xref: /netbsd-src/external/gpl3/gcc.old/dist/gcc/fortran/gfortran.info (revision 82d56013d7b633d116a93943de88e08335357a7c)
1This is gfortran.info, produced by makeinfo version 6.5 from
2gfortran.texi.
3
4Copyright (C) 1999-2019 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-2019 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. Note that this is an
307experimental feature, incomplete, and subject to change in future
308versions of GCC. See <https://gcc.gnu.org/wiki/OpenACC> for more
309information.
310
311   At present, the GNU Fortran compiler passes the NIST Fortran 77 Test
312Suite (http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html), and
313produces acceptable results on the LAPACK Test Suite
314(http://www.netlib.org/lapack/faq.html#1.21).  It also provides
315respectable performance on the Polyhedron Fortran compiler benchmarks
316(http://www.polyhedron.com/fortran-compiler-comparisons/polyhedron-benchmark-suite)
317and the Livermore Fortran Kernels test
318(http://www.netlib.org/benchmark/livermore).  It has been used to
319compile a number of large real-world programs, including the HARMONIE
320and HIRLAM weather forecasting code (http://hirlam.org/) and the Tonto
321quantum chemistry package
322(http://physical-chemistry.scb.uwa.edu.au/tonto/wiki/index.php/Main_Page);
323see <https://gcc.gnu.org/wiki/GfortranApps> for an extended list.
324
325   Among other things, the GNU Fortran compiler is intended as a
326replacement for G77.  At this point, nearly all programs that could be
327compiled with G77 can be compiled with GNU Fortran, although there are a
328few minor known regressions.
329
330   The primary work remaining to be done on GNU Fortran falls into three
331categories: bug fixing (primarily regarding the treatment of invalid
332code and providing useful error messages), improving the compiler
333optimizations and the performance of compiled code, and extending the
334compiler to support future standards--in particular, Fortran 2003,
335Fortran 2008 and Fortran 2018.
336
337
338File: gfortran.info,  Node: Standards,  Prev: Project Status,  Up: Introduction
339
3401.6 Standards
341=============
342
343* Menu:
344
345* Varying Length Character Strings::
346
347The GNU Fortran compiler implements ISO/IEC 1539:1997 (Fortran 95).  As
348such, it can also compile essentially all standard-compliant Fortran 90
349and Fortran 77 programs.  It also supports the ISO/IEC TR-15581
350enhancements to allocatable arrays.
351
352   GNU Fortran also have a partial support for ISO/IEC 1539-1:2004
353(Fortran 2003), ISO/IEC 1539-1:2010 (Fortran 2008), the Technical
354Specification 'Further Interoperability of Fortran with C' (ISO/IEC TS
35529113:2012).  Full support of those standards and future Fortran
356standards is planned.  The current status of the support is can be found
357in the *note Fortran 2003 status::, *note Fortran 2008 status:: and
358*note Fortran 2018 status:: sections of the documentation.
359
360   Additionally, the GNU Fortran compilers supports the OpenMP
361specification (version 4.0 and most of the features of the 4.5 version,
362<http://openmp.org/wp/openmp-specifications/>).  There also is initial
363support for the OpenACC specification (targeting version 2.0,
364<http://www.openacc.org/>).  Note that this is an experimental feature,
365incomplete, and subject to change in future versions of GCC. See
366<https://gcc.gnu.org/wiki/OpenACC> for more information.
367
368
369File: gfortran.info,  Node: Varying Length Character Strings,  Up: Standards
370
3711.6.1 Varying Length Character Strings
372--------------------------------------
373
374The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000)
375varying length character strings.  While GNU Fortran currently does not
376support such strings directly, there exist two Fortran implementations
377for them, which work with GNU Fortran.  They can be found at
378<http://www.fortran.com/iso_varying_string.f95> and at
379<ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/>.
380
381   Deferred-length character strings of Fortran 2003 supports part of
382the features of 'ISO_VARYING_STRING' and should be considered as
383replacement.  (Namely, allocatable or pointers of the type
384'character(len=:)'.)
385
386
387File: gfortran.info,  Node: Invoking GNU Fortran,  Next: Runtime,  Prev: Introduction,  Up: Top
388
3892 GNU Fortran Command Options
390*****************************
391
392The 'gfortran' command supports all the options supported by the 'gcc'
393command.  Only options specific to GNU Fortran are documented here.
394
395   *Note GCC Command Options: (gcc)Invoking GCC, for information on the
396non-Fortran-specific aspects of the 'gcc' command (and, therefore, the
397'gfortran' command).
398
399   All GCC and GNU Fortran options are accepted both by 'gfortran' and
400by 'gcc' (as well as any other drivers built at the same time, such as
401'g++'), since adding GNU Fortran to the GCC distribution enables
402acceptance of GNU Fortran options by all of the relevant drivers.
403
404   In some cases, options have positive and negative forms; the negative
405form of '-ffoo' would be '-fno-foo'.  This manual documents only one of
406these two forms, whichever one is not the default.
407
408* Menu:
409
410* Option Summary::      Brief list of all 'gfortran' options,
411                        without explanations.
412* Fortran Dialect Options::  Controlling the variant of Fortran language
413                             compiled.
414* Preprocessing Options::  Enable and customize preprocessing.
415* Error and Warning Options::     How picky should the compiler be?
416* Debugging Options::   Symbol tables, measurements, and debugging dumps.
417* Directory Options::   Where to find module files
418* Link Options ::       Influencing the linking step
419* Runtime Options::     Influencing runtime behavior
420* Code Gen Options::    Specifying conventions for function calls, data layout
421                        and register usage.
422* Interoperability Options::  Options for interoperability with other
423                              languages.
424* Environment Variables:: Environment variables that affect 'gfortran'.
425
426
427File: gfortran.info,  Node: Option Summary,  Next: Fortran Dialect Options,  Up: Invoking GNU Fortran
428
4292.1 Option summary
430==================
431
432Here is a summary of all the options specific to GNU Fortran, grouped by
433type.  Explanations are in the following sections.
434
435_Fortran Language Options_
436     *Note Options controlling Fortran dialect: Fortran Dialect Options.
437          -fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code
438          -fd-lines-as-comments
439          -fdec -fdec-structure -fdec-intrinsic-ints -fdec-static -fdec-math
440          -fdec-include -fdefault-double-8 -fdefault-integer-8 -fdefault-real-8
441          -fdefault-real-10 -fdefault-real-16 -fdollar-ok -ffixed-line-length-N
442          -ffixed-line-length-none -fpad-source -ffree-form -ffree-line-length-N
443          -ffree-line-length-none -fimplicit-none -finteger-4-integer-8
444          -fmax-identifier-length -fmodule-private -ffixed-form -fno-range-check
445          -fopenacc -fopenmp -freal-4-real-10 -freal-4-real-16 -freal-4-real-8
446          -freal-8-real-10 -freal-8-real-16 -freal-8-real-4 -std=STD
447          -ftest-forall-temp
448
449
450_Preprocessing Options_
451     *Note Enable and customize preprocessing: Preprocessing Options.
452          -A-QUESTION[=ANSWER]
453          -AQUESTION=ANSWER -C -CC -DMACRO[=DEFN]
454          -H -P
455          -UMACRO -cpp -dD -dI -dM -dN -dU -fworking-directory
456          -imultilib DIR
457          -iprefix FILE -iquote -isysroot DIR -isystem DIR -nocpp
458          -nostdinc
459          -undef
460
461
462_Error and Warning Options_
463     *Note Options to request or suppress errors and warnings: Error and
464     Warning Options.
465          -Waliasing -Wall -Wampersand -Wargument-mismatch -Warray-bounds
466          -Wc-binding-type -Wcharacter-truncation -Wconversion
467          -Wdo-subscript -Wfunction-elimination -Wimplicit-interface
468          -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only -Wintrinsics-std
469          -Wline-truncation -Wno-align-commons -Wno-tabs -Wreal-q-constant
470          -Wsurprising -Wunderflow -Wunused-parameter -Wrealloc-lhs
471          -Wrealloc-lhs-all -Wfrontend-loop-interchange -Wtarget-lifetime
472          -fmax-errors=N -fsyntax-only -pedantic -pedantic-errors
473
474
475_Debugging Options_
476     *Note Options for debugging your program or GNU Fortran: Debugging
477     Options.
478          -fbacktrace -fdump-fortran-optimized -fdump-fortran-original
479          -fdump-fortran-global -fdump-parse-tree -ffpe-trap=LIST
480          -ffpe-summary=LIST
481
482
483_Directory Options_
484     *Note Options for directory search: Directory Options.
485          -IDIR  -JDIR -fintrinsic-modules-path DIR
486
487_Link Options_
488     *Note Options for influencing the linking step: Link Options.
489          -static-libgfortran
490
491_Runtime Options_
492     *Note Options for influencing runtime behavior: Runtime Options.
493          -fconvert=CONVERSION -fmax-subrecord-length=LENGTH
494          -frecord-marker=LENGTH -fsign-zero
495
496
497_Interoperability Options_
498     *Note Options for interoperability: Interoperability Options.
499          -fc-prototypes -fc-prototypes-external
500
501_Code Generation Options_
502     *Note Options for code generation conventions: Code Gen Options.
503          -faggressive-function-elimination -fblas-matmul-limit=N
504          -fbounds-check -ftail-call-workaround -ftail-call-workaround=N
505          -fcheck-array-temporaries
506          -fcheck=<ALL|ARRAY-TEMPS|BOUNDS|DO|MEM|POINTER|RECURSION>
507          -fcoarray=<NONE|SINGLE|LIB> -fexternal-blas -ff2c
508          -ffrontend-loop-interchange
509          -ffrontend-optimize
510          -finit-character=N -finit-integer=N -finit-local-zero
511          -finit-derived
512          -finit-logical=<TRUE|FALSE>
513          -finit-real=<ZERO|INF|-INF|NAN|SNAN>
514          -finline-matmul-limit=N
515          -fmax-array-constructor=N -fmax-stack-var-size=N
516          -fno-align-commons
517          -fno-automatic -fno-protect-parens -fno-underscoring
518          -fsecond-underscore -fpack-derived -frealloc-lhs -frecursive
519          -frepack-arrays -fshort-enums -fstack-arrays
520
521
522
523File: gfortran.info,  Node: Fortran Dialect Options,  Next: Preprocessing Options,  Prev: Option Summary,  Up: Invoking GNU Fortran
524
5252.2 Options controlling Fortran dialect
526=======================================
527
528The following options control the details of the Fortran dialect
529accepted by the compiler:
530
531'-ffree-form'
532'-ffixed-form'
533     Specify the layout used by the source file.  The free form layout
534     was introduced in Fortran 90.  Fixed form was traditionally used in
535     older Fortran programs.  When neither option is specified, the
536     source form is determined by the file extension.
537
538'-fall-intrinsics'
539     This option causes all intrinsic procedures (including the
540     GNU-specific extensions) to be accepted.  This can be useful with
541     '-std=f95' to force standard-compliance but get access to the full
542     range of intrinsics available with 'gfortran'.  As a consequence,
543     '-Wintrinsics-std' will be ignored and no user-defined procedure
544     with the same name as any intrinsic will be called except when it
545     is explicitly declared 'EXTERNAL'.
546
547'-fd-lines-as-code'
548'-fd-lines-as-comments'
549     Enable special treatment for lines beginning with 'd' or 'D' in
550     fixed form sources.  If the '-fd-lines-as-code' option is given
551     they are treated as if the first column contained a blank.  If the
552     '-fd-lines-as-comments' option is given, they are treated as
553     comment lines.
554
555'-fdec'
556     DEC compatibility mode.  Enables extensions and other features that
557     mimic the default behavior of older compilers (such as DEC). These
558     features are non-standard and should be avoided at all costs.  For
559     details on GNU Fortran's implementation of these extensions see the
560     full documentation.
561
562     Other flags enabled by this switch are: '-fdollar-ok'
563     '-fcray-pointer' '-fdec-structure' '-fdec-intrinsic-ints'
564     '-fdec-static' '-fdec-math'
565
566     If '-fd-lines-as-code'/'-fd-lines-as-comments' are unset, then
567     '-fdec' also sets '-fd-lines-as-comments'.
568
569'-fdec-structure'
570     Enable DEC 'STRUCTURE' and 'RECORD' as well as 'UNION', 'MAP', and
571     dot ('.')  as a member separator (in addition to '%').  This is
572     provided for compatibility only; Fortran 90 derived types should be
573     used instead where possible.
574
575'-fdec-intrinsic-ints'
576     Enable B/I/J/K kind variants of existing integer functions (e.g.
577     BIAND, IIAND, JIAND, etc...).  For a complete list of intrinsics
578     see the full documentation.
579
580'-fdec-math'
581     Enable legacy math intrinsics such as COTAN and degree-valued
582     trigonometric functions (e.g.  TAND, ATAND, etc...)  for
583     compatability with older code.
584
585'-fdec-static'
586     Enable DEC-style STATIC and AUTOMATIC attributes to explicitly
587     specify the storage of variables and other objects.
588
589'-fdec-include'
590     Enable parsing of INCLUDE as a statement in addition to parsing it
591     as INCLUDE line.  When parsed as INCLUDE statement, INCLUDE does
592     not have to be on a single line and can use line continuations.
593
594'-fdollar-ok'
595     Allow '$' as a valid non-first character in a symbol name.  Symbols
596     that start with '$' are rejected since it is unclear which rules to
597     apply to implicit typing as different vendors implement different
598     rules.  Using '$' in 'IMPLICIT' statements is also rejected.
599
600'-fbackslash'
601     Change the interpretation of backslashes in string literals from a
602     single backslash character to "C-style" escape characters.  The
603     following combinations are expanded '\a', '\b', '\f', '\n', '\r',
604     '\t', '\v', '\\', and '\0' to the ASCII characters alert,
605     backspace, form feed, newline, carriage return, horizontal tab,
606     vertical tab, backslash, and NUL, respectively.  Additionally,
607     '\x'NN, '\u'NNNN and '\U'NNNNNNNN (where each N is a hexadecimal
608     digit) are translated into the Unicode characters corresponding to
609     the specified code points.  All other combinations of a character
610     preceded by \ are unexpanded.
611
612'-fmodule-private'
613     Set the default accessibility of module entities to 'PRIVATE'.
614     Use-associated entities will not be accessible unless they are
615     explicitly declared as 'PUBLIC'.
616
617'-ffixed-line-length-N'
618     Set column after which characters are ignored in typical fixed-form
619     lines in the source file, and, unless '-fno-pad-source', through
620     which spaces are assumed (as if padded to that length) after the
621     ends of short fixed-form lines.
622
623     Popular values for N include 72 (the standard and the default), 80
624     (card image), and 132 (corresponding to "extended-source" options
625     in some popular compilers).  N may also be 'none', meaning that the
626     entire line is meaningful and that continued character constants
627     never have implicit spaces appended to them to fill out the line.
628     '-ffixed-line-length-0' means the same thing as
629     '-ffixed-line-length-none'.
630
631'-fno-pad-source'
632     By default fixed-form lines have spaces assumed (as if padded to
633     that length) after the ends of short fixed-form lines.  This is not
634     done either if '-ffixed-line-length-0', '-ffixed-line-length-none'
635     or if '-fno-pad-source' option is used.  With any of those options
636     continued character constants never have implicit spaces appended
637     to them to fill out the line.
638
639'-ffree-line-length-N'
640     Set column after which characters are ignored in typical free-form
641     lines in the source file.  The default value is 132.  N may be
642     'none', meaning that the entire line is meaningful.
643     '-ffree-line-length-0' means the same thing as
644     '-ffree-line-length-none'.
645
646'-fmax-identifier-length=N'
647     Specify the maximum allowed identifier length.  Typical values are
648     31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008).
649
650'-fimplicit-none'
651     Specify that no implicit typing is allowed, unless overridden by
652     explicit 'IMPLICIT' statements.  This is the equivalent of adding
653     'implicit none' to the start of every procedure.
654
655'-fcray-pointer'
656     Enable the Cray pointer extension, which provides C-like pointer
657     functionality.
658
659'-fopenacc'
660     Enable the OpenACC extensions.  This includes OpenACC '!$acc'
661     directives in free form and 'c$acc', '*$acc' and '!$acc' directives
662     in fixed form, '!$' conditional compilation sentinels in free form
663     and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
664     arranges for the OpenACC runtime library to be linked in.
665
666     Note that this is an experimental feature, incomplete, and subject
667     to change in future versions of GCC. See
668     <https://gcc.gnu.org/wiki/OpenACC> for more information.
669
670'-fopenmp'
671     Enable the OpenMP extensions.  This includes OpenMP '!$omp'
672     directives in free form and 'c$omp', '*$omp' and '!$omp' directives
673     in fixed form, '!$' conditional compilation sentinels in free form
674     and 'c$', '*$' and '!$' sentinels in fixed form, and when linking
675     arranges for the OpenMP runtime library to be linked in.  The
676     option '-fopenmp' implies '-frecursive'.
677
678'-fno-range-check'
679     Disable range checking on results of simplification of constant
680     expressions during compilation.  For example, GNU Fortran will give
681     an error at compile time when simplifying 'a = 1. / 0'.  With this
682     option, no error will be given and 'a' will be assigned the value
683     '+Infinity'.  If an expression evaluates to a value outside of the
684     relevant range of ['-HUGE()':'HUGE()'], then the expression will be
685     replaced by '-Inf' or '+Inf' as appropriate.  Similarly, 'DATA
686     i/Z'FFFFFFFF'/' will result in an integer overflow on most systems,
687     but with '-fno-range-check' the value will "wrap around" and 'i'
688     will be initialized to -1 instead.
689
690'-fdefault-integer-8'
691     Set the default integer and logical types to an 8 byte wide type.
692     This option also affects the kind of integer constants like '42'.
693     Unlike '-finteger-4-integer-8', it does not promote variables with
694     explicit kind declaration.
695
696'-fdefault-real-8'
697     Set the default real type to an 8 byte wide type.  This option also
698     affects the kind of non-double real constants like '1.0'.  This
699     option promotes the default width of 'DOUBLE PRECISION' and double
700     real constants like '1.d0' to 16 bytes if possible.  If
701     '-fdefault-double-8' is given along with 'fdefault-real-8', 'DOUBLE
702     PRECISION' and double real constants are not promoted.  Unlike
703     '-freal-4-real-8', 'fdefault-real-8' does not promote variables
704     with explicit kind declarations.
705
706'-fdefault-real-10'
707     Set the default real type to an 10 byte wide type.  This option
708     also affects the kind of non-double real constants like '1.0'.
709     This option promotes the default width of 'DOUBLE PRECISION' and
710     double real constants like '1.d0' to 16 bytes if possible.  If
711     '-fdefault-double-8' is given along with 'fdefault-real-10',
712     'DOUBLE PRECISION' and double real constants are not promoted.
713     Unlike '-freal-4-real-10', 'fdefault-real-10' does not promote
714     variables with explicit kind declarations.
715
716'-fdefault-real-16'
717     Set the default real type to an 16 byte wide type.  This option
718     also affects the kind of non-double real constants like '1.0'.
719     This option promotes the default width of 'DOUBLE PRECISION' and
720     double real constants like '1.d0' to 16 bytes if possible.  If
721     '-fdefault-double-8' is given along with 'fdefault-real-16',
722     'DOUBLE PRECISION' and double real constants are not promoted.
723     Unlike '-freal-4-real-16', 'fdefault-real-16' does not promote
724     variables with explicit kind declarations.
725
726'-fdefault-double-8'
727     Set the 'DOUBLE PRECISION' type and double real constants like
728     '1.d0' to an 8 byte wide type.  Do nothing if this is already the
729     default.  This option prevents '-fdefault-real-8',
730     '-fdefault-real-10', and '-fdefault-real-16', from promoting
731     'DOUBLE PRECISION' and double real constants like '1.d0' to 16
732     bytes.
733
734'-finteger-4-integer-8'
735     Promote all 'INTEGER(KIND=4)' entities to an 'INTEGER(KIND=8)'
736     entities.  If 'KIND=8' is unavailable, then an error will be
737     issued.  This option should be used with care and may not be
738     suitable for your codes.  Areas of possible concern include calls
739     to external procedures, alignment in 'EQUIVALENCE' and/or 'COMMON',
740     generic interfaces, BOZ literal constant conversion, and I/O.
741     Inspection of the intermediate representation of the translated
742     Fortran code, produced by '-fdump-tree-original', is suggested.
743
744'-freal-4-real-8'
745'-freal-4-real-10'
746'-freal-4-real-16'
747'-freal-8-real-4'
748'-freal-8-real-10'
749'-freal-8-real-16'
750     Promote all 'REAL(KIND=M)' entities to 'REAL(KIND=N)' entities.  If
751     'REAL(KIND=N)' is unavailable, then an error will be issued.  All
752     other real kind types are unaffected by this option.  These options
753     should be used with care and may not be suitable for your codes.
754     Areas of possible concern include calls to external procedures,
755     alignment in 'EQUIVALENCE' and/or 'COMMON', generic interfaces, BOZ
756     literal constant conversion, and I/O. Inspection of the
757     intermediate representation of the translated Fortran code,
758     produced by '-fdump-tree-original', is suggested.
759
760'-std=STD'
761     Specify the standard to which the program is expected to conform,
762     which may be one of 'f95', 'f2003', 'f2008', 'f2018', 'gnu', or
763     'legacy'.  The default value for STD is 'gnu', which specifies a
764     superset of the latest Fortran standard that includes all of the
765     extensions supported by GNU Fortran, although warnings will be
766     given for obsolete extensions not recommended for use in new code.
767     The 'legacy' value is equivalent but without the warnings for
768     obsolete extensions, and may be useful for old non-standard
769     programs.  The 'f95', 'f2003', 'f2008', and 'f2018' values specify
770     strict conformance to the Fortran 95, Fortran 2003, Fortran 2008
771     and Fortran 2018 standards, respectively; errors are given for all
772     extensions beyond the relevant language standard, and warnings are
773     given for the Fortran 77 features that are permitted but
774     obsolescent in later standards.  The deprecated option
775     '-std=f2008ts' acts as an alias for '-std=f2018'.  It is only
776     present for backwards compatibility with earlier gfortran versions
777     and should not be used any more.
778
779'-ftest-forall-temp'
780     Enhance test coverage by forcing most forall assignments to use
781     temporary.
782
783
784File: gfortran.info,  Node: Preprocessing Options,  Next: Error and Warning Options,  Prev: Fortran Dialect Options,  Up: Invoking GNU Fortran
785
7862.3 Enable and customize preprocessing
787======================================
788
789Preprocessor related options.  See section *note Preprocessing and
790conditional compilation:: for more detailed information on preprocessing
791in 'gfortran'.
792
793'-cpp'
794'-nocpp'
795     Enable preprocessing.  The preprocessor is automatically invoked if
796     the file extension is '.fpp', '.FPP', '.F', '.FOR', '.FTN', '.F90',
797     '.F95', '.F03' or '.F08'.  Use this option to manually enable
798     preprocessing of any kind of Fortran file.
799
800     To disable preprocessing of files with any of the above listed
801     extensions, use the negative form: '-nocpp'.
802
803     The preprocessor is run in traditional mode.  Any restrictions of
804     the file-format, especially the limits on line length, apply for
805     preprocessed output as well, so it might be advisable to use the
806     '-ffree-line-length-none' or '-ffixed-line-length-none' options.
807
808'-dM'
809     Instead of the normal output, generate a list of ''#define''
810     directives for all the macros defined during the execution of the
811     preprocessor, including predefined macros.  This gives you a way of
812     finding out what is predefined in your version of the preprocessor.
813     Assuming you have no file 'foo.f90', the command
814            touch foo.f90; gfortran -cpp -E -dM foo.f90
815     will show all the predefined macros.
816
817'-dD'
818     Like '-dM' except in two respects: it does not include the
819     predefined macros, and it outputs both the '#define' directives and
820     the result of preprocessing.  Both kinds of output go to the
821     standard output file.
822
823'-dN'
824     Like '-dD', but emit only the macro names, not their expansions.
825
826'-dU'
827     Like 'dD' except that only macros that are expanded, or whose
828     definedness is tested in preprocessor directives, are output; the
829     output is delayed until the use or test of the macro; and
830     ''#undef'' directives are also output for macros tested but
831     undefined at the time.
832
833'-dI'
834     Output ''#include'' directives in addition to the result of
835     preprocessing.
836
837'-fworking-directory'
838     Enable generation of linemarkers in the preprocessor output that
839     will let the compiler know the current working directory at the
840     time of preprocessing.  When this option is enabled, the
841     preprocessor will emit, after the initial linemarker, a second
842     linemarker with the current working directory followed by two
843     slashes.  GCC will use this directory, when it is present in the
844     preprocessed input, as the directory emitted as the current working
845     directory in some debugging information formats.  This option is
846     implicitly enabled if debugging information is enabled, but this
847     can be inhibited with the negated form '-fno-working-directory'.
848     If the '-P' flag is present in the command line, this option has no
849     effect, since no '#line' directives are emitted whatsoever.
850
851'-idirafter DIR'
852     Search DIR for include files, but do it after all directories
853     specified with '-I' and the standard system directories have been
854     exhausted.  DIR is treated as a system include directory.  If dir
855     begins with '=', then the '=' will be replaced by the sysroot
856     prefix; see '--sysroot' and '-isysroot'.
857
858'-imultilib DIR'
859     Use DIR as a subdirectory of the directory containing
860     target-specific C++ headers.
861
862'-iprefix PREFIX'
863     Specify PREFIX as the prefix for subsequent '-iwithprefix' options.
864     If the PREFIX represents a directory, you should include the final
865     ''/''.
866
867'-isysroot DIR'
868     This option is like the '--sysroot' option, but applies only to
869     header files.  See the '--sysroot' option for more information.
870
871'-iquote DIR'
872     Search DIR only for header files requested with '#include "file"';
873     they are not searched for '#include <file>', before all directories
874     specified by '-I' and before the standard system directories.  If
875     DIR begins with '=', then the '=' will be replaced by the sysroot
876     prefix; see '--sysroot' and '-isysroot'.
877
878'-isystem DIR'
879     Search DIR for header files, after all directories specified by
880     '-I' but before the standard system directories.  Mark it as a
881     system directory, so that it gets the same special treatment as is
882     applied to the standard system directories.  If DIR begins with
883     '=', then the '=' will be replaced by the sysroot prefix; see
884     '--sysroot' and '-isysroot'.
885
886'-nostdinc'
887     Do not search the standard system directories for header files.
888     Only the directories you have specified with '-I' options (and the
889     directory of the current file, if appropriate) are searched.
890
891'-undef'
892     Do not predefine any system-specific or GCC-specific macros.  The
893     standard predefined macros remain defined.
894
895'-APREDICATE=ANSWER'
896     Make an assertion with the predicate PREDICATE and answer ANSWER.
897     This form is preferred to the older form -A predicate(answer),
898     which is still supported, because it does not use shell special
899     characters.
900
901'-A-PREDICATE=ANSWER'
902     Cancel an assertion with the predicate PREDICATE and answer ANSWER.
903
904'-C'
905     Do not discard comments.  All comments are passed through to the
906     output file, except for comments in processed directives, which are
907     deleted along with the directive.
908
909     You should be prepared for side effects when using '-C'; it causes
910     the preprocessor to treat comments as tokens in their own right.
911     For example, comments appearing at the start of what would be a
912     directive line have the effect of turning that line into an
913     ordinary source line, since the first token on the line is no
914     longer a ''#''.
915
916     Warning: this currently handles C-Style comments only.  The
917     preprocessor does not yet recognize Fortran-style comments.
918
919'-CC'
920     Do not discard comments, including during macro expansion.  This is
921     like '-C', except that comments contained within macros are also
922     passed through to the output file where the macro is expanded.
923
924     In addition to the side-effects of the '-C' option, the '-CC'
925     option causes all C++-style comments inside a macro to be converted
926     to C-style comments.  This is to prevent later use of that macro
927     from inadvertently commenting out the remainder of the source line.
928     The '-CC' option is generally used to support lint comments.
929
930     Warning: this currently handles C- and C++-Style comments only.
931     The preprocessor does not yet recognize Fortran-style comments.
932
933'-DNAME'
934     Predefine name as a macro, with definition '1'.
935
936'-DNAME=DEFINITION'
937     The contents of DEFINITION are tokenized and processed as if they
938     appeared during translation phase three in a ''#define'' directive.
939     In particular, the definition will be truncated by embedded newline
940     characters.
941
942     If you are invoking the preprocessor from a shell or shell-like
943     program you may need to use the shell's quoting syntax to protect
944     characters such as spaces that have a meaning in the shell syntax.
945
946     If you wish to define a function-like macro on the command line,
947     write its argument list with surrounding parentheses before the
948     equals sign (if any).  Parentheses are meaningful to most shells,
949     so you will need to quote the option.  With sh and csh,
950     '-D'name(args...)=definition'' works.
951
952     '-D' and '-U' options are processed in the order they are given on
953     the command line.  All -imacros file and -include file options are
954     processed after all -D and -U options.
955
956'-H'
957     Print the name of each header file used, in addition to other
958     normal activities.  Each name is indented to show how deep in the
959     ''#include'' stack it is.
960
961'-P'
962     Inhibit generation of linemarkers in the output from the
963     preprocessor.  This might be useful when running the preprocessor
964     on something that is not C code, and will be sent to a program
965     which might be confused by the linemarkers.
966
967'-UNAME'
968     Cancel any previous definition of NAME, either built in or provided
969     with a '-D' option.
970
971
972File: gfortran.info,  Node: Error and Warning Options,  Next: Debugging Options,  Prev: Preprocessing Options,  Up: Invoking GNU Fortran
973
9742.4 Options to request or suppress errors and warnings
975======================================================
976
977Errors are diagnostic messages that report that the GNU Fortran compiler
978cannot compile the relevant piece of source code.  The compiler will
979continue to process the program in an attempt to report further errors
980to aid in debugging, but will not produce any compiled output.
981
982   Warnings are diagnostic messages that report constructions which are
983not inherently erroneous but which are risky or suggest there is likely
984to be a bug in the program.  Unless '-Werror' is specified, they do not
985prevent compilation of the program.
986
987   You can request many specific warnings with options beginning '-W',
988for example '-Wimplicit' to request warnings on implicit declarations.
989Each of these specific warning options also has a negative form
990beginning '-Wno-' to turn off warnings; for example, '-Wno-implicit'.
991This manual lists only one of the two forms, whichever is not the
992default.
993
994   These options control the amount and kinds of errors and warnings
995produced by GNU Fortran:
996
997'-fmax-errors=N'
998     Limits the maximum number of error messages to N, at which point
999     GNU Fortran bails out rather than attempting to continue processing
1000     the source code.  If N is 0, there is no limit on the number of
1001     error messages produced.
1002
1003'-fsyntax-only'
1004     Check the code for syntax errors, but do not actually compile it.
1005     This will generate module files for each module present in the
1006     code, but no other output file.
1007
1008'-Wpedantic'
1009'-pedantic'
1010     Issue warnings for uses of extensions to Fortran.  '-pedantic' also
1011     applies to C-language constructs where they occur in GNU Fortran
1012     source files, such as use of '\e' in a character constant within a
1013     directive like '#include'.
1014
1015     Valid Fortran programs should compile properly with or without this
1016     option.  However, without this option, certain GNU extensions and
1017     traditional Fortran features are supported as well.  With this
1018     option, many of them are rejected.
1019
1020     Some users try to use '-pedantic' to check programs for
1021     conformance.  They soon find that it does not do quite what they
1022     want--it finds some nonstandard practices, but not all.  However,
1023     improvements to GNU Fortran in this area are welcome.
1024
1025     This should be used in conjunction with '-std=f95', '-std=f2003',
1026     '-std=f2008' or '-std=f2018'.
1027
1028'-pedantic-errors'
1029     Like '-pedantic', except that errors are produced rather than
1030     warnings.
1031
1032'-Wall'
1033     Enables commonly used warning options pertaining to usage that we
1034     recommend avoiding and that we believe are easy to avoid.  This
1035     currently includes '-Waliasing', '-Wampersand', '-Wconversion',
1036     '-Wsurprising', '-Wc-binding-type', '-Wintrinsics-std', '-Wtabs',
1037     '-Wintrinsic-shadow', '-Wline-truncation', '-Wtarget-lifetime',
1038     '-Winteger-division', '-Wreal-q-constant', '-Wunused' and
1039     '-Wundefined-do-loop'.
1040
1041'-Waliasing'
1042     Warn about possible aliasing of dummy arguments.  Specifically, it
1043     warns if the same actual argument is associated with a dummy
1044     argument with 'INTENT(IN)' and a dummy argument with 'INTENT(OUT)'
1045     in a call with an explicit interface.
1046
1047     The following example will trigger the warning.
1048            interface
1049              subroutine bar(a,b)
1050                integer, intent(in) :: a
1051                integer, intent(out) :: b
1052              end subroutine
1053            end interface
1054            integer :: a
1055
1056            call bar(a,a)
1057
1058'-Wampersand'
1059     Warn about missing ampersand in continued character constants.  The
1060     warning is given with '-Wampersand', '-pedantic', '-std=f95',
1061     '-std=f2003', '-std=f2008' and '-std=f2018'.  Note: With no
1062     ampersand given in a continued character constant, GNU Fortran
1063     assumes continuation at the first non-comment, non-whitespace
1064     character after the ampersand that initiated the continuation.
1065
1066'-Wargument-mismatch'
1067     Warn about type, rank, and other mismatches between formal
1068     parameters and actual arguments to functions and subroutines.
1069     These warnings are recommended and thus enabled by default.
1070
1071'-Warray-temporaries'
1072     Warn about array temporaries generated by the compiler.  The
1073     information generated by this warning is sometimes useful in
1074     optimization, in order to avoid such temporaries.
1075
1076'-Wc-binding-type'
1077     Warn if the a variable might not be C interoperable.  In
1078     particular, warn if the variable has been declared using an
1079     intrinsic type with default kind instead of using a kind parameter
1080     defined for C interoperability in the intrinsic 'ISO_C_Binding'
1081     module.  This option is implied by '-Wall'.
1082
1083'-Wcharacter-truncation'
1084     Warn when a character assignment will truncate the assigned string.
1085
1086'-Wline-truncation'
1087     Warn when a source code line will be truncated.  This option is
1088     implied by '-Wall'.  For free-form source code, the default is
1089     '-Werror=line-truncation' such that truncations are reported as
1090     error.
1091
1092'-Wconversion'
1093     Warn about implicit conversions that are likely to change the value
1094     of the expression after conversion.  Implied by '-Wall'.
1095
1096'-Wconversion-extra'
1097     Warn about implicit conversions between different types and kinds.
1098     This option does _not_ imply '-Wconversion'.
1099
1100'-Wextra'
1101     Enables some warning options for usages of language features which
1102     may be problematic.  This currently includes '-Wcompare-reals',
1103     '-Wunused-parameter' and '-Wdo-subscript'.
1104
1105'-Wfrontend-loop-interchange'
1106     Enable warning for loop interchanges performed by the
1107     '-ffrontend-loop-interchange' option.
1108
1109'-Wimplicit-interface'
1110     Warn if a procedure is called without an explicit interface.  Note
1111     this only checks that an explicit interface is present.  It does
1112     not check that the declared interfaces are consistent across
1113     program units.
1114
1115'-Wimplicit-procedure'
1116     Warn if a procedure is called that has neither an explicit
1117     interface nor has been declared as 'EXTERNAL'.
1118
1119'-Winteger-division'
1120     Warn if a constant integer division truncates it result.  As an
1121     example, 3/5 evaluates to 0.
1122
1123'-Wintrinsics-std'
1124     Warn if 'gfortran' finds a procedure named like an intrinsic not
1125     available in the currently selected standard (with '-std') and
1126     treats it as 'EXTERNAL' procedure because of this.
1127     '-fall-intrinsics' can be used to never trigger this behavior and
1128     always link to the intrinsic regardless of the selected standard.
1129
1130'-Wreal-q-constant'
1131     Produce a warning if a real-literal-constant contains a 'q'
1132     exponent-letter.
1133
1134'-Wsurprising'
1135     Produce a warning when "suspicious" code constructs are
1136     encountered.  While technically legal these usually indicate that
1137     an error has been made.
1138
1139     This currently produces a warning under the following
1140     circumstances:
1141
1142        * An INTEGER SELECT construct has a CASE that can never be
1143          matched as its lower value is greater than its upper value.
1144
1145        * A LOGICAL SELECT construct has three CASE statements.
1146
1147        * A TRANSFER specifies a source that is shorter than the
1148          destination.
1149
1150        * The type of a function result is declared more than once with
1151          the same type.  If '-pedantic' or standard-conforming mode is
1152          enabled, this is an error.
1153
1154        * A 'CHARACTER' variable is declared with negative length.
1155
1156'-Wtabs'
1157     By default, tabs are accepted as whitespace, but tabs are not
1158     members of the Fortran Character Set.  For continuation lines, a
1159     tab followed by a digit between 1 and 9 is supported.  '-Wtabs'
1160     will cause a warning to be issued if a tab is encountered.  Note,
1161     '-Wtabs' is active for '-pedantic', '-std=f95', '-std=f2003',
1162     '-std=f2008', '-std=f2018' and '-Wall'.
1163
1164'-Wundefined-do-loop'
1165     Warn if a DO loop with step either 1 or -1 yields an underflow or
1166     an overflow during iteration of an induction variable of the loop.
1167     This option is implied by '-Wall'.
1168
1169'-Wunderflow'
1170     Produce a warning when numerical constant expressions are
1171     encountered, which yield an UNDERFLOW during compilation.  Enabled
1172     by default.
1173
1174'-Wintrinsic-shadow'
1175     Warn if a user-defined procedure or module procedure has the same
1176     name as an intrinsic; in this case, an explicit interface or
1177     'EXTERNAL' or 'INTRINSIC' declaration might be needed to get calls
1178     later resolved to the desired intrinsic/procedure.  This option is
1179     implied by '-Wall'.
1180
1181'-Wuse-without-only'
1182     Warn if a 'USE' statement has no 'ONLY' qualifier and thus
1183     implicitly imports all public entities of the used module.
1184
1185'-Wunused-dummy-argument'
1186     Warn about unused dummy arguments.  This option is implied by
1187     '-Wall'.
1188
1189'-Wunused-parameter'
1190     Contrary to 'gcc''s meaning of '-Wunused-parameter', 'gfortran''s
1191     implementation of this option does not warn about unused dummy
1192     arguments (see '-Wunused-dummy-argument'), but about unused
1193     'PARAMETER' values.  '-Wunused-parameter' is implied by '-Wextra'
1194     if also '-Wunused' or '-Wall' is used.
1195
1196'-Walign-commons'
1197     By default, 'gfortran' warns about any occasion of variables being
1198     padded for proper alignment inside a 'COMMON' block.  This warning
1199     can be turned off via '-Wno-align-commons'.  See also
1200     '-falign-commons'.
1201
1202'-Wfunction-elimination'
1203     Warn if any calls to impure functions are eliminated by the
1204     optimizations enabled by the '-ffrontend-optimize' option.  This
1205     option is implied by '-Wextra'.
1206
1207'-Wrealloc-lhs'
1208     Warn when the compiler might insert code to for allocation or
1209     reallocation of an allocatable array variable of intrinsic type in
1210     intrinsic assignments.  In hot loops, the Fortran 2003 reallocation
1211     feature may reduce the performance.  If the array is already
1212     allocated with the correct shape, consider using a whole-array
1213     array-spec (e.g.  '(:,:,:)') for the variable on the left-hand side
1214     to prevent the reallocation check.  Note that in some cases the
1215     warning is shown, even if the compiler will optimize reallocation
1216     checks away.  For instance, when the right-hand side contains the
1217     same variable multiplied by a scalar.  See also '-frealloc-lhs'.
1218
1219'-Wrealloc-lhs-all'
1220     Warn when the compiler inserts code to for allocation or
1221     reallocation of an allocatable variable; this includes scalars and
1222     derived types.
1223
1224'-Wcompare-reals'
1225     Warn when comparing real or complex types for equality or
1226     inequality.  This option is implied by '-Wextra'.
1227
1228'-Wtarget-lifetime'
1229     Warn if the pointer in a pointer assignment might be longer than
1230     the its target.  This option is implied by '-Wall'.
1231
1232'-Wzerotrip'
1233     Warn if a 'DO' loop is known to execute zero times at compile time.
1234     This option is implied by '-Wall'.
1235
1236'-Wdo-subscript'
1237     Warn if an array subscript inside a DO loop could lead to an
1238     out-of-bounds access even if the compiler cannot prove that the
1239     statement is actually executed, in cases like
1240            real a(3)
1241            do i=1,4
1242              if (condition(i)) then
1243                a(i) = 1.2
1244              end if
1245            end do
1246     This option is implied by '-Wextra'.
1247
1248'-Werror'
1249     Turns all warnings into errors.
1250
1251   *Note Options to Request or Suppress Errors and Warnings:
1252(gcc)Warning Options, for information on more options offered by the GBE
1253shared by 'gfortran', 'gcc' and other GNU compilers.
1254
1255   Some of these have no effect when compiling programs written in
1256Fortran.
1257
1258
1259File: gfortran.info,  Node: Debugging Options,  Next: Directory Options,  Prev: Error and Warning Options,  Up: Invoking GNU Fortran
1260
12612.5 Options for debugging your program or GNU Fortran
1262=====================================================
1263
1264GNU Fortran has various special options that are used for debugging
1265either your program or the GNU Fortran compiler.
1266
1267'-fdump-fortran-original'
1268     Output the internal parse tree after translating the source program
1269     into internal representation.  This option is mostly useful for
1270     debugging the GNU Fortran compiler itself.  The output generated by
1271     this option might change between releases.  This option may also
1272     generate internal compiler errors for features which have only
1273     recently been added.
1274
1275'-fdump-fortran-optimized'
1276     Output the parse tree after front-end optimization.  Mostly useful
1277     for debugging the GNU Fortran compiler itself.  The output
1278     generated by this option might change between releases.  This
1279     option may also generate internal compiler errors for features
1280     which have only recently been added.
1281
1282'-fdump-parse-tree'
1283     Output the internal parse tree after translating the source program
1284     into internal representation.  Mostly useful for debugging the GNU
1285     Fortran compiler itself.  The output generated by this option might
1286     change between releases.  This option may also generate internal
1287     compiler errors for features which have only recently been added.
1288     This option is deprecated; use '-fdump-fortran-original' instead.
1289
1290'-fdump-fortran-global'
1291     Output a list of the global identifiers after translating into
1292     middle-end representation.  Mostly useful for debugging the GNU
1293     Fortran compiler itself.  The output generated by this option might
1294     change between releases.  This option may also generate internal
1295     compiler errors for features which have only recently been added.
1296
1297'-ffpe-trap=LIST'
1298     Specify a list of floating point exception traps to enable.  On
1299     most systems, if a floating point exception occurs and the trap for
1300     that exception is enabled, a SIGFPE signal will be sent and the
1301     program being aborted, producing a core file useful for debugging.
1302     LIST is a (possibly empty) comma-separated list of the following
1303     exceptions: 'invalid' (invalid floating point operation, such as
1304     'SQRT(-1.0)'), 'zero' (division by zero), 'overflow' (overflow in a
1305     floating point operation), 'underflow' (underflow in a floating
1306     point operation), 'inexact' (loss of precision during operation),
1307     and 'denormal' (operation performed on a denormal value).  The
1308     first five exceptions correspond to the five IEEE 754 exceptions,
1309     whereas the last one ('denormal') is not part of the IEEE 754
1310     standard but is available on some common architectures such as x86.
1311
1312     The first three exceptions ('invalid', 'zero', and 'overflow')
1313     often indicate serious errors, and unless the program has
1314     provisions for dealing with these exceptions, enabling traps for
1315     these three exceptions is probably a good idea.
1316
1317     If the option is used more than once in the command line, the lists
1318     will be joined: ''ffpe-trap='LIST1 'ffpe-trap='LIST2' is equivalent
1319     to 'ffpe-trap='LIST1,LIST2.
1320
1321     Note that once enabled an exception cannot be disabled (no negative
1322     form).
1323
1324     Many, if not most, floating point operations incur loss of
1325     precision due to rounding, and hence the 'ffpe-trap=inexact' is
1326     likely to be uninteresting in practice.
1327
1328     By default no exception traps are enabled.
1329
1330'-ffpe-summary=LIST'
1331     Specify a list of floating-point exceptions, whose flag status is
1332     printed to 'ERROR_UNIT' when invoking 'STOP' and 'ERROR STOP'.
1333     LIST can be either 'none', 'all' or a comma-separated list of the
1334     following exceptions: 'invalid', 'zero', 'overflow', 'underflow',
1335     'inexact' and 'denormal'.  (See '-ffpe-trap' for a description of
1336     the exceptions.)
1337
1338     If the option is used more than once in the command line, only the
1339     last one will be used.
1340
1341     By default, a summary for all exceptions but 'inexact' is shown.
1342
1343'-fno-backtrace'
1344     When a serious runtime error is encountered or a deadly signal is
1345     emitted (segmentation fault, illegal instruction, bus error,
1346     floating-point exception, and the other POSIX signals that have the
1347     action 'core'), the Fortran runtime library tries to output a
1348     backtrace of the error.  '-fno-backtrace' disables the backtrace
1349     generation.  This option only has influence for compilation of the
1350     Fortran main program.
1351
1352   *Note Options for Debugging Your Program or GCC: (gcc)Debugging
1353Options, for more information on debugging options.
1354
1355
1356File: gfortran.info,  Node: Directory Options,  Next: Link Options,  Prev: Debugging Options,  Up: Invoking GNU Fortran
1357
13582.6 Options for directory search
1359================================
1360
1361These options affect how GNU Fortran searches for files specified by the
1362'INCLUDE' directive and where it searches for previously compiled
1363modules.
1364
1365   It also affects the search paths used by 'cpp' when used to
1366preprocess Fortran source.
1367
1368'-IDIR'
1369     These affect interpretation of the 'INCLUDE' directive (as well as
1370     of the '#include' directive of the 'cpp' preprocessor).
1371
1372     Also note that the general behavior of '-I' and 'INCLUDE' is pretty
1373     much the same as of '-I' with '#include' in the 'cpp' preprocessor,
1374     with regard to looking for 'header.gcc' files and other such
1375     things.
1376
1377     This path is also used to search for '.mod' files when previously
1378     compiled modules are required by a 'USE' statement.
1379
1380     *Note Options for Directory Search: (gcc)Directory Options, for
1381     information on the '-I' option.
1382
1383'-JDIR'
1384     This option specifies where to put '.mod' files for compiled
1385     modules.  It is also added to the list of directories to searched
1386     by an 'USE' statement.
1387
1388     The default is the current directory.
1389
1390'-fintrinsic-modules-path DIR'
1391     This option specifies the location of pre-compiled intrinsic
1392     modules, if they are not in the default location expected by the
1393     compiler.
1394
1395
1396File: gfortran.info,  Node: Link Options,  Next: Runtime Options,  Prev: Directory Options,  Up: Invoking GNU Fortran
1397
13982.7 Influencing the linking step
1399================================
1400
1401These options come into play when the compiler links object files into
1402an executable output file.  They are meaningless if the compiler is not
1403doing a link step.
1404
1405'-static-libgfortran'
1406     On systems that provide 'libgfortran' as a shared and a static
1407     library, this option forces the use of the static version.  If no
1408     shared version of 'libgfortran' was built when the compiler was
1409     configured, this option has no effect.
1410
1411
1412File: gfortran.info,  Node: Runtime Options,  Next: Code Gen Options,  Prev: Link Options,  Up: Invoking GNU Fortran
1413
14142.8 Influencing runtime behavior
1415================================
1416
1417These options affect the runtime behavior of programs compiled with GNU
1418Fortran.
1419
1420'-fconvert=CONVERSION'
1421     Specify the representation of data for unformatted files.  Valid
1422     values for conversion are: 'native', the default; 'swap', swap
1423     between big- and little-endian; 'big-endian', use big-endian
1424     representation for unformatted files; 'little-endian', use
1425     little-endian representation for unformatted files.
1426
1427     _This option has an effect only when used in the main program.  The
1428     'CONVERT' specifier and the GFORTRAN_CONVERT_UNIT environment
1429     variable override the default specified by '-fconvert'._
1430
1431'-frecord-marker=LENGTH'
1432     Specify the length of record markers for unformatted files.  Valid
1433     values for LENGTH are 4 and 8.  Default is 4.  _This is different
1434     from previous versions of 'gfortran'_, which specified a default
1435     record marker length of 8 on most systems.  If you want to read or
1436     write files compatible with earlier versions of 'gfortran', use
1437     '-frecord-marker=8'.
1438
1439'-fmax-subrecord-length=LENGTH'
1440     Specify the maximum length for a subrecord.  The maximum permitted
1441     value for length is 2147483639, which is also the default.  Only
1442     really useful for use by the gfortran testsuite.
1443
1444'-fsign-zero'
1445     When enabled, floating point numbers of value zero with the sign
1446     bit set are written as negative number in formatted output and
1447     treated as negative in the 'SIGN' intrinsic.  '-fno-sign-zero' does
1448     not print the negative sign of zero values (or values rounded to
1449     zero for I/O) and regards zero as positive number in the 'SIGN'
1450     intrinsic for compatibility with Fortran 77.  The default is
1451     '-fsign-zero'.
1452
1453
1454File: gfortran.info,  Node: Code Gen Options,  Next: Interoperability Options,  Prev: Runtime Options,  Up: Invoking GNU Fortran
1455
14562.9 Options for code generation conventions
1457===========================================
1458
1459These machine-independent options control the interface conventions used
1460in code generation.
1461
1462   Most of them have both positive and negative forms; the negative form
1463of '-ffoo' would be '-fno-foo'.  In the table below, only one of the
1464forms is listed--the one which is not the default.  You can figure out
1465the other form by either removing 'no-' or adding it.
1466
1467'-fno-automatic'
1468     Treat each program unit (except those marked as RECURSIVE) as if
1469     the 'SAVE' statement were specified for every local variable and
1470     array referenced in it.  Does not affect common blocks.  (Some
1471     Fortran compilers provide this option under the name '-static' or
1472     '-save'.)  The default, which is '-fautomatic', uses the stack for
1473     local variables smaller than the value given by
1474     '-fmax-stack-var-size'.  Use the option '-frecursive' to use no
1475     static memory.
1476
1477     Local variables or arrays having an explicit 'SAVE' attribute are
1478     silently ignored unless the '-pedantic' option is added.
1479
1480'-ff2c'
1481     Generate code designed to be compatible with code generated by
1482     'g77' and 'f2c'.
1483
1484     The calling conventions used by 'g77' (originally implemented in
1485     'f2c') require functions that return type default 'REAL' to
1486     actually return the C type 'double', and functions that return type
1487     'COMPLEX' to return the values via an extra argument in the calling
1488     sequence that points to where to store the return value.  Under the
1489     default GNU calling conventions, such functions simply return their
1490     results as they would in GNU C--default 'REAL' functions return the
1491     C type 'float', and 'COMPLEX' functions return the GNU C type
1492     'complex'.  Additionally, this option implies the
1493     '-fsecond-underscore' option, unless '-fno-second-underscore' is
1494     explicitly requested.
1495
1496     This does not affect the generation of code that interfaces with
1497     the 'libgfortran' library.
1498
1499     _Caution:_ It is not a good idea to mix Fortran code compiled with
1500     '-ff2c' with code compiled with the default '-fno-f2c' calling
1501     conventions as, calling 'COMPLEX' or default 'REAL' functions
1502     between program parts which were compiled with different calling
1503     conventions will break at execution time.
1504
1505     _Caution:_ This will break code which passes intrinsic functions of
1506     type default 'REAL' or 'COMPLEX' as actual arguments, as the
1507     library implementations use the '-fno-f2c' calling conventions.
1508
1509'-fno-underscoring'
1510     Do not transform names of entities specified in the Fortran source
1511     file by appending underscores to them.
1512
1513     With '-funderscoring' in effect, GNU Fortran appends one underscore
1514     to external names with no underscores.  This is done to ensure
1515     compatibility with code produced by many UNIX Fortran compilers.
1516
1517     _Caution_: The default behavior of GNU Fortran is incompatible with
1518     'f2c' and 'g77', please use the '-ff2c' option if you want object
1519     files compiled with GNU Fortran to be compatible with object code
1520     created with these tools.
1521
1522     Use of '-fno-underscoring' is not recommended unless you are
1523     experimenting with issues such as integration of GNU Fortran into
1524     existing system environments (vis-a`-vis existing libraries, tools,
1525     and so on).
1526
1527     For example, with '-funderscoring', and assuming that 'j()' and
1528     'max_count()' are external functions while 'my_var' and 'lvar' are
1529     local variables, a statement like
1530          I = J() + MAX_COUNT (MY_VAR, LVAR)
1531     is implemented as something akin to:
1532          i = j_() + max_count__(&my_var__, &lvar);
1533
1534     With '-fno-underscoring', the same statement is implemented as:
1535
1536          i = j() + max_count(&my_var, &lvar);
1537
1538     Use of '-fno-underscoring' allows direct specification of
1539     user-defined names while debugging and when interfacing GNU Fortran
1540     code with other languages.
1541
1542     Note that just because the names match does _not_ mean that the
1543     interface implemented by GNU Fortran for an external name matches
1544     the interface implemented by some other language for that same
1545     name.  That is, getting code produced by GNU Fortran to link to
1546     code produced by some other compiler using this or any other method
1547     can be only a small part of the overall solution--getting the code
1548     generated by both compilers to agree on issues other than naming
1549     can require significant effort, and, unlike naming disagreements,
1550     linkers normally cannot detect disagreements in these other areas.
1551
1552     Also, note that with '-fno-underscoring', the lack of appended
1553     underscores introduces the very real possibility that a
1554     user-defined external name will conflict with a name in a system
1555     library, which could make finding unresolved-reference bugs quite
1556     difficult in some cases--they might occur at program run time, and
1557     show up only as buggy behavior at run time.
1558
1559     In future versions of GNU Fortran we hope to improve naming and
1560     linking issues so that debugging always involves using the names as
1561     they appear in the source, even if the names as seen by the linker
1562     are mangled to prevent accidental linking between procedures with
1563     incompatible interfaces.
1564
1565'-fsecond-underscore'
1566     By default, GNU Fortran appends an underscore to external names.
1567     If this option is used GNU Fortran appends two underscores to names
1568     with underscores and one underscore to external names with no
1569     underscores.  GNU Fortran also appends two underscores to internal
1570     names with underscores to avoid naming collisions with external
1571     names.
1572
1573     This option has no effect if '-fno-underscoring' is in effect.  It
1574     is implied by the '-ff2c' option.
1575
1576     Otherwise, with this option, an external name such as 'MAX_COUNT'
1577     is implemented as a reference to the link-time external symbol
1578     'max_count__', instead of 'max_count_'.  This is required for
1579     compatibility with 'g77' and 'f2c', and is implied by use of the
1580     '-ff2c' option.
1581
1582'-fcoarray=<KEYWORD>'
1583
1584     'none'
1585          Disable coarray support; using coarray declarations and
1586          image-control statements will produce a compile-time error.
1587          (Default)
1588
1589     'single'
1590          Single-image mode, i.e.  'num_images()' is always one.
1591
1592     'lib'
1593          Library-based coarray parallelization; a suitable GNU Fortran
1594          coarray library needs to be linked.
1595
1596'-fcheck=<KEYWORD>'
1597
1598     Enable the generation of run-time checks; the argument shall be a
1599     comma-delimited list of the following keywords.  Prefixing a check
1600     with 'no-' disables it if it was activated by a previous
1601     specification.
1602
1603     'all'
1604          Enable all run-time test of '-fcheck'.
1605
1606     'array-temps'
1607          Warns at run time when for passing an actual argument a
1608          temporary array had to be generated.  The information
1609          generated by this warning is sometimes useful in optimization,
1610          in order to avoid such temporaries.
1611
1612          Note: The warning is only printed once per location.
1613
1614     'bounds'
1615          Enable generation of run-time checks for array subscripts and
1616          against the declared minimum and maximum values.  It also
1617          checks array indices for assumed and deferred shape arrays
1618          against the actual allocated bounds and ensures that all
1619          string lengths are equal for character array constructors
1620          without an explicit typespec.
1621
1622          Some checks require that '-fcheck=bounds' is set for the
1623          compilation of the main program.
1624
1625          Note: In the future this may also include other forms of
1626          checking, e.g., checking substring references.
1627
1628     'do'
1629          Enable generation of run-time checks for invalid modification
1630          of loop iteration variables.
1631
1632     'mem'
1633          Enable generation of run-time checks for memory allocation.
1634          Note: This option does not affect explicit allocations using
1635          the 'ALLOCATE' statement, which will be always checked.
1636
1637     'pointer'
1638          Enable generation of run-time checks for pointers and
1639          allocatables.
1640
1641     'recursion'
1642          Enable generation of run-time checks for recursively called
1643          subroutines and functions which are not marked as recursive.
1644          See also '-frecursive'.  Note: This check does not work for
1645          OpenMP programs and is disabled if used together with
1646          '-frecursive' and '-fopenmp'.
1647
1648     Example: Assuming you have a file 'foo.f90', the command
1649            gfortran -fcheck=all,no-array-temps foo.f90
1650     will compile the file with all checks enabled as specified above
1651     except warnings for generated array temporaries.
1652
1653'-fbounds-check'
1654     Deprecated alias for '-fcheck=bounds'.
1655
1656'-ftail-call-workaround'
1657'-ftail-call-workaround=N'
1658     Some C interfaces to Fortran codes violate the gfortran ABI by
1659     omitting the hidden character length arguments as described in
1660     *Note Argument passing conventions::.  This can lead to crashes
1661     because pushing arguments for tail calls can overflow the stack.
1662
1663     To provide a workaround for existing binary packages, this option
1664     disables tail call optimization for gfortran procedures with
1665     character arguments.  With '-ftail-call-workaround=2' tail call
1666     optimization is disabled in all gfortran procedures with character
1667     arguments, with '-ftail-call-workaround=1' or equivalent
1668     '-ftail-call-workaround' only in gfortran procedures with character
1669     arguments that call implicitly prototyped procedures.
1670
1671     Using this option can lead to problems including crashes due to
1672     insufficient stack space.
1673
1674     It is _very strongly_ recommended to fix the code in question.  The
1675     '-fc-prototypes-external' option can be used to generate prototypes
1676     which conform to gfortran's ABI, for inclusion in the source code.
1677
1678     Support for this option will likely be withdrawn in a future
1679     release of gfortran.
1680
1681     The negative form, '-fno-tail-call-workaround' or equivalent
1682     '-ftail-call-workaround=0', can be used to disable this option.
1683
1684     Default is currently '-ftail-call-workaround', this will change in
1685     future releases.
1686
1687'-fcheck-array-temporaries'
1688     Deprecated alias for '-fcheck=array-temps'.
1689
1690'-fmax-array-constructor=N'
1691     This option can be used to increase the upper limit permitted in
1692     array constructors.  The code below requires this option to expand
1693     the array at compile time.
1694
1695          program test
1696          implicit none
1697          integer j
1698          integer, parameter :: n = 100000
1699          integer, parameter :: i(n) = (/ (2*j, j = 1, n) /)
1700          print '(10(I0,1X))', i
1701          end program test
1702
1703     _Caution: This option can lead to long compile times and
1704     excessively large object files._
1705
1706     The default value for N is 65535.
1707
1708'-fmax-stack-var-size=N'
1709     This option specifies the size in bytes of the largest array that
1710     will be put on the stack; if the size is exceeded static memory is
1711     used (except in procedures marked as RECURSIVE). Use the option
1712     '-frecursive' to allow for recursive procedures which do not have a
1713     RECURSIVE attribute or for parallel programs.  Use '-fno-automatic'
1714     to never use the stack.
1715
1716     This option currently only affects local arrays declared with
1717     constant bounds, and may not apply to all character variables.
1718     Future versions of GNU Fortran may improve this behavior.
1719
1720     The default value for N is 32768.
1721
1722'-fstack-arrays'
1723     Adding this option will make the Fortran compiler put all arrays of
1724     unknown size and array temporaries onto stack memory.  If your
1725     program uses very large local arrays it is possible that you will
1726     have to extend your runtime limits for stack memory on some
1727     operating systems.  This flag is enabled by default at optimization
1728     level '-Ofast' unless '-fmax-stack-var-size' is specified.
1729
1730'-fpack-derived'
1731     This option tells GNU Fortran to pack derived type members as
1732     closely as possible.  Code compiled with this option is likely to
1733     be incompatible with code compiled without this option, and may
1734     execute slower.
1735
1736'-frepack-arrays'
1737     In some circumstances GNU Fortran may pass assumed shape array
1738     sections via a descriptor describing a noncontiguous area of
1739     memory.  This option adds code to the function prologue to repack
1740     the data into a contiguous block at runtime.
1741
1742     This should result in faster accesses to the array.  However it can
1743     introduce significant overhead to the function call, especially
1744     when the passed data is noncontiguous.
1745
1746'-fshort-enums'
1747     This option is provided for interoperability with C code that was
1748     compiled with the '-fshort-enums' option.  It will make GNU Fortran
1749     choose the smallest 'INTEGER' kind a given enumerator set will fit
1750     in, and give all its enumerators this kind.
1751
1752'-fexternal-blas'
1753     This option will make 'gfortran' generate calls to BLAS functions
1754     for some matrix operations like 'MATMUL', instead of using our own
1755     algorithms, if the size of the matrices involved is larger than a
1756     given limit (see '-fblas-matmul-limit').  This may be profitable if
1757     an optimized vendor BLAS library is available.  The BLAS library
1758     will have to be specified at link time.
1759
1760'-fblas-matmul-limit=N'
1761     Only significant when '-fexternal-blas' is in effect.  Matrix
1762     multiplication of matrices with size larger than (or equal to) N
1763     will be performed by calls to BLAS functions, while others will be
1764     handled by 'gfortran' internal algorithms.  If the matrices
1765     involved are not square, the size comparison is performed using the
1766     geometric mean of the dimensions of the argument and result
1767     matrices.
1768
1769     The default value for N is 30.
1770
1771'-finline-matmul-limit=N'
1772     When front-end optimiztion is active, some calls to the 'MATMUL'
1773     intrinsic function will be inlined.  This may result in code size
1774     increase if the size of the matrix cannot be determined at compile
1775     time, as code for both cases is generated.  Setting
1776     '-finline-matmul-limit=0' will disable inlining in all cases.
1777     Setting this option with a value of N will produce inline code for
1778     matrices with size up to N.  If the matrices involved are not
1779     square, the size comparison is performed using the geometric mean
1780     of the dimensions of the argument and result matrices.
1781
1782     The default value for N is 30.  The '-fblas-matmul-limit' can be
1783     used to change this value.
1784
1785'-frecursive'
1786     Allow indirect recursion by forcing all local arrays to be
1787     allocated on the stack.  This flag cannot be used together with
1788     '-fmax-stack-var-size=' or '-fno-automatic'.
1789
1790'-finit-local-zero'
1791'-finit-derived'
1792'-finit-integer=N'
1793'-finit-real=<ZERO|INF|-INF|NAN|SNAN>'
1794'-finit-logical=<TRUE|FALSE>'
1795'-finit-character=N'
1796     The '-finit-local-zero' option instructs the compiler to initialize
1797     local 'INTEGER', 'REAL', and 'COMPLEX' variables to zero, 'LOGICAL'
1798     variables to false, and 'CHARACTER' variables to a string of null
1799     bytes.  Finer-grained initialization options are provided by the
1800     '-finit-integer=N', '-finit-real=<ZERO|INF|-INF|NAN|SNAN>' (which
1801     also initializes the real and imaginary parts of local 'COMPLEX'
1802     variables), '-finit-logical=<TRUE|FALSE>', and '-finit-character=N'
1803     (where N is an ASCII character value) options.
1804
1805     With '-finit-derived', components of derived type variables will be
1806     initialized according to these flags.  Components whose type is not
1807     covered by an explicit '-finit-*' flag will be treated as described
1808     above with '-finit-local-zero'.
1809
1810     These options do not initialize
1811        * objects with the POINTER attribute
1812        * allocatable arrays
1813        * variables that appear in an 'EQUIVALENCE' statement.
1814     (These limitations may be removed in future releases).
1815
1816     Note that the '-finit-real=nan' option initializes 'REAL' and
1817     'COMPLEX' variables with a quiet NaN. For a signalling NaN use
1818     '-finit-real=snan'; note, however, that compile-time optimizations
1819     may convert them into quiet NaN and that trapping needs to be
1820     enabled (e.g.  via '-ffpe-trap').
1821
1822     The '-finit-integer' option will parse the value into an integer of
1823     type 'INTEGER(kind=C_LONG)' on the host.  Said value is then
1824     assigned to the integer variables in the Fortran code, which might
1825     result in wraparound if the value is too large for the kind.
1826
1827     Finally, note that enabling any of the '-finit-*' options will
1828     silence warnings that would have been emitted by '-Wuninitialized'
1829     for the affected local variables.
1830
1831'-falign-commons'
1832     By default, 'gfortran' enforces proper alignment of all variables
1833     in a 'COMMON' block by padding them as needed.  On certain
1834     platforms this is mandatory, on others it increases performance.
1835     If a 'COMMON' block is not declared with consistent data types
1836     everywhere, this padding can cause trouble, and
1837     '-fno-align-commons' can be used to disable automatic alignment.
1838     The same form of this option should be used for all files that
1839     share a 'COMMON' block.  To avoid potential alignment issues in
1840     'COMMON' blocks, it is recommended to order objects from largest to
1841     smallest.
1842
1843'-fno-protect-parens'
1844     By default the parentheses in expression are honored for all
1845     optimization levels such that the compiler does not do any
1846     re-association.  Using '-fno-protect-parens' allows the compiler to
1847     reorder 'REAL' and 'COMPLEX' expressions to produce faster code.
1848     Note that for the re-association optimization '-fno-signed-zeros'
1849     and '-fno-trapping-math' need to be in effect.  The parentheses
1850     protection is enabled by default, unless '-Ofast' is given.
1851
1852'-frealloc-lhs'
1853     An allocatable left-hand side of an intrinsic assignment is
1854     automatically (re)allocated if it is either unallocated or has a
1855     different shape.  The option is enabled by default except when
1856     '-std=f95' is given.  See also '-Wrealloc-lhs'.
1857
1858'-faggressive-function-elimination'
1859     Functions with identical argument lists are eliminated within
1860     statements, regardless of whether these functions are marked 'PURE'
1861     or not.  For example, in
1862            a = f(b,c) + f(b,c)
1863     there will only be a single call to 'f'.  This option only works if
1864     '-ffrontend-optimize' is in effect.
1865
1866'-ffrontend-optimize'
1867     This option performs front-end optimization, based on manipulating
1868     parts the Fortran parse tree.  Enabled by default by any '-O'
1869     option except '-O0' and '-Og'.  Optimizations enabled by this
1870     option include:
1871        * inlining calls to 'MATMUL',
1872        * elimination of identical function calls within expressions,
1873        * removing unnecessary calls to 'TRIM' in comparisons and
1874          assignments,
1875        * replacing 'TRIM(a)' with 'a(1:LEN_TRIM(a))' and
1876        * short-circuiting of logical operators ('.AND.' and '.OR.').
1877     It can be deselected by specifying '-fno-frontend-optimize'.
1878
1879'-ffrontend-loop-interchange'
1880     Attempt to interchange loops in the Fortran front end where
1881     profitable.  Enabled by default by any '-O' option.  At the moment,
1882     this option only affects 'FORALL' and 'DO CONCURRENT' statements
1883     with several forall triplets.
1884
1885   *Note Options for Code Generation Conventions: (gcc)Code Gen Options,
1886for information on more options offered by the GBE shared by 'gfortran',
1887'gcc', and other GNU compilers.
1888
1889
1890File: gfortran.info,  Node: Interoperability Options,  Next: Environment Variables,  Prev: Code Gen Options,  Up: Invoking GNU Fortran
1891
18922.10 Options for interoperability with other languages
1893======================================================
1894
1895-fc-prototypes
1896     This option will generate C prototypes from 'BIND(C)' variable
1897     declarations, types and procedure interfaces and writes them to
1898     standard output.  'ENUM' is not yet supported.
1899
1900     The generated prototypes may need inclusion of an appropriate
1901     header, such as '<stdint.h>' or '<stdlib.h>'.  For types which are
1902     not specified using the appropriate kind from the 'iso_c_binding'
1903     module, a warning is added as a comment to the code.
1904
1905     For function pointers, a pointer to a function returning 'int'
1906     without an explicit argument list is generated.
1907
1908     Example of use:
1909          $ gfortran -fc-prototypes -fsyntax-only foo.f90 > foo.h
1910     where the C code intended for interoperating with the Fortran code
1911     then uses '#include "foo.h"'.
1912
1913-fc-prototypes-external
1914     This option will generate C prototypes from external functions and
1915     subroutines and write them to standard output.  This may be useful
1916     for making sure that C bindings to Fortran code are correct.  This
1917     option does not generate prototypes for 'BIND(C)' procedures, use
1918     '-fc-prototypes' for that.
1919
1920     The generated prototypes may need inclusion of an appropriate
1921     header, such as as '<stdint.h>' or '<stdlib.h>'.
1922
1923     This is primarily meant for legacy code to ensure that existing C
1924     bindings match what 'gfortran' emits.  The generated C prototypes
1925     should be correct for the current version of the compiler, but may
1926     not match what other compilers or earlier versions of 'gfortran'
1927     need.  For new developments, use of the 'BIND(C)' features is
1928     recommended.
1929
1930     Example of use:
1931          $ gfortran -fc-prototypes-external -fsyntax-only foo.f > foo.h
1932     where the C code intended for interoperating with the Fortran code
1933     then uses '#include "foo.h"'.
1934
1935
1936File: gfortran.info,  Node: Environment Variables,  Prev: Interoperability Options,  Up: Invoking GNU Fortran
1937
19382.11 Environment variables affecting 'gfortran'
1939===============================================
1940
1941The 'gfortran' compiler currently does not make use of any environment
1942variables to control its operation above and beyond those that affect
1943the operation of 'gcc'.
1944
1945   *Note Environment Variables Affecting GCC: (gcc)Environment
1946Variables, for information on environment variables.
1947
1948   *Note Runtime::, for environment variables that affect the run-time
1949behavior of programs compiled with GNU Fortran.
1950
1951
1952File: gfortran.info,  Node: Runtime,  Next: Fortran standards status,  Prev: Invoking GNU Fortran,  Up: Top
1953
19543 Runtime: Influencing runtime behavior with environment variables
1955******************************************************************
1956
1957The behavior of the 'gfortran' can be influenced by environment
1958variables.
1959
1960   Malformed environment variables are silently ignored.
1961
1962* Menu:
1963
1964* TMPDIR:: Directory for scratch files
1965* GFORTRAN_STDIN_UNIT:: Unit number for standard input
1966* GFORTRAN_STDOUT_UNIT:: Unit number for standard output
1967* GFORTRAN_STDERR_UNIT:: Unit number for standard error
1968* GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units.
1969* GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units.
1970* GFORTRAN_SHOW_LOCUS::  Show location for runtime errors
1971* GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted
1972* GFORTRAN_LIST_SEPARATOR::  Separator for list output
1973* GFORTRAN_CONVERT_UNIT::  Set endianness for unformatted I/O
1974* GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors
1975* GFORTRAN_FORMATTED_BUFFER_SIZE:: Buffer size for formatted files.
1976* GFORTRAN_UNFORMATTED_BUFFER_SIZE:: Buffer size for unformatted files.
1977
1978
1979File: gfortran.info,  Node: TMPDIR,  Next: GFORTRAN_STDIN_UNIT,  Up: Runtime
1980
19813.1 'TMPDIR'--Directory for scratch files
1982=========================================
1983
1984When opening a file with 'STATUS='SCRATCH'', GNU Fortran tries to create
1985the file in one of the potential directories by testing each directory
1986in the order below.
1987
1988  1. The environment variable 'TMPDIR', if it exists.
1989
1990  2. On the MinGW target, the directory returned by the 'GetTempPath'
1991     function.  Alternatively, on the Cygwin target, the 'TMP' and
1992     'TEMP' environment variables, if they exist, in that order.
1993
1994  3. The 'P_tmpdir' macro if it is defined, otherwise the directory
1995     '/tmp'.
1996
1997
1998File: gfortran.info,  Node: GFORTRAN_STDIN_UNIT,  Next: GFORTRAN_STDOUT_UNIT,  Prev: TMPDIR,  Up: Runtime
1999
20003.2 'GFORTRAN_STDIN_UNIT'--Unit number for standard input
2001=========================================================
2002
2003This environment variable can be used to select the unit number
2004preconnected to standard input.  This must be a positive integer.  The
2005default value is 5.
2006
2007
2008File: gfortran.info,  Node: GFORTRAN_STDOUT_UNIT,  Next: GFORTRAN_STDERR_UNIT,  Prev: GFORTRAN_STDIN_UNIT,  Up: Runtime
2009
20103.3 'GFORTRAN_STDOUT_UNIT'--Unit number for standard output
2011===========================================================
2012
2013This environment variable can be used to select the unit number
2014preconnected to standard output.  This must be a positive integer.  The
2015default value is 6.
2016
2017
2018File: gfortran.info,  Node: GFORTRAN_STDERR_UNIT,  Next: GFORTRAN_UNBUFFERED_ALL,  Prev: GFORTRAN_STDOUT_UNIT,  Up: Runtime
2019
20203.4 'GFORTRAN_STDERR_UNIT'--Unit number for standard error
2021==========================================================
2022
2023This environment variable can be used to select the unit number
2024preconnected to standard error.  This must be a positive integer.  The
2025default value is 0.
2026
2027
2028File: gfortran.info,  Node: GFORTRAN_UNBUFFERED_ALL,  Next: GFORTRAN_UNBUFFERED_PRECONNECTED,  Prev: GFORTRAN_STDERR_UNIT,  Up: Runtime
2029
20303.5 'GFORTRAN_UNBUFFERED_ALL'--Do not buffer I/O on all units
2031=============================================================
2032
2033This environment variable controls whether all I/O is unbuffered.  If
2034the first letter is 'y', 'Y' or '1', all I/O is unbuffered.  This will
2035slow down small sequential reads and writes.  If the first letter is
2036'n', 'N' or '0', I/O is buffered.  This is the default.
2037
2038
2039File: gfortran.info,  Node: GFORTRAN_UNBUFFERED_PRECONNECTED,  Next: GFORTRAN_SHOW_LOCUS,  Prev: GFORTRAN_UNBUFFERED_ALL,  Up: Runtime
2040
20413.6 'GFORTRAN_UNBUFFERED_PRECONNECTED'--Do not buffer I/O on preconnected units
2042===============================================================================
2043
2044The environment variable named 'GFORTRAN_UNBUFFERED_PRECONNECTED'
2045controls whether I/O on a preconnected unit (i.e. STDOUT or STDERR) is
2046unbuffered.  If the first letter is 'y', 'Y' or '1', I/O is unbuffered.
2047This will slow down small sequential reads and writes.  If the first
2048letter is 'n', 'N' or '0', I/O is buffered.  This is the default.
2049
2050
2051File: gfortran.info,  Node: GFORTRAN_SHOW_LOCUS,  Next: GFORTRAN_OPTIONAL_PLUS,  Prev: GFORTRAN_UNBUFFERED_PRECONNECTED,  Up: Runtime
2052
20533.7 'GFORTRAN_SHOW_LOCUS'--Show location for runtime errors
2054===========================================================
2055
2056If the first letter is 'y', 'Y' or '1', filename and line numbers for
2057runtime errors are printed.  If the first letter is 'n', 'N' or '0', do
2058not print filename and line numbers for runtime errors.  The default is
2059to print the location.
2060
2061
2062File: gfortran.info,  Node: GFORTRAN_OPTIONAL_PLUS,  Next: GFORTRAN_LIST_SEPARATOR,  Prev: GFORTRAN_SHOW_LOCUS,  Up: Runtime
2063
20643.8 'GFORTRAN_OPTIONAL_PLUS'--Print leading + where permitted
2065=============================================================
2066
2067If the first letter is 'y', 'Y' or '1', a plus sign is printed where
2068permitted by the Fortran standard.  If the first letter is 'n', 'N' or
2069'0', a plus sign is not printed in most cases.  Default is not to print
2070plus signs.
2071
2072
2073File: gfortran.info,  Node: GFORTRAN_LIST_SEPARATOR,  Next: GFORTRAN_CONVERT_UNIT,  Prev: GFORTRAN_OPTIONAL_PLUS,  Up: Runtime
2074
20753.9 'GFORTRAN_LIST_SEPARATOR'--Separator for list output
2076========================================================
2077
2078This environment variable specifies the separator when writing
2079list-directed output.  It may contain any number of spaces and at most
2080one comma.  If you specify this on the command line, be sure to quote
2081spaces, as in
2082     $ GFORTRAN_LIST_SEPARATOR='  ,  ' ./a.out
2083   when 'a.out' is the compiled Fortran program that you want to run.
2084Default is a single space.
2085
2086
2087File: gfortran.info,  Node: GFORTRAN_CONVERT_UNIT,  Next: GFORTRAN_ERROR_BACKTRACE,  Prev: GFORTRAN_LIST_SEPARATOR,  Up: Runtime
2088
20893.10 'GFORTRAN_CONVERT_UNIT'--Set endianness for unformatted I/O
2090================================================================
2091
2092By setting the 'GFORTRAN_CONVERT_UNIT' variable, it is possible to
2093change the representation of data for unformatted files.  The syntax for
2094the 'GFORTRAN_CONVERT_UNIT' variable is:
2095     GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ;
2096     mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ;
2097     exception: mode ':' unit_list | unit_list ;
2098     unit_list: unit_spec | unit_list unit_spec ;
2099     unit_spec: INTEGER | INTEGER '-' INTEGER ;
2100   The variable consists of an optional default mode, followed by a list
2101of optional exceptions, which are separated by semicolons from the
2102preceding default and each other.  Each exception consists of a format
2103and a comma-separated list of units.  Valid values for the modes are the
2104same as for the 'CONVERT' specifier:
2105
2106     'NATIVE' Use the native format.  This is the default.
2107     'SWAP' Swap between little- and big-endian.
2108     'LITTLE_ENDIAN' Use the little-endian format for unformatted files.
2109     'BIG_ENDIAN' Use the big-endian format for unformatted files.
2110   A missing mode for an exception is taken to mean 'BIG_ENDIAN'.
2111Examples of values for 'GFORTRAN_CONVERT_UNIT' are:
2112     ''big_endian'' Do all unformatted I/O in big_endian mode.
2113     ''little_endian;native:10-20,25'' Do all unformatted I/O in
2114     little_endian mode, except for units 10 to 20 and 25, which are in
2115     native format.
2116     ''10-20'' Units 10 to 20 are big-endian, the rest is native.
2117
2118   Setting the environment variables should be done on the command line
2119or via the 'export' command for 'sh'-compatible shells and via 'setenv'
2120for 'csh'-compatible shells.
2121
2122   Example for 'sh':
2123     $ gfortran foo.f90
2124     $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out
2125
2126   Example code for 'csh':
2127     % gfortran foo.f90
2128     % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20'
2129     % ./a.out
2130
2131   Using anything but the native representation for unformatted data
2132carries a significant speed overhead.  If speed in this area matters to
2133you, it is best if you use this only for data that needs to be portable.
2134
2135   *Note CONVERT specifier::, for an alternative way to specify the data
2136representation for unformatted files.  *Note Runtime Options::, for
2137setting a default data representation for the whole program.  The
2138'CONVERT' specifier overrides the '-fconvert' compile options.
2139
2140   _Note that the values specified via the GFORTRAN_CONVERT_UNIT
2141environment variable will override the CONVERT specifier in the open
2142statement_.  This is to give control over data formats to users who do
2143not have the source code of their program available.
2144
2145
2146File: gfortran.info,  Node: GFORTRAN_ERROR_BACKTRACE,  Next: GFORTRAN_FORMATTED_BUFFER_SIZE,  Prev: GFORTRAN_CONVERT_UNIT,  Up: Runtime
2147
21483.11 'GFORTRAN_ERROR_BACKTRACE'--Show backtrace on run-time errors
2149==================================================================
2150
2151If the 'GFORTRAN_ERROR_BACKTRACE' variable is set to 'y', 'Y' or '1'
2152(only the first letter is relevant) then a backtrace is printed when a
2153serious run-time error occurs.  To disable the backtracing, set the
2154variable to 'n', 'N', '0'.  Default is to print a backtrace unless the
2155'-fno-backtrace' compile option was used.
2156
2157
2158File: gfortran.info,  Node: GFORTRAN_FORMATTED_BUFFER_SIZE,  Next: GFORTRAN_UNFORMATTED_BUFFER_SIZE,  Prev: GFORTRAN_ERROR_BACKTRACE,  Up: Runtime
2159
21603.12 'GFORTRAN_FORMATTED_BUFFER_SIZE'--Set buffer size for formatted I/O
2161========================================================================
2162
2163The 'GFORTRAN_FORMATTED_BUFFER_SIZE' environment variable specifies
2164buffer size in bytes to be used for formatted output.  The default value
2165is 8192.
2166
2167
2168File: gfortran.info,  Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE,  Prev: GFORTRAN_FORMATTED_BUFFER_SIZE,  Up: Runtime
2169
21703.13 'GFORTRAN_UNFORMATTED_BUFFER_SIZE'--Set buffer size for unformatted I/O
2171============================================================================
2172
2173The 'GFORTRAN_UNFORMATTED_BUFFER_SIZE' environment variable specifies
2174buffer size in bytes to be used for unformatted output.  The default
2175value is 131072.
2176
2177
2178File: gfortran.info,  Node: Fortran standards status,  Next: Compiler Characteristics,  Prev: Runtime,  Up: Top
2179
21804 Fortran standards status
2181**************************
2182
2183* Menu:
2184
2185* Fortran 2003 status::
2186* Fortran 2008 status::
2187* Fortran 2018 status::
2188
2189
2190File: gfortran.info,  Node: Fortran 2003 status,  Next: Fortran 2008 status,  Up: Fortran standards status
2191
21924.1 Fortran 2003 status
2193=======================
2194
2195GNU Fortran supports several Fortran 2003 features; an incomplete list
2196can be found below.  See also the wiki page
2197(https://gcc.gnu.org/wiki/Fortran2003) about Fortran 2003.
2198
2199   * Procedure pointers including procedure-pointer components with
2200     'PASS' attribute.
2201
2202   * Procedures which are bound to a derived type (type-bound
2203     procedures) including 'PASS', 'PROCEDURE' and 'GENERIC', and
2204     operators bound to a type.
2205
2206   * Abstract interfaces and type extension with the possibility to
2207     override type-bound procedures or to have deferred binding.
2208
2209   * Polymorphic entities ("'CLASS'") for derived types and unlimited
2210     polymorphism ("'CLASS(*)'") - including 'SAME_TYPE_AS',
2211     'EXTENDS_TYPE_OF' and 'SELECT TYPE' for scalars and arrays and
2212     finalization.
2213
2214   * Generic interface names, which have the same name as derived types,
2215     are now supported.  This allows one to write constructor functions.
2216     Note that Fortran does not support static constructor functions.
2217     For static variables, only default initialization or
2218     structure-constructor initialization are available.
2219
2220   * The 'ASSOCIATE' construct.
2221
2222   * Interoperability with C including enumerations,
2223
2224   * In structure constructors the components with default values may be
2225     omitted.
2226
2227   * Extensions to the 'ALLOCATE' statement, allowing for a
2228     type-specification with type parameter and for allocation and
2229     initialization from a 'SOURCE=' expression; 'ALLOCATE' and
2230     'DEALLOCATE' optionally return an error message string via
2231     'ERRMSG='.
2232
2233   * Reallocation on assignment: If an intrinsic assignment is used, an
2234     allocatable variable on the left-hand side is automatically
2235     allocated (if unallocated) or reallocated (if the shape is
2236     different).  Currently, scalar deferred character length left-hand
2237     sides are correctly handled but arrays are not yet fully
2238     implemented.
2239
2240   * Deferred-length character variables and scalar deferred-length
2241     character components of derived types are supported.  (Note that
2242     array-valued compoents are not yet implemented.)
2243
2244   * Transferring of allocations via 'MOVE_ALLOC'.
2245
2246   * The 'PRIVATE' and 'PUBLIC' attributes may be given individually to
2247     derived-type components.
2248
2249   * In pointer assignments, the lower bound may be specified and the
2250     remapping of elements is supported.
2251
2252   * For pointers an 'INTENT' may be specified which affect the
2253     association status not the value of the pointer target.
2254
2255   * Intrinsics 'command_argument_count', 'get_command',
2256     'get_command_argument', and 'get_environment_variable'.
2257
2258   * Support for Unicode characters (ISO 10646) and UTF-8, including the
2259     'SELECTED_CHAR_KIND' and 'NEW_LINE' intrinsic functions.
2260
2261   * Support for binary, octal and hexadecimal (BOZ) constants in the
2262     intrinsic functions 'INT', 'REAL', 'CMPLX' and 'DBLE'.
2263
2264   * Support for namelist variables with allocatable and pointer
2265     attribute and nonconstant length type parameter.
2266
2267   * Array constructors using square brackets.  That is, '[...]' rather
2268     than '(/.../)'.  Type-specification for array constructors like '(/
2269     some-type :: ... /)'.
2270
2271   * Extensions to the specification and initialization expressions,
2272     including the support for intrinsics with real and complex
2273     arguments.
2274
2275   * Support for the asynchronous input/output.
2276
2277   * 'FLUSH' statement.
2278
2279   * 'IOMSG=' specifier for I/O statements.
2280
2281   * Support for the declaration of enumeration constants via the 'ENUM'
2282     and 'ENUMERATOR' statements.  Interoperability with 'gcc' is
2283     guaranteed also for the case where the '-fshort-enums' command line
2284     option is given.
2285
2286   * TR 15581:
2287        * 'ALLOCATABLE' dummy arguments.
2288        * 'ALLOCATABLE' function results
2289        * 'ALLOCATABLE' components of derived types
2290
2291   * The 'OPEN' statement supports the 'ACCESS='STREAM'' specifier,
2292     allowing I/O without any record structure.
2293
2294   * Namelist input/output for internal files.
2295
2296   * Minor I/O features: Rounding during formatted output, using of a
2297     decimal comma instead of a decimal point, setting whether a plus
2298     sign should appear for positive numbers.  On systems where 'strtod'
2299     honours the rounding mode, the rounding mode is also supported for
2300     input.
2301
2302   * The 'PROTECTED' statement and attribute.
2303
2304   * The 'VALUE' statement and attribute.
2305
2306   * The 'VOLATILE' statement and attribute.
2307
2308   * The 'IMPORT' statement, allowing to import host-associated derived
2309     types.
2310
2311   * The intrinsic modules 'ISO_FORTRAN_ENVIRONMENT' is supported, which
2312     contains parameters of the I/O units, storage sizes.  Additionally,
2313     procedures for C interoperability are available in the
2314     'ISO_C_BINDING' module.
2315
2316   * 'USE' statement with 'INTRINSIC' and 'NON_INTRINSIC' attribute;
2317     supported intrinsic modules: 'ISO_FORTRAN_ENV', 'ISO_C_BINDING',
2318     'OMP_LIB' and 'OMP_LIB_KINDS', and 'OPENACC'.
2319
2320   * Renaming of operators in the 'USE' statement.
2321
2322
2323File: gfortran.info,  Node: Fortran 2008 status,  Next: Fortran 2018 status,  Prev: Fortran 2003 status,  Up: Fortran standards status
2324
23254.2 Fortran 2008 status
2326=======================
2327
2328The latest version of the Fortran standard is ISO/IEC 1539-1:2010,
2329informally known as Fortran 2008.  The official version is available
2330from International Organization for Standardization (ISO) or its
2331national member organizations.  The the final draft (FDIS) can be
2332downloaded free of charge from
2333<http://www.nag.co.uk/sc22wg5/links.html>.  Fortran is developed by the
2334Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1
2335of the International Organization for Standardization and the
2336International Electrotechnical Commission (IEC). This group is known as
2337WG5 (http://www.nag.co.uk/sc22wg5/).
2338
2339   The GNU Fortran compiler supports several of the new features of
2340Fortran 2008; the wiki (https://gcc.gnu.org/wiki/Fortran2008Status) has
2341some information about the current Fortran 2008 implementation status.
2342In particular, the following is implemented.
2343
2344   * The '-std=f2008' option and support for the file extensions '.f08'
2345     and '.F08'.
2346
2347   * The 'OPEN' statement now supports the 'NEWUNIT=' option, which
2348     returns a unique file unit, thus preventing inadvertent use of the
2349     same unit in different parts of the program.
2350
2351   * The 'g0' format descriptor and unlimited format items.
2352
2353   * The mathematical intrinsics 'ASINH', 'ACOSH', 'ATANH', 'ERF',
2354     'ERFC', 'GAMMA', 'LOG_GAMMA', 'BESSEL_J0', 'BESSEL_J1',
2355     'BESSEL_JN', 'BESSEL_Y0', 'BESSEL_Y1', 'BESSEL_YN', 'HYPOT',
2356     'NORM2', and 'ERFC_SCALED'.
2357
2358   * Using complex arguments with 'TAN', 'SINH', 'COSH', 'TANH', 'ASIN',
2359     'ACOS', and 'ATAN' is now possible; 'ATAN'(Y,X) is now an alias for
2360     'ATAN2'(Y,X).
2361
2362   * Support of the 'PARITY' intrinsic functions.
2363
2364   * The following bit intrinsics: 'LEADZ' and 'TRAILZ' for counting the
2365     number of leading and trailing zero bits, 'POPCNT' and 'POPPAR' for
2366     counting the number of one bits and returning the parity; 'BGE',
2367     'BGT', 'BLE', and 'BLT' for bitwise comparisons; 'DSHIFTL' and
2368     'DSHIFTR' for combined left and right shifts, 'MASKL' and 'MASKR'
2369     for simple left and right justified masks, 'MERGE_BITS' for a
2370     bitwise merge using a mask, 'SHIFTA', 'SHIFTL' and 'SHIFTR' for
2371     shift operations, and the transformational bit intrinsics 'IALL',
2372     'IANY' and 'IPARITY'.
2373
2374   * Support of the 'EXECUTE_COMMAND_LINE' intrinsic subroutine.
2375
2376   * Support for the 'STORAGE_SIZE' intrinsic inquiry function.
2377
2378   * The 'INT{8,16,32}' and 'REAL{32,64,128}' kind type parameters and
2379     the array-valued named constants 'INTEGER_KINDS', 'LOGICAL_KINDS',
2380     'REAL_KINDS' and 'CHARACTER_KINDS' of the intrinsic module
2381     'ISO_FORTRAN_ENV'.
2382
2383   * The module procedures 'C_SIZEOF' of the intrinsic module
2384     'ISO_C_BINDINGS' and 'COMPILER_VERSION' and 'COMPILER_OPTIONS' of
2385     'ISO_FORTRAN_ENV'.
2386
2387   * Coarray support for serial programs with '-fcoarray=single' flag
2388     and experimental support for multiple images with the
2389     '-fcoarray=lib' flag.
2390
2391   * Submodules are supported.  It should noted that 'MODULEs' do not
2392     produce the smod file needed by the descendent 'SUBMODULEs' unless
2393     they contain at least one 'MODULE PROCEDURE' interface.  The reason
2394     for this is that 'SUBMODULEs' are useless without 'MODULE
2395     PROCEDUREs'.  See http://j3-fortran.org/doc/meeting/207/15-209.txt
2396     for a discussion and a draft interpretation.  Adopting this
2397     interpretation has the advantage that code that does not use
2398     submodules does not generate smod files.
2399
2400   * The 'DO CONCURRENT' construct is supported.
2401
2402   * The 'BLOCK' construct is supported.
2403
2404   * The 'STOP' and the new 'ERROR STOP' statements now support all
2405     constant expressions.  Both show the signals which were signaling
2406     at termination.
2407
2408   * Support for the 'CONTIGUOUS' attribute.
2409
2410   * Support for 'ALLOCATE' with 'MOLD'.
2411
2412   * Support for the 'IMPURE' attribute for procedures, which allows for
2413     'ELEMENTAL' procedures without the restrictions of 'PURE'.
2414
2415   * Null pointers (including 'NULL()') and not-allocated variables can
2416     be used as actual argument to optional non-pointer, non-allocatable
2417     dummy arguments, denoting an absent argument.
2418
2419   * Non-pointer variables with 'TARGET' attribute can be used as actual
2420     argument to 'POINTER' dummies with 'INTENT(IN)'.
2421
2422   * Pointers including procedure pointers and those in a derived type
2423     (pointer components) can now be initialized by a target instead of
2424     only by 'NULL'.
2425
2426   * The 'EXIT' statement (with construct-name) can be now be used to
2427     leave not only the 'DO' but also the 'ASSOCIATE', 'BLOCK', 'IF',
2428     'SELECT CASE' and 'SELECT TYPE' constructs.
2429
2430   * Internal procedures can now be used as actual argument.
2431
2432   * Minor features: obsolesce diagnostics for 'ENTRY' with
2433     '-std=f2008'; a line may start with a semicolon; for internal and
2434     module procedures 'END' can be used instead of 'END SUBROUTINE' and
2435     'END FUNCTION'; 'SELECTED_REAL_KIND' now also takes a 'RADIX'
2436     argument; intrinsic types are supported for
2437     'TYPE'(INTRINSIC-TYPE-SPEC); multiple type-bound procedures can be
2438     declared in a single 'PROCEDURE' statement; implied-shape arrays
2439     are supported for named constants ('PARAMETER').
2440
2441
2442File: gfortran.info,  Node: Fortran 2018 status,  Prev: Fortran 2008 status,  Up: Fortran standards status
2443
24444.3 Status of Fortran 2018 support
2445==================================
2446
2447   * ERROR STOP in a PURE procedure An 'ERROR STOP' statement is
2448     permitted in a 'PURE' procedure.
2449
2450   * IMPLICIT NONE with a spec-list Support the 'IMPLICIT NONE'
2451     statement with an 'implicit-none-spec-list'.
2452
2453   * Behavior of INQUIRE with the RECL= specifier
2454
2455     The behavior of the 'INQUIRE' statement with the 'RECL=' specifier
2456     now conforms to Fortran 2018.
2457
24584.3.1 TS 29113 Status (Further Interoperability with C)
2459-------------------------------------------------------
2460
2461GNU Fortran supports some of the new features of the Technical
2462Specification (TS) 29113 on Further Interoperability of Fortran with C.
2463The wiki (https://gcc.gnu.org/wiki/TS29113Status) has some information
2464about the current TS 29113 implementation status.  In particular, the
2465following is implemented.
2466
2467   See also *note Further Interoperability of Fortran with C::.
2468
2469   * The 'OPTIONAL' attribute is allowed for dummy arguments of 'BIND(C)
2470     procedures.'
2471
2472   * The 'RANK' intrinsic is supported.
2473
2474   * GNU Fortran's implementation for variables with 'ASYNCHRONOUS'
2475     attribute is compatible with TS 29113.
2476
2477   * Assumed types ('TYPE(*)').
2478
2479   * Assumed-rank ('DIMENSION(..)').
2480
2481   * ISO_Fortran_binding (now in Fortran 2018 18.4) is implemented such
2482     that conversion of the array descriptor for assumed type or assumed
2483     rank arrays is done in the library.  The include file
2484     ISO_Fortran_binding.h is can be found in
2485     '~prefix/lib/gcc/$target/$version'.
2486
24874.3.2 TS 18508 Status (Additional Parallel Features)
2488----------------------------------------------------
2489
2490GNU Fortran supports the following new features of the Technical
2491Specification 18508 on Additional Parallel Features in Fortran:
2492
2493   * The new atomic ADD, CAS, FETCH and ADD/OR/XOR, OR and XOR
2494     intrinsics.
2495
2496   * The 'CO_MIN' and 'CO_MAX' and 'SUM' reduction intrinsics.  And the
2497     'CO_BROADCAST' and 'CO_REDUCE' intrinsic, except that those do not
2498     support polymorphic types or types with allocatable, pointer or
2499     polymorphic components.
2500
2501   * Events ('EVENT POST', 'EVENT WAIT', 'EVENT_QUERY')
2502
2503   * Failed images ('FAIL IMAGE', 'IMAGE_STATUS', 'FAILED_IMAGES',
2504     'STOPPED_IMAGES')
2505
2506
2507File: gfortran.info,  Node: Compiler Characteristics,  Next: Extensions,  Prev: Fortran standards status,  Up: Top
2508
25095 Compiler Characteristics
2510**************************
2511
2512This chapter describes certain characteristics of the GNU Fortran
2513compiler, that are not specified by the Fortran standard, but which
2514might in some way or another become visible to the programmer.
2515
2516* Menu:
2517
2518* KIND Type Parameters::
2519* Internal representation of LOGICAL variables::
2520* Evaluation of logical expressions::
2521* MAX and MIN intrinsics with REAL NaN arguments::
2522* Thread-safety of the runtime library::
2523* Data consistency and durability::
2524* Files opened without an explicit ACTION= specifier::
2525* File operations on symbolic links::
2526* File format of unformatted sequential files::
2527* Asynchronous I/O::
2528
2529
2530File: gfortran.info,  Node: KIND Type Parameters,  Next: Internal representation of LOGICAL variables,  Up: Compiler Characteristics
2531
25325.1 KIND Type Parameters
2533========================
2534
2535The 'KIND' type parameters supported by GNU Fortran for the primitive
2536data types are:
2537
2538'INTEGER'
2539     1, 2, 4, 8*, 16*, default: 4**
2540
2541'LOGICAL'
2542     1, 2, 4, 8*, 16*, default: 4**
2543
2544'REAL'
2545     4, 8, 10*, 16*, default: 4***
2546
2547'COMPLEX'
2548     4, 8, 10*, 16*, default: 4***
2549
2550'DOUBLE PRECISION'
2551     4, 8, 10*, 16*, default: 8***
2552
2553'CHARACTER'
2554     1, 4, default: 1
2555
2556* not available on all systems
2557** unless '-fdefault-integer-8' is used
2558*** unless '-fdefault-real-8' is used (see *note Fortran Dialect
2559Options::)
2560
2561The 'KIND' value matches the storage size in bytes, except for 'COMPLEX'
2562where the storage size is twice as much (or both real and imaginary part
2563are a real value of the given size).  It is recommended to use the *note
2564SELECTED_CHAR_KIND::, *note SELECTED_INT_KIND:: and *note
2565SELECTED_REAL_KIND:: intrinsics or the 'INT8', 'INT16', 'INT32',
2566'INT64', 'REAL32', 'REAL64', and 'REAL128' parameters of the
2567'ISO_FORTRAN_ENV' module instead of the concrete values.  The available
2568kind parameters can be found in the constant arrays 'CHARACTER_KINDS',
2569'INTEGER_KINDS', 'LOGICAL_KINDS' and 'REAL_KINDS' in the *note
2570ISO_FORTRAN_ENV:: module.  For C interoperability, the kind parameters
2571of the *note ISO_C_BINDING:: module should be used.
2572
2573
2574File: gfortran.info,  Node: Internal representation of LOGICAL variables,  Next: Evaluation of logical expressions,  Prev: KIND Type Parameters,  Up: Compiler Characteristics
2575
25765.2 Internal representation of LOGICAL variables
2577================================================
2578
2579The Fortran standard does not specify how variables of 'LOGICAL' type
2580are represented, beyond requiring that 'LOGICAL' variables of default
2581kind have the same storage size as default 'INTEGER' and 'REAL'
2582variables.  The GNU Fortran internal representation is as follows.
2583
2584   A 'LOGICAL(KIND=N)' variable is represented as an 'INTEGER(KIND=N)'
2585variable, however, with only two permissible values: '1' for '.TRUE.'
2586and '0' for '.FALSE.'.  Any other integer value results in undefined
2587behavior.
2588
2589   See also *note Argument passing conventions:: and *note
2590Interoperability with C::.
2591
2592
2593File: 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
2594
25955.3 Evaluation of logical expressions
2596=====================================
2597
2598The Fortran standard does not require the compiler to evaluate all parts
2599of an expression, if they do not contribute to the final result.  For
2600logical expressions with '.AND.' or '.OR.' operators, in particular, GNU
2601Fortran will optimize out function calls (even to impure functions) if
2602the result of the expression can be established without them.  However,
2603since not all compilers do that, and such an optimization can
2604potentially modify the program flow and subsequent results, GNU Fortran
2605throws warnings for such situations with the '-Wfunction-elimination'
2606flag.
2607
2608
2609File: 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
2610
26115.4 MAX and MIN intrinsics with REAL NaN arguments
2612==================================================
2613
2614The Fortran standard does not specify what the result of the 'MAX' and
2615'MIN' intrinsics are if one of the arguments is a 'NaN'.  Accordingly,
2616the GNU Fortran compiler does not specify that either, as this allows
2617for faster and more compact code to be generated.  If the programmer
2618wishes to take some specific action in case one of the arguments is a
2619'NaN', it is necessary to explicitly test the arguments before calling
2620'MAX' or 'MIN', e.g.  with the 'IEEE_IS_NAN' function from the intrinsic
2621module 'IEEE_ARITHMETIC'.
2622
2623
2624File: 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
2625
26265.5 Thread-safety of the runtime library
2627========================================
2628
2629GNU Fortran can be used in programs with multiple threads, e.g. by using
2630OpenMP, by calling OS thread handling functions via the 'ISO_C_BINDING'
2631facility, or by GNU Fortran compiled library code being called from a
2632multi-threaded program.
2633
2634   The GNU Fortran runtime library, ('libgfortran'), supports being
2635called concurrently from multiple threads with the following exceptions.
2636
2637   During library initialization, the C 'getenv' function is used, which
2638need not be thread-safe.  Similarly, the 'getenv' function is used to
2639implement the 'GET_ENVIRONMENT_VARIABLE' and 'GETENV' intrinsics.  It is
2640the responsibility of the user to ensure that the environment is not
2641being updated concurrently when any of these actions are taking place.
2642
2643   The 'EXECUTE_COMMAND_LINE' and 'SYSTEM' intrinsics are implemented
2644with the 'system' function, which need not be thread-safe.  It is the
2645responsibility of the user to ensure that 'system' is not called
2646concurrently.
2647
2648   For platforms not supporting thread-safe POSIX functions, further
2649functionality might not be thread-safe.  For details, please consult the
2650documentation for your operating system.
2651
2652   The GNU Fortran runtime library uses various C library functions that
2653depend on the locale, such as 'strtod' and 'snprintf'.  In order to work
2654correctly in locale-aware programs that set the locale using
2655'setlocale', the locale is reset to the default "C" locale while
2656executing a formatted 'READ' or 'WRITE' statement.  On targets
2657supporting the POSIX 2008 per-thread locale functions (e.g.
2658'newlocale', 'uselocale', 'freelocale'), these are used and thus the
2659global locale set using 'setlocale' or the per-thread locales in other
2660threads are not affected.  However, on targets lacking this
2661functionality, the global LC_NUMERIC locale is set to "C" during the
2662formatted I/O. Thus, on such targets it's not safe to call 'setlocale'
2663concurrently from another thread while a Fortran formatted I/O operation
2664is in progress.  Also, other threads doing something dependent on the
2665LC_NUMERIC locale might not work correctly if a formatted I/O operation
2666is in progress in another thread.
2667
2668
2669File: 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
2670
26715.6 Data consistency and durability
2672===================================
2673
2674This section contains a brief overview of data and metadata consistency
2675and durability issues when doing I/O.
2676
2677   With respect to durability, GNU Fortran makes no effort to ensure
2678that data is committed to stable storage.  If this is required, the GNU
2679Fortran programmer can use the intrinsic 'FNUM' to retrieve the low
2680level file descriptor corresponding to an open Fortran unit.  Then,
2681using e.g.  the 'ISO_C_BINDING' feature, one can call the underlying
2682system call to flush dirty data to stable storage, such as 'fsync' on
2683POSIX, '_commit' on MingW, or 'fcntl(fd, F_FULLSYNC, 0)' on Mac OS X.
2684The following example shows how to call fsync:
2685
2686       ! Declare the interface for POSIX fsync function
2687       interface
2688         function fsync (fd) bind(c,name="fsync")
2689         use iso_c_binding, only: c_int
2690           integer(c_int), value :: fd
2691           integer(c_int) :: fsync
2692         end function fsync
2693       end interface
2694
2695       ! Variable declaration
2696       integer :: ret
2697
2698       ! Opening unit 10
2699       open (10,file="foo")
2700
2701       ! ...
2702       ! Perform I/O on unit 10
2703       ! ...
2704
2705       ! Flush and sync
2706       flush(10)
2707       ret = fsync(fnum(10))
2708
2709       ! Handle possible error
2710       if (ret /= 0) stop "Error calling FSYNC"
2711
2712   With respect to consistency, for regular files GNU Fortran uses
2713buffered I/O in order to improve performance.  This buffer is flushed
2714automatically when full and in some other situations, e.g.  when closing
2715a unit.  It can also be explicitly flushed with the 'FLUSH' statement.
2716Also, the buffering can be turned off with the 'GFORTRAN_UNBUFFERED_ALL'
2717and 'GFORTRAN_UNBUFFERED_PRECONNECTED' environment variables.  Special
2718files, such as terminals and pipes, are always unbuffered.  Sometimes,
2719however, further things may need to be done in order to allow other
2720processes to see data that GNU Fortran has written, as follows.
2721
2722   The Windows platform supports a relaxed metadata consistency model,
2723where file metadata is written to the directory lazily.  This means
2724that, for instance, the 'dir' command can show a stale size for a file.
2725One can force a directory metadata update by closing the unit, or by
2726calling '_commit' on the file descriptor.  Note, though, that '_commit'
2727will force all dirty data to stable storage, which is often a very slow
2728operation.
2729
2730   The Network File System (NFS) implements a relaxed consistency model
2731called open-to-close consistency.  Closing a file forces dirty data and
2732metadata to be flushed to the server, and opening a file forces the
2733client to contact the server in order to revalidate cached data.
2734'fsync' will also force a flush of dirty data and metadata to the
2735server.  Similar to 'open' and 'close', acquiring and releasing 'fcntl'
2736file locks, if the server supports them, will also force cache
2737validation and flushing dirty data and metadata.
2738
2739
2740File: gfortran.info,  Node: Files opened without an explicit ACTION= specifier,  Next: File operations on symbolic links,  Prev: Data consistency and durability,  Up: Compiler Characteristics
2741
27425.7 Files opened without an explicit ACTION= specifier
2743======================================================
2744
2745The Fortran standard says that if an 'OPEN' statement is executed
2746without an explicit 'ACTION=' specifier, the default value is processor
2747dependent.  GNU Fortran behaves as follows:
2748
2749  1. Attempt to open the file with 'ACTION='READWRITE''
2750  2. If that fails, try to open with 'ACTION='READ''
2751  3. If that fails, try to open with 'ACTION='WRITE''
2752  4. If that fails, generate an error
2753
2754
2755File: 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
2756
27575.8 File operations on symbolic links
2758=====================================
2759
2760This section documents the behavior of GNU Fortran for file operations
2761on symbolic links, on systems that support them.
2762
2763   * Results of INQUIRE statements of the "inquire by file" form will
2764     relate to the target of the symbolic link.  For example,
2765     'INQUIRE(FILE="foo",EXIST=ex)' will set EX to .TRUE. if FOO is a
2766     symbolic link pointing to an existing file, and .FALSE. if FOO
2767     points to an non-existing file ("dangling" symbolic link).
2768
2769   * Using the 'OPEN' statement with a 'STATUS="NEW"' specifier on a
2770     symbolic link will result in an error condition, whether the
2771     symbolic link points to an existing target or is dangling.
2772
2773   * If a symbolic link was connected, using the 'CLOSE' statement with
2774     a 'STATUS="DELETE"' specifier will cause the symbolic link itself
2775     to be deleted, not its target.
2776
2777
2778File: gfortran.info,  Node: File format of unformatted sequential files,  Next: Asynchronous I/O,  Prev: File operations on symbolic links,  Up: Compiler Characteristics
2779
27805.9 File format of unformatted sequential files
2781===============================================
2782
2783Unformatted sequential files are stored as logical records using record
2784markers.  Each logical record consists of one of more subrecords.
2785
2786   Each subrecord consists of a leading record marker, the data written
2787by the user program, and a trailing record marker.  The record markers
2788are four-byte integers by default, and eight-byte integers if the
2789'-fmax-subrecord-length=8' option (which exists for backwards
2790compability only) is in effect.
2791
2792   The representation of the record markers is that of unformatted files
2793given with the '-fconvert' option, the *note CONVERT specifier:: in an
2794open statement or the *note GFORTRAN_CONVERT_UNIT:: environment
2795variable.
2796
2797   The maximum number of bytes of user data in a subrecord is 2147483639
2798(2 GiB - 9) for a four-byte record marker.  This limit can be lowered
2799with the '-fmax-subrecord-length' option, altough this is rarely useful.
2800If the length of a logical record exceeds this limit, the data is
2801distributed among several subrecords.
2802
2803   The absolute of the number stored in the record markers is the number
2804of bytes of user data in the corresponding subrecord.  If the leading
2805record marker of a subrecord contains a negative number, another
2806subrecord follows the current one.  If the trailing record marker
2807contains a negative number, then there is a preceding subrecord.
2808
2809   In the most simple case, with only one subrecord per logical record,
2810both record markers contain the number of bytes of user data in the
2811record.
2812
2813   The format for unformatted sequential data can be duplicated using
2814unformatted stream, as shown in the example program for an unformatted
2815record containing a single subrecord:
2816
2817     program main
2818       use iso_fortran_env, only: int32
2819       implicit none
2820       integer(int32) :: i
2821       real, dimension(10) :: a, b
2822       call random_number(a)
2823       open (10,file='test.dat',form='unformatted',access='stream')
2824       inquire (iolength=i) a
2825       write (10) i, a, i
2826       close (10)
2827       open (10,file='test.dat',form='unformatted')
2828       read (10) b
2829       if (all (a == b)) print *,'success!'
2830     end program main
2831
2832
2833File: gfortran.info,  Node: Asynchronous I/O,  Prev: File format of unformatted sequential files,  Up: Compiler Characteristics
2834
28355.10 Asynchronous I/O
2836=====================
2837
2838Asynchronous I/O is supported if the program is linked against the POSIX
2839thread library.  If that is not the case, all I/O is performed as
2840synchronous.  On systems which do not support pthread condition
2841variables, such as AIX, I/O is also performed as synchronous.
2842
2843   On some systems, such as Darwin or Solaris, the POSIX thread library
2844is always linked in, so asynchronous I/O is always performed.  On other
2845sytems, such as Linux, it is necessary to specify '-pthread',
2846'-lpthread' or '-fopenmp' during the linking step.
2847
2848
2849File: gfortran.info,  Node: Extensions,  Next: Mixed-Language Programming,  Prev: Compiler Characteristics,  Up: Top
2850
28516 Extensions
2852************
2853
2854The two sections below detail the extensions to standard Fortran that
2855are implemented in GNU Fortran, as well as some of the popular or
2856historically important extensions that are not (or not yet) implemented.
2857For the latter case, we explain the alternatives available to GNU
2858Fortran users, including replacement by standard-conforming code or GNU
2859extensions.
2860
2861* Menu:
2862
2863* Extensions implemented in GNU Fortran::
2864* Extensions not implemented in GNU Fortran::
2865
2866
2867File: gfortran.info,  Node: Extensions implemented in GNU Fortran,  Next: Extensions not implemented in GNU Fortran,  Up: Extensions
2868
28696.1 Extensions implemented in GNU Fortran
2870=========================================
2871
2872GNU Fortran implements a number of extensions over standard Fortran.
2873This chapter contains information on their syntax and meaning.  There
2874are currently two categories of GNU Fortran extensions, those that
2875provide functionality beyond that provided by any standard, and those
2876that are supported by GNU Fortran purely for backward compatibility with
2877legacy compilers.  By default, '-std=gnu' allows the compiler to accept
2878both types of extensions, but to warn about the use of the latter.
2879Specifying either '-std=f95', '-std=f2003', '-std=f2008', or
2880'-std=f2018' disables both types of extensions, and '-std=legacy' allows
2881both without warning.  The special compile flag '-fdec' enables
2882additional compatibility extensions along with those enabled by
2883'-std=legacy'.
2884
2885* Menu:
2886
2887* Old-style kind specifications::
2888* Old-style variable initialization::
2889* Extensions to namelist::
2890* X format descriptor without count field::
2891* Commas in FORMAT specifications::
2892* Missing period in FORMAT specifications::
2893* I/O item lists::
2894* Q exponent-letter::
2895* BOZ literal constants::
2896* Real array indices::
2897* Unary operators::
2898* Implicitly convert LOGICAL and INTEGER values::
2899* Hollerith constants support::
2900* Cray pointers::
2901* CONVERT specifier::
2902* OpenMP::
2903* OpenACC::
2904* Argument list functions::
2905* Read/Write after EOF marker::
2906* STRUCTURE and RECORD::
2907* UNION and MAP::
2908* Type variants for integer intrinsics::
2909* AUTOMATIC and STATIC attributes::
2910* Extended math intrinsics::
2911* Form feed as whitespace::
2912* TYPE as an alias for PRINT::
2913* %LOC as an rvalue::
2914* .XOR. operator::
2915* Bitwise logical operators::
2916* Extended I/O specifiers::
2917* Legacy PARAMETER statements::
2918* Default exponents::
2919
2920
2921File: gfortran.info,  Node: Old-style kind specifications,  Next: Old-style variable initialization,  Up: Extensions implemented in GNU Fortran
2922
29236.1.1 Old-style kind specifications
2924-----------------------------------
2925
2926GNU Fortran allows old-style kind specifications in declarations.  These
2927look like:
2928           TYPESPEC*size x,y,z
2929where 'TYPESPEC' is a basic type ('INTEGER', 'REAL', etc.), and where
2930'size' is a byte count corresponding to the storage size of a valid kind
2931for that type.  (For 'COMPLEX' variables, 'size' is the total size of
2932the real and imaginary parts.)  The statement then declares 'x', 'y' and
2933'z' to be of type 'TYPESPEC' with the appropriate kind.  This is
2934equivalent to the standard-conforming declaration
2935           TYPESPEC(k) x,y,z
2936where 'k' is the kind parameter suitable for the intended precision.  As
2937kind parameters are implementation-dependent, use the 'KIND',
2938'SELECTED_INT_KIND' and 'SELECTED_REAL_KIND' intrinsics to retrieve the
2939correct value, for instance 'REAL*8 x' can be replaced by:
2940     INTEGER, PARAMETER :: dbl = KIND(1.0d0)
2941     REAL(KIND=dbl) :: x
2942
2943
2944File: gfortran.info,  Node: Old-style variable initialization,  Next: Extensions to namelist,  Prev: Old-style kind specifications,  Up: Extensions implemented in GNU Fortran
2945
29466.1.2 Old-style variable initialization
2947---------------------------------------
2948
2949GNU Fortran allows old-style initialization of variables of the form:
2950           INTEGER i/1/,j/2/
2951           REAL x(2,2) /3*0.,1./
2952   The syntax for the initializers is as for the 'DATA' statement, but
2953unlike in a 'DATA' statement, an initializer only applies to the
2954variable immediately preceding the initialization.  In other words,
2955something like 'INTEGER I,J/2,3/' is not valid.  This style of
2956initialization is only allowed in declarations without double colons
2957('::'); the double colons were introduced in Fortran 90, which also
2958introduced a standard syntax for initializing variables in type
2959declarations.
2960
2961   Examples of standard-conforming code equivalent to the above example
2962are:
2963     ! Fortran 90
2964           INTEGER :: i = 1, j = 2
2965           REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x))
2966     ! Fortran 77
2967           INTEGER i, j
2968           REAL x(2,2)
2969           DATA i/1/, j/2/, x/3*0.,1./
2970
2971   Note that variables which are explicitly initialized in declarations
2972or in 'DATA' statements automatically acquire the 'SAVE' attribute.
2973
2974
2975File: gfortran.info,  Node: Extensions to namelist,  Next: X format descriptor without count field,  Prev: Old-style variable initialization,  Up: Extensions implemented in GNU Fortran
2976
29776.1.3 Extensions to namelist
2978----------------------------
2979
2980GNU Fortran fully supports the Fortran 95 standard for namelist I/O
2981including array qualifiers, substrings and fully qualified derived
2982types.  The output from a namelist write is compatible with namelist
2983read.  The output has all names in upper case and indentation to column
29841 after the namelist name.  Two extensions are permitted:
2985
2986   Old-style use of '$' instead of '&'
2987     $MYNML
2988      X(:)%Y(2) = 1.0 2.0 3.0
2989      CH(1:4) = "abcd"
2990     $END
2991
2992   It should be noted that the default terminator is '/' rather than
2993'&END'.
2994
2995   Querying of the namelist when inputting from stdin.  After at least
2996one space, entering '?' sends to stdout the namelist name and the names
2997of the variables in the namelist:
2998      ?
2999
3000     &mynml
3001      x
3002      x%y
3003      ch
3004     &end
3005
3006   Entering '=?' outputs the namelist to stdout, as if 'WRITE(*,NML =
3007mynml)' had been called:
3008     =?
3009
3010     &MYNML
3011      X(1)%Y=  0.000000    ,  1.000000    ,  0.000000    ,
3012      X(2)%Y=  0.000000    ,  2.000000    ,  0.000000    ,
3013      X(3)%Y=  0.000000    ,  3.000000    ,  0.000000    ,
3014      CH=abcd,  /
3015
3016   To aid this dialog, when input is from stdin, errors send their
3017messages to stderr and execution continues, even if 'IOSTAT' is set.
3018
3019   'PRINT' namelist is permitted.  This causes an error if '-std=f95' is
3020used.
3021     PROGRAM test_print
3022       REAL, dimension (4)  ::  x = (/1.0, 2.0, 3.0, 4.0/)
3023       NAMELIST /mynml/ x
3024       PRINT mynml
3025     END PROGRAM test_print
3026
3027   Expanded namelist reads are permitted.  This causes an error if
3028'-std=f95' is used.  In the following example, the first element of the
3029array will be given the value 0.00 and the two succeeding elements will
3030be given the values 1.00 and 2.00.
3031     &MYNML
3032       X(1,1) = 0.00 , 1.00 , 2.00
3033     /
3034
3035   When writing a namelist, if no 'DELIM=' is specified, by default a
3036double quote is used to delimit character strings.  If -std=F95, F2003,
3037or F2008, etc, the delim status is set to 'none'.  Defaulting to quotes
3038ensures that namelists with character strings can be subsequently read
3039back in accurately.
3040
3041
3042File: gfortran.info,  Node: X format descriptor without count field,  Next: Commas in FORMAT specifications,  Prev: Extensions to namelist,  Up: Extensions implemented in GNU Fortran
3043
30446.1.4 'X' format descriptor without count field
3045-----------------------------------------------
3046
3047To support legacy codes, GNU Fortran permits the count field of the 'X'
3048edit descriptor in 'FORMAT' statements to be omitted.  When omitted, the
3049count is implicitly assumed to be one.
3050
3051            PRINT 10, 2, 3
3052     10     FORMAT (I1, X, I1)
3053
3054
3055File: 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
3056
30576.1.5 Commas in 'FORMAT' specifications
3058---------------------------------------
3059
3060To support legacy codes, GNU Fortran allows the comma separator to be
3061omitted immediately before and after character string edit descriptors
3062in 'FORMAT' statements.
3063
3064            PRINT 10, 2, 3
3065     10     FORMAT ('FOO='I1' BAR='I2)
3066
3067
3068File: gfortran.info,  Node: Missing period in FORMAT specifications,  Next: I/O item lists,  Prev: Commas in FORMAT specifications,  Up: Extensions implemented in GNU Fortran
3069
30706.1.6 Missing period in 'FORMAT' specifications
3071-----------------------------------------------
3072
3073To support legacy codes, GNU Fortran allows missing periods in format
3074specifications if and only if '-std=legacy' is given on the command
3075line.  This is considered non-conforming code and is discouraged.
3076
3077            REAL :: value
3078            READ(*,10) value
3079     10     FORMAT ('F4')
3080
3081
3082File: gfortran.info,  Node: I/O item lists,  Next: Q exponent-letter,  Prev: Missing period in FORMAT specifications,  Up: Extensions implemented in GNU Fortran
3083
30846.1.7 I/O item lists
3085--------------------
3086
3087To support legacy codes, GNU Fortran allows the input item list of the
3088'READ' statement, and the output item lists of the 'WRITE' and 'PRINT'
3089statements, to start with a comma.
3090
3091
3092File: gfortran.info,  Node: Q exponent-letter,  Next: BOZ literal constants,  Prev: I/O item lists,  Up: Extensions implemented in GNU Fortran
3093
30946.1.8 'Q' exponent-letter
3095-------------------------
3096
3097GNU Fortran accepts real literal constants with an exponent-letter of
3098'Q', for example, '1.23Q45'.  The constant is interpreted as a
3099'REAL(16)' entity on targets that support this type.  If the target does
3100not support 'REAL(16)' but has a 'REAL(10)' type, then the
3101real-literal-constant will be interpreted as a 'REAL(10)' entity.  In
3102the absence of 'REAL(16)' and 'REAL(10)', an error will occur.
3103
3104
3105File: gfortran.info,  Node: BOZ literal constants,  Next: Real array indices,  Prev: Q exponent-letter,  Up: Extensions implemented in GNU Fortran
3106
31076.1.9 BOZ literal constants
3108---------------------------
3109
3110Besides decimal constants, Fortran also supports binary ('b'), octal
3111('o') and hexadecimal ('z') integer constants.  The syntax is: 'prefix
3112quote digits quote', were the prefix is either 'b', 'o' or 'z', quote is
3113either ''' or '"' and the digits are for binary '0' or '1', for octal
3114between '0' and '7', and for hexadecimal between '0' and 'F'.  (Example:
3115'b'01011101''.)
3116
3117   Up to Fortran 95, BOZ literals were only allowed to initialize
3118integer variables in DATA statements.  Since Fortran 2003 BOZ literals
3119are also allowed as argument of 'REAL', 'DBLE', 'INT' and 'CMPLX'; the
3120result is the same as if the integer BOZ literal had been converted by
3121'TRANSFER' to, respectively, 'real', 'double precision', 'integer' or
3122'complex'.  As GNU Fortran extension the intrinsic procedures 'FLOAT',
3123'DFLOAT', 'COMPLEX' and 'DCMPLX' are treated alike.
3124
3125   As an extension, GNU Fortran allows hexadecimal BOZ literal constants
3126to be specified using the 'X' prefix, in addition to the standard 'Z'
3127prefix.  The BOZ literal can also be specified by adding a suffix to the
3128string, for example, 'Z'ABC'' and ''ABC'Z' are equivalent.
3129
3130   Furthermore, GNU Fortran allows using BOZ literal constants outside
3131DATA statements and the four intrinsic functions allowed by Fortran
31322003.  In DATA statements, in direct assignments, where the right-hand
3133side only contains a BOZ literal constant, and for old-style
3134initializers of the form 'integer i /o'0173'/', the constant is
3135transferred as if 'TRANSFER' had been used; for 'COMPLEX' numbers, only
3136the real part is initialized unless 'CMPLX' is used.  In all other
3137cases, the BOZ literal constant is converted to an 'INTEGER' value with
3138the largest decimal representation.  This value is then converted
3139numerically to the type and kind of the variable in question.  (For
3140instance, 'real :: r = b'0000001' + 1' initializes 'r' with '2.0'.)  As
3141different compilers implement the extension differently, one should be
3142careful when doing bitwise initialization of non-integer variables.
3143
3144   Note that initializing an 'INTEGER' variable with a statement such as
3145'DATA i/Z'FFFFFFFF'/' will give an integer overflow error rather than
3146the desired result of -1 when 'i' is a 32-bit integer on a system that
3147supports 64-bit integers.  The '-fno-range-check' option can be used as
3148a workaround for legacy code that initializes integers in this manner.
3149
3150
3151File: gfortran.info,  Node: Real array indices,  Next: Unary operators,  Prev: BOZ literal constants,  Up: Extensions implemented in GNU Fortran
3152
31536.1.10 Real array indices
3154-------------------------
3155
3156As an extension, GNU Fortran allows the use of 'REAL' expressions or
3157variables as array indices.
3158
3159
3160File: gfortran.info,  Node: Unary operators,  Next: Implicitly convert LOGICAL and INTEGER values,  Prev: Real array indices,  Up: Extensions implemented in GNU Fortran
3161
31626.1.11 Unary operators
3163----------------------
3164
3165As an extension, GNU Fortran allows unary plus and unary minus operators
3166to appear as the second operand of binary arithmetic operators without
3167the need for parenthesis.
3168
3169            X = Y * -Z
3170
3171
3172File: gfortran.info,  Node: Implicitly convert LOGICAL and INTEGER values,  Next: Hollerith constants support,  Prev: Unary operators,  Up: Extensions implemented in GNU Fortran
3173
31746.1.12 Implicitly convert 'LOGICAL' and 'INTEGER' values
3175--------------------------------------------------------
3176
3177As an extension for backwards compatibility with other compilers, GNU
3178Fortran allows the implicit conversion of 'LOGICAL' values to 'INTEGER'
3179values and vice versa.  When converting from a 'LOGICAL' to an
3180'INTEGER', '.FALSE.' is interpreted as zero, and '.TRUE.' is interpreted
3181as one.  When converting from 'INTEGER' to 'LOGICAL', the value zero is
3182interpreted as '.FALSE.' and any nonzero value is interpreted as
3183'.TRUE.'.
3184
3185             LOGICAL :: l
3186             l = 1
3187             INTEGER :: i
3188             i = .TRUE.
3189
3190   However, there is no implicit conversion of 'INTEGER' values in
3191'if'-statements, nor of 'LOGICAL' or 'INTEGER' values in I/O operations.
3192
3193
3194File: gfortran.info,  Node: Hollerith constants support,  Next: Cray pointers,  Prev: Implicitly convert LOGICAL and INTEGER values,  Up: Extensions implemented in GNU Fortran
3195
31966.1.13 Hollerith constants support
3197----------------------------------
3198
3199GNU Fortran supports Hollerith constants in assignments, function
3200arguments, and 'DATA' and 'ASSIGN' statements.  A Hollerith constant is
3201written as a string of characters preceded by an integer constant
3202indicating the character count, and the letter 'H' or 'h', and stored in
3203bytewise fashion in a numeric ('INTEGER', 'REAL', or 'complex') or
3204'LOGICAL' variable.  The constant will be padded or truncated to fit the
3205size of the variable in which it is stored.
3206
3207   Examples of valid uses of Hollerith constants:
3208           complex*16 x(2)
3209           data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/
3210           x(1) = 16HABCDEFGHIJKLMNOP
3211           call foo (4h abc)
3212
3213   Invalid Hollerith constants examples:
3214           integer*4 a
3215           a = 8H12345678 ! Valid, but the Hollerith constant will be truncated.
3216           a = 0H         ! At least one character is needed.
3217
3218   In general, Hollerith constants were used to provide a rudimentary
3219facility for handling character strings in early Fortran compilers,
3220prior to the introduction of 'CHARACTER' variables in Fortran 77; in
3221those cases, the standard-compliant equivalent is to convert the program
3222to use proper character strings.  On occasion, there may be a case where
3223the intent is specifically to initialize a numeric variable with a given
3224byte sequence.  In these cases, the same result can be obtained by using
3225the 'TRANSFER' statement, as in this example.
3226           INTEGER(KIND=4) :: a
3227           a = TRANSFER ("abcd", a)     ! equivalent to: a = 4Habcd
3228
3229
3230File: gfortran.info,  Node: Cray pointers,  Next: CONVERT specifier,  Prev: Hollerith constants support,  Up: Extensions implemented in GNU Fortran
3231
32326.1.14 Cray pointers
3233--------------------
3234
3235Cray pointers are part of a non-standard extension that provides a
3236C-like pointer in Fortran.  This is accomplished through a pair of
3237variables: an integer "pointer" that holds a memory address, and a
3238"pointee" that is used to dereference the pointer.
3239
3240   Pointer/pointee pairs are declared in statements of the form:
3241             pointer ( <pointer> , <pointee> )
3242   or,
3243             pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ...
3244   The pointer is an integer that is intended to hold a memory address.
3245The pointee may be an array or scalar.  If an assumed-size array is
3246permitted within the scoping unit, a pointee can be an assumed-size
3247array.  That is, the last dimension may be left unspecified by using a
3248'*' in place of a value.  A pointee cannot be an assumed shape array.
3249No space is allocated for the pointee.
3250
3251   The pointee may have its type declared before or after the pointer
3252statement, and its array specification (if any) may be declared before,
3253during, or after the pointer statement.  The pointer may be declared as
3254an integer prior to the pointer statement.  However, some machines have
3255default integer sizes that are different than the size of a pointer, and
3256so the following code is not portable:
3257             integer ipt
3258             pointer (ipt, iarr)
3259   If a pointer is declared with a kind that is too small, the compiler
3260will issue a warning; the resulting binary will probably not work
3261correctly, because the memory addresses stored in the pointers may be
3262truncated.  It is safer to omit the first line of the above example; if
3263explicit declaration of ipt's type is omitted, then the compiler will
3264ensure that ipt is an integer variable large enough to hold a pointer.
3265
3266   Pointer arithmetic is valid with Cray pointers, but it is not the
3267same as C pointer arithmetic.  Cray pointers are just ordinary integers,
3268so the user is responsible for determining how many bytes to add to a
3269pointer in order to increment it.  Consider the following example:
3270             real target(10)
3271             real pointee(10)
3272             pointer (ipt, pointee)
3273             ipt = loc (target)
3274             ipt = ipt + 1
3275   The last statement does not set 'ipt' to the address of 'target(1)',
3276as it would in C pointer arithmetic.  Adding '1' to 'ipt' just adds one
3277byte to the address stored in 'ipt'.
3278
3279   Any expression involving the pointee will be translated to use the
3280value stored in the pointer as the base address.
3281
3282   To get the address of elements, this extension provides an intrinsic
3283function 'LOC()'.  The 'LOC()' function is equivalent to the '&'
3284operator in C, except the address is cast to an integer type:
3285             real ar(10)
3286             pointer(ipt, arpte(10))
3287             real arpte
3288             ipt = loc(ar)  ! Makes arpte is an alias for ar
3289             arpte(1) = 1.0 ! Sets ar(1) to 1.0
3290   The pointer can also be set by a call to the 'MALLOC' intrinsic (see
3291*note MALLOC::).
3292
3293   Cray pointees often are used to alias an existing variable.  For
3294example:
3295             integer target(10)
3296             integer iarr(10)
3297             pointer (ipt, iarr)
3298             ipt = loc(target)
3299   As long as 'ipt' remains unchanged, 'iarr' is now an alias for
3300'target'.  The optimizer, however, will not detect this aliasing, so it
3301is unsafe to use 'iarr' and 'target' simultaneously.  Using a pointee in
3302any way that violates the Fortran aliasing rules or assumptions is
3303illegal.  It is the user's responsibility to avoid doing this; the
3304compiler works under the assumption that no such aliasing occurs.
3305
3306   Cray pointers will work correctly when there is no aliasing (i.e.,
3307when they are used to access a dynamically allocated block of memory),
3308and also in any routine where a pointee is used, but any variable with
3309which it shares storage is not used.  Code that violates these rules may
3310not run as the user intends.  This is not a bug in the optimizer; any
3311code that violates the aliasing rules is illegal.  (Note that this is
3312not unique to GNU Fortran; any Fortran compiler that supports Cray
3313pointers will "incorrectly" optimize code with illegal aliasing.)
3314
3315   There are a number of restrictions on the attributes that can be
3316applied to Cray pointers and pointees.  Pointees may not have the
3317'ALLOCATABLE', 'INTENT', 'OPTIONAL', 'DUMMY', 'TARGET', 'INTRINSIC', or
3318'POINTER' attributes.  Pointers may not have the 'DIMENSION', 'POINTER',
3319'TARGET', 'ALLOCATABLE', 'EXTERNAL', or 'INTRINSIC' attributes, nor may
3320they be function results.  Pointees may not occur in more than one
3321pointer statement.  A pointee cannot be a pointer.  Pointees cannot
3322occur in equivalence, common, or data statements.
3323
3324   A Cray pointer may also point to a function or a subroutine.  For
3325example, the following excerpt is valid:
3326       implicit none
3327       external sub
3328       pointer (subptr,subpte)
3329       external subpte
3330       subptr = loc(sub)
3331       call subpte()
3332       [...]
3333       subroutine sub
3334       [...]
3335       end subroutine sub
3336
3337   A pointer may be modified during the course of a program, and this
3338will change the location to which the pointee refers.  However, when
3339pointees are passed as arguments, they are treated as ordinary variables
3340in the invoked function.  Subsequent changes to the pointer will not
3341change the base address of the array that was passed.
3342
3343
3344File: gfortran.info,  Node: CONVERT specifier,  Next: OpenMP,  Prev: Cray pointers,  Up: Extensions implemented in GNU Fortran
3345
33466.1.15 'CONVERT' specifier
3347--------------------------
3348
3349GNU Fortran allows the conversion of unformatted data between little-
3350and big-endian representation to facilitate moving of data between
3351different systems.  The conversion can be indicated with the 'CONVERT'
3352specifier on the 'OPEN' statement.  *Note GFORTRAN_CONVERT_UNIT::, for
3353an alternative way of specifying the data format via an environment
3354variable.
3355
3356   Valid values for 'CONVERT' are:
3357     'CONVERT='NATIVE'' Use the native format.  This is the default.
3358     'CONVERT='SWAP'' Swap between little- and big-endian.
3359     'CONVERT='LITTLE_ENDIAN'' Use the little-endian representation for
3360     unformatted files.
3361     'CONVERT='BIG_ENDIAN'' Use the big-endian representation for
3362     unformatted files.
3363
3364   Using the option could look like this:
3365       open(file='big.dat',form='unformatted',access='sequential', &
3366            convert='big_endian')
3367
3368   The value of the conversion can be queried by using
3369'INQUIRE(CONVERT=ch)'.  The values returned are ''BIG_ENDIAN'' and
3370''LITTLE_ENDIAN''.
3371
3372   'CONVERT' works between big- and little-endian for 'INTEGER' values
3373of all supported kinds and for 'REAL' on IEEE systems of kinds 4 and 8.
3374Conversion between different "extended double" types on different
3375architectures such as m68k and x86_64, which GNU Fortran supports as
3376'REAL(KIND=10)' and 'REAL(KIND=16)', will probably not work.
3377
3378   _Note that the values specified via the GFORTRAN_CONVERT_UNIT
3379environment variable will override the CONVERT specifier in the open
3380statement_.  This is to give control over data formats to users who do
3381not have the source code of their program available.
3382
3383   Using anything but the native representation for unformatted data
3384carries a significant speed overhead.  If speed in this area matters to
3385you, it is best if you use this only for data that needs to be portable.
3386
3387
3388File: gfortran.info,  Node: OpenMP,  Next: OpenACC,  Prev: CONVERT specifier,  Up: Extensions implemented in GNU Fortran
3389
33906.1.16 OpenMP
3391-------------
3392
3393OpenMP (Open Multi-Processing) is an application programming interface
3394(API) that supports multi-platform shared memory multiprocessing
3395programming in C/C++ and Fortran on many architectures, including Unix
3396and Microsoft Windows platforms.  It consists of a set of compiler
3397directives, library routines, and environment variables that influence
3398run-time behavior.
3399
3400   GNU Fortran strives to be compatible to the OpenMP Application
3401Program Interface v4.5 (http://openmp.org/wp/openmp-specifications/).
3402
3403   To enable the processing of the OpenMP directive '!$omp' in free-form
3404source code; the 'c$omp', '*$omp' and '!$omp' directives in fixed form;
3405the '!$' conditional compilation sentinels in free form; and the 'c$',
3406'*$' and '!$' sentinels in fixed form, 'gfortran' needs to be invoked
3407with the '-fopenmp'.  This also arranges for automatic linking of the
3408GNU Offloading and Multi Processing Runtime Library *note libgomp:
3409(libgomp)Top.
3410
3411   The OpenMP Fortran runtime library routines are provided both in a
3412form of a Fortran 90 module named 'omp_lib' and in a form of a Fortran
3413'include' file named 'omp_lib.h'.
3414
3415   An example of a parallelized loop taken from Appendix A.1 of the
3416OpenMP Application Program Interface v2.5:
3417     SUBROUTINE A1(N, A, B)
3418       INTEGER I, N
3419       REAL B(N), A(N)
3420     !$OMP PARALLEL DO !I is private by default
3421       DO I=2,N
3422         B(I) = (A(I) + A(I-1)) / 2.0
3423       ENDDO
3424     !$OMP END PARALLEL DO
3425     END SUBROUTINE A1
3426
3427   Please note:
3428   * '-fopenmp' implies '-frecursive', i.e., all local arrays will be
3429     allocated on the stack.  When porting existing code to OpenMP, this
3430     may lead to surprising results, especially to segmentation faults
3431     if the stacksize is limited.
3432
3433   * On glibc-based systems, OpenMP enabled applications cannot be
3434     statically linked due to limitations of the underlying
3435     pthreads-implementation.  It might be possible to get a working
3436     solution if '-Wl,--whole-archive -lpthread -Wl,--no-whole-archive'
3437     is added to the command line.  However, this is not supported by
3438     'gcc' and thus not recommended.
3439
3440
3441File: gfortran.info,  Node: OpenACC,  Next: Argument list functions,  Prev: OpenMP,  Up: Extensions implemented in GNU Fortran
3442
34436.1.17 OpenACC
3444--------------
3445
3446OpenACC is an application programming interface (API) that supports
3447offloading of code to accelerator devices.  It consists of a set of
3448compiler directives, library routines, and environment variables that
3449influence run-time behavior.
3450
3451   GNU Fortran strives to be compatible to the OpenACC Application
3452Programming Interface v2.0 (http://www.openacc.org/).
3453
3454   To enable the processing of the OpenACC directive '!$acc' in
3455free-form source code; the 'c$acc', '*$acc' and '!$acc' directives in
3456fixed form; the '!$' conditional compilation sentinels in free form; and
3457the 'c$', '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be
3458invoked with the '-fopenacc'.  This also arranges for automatic linking
3459of the GNU Offloading and Multi Processing Runtime Library *note
3460libgomp: (libgomp)Top.
3461
3462   The OpenACC Fortran runtime library routines are provided both in a
3463form of a Fortran 90 module named 'openacc' and in a form of a Fortran
3464'include' file named 'openacc_lib.h'.
3465
3466   Note that this is an experimental feature, incomplete, and subject to
3467change in future versions of GCC. See <https://gcc.gnu.org/wiki/OpenACC>
3468for more information.
3469
3470
3471File: gfortran.info,  Node: Argument list functions,  Next: Read/Write after EOF marker,  Prev: OpenACC,  Up: Extensions implemented in GNU Fortran
3472
34736.1.18 Argument list functions '%VAL', '%REF' and '%LOC'
3474--------------------------------------------------------
3475
3476GNU Fortran supports argument list functions '%VAL', '%REF' and '%LOC'
3477statements, for backward compatibility with g77.  It is recommended that
3478these should be used only for code that is accessing facilities outside
3479of GNU Fortran, such as operating system or windowing facilities.  It is
3480best to constrain such uses to isolated portions of a program-portions
3481that deal specifically and exclusively with low-level, system-dependent
3482facilities.  Such portions might well provide a portable interface for
3483use by the program as a whole, but are themselves not portable, and
3484should be thoroughly tested each time they are rebuilt using a new
3485compiler or version of a compiler.
3486
3487   '%VAL' passes a scalar argument by value, '%REF' passes it by
3488reference and '%LOC' passes its memory location.  Since gfortran already
3489passes scalar arguments by reference, '%REF' is in effect a do-nothing.
3490'%LOC' has the same effect as a Fortran pointer.
3491
3492   An example of passing an argument by value to a C subroutine foo.:
3493     C
3494     C prototype      void foo_ (float x);
3495     C
3496           external foo
3497           real*4 x
3498           x = 3.14159
3499           call foo (%VAL (x))
3500           end
3501
3502   For details refer to the g77 manual
3503<https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top>.
3504
3505   Also, 'c_by_val.f' and its partner 'c_by_val.c' of the GNU Fortran
3506testsuite are worth a look.
3507
3508
3509File: gfortran.info,  Node: Read/Write after EOF marker,  Next: STRUCTURE and RECORD,  Prev: Argument list functions,  Up: Extensions implemented in GNU Fortran
3510
35116.1.19 Read/Write after EOF marker
3512----------------------------------
3513
3514Some legacy codes rely on allowing 'READ' or 'WRITE' after the EOF file
3515marker in order to find the end of a file.  GNU Fortran normally rejects
3516these codes with a run-time error message and suggests the user consider
3517'BACKSPACE' or 'REWIND' to properly position the file before the EOF
3518marker.  As an extension, the run-time error may be disabled using
3519-std=legacy.
3520
3521
3522File: gfortran.info,  Node: STRUCTURE and RECORD,  Next: UNION and MAP,  Prev: Read/Write after EOF marker,  Up: Extensions implemented in GNU Fortran
3523
35246.1.20 'STRUCTURE' and 'RECORD'
3525-------------------------------
3526
3527Record structures are a pre-Fortran-90 vendor extension to create
3528user-defined aggregate data types.  Support for record structures in GNU
3529Fortran can be enabled with the '-fdec-structure' compile flag.  If you
3530have a choice, you should instead use Fortran 90's "derived types",
3531which have a different syntax.
3532
3533   In many cases, record structures can easily be converted to derived
3534types.  To convert, replace 'STRUCTURE /'STRUCTURE-NAME'/' by 'TYPE'
3535TYPE-NAME.  Additionally, replace 'RECORD /'STRUCTURE-NAME'/' by
3536'TYPE('TYPE-NAME')'.  Finally, in the component access, replace the
3537period ('.') by the percent sign ('%').
3538
3539   Here is an example of code using the non portable record structure
3540syntax:
3541
3542     ! Declaring a structure named ``item'' and containing three fields:
3543     ! an integer ID, an description string and a floating-point price.
3544     STRUCTURE /item/
3545       INTEGER id
3546       CHARACTER(LEN=200) description
3547       REAL price
3548     END STRUCTURE
3549
3550     ! Define two variables, an single record of type ``item''
3551     ! named ``pear'', and an array of items named ``store_catalog''
3552     RECORD /item/ pear, store_catalog(100)
3553
3554     ! We can directly access the fields of both variables
3555     pear.id = 92316
3556     pear.description = "juicy D'Anjou pear"
3557     pear.price = 0.15
3558     store_catalog(7).id = 7831
3559     store_catalog(7).description = "milk bottle"
3560     store_catalog(7).price = 1.2
3561
3562     ! We can also manipulate the whole structure
3563     store_catalog(12) = pear
3564     print *, store_catalog(12)
3565
3566This code can easily be rewritten in the Fortran 90 syntax as following:
3567
3568     ! ``STRUCTURE /name/ ... END STRUCTURE'' becomes
3569     ! ``TYPE name ... END TYPE''
3570     TYPE item
3571       INTEGER id
3572       CHARACTER(LEN=200) description
3573       REAL price
3574     END TYPE
3575
3576     ! ``RECORD /name/ variable'' becomes ``TYPE(name) variable''
3577     TYPE(item) pear, store_catalog(100)
3578
3579     ! Instead of using a dot (.) to access fields of a record, the
3580     ! standard syntax uses a percent sign (%)
3581     pear%id = 92316
3582     pear%description = "juicy D'Anjou pear"
3583     pear%price = 0.15
3584     store_catalog(7)%id = 7831
3585     store_catalog(7)%description = "milk bottle"
3586     store_catalog(7)%price = 1.2
3587
3588     ! Assignments of a whole variable do not change
3589     store_catalog(12) = pear
3590     print *, store_catalog(12)
3591
3592GNU Fortran implements STRUCTURES like derived types with the following
3593rules and exceptions:
3594
3595   * Structures act like derived types with the 'SEQUENCE' attribute.
3596     Otherwise they may contain no specifiers.
3597
3598   * Structures may contain a special field with the name '%FILL'.  This
3599     will create an anonymous component which cannot be accessed but
3600     occupies space just as if a component of the same type was declared
3601     in its place, useful for alignment purposes.  As an example, the
3602     following structure will consist of at least sixteen bytes:
3603
3604          structure /padded/
3605            character(4) start
3606            character(8) %FILL
3607            character(4) end
3608          end structure
3609
3610   * Structures may share names with other symbols.  For example, the
3611     following is invalid for derived types, but valid for structures:
3612
3613          structure /header/
3614            ! ...
3615          end structure
3616          record /header/ header
3617
3618   * Structure types may be declared nested within another parent
3619     structure.  The syntax is:
3620          structure /type-name/
3621              ...
3622              structure [/<type-name>/] <field-list>
3623          ...
3624
3625     The type name may be ommitted, in which case the structure type
3626     itself is anonymous, and other structures of the same type cannot
3627     be instantiated.  The following shows some examples:
3628
3629          structure /appointment/
3630            ! nested structure definition: app_time is an array of two 'time'
3631            structure /time/ app_time (2)
3632              integer(1) hour, minute
3633            end structure
3634            character(10) memo
3635          end structure
3636
3637          ! The 'time' structure is still usable
3638          record /time/ now
3639          now = time(5, 30)
3640
3641          ...
3642
3643          structure /appointment/
3644            ! anonymous nested structure definition
3645            structure start, end
3646              integer(1) hour, minute
3647            end structure
3648            character(10) memo
3649          end structure
3650
3651   * Structures may contain 'UNION' blocks.  For more detail see the
3652     section on *note UNION and MAP::.
3653
3654   * Structures support old-style initialization of components, like
3655     those described in *note Old-style variable initialization::.  For
3656     array initializers, an initializer may contain a repeat
3657     specification of the form '<literal-integer> *
3658     <constant-initializer>'.  The value of the integer indicates the
3659     number of times to repeat the constant initializer when expanding
3660     the initializer list.
3661
3662
3663File: gfortran.info,  Node: UNION and MAP,  Next: Type variants for integer intrinsics,  Prev: STRUCTURE and RECORD,  Up: Extensions implemented in GNU Fortran
3664
36656.1.21 'UNION' and 'MAP'
3666------------------------
3667
3668Unions are an old vendor extension which were commonly used with the
3669non-standard *note STRUCTURE and RECORD:: extensions.  Use of 'UNION'
3670and 'MAP' is automatically enabled with '-fdec-structure'.
3671
3672   A 'UNION' declaration occurs within a structure; within the
3673definition of each union is a number of 'MAP' blocks.  Each 'MAP' shares
3674storage with its sibling maps (in the same union), and the size of the
3675union is the size of the largest map within it, just as with unions in
3676C. The major difference is that component references do not indicate
3677which union or map the component is in (the compiler gets to figure that
3678out).
3679
3680   Here is a small example:
3681     structure /myunion/
3682     union
3683       map
3684         character(2) w0, w1, w2
3685       end map
3686       map
3687         character(6) long
3688       end map
3689     end union
3690     end structure
3691
3692     record /myunion/ rec
3693     ! After this assignment...
3694     rec.long = 'hello!'
3695
3696     ! The following is true:
3697     ! rec.w0 === 'he'
3698     ! rec.w1 === 'll'
3699     ! rec.w2 === 'o!'
3700
3701   The two maps share memory, and the size of the union is ultimately
3702six bytes:
3703
3704     0    1    2    3    4   5   6     Byte offset
3705     -------------------------------
3706     |    |    |    |    |    |    |
3707     -------------------------------
3708
3709     ^    W0   ^    W1   ^    W2   ^
3710      \-------/ \-------/ \-------/
3711
3712     ^             LONG            ^
3713      \---------------------------/
3714
3715   Following is an example mirroring the layout of an Intel x86_64
3716register:
3717
3718     structure /reg/
3719       union ! U0                ! rax
3720         map
3721           character(16) rx
3722         end map
3723         map
3724           character(8) rh         ! rah
3725           union ! U1
3726             map
3727               character(8) rl     ! ral
3728             end map
3729             map
3730               character(8) ex     ! eax
3731             end map
3732             map
3733               character(4) eh     ! eah
3734               union ! U2
3735                 map
3736                   character(4) el ! eal
3737                 end map
3738                 map
3739                   character(4) x  ! ax
3740                 end map
3741                 map
3742                   character(2) h  ! ah
3743                   character(2) l  ! al
3744                 end map
3745               end union
3746             end map
3747           end union
3748         end map
3749       end union
3750     end structure
3751     record /reg/ a
3752
3753     ! After this assignment...
3754     a.rx     =     'AAAAAAAA.BBB.C.D'
3755
3756     ! The following is true:
3757     a.rx === 'AAAAAAAA.BBB.C.D'
3758     a.rh === 'AAAAAAAA'
3759     a.rl ===         '.BBB.C.D'
3760     a.ex ===         '.BBB.C.D'
3761     a.eh ===         '.BBB'
3762     a.el ===             '.C.D'
3763     a.x  ===             '.C.D'
3764     a.h  ===             '.C'
3765     a.l  ===               '.D'
3766
3767
3768File: gfortran.info,  Node: Type variants for integer intrinsics,  Next: AUTOMATIC and STATIC attributes,  Prev: UNION and MAP,  Up: Extensions implemented in GNU Fortran
3769
37706.1.22 Type variants for integer intrinsics
3771-------------------------------------------
3772
3773Similar to the D/C prefixes to real functions to specify the
3774input/output types, GNU Fortran offers B/I/J/K prefixes to integer
3775functions for compatibility with DEC programs.  The types implied by
3776each are:
3777
3778     B - INTEGER(kind=1)
3779     I - INTEGER(kind=2)
3780     J - INTEGER(kind=4)
3781     K - INTEGER(kind=8)
3782
3783   GNU Fortran supports these with the flag '-fdec-intrinsic-ints'.
3784Intrinsics for which prefixed versions are available and in what form
3785are noted in *note Intrinsic Procedures::.  The complete list of
3786supported intrinsics is here:
3787
3788Intrinsic      B              I              J              K
3789
3790---------------------------------------------------------------------------
3791'*note ABS::'  'BABS'         'IIABS'        'JIABS'        'KIABS'
3792'*note BTEST::''BBTEST'       'BITEST'       'BJTEST'       'BKTEST'
3793'*note IAND::' 'BIAND'        'IIAND'        'JIAND'        'KIAND'
3794'*note IBCLR::''BBCLR'        'IIBCLR'       'JIBCLR'       'KIBCLR'
3795'*note IBITS::''BBITS'        'IIBITS'       'JIBITS'       'KIBITS'
3796'*note IBSET::''BBSET'        'IIBSET'       'JIBSET'       'KIBSET'
3797'*note IEOR::' 'BIEOR'        'IIEOR'        'JIEOR'        'KIEOR'
3798'*note IOR::'  'BIOR'         'IIOR'         'JIOR'         'KIOR'
3799'*note ISHFT::''BSHFT'        'IISHFT'       'JISHFT'       'KISHFT'
3800'*note ISHFTC::''BSHFTC'      'IISHFTC'      'JISHFTC'      'KISHFTC'
3801'*note MOD::'  'BMOD'         'IMOD'         'JMOD'         'KMOD'
3802'*note NOT::'  'BNOT'         'INOT'         'JNOT'         'KNOT'
3803'*note REAL::' '--'           'FLOATI'       'FLOATJ'       'FLOATK'
3804
3805
3806File: gfortran.info,  Node: AUTOMATIC and STATIC attributes,  Next: Extended math intrinsics,  Prev: Type variants for integer intrinsics,  Up: Extensions implemented in GNU Fortran
3807
38086.1.23 'AUTOMATIC' and 'STATIC' attributes
3809------------------------------------------
3810
3811With '-fdec-static' GNU Fortran supports the DEC extended attributes
3812'STATIC' and 'AUTOMATIC' to provide explicit specification of entity
3813storage.  These follow the syntax of the Fortran standard 'SAVE'
3814attribute.
3815
3816   'STATIC' is exactly equivalent to 'SAVE', and specifies that an
3817entity should be allocated in static memory.  As an example, 'STATIC'
3818local variables will retain their values across multiple calls to a
3819function.
3820
3821   Entities marked 'AUTOMATIC' will be stack automatic whenever
3822possible.  'AUTOMATIC' is the default for local variables smaller than
3823'-fmax-stack-var-size', unless '-fno-automatic' is given.  This
3824attribute overrides '-fno-automatic', '-fmax-stack-var-size', and
3825blanket 'SAVE' statements.
3826
3827   Examples:
3828
3829     subroutine f
3830       integer, automatic :: i  ! automatic variable
3831       integer x, y             ! static variables
3832       save
3833       ...
3834     endsubroutine
3835     subroutine f
3836       integer a, b, c, x, y, z
3837       static :: x
3838       save y
3839       automatic z, c
3840       ! a, b, c, and z are automatic
3841       ! x and y are static
3842     endsubroutine
3843     ! Compiled with -fno-automatic
3844     subroutine f
3845       integer a, b, c, d
3846       automatic :: a
3847       ! a is automatic; b, c, and d are static
3848     endsubroutine
3849
3850
3851File: gfortran.info,  Node: Extended math intrinsics,  Next: Form feed as whitespace,  Prev: AUTOMATIC and STATIC attributes,  Up: Extensions implemented in GNU Fortran
3852
38536.1.24 Extended math intrinsics
3854-------------------------------
3855
3856GNU Fortran supports an extended list of mathematical intrinsics with
3857the compile flag '-fdec-math' for compatability with legacy code.  These
3858intrinsics are described fully in *note Intrinsic Procedures:: where it
3859is noted that they are extensions and should be avoided whenever
3860possible.
3861
3862   Specifically, '-fdec-math' enables the *note COTAN:: intrinsic, and
3863trigonometric intrinsics which accept or produce values in degrees
3864instead of radians.  Here is a summary of the new intrinsics:
3865
3866Radians                              Degrees
3867--------------------------------------------------------------------------
3868'*note ACOS::'                       '*note ACOSD::'*
3869'*note ASIN::'                       '*note ASIND::'*
3870'*note ATAN::'                       '*note ATAND::'*
3871'*note ATAN2::'                      '*note ATAN2D::'*
3872'*note COS::'                        '*note COSD::'*
3873'*note COTAN::'*                     '*note COTAND::'*
3874'*note SIN::'                        '*note SIND::'*
3875'*note TAN::'                        '*note TAND::'*
3876
3877   * Enabled with '-fdec-math'.
3878
3879   For advanced users, it may be important to know the implementation of
3880these functions.  They are simply wrappers around the standard radian
3881functions, which have more accurate builtin versions.  These functions
3882convert their arguments (or results) to degrees (or radians) by taking
3883the value modulus 360 (or 2*pi) and then multiplying it by a constant
3884radian-to-degree (or degree-to-radian) factor, as appropriate.  The
3885factor is computed at compile-time as 180/pi (or pi/180).
3886
3887
3888File: gfortran.info,  Node: Form feed as whitespace,  Next: TYPE as an alias for PRINT,  Prev: Extended math intrinsics,  Up: Extensions implemented in GNU Fortran
3889
38906.1.25 Form feed as whitespace
3891------------------------------
3892
3893Historically, legacy compilers allowed insertion of form feed characters
3894('\f', ASCII 0xC) at the beginning of lines for formatted output to line
3895printers, though the Fortran standard does not mention this.  GNU
3896Fortran supports the interpretation of form feed characters in source as
3897whitespace for compatibility.
3898
3899
3900File: 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
3901
39026.1.26 TYPE as an alias for PRINT
3903---------------------------------
3904
3905For compatibility, GNU Fortran will interpret 'TYPE' statements as
3906'PRINT' statements with the flag '-fdec'.  With this flag asserted, the
3907following two examples are equivalent:
3908
3909     TYPE *, 'hello world'
3910
3911     PRINT *, 'hello world'
3912
3913
3914File: gfortran.info,  Node: %LOC as an rvalue,  Next: .XOR. operator,  Prev: TYPE as an alias for PRINT,  Up: Extensions implemented in GNU Fortran
3915
39166.1.27 %LOC as an rvalue
3917------------------------
3918
3919Normally '%LOC' is allowed only in parameter lists.  However the
3920intrinsic function 'LOC' does the same thing, and is usable as the
3921right-hand-side of assignments.  For compatibility, GNU Fortran supports
3922the use of '%LOC' as an alias for the builtin 'LOC' with '-std=legacy'.
3923With this feature enabled the following two examples are equivalent:
3924
3925     integer :: i, l
3926     l = %loc(i)
3927     call sub(l)
3928
3929     integer :: i
3930     call sub(%loc(i))
3931
3932
3933File: gfortran.info,  Node: .XOR. operator,  Next: Bitwise logical operators,  Prev: %LOC as an rvalue,  Up: Extensions implemented in GNU Fortran
3934
39356.1.28 .XOR. operator
3936---------------------
3937
3938GNU Fortran supports '.XOR.' as a logical operator with '-std=legacy'
3939for compatibility with legacy code.  '.XOR.' is equivalent to '.NEQV.'.
3940That is, the output is true if and only if the inputs differ.
3941
3942
3943File: gfortran.info,  Node: Bitwise logical operators,  Next: Extended I/O specifiers,  Prev: .XOR. operator,  Up: Extensions implemented in GNU Fortran
3944
39456.1.29 Bitwise logical operators
3946--------------------------------
3947
3948With '-fdec', GNU Fortran relaxes the type constraints on logical
3949operators to allow integer operands, and performs the corresponding
3950bitwise operation instead.  This flag is for compatibility only, and
3951should be avoided in new code.  Consider:
3952
3953       INTEGER :: i, j
3954       i = z'33'
3955       j = z'cc'
3956       print *, i .AND. j
3957
3958   In this example, compiled with '-fdec', GNU Fortran will replace the
3959'.AND.' operation with a call to the intrinsic '*note IAND::' function,
3960yielding the bitwise-and of 'i' and 'j'.
3961
3962   Note that this conversion will occur if at least one operand is of
3963integral type.  As a result, a logical operand will be converted to an
3964integer when the other operand is an integer in a logical operation.  In
3965this case, '.TRUE.' is converted to '1' and '.FALSE.' to '0'.
3966
3967   Here is the mapping of logical operator to bitwise intrinsic used
3968with '-fdec':
3969
3970Operator           Intrinsic          Bitwise operation
3971---------------------------------------------------------------------------
3972'.NOT.'            '*note NOT::'      complement
3973'.AND.'            '*note IAND::'     intersection
3974'.OR.'             '*note IOR::'      union
3975'.NEQV.'           '*note IEOR::'     exclusive or
3976'.EQV.'            '*note NOT::(*note IEOR::)'complement of exclusive or
3977
3978
3979File: gfortran.info,  Node: Extended I/O specifiers,  Next: Legacy PARAMETER statements,  Prev: Bitwise logical operators,  Up: Extensions implemented in GNU Fortran
3980
39816.1.30 Extended I/O specifiers
3982------------------------------
3983
3984GNU Fortran supports the additional legacy I/O specifiers
3985'CARRIAGECONTROL', 'READONLY', and 'SHARE' with the compile flag
3986'-fdec', for compatibility.
3987
3988'CARRIAGECONTROL'
3989     The 'CARRIAGECONTROL' specifier allows a user to control line
3990     termination settings between output records for an I/O unit.  The
3991     specifier has no meaning for readonly files.  When
3992     'CARRAIGECONTROL' is specified upon opening a unit for formatted
3993     writing, the exact 'CARRIAGECONTROL' setting determines what
3994     characters to write between output records.  The syntax is:
3995
3996          OPEN(..., CARRIAGECONTROL=cc)
3997
3998     Where _cc_ is a character expression that evaluates to one of the
3999     following values:
4000
4001     ''LIST''       One line feed between records (default)
4002     ''FORTRAN''    Legacy interpretation of the first character (see below)
4003     ''NONE''       No separator between records
4004
4005     With 'CARRIAGECONTROL='FORTRAN'', when a record is written, the
4006     first character of the input record is not written, and instead
4007     determines the output record separator as follows:
4008
4009     Leading character      Meaning                Output separating
4010                                                   character(s)
4011     ----------------------------------------------------------------------------
4012     ''+''                  Overprinting           Carriage return only
4013     ''-''                  New line               Line feed and carriage
4014                                                   return
4015     ''0''                  Skip line              Two line feeds and carriage
4016                                                   return
4017     ''1''                  New page               Form feed and carriage
4018                                                   return
4019     ''$''                  Prompting              Line feed (no carriage
4020                                                   return)
4021     'CHAR(0)'              Overprinting (no       None
4022                            advance)
4023
4024'READONLY'
4025     The 'READONLY' specifier may be given upon opening a unit, and is
4026     equivalent to specifying 'ACTION='READ'', except that the file may
4027     not be deleted on close (i.e.  'CLOSE' with 'STATUS="DELETE"').
4028     The syntax is:
4029
4030          OPEN(..., READONLY)
4031
4032'SHARE'
4033     The 'SHARE' specifier allows system-level locking on a unit upon
4034     opening it for controlled access from multiple processes/threads.
4035     The 'SHARE' specifier has several forms:
4036
4037          OPEN(..., SHARE=sh)
4038          OPEN(..., SHARED)
4039          OPEN(..., NOSHARED)
4040
4041     Where _sh_ in the first form is a character expression that
4042     evaluates to a value as seen in the table below.  The latter two
4043     forms are aliases for particular values of _sh_:
4044
4045     Explicit form          Short form             Meaning
4046     ----------------------------------------------------------------------------
4047     'SHARE='DENYRW''       'NOSHARED'             Exclusive (write) lock
4048     'SHARE='DENYNONE''     'SHARED'               Shared (read) lock
4049
4050     In general only one process may hold an exclusive (write) lock for
4051     a given file at a time, whereas many processes may hold shared
4052     (read) locks for the same file.
4053
4054     The behavior of locking may vary with your operating system.  On
4055     POSIX systems, locking is implemented with 'fcntl'.  Consult your
4056     corresponding operating system's manual pages for further details.
4057     Locking via 'SHARE=' is not supported on other systems.
4058
4059
4060File: gfortran.info,  Node: Legacy PARAMETER statements,  Next: Default exponents,  Prev: Extended I/O specifiers,  Up: Extensions implemented in GNU Fortran
4061
40626.1.31 Legacy PARAMETER statements
4063----------------------------------
4064
4065For compatibility, GNU Fortran supports legacy PARAMETER statements
4066without parentheses with '-std=legacy'.  A warning is emitted if used
4067with '-std=gnu', and an error is acknowledged with a real Fortran
4068standard flag ('-std=f95', etc...).  These statements take the following
4069form:
4070
4071     implicit real (E)
4072     parameter e = 2.718282
4073     real c
4074     parameter c = 3.0e8
4075
4076
4077File: gfortran.info,  Node: Default exponents,  Prev: Legacy PARAMETER statements,  Up: Extensions implemented in GNU Fortran
4078
40796.1.32 Default exponents
4080------------------------
4081
4082For compatibility, GNU Fortran supports a default exponent of zero in
4083real constants with '-fdec'.  For example, '9e' would be interpreted as
4084'9e0', rather than an error.
4085
4086
4087File: gfortran.info,  Node: Extensions not implemented in GNU Fortran,  Prev: Extensions implemented in GNU Fortran,  Up: Extensions
4088
40896.2 Extensions not implemented in GNU Fortran
4090=============================================
4091
4092The long history of the Fortran language, its wide use and broad
4093userbase, the large number of different compiler vendors and the lack of
4094some features crucial to users in the first standards have lead to the
4095existence of a number of important extensions to the language.  While
4096some of the most useful or popular extensions are supported by the GNU
4097Fortran compiler, not all existing extensions are supported.  This
4098section aims at listing these extensions and offering advice on how best
4099make code that uses them running with the GNU Fortran compiler.
4100
4101* Menu:
4102
4103* ENCODE and DECODE statements::
4104* Variable FORMAT expressions::
4105* Alternate complex function syntax::
4106* Volatile COMMON blocks::
4107* OPEN( ... NAME=)::
4108* Q edit descriptor::
4109
4110
4111File: gfortran.info,  Node: ENCODE and DECODE statements,  Next: Variable FORMAT expressions,  Up: Extensions not implemented in GNU Fortran
4112
41136.2.1 'ENCODE' and 'DECODE' statements
4114--------------------------------------
4115
4116GNU Fortran does not support the 'ENCODE' and 'DECODE' statements.
4117These statements are best replaced by 'READ' and 'WRITE' statements
4118involving internal files ('CHARACTER' variables and arrays), which have
4119been part of the Fortran standard since Fortran 77.  For example,
4120replace a code fragment like
4121
4122           INTEGER*1 LINE(80)
4123           REAL A, B, C
4124     c     ... Code that sets LINE
4125           DECODE (80, 9000, LINE) A, B, C
4126      9000 FORMAT (1X, 3(F10.5))
4127
4128with the following:
4129
4130           CHARACTER(LEN=80) LINE
4131           REAL A, B, C
4132     c     ... Code that sets LINE
4133           READ (UNIT=LINE, FMT=9000) A, B, C
4134      9000 FORMAT (1X, 3(F10.5))
4135
4136   Similarly, replace a code fragment like
4137
4138           INTEGER*1 LINE(80)
4139           REAL A, B, C
4140     c     ... Code that sets A, B and C
4141           ENCODE (80, 9000, LINE) A, B, C
4142      9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
4143
4144with the following:
4145
4146           CHARACTER(LEN=80) LINE
4147           REAL A, B, C
4148     c     ... Code that sets A, B and C
4149           WRITE (UNIT=LINE, FMT=9000) A, B, C
4150      9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5))
4151
4152
4153File: gfortran.info,  Node: Variable FORMAT expressions,  Next: Alternate complex function syntax,  Prev: ENCODE and DECODE statements,  Up: Extensions not implemented in GNU Fortran
4154
41556.2.2 Variable 'FORMAT' expressions
4156-----------------------------------
4157
4158A variable 'FORMAT' expression is format statement which includes angle
4159brackets enclosing a Fortran expression: 'FORMAT(I<N>)'.  GNU Fortran
4160does not support this legacy extension.  The effect of variable format
4161expressions can be reproduced by using the more powerful (and standard)
4162combination of internal output and string formats.  For example, replace
4163a code fragment like this:
4164
4165           WRITE(6,20) INT1
4166      20   FORMAT(I<N+1>)
4167
4168with the following:
4169
4170     c     Variable declaration
4171           CHARACTER(LEN=20) FMT
4172     c
4173     c     Other code here...
4174     c
4175           WRITE(FMT,'("(I", I0, ")")') N+1
4176           WRITE(6,FMT) INT1
4177
4178or with:
4179
4180     c     Variable declaration
4181           CHARACTER(LEN=20) FMT
4182     c
4183     c     Other code here...
4184     c
4185           WRITE(FMT,*) N+1
4186           WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1
4187
4188
4189File: gfortran.info,  Node: Alternate complex function syntax,  Next: Volatile COMMON blocks,  Prev: Variable FORMAT expressions,  Up: Extensions not implemented in GNU Fortran
4190
41916.2.3 Alternate complex function syntax
4192---------------------------------------
4193
4194Some Fortran compilers, including 'g77', let the user declare complex
4195functions with the syntax 'COMPLEX FUNCTION name*16()', as well as
4196'COMPLEX*16 FUNCTION name()'.  Both are non-standard, legacy extensions.
4197'gfortran' accepts the latter form, which is more common, but not the
4198former.
4199
4200
4201File: gfortran.info,  Node: Volatile COMMON blocks,  Next: OPEN( ... NAME=),  Prev: Alternate complex function syntax,  Up: Extensions not implemented in GNU Fortran
4202
42036.2.4 Volatile 'COMMON' blocks
4204------------------------------
4205
4206Some Fortran compilers, including 'g77', let the user declare 'COMMON'
4207with the 'VOLATILE' attribute.  This is invalid standard Fortran syntax
4208and is not supported by 'gfortran'.  Note that 'gfortran' accepts
4209'VOLATILE' variables in 'COMMON' blocks since revision 4.3.
4210
4211
4212File: gfortran.info,  Node: OPEN( ... NAME=),  Next: Q edit descriptor,  Prev: Volatile COMMON blocks,  Up: Extensions not implemented in GNU Fortran
4213
42146.2.5 'OPEN( ... NAME=)'
4215------------------------
4216
4217Some Fortran compilers, including 'g77', let the user declare 'OPEN( ...
4218NAME=)'.  This is invalid standard Fortran syntax and is not supported
4219by 'gfortran'.  'OPEN( ... NAME=)' should be replaced with 'OPEN( ...
4220FILE=)'.
4221
4222
4223File: gfortran.info,  Node: Q edit descriptor,  Prev: OPEN( ... NAME=),  Up: Extensions not implemented in GNU Fortran
4224
42256.2.6 'Q' edit descriptor
4226-------------------------
4227
4228Some Fortran compilers provide the 'Q' edit descriptor, which transfers
4229the number of characters left within an input record into an integer
4230variable.
4231
4232   A direct replacement of the 'Q' edit descriptor is not available in
4233'gfortran'.  How to replicate its functionality using
4234standard-conforming code depends on what the intent of the original code
4235is.
4236
4237   Options to replace 'Q' may be to read the whole line into a character
4238variable and then counting the number of non-blank characters left using
4239'LEN_TRIM'.  Another method may be to use formatted stream, read the
4240data up to the position where the 'Q' descriptor occurred, use 'INQUIRE'
4241to get the file position, count the characters up to the next 'NEW_LINE'
4242and then start reading from the position marked previously.
4243
4244
4245File: gfortran.info,  Node: Mixed-Language Programming,  Next: Coarray Programming,  Prev: Extensions,  Up: Top
4246
42477 Mixed-Language Programming
4248****************************
4249
4250* Menu:
4251
4252* Interoperability with C::
4253* GNU Fortran Compiler Directives::
4254* Non-Fortran Main Program::
4255* Naming and argument-passing conventions::
4256
4257This chapter is about mixed-language interoperability, but also applies
4258if one links Fortran code compiled by different compilers.  In most
4259cases, use of the C Binding features of the Fortran 2003 standard is
4260sufficient, and their use is highly recommended.
4261
4262
4263File: gfortran.info,  Node: Interoperability with C,  Next: GNU Fortran Compiler Directives,  Up: Mixed-Language Programming
4264
42657.1 Interoperability with C
4266===========================
4267
4268* Menu:
4269
4270* Intrinsic Types::
4271* Derived Types and struct::
4272* Interoperable Global Variables::
4273* Interoperable Subroutines and Functions::
4274* Working with Pointers::
4275* Further Interoperability of Fortran with C::
4276
4277Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a standardized way
4278to generate procedure and derived-type declarations and global variables
4279which are interoperable with C (ISO/IEC 9899:1999).  The 'bind(C)'
4280attribute has been added to inform the compiler that a symbol shall be
4281interoperable with C; also, some constraints are added.  Note, however,
4282that not all C features have a Fortran equivalent or vice versa.  For
4283instance, neither C's unsigned integers nor C's functions with variable
4284number of arguments have an equivalent in Fortran.
4285
4286   Note that array dimensions are reversely ordered in C and that arrays
4287in C always start with index 0 while in Fortran they start by default
4288with 1.  Thus, an array declaration 'A(n,m)' in Fortran matches
4289'A[m][n]' in C and accessing the element 'A(i,j)' matches 'A[j-1][i-1]'.
4290The element following 'A(i,j)' (C: 'A[j-1][i-1]'; assuming i < n) in
4291memory is 'A(i+1,j)' (C: 'A[j-1][i]').
4292
4293
4294File: gfortran.info,  Node: Intrinsic Types,  Next: Derived Types and struct,  Up: Interoperability with C
4295
42967.1.1 Intrinsic Types
4297---------------------
4298
4299In order to ensure that exactly the same variable type and kind is used
4300in C and Fortran, the named constants shall be used which are defined in
4301the 'ISO_C_BINDING' intrinsic module.  That module contains named
4302constants for kind parameters and character named constants for the
4303escape sequences in C. For a list of the constants, see *note
4304ISO_C_BINDING::.
4305
4306   For logical types, please note that the Fortran standard only
4307guarantees interoperability between C99's '_Bool' and Fortran's
4308'C_Bool'-kind logicals and C99 defines that 'true' has the value 1 and
4309'false' the value 0.  Using any other integer value with GNU Fortran's
4310'LOGICAL' (with any kind parameter) gives an undefined result.  (Passing
4311other integer values than 0 and 1 to GCC's '_Bool' is also undefined,
4312unless the integer is explicitly or implicitly casted to '_Bool'.)
4313
4314
4315File: gfortran.info,  Node: Derived Types and struct,  Next: Interoperable Global Variables,  Prev: Intrinsic Types,  Up: Interoperability with C
4316
43177.1.2 Derived Types and struct
4318------------------------------
4319
4320For compatibility of derived types with 'struct', one needs to use the
4321'BIND(C)' attribute in the type declaration.  For instance, the
4322following type declaration
4323
4324      USE ISO_C_BINDING
4325      TYPE, BIND(C) :: myType
4326        INTEGER(C_INT) :: i1, i2
4327        INTEGER(C_SIGNED_CHAR) :: i3
4328        REAL(C_DOUBLE) :: d1
4329        COMPLEX(C_FLOAT_COMPLEX) :: c1
4330        CHARACTER(KIND=C_CHAR) :: str(5)
4331      END TYPE
4332
4333   matches the following 'struct' declaration in C
4334
4335      struct {
4336        int i1, i2;
4337        /* Note: "char" might be signed or unsigned.  */
4338        signed char i3;
4339        double d1;
4340        float _Complex c1;
4341        char str[5];
4342      } myType;
4343
4344   Derived types with the C binding attribute shall not have the
4345'sequence' attribute, type parameters, the 'extends' attribute, nor
4346type-bound procedures.  Every component must be of interoperable type
4347and kind and may not have the 'pointer' or 'allocatable' attribute.  The
4348names of the components are irrelevant for interoperability.
4349
4350   As there exist no direct Fortran equivalents, neither unions nor
4351structs with bit field or variable-length array members are
4352interoperable.
4353
4354
4355File: gfortran.info,  Node: Interoperable Global Variables,  Next: Interoperable Subroutines and Functions,  Prev: Derived Types and struct,  Up: Interoperability with C
4356
43577.1.3 Interoperable Global Variables
4358------------------------------------
4359
4360Variables can be made accessible from C using the C binding attribute,
4361optionally together with specifying a binding name.  Those variables
4362have to be declared in the declaration part of a 'MODULE', be of
4363interoperable type, and have neither the 'pointer' nor the 'allocatable'
4364attribute.
4365
4366       MODULE m
4367         USE myType_module
4368         USE ISO_C_BINDING
4369         integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag
4370         type(myType), bind(C) :: tp
4371       END MODULE
4372
4373   Here, '_MyProject_flags' is the case-sensitive name of the variable
4374as seen from C programs while 'global_flag' is the case-insensitive name
4375as seen from Fortran.  If no binding name is specified, as for TP, the C
4376binding name is the (lowercase) Fortran binding name.  If a binding name
4377is specified, only a single variable may be after the double colon.
4378Note of warning: You cannot use a global variable to access ERRNO of the
4379C library as the C standard allows it to be a macro.  Use the 'IERRNO'
4380intrinsic (GNU extension) instead.
4381
4382
4383File: gfortran.info,  Node: Interoperable Subroutines and Functions,  Next: Working with Pointers,  Prev: Interoperable Global Variables,  Up: Interoperability with C
4384
43857.1.4 Interoperable Subroutines and Functions
4386---------------------------------------------
4387
4388Subroutines and functions have to have the 'BIND(C)' attribute to be
4389compatible with C. The dummy argument declaration is relatively
4390straightforward.  However, one needs to be careful because C uses
4391call-by-value by default while Fortran behaves usually similar to
4392call-by-reference.  Furthermore, strings and pointers are handled
4393differently.  Note that in Fortran 2003 and 2008 only explicit size and
4394assumed-size arrays are supported but not assumed-shape or
4395deferred-shape (i.e.  allocatable or pointer) arrays.  However, those
4396are allowed since the Technical Specification 29113, see *note Further
4397Interoperability of Fortran with C::
4398
4399   To pass a variable by value, use the 'VALUE' attribute.  Thus, the
4400following C prototype
4401
4402     int func(int i, int *j)
4403
4404   matches the Fortran declaration
4405
4406       integer(c_int) function func(i,j)
4407         use iso_c_binding, only: c_int
4408         integer(c_int), VALUE :: i
4409         integer(c_int) :: j
4410
4411   Note that pointer arguments also frequently need the 'VALUE'
4412attribute, see *note Working with Pointers::.
4413
4414   Strings are handled quite differently in C and Fortran.  In C a
4415string is a 'NUL'-terminated array of characters while in Fortran each
4416string has a length associated with it and is thus not terminated (by
4417e.g.  'NUL').  For example, if one wants to use the following C
4418function,
4419
4420       #include <stdio.h>
4421       void print_C(char *string) /* equivalent: char string[]  */
4422       {
4423          printf("%s\n", string);
4424       }
4425
4426   to print "Hello World" from Fortran, one can call it using
4427
4428       use iso_c_binding, only: C_CHAR, C_NULL_CHAR
4429       interface
4430         subroutine print_c(string) bind(C, name="print_C")
4431           use iso_c_binding, only: c_char
4432           character(kind=c_char) :: string(*)
4433         end subroutine print_c
4434       end interface
4435       call print_c(C_CHAR_"Hello World"//C_NULL_CHAR)
4436
4437   As the example shows, one needs to ensure that the string is 'NUL'
4438terminated.  Additionally, the dummy argument STRING of 'print_C' is a
4439length-one assumed-size array; using 'character(len=*)' is not allowed.
4440The example above uses 'c_char_"Hello World"' to ensure the string
4441literal has the right type; typically the default character kind and
4442'c_char' are the same and thus '"Hello World"' is equivalent.  However,
4443the standard does not guarantee this.
4444
4445   The use of strings is now further illustrated using the C library
4446function 'strncpy', whose prototype is
4447
4448       char *strncpy(char *restrict s1, const char *restrict s2, size_t n);
4449
4450   The function 'strncpy' copies at most N characters from string S2 to
4451S1 and returns S1.  In the following example, we ignore the return
4452value:
4453
4454       use iso_c_binding
4455       implicit none
4456       character(len=30) :: str,str2
4457       interface
4458         ! Ignore the return value of strncpy -> subroutine
4459         ! "restrict" is always assumed if we do not pass a pointer
4460         subroutine strncpy(dest, src, n) bind(C)
4461           import
4462           character(kind=c_char),  intent(out) :: dest(*)
4463           character(kind=c_char),  intent(in)  :: src(*)
4464           integer(c_size_t), value, intent(in) :: n
4465         end subroutine strncpy
4466       end interface
4467       str = repeat('X',30) ! Initialize whole string with 'X'
4468       call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, &
4469                    len(c_char_"Hello World",kind=c_size_t))
4470       print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX"
4471       end
4472
4473   The intrinsic procedures are described in *note Intrinsic
4474Procedures::.
4475
4476
4477File: gfortran.info,  Node: Working with Pointers,  Next: Further Interoperability of Fortran with C,  Prev: Interoperable Subroutines and Functions,  Up: Interoperability with C
4478
44797.1.5 Working with Pointers
4480---------------------------
4481
4482C pointers are represented in Fortran via the special opaque derived
4483type 'type(c_ptr)' (with private components).  Thus one needs to use
4484intrinsic conversion procedures to convert from or to C pointers.
4485
4486   For some applications, using an assumed type ('TYPE(*)') can be an
4487alternative to a C pointer; see *note Further Interoperability of
4488Fortran with C::.
4489
4490   For example,
4491
4492       use iso_c_binding
4493       type(c_ptr) :: cptr1, cptr2
4494       integer, target :: array(7), scalar
4495       integer, pointer :: pa(:), ps
4496       cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the
4497                               ! array is contiguous if required by the C
4498                               ! procedure
4499       cptr2 = c_loc(scalar)
4500       call c_f_pointer(cptr2, ps)
4501       call c_f_pointer(cptr2, pa, shape=[7])
4502
4503   When converting C to Fortran arrays, the one-dimensional 'SHAPE'
4504argument has to be passed.
4505
4506   If a pointer is a dummy-argument of an interoperable procedure, it
4507usually has to be declared using the 'VALUE' attribute.  'void*' matches
4508'TYPE(C_PTR), VALUE', while 'TYPE(C_PTR)' alone matches 'void**'.
4509
4510   Procedure pointers are handled analogously to pointers; the C type is
4511'TYPE(C_FUNPTR)' and the intrinsic conversion procedures are
4512'C_F_PROCPOINTER' and 'C_FUNLOC'.
4513
4514   Let us consider two examples of actually passing a procedure pointer
4515from C to Fortran and vice versa.  Note that these examples are also
4516very similar to passing ordinary pointers between both languages.
4517First, consider this code in C:
4518
4519     /* Procedure implemented in Fortran.  */
4520     void get_values (void (*)(double));
4521
4522     /* Call-back routine we want called from Fortran.  */
4523     void
4524     print_it (double x)
4525     {
4526       printf ("Number is %f.\n", x);
4527     }
4528
4529     /* Call Fortran routine and pass call-back to it.  */
4530     void
4531     foobar ()
4532     {
4533       get_values (&print_it);
4534     }
4535
4536   A matching implementation for 'get_values' in Fortran, that correctly
4537receives the procedure pointer from C and is able to call it, is given
4538in the following 'MODULE':
4539
4540     MODULE m
4541       IMPLICIT NONE
4542
4543       ! Define interface of call-back routine.
4544       ABSTRACT INTERFACE
4545         SUBROUTINE callback (x)
4546           USE, INTRINSIC :: ISO_C_BINDING
4547           REAL(KIND=C_DOUBLE), INTENT(IN), VALUE :: x
4548         END SUBROUTINE callback
4549       END INTERFACE
4550
4551     CONTAINS
4552
4553       ! Define C-bound procedure.
4554       SUBROUTINE get_values (cproc) BIND(C)
4555         USE, INTRINSIC :: ISO_C_BINDING
4556         TYPE(C_FUNPTR), INTENT(IN), VALUE :: cproc
4557
4558         PROCEDURE(callback), POINTER :: proc
4559
4560         ! Convert C to Fortran procedure pointer.
4561         CALL C_F_PROCPOINTER (cproc, proc)
4562
4563         ! Call it.
4564         CALL proc (1.0_C_DOUBLE)
4565         CALL proc (-42.0_C_DOUBLE)
4566         CALL proc (18.12_C_DOUBLE)
4567       END SUBROUTINE get_values
4568
4569     END MODULE m
4570
4571   Next, we want to call a C routine that expects a procedure pointer
4572argument and pass it a Fortran procedure (which clearly must be
4573interoperable!).  Again, the C function may be:
4574
4575     int
4576     call_it (int (*func)(int), int arg)
4577     {
4578       return func (arg);
4579     }
4580
4581   It can be used as in the following Fortran code:
4582
4583     MODULE m
4584       USE, INTRINSIC :: ISO_C_BINDING
4585       IMPLICIT NONE
4586
4587       ! Define interface of C function.
4588       INTERFACE
4589         INTEGER(KIND=C_INT) FUNCTION call_it (func, arg) BIND(C)
4590           USE, INTRINSIC :: ISO_C_BINDING
4591           TYPE(C_FUNPTR), INTENT(IN), VALUE :: func
4592           INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
4593         END FUNCTION call_it
4594       END INTERFACE
4595
4596     CONTAINS
4597
4598       ! Define procedure passed to C function.
4599       ! It must be interoperable!
4600       INTEGER(KIND=C_INT) FUNCTION double_it (arg) BIND(C)
4601         INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg
4602         double_it = arg + arg
4603       END FUNCTION double_it
4604
4605       ! Call C function.
4606       SUBROUTINE foobar ()
4607         TYPE(C_FUNPTR) :: cproc
4608         INTEGER(KIND=C_INT) :: i
4609
4610         ! Get C procedure pointer.
4611         cproc = C_FUNLOC (double_it)
4612
4613         ! Use it.
4614         DO i = 1_C_INT, 10_C_INT
4615           PRINT *, call_it (cproc, i)
4616         END DO
4617       END SUBROUTINE foobar
4618
4619     END MODULE m
4620
4621
4622File: gfortran.info,  Node: Further Interoperability of Fortran with C,  Prev: Working with Pointers,  Up: Interoperability with C
4623
46247.1.6 Further Interoperability of Fortran with C
4625------------------------------------------------
4626
4627The Technical Specification ISO/IEC TS 29113:2012 on further
4628interoperability of Fortran with C extends the interoperability support
4629of Fortran 2003 and Fortran 2008.  Besides removing some restrictions
4630and constraints, it adds assumed-type ('TYPE(*)') and assumed-rank
4631('dimension') variables and allows for interoperability of
4632assumed-shape, assumed-rank and deferred-shape arrays, including
4633allocatables and pointers.
4634
4635   Note: Currently, GNU Fortran does not use internally the array
4636descriptor (dope vector) as specified in the Technical Specification,
4637but uses an array descriptor with different fields.  Assumed type and
4638assumed rank formal arguments are converted in the library to the
4639specified form.  The ISO_Fortran_binding API functions (also Fortran
46402018 18.4) are implemented in libgfortran.  Alternatively, the Chasm
4641Language Interoperability Tools,
4642<http://chasm-interop.sourceforge.net/>, provide an interface to GNU
4643Fortran's array descriptor.
4644
4645   The Technical Specification adds the following new features, which
4646are supported by GNU Fortran:
4647
4648   * The 'ASYNCHRONOUS' attribute has been clarified and extended to
4649     allow its use with asynchronous communication in user-provided
4650     libraries such as in implementations of the Message Passing
4651     Interface specification.
4652
4653   * Many constraints have been relaxed, in particular for the 'C_LOC'
4654     and 'C_F_POINTER' intrinsics.
4655
4656   * The 'OPTIONAL' attribute is now allowed for dummy arguments; an
4657     absent argument matches a 'NULL' pointer.
4658
4659   * Assumed types ('TYPE(*)') have been added, which may only be used
4660     for dummy arguments.  They are unlimited polymorphic but contrary
4661     to 'CLASS(*)' they do not contain any type information, similar to
4662     C's 'void *' pointers.  Expressions of any type and kind can be
4663     passed; thus, it can be used as replacement for 'TYPE(C_PTR)',
4664     avoiding the use of 'C_LOC' in the caller.
4665
4666     Note, however, that 'TYPE(*)' only accepts scalar arguments, unless
4667     the 'DIMENSION' is explicitly specified.  As 'DIMENSION(*)' only
4668     supports array (including array elements) but no scalars, it is not
4669     a full replacement for 'C_LOC'.  On the other hand, assumed-type
4670     assumed-rank dummy arguments ('TYPE(*), DIMENSION(..)') allow for
4671     both scalars and arrays, but require special code on the callee
4672     side to handle the array descriptor.
4673
4674   * Assumed-rank arrays ('DIMENSION(..)') as dummy argument allow that
4675     scalars and arrays of any rank can be passed as actual argument.
4676     As the Technical Specification does not provide for direct means to
4677     operate with them, they have to be used either from the C side or
4678     be converted using 'C_LOC' and 'C_F_POINTER' to scalars or arrays
4679     of a specific rank.  The rank can be determined using the 'RANK'
4680     intrinisic.
4681
4682   Currently unimplemented:
4683
4684   * GNU Fortran always uses an array descriptor, which does not match
4685     the one of the Technical Specification.  The
4686     'ISO_Fortran_binding.h' header file and the C functions it
4687     specifies are not available.
4688
4689   * Using assumed-shape, assumed-rank and deferred-shape arrays in
4690     'BIND(C)' procedures is not fully supported.  In particular, C
4691     interoperable strings of other length than one are not supported as
4692     this requires the new array descriptor.
4693
4694
4695File: gfortran.info,  Node: GNU Fortran Compiler Directives,  Next: Non-Fortran Main Program,  Prev: Interoperability with C,  Up: Mixed-Language Programming
4696
46977.2 GNU Fortran Compiler Directives
4698===================================
4699
4700* Menu:
4701
4702* ATTRIBUTES directive::
4703* UNROLL directive::
4704* BUILTIN directive::
4705* IVDEP directive::
4706* VECTOR directive::
4707* NOVECTOR directive::
4708
4709
4710File: gfortran.info,  Node: ATTRIBUTES directive,  Next: UNROLL directive,  Up: GNU Fortran Compiler Directives
4711
47127.2.1 ATTRIBUTES directive
4713--------------------------
4714
4715The Fortran standard describes how a conforming program shall behave;
4716however, the exact implementation is not standardized.  In order to
4717allow the user to choose specific implementation details, compiler
4718directives can be used to set attributes of variables and procedures
4719which are not part of the standard.  Whether a given attribute is
4720supported and its exact effects depend on both the operating system and
4721on the processor; see *note C Extensions: (gcc)Top. for details.
4722
4723   For procedures and procedure pointers, the following attributes can
4724be used to change the calling convention:
4725
4726   * 'CDECL' - standard C calling convention
4727   * 'STDCALL' - convention where the called procedure pops the stack
4728   * 'FASTCALL' - part of the arguments are passed via registers instead
4729     using the stack
4730
4731   Besides changing the calling convention, the attributes also
4732influence the decoration of the symbol name, e.g., by a leading
4733underscore or by a trailing at-sign followed by the number of bytes on
4734the stack.  When assigning a procedure to a procedure pointer, both
4735should use the same calling convention.
4736
4737   On some systems, procedures and global variables (module variables
4738and 'COMMON' blocks) need special handling to be accessible when they
4739are in a shared library.  The following attributes are available:
4740
4741   * 'DLLEXPORT' - provide a global pointer to a pointer in the DLL
4742   * 'DLLIMPORT' - reference the function or variable using a global
4743     pointer
4744
4745   For dummy arguments, the 'NO_ARG_CHECK' attribute can be used; in
4746other compilers, it is also known as 'IGNORE_TKR'.  For dummy arguments
4747with this attribute actual arguments of any type and kind (similar to
4748'TYPE(*)'), scalars and arrays of any rank (no equivalent in Fortran
4749standard) are accepted.  As with 'TYPE(*)', the argument is unlimited
4750polymorphic and no type information is available.  Additionally, the
4751argument may only be passed to dummy arguments with the 'NO_ARG_CHECK'
4752attribute and as argument to the 'PRESENT' intrinsic function and to
4753'C_LOC' of the 'ISO_C_BINDING' module.
4754
4755   Variables with 'NO_ARG_CHECK' attribute shall be of assumed-type
4756('TYPE(*)'; recommended) or of type 'INTEGER', 'LOGICAL', 'REAL' or
4757'COMPLEX'.  They shall not have the 'ALLOCATE', 'CODIMENSION',
4758'INTENT(OUT)', 'POINTER' or 'VALUE' attribute; furthermore, they shall
4759be either scalar or of assumed-size ('dimension(*)').  As 'TYPE(*)', the
4760'NO_ARG_CHECK' attribute requires an explicit interface.
4761
4762   * 'NO_ARG_CHECK' - disable the type, kind and rank checking
4763
4764   The attributes are specified using the syntax
4765
4766   '!GCC$ ATTRIBUTES' ATTRIBUTE-LIST '::' VARIABLE-LIST
4767
4768   where in free-form source code only whitespace is allowed before
4769'!GCC$' and in fixed-form source code '!GCC$', 'cGCC$' or '*GCC$' shall
4770start in the first column.
4771
4772   For procedures, the compiler directives shall be placed into the body
4773of the procedure; for variables and procedure pointers, they shall be in
4774the same declaration part as the variable or procedure pointer.
4775
4776
4777File: gfortran.info,  Node: UNROLL directive,  Next: BUILTIN directive,  Prev: ATTRIBUTES directive,  Up: GNU Fortran Compiler Directives
4778
47797.2.2 UNROLL directive
4780----------------------
4781
4782The syntax of the directive is
4783
4784   '!GCC$ unroll N'
4785
4786   You can use this directive to control how many times a loop should be
4787unrolled.  It must be placed immediately before a 'DO' loop and applies
4788only to the loop that follows.  N is an integer constant specifying the
4789unrolling factor.  The values of 0 and 1 block any unrolling of the
4790loop.
4791
4792
4793File: gfortran.info,  Node: BUILTIN directive,  Next: IVDEP directive,  Prev: UNROLL directive,  Up: GNU Fortran Compiler Directives
4794
47957.2.3 BUILTIN directive
4796-----------------------
4797
4798The syntax of the directive is
4799
4800   '!GCC$ BUILTIN (B) attributes simd FLAGS IF('target')'
4801
4802   You can use this directive to define which middle-end built-ins
4803provide vector implementations.  'B' is name of the middle-end built-in.
4804'FLAGS' are optional and must be either "(inbranch)" or "(notinbranch)".
4805'IF' statement is optional and is used to filter multilib ABIs for the
4806built-in that should be vectorized.  Example usage:
4807
4808     !GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64')
4809
4810   The purpose of the directive is to provide an API among the GCC
4811compiler and the GNU C Library which would define vector implementations
4812of math routines.
4813
4814
4815File: gfortran.info,  Node: IVDEP directive,  Next: VECTOR directive,  Prev: BUILTIN directive,  Up: GNU Fortran Compiler Directives
4816
48177.2.4 IVDEP directive
4818---------------------
4819
4820The syntax of the directive is
4821
4822   '!GCC$ ivdep'
4823
4824   This directive tells the compiler to ignore vector dependencies in
4825the following loop.  It must be placed immediately before a 'DO' loop
4826and applies only to the loop that follows.
4827
4828   Sometimes the compiler may not have sufficient information to decide
4829whether a particular loop is vectorizable due to potential dependencies
4830between iterations.  The purpose of the directive is to tell the
4831compiler that vectorization is safe.
4832
4833   This directive is intended for annotation of existing code.  For new
4834code it is recommended to consider OpenMP SIMD directives as potential
4835alternative.
4836
4837
4838File: gfortran.info,  Node: VECTOR directive,  Next: NOVECTOR directive,  Prev: IVDEP directive,  Up: GNU Fortran Compiler Directives
4839
48407.2.5 VECTOR directive
4841----------------------
4842
4843The syntax of the directive is
4844
4845   '!GCC$ vector'
4846
4847   This directive tells the compiler to vectorize the following loop.
4848It must be placed immediately before a 'DO' loop and applies only to the
4849loop that follows.
4850
4851
4852File: gfortran.info,  Node: NOVECTOR directive,  Prev: VECTOR directive,  Up: GNU Fortran Compiler Directives
4853
48547.2.6 NOVECTOR directive
4855------------------------
4856
4857The syntax of the directive is
4858
4859   '!GCC$ novector'
4860
4861   This directive tells the compiler to not vectorize the following
4862loop.  It must be placed immediately before a 'DO' loop and applies only
4863to the loop that follows.
4864
4865
4866File: gfortran.info,  Node: Non-Fortran Main Program,  Next: Naming and argument-passing conventions,  Prev: GNU Fortran Compiler Directives,  Up: Mixed-Language Programming
4867
48687.3 Non-Fortran Main Program
4869============================
4870
4871* Menu:
4872
4873* _gfortran_set_args:: Save command-line arguments
4874* _gfortran_set_options:: Set library option flags
4875* _gfortran_set_convert:: Set endian conversion
4876* _gfortran_set_record_marker:: Set length of record markers
4877* _gfortran_set_fpe:: Set when a Floating Point Exception should be raised
4878* _gfortran_set_max_subrecord_length:: Set subrecord length
4879
4880Even if you are doing mixed-language programming, it is very likely that
4881you do not need to know or use the information in this section.  Since
4882it is about the internal structure of GNU Fortran, it may also change in
4883GCC minor releases.
4884
4885   When you compile a 'PROGRAM' with GNU Fortran, a function with the
4886name 'main' (in the symbol table of the object file) is generated, which
4887initializes the libgfortran library and then calls the actual program
4888which uses the name 'MAIN__', for historic reasons.  If you link GNU
4889Fortran compiled procedures to, e.g., a C or C++ program or to a Fortran
4890program compiled by a different compiler, the libgfortran library is not
4891initialized and thus a few intrinsic procedures do not work properly,
4892e.g.  those for obtaining the command-line arguments.
4893
4894   Therefore, if your 'PROGRAM' is not compiled with GNU Fortran and the
4895GNU Fortran compiled procedures require intrinsics relying on the
4896library initialization, you need to initialize the library yourself.
4897Using the default options, gfortran calls '_gfortran_set_args' and
4898'_gfortran_set_options'.  The initialization of the former is needed if
4899the called procedures access the command line (and for backtracing); the
4900latter sets some flags based on the standard chosen or to enable
4901backtracing.  In typical programs, it is not necessary to call any
4902initialization function.
4903
4904   If your 'PROGRAM' is compiled with GNU Fortran, you shall not call
4905any of the following functions.  The libgfortran initialization
4906functions are shown in C syntax but using C bindings they are also
4907accessible from Fortran.
4908
4909
4910File: gfortran.info,  Node: _gfortran_set_args,  Next: _gfortran_set_options,  Up: Non-Fortran Main Program
4911
49127.3.1 '_gfortran_set_args' -- Save command-line arguments
4913---------------------------------------------------------
4914
4915_Description_:
4916     '_gfortran_set_args' saves the command-line arguments; this
4917     initialization is required if any of the command-line intrinsics is
4918     called.  Additionally, it shall be called if backtracing is enabled
4919     (see '_gfortran_set_options').
4920
4921_Syntax_:
4922     'void _gfortran_set_args (int argc, char *argv[])'
4923
4924_Arguments_:
4925     ARGC        number of command line argument strings
4926     ARGV        the command-line argument strings; argv[0] is
4927                 the pathname of the executable itself.
4928
4929_Example_:
4930          int main (int argc, char *argv[])
4931          {
4932            /* Initialize libgfortran.  */
4933            _gfortran_set_args (argc, argv);
4934            return 0;
4935          }
4936
4937
4938File: gfortran.info,  Node: _gfortran_set_options,  Next: _gfortran_set_convert,  Prev: _gfortran_set_args,  Up: Non-Fortran Main Program
4939
49407.3.2 '_gfortran_set_options' -- Set library option flags
4941---------------------------------------------------------
4942
4943_Description_:
4944     '_gfortran_set_options' sets several flags related to the Fortran
4945     standard to be used, whether backtracing should be enabled and
4946     whether range checks should be performed.  The syntax allows for
4947     upward compatibility since the number of passed flags is specified;
4948     for non-passed flags, the default value is used.  See also *note
4949     Code Gen Options::.  Please note that not all flags are actually
4950     used.
4951
4952_Syntax_:
4953     'void _gfortran_set_options (int num, int options[])'
4954
4955_Arguments_:
4956     NUM         number of options passed
4957     ARGV        The list of flag values
4958
4959_option flag list_:
4960     OPTION[0]   Allowed standard; can give run-time errors if
4961                 e.g.  an input-output edit descriptor is invalid
4962                 in a given standard.  Possible values are
4963                 (bitwise or-ed) 'GFC_STD_F77' (1),
4964                 'GFC_STD_F95_OBS' (2), 'GFC_STD_F95_DEL' (4),
4965                 'GFC_STD_F95' (8), 'GFC_STD_F2003' (16),
4966                 'GFC_STD_GNU' (32), 'GFC_STD_LEGACY' (64),
4967                 'GFC_STD_F2008' (128), 'GFC_STD_F2008_OBS'
4968                 (256), 'GFC_STD_F2008_TS' (512), 'GFC_STD_F2018'
4969                 (1024), 'GFC_STD_F2018_OBS' (2048), and
4970                 'GFC_STD=F2018_DEL' (4096).  Default:
4971                 'GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95
4972                 | GFC_STD_F2003 | GFC_STD_F2008 |
4973                 GFC_STD_F2008_TS | GFC_STD_F2008_OBS |
4974                 GFC_STD_F77 | GFC_STD_F2018 | GFC_STD_F2018_OBS
4975                 | GFC_STD_F2018_DEL | GFC_STD_GNU |
4976                 GFC_STD_LEGACY'.
4977     OPTION[1]   Standard-warning flag; prints a warning to
4978                 standard error.  Default: 'GFC_STD_F95_DEL |
4979                 GFC_STD_LEGACY'.
4980     OPTION[2]   If non zero, enable pedantic checking.  Default:
4981                 off.
4982     OPTION[3]   Unused.
4983     OPTION[4]   If non zero, enable backtracing on run-time
4984                 errors.  Default: off.  (Default in the
4985                 compiler: on.)  Note: Installs a signal handler
4986                 and requires command-line initialization using
4987                 '_gfortran_set_args'.
4988     OPTION[5]   If non zero, supports signed zeros.  Default:
4989                 enabled.
4990     OPTION[6]   Enables run-time checking.  Possible values are
4991                 (bitwise or-ed): GFC_RTCHECK_BOUNDS (1),
4992                 GFC_RTCHECK_ARRAY_TEMPS (2),
4993                 GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO (16),
4994                 GFC_RTCHECK_POINTER (32).  Default: disabled.
4995     OPTION[7]   Unused.
4996     OPTION[8]   Show a warning when invoking 'STOP' and 'ERROR
4997                 STOP' if a floating-point exception occurred.
4998                 Possible values are (bitwise or-ed)
4999                 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
5000                 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
5001                 'GFC_FPE_UNDERFLOW' (16), 'GFC_FPE_INEXACT'
5002                 (32).  Default: None (0).  (Default in the
5003                 compiler: 'GFC_FPE_INVALID | GFC_FPE_DENORMAL |
5004                 GFC_FPE_ZERO | GFC_FPE_OVERFLOW |
5005                 GFC_FPE_UNDERFLOW'.)
5006
5007_Example_:
5008            /* Use gfortran 4.9 default options.  */
5009            static int options[] = {68, 511, 0, 0, 1, 1, 0, 0, 31};
5010            _gfortran_set_options (9, &options);
5011
5012
5013File: gfortran.info,  Node: _gfortran_set_convert,  Next: _gfortran_set_record_marker,  Prev: _gfortran_set_options,  Up: Non-Fortran Main Program
5014
50157.3.3 '_gfortran_set_convert' -- Set endian conversion
5016------------------------------------------------------
5017
5018_Description_:
5019     '_gfortran_set_convert' set the representation of data for
5020     unformatted files.
5021
5022_Syntax_:
5023     'void _gfortran_set_convert (int conv)'
5024
5025_Arguments_:
5026     CONV        Endian conversion, possible values:
5027                 GFC_CONVERT_NATIVE (0, default),
5028                 GFC_CONVERT_SWAP (1), GFC_CONVERT_BIG (2),
5029                 GFC_CONVERT_LITTLE (3).
5030
5031_Example_:
5032          int main (int argc, char *argv[])
5033          {
5034            /* Initialize libgfortran.  */
5035            _gfortran_set_args (argc, argv);
5036            _gfortran_set_convert (1);
5037            return 0;
5038          }
5039
5040
5041File: gfortran.info,  Node: _gfortran_set_record_marker,  Next: _gfortran_set_fpe,  Prev: _gfortran_set_convert,  Up: Non-Fortran Main Program
5042
50437.3.4 '_gfortran_set_record_marker' -- Set length of record markers
5044-------------------------------------------------------------------
5045
5046_Description_:
5047     '_gfortran_set_record_marker' sets the length of record markers for
5048     unformatted files.
5049
5050_Syntax_:
5051     'void _gfortran_set_record_marker (int val)'
5052
5053_Arguments_:
5054     VAL         Length of the record marker; valid values are 4
5055                 and 8.  Default is 4.
5056
5057_Example_:
5058          int main (int argc, char *argv[])
5059          {
5060            /* Initialize libgfortran.  */
5061            _gfortran_set_args (argc, argv);
5062            _gfortran_set_record_marker (8);
5063            return 0;
5064          }
5065
5066
5067File: gfortran.info,  Node: _gfortran_set_fpe,  Next: _gfortran_set_max_subrecord_length,  Prev: _gfortran_set_record_marker,  Up: Non-Fortran Main Program
5068
50697.3.5 '_gfortran_set_fpe' -- Enable floating point exception traps
5070------------------------------------------------------------------
5071
5072_Description_:
5073     '_gfortran_set_fpe' enables floating point exception traps for the
5074     specified exceptions.  On most systems, this will result in a
5075     SIGFPE signal being sent and the program being aborted.
5076
5077_Syntax_:
5078     'void _gfortran_set_fpe (int val)'
5079
5080_Arguments_:
5081     OPTION[0]   IEEE exceptions.  Possible values are (bitwise
5082                 or-ed) zero (0, default) no trapping,
5083                 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2),
5084                 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8),
5085                 'GFC_FPE_UNDERFLOW' (16), and 'GFC_FPE_INEXACT'
5086                 (32).
5087
5088_Example_:
5089          int main (int argc, char *argv[])
5090          {
5091            /* Initialize libgfortran.  */
5092            _gfortran_set_args (argc, argv);
5093            /* FPE for invalid operations such as SQRT(-1.0).  */
5094            _gfortran_set_fpe (1);
5095            return 0;
5096          }
5097
5098
5099File: gfortran.info,  Node: _gfortran_set_max_subrecord_length,  Prev: _gfortran_set_fpe,  Up: Non-Fortran Main Program
5100
51017.3.6 '_gfortran_set_max_subrecord_length' -- Set subrecord length
5102------------------------------------------------------------------
5103
5104_Description_:
5105     '_gfortran_set_max_subrecord_length' set the maximum length for a
5106     subrecord.  This option only makes sense for testing and debugging
5107     of unformatted I/O.
5108
5109_Syntax_:
5110     'void _gfortran_set_max_subrecord_length (int val)'
5111
5112_Arguments_:
5113     VAL         the maximum length for a subrecord; the maximum
5114                 permitted value is 2147483639, which is also the
5115                 default.
5116
5117_Example_:
5118          int main (int argc, char *argv[])
5119          {
5120            /* Initialize libgfortran.  */
5121            _gfortran_set_args (argc, argv);
5122            _gfortran_set_max_subrecord_length (8);
5123            return 0;
5124          }
5125
5126
5127File: gfortran.info,  Node: Naming and argument-passing conventions,  Prev: Non-Fortran Main Program,  Up: Mixed-Language Programming
5128
51297.4 Naming and argument-passing conventions
5130===========================================
5131
5132This section gives an overview about the naming convention of procedures
5133and global variables and about the argument passing conventions used by
5134GNU Fortran.  If a C binding has been specified, the naming convention
5135and some of the argument-passing conventions change.  If possible,
5136mixed-language and mixed-compiler projects should use the better defined
5137C binding for interoperability.  See *note Interoperability with C::.
5138
5139* Menu:
5140
5141* Naming conventions::
5142* Argument passing conventions::
5143
5144
5145File: gfortran.info,  Node: Naming conventions,  Next: Argument passing conventions,  Up: Naming and argument-passing conventions
5146
51477.4.1 Naming conventions
5148------------------------
5149
5150According the Fortran standard, valid Fortran names consist of a letter
5151between 'A' to 'Z', 'a' to 'z', digits '0', '1' to '9' and underscores
5152('_') with the restriction that names may only start with a letter.  As
5153vendor extension, the dollar sign ('$') is additionally permitted with
5154the option '-fdollar-ok', but not as first character and only if the
5155target system supports it.
5156
5157   By default, the procedure name is the lower-cased Fortran name with
5158an appended underscore ('_'); using '-fno-underscoring' no underscore is
5159appended while '-fsecond-underscore' appends two underscores.  Depending
5160on the target system and the calling convention, the procedure might be
5161additionally dressed; for instance, on 32bit Windows with 'stdcall', an
5162at-sign '@' followed by an integer number is appended.  For the changing
5163the calling convention, see *note GNU Fortran Compiler Directives::.
5164
5165   For common blocks, the same convention is used, i.e.  by default an
5166underscore is appended to the lower-cased Fortran name.  Blank commons
5167have the name '__BLNK__'.
5168
5169   For procedures and variables declared in the specification space of a
5170module, the name is formed by '__', followed by the lower-cased module
5171name, '_MOD_', and the lower-cased Fortran name.  Note that no
5172underscore is appended.
5173
5174
5175File: gfortran.info,  Node: Argument passing conventions,  Prev: Naming conventions,  Up: Naming and argument-passing conventions
5176
51777.4.2 Argument passing conventions
5178----------------------------------
5179
5180Subroutines do not return a value (matching C99's 'void') while
5181functions either return a value as specified in the platform ABI or the
5182result variable is passed as hidden argument to the function and no
5183result is returned.  A hidden result variable is used when the result
5184variable is an array or of type 'CHARACTER'.
5185
5186   Arguments are passed according to the platform ABI. In particular,
5187complex arguments might not be compatible to a struct with two real
5188components for the real and imaginary part.  The argument passing
5189matches the one of C99's '_Complex'.  Functions with scalar complex
5190result variables return their value and do not use a by-reference
5191argument.  Note that with the '-ff2c' option, the argument passing is
5192modified and no longer completely matches the platform ABI. Some other
5193Fortran compilers use 'f2c' semantic by default; this might cause
5194problems with interoperablility.
5195
5196   GNU Fortran passes most arguments by reference, i.e.  by passing a
5197pointer to the data.  Note that the compiler might use a temporary
5198variable into which the actual argument has been copied, if required
5199semantically (copy-in/copy-out).
5200
5201   For arguments with 'ALLOCATABLE' and 'POINTER' attribute (including
5202procedure pointers), a pointer to the pointer is passed such that the
5203pointer address can be modified in the procedure.
5204
5205   For dummy arguments with the 'VALUE' attribute: Scalar arguments of
5206the type 'INTEGER', 'LOGICAL', 'REAL' and 'COMPLEX' are passed by value
5207according to the platform ABI. (As vendor extension and not recommended,
5208using '%VAL()' in the call to a procedure has the same effect.)  For
5209'TYPE(C_PTR)' and procedure pointers, the pointer itself is passed such
5210that it can be modified without affecting the caller.
5211
5212   For Boolean ('LOGICAL') arguments, please note that GCC expects only
5213the integer value 0 and 1.  If a GNU Fortran 'LOGICAL' variable contains
5214another integer value, the result is undefined.  As some other Fortran
5215compilers use -1 for '.TRUE.', extra care has to be taken - such as
5216passing the value as 'INTEGER'.  (The same value restriction also
5217applies to other front ends of GCC, e.g.  to GCC's C99 compiler for
5218'_Bool' or GCC's Ada compiler for 'Boolean'.)
5219
5220   For arguments of 'CHARACTER' type, the character length is passed as
5221a hidden argument at the end of the argument list.  For deferred-length
5222strings, the value is passed by reference, otherwise by value.  The
5223character length has the C type 'size_t' (or 'INTEGER(kind=C_SIZE_T)' in
5224Fortran).  Note that this is different to older versions of the GNU
5225Fortran compiler, where the type of the hidden character length argument
5226was a C 'int'.  In order to retain compatibility with older versions,
5227one can e.g.  for the following Fortran procedure
5228
5229     subroutine fstrlen (s, a)
5230        character(len=*) :: s
5231        integer :: a
5232        print*, len(s)
5233     end subroutine fstrlen
5234
5235   define the corresponding C prototype as follows:
5236
5237     #if __GNUC__ > 7
5238     typedef size_t fortran_charlen_t;
5239     #else
5240     typedef int fortran_charlen_t;
5241     #endif
5242
5243     void fstrlen_ (char*, int*, fortran_charlen_t);
5244
5245   In order to avoid such compiler-specific details, for new code it is
5246instead recommended to use the ISO_C_BINDING feature.
5247
5248   Note with C binding, 'CHARACTER(len=1)' result variables are returned
5249according to the platform ABI and no hidden length argument is used for
5250dummy arguments; with 'VALUE', those variables are passed by value.
5251
5252   For 'OPTIONAL' dummy arguments, an absent argument is denoted by a
5253NULL pointer, except for scalar dummy arguments of type 'INTEGER',
5254'LOGICAL', 'REAL' and 'COMPLEX' which have the 'VALUE' attribute.  For
5255those, a hidden Boolean argument ('logical(kind=C_bool),value') is used
5256to indicate whether the argument is present.
5257
5258   Arguments which are assumed-shape, assumed-rank or deferred-rank
5259arrays or, with '-fcoarray=lib', allocatable scalar coarrays use an
5260array descriptor.  All other arrays pass the address of the first
5261element of the array.  With '-fcoarray=lib', the token and the offset
5262belonging to nonallocatable coarrays dummy arguments are passed as
5263hidden argument along the character length hidden arguments.  The token
5264is an oparque pointer identifying the coarray and the offset is a
5265passed-by-value integer of kind 'C_PTRDIFF_T', denoting the byte offset
5266between the base address of the coarray and the passed scalar or first
5267element of the passed array.
5268
5269   The arguments are passed in the following order
5270   * Result variable, when the function result is passed by reference
5271   * Character length of the function result, if it is a of type
5272     'CHARACTER' and no C binding is used
5273   * The arguments in the order in which they appear in the Fortran
5274     declaration
5275   * The the present status for optional arguments with value attribute,
5276     which are internally passed by value
5277   * The character length and/or coarray token and offset for the first
5278     argument which is a 'CHARACTER' or a nonallocatable coarray dummy
5279     argument, followed by the hidden arguments of the next dummy
5280     argument of such a type
5281
5282
5283File: gfortran.info,  Node: Coarray Programming,  Next: Intrinsic Procedures,  Prev: Mixed-Language Programming,  Up: Top
5284
52858 Coarray Programming
5286*********************
5287
5288* Menu:
5289
5290* Type and enum ABI Documentation::
5291* Function ABI Documentation::
5292
5293
5294File: gfortran.info,  Node: Type and enum ABI Documentation,  Next: Function ABI Documentation,  Up: Coarray Programming
5295
52968.1 Type and enum ABI Documentation
5297===================================
5298
5299* Menu:
5300
5301* caf_token_t::
5302* caf_register_t::
5303* caf_deregister_t::
5304* caf_reference_t::
5305* caf_team_t::
5306
5307
5308File: gfortran.info,  Node: caf_token_t,  Next: caf_register_t,  Up: Type and enum ABI Documentation
5309
53108.1.1 'caf_token_t'
5311-------------------
5312
5313Typedef of type 'void *' on the compiler side.  Can be any data type on
5314the library side.
5315
5316
5317File: gfortran.info,  Node: caf_register_t,  Next: caf_deregister_t,  Prev: caf_token_t,  Up: Type and enum ABI Documentation
5318
53198.1.2 'caf_register_t'
5320----------------------
5321
5322Indicates which kind of coarray variable should be registered.
5323
5324typedef enum caf_register_t {
5325  CAF_REGTYPE_COARRAY_STATIC,
5326  CAF_REGTYPE_COARRAY_ALLOC,
5327  CAF_REGTYPE_LOCK_STATIC,
5328  CAF_REGTYPE_LOCK_ALLOC,
5329  CAF_REGTYPE_CRITICAL,
5330  CAF_REGTYPE_EVENT_STATIC,
5331  CAF_REGTYPE_EVENT_ALLOC,
5332  CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY,
5333  CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY
5334}
5335caf_register_t;
5336
5337   The values 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and
5338'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' are for allocatable components
5339in derived type coarrays only.  The first one sets up the token without
5340allocating memory for allocatable component.  The latter one only
5341allocates the memory for an allocatable component in a derived type
5342coarray.  The token needs to be setup previously by the REGISTER_ONLY.
5343This allows to have allocatable components un-allocated on some images.
5344The status whether an allocatable component is allocated on a remote
5345image can be queried by '_caf_is_present' which used internally by the
5346'ALLOCATED' intrinsic.
5347
5348
5349File: gfortran.info,  Node: caf_deregister_t,  Next: caf_reference_t,  Prev: caf_register_t,  Up: Type and enum ABI Documentation
5350
53518.1.3 'caf_deregister_t'
5352------------------------
5353
5354typedef enum caf_deregister_t {
5355  CAF_DEREGTYPE_COARRAY_DEREGISTER,
5356  CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY
5357}
5358caf_deregister_t;
5359
5360   Allows to specifiy the type of deregistration of a coarray object.
5361The 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' flag is only allowed for
5362allocatable components in derived type coarrays.
5363
5364
5365File: gfortran.info,  Node: caf_reference_t,  Next: caf_team_t,  Prev: caf_deregister_t,  Up: Type and enum ABI Documentation
5366
53678.1.4 'caf_reference_t'
5368-----------------------
5369
5370The structure used for implementing arbitrary reference chains.  A
5371'CAF_REFERENCE_T' allows to specify a component reference or any kind of
5372array reference of any rank supported by gfortran.  For array references
5373all kinds as known by the compiler/Fortran standard are supported
5374indicated by a 'MODE'.
5375
5376typedef enum caf_ref_type_t {
5377  /* Reference a component of a derived type, either regular one or an
5378     allocatable or pointer type.  For regular ones idx in caf_reference_t is
5379     set to -1.  */
5380  CAF_REF_COMPONENT,
5381  /* Reference an allocatable array.  */
5382  CAF_REF_ARRAY,
5383  /* Reference a non-allocatable/non-pointer array.  I.e., the coarray object
5384     has no array descriptor associated and the addressing is done
5385     completely using the ref.  */
5386  CAF_REF_STATIC_ARRAY
5387} caf_ref_type_t;
5388
5389typedef enum caf_array_ref_t {
5390  /* No array ref.  This terminates the array ref.  */
5391  CAF_ARR_REF_NONE = 0,
5392  /* Reference array elements given by a vector.  Only for this mode
5393     caf_reference_t.u.a.dim[i].v is valid.  */
5394  CAF_ARR_REF_VECTOR,
5395  /* A full array ref (:).  */
5396  CAF_ARR_REF_FULL,
5397  /* Reference a range on elements given by start, end and stride.  */
5398  CAF_ARR_REF_RANGE,
5399  /* Only a single item is referenced given in the start member.  */
5400  CAF_ARR_REF_SINGLE,
5401  /* An array ref of the kind (i:), where i is an arbitrary valid index in the
5402     array.  The index i is given in the start member.  */
5403  CAF_ARR_REF_OPEN_END,
5404  /* An array ref of the kind (:i), where the lower bound of the array ref
5405     is given by the remote side.  The index i is given in the end member.  */
5406  CAF_ARR_REF_OPEN_START
5407} caf_array_ref_t;
5408
5409/* References to remote components of a derived type.  */
5410typedef struct caf_reference_t {
5411  /* A pointer to the next ref or NULL.  */
5412  struct caf_reference_t *next;
5413  /* The type of the reference.  */
5414  /* caf_ref_type_t, replaced by int to allow specification in fortran FE.  */
5415  int type;
5416  /* The size of an item referenced in bytes.  I.e. in an array ref this is
5417     the factor to advance the array pointer with to get to the next item.
5418     For component refs this gives just the size of the element referenced.  */
5419  size_t item_size;
5420  union {
5421    struct {
5422      /* The offset (in bytes) of the component in the derived type.
5423         Unused for allocatable or pointer components.  */
5424      ptrdiff_t offset;
5425      /* The offset (in bytes) to the caf_token associated with this
5426         component.  NULL, when not allocatable/pointer ref.  */
5427      ptrdiff_t caf_token_offset;
5428    } c;
5429    struct {
5430      /* The mode of the array ref.  See CAF_ARR_REF_*.  */
5431      /* caf_array_ref_t, replaced by unsigend char to allow specification in
5432         fortran FE.  */
5433     unsigned char mode[GFC_MAX_DIMENSIONS];
5434      /* The type of a static array.  Unset for array's with descriptors.  */
5435      int static_array_type;
5436      /* Subscript refs (s) or vector refs (v).  */
5437      union {
5438        struct {
5439          /* The start and end boundary of the ref and the stride.  */
5440          index_type start, end, stride;
5441        } s;
5442        struct {
5443          /* nvec entries of kind giving the elements to reference.  */
5444          void *vector;
5445          /* The number of entries in vector.  */
5446          size_t nvec;
5447          /* The integer kind used for the elements in vector.  */
5448          int kind;
5449        } v;
5450      } dim[GFC_MAX_DIMENSIONS];
5451    } a;
5452  } u;
5453} caf_reference_t;
5454
5455   The references make up a single linked list of reference operations.
5456The 'NEXT' member links to the next reference or NULL to indicate the
5457end of the chain.  Component and array refs can be arbitrarly mixed as
5458long as they comply to the Fortran standard.
5459
5460   _NOTES_ The member 'STATIC_ARRAY_TYPE' is used only when the 'TYPE'
5461is 'CAF_REF_STATIC_ARRAY'.  The member gives the type of the data
5462referenced.  Because no array descriptor is available for a
5463descriptor-less array and type conversion still needs to take place the
5464type is transported here.
5465
5466   At the moment 'CAF_ARR_REF_VECTOR' is not implemented in the front
5467end for descriptor-less arrays.  The library caf_single has untested
5468support for it.
5469
5470
5471File: gfortran.info,  Node: caf_team_t,  Prev: caf_reference_t,  Up: Type and enum ABI Documentation
5472
54738.1.5 'caf_team_t'
5474------------------
5475
5476Opaque pointer to represent a team-handle.  This type is a stand-in for
5477the future implementation of teams.  It is about to change without
5478further notice.
5479
5480
5481File: gfortran.info,  Node: Function ABI Documentation,  Prev: Type and enum ABI Documentation,  Up: Coarray Programming
5482
54838.2 Function ABI Documentation
5484==============================
5485
5486* Menu:
5487
5488* _gfortran_caf_init:: Initialiation function
5489* _gfortran_caf_finish:: Finalization function
5490* _gfortran_caf_this_image:: Querying the image number
5491* _gfortran_caf_num_images:: Querying the maximal number of images
5492* _gfortran_caf_image_status :: Query the status of an image
5493* _gfortran_caf_failed_images :: Get an array of the indexes of the failed images
5494* _gfortran_caf_stopped_images :: Get an array of the indexes of the stopped images
5495* _gfortran_caf_register:: Registering coarrays
5496* _gfortran_caf_deregister:: Deregistering coarrays
5497* _gfortran_caf_is_present:: Query whether an allocatable or pointer component in a derived type coarray is allocated
5498* _gfortran_caf_send:: Sending data from a local image to a remote image
5499* _gfortran_caf_get:: Getting data from a remote image
5500* _gfortran_caf_sendget:: Sending data between remote images
5501* _gfortran_caf_send_by_ref:: Sending data from a local image to a remote image using enhanced references
5502* _gfortran_caf_get_by_ref:: Getting data from a remote image using enhanced references
5503* _gfortran_caf_sendget_by_ref:: Sending data between remote images using enhanced references
5504* _gfortran_caf_lock:: Locking a lock variable
5505* _gfortran_caf_unlock:: Unlocking a lock variable
5506* _gfortran_caf_event_post:: Post an event
5507* _gfortran_caf_event_wait:: Wait that an event occurred
5508* _gfortran_caf_event_query:: Query event count
5509* _gfortran_caf_sync_all:: All-image barrier
5510* _gfortran_caf_sync_images:: Barrier for selected images
5511* _gfortran_caf_sync_memory:: Wait for completion of segment-memory operations
5512* _gfortran_caf_error_stop:: Error termination with exit code
5513* _gfortran_caf_error_stop_str:: Error termination with string
5514* _gfortran_caf_fail_image :: Mark the image failed and end its execution
5515* _gfortran_caf_atomic_define:: Atomic variable assignment
5516* _gfortran_caf_atomic_ref:: Atomic variable reference
5517* _gfortran_caf_atomic_cas:: Atomic compare and swap
5518* _gfortran_caf_atomic_op:: Atomic operation
5519* _gfortran_caf_co_broadcast:: Sending data to all images
5520* _gfortran_caf_co_max:: Collective maximum reduction
5521* _gfortran_caf_co_min:: Collective minimum reduction
5522* _gfortran_caf_co_sum:: Collective summing reduction
5523* _gfortran_caf_co_reduce:: Generic collective reduction
5524
5525
5526File: gfortran.info,  Node: _gfortran_caf_init,  Next: _gfortran_caf_finish,  Up: Function ABI Documentation
5527
55288.2.1 '_gfortran_caf_init' -- Initialiation function
5529----------------------------------------------------
5530
5531_Description_:
5532     This function is called at startup of the program before the
5533     Fortran main program, if the latter has been compiled with
5534     '-fcoarray=lib'.  It takes as arguments the command-line arguments
5535     of the program.  It is permitted to pass two 'NULL' pointers as
5536     argument; if non-'NULL', the library is permitted to modify the
5537     arguments.
5538
5539_Syntax_:
5540     'void _gfortran_caf_init (int *argc, char ***argv)'
5541
5542_Arguments_:
5543     ARGC        intent(inout) An integer pointer with the number
5544                 of arguments passed to the program or 'NULL'.
5545     ARGV        intent(inout) A pointer to an array of strings
5546                 with the command-line arguments or 'NULL'.
5547
5548_NOTES_
5549     The function is modelled after the initialization function of the
5550     Message Passing Interface (MPI) specification.  Due to the way
5551     coarray registration works, it might not be the first call to the
5552     library.  If the main program is not written in Fortran and only a
5553     library uses coarrays, it can happen that this function is never
5554     called.  Therefore, it is recommended that the library does not
5555     rely on the passed arguments and whether the call has been done.
5556
5557
5558File: gfortran.info,  Node: _gfortran_caf_finish,  Next: _gfortran_caf_this_image,  Prev: _gfortran_caf_init,  Up: Function ABI Documentation
5559
55608.2.2 '_gfortran_caf_finish' -- Finalization function
5561-----------------------------------------------------
5562
5563_Description_:
5564     This function is called at the end of the Fortran main program, if
5565     it has been compiled with the '-fcoarray=lib' option.
5566
5567_Syntax_:
5568     'void _gfortran_caf_finish (void)'
5569
5570_NOTES_
5571     For non-Fortran programs, it is recommended to call the function at
5572     the end of the main program.  To ensure that the shutdown is also
5573     performed for programs where this function is not explicitly
5574     invoked, for instance non-Fortran programs or calls to the system's
5575     exit() function, the library can use a destructor function.  Note
5576     that programs can also be terminated using the STOP and ERROR STOP
5577     statements; those use different library calls.
5578
5579
5580File: gfortran.info,  Node: _gfortran_caf_this_image,  Next: _gfortran_caf_num_images,  Prev: _gfortran_caf_finish,  Up: Function ABI Documentation
5581
55828.2.3 '_gfortran_caf_this_image' -- Querying the image number
5583-------------------------------------------------------------
5584
5585_Description_:
5586     This function returns the current image number, which is a positive
5587     number.
5588
5589_Syntax_:
5590     'int _gfortran_caf_this_image (int distance)'
5591
5592_Arguments_:
5593     DISTANCE    As specified for the 'this_image' intrinsic in
5594                 TS18508.  Shall be a non-negative number.
5595
5596_NOTES_
5597     If the Fortran intrinsic 'this_image' is invoked without an
5598     argument, which is the only permitted form in Fortran 2008, GCC
5599     passes '0' as first argument.
5600
5601
5602File: gfortran.info,  Node: _gfortran_caf_num_images,  Next: _gfortran_caf_image_status,  Prev: _gfortran_caf_this_image,  Up: Function ABI Documentation
5603
56048.2.4 '_gfortran_caf_num_images' -- Querying the maximal number of images
5605-------------------------------------------------------------------------
5606
5607_Description_:
5608     This function returns the number of images in the current team, if
5609     DISTANCE is 0 or the number of images in the parent team at the
5610     specified distance.  If failed is -1, the function returns the
5611     number of all images at the specified distance; if it is 0, the
5612     function returns the number of nonfailed images, and if it is 1, it
5613     returns the number of failed images.
5614
5615_Syntax_:
5616     'int _gfortran_caf_num_images(int distance, int failed)'
5617
5618_Arguments_:
5619     DISTANCE    the distance from this image to the ancestor.
5620                 Shall be positive.
5621     FAILED      shall be -1, 0, or 1
5622
5623_NOTES_
5624     This function follows TS18508.  If the num_image intrinsic has no
5625     arguments, then the compiler passes 'distance=0' and 'failed=-1' to
5626     the function.
5627
5628
5629File: gfortran.info,  Node: _gfortran_caf_image_status,  Next: _gfortran_caf_failed_images,  Prev: _gfortran_caf_num_images,  Up: Function ABI Documentation
5630
56318.2.5 '_gfortran_caf_image_status' -- Query the status of an image
5632------------------------------------------------------------------
5633
5634_Description_:
5635     Get the status of the image given by the id IMAGE of the team given
5636     by TEAM.  Valid results are zero, for image is ok,
5637     'STAT_STOPPED_IMAGE' from the ISO_FORTRAN_ENV module to indicate
5638     that the image has been stopped and 'STAT_FAILED_IMAGE' also from
5639     ISO_FORTRAN_ENV to indicate that the image has executed a 'FAIL
5640     IMAGE' statement.
5641
5642_Syntax_:
5643     'int _gfortran_caf_image_status (int image, caf_team_t * team)'
5644
5645_Arguments_:
5646     IMAGE       the positive scalar id of the image in the
5647                 current TEAM.
5648     TEAM        optional; team on the which the inquiry is to be
5649                 performed.
5650
5651_NOTES_
5652     This function follows TS18508.  Because team-functionality is not
5653     yet implemented a null-pointer is passed for the TEAM argument at
5654     the moment.
5655
5656
5657File: gfortran.info,  Node: _gfortran_caf_failed_images,  Next: _gfortran_caf_stopped_images,  Prev: _gfortran_caf_image_status,  Up: Function ABI Documentation
5658
56598.2.6 '_gfortran_caf_failed_images' -- Get an array of the indexes of the failed images
5660---------------------------------------------------------------------------------------
5661
5662_Description_:
5663     Get an array of image indexes in the current TEAM that have failed.
5664     The array is sorted ascendingly.  When TEAM is not provided the
5665     current team is to be used.  When KIND is provided then the
5666     resulting array is of that integer kind else it is of default
5667     integer kind.  The returns an unallocated size zero array when no
5668     images have failed.
5669
5670_Syntax_:
5671     'int _gfortran_caf_failed_images (caf_team_t * team, int * kind)'
5672
5673_Arguments_:
5674     TEAM        optional; team on the which the inquiry is to be
5675                 performed.
5676     IMAGE       optional; the kind of the resulting integer
5677                 array.
5678
5679_NOTES_
5680     This function follows TS18508.  Because team-functionality is not
5681     yet implemented a null-pointer is passed for the TEAM argument at
5682     the moment.
5683
5684
5685File: gfortran.info,  Node: _gfortran_caf_stopped_images,  Next: _gfortran_caf_register,  Prev: _gfortran_caf_failed_images,  Up: Function ABI Documentation
5686
56878.2.7 '_gfortran_caf_stopped_images' -- Get an array of the indexes of the stopped images
5688-----------------------------------------------------------------------------------------
5689
5690_Description_:
5691     Get an array of image indexes in the current TEAM that have
5692     stopped.  The array is sorted ascendingly.  When TEAM is not
5693     provided the current team is to be used.  When KIND is provided
5694     then the resulting array is of that integer kind else it is of
5695     default integer kind.  The returns an unallocated size zero array
5696     when no images have failed.
5697
5698_Syntax_:
5699     'int _gfortran_caf_stopped_images (caf_team_t * team, int * kind)'
5700
5701_Arguments_:
5702     TEAM        optional; team on the which the inquiry is to be
5703                 performed.
5704     IMAGE       optional; the kind of the resulting integer
5705                 array.
5706
5707_NOTES_
5708     This function follows TS18508.  Because team-functionality is not
5709     yet implemented a null-pointer is passed for the TEAM argument at
5710     the moment.
5711
5712
5713File: gfortran.info,  Node: _gfortran_caf_register,  Next: _gfortran_caf_deregister,  Prev: _gfortran_caf_stopped_images,  Up: Function ABI Documentation
5714
57158.2.8 '_gfortran_caf_register' -- Registering coarrays
5716------------------------------------------------------
5717
5718_Description_:
5719     Registers memory for a coarray and creates a token to identify the
5720     coarray.  The routine is called for both coarrays with 'SAVE'
5721     attribute and using an explicit 'ALLOCATE' statement.  If an error
5722     occurs and STAT is a 'NULL' pointer, the function shall abort with
5723     printing an error message and starting the error termination.  If
5724     no error occurs and STAT is present, it shall be set to zero.
5725     Otherwise, it shall be set to a positive value and, if not-'NULL',
5726     ERRMSG shall be set to a string describing the failure.  The
5727     routine shall register the memory provided in the 'DATA'-component
5728     of the array descriptor DESC, when that component is non-'NULL',
5729     else it shall allocate sufficient memory and provide a pointer to
5730     it in the 'DATA'-component of DESC.  The array descriptor has rank
5731     zero, when a scalar object is to be registered and the array
5732     descriptor may be invalid after the call to
5733     '_gfortran_caf_register'.  When an array is to be allocated the
5734     descriptor persists.
5735
5736     For 'CAF_REGTYPE_COARRAY_STATIC' and 'CAF_REGTYPE_COARRAY_ALLOC',
5737     the passed size is the byte size requested.  For
5738     'CAF_REGTYPE_LOCK_STATIC', 'CAF_REGTYPE_LOCK_ALLOC' and
5739     'CAF_REGTYPE_CRITICAL' it is the array size or one for a scalar.
5740
5741     When 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' is used, then only a
5742     token for an allocatable or pointer component is created.  The
5743     'SIZE' parameter is not used then.  On the contrary when
5744     'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' is specified, then the
5745     TOKEN needs to be registered by a previous call with regtype
5746     'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and either the memory
5747     specified in the DESC's data-ptr is registered or allocate when the
5748     data-ptr is 'NULL'.
5749
5750_Syntax_:
5751     'void caf_register (size_t size, caf_register_t type, caf_token_t
5752     *token, gfc_descriptor_t *desc, int *stat, char *errmsg, size_t
5753     errmsg_len)'
5754
5755_Arguments_:
5756     SIZE        For normal coarrays, the byte size of the
5757                 coarray to be allocated; for lock types and
5758                 event types, the number of elements.
5759     TYPE        one of the caf_register_t types.
5760     TOKEN       intent(out) An opaque pointer identifying the
5761                 coarray.
5762     DESC        intent(inout) The (pseudo) array descriptor.
5763     STAT        intent(out) For allocatable coarrays, stores the
5764                 STAT=; may be 'NULL'
5765     ERRMSG      intent(out) When an error occurs, this will be
5766                 set to an error message; may be 'NULL'
5767     ERRMSG_LEN  the buffer size of errmsg.
5768
5769_NOTES_
5770     Nonallocatable coarrays have to be registered prior use from remote
5771     images.  In order to guarantee this, they have to be registered
5772     before the main program.  This can be achieved by creating
5773     constructor functions.  That is what GCC does such that also for
5774     nonallocatable coarrays the memory is allocated and no static
5775     memory is used.  The token permits to identify the coarray; to the
5776     processor, the token is a nonaliasing pointer.  The library can,
5777     for instance, store the base address of the coarray in the token,
5778     some handle or a more complicated struct.  The library may also
5779     store the array descriptor DESC when its rank is non-zero.
5780
5781     For lock types, the value shall only be used for checking the
5782     allocation status.  Note that for critical blocks, the locking is
5783     only required on one image; in the locking statement, the processor
5784     shall always pass an image index of one for critical-block lock
5785     variables ('CAF_REGTYPE_CRITICAL').  For lock types and
5786     critical-block variables, the initial value shall be unlocked (or,
5787     respecitively, not in critical section) such as the value false;
5788     for event types, the initial state should be no event, e.g.  zero.
5789
5790
5791File: gfortran.info,  Node: _gfortran_caf_deregister,  Next: _gfortran_caf_is_present,  Prev: _gfortran_caf_register,  Up: Function ABI Documentation
5792
57938.2.9 '_gfortran_caf_deregister' -- Deregistering coarrays
5794----------------------------------------------------------
5795
5796_Description_:
5797     Called to free or deregister the memory of a coarray; the processor
5798     calls this function for automatic and explicit deallocation.  In
5799     case of an error, this function shall fail with an error message,
5800     unless the STAT variable is not null.  The library is only expected
5801     to free memory it allocated itself during a call to
5802     '_gfortran_caf_register'.
5803
5804_Syntax_:
5805     'void caf_deregister (caf_token_t *token, caf_deregister_t type,
5806     int *stat, char *errmsg, size_t errmsg_len)'
5807
5808_Arguments_:
5809     TOKEN       the token to free.
5810     TYPE        the type of action to take for the coarray.  A
5811                 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' is
5812                 allowed only for allocatable or pointer
5813                 components of derived type coarrays.  The action
5814                 only deallocates the local memory without
5815                 deleting the token.
5816     STAT        intent(out) Stores the STAT=; may be NULL
5817     ERRMSG      intent(out) When an error occurs, this will be
5818                 set to an error message; may be NULL
5819     ERRMSG_LEN  the buffer size of errmsg.
5820
5821_NOTES_
5822     For nonalloatable coarrays this function is never called.  If a
5823     cleanup is required, it has to be handled via the finish, stop and
5824     error stop functions, and via destructors.
5825
5826
5827File: gfortran.info,  Node: _gfortran_caf_is_present,  Next: _gfortran_caf_send,  Prev: _gfortran_caf_deregister,  Up: Function ABI Documentation
5828
58298.2.10 '_gfortran_caf_is_present' -- Query whether an allocatable or pointer component in a derived type coarray is allocated
5830-----------------------------------------------------------------------------------------------------------------------------
5831
5832_Description_:
5833     Used to query the coarray library whether an allocatable component
5834     in a derived type coarray is allocated on a remote image.
5835
5836_Syntax_:
5837     'void _gfortran_caf_is_present (caf_token_t token, int image_index,
5838     gfc_reference_t *ref)'
5839
5840_Arguments_:
5841     TOKEN       An opaque pointer identifying the coarray.
5842     IMAGE_INDEX The ID of the remote image; must be a positive
5843                 number.
5844     REF         A chain of references to address the allocatable
5845                 or pointer component in the derived type
5846                 coarray.  The object reference needs to be a
5847                 scalar or a full array reference, respectively.
5848
5849
5850File: gfortran.info,  Node: _gfortran_caf_send,  Next: _gfortran_caf_get,  Prev: _gfortran_caf_is_present,  Up: Function ABI Documentation
5851
58528.2.11 '_gfortran_caf_send' -- Sending data from a local image to a remote image
5853--------------------------------------------------------------------------------
5854
5855_Description_:
5856     Called to send a scalar, an array section or a whole array from a
5857     local to a remote image identified by the image_index.
5858
5859_Syntax_:
5860     'void _gfortran_caf_send (caf_token_t token, size_t offset, int
5861     image_index, gfc_descriptor_t *dest, caf_vector_t *dst_vector,
5862     gfc_descriptor_t *src, int dst_kind, int src_kind, bool
5863     may_require_tmp, int *stat)'
5864
5865_Arguments_:
5866     TOKEN       intent(in) An opaque pointer identifying the
5867                 coarray.
5868     OFFSET      intent(in) By which amount of bytes the actual
5869                 data is shifted compared to the base address of
5870                 the coarray.
5871     IMAGE_INDEX intent(in) The ID of the remote image; must be a
5872                 positive number.
5873     DEST        intent(in) Array descriptor for the remote image
5874                 for the bounds and the size.  The 'base_addr'
5875                 shall not be accessed.
5876     DST_VECTOR  intent(in) If not NULL, it contains the vector
5877                 subscript of the destination array; the values
5878                 are relative to the dimension triplet of the
5879                 dest argument.
5880     SRC         intent(in) Array descriptor of the local array
5881                 to be transferred to the remote image
5882     DST_KIND    intent(in) Kind of the destination argument
5883     SRC_KIND    intent(in) Kind of the source argument
5884     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
5885                 known at compile time that the DEST and SRC
5886                 either cannot overlap or overlap (fully or
5887                 partially) such that walking SRC and DEST in
5888                 element wise element order (honoring the stride
5889                 value) will not lead to wrong results.
5890                 Otherwise, the value is 'true'.
5891     STAT        intent(out) when non-NULL give the result of the
5892                 operation, i.e., zero on success and non-zero on
5893                 error.  When NULL and an error occurs, then an
5894                 error message is printed and the program is
5895                 terminated.
5896
5897_NOTES_
5898     It is permitted to have IMAGE_INDEX equal the current image; the
5899     memory of the send-to and the send-from might (partially) overlap
5900     in that case.  The implementation has to take care that it handles
5901     this case, e.g.  using 'memmove' which handles (partially)
5902     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
5903     additionally create a temporary variable, unless additional checks
5904     show that this is not required (e.g.  because walking backward is
5905     possible or because both arrays are contiguous and 'memmove' takes
5906     care of overlap issues).
5907
5908     Note that the assignment of a scalar to an array is permitted.  In
5909     addition, the library has to handle numeric-type conversion and for
5910     strings, padding and different character kinds.
5911
5912
5913File: gfortran.info,  Node: _gfortran_caf_get,  Next: _gfortran_caf_sendget,  Prev: _gfortran_caf_send,  Up: Function ABI Documentation
5914
59158.2.12 '_gfortran_caf_get' -- Getting data from a remote image
5916--------------------------------------------------------------
5917
5918_Description_:
5919     Called to get an array section or a whole array from a remote,
5920     image identified by the image_index.
5921
5922_Syntax_:
5923     'void _gfortran_caf_get (caf_token_t token, size_t offset, int
5924     image_index, gfc_descriptor_t *src, caf_vector_t *src_vector,
5925     gfc_descriptor_t *dest, int src_kind, int dst_kind, bool
5926     may_require_tmp, int *stat)'
5927
5928_Arguments_:
5929     TOKEN       intent(in) An opaque pointer identifying the
5930                 coarray.
5931     OFFSET      intent(in) By which amount of bytes the actual
5932                 data is shifted compared to the base address of
5933                 the coarray.
5934     IMAGE_INDEX intent(in) The ID of the remote image; must be a
5935                 positive number.
5936     DEST        intent(out) Array descriptor of the local array
5937                 to store the data retrieved from the remote
5938                 image
5939     SRC         intent(in) Array descriptor for the remote image
5940                 for the bounds and the size.  The 'base_addr'
5941                 shall not be accessed.
5942     SRC_VECTOR  intent(in) If not NULL, it contains the vector
5943                 subscript of the source array; the values are
5944                 relative to the dimension triplet of the SRC
5945                 argument.
5946     DST_KIND    intent(in) Kind of the destination argument
5947     SRC_KIND    intent(in) Kind of the source argument
5948     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
5949                 known at compile time that the DEST and SRC
5950                 either cannot overlap or overlap (fully or
5951                 partially) such that walking SRC and DEST in
5952                 element wise element order (honoring the stride
5953                 value) will not lead to wrong results.
5954                 Otherwise, the value is 'true'.
5955     STAT        intent(out) When non-NULL give the result of the
5956                 operation, i.e., zero on success and non-zero on
5957                 error.  When NULL and an error occurs, then an
5958                 error message is printed and the program is
5959                 terminated.
5960
5961_NOTES_
5962     It is permitted to have IMAGE_INDEX equal the current image; the
5963     memory of the send-to and the send-from might (partially) overlap
5964     in that case.  The implementation has to take care that it handles
5965     this case, e.g.  using 'memmove' which handles (partially)
5966     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
5967     additionally create a temporary variable, unless additional checks
5968     show that this is not required (e.g.  because walking backward is
5969     possible or because both arrays are contiguous and 'memmove' takes
5970     care of overlap issues).
5971
5972     Note that the library has to handle numeric-type conversion and for
5973     strings, padding and different character kinds.
5974
5975
5976File: gfortran.info,  Node: _gfortran_caf_sendget,  Next: _gfortran_caf_send_by_ref,  Prev: _gfortran_caf_get,  Up: Function ABI Documentation
5977
59788.2.13 '_gfortran_caf_sendget' -- Sending data between remote images
5979--------------------------------------------------------------------
5980
5981_Description_:
5982     Called to send a scalar, an array section or a whole array from a
5983     remote image identified by the SRC_IMAGE_INDEX to a remote image
5984     identified by the DST_IMAGE_INDEX.
5985
5986_Syntax_:
5987     'void _gfortran_caf_sendget (caf_token_t dst_token, size_t
5988     dst_offset, int dst_image_index, gfc_descriptor_t *dest,
5989     caf_vector_t *dst_vector, caf_token_t src_token, size_t src_offset,
5990     int src_image_index, gfc_descriptor_t *src, caf_vector_t
5991     *src_vector, int dst_kind, int src_kind, bool may_require_tmp, int
5992     *stat)'
5993
5994_Arguments_:
5995     DST_TOKEN   intent(in) An opaque pointer identifying the
5996                 destination coarray.
5997     DST_OFFSET  intent(in) By which amount of bytes the actual
5998                 data is shifted compared to the base address of
5999                 the destination coarray.
6000     DST_IMAGE_INDEXintent(in) The ID of the destination remote
6001                 image; must be a positive number.
6002     DEST        intent(in) Array descriptor for the destination
6003                 remote image for the bounds and the size.  The
6004                 'base_addr' shall not be accessed.
6005     DST_VECTOR  intent(int) If not NULL, it contains the vector
6006                 subscript of the destination array; the values
6007                 are relative to the dimension triplet of the
6008                 DEST argument.
6009     SRC_TOKEN   intent(in) An opaque pointer identifying the
6010                 source coarray.
6011     SRC_OFFSET  intent(in) By which amount of bytes the actual
6012                 data is shifted compared to the base address of
6013                 the source coarray.
6014     SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
6015                 must be a positive number.
6016     SRC         intent(in) Array descriptor of the local array
6017                 to be transferred to the remote image.
6018     SRC_VECTOR  intent(in) Array descriptor of the local array
6019                 to be transferred to the remote image
6020     DST_KIND    intent(in) Kind of the destination argument
6021     SRC_KIND    intent(in) Kind of the source argument
6022     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
6023                 known at compile time that the DEST and SRC
6024                 either cannot overlap or overlap (fully or
6025                 partially) such that walking SRC and DEST in
6026                 element wise element order (honoring the stride
6027                 value) will not lead to wrong results.
6028                 Otherwise, the value is 'true'.
6029     STAT        intent(out) when non-NULL give the result of the
6030                 operation, i.e., zero on success and non-zero on
6031                 error.  When NULL and an error occurs, then an
6032                 error message is printed and the program is
6033                 terminated.
6034
6035_NOTES_
6036     It is permitted to have the same image index for both
6037     SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
6038     the send-from might (partially) overlap in that case.  The
6039     implementation has to take care that it handles this case, e.g.
6040     using 'memmove' which handles (partially) overlapping memory.  If
6041     MAY_REQUIRE_TMP is true, the library might additionally create a
6042     temporary variable, unless additional checks show that this is not
6043     required (e.g.  because walking backward is possible or because
6044     both arrays are contiguous and 'memmove' takes care of overlap
6045     issues).
6046
6047     Note that the assignment of a scalar to an array is permitted.  In
6048     addition, the library has to handle numeric-type conversion and for
6049     strings, padding and different character kinds.
6050
6051
6052File: gfortran.info,  Node: _gfortran_caf_send_by_ref,  Next: _gfortran_caf_get_by_ref,  Prev: _gfortran_caf_sendget,  Up: Function ABI Documentation
6053
60548.2.14 '_gfortran_caf_send_by_ref' -- Sending data from a local image to a remote image with enhanced referencing options
6055-------------------------------------------------------------------------------------------------------------------------
6056
6057_Description_:
6058     Called to send a scalar, an array section or a whole array from a
6059     local to a remote image identified by the IMAGE_INDEX.
6060
6061_Syntax_:
6062     'void _gfortran_caf_send_by_ref (caf_token_t token, int
6063     image_index, gfc_descriptor_t *src, caf_reference_t *refs, int
6064     dst_kind, int src_kind, bool may_require_tmp, bool
6065     dst_reallocatable, int *stat, int dst_type)'
6066
6067_Arguments_:
6068     TOKEN       intent(in) An opaque pointer identifying the
6069                 coarray.
6070     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6071                 positive number.
6072     SRC         intent(in) Array descriptor of the local array
6073                 to be transferred to the remote image
6074     REFS        intent(in) The references on the remote array to
6075                 store the data given by src.  Guaranteed to have
6076                 at least one entry.
6077     DST_KIND    intent(in) Kind of the destination argument
6078     SRC_KIND    intent(in) Kind of the source argument
6079     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
6080                 known at compile time that the DEST and SRC
6081                 either cannot overlap or overlap (fully or
6082                 partially) such that walking SRC and DEST in
6083                 element wise element order (honoring the stride
6084                 value) will not lead to wrong results.
6085                 Otherwise, the value is 'true'.
6086     DST_REALLOCATABLEintent(in) Set when the destination is of
6087                 allocatable or pointer type and the refs will
6088                 allow reallocation, i.e., the ref is a full
6089                 array or component ref.
6090     STAT        intent(out) When non-'NULL' give the result of
6091                 the operation, i.e., zero on success and
6092                 non-zero on error.  When 'NULL' and an error
6093                 occurs, then an error message is printed and the
6094                 program is terminated.
6095     DST_TYPE    intent(in) Give the type of the destination.
6096                 When the destination is not an array, than the
6097                 precise type, e.g.  of a component in a derived
6098                 type, is not known, but provided here.
6099
6100_NOTES_
6101     It is permitted to have IMAGE_INDEX equal the current image; the
6102     memory of the send-to and the send-from might (partially) overlap
6103     in that case.  The implementation has to take care that it handles
6104     this case, e.g.  using 'memmove' which handles (partially)
6105     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
6106     additionally create a temporary variable, unless additional checks
6107     show that this is not required (e.g.  because walking backward is
6108     possible or because both arrays are contiguous and 'memmove' takes
6109     care of overlap issues).
6110
6111     Note that the assignment of a scalar to an array is permitted.  In
6112     addition, the library has to handle numeric-type conversion and for
6113     strings, padding and different character kinds.
6114
6115     Because of the more complicated references possible some operations
6116     may be unsupported by certain libraries.  The library is expected
6117     to issue a precise error message why the operation is not
6118     permitted.
6119
6120
6121File: gfortran.info,  Node: _gfortran_caf_get_by_ref,  Next: _gfortran_caf_sendget_by_ref,  Prev: _gfortran_caf_send_by_ref,  Up: Function ABI Documentation
6122
61238.2.15 '_gfortran_caf_get_by_ref' -- Getting data from a remote image using enhanced references
6124-----------------------------------------------------------------------------------------------
6125
6126_Description_:
6127     Called to get a scalar, an array section or a whole array from a
6128     remote image identified by the IMAGE_INDEX.
6129
6130_Syntax_:
6131     'void _gfortran_caf_get_by_ref (caf_token_t token, int image_index,
6132     caf_reference_t *refs, gfc_descriptor_t *dst, int dst_kind, int
6133     src_kind, bool may_require_tmp, bool dst_reallocatable, int *stat,
6134     int src_type)'
6135
6136_Arguments_:
6137     TOKEN       intent(in) An opaque pointer identifying the
6138                 coarray.
6139     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6140                 positive number.
6141     REFS        intent(in) The references to apply to the remote
6142                 structure to get the data.
6143     DST         intent(in) Array descriptor of the local array
6144                 to store the data transferred from the remote
6145                 image.  May be reallocated where needed and when
6146                 DST_REALLOCATABLE allows it.
6147     DST_KIND    intent(in) Kind of the destination argument
6148     SRC_KIND    intent(in) Kind of the source argument
6149     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
6150                 known at compile time that the DEST and SRC
6151                 either cannot overlap or overlap (fully or
6152                 partially) such that walking SRC and DEST in
6153                 element wise element order (honoring the stride
6154                 value) will not lead to wrong results.
6155                 Otherwise, the value is 'true'.
6156     DST_REALLOCATABLEintent(in) Set when DST is of allocatable or
6157                 pointer type and its refs allow reallocation,
6158                 i.e., the full array or a component is
6159                 referenced.
6160     STAT        intent(out) When non-'NULL' give the result of
6161                 the operation, i.e., zero on success and
6162                 non-zero on error.  When 'NULL' and an error
6163                 occurs, then an error message is printed and the
6164                 program is terminated.
6165     SRC_TYPE    intent(in) Give the type of the source.  When
6166                 the source is not an array, than the precise
6167                 type, e.g.  of a component in a derived type, is
6168                 not known, but provided here.
6169
6170_NOTES_
6171     It is permitted to have 'image_index' equal the current image; the
6172     memory of the send-to and the send-from might (partially) overlap
6173     in that case.  The implementation has to take care that it handles
6174     this case, e.g.  using 'memmove' which handles (partially)
6175     overlapping memory.  If MAY_REQUIRE_TMP is true, the library might
6176     additionally create a temporary variable, unless additional checks
6177     show that this is not required (e.g.  because walking backward is
6178     possible or because both arrays are contiguous and 'memmove' takes
6179     care of overlap issues).
6180
6181     Note that the library has to handle numeric-type conversion and for
6182     strings, padding and different character kinds.
6183
6184     Because of the more complicated references possible some operations
6185     may be unsupported by certain libraries.  The library is expected
6186     to issue a precise error message why the operation is not
6187     permitted.
6188
6189
6190File: gfortran.info,  Node: _gfortran_caf_sendget_by_ref,  Next: _gfortran_caf_lock,  Prev: _gfortran_caf_get_by_ref,  Up: Function ABI Documentation
6191
61928.2.16 '_gfortran_caf_sendget_by_ref' -- Sending data between remote images using enhanced references on both sides
6193-------------------------------------------------------------------------------------------------------------------
6194
6195_Description_:
6196     Called to send a scalar, an array section or a whole array from a
6197     remote image identified by the SRC_IMAGE_INDEX to a remote image
6198     identified by the DST_IMAGE_INDEX.
6199
6200_Syntax_:
6201     'void _gfortran_caf_sendget_by_ref (caf_token_t dst_token, int
6202     dst_image_index, caf_reference_t *dst_refs, caf_token_t src_token,
6203     int src_image_index, caf_reference_t *src_refs, int dst_kind, int
6204     src_kind, bool may_require_tmp, int *dst_stat, int *src_stat, int
6205     dst_type, int src_type)'
6206
6207_Arguments_:
6208     DST_TOKEN   intent(in) An opaque pointer identifying the
6209                 destination coarray.
6210     DST_IMAGE_INDEXintent(in) The ID of the destination remote
6211                 image; must be a positive number.
6212     DST_REFS    intent(in) The references on the remote array to
6213                 store the data given by the source.  Guaranteed
6214                 to have at least one entry.
6215     SRC_TOKEN   intent(in) An opaque pointer identifying the
6216                 source coarray.
6217     SRC_IMAGE_INDEXintent(in) The ID of the source remote image;
6218                 must be a positive number.
6219     SRC_REFS    intent(in) The references to apply to the remote
6220                 structure to get the data.
6221     DST_KIND    intent(in) Kind of the destination argument
6222     SRC_KIND    intent(in) Kind of the source argument
6223     MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is
6224                 known at compile time that the DEST and SRC
6225                 either cannot overlap or overlap (fully or
6226                 partially) such that walking SRC and DEST in
6227                 element wise element order (honoring the stride
6228                 value) will not lead to wrong results.
6229                 Otherwise, the value is 'true'.
6230     DST_STAT    intent(out) when non-'NULL' give the result of
6231                 the send-operation, i.e., zero on success and
6232                 non-zero on error.  When 'NULL' and an error
6233                 occurs, then an error message is printed and the
6234                 program is terminated.
6235     SRC_STAT    intent(out) When non-'NULL' give the result of
6236                 the get-operation, i.e., zero on success and
6237                 non-zero on error.  When 'NULL' and an error
6238                 occurs, then an error message is printed and the
6239                 program is terminated.
6240     DST_TYPE    intent(in) Give the type of the destination.
6241                 When the destination is not an array, than the
6242                 precise type, e.g.  of a component in a derived
6243                 type, is not known, but provided here.
6244     SRC_TYPE    intent(in) Give the type of the source.  When
6245                 the source is not an array, than the precise
6246                 type, e.g.  of a component in a derived type, is
6247                 not known, but provided here.
6248
6249_NOTES_
6250     It is permitted to have the same image index for both
6251     SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and
6252     the send-from might (partially) overlap in that case.  The
6253     implementation has to take care that it handles this case, e.g.
6254     using 'memmove' which handles (partially) overlapping memory.  If
6255     MAY_REQUIRE_TMP is true, the library might additionally create a
6256     temporary variable, unless additional checks show that this is not
6257     required (e.g.  because walking backward is possible or because
6258     both arrays are contiguous and 'memmove' takes care of overlap
6259     issues).
6260
6261     Note that the assignment of a scalar to an array is permitted.  In
6262     addition, the library has to handle numeric-type conversion and for
6263     strings, padding and different character kinds.
6264
6265     Because of the more complicated references possible some operations
6266     may be unsupported by certain libraries.  The library is expected
6267     to issue a precise error message why the operation is not
6268     permitted.
6269
6270
6271File: gfortran.info,  Node: _gfortran_caf_lock,  Next: _gfortran_caf_unlock,  Prev: _gfortran_caf_sendget_by_ref,  Up: Function ABI Documentation
6272
62738.2.17 '_gfortran_caf_lock' -- Locking a lock variable
6274------------------------------------------------------
6275
6276_Description_:
6277     Acquire a lock on the given image on a scalar locking variable or
6278     for the given array element for an array-valued variable.  If the
6279     AQUIRED_LOCK is 'NULL', the function returns after having obtained
6280     the lock.  If it is non-'NULL', then ACQUIRED_LOCK is assigned the
6281     value true (one) when the lock could be obtained and false (zero)
6282     otherwise.  Locking a lock variable which has already been locked
6283     by the same image is an error.
6284
6285_Syntax_:
6286     'void _gfortran_caf_lock (caf_token_t token, size_t index, int
6287     image_index, int *aquired_lock, int *stat, char *errmsg, size_t
6288     errmsg_len)'
6289
6290_Arguments_:
6291     TOKEN       intent(in) An opaque pointer identifying the
6292                 coarray.
6293     INDEX       intent(in) Array index; first array index is 0.
6294                 For scalars, it is always 0.
6295     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6296                 positive number.
6297     AQUIRED_LOCKintent(out) If not NULL, it returns whether lock
6298                 could be obtained.
6299     STAT        intent(out) Stores the STAT=; may be NULL.
6300     ERRMSG      intent(out) When an error occurs, this will be
6301                 set to an error message; may be NULL.
6302     ERRMSG_LEN  intent(in) the buffer size of errmsg
6303
6304_NOTES_
6305     This function is also called for critical blocks; for those, the
6306     array index is always zero and the image index is one.  Libraries
6307     are permitted to use other images for critical-block locking
6308     variables.
6309
6310
6311File: gfortran.info,  Node: _gfortran_caf_unlock,  Next: _gfortran_caf_event_post,  Prev: _gfortran_caf_lock,  Up: Function ABI Documentation
6312
63138.2.18 '_gfortran_caf_lock' -- Unlocking a lock variable
6314--------------------------------------------------------
6315
6316_Description_:
6317     Release a lock on the given image on a scalar locking variable or
6318     for the given array element for an array-valued variable.
6319     Unlocking a lock variable which is unlocked or has been locked by a
6320     different image is an error.
6321
6322_Syntax_:
6323     'void _gfortran_caf_unlock (caf_token_t token, size_t index, int
6324     image_index, int *stat, char *errmsg, size_t errmsg_len)'
6325
6326_Arguments_:
6327     TOKEN       intent(in) An opaque pointer identifying the
6328                 coarray.
6329     INDEX       intent(in) Array index; first array index is 0.
6330                 For scalars, it is always 0.
6331     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6332                 positive number.
6333     STAT        intent(out) For allocatable coarrays, stores the
6334                 STAT=; may be NULL.
6335     ERRMSG      intent(out) When an error occurs, this will be
6336                 set to an error message; may be NULL.
6337     ERRMSG_LEN  intent(in) the buffer size of errmsg
6338
6339_NOTES_
6340     This function is also called for critical block; for those, the
6341     array index is always zero and the image index is one.  Libraries
6342     are permitted to use other images for critical-block locking
6343     variables.
6344
6345
6346File: gfortran.info,  Node: _gfortran_caf_event_post,  Next: _gfortran_caf_event_wait,  Prev: _gfortran_caf_unlock,  Up: Function ABI Documentation
6347
63488.2.19 '_gfortran_caf_event_post' -- Post an event
6349--------------------------------------------------
6350
6351_Description_:
6352     Increment the event count of the specified event variable.
6353
6354_Syntax_:
6355     'void _gfortran_caf_event_post (caf_token_t token, size_t index,
6356     int image_index, int *stat, char *errmsg, size_t errmsg_len)'
6357
6358_Arguments_:
6359     TOKEN       intent(in) An opaque pointer identifying the
6360                 coarray.
6361     INDEX       intent(in) Array index; first array index is 0.
6362                 For scalars, it is always 0.
6363     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6364                 positive number; zero indicates the current
6365                 image, when accessed noncoindexed.
6366     STAT        intent(out) Stores the STAT=; may be NULL.
6367     ERRMSG      intent(out) When an error occurs, this will be
6368                 set to an error message; may be NULL.
6369     ERRMSG_LEN  intent(in) the buffer size of errmsg
6370
6371_NOTES_
6372     This acts like an atomic add of one to the remote image's event
6373     variable.  The statement is an image-control statement but does not
6374     imply sync memory.  Still, all preceeding push communications of
6375     this image to the specified remote image have to be completed
6376     before 'event_wait' on the remote image returns.
6377
6378
6379File: gfortran.info,  Node: _gfortran_caf_event_wait,  Next: _gfortran_caf_event_query,  Prev: _gfortran_caf_event_post,  Up: Function ABI Documentation
6380
63818.2.20 '_gfortran_caf_event_wait' -- Wait that an event occurred
6382----------------------------------------------------------------
6383
6384_Description_:
6385     Wait until the event count has reached at least the specified
6386     UNTIL_COUNT; if so, atomically decrement the event variable by this
6387     amount and return.
6388
6389_Syntax_:
6390     'void _gfortran_caf_event_wait (caf_token_t token, size_t index,
6391     int until_count, int *stat, char *errmsg, size_t errmsg_len)'
6392
6393_Arguments_:
6394     TOKEN       intent(in) An opaque pointer identifying the
6395                 coarray.
6396     INDEX       intent(in) Array index; first array index is 0.
6397                 For scalars, it is always 0.
6398     UNTIL_COUNT intent(in) The number of events which have to be
6399                 available before the function returns.
6400     STAT        intent(out) Stores the STAT=; may be NULL.
6401     ERRMSG      intent(out) When an error occurs, this will be
6402                 set to an error message; may be NULL.
6403     ERRMSG_LEN  intent(in) the buffer size of errmsg
6404
6405_NOTES_
6406     This function only operates on a local coarray.  It acts like a
6407     loop checking atomically the value of the event variable, breaking
6408     if the value is greater or equal the requested number of counts.
6409     Before the function returns, the event variable has to be
6410     decremented by the requested UNTIL_COUNT value.  A possible
6411     implementation would be a busy loop for a certain number of spins
6412     (possibly depending on the number of threads relative to the number
6413     of available cores) followed by another waiting strategy such as a
6414     sleeping wait (possibly with an increasing number of sleep time)
6415     or, if possible, a futex wait.
6416
6417     The statement is an image-control statement but does not imply sync
6418     memory.  Still, all preceeding push communications of this image to
6419     the specified remote image have to be completed before 'event_wait'
6420     on the remote image returns.
6421
6422
6423File: gfortran.info,  Node: _gfortran_caf_event_query,  Next: _gfortran_caf_sync_all,  Prev: _gfortran_caf_event_wait,  Up: Function ABI Documentation
6424
64258.2.21 '_gfortran_caf_event_query' -- Query event count
6426-------------------------------------------------------
6427
6428_Description_:
6429     Return the event count of the specified event variable.
6430
6431_Syntax_:
6432     'void _gfortran_caf_event_query (caf_token_t token, size_t index,
6433     int image_index, int *count, int *stat)'
6434
6435_Arguments_:
6436     TOKEN       intent(in) An opaque pointer identifying the
6437                 coarray.
6438     INDEX       intent(in) Array index; first array index is 0.
6439                 For scalars, it is always 0.
6440     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6441                 positive number; zero indicates the current
6442                 image when accessed noncoindexed.
6443     COUNT       intent(out) The number of events currently
6444                 posted to the event variable.
6445     STAT        intent(out) Stores the STAT=; may be NULL.
6446
6447_NOTES_
6448     The typical use is to check the local event variable to only call
6449     'event_wait' when the data is available.  However, a coindexed
6450     variable is permitted; there is no ordering or synchronization
6451     implied.  It acts like an atomic fetch of the value of the event
6452     variable.
6453
6454
6455File: gfortran.info,  Node: _gfortran_caf_sync_all,  Next: _gfortran_caf_sync_images,  Prev: _gfortran_caf_event_query,  Up: Function ABI Documentation
6456
64578.2.22 '_gfortran_caf_sync_all' -- All-image barrier
6458----------------------------------------------------
6459
6460_Description_:
6461     Synchronization of all images in the current team; the program only
6462     continues on a given image after this function has been called on
6463     all images of the current team.  Additionally, it ensures that all
6464     pending data transfers of previous segment have completed.
6465
6466_Syntax_:
6467     'void _gfortran_caf_sync_all (int *stat, char *errmsg, size_t
6468     errmsg_len)'
6469
6470_Arguments_:
6471     STAT        intent(out) Stores the status STAT= and may be
6472                 NULL.
6473     ERRMSG      intent(out) When an error occurs, this will be
6474                 set to an error message; may be NULL.
6475     ERRMSG_LEN  intent(in) the buffer size of errmsg
6476
6477
6478File: gfortran.info,  Node: _gfortran_caf_sync_images,  Next: _gfortran_caf_sync_memory,  Prev: _gfortran_caf_sync_all,  Up: Function ABI Documentation
6479
64808.2.23 '_gfortran_caf_sync_images' -- Barrier for selected images
6481-----------------------------------------------------------------
6482
6483_Description_:
6484     Synchronization between the specified images; the program only
6485     continues on a given image after this function has been called on
6486     all images specified for that image.  Note that one image can wait
6487     for all other images in the current team (e.g.  via 'sync
6488     images(*)') while those only wait for that specific image.
6489     Additionally, 'sync images' ensures that all pending data transfers
6490     of previous segments have completed.
6491
6492_Syntax_:
6493     'void _gfortran_caf_sync_images (int count, int images[], int
6494     *stat, char *errmsg, size_t errmsg_len)'
6495
6496_Arguments_:
6497     COUNT       intent(in) The number of images which are
6498                 provided in the next argument.  For a zero-sized
6499                 array, the value is zero.  For 'sync images
6500                 (*)', the value is -1.
6501     IMAGES      intent(in) An array with the images provided by
6502                 the user.  If COUNT is zero, a NULL pointer is
6503                 passed.
6504     STAT        intent(out) Stores the status STAT= and may be
6505                 NULL.
6506     ERRMSG      intent(out) When an error occurs, this will be
6507                 set to an error message; may be NULL.
6508     ERRMSG_LEN  intent(in) the buffer size of errmsg
6509
6510
6511File: gfortran.info,  Node: _gfortran_caf_sync_memory,  Next: _gfortran_caf_error_stop,  Prev: _gfortran_caf_sync_images,  Up: Function ABI Documentation
6512
65138.2.24 '_gfortran_caf_sync_memory' -- Wait for completion of segment-memory operations
6514--------------------------------------------------------------------------------------
6515
6516_Description_:
6517     Acts as optimization barrier between different segments.  It also
6518     ensures that all pending memory operations of this image have been
6519     completed.
6520
6521_Syntax_:
6522     'void _gfortran_caf_sync_memory (int *stat, char *errmsg, size_t
6523     errmsg_len)'
6524
6525_Arguments_:
6526     STAT        intent(out) Stores the status STAT= and may be
6527                 NULL.
6528     ERRMSG      intent(out) When an error occurs, this will be
6529                 set to an error message; may be NULL.
6530     ERRMSG_LEN  intent(in) the buffer size of errmsg
6531
6532_NOTE_ A simple implementation could be
6533     '__asm__ __volatile__ ("":::"memory")' to prevent code movements.
6534
6535
6536File: gfortran.info,  Node: _gfortran_caf_error_stop,  Next: _gfortran_caf_error_stop_str,  Prev: _gfortran_caf_sync_memory,  Up: Function ABI Documentation
6537
65388.2.25 '_gfortran_caf_error_stop' -- Error termination with exit code
6539---------------------------------------------------------------------
6540
6541_Description_:
6542     Invoked for an 'ERROR STOP' statement which has an integer
6543     argument.  The function should terminate the program with the
6544     specified exit code.
6545
6546_Syntax_:
6547     'void _gfortran_caf_error_stop (int error)'
6548
6549_Arguments_:
6550     ERROR       intent(in) The exit status to be used.
6551
6552
6553File: gfortran.info,  Node: _gfortran_caf_error_stop_str,  Next: _gfortran_caf_fail_image,  Prev: _gfortran_caf_error_stop,  Up: Function ABI Documentation
6554
65558.2.26 '_gfortran_caf_error_stop_str' -- Error termination with string
6556----------------------------------------------------------------------
6557
6558_Description_:
6559     Invoked for an 'ERROR STOP' statement which has a string as
6560     argument.  The function should terminate the program with a
6561     nonzero-exit code.
6562
6563_Syntax_:
6564     'void _gfortran_caf_error_stop (const char *string, size_t len)'
6565
6566_Arguments_:
6567     STRING      intent(in) the error message (not zero
6568                 terminated)
6569     LEN         intent(in) the length of the string
6570
6571
6572File: gfortran.info,  Node: _gfortran_caf_fail_image,  Next: _gfortran_caf_atomic_define,  Prev: _gfortran_caf_error_stop_str,  Up: Function ABI Documentation
6573
65748.2.27 '_gfortran_caf_fail_image' -- Mark the image failed and end its execution
6575--------------------------------------------------------------------------------
6576
6577_Description_:
6578     Invoked for an 'FAIL IMAGE' statement.  The function should
6579     terminate the current image.
6580
6581_Syntax_:
6582     'void _gfortran_caf_fail_image ()'
6583
6584_NOTES_
6585     This function follows TS18508.
6586
6587
6588File: gfortran.info,  Node: _gfortran_caf_atomic_define,  Next: _gfortran_caf_atomic_ref,  Prev: _gfortran_caf_fail_image,  Up: Function ABI Documentation
6589
65908.2.28 '_gfortran_caf_atomic_define' -- Atomic variable assignment
6591------------------------------------------------------------------
6592
6593_Description_:
6594     Assign atomically a value to an integer or logical variable.
6595
6596_Syntax_:
6597     'void _gfortran_caf_atomic_define (caf_token_t token, size_t
6598     offset, int image_index, void *value, int *stat, int type, int
6599     kind)'
6600
6601_Arguments_:
6602     TOKEN       intent(in) An opaque pointer identifying the
6603                 coarray.
6604     OFFSET      intent(in) By which amount of bytes the actual
6605                 data is shifted compared to the base address of
6606                 the coarray.
6607     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6608                 positive number; zero indicates the current
6609                 image when used noncoindexed.
6610     VALUE       intent(in) the value to be assigned, passed by
6611                 reference
6612     STAT        intent(out) Stores the status STAT= and may be
6613                 NULL.
6614     TYPE        intent(in) The data type, i.e.  'BT_INTEGER' (1)
6615                 or 'BT_LOGICAL' (2).
6616     KIND        intent(in) The kind value (only 4; always 'int')
6617
6618
6619File: gfortran.info,  Node: _gfortran_caf_atomic_ref,  Next: _gfortran_caf_atomic_cas,  Prev: _gfortran_caf_atomic_define,  Up: Function ABI Documentation
6620
66218.2.29 '_gfortran_caf_atomic_ref' -- Atomic variable reference
6622--------------------------------------------------------------
6623
6624_Description_:
6625     Reference atomically a value of a kind-4 integer or logical
6626     variable.
6627
6628_Syntax_:
6629     'void _gfortran_caf_atomic_ref (caf_token_t token, size_t offset,
6630     int image_index, void *value, int *stat, int type, int kind)'
6631
6632_Arguments_:
6633     TOKEN       intent(in) An opaque pointer identifying the
6634                 coarray.
6635     OFFSET      intent(in) By which amount of bytes the actual
6636                 data is shifted compared to the base address of
6637                 the coarray.
6638     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6639                 positive number; zero indicates the current
6640                 image when used noncoindexed.
6641     VALUE       intent(out) The variable assigned the atomically
6642                 referenced variable.
6643     STAT        intent(out) Stores the status STAT= and may be
6644                 NULL.
6645     TYPE        the data type, i.e.  'BT_INTEGER' (1) or
6646                 'BT_LOGICAL' (2).
6647     KIND        The kind value (only 4; always 'int')
6648
6649
6650File: gfortran.info,  Node: _gfortran_caf_atomic_cas,  Next: _gfortran_caf_atomic_op,  Prev: _gfortran_caf_atomic_ref,  Up: Function ABI Documentation
6651
66528.2.30 '_gfortran_caf_atomic_cas' -- Atomic compare and swap
6653------------------------------------------------------------
6654
6655_Description_:
6656     Atomic compare and swap of a kind-4 integer or logical variable.
6657     Assigns atomically the specified value to the atomic variable, if
6658     the latter has the value specified by the passed condition value.
6659
6660_Syntax_:
6661     'void _gfortran_caf_atomic_cas (caf_token_t token, size_t offset,
6662     int image_index, void *old, void *compare, void *new_val, int
6663     *stat, int type, int kind)'
6664
6665_Arguments_:
6666     TOKEN       intent(in) An opaque pointer identifying the
6667                 coarray.
6668     OFFSET      intent(in) By which amount of bytes the actual
6669                 data is shifted compared to the base address of
6670                 the coarray.
6671     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6672                 positive number; zero indicates the current
6673                 image when used noncoindexed.
6674     OLD         intent(out) The value which the atomic variable
6675                 had just before the cas operation.
6676     COMPARE     intent(in) The value used for comparision.
6677     NEW_VAL     intent(in) The new value for the atomic
6678                 variable, assigned to the atomic variable, if
6679                 'compare' equals the value of the atomic
6680                 variable.
6681     STAT        intent(out) Stores the status STAT= and may be
6682                 NULL.
6683     TYPE        intent(in) the data type, i.e.  'BT_INTEGER' (1)
6684                 or 'BT_LOGICAL' (2).
6685     KIND        intent(in) The kind value (only 4; always 'int')
6686
6687
6688File: gfortran.info,  Node: _gfortran_caf_atomic_op,  Next: _gfortran_caf_co_broadcast,  Prev: _gfortran_caf_atomic_cas,  Up: Function ABI Documentation
6689
66908.2.31 '_gfortran_caf_atomic_op' -- Atomic operation
6691----------------------------------------------------
6692
6693_Description_:
6694     Apply an operation atomically to an atomic integer or logical
6695     variable.  After the operation, OLD contains the value just before
6696     the operation, which, respectively, adds (GFC_CAF_ATOMIC_ADD)
6697     atomically the 'value' to the atomic integer variable or does a
6698     bitwise AND, OR or exclusive OR between the atomic variable and
6699     VALUE; the result is then stored in the atomic variable.
6700
6701_Syntax_:
6702     'void _gfortran_caf_atomic_op (int op, caf_token_t token, size_t
6703     offset, int image_index, void *value, void *old, int *stat, int
6704     type, int kind)'
6705
6706_Arguments_:
6707     OP          intent(in) the operation to be performed;
6708                 possible values 'GFC_CAF_ATOMIC_ADD' (1),
6709                 'GFC_CAF_ATOMIC_AND' (2), 'GFC_CAF_ATOMIC_OR'
6710                 (3), 'GFC_CAF_ATOMIC_XOR' (4).
6711     TOKEN       intent(in) An opaque pointer identifying the
6712                 coarray.
6713     OFFSET      intent(in) By which amount of bytes the actual
6714                 data is shifted compared to the base address of
6715                 the coarray.
6716     IMAGE_INDEX intent(in) The ID of the remote image; must be a
6717                 positive number; zero indicates the current
6718                 image when used noncoindexed.
6719     OLD         intent(out) The value which the atomic variable
6720                 had just before the atomic operation.
6721     VAL         intent(in) The new value for the atomic
6722                 variable, assigned to the atomic variable, if
6723                 'compare' equals the value of the atomic
6724                 variable.
6725     STAT        intent(out) Stores the status STAT= and may be
6726                 NULL.
6727     TYPE        intent(in) the data type, i.e.  'BT_INTEGER' (1)
6728                 or 'BT_LOGICAL' (2)
6729     KIND        intent(in) the kind value (only 4; always 'int')
6730
6731
6732File: gfortran.info,  Node: _gfortran_caf_co_broadcast,  Next: _gfortran_caf_co_max,  Prev: _gfortran_caf_atomic_op,  Up: Function ABI Documentation
6733
67348.2.32 '_gfortran_caf_co_broadcast' -- Sending data to all images
6735-----------------------------------------------------------------
6736
6737_Description_:
6738     Distribute a value from a given image to all other images in the
6739     team.  Has to be called collectively.
6740
6741_Syntax_:
6742     'void _gfortran_caf_co_broadcast (gfc_descriptor_t *a, int
6743     source_image, int *stat, char *errmsg, size_t errmsg_len)'
6744
6745_Arguments_:
6746     A           intent(inout) An array descriptor with the data
6747                 to be broadcasted (on SOURCE_IMAGE) or to be
6748                 received (other images).
6749     SOURCE_IMAGEintent(in) The ID of the image from which the
6750                 data should be broadcasted.
6751     STAT        intent(out) Stores the status STAT= and may be
6752                 NULL.
6753     ERRMSG      intent(out) When an error occurs, this will be
6754                 set to an error message; may be NULL.
6755     ERRMSG_LEN  intent(in) the buffer size of errmsg.
6756
6757
6758File: gfortran.info,  Node: _gfortran_caf_co_max,  Next: _gfortran_caf_co_min,  Prev: _gfortran_caf_co_broadcast,  Up: Function ABI Documentation
6759
67608.2.33 '_gfortran_caf_co_max' -- Collective maximum reduction
6761-------------------------------------------------------------
6762
6763_Description_:
6764     Calculates for each array element of the variable A the maximum
6765     value for that element in the current team; if RESULT_IMAGE has the
6766     value 0, the result shall be stored on all images, otherwise, only
6767     on the specified image.  This function operates on numeric values
6768     and character strings.
6769
6770_Syntax_:
6771     'void _gfortran_caf_co_max (gfc_descriptor_t *a, int result_image,
6772     int *stat, char *errmsg, int a_len, size_t errmsg_len)'
6773
6774_Arguments_:
6775     A           intent(inout) An array descriptor for the data
6776                 to be processed.  On the destination image(s)
6777                 the result overwrites the old content.
6778     RESULT_IMAGEintent(in) The ID of the image to which the
6779                 reduced value should be copied to; if zero, it
6780                 has to be copied to all images.
6781     STAT        intent(out) Stores the status STAT= and may be
6782                 NULL.
6783     ERRMSG      intent(out) When an error occurs, this will be
6784                 set to an error message; may be NULL.
6785     A_LEN       intent(in) the string length of argument A
6786     ERRMSG_LEN  intent(in) the buffer size of errmsg
6787
6788_NOTES_
6789     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6790     all images except of the specified one become undefined; hence, the
6791     library may make use of this.
6792
6793
6794File: gfortran.info,  Node: _gfortran_caf_co_min,  Next: _gfortran_caf_co_sum,  Prev: _gfortran_caf_co_max,  Up: Function ABI Documentation
6795
67968.2.34 '_gfortran_caf_co_min' -- Collective minimum reduction
6797-------------------------------------------------------------
6798
6799_Description_:
6800     Calculates for each array element of the variable A the minimum
6801     value for that element in the current team; if RESULT_IMAGE has the
6802     value 0, the result shall be stored on all images, otherwise, only
6803     on the specified image.  This function operates on numeric values
6804     and character strings.
6805
6806_Syntax_:
6807     'void _gfortran_caf_co_min (gfc_descriptor_t *a, int result_image,
6808     int *stat, char *errmsg, int a_len, size_t errmsg_len)'
6809
6810_Arguments_:
6811     A           intent(inout) An array descriptor for the data
6812                 to be processed.  On the destination image(s)
6813                 the result overwrites the old content.
6814     RESULT_IMAGEintent(in) The ID of the image to which the
6815                 reduced value should be copied to; if zero, it
6816                 has to be copied to all images.
6817     STAT        intent(out) Stores the status STAT= and may be
6818                 NULL.
6819     ERRMSG      intent(out) When an error occurs, this will be
6820                 set to an error message; may be NULL.
6821     A_LEN       intent(in) the string length of argument A
6822     ERRMSG_LEN  intent(in) the buffer size of errmsg
6823
6824_NOTES_
6825     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6826     all images except of the specified one become undefined; hence, the
6827     library may make use of this.
6828
6829
6830File: gfortran.info,  Node: _gfortran_caf_co_sum,  Next: _gfortran_caf_co_reduce,  Prev: _gfortran_caf_co_min,  Up: Function ABI Documentation
6831
68328.2.35 '_gfortran_caf_co_sum' -- Collective summing reduction
6833-------------------------------------------------------------
6834
6835_Description_:
6836     Calculates for each array element of the variable A the sum of all
6837     values for that element in the current team; if RESULT_IMAGE has
6838     the value 0, the result shall be stored on all images, otherwise,
6839     only on the specified image.  This function operates on numeric
6840     values only.
6841
6842_Syntax_:
6843     'void _gfortran_caf_co_sum (gfc_descriptor_t *a, int result_image,
6844     int *stat, char *errmsg, size_t errmsg_len)'
6845
6846_Arguments_:
6847     A           intent(inout) An array descriptor with the data
6848                 to be processed.  On the destination image(s)
6849                 the result overwrites the old content.
6850     RESULT_IMAGEintent(in) The ID of the image to which the
6851                 reduced value should be copied to; if zero, it
6852                 has to be copied to all images.
6853     STAT        intent(out) Stores the status STAT= and may be
6854                 NULL.
6855     ERRMSG      intent(out) When an error occurs, this will be
6856                 set to an error message; may be NULL.
6857     ERRMSG_LEN  intent(in) the buffer size of errmsg
6858
6859_NOTES_
6860     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6861     all images except of the specified one become undefined; hence, the
6862     library may make use of this.
6863
6864
6865File: gfortran.info,  Node: _gfortran_caf_co_reduce,  Prev: _gfortran_caf_co_sum,  Up: Function ABI Documentation
6866
68678.2.36 '_gfortran_caf_co_reduce' -- Generic collective reduction
6868----------------------------------------------------------------
6869
6870_Description_:
6871     Calculates for each array element of the variable A the reduction
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.  The OPR is a pure function doing a
6875     mathematically commutative and associative operation.
6876
6877     The OPR_FLAGS denote the following; the values are bitwise ored.
6878     'GFC_CAF_BYREF' (1) if the result should be returned by reference;
6879     'GFC_CAF_HIDDENLEN' (2) whether the result and argument string
6880     lengths shall be specified as hidden arguments; 'GFC_CAF_ARG_VALUE'
6881     (4) whether the arguments shall be passed by value,
6882     'GFC_CAF_ARG_DESC' (8) whether the arguments shall be passed by
6883     descriptor.
6884
6885_Syntax_:
6886     'void _gfortran_caf_co_reduce (gfc_descriptor_t *a, void * (*opr)
6887     (void *, void *), int opr_flags, int result_image, int *stat, char
6888     *errmsg, int a_len, size_t errmsg_len)'
6889
6890_Arguments_:
6891     A           intent(inout) An array descriptor with the data
6892                 to be processed.  On the destination image(s)
6893                 the result overwrites the old content.
6894     OPR         intent(in) Function pointer to the reduction
6895                 function
6896     OPR_FLAGS   intent(in) Flags regarding the reduction
6897                 function
6898     RESULT_IMAGEintent(in) The ID of the image to which the
6899                 reduced value should be copied to; if zero, it
6900                 has to be copied to all images.
6901     STAT        intent(out) Stores the status STAT= and may be
6902                 NULL.
6903     ERRMSG      intent(out) When an error occurs, this will be
6904                 set to an error message; may be NULL.
6905     A_LEN       intent(in) the string length of argument A
6906     ERRMSG_LEN  intent(in) the buffer size of errmsg
6907
6908_NOTES_
6909     If RESULT_IMAGE is nonzero, the data in the array descriptor A on
6910     all images except of the specified one become undefined; hence, the
6911     library may make use of this.
6912
6913     For character arguments, the result is passed as first argument,
6914     followed by the result string length, next come the two string
6915     arguments, followed by the two hidden string length arguments.
6916     With C binding, there are no hidden arguments and by-reference
6917     passing and either only a single character is passed or an array
6918     descriptor.
6919
6920
6921File: gfortran.info,  Node: Intrinsic Procedures,  Next: Intrinsic Modules,  Prev: Coarray Programming,  Up: Top
6922
69239 Intrinsic Procedures
6924**********************
6925
6926* Menu:
6927
6928* Introduction:         Introduction to Intrinsics
6929* 'ABORT':         ABORT,     Abort the program
6930* 'ABS':           ABS,       Absolute value
6931* 'ACCESS':        ACCESS,    Checks file access modes
6932* 'ACHAR':         ACHAR,     Character in ASCII collating sequence
6933* 'ACOS':          ACOS,      Arccosine function
6934* 'ACOSD':         ACOSD,     Arccosine function, degrees
6935* 'ACOSH':         ACOSH,     Inverse hyperbolic cosine function
6936* 'ADJUSTL':       ADJUSTL,   Left adjust a string
6937* 'ADJUSTR':       ADJUSTR,   Right adjust a string
6938* 'AIMAG':         AIMAG,     Imaginary part of complex number
6939* 'AINT':          AINT,      Truncate to a whole number
6940* 'ALARM':         ALARM,     Set an alarm clock
6941* 'ALL':           ALL,       Determine if all values are true
6942* 'ALLOCATED':     ALLOCATED, Status of allocatable entity
6943* 'AND':           AND,       Bitwise logical AND
6944* 'ANINT':         ANINT,     Nearest whole number
6945* 'ANY':           ANY,       Determine if any values are true
6946* 'ASIN':          ASIN,      Arcsine function
6947* 'ASIND':         ASIND,     Arcsine function, degrees
6948* 'ASINH':         ASINH,     Inverse hyperbolic sine function
6949* 'ASSOCIATED':    ASSOCIATED, Status of a pointer or pointer/target pair
6950* 'ATAN':          ATAN,      Arctangent function
6951* 'ATAND':         ATAND,     Arctangent function, degrees
6952* 'ATAN2':         ATAN2,     Arctangent function
6953* 'ATAN2D':        ATAN2D,    Arctangent function, degrees
6954* 'ATANH':         ATANH,     Inverse hyperbolic tangent function
6955* 'ATOMIC_ADD':    ATOMIC_ADD, Atomic ADD operation
6956* 'ATOMIC_AND':    ATOMIC_AND, Atomic bitwise AND operation
6957* 'ATOMIC_CAS':    ATOMIC_CAS, Atomic compare and swap
6958* 'ATOMIC_DEFINE': ATOMIC_DEFINE, Setting a variable atomically
6959* 'ATOMIC_FETCH_ADD': ATOMIC_FETCH_ADD, Atomic ADD operation with prior fetch
6960* 'ATOMIC_FETCH_AND': ATOMIC_FETCH_AND, Atomic bitwise AND operation with prior fetch
6961* 'ATOMIC_FETCH_OR': ATOMIC_FETCH_OR, Atomic bitwise OR operation with prior fetch
6962* 'ATOMIC_FETCH_XOR': ATOMIC_FETCH_XOR, Atomic bitwise XOR operation with prior fetch
6963* 'ATOMIC_OR':     ATOMIC_OR, Atomic bitwise OR operation
6964* 'ATOMIC_REF':    ATOMIC_REF, Obtaining the value of a variable atomically
6965* 'ATOMIC_XOR':    ATOMIC_XOR, Atomic bitwise OR operation
6966* 'BACKTRACE':     BACKTRACE, Show a backtrace
6967* 'BESSEL_J0':     BESSEL_J0, Bessel function of the first kind of order 0
6968* 'BESSEL_J1':     BESSEL_J1, Bessel function of the first kind of order 1
6969* 'BESSEL_JN':     BESSEL_JN, Bessel function of the first kind
6970* 'BESSEL_Y0':     BESSEL_Y0, Bessel function of the second kind of order 0
6971* 'BESSEL_Y1':     BESSEL_Y1, Bessel function of the second kind of order 1
6972* 'BESSEL_YN':     BESSEL_YN, Bessel function of the second kind
6973* 'BGE':           BGE,       Bitwise greater than or equal to
6974* 'BGT':           BGT,       Bitwise greater than
6975* 'BIT_SIZE':      BIT_SIZE,  Bit size inquiry function
6976* 'BLE':           BLE,       Bitwise less than or equal to
6977* 'BLT':           BLT,       Bitwise less than
6978* 'BTEST':         BTEST,     Bit test function
6979* 'C_ASSOCIATED':  C_ASSOCIATED, Status of a C pointer
6980* 'C_F_POINTER':   C_F_POINTER, Convert C into Fortran pointer
6981* 'C_F_PROCPOINTER': C_F_PROCPOINTER, Convert C into Fortran procedure pointer
6982* 'C_FUNLOC':      C_FUNLOC,  Obtain the C address of a procedure
6983* 'C_LOC':         C_LOC,     Obtain the C address of an object
6984* 'C_SIZEOF':      C_SIZEOF,  Size in bytes of an expression
6985* 'CEILING':       CEILING,   Integer ceiling function
6986* 'CHAR':          CHAR,      Integer-to-character conversion function
6987* 'CHDIR':         CHDIR,     Change working directory
6988* 'CHMOD':         CHMOD,     Change access permissions of files
6989* 'CMPLX':         CMPLX,     Complex conversion function
6990* 'CO_BROADCAST':  CO_BROADCAST, Copy a value to all images the current set of images
6991* 'CO_MAX':        CO_MAX,    Maximal value on the current set of images
6992* 'CO_MIN':        CO_MIN,    Minimal value on the current set of images
6993* 'CO_REDUCE':     CO_REDUCE, Reduction of values on the current set of images
6994* 'CO_SUM':        CO_SUM,    Sum of values on the current set of images
6995* 'COMMAND_ARGUMENT_COUNT': COMMAND_ARGUMENT_COUNT, Get number of command line arguments
6996* 'COMPILER_OPTIONS': COMPILER_OPTIONS, Options passed to the compiler
6997* 'COMPILER_VERSION': COMPILER_VERSION, Compiler version string
6998* 'COMPLEX':       COMPLEX,   Complex conversion function
6999* 'CONJG':         CONJG,     Complex conjugate function
7000* 'COS':           COS,       Cosine function
7001* 'COSD':          COSD,      Cosine function, degrees
7002* 'COSH':          COSH,      Hyperbolic cosine function
7003* 'COTAN':         COTAN,     Cotangent function
7004* 'COTAND':        COTAND,    Cotangent function, degrees
7005* 'COUNT':         COUNT,     Count occurrences of TRUE in an array
7006* 'CPU_TIME':      CPU_TIME,  CPU time subroutine
7007* 'CSHIFT':        CSHIFT,    Circular shift elements of an array
7008* 'CTIME':         CTIME,     Subroutine (or function) to convert a time into a string
7009* 'DATE_AND_TIME': DATE_AND_TIME, Date and time subroutine
7010* 'DBLE':          DBLE,      Double precision conversion function
7011* 'DCMPLX':        DCMPLX,    Double complex conversion function
7012* 'DIGITS':        DIGITS,    Significant digits function
7013* 'DIM':           DIM,       Positive difference
7014* 'DOT_PRODUCT':   DOT_PRODUCT, Dot product function
7015* 'DPROD':         DPROD,     Double product function
7016* 'DREAL':         DREAL,     Double real part function
7017* 'DSHIFTL':       DSHIFTL,   Combined left shift
7018* 'DSHIFTR':       DSHIFTR,   Combined right shift
7019* 'DTIME':         DTIME,     Execution time subroutine (or function)
7020* 'EOSHIFT':       EOSHIFT,   End-off shift elements of an array
7021* 'EPSILON':       EPSILON,   Epsilon function
7022* 'ERF':           ERF,       Error function
7023* 'ERFC':          ERFC,      Complementary error function
7024* 'ERFC_SCALED':   ERFC_SCALED, Exponentially-scaled complementary error function
7025* 'ETIME':         ETIME,     Execution time subroutine (or function)
7026* 'EVENT_QUERY': EVENT_QUERY, Query whether a coarray event has occurred
7027* 'EXECUTE_COMMAND_LINE': EXECUTE_COMMAND_LINE, Execute a shell command
7028* 'EXIT':          EXIT,      Exit the program with status.
7029* 'EXP':           EXP,       Exponential function
7030* 'EXPONENT':      EXPONENT,  Exponent function
7031* 'EXTENDS_TYPE_OF': EXTENDS_TYPE_OF,  Query dynamic type for extension
7032* 'FDATE':         FDATE,     Subroutine (or function) to get the current time as a string
7033* 'FGET':          FGET,      Read a single character in stream mode from stdin
7034* 'FGETC':         FGETC,     Read a single character in stream mode
7035* 'FINDLOC':       FINDLOC,   Search an array for a value
7036* 'FLOOR':         FLOOR,     Integer floor function
7037* 'FLUSH':         FLUSH,     Flush I/O unit(s)
7038* 'FNUM':          FNUM,      File number function
7039* 'FPUT':          FPUT,      Write a single character in stream mode to stdout
7040* 'FPUTC':         FPUTC,     Write a single character in stream mode
7041* 'FRACTION':      FRACTION,  Fractional part of the model representation
7042* 'FREE':          FREE,      Memory de-allocation subroutine
7043* 'FSEEK':         FSEEK,     Low level file positioning subroutine
7044* 'FSTAT':         FSTAT,     Get file status
7045* 'FTELL':         FTELL,     Current stream position
7046* 'GAMMA':         GAMMA,     Gamma function
7047* 'GERROR':        GERROR,    Get last system error message
7048* 'GETARG':        GETARG,    Get command line arguments
7049* 'GET_COMMAND':   GET_COMMAND, Get the entire command line
7050* 'GET_COMMAND_ARGUMENT': GET_COMMAND_ARGUMENT, Get command line arguments
7051* 'GETCWD':        GETCWD,    Get current working directory
7052* 'GETENV':        GETENV,    Get an environmental variable
7053* 'GET_ENVIRONMENT_VARIABLE': GET_ENVIRONMENT_VARIABLE, Get an environmental variable
7054* 'GETGID':        GETGID,    Group ID function
7055* 'GETLOG':        GETLOG,    Get login name
7056* 'GETPID':        GETPID,    Process ID function
7057* 'GETUID':        GETUID,    User ID function
7058* 'GMTIME':        GMTIME,    Convert time to GMT info
7059* 'HOSTNM':        HOSTNM,    Get system host name
7060* 'HUGE':          HUGE,      Largest number of a kind
7061* 'HYPOT':         HYPOT,     Euclidean distance function
7062* 'IACHAR':        IACHAR,    Code in ASCII collating sequence
7063* 'IALL':          IALL,      Bitwise AND of array elements
7064* 'IAND':          IAND,      Bitwise logical and
7065* 'IANY':          IANY,      Bitwise OR of array elements
7066* 'IARGC':         IARGC,     Get the number of command line arguments
7067* 'IBCLR':         IBCLR,     Clear bit
7068* 'IBITS':         IBITS,     Bit extraction
7069* 'IBSET':         IBSET,     Set bit
7070* 'ICHAR':         ICHAR,     Character-to-integer conversion function
7071* 'IDATE':         IDATE,     Current local time (day/month/year)
7072* 'IEOR':          IEOR,      Bitwise logical exclusive or
7073* 'IERRNO':        IERRNO,    Function to get the last system error number
7074* 'IMAGE_INDEX':   IMAGE_INDEX, Cosubscript to image index conversion
7075* 'INDEX':         INDEX intrinsic, Position of a substring within a string
7076* 'INT':           INT,       Convert to integer type
7077* 'INT2':          INT2,      Convert to 16-bit integer type
7078* 'INT8':          INT8,      Convert to 64-bit integer type
7079* 'IOR':           IOR,       Bitwise logical or
7080* 'IPARITY':       IPARITY,   Bitwise XOR of array elements
7081* 'IRAND':         IRAND,     Integer pseudo-random number
7082* 'IS_CONTIGUOUS':  IS_CONTIGUOUS, Test whether an array is contiguous
7083* 'IS_IOSTAT_END':  IS_IOSTAT_END, Test for end-of-file value
7084* 'IS_IOSTAT_EOR':  IS_IOSTAT_EOR, Test for end-of-record value
7085* 'ISATTY':        ISATTY,    Whether a unit is a terminal device
7086* 'ISHFT':         ISHFT,     Shift bits
7087* 'ISHFTC':        ISHFTC,    Shift bits circularly
7088* 'ISNAN':         ISNAN,     Tests for a NaN
7089* 'ITIME':         ITIME,     Current local time (hour/minutes/seconds)
7090* 'KILL':          KILL,      Send a signal to a process
7091* 'KIND':          KIND,      Kind of an entity
7092* 'LBOUND':        LBOUND,    Lower dimension bounds of an array
7093* 'LCOBOUND':      LCOBOUND,  Lower codimension bounds of an array
7094* 'LEADZ':         LEADZ,     Number of leading zero bits of an integer
7095* 'LEN':           LEN,       Length of a character entity
7096* 'LEN_TRIM':      LEN_TRIM,  Length of a character entity without trailing blank characters
7097* 'LGE':           LGE,       Lexical greater than or equal
7098* 'LGT':           LGT,       Lexical greater than
7099* 'LINK':          LINK,      Create a hard link
7100* 'LLE':           LLE,       Lexical less than or equal
7101* 'LLT':           LLT,       Lexical less than
7102* 'LNBLNK':        LNBLNK,    Index of the last non-blank character in a string
7103* 'LOC':           LOC,       Returns the address of a variable
7104* 'LOG':           LOG,       Logarithm function
7105* 'LOG10':         LOG10,     Base 10 logarithm function
7106* 'LOG_GAMMA':     LOG_GAMMA, Logarithm of the Gamma function
7107* 'LOGICAL':       LOGICAL,   Convert to logical type
7108* 'LONG':          LONG,      Convert to integer type
7109* 'LSHIFT':        LSHIFT,    Left shift bits
7110* 'LSTAT':         LSTAT,     Get file status
7111* 'LTIME':         LTIME,     Convert time to local time info
7112* 'MALLOC':        MALLOC,    Dynamic memory allocation function
7113* 'MASKL':         MASKL,     Left justified mask
7114* 'MASKR':         MASKR,     Right justified mask
7115* 'MATMUL':        MATMUL,    matrix multiplication
7116* 'MAX':           MAX,       Maximum value of an argument list
7117* 'MAXEXPONENT':   MAXEXPONENT, Maximum exponent of a real kind
7118* 'MAXLOC':        MAXLOC,    Location of the maximum value within an array
7119* 'MAXVAL':        MAXVAL,    Maximum value of an array
7120* 'MCLOCK':        MCLOCK,    Time function
7121* 'MCLOCK8':       MCLOCK8,   Time function (64-bit)
7122* 'MERGE':         MERGE,     Merge arrays
7123* 'MERGE_BITS':    MERGE_BITS, Merge of bits under mask
7124* 'MIN':           MIN,       Minimum value of an argument list
7125* 'MINEXPONENT':   MINEXPONENT, Minimum exponent of a real kind
7126* 'MINLOC':        MINLOC,    Location of the minimum value within an array
7127* 'MINVAL':        MINVAL,    Minimum value of an array
7128* 'MOD':           MOD,       Remainder function
7129* 'MODULO':        MODULO,    Modulo function
7130* 'MOVE_ALLOC':    MOVE_ALLOC, Move allocation from one object to another
7131* 'MVBITS':        MVBITS,    Move bits from one integer to another
7132* 'NEAREST':       NEAREST,   Nearest representable number
7133* 'NEW_LINE':      NEW_LINE,  New line character
7134* 'NINT':          NINT,      Nearest whole number
7135* 'NORM2':         NORM2,     Euclidean vector norm
7136* 'NOT':           NOT,       Logical negation
7137* 'NULL':          NULL,      Function that returns an disassociated pointer
7138* 'NUM_IMAGES':    NUM_IMAGES, Number of images
7139* 'OR':            OR,        Bitwise logical OR
7140* 'PACK':          PACK,      Pack an array into an array of rank one
7141* 'PARITY':        PARITY,    Reduction with exclusive OR
7142* 'PERROR':        PERROR,    Print system error message
7143* 'POPCNT':        POPCNT,    Number of bits set
7144* 'POPPAR':        POPPAR,    Parity of the number of bits set
7145* 'PRECISION':     PRECISION, Decimal precision of a real kind
7146* 'PRESENT':       PRESENT,   Determine whether an optional dummy argument is specified
7147* 'PRODUCT':       PRODUCT,   Product of array elements
7148* 'RADIX':         RADIX,     Base of a data model
7149* 'RAN':           RAN,       Real pseudo-random number
7150* 'RAND':          RAND,      Real pseudo-random number
7151* 'RANDOM_INIT':   RANDOM_INIT, Initialize pseudo-random number generator
7152* 'RANDOM_NUMBER': RANDOM_NUMBER, Pseudo-random number
7153* 'RANDOM_SEED':   RANDOM_SEED, Initialize a pseudo-random number sequence
7154* 'RANGE':         RANGE,     Decimal exponent range
7155* 'RANK' :         RANK,      Rank of a data object
7156* 'REAL':          REAL,      Convert to real type
7157* 'RENAME':        RENAME,    Rename a file
7158* 'REPEAT':        REPEAT,    Repeated string concatenation
7159* 'RESHAPE':       RESHAPE,   Function to reshape an array
7160* 'RRSPACING':     RRSPACING, Reciprocal of the relative spacing
7161* 'RSHIFT':        RSHIFT,    Right shift bits
7162* 'SAME_TYPE_AS':  SAME_TYPE_AS,  Query dynamic types for equality
7163* 'SCALE':         SCALE,     Scale a real value
7164* 'SCAN':          SCAN,      Scan a string for the presence of a set of characters
7165* 'SECNDS':        SECNDS,    Time function
7166* 'SECOND':        SECOND,    CPU time function
7167* 'SELECTED_CHAR_KIND': SELECTED_CHAR_KIND,  Choose character kind
7168* 'SELECTED_INT_KIND': SELECTED_INT_KIND,  Choose integer kind
7169* 'SELECTED_REAL_KIND': SELECTED_REAL_KIND,  Choose real kind
7170* 'SET_EXPONENT':  SET_EXPONENT, Set the exponent of the model
7171* 'SHAPE':         SHAPE,     Determine the shape of an array
7172* 'SHIFTA':        SHIFTA,    Right shift with fill
7173* 'SHIFTL':        SHIFTL,    Left shift
7174* 'SHIFTR':        SHIFTR,    Right shift
7175* 'SIGN':          SIGN,      Sign copying function
7176* 'SIGNAL':        SIGNAL,    Signal handling subroutine (or function)
7177* 'SIN':           SIN,       Sine function
7178* 'SIND':          SIND,      Sine function, degrees
7179* 'SINH':          SINH,      Hyperbolic sine function
7180* 'SIZE':          SIZE,      Function to determine the size of an array
7181* 'SIZEOF':        SIZEOF,    Determine the size in bytes of an expression
7182* 'SLEEP':         SLEEP,     Sleep for the specified number of seconds
7183* 'SPACING':       SPACING,   Smallest distance between two numbers of a given type
7184* 'SPREAD':        SPREAD,    Add a dimension to an array
7185* 'SQRT':          SQRT,      Square-root function
7186* 'SRAND':         SRAND,     Reinitialize the random number generator
7187* 'STAT':          STAT,      Get file status
7188* 'STORAGE_SIZE':  STORAGE_SIZE, Storage size in bits
7189* 'SUM':           SUM,       Sum of array elements
7190* 'SYMLNK':        SYMLNK,    Create a symbolic link
7191* 'SYSTEM':        SYSTEM,    Execute a shell command
7192* 'SYSTEM_CLOCK':  SYSTEM_CLOCK, Time function
7193* 'TAN':           TAN,       Tangent function
7194* 'TAND':          TAND,      Tangent function, degrees
7195* 'TANH':          TANH,      Hyperbolic tangent function
7196* 'THIS_IMAGE':    THIS_IMAGE, Cosubscript index of this image
7197* 'TIME':          TIME,      Time function
7198* 'TIME8':         TIME8,     Time function (64-bit)
7199* 'TINY':          TINY,      Smallest positive number of a real kind
7200* 'TRAILZ':        TRAILZ,    Number of trailing zero bits of an integer
7201* 'TRANSFER':      TRANSFER,  Transfer bit patterns
7202* 'TRANSPOSE':     TRANSPOSE, Transpose an array of rank two
7203* 'TRIM':          TRIM,      Remove trailing blank characters of a string
7204* 'TTYNAM':        TTYNAM,    Get the name of a terminal device.
7205* 'UBOUND':        UBOUND,    Upper dimension bounds of an array
7206* 'UCOBOUND':      UCOBOUND,  Upper codimension bounds of an array
7207* 'UMASK':         UMASK,     Set the file creation mask
7208* 'UNLINK':        UNLINK,    Remove a file from the file system
7209* 'UNPACK':        UNPACK,    Unpack an array of rank one into an array
7210* 'VERIFY':        VERIFY,    Scan a string for the absence of a set of characters
7211* 'XOR':           XOR,       Bitwise logical exclusive or
7212
7213
7214File: gfortran.info,  Node: Introduction to Intrinsics,  Next: ABORT,  Up: Intrinsic Procedures
7215
72169.1 Introduction to intrinsic procedures
7217========================================
7218
7219The intrinsic procedures provided by GNU Fortran include all of the
7220intrinsic procedures required by the Fortran 95 standard, a set of
7221intrinsic procedures for backwards compatibility with G77, and a
7222selection of intrinsic procedures from the Fortran 2003 and Fortran 2008
7223standards.  Any conflict between a description here and a description in
7224either the Fortran 95 standard, the Fortran 2003 standard or the Fortran
72252008 standard is unintentional, and the standard(s) should be considered
7226authoritative.
7227
7228   The enumeration of the 'KIND' type parameter is processor defined in
7229the Fortran 95 standard.  GNU Fortran defines the default integer type
7230and default real type by 'INTEGER(KIND=4)' and 'REAL(KIND=4)',
7231respectively.  The standard mandates that both data types shall have
7232another kind, which have more precision.  On typical target
7233architectures supported by 'gfortran', this kind type parameter is
7234'KIND=8'.  Hence, 'REAL(KIND=8)' and 'DOUBLE PRECISION' are equivalent.
7235In the description of generic intrinsic procedures, the kind type
7236parameter will be specified by 'KIND=*', and in the description of
7237specific names for an intrinsic procedure the kind type parameter will
7238be explicitly given (e.g., 'REAL(KIND=4)' or 'REAL(KIND=8)').  Finally,
7239for brevity the optional 'KIND=' syntax will be omitted.
7240
7241   Many of the intrinsic procedures take one or more optional arguments.
7242This document follows the convention used in the Fortran 95 standard,
7243and denotes such arguments by square brackets.
7244
7245   GNU Fortran offers the '-std=f95' and '-std=gnu' options, which can
7246be used to restrict the set of intrinsic procedures to a given standard.
7247By default, 'gfortran' sets the '-std=gnu' option, and so all intrinsic
7248procedures described here are accepted.  There is one caveat.  For a
7249select group of intrinsic procedures, 'g77' implemented both a function
7250and a subroutine.  Both classes have been implemented in 'gfortran' for
7251backwards compatibility with 'g77'.  It is noted here that these
7252functions and subroutines cannot be intermixed in a given subprogram.
7253In the descriptions that follow, the applicable standard for each
7254intrinsic procedure is noted.
7255
7256
7257File: gfortran.info,  Node: ABORT,  Next: ABS,  Prev: Introduction to Intrinsics,  Up: Intrinsic Procedures
7258
72599.2 'ABORT' -- Abort the program
7260================================
7261
7262_Description_:
7263     'ABORT' causes immediate termination of the program.  On operating
7264     systems that support a core dump, 'ABORT' will produce a core dump.
7265     It will also print a backtrace, unless '-fno-backtrace' is given.
7266
7267_Standard_:
7268     GNU extension
7269
7270_Class_:
7271     Subroutine
7272
7273_Syntax_:
7274     'CALL ABORT'
7275
7276_Return value_:
7277     Does not return.
7278
7279_Example_:
7280          program test_abort
7281            integer :: i = 1, j = 2
7282            if (i /= j) call abort
7283          end program test_abort
7284
7285_See also_:
7286     *note EXIT::, *note KILL::, *note BACKTRACE::
7287
7288
7289File: gfortran.info,  Node: ABS,  Next: ACCESS,  Prev: ABORT,  Up: Intrinsic Procedures
7290
72919.3 'ABS' -- Absolute value
7292===========================
7293
7294_Description_:
7295     'ABS(A)' computes the absolute value of 'A'.
7296
7297_Standard_:
7298     Fortran 77 and later, has overloads that are GNU extensions
7299
7300_Class_:
7301     Elemental function
7302
7303_Syntax_:
7304     'RESULT = ABS(A)'
7305
7306_Arguments_:
7307     A           The type of the argument shall be an 'INTEGER',
7308                 'REAL', or 'COMPLEX'.
7309
7310_Return value_:
7311     The return value is of the same type and kind as the argument
7312     except the return value is 'REAL' for a 'COMPLEX' argument.
7313
7314_Example_:
7315          program test_abs
7316            integer :: i = -1
7317            real :: x = -1.e0
7318            complex :: z = (-1.e0,0.e0)
7319            i = abs(i)
7320            x = abs(x)
7321            x = abs(z)
7322          end program test_abs
7323
7324_Specific names_:
7325     Name           Argument       Return type    Standard
7326     'ABS(A)'       'REAL(4) A'    'REAL(4)'      Fortran 77 and
7327                                                  later
7328     'CABS(A)'      'COMPLEX(4)    'REAL(4)'      Fortran 77 and
7329                    A'                            later
7330     'DABS(A)'      'REAL(8) A'    'REAL(8)'      Fortran 77 and
7331                                                  later
7332     'IABS(A)'      'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
7333                    A'                            later
7334     'BABS(A)'      'INTEGER(1)    'INTEGER(1)'   GNU extension
7335                    A'
7336     'IIABS(A)'     'INTEGER(2)    'INTEGER(2)'   GNU extension
7337                    A'
7338     'JIABS(A)'     'INTEGER(4)    'INTEGER(4)'   GNU extension
7339                    A'
7340     'KIABS(A)'     'INTEGER(8)    'INTEGER(8)'   GNU extension
7341                    A'
7342     'ZABS(A)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
7343                    A'
7344     'CDABS(A)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
7345                    A'
7346
7347
7348File: gfortran.info,  Node: ACCESS,  Next: ACHAR,  Prev: ABS,  Up: Intrinsic Procedures
7349
73509.4 'ACCESS' -- Checks file access modes
7351========================================
7352
7353_Description_:
7354     'ACCESS(NAME, MODE)' checks whether the file NAME exists, is
7355     readable, writable or executable.  Except for the executable check,
7356     'ACCESS' can be replaced by Fortran 95's 'INQUIRE'.
7357
7358_Standard_:
7359     GNU extension
7360
7361_Class_:
7362     Inquiry function
7363
7364_Syntax_:
7365     'RESULT = ACCESS(NAME, MODE)'
7366
7367_Arguments_:
7368     NAME        Scalar 'CHARACTER' of default kind with the file
7369                 name.  Tailing blank are ignored unless the
7370                 character 'achar(0)' is present, then all
7371                 characters up to and excluding 'achar(0)' are
7372                 used as file name.
7373     MODE        Scalar 'CHARACTER' of default kind with the file
7374                 access mode, may be any concatenation of '"r"'
7375                 (readable), '"w"' (writable) and '"x"'
7376                 (executable), or '" "' to check for existence.
7377
7378_Return value_:
7379     Returns a scalar 'INTEGER', which is '0' if the file is accessible
7380     in the given mode; otherwise or if an invalid argument has been
7381     given for 'MODE' the value '1' is returned.
7382
7383_Example_:
7384          program access_test
7385            implicit none
7386            character(len=*), parameter :: file  = 'test.dat'
7387            character(len=*), parameter :: file2 = 'test.dat  '//achar(0)
7388            if(access(file,' ') == 0) print *, trim(file),' is exists'
7389            if(access(file,'r') == 0) print *, trim(file),' is readable'
7390            if(access(file,'w') == 0) print *, trim(file),' is writable'
7391            if(access(file,'x') == 0) print *, trim(file),' is executable'
7392            if(access(file2,'rwx') == 0) &
7393              print *, trim(file2),' is readable, writable and executable'
7394          end program access_test
7395_Specific names_:
7396_See also_:
7397
7398
7399File: gfortran.info,  Node: ACHAR,  Next: ACOS,  Prev: ACCESS,  Up: Intrinsic Procedures
7400
74019.5 'ACHAR' -- Character in ASCII collating sequence
7402====================================================
7403
7404_Description_:
7405     'ACHAR(I)' returns the character located at position 'I' in the
7406     ASCII collating sequence.
7407
7408_Standard_:
7409     Fortran 77 and later, with KIND argument Fortran 2003 and later
7410
7411_Class_:
7412     Elemental function
7413
7414_Syntax_:
7415     'RESULT = ACHAR(I [, KIND])'
7416
7417_Arguments_:
7418     I           The type shall be 'INTEGER'.
7419     KIND        (Optional) An 'INTEGER' initialization
7420                 expression indicating the kind parameter of the
7421                 result.
7422
7423_Return value_:
7424     The return value is of type 'CHARACTER' with a length of one.  If
7425     the KIND argument is present, the return value is of the specified
7426     kind and of the default kind otherwise.
7427
7428_Example_:
7429          program test_achar
7430            character c
7431            c = achar(32)
7432          end program test_achar
7433
7434_Note_:
7435     See *note ICHAR:: for a discussion of converting between numerical
7436     values and formatted string representations.
7437
7438_See also_:
7439     *note CHAR::, *note IACHAR::, *note ICHAR::
7440
7441
7442File: gfortran.info,  Node: ACOS,  Next: ACOSD,  Prev: ACHAR,  Up: Intrinsic Procedures
7443
74449.6 'ACOS' -- Arccosine function
7445================================
7446
7447_Description_:
7448     'ACOS(X)' computes the arccosine of X (inverse of 'COS(X)').
7449
7450_Standard_:
7451     Fortran 77 and later, for a complex argument Fortran 2008 or later
7452
7453_Class_:
7454     Elemental function
7455
7456_Syntax_:
7457     'RESULT = ACOS(X)'
7458
7459_Arguments_:
7460     X           The type shall either be 'REAL' with a magnitude
7461                 that is less than or equal to one - or the type
7462                 shall be 'COMPLEX'.
7463
7464_Return value_:
7465     The return value is of the same type and kind as X.  The real part
7466     of the result is in radians and lies in the range 0 \leq \Re
7467     \acos(x) \leq \pi.
7468
7469_Example_:
7470          program test_acos
7471            real(8) :: x = 0.866_8
7472            x = acos(x)
7473          end program test_acos
7474
7475_Specific names_:
7476     Name           Argument       Return type    Standard
7477     'ACOS(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
7478                                                  later
7479     'DACOS(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
7480                                                  later
7481
7482_See also_:
7483     Inverse function: *note COS:: Degrees function: *note ACOSD::
7484
7485
7486File: gfortran.info,  Node: ACOSD,  Next: ACOSH,  Prev: ACOS,  Up: Intrinsic Procedures
7487
74889.7 'ACOSD' -- Arccosine function, degrees
7489==========================================
7490
7491_Description_:
7492     'ACOSD(X)' computes the arccosine of X in degrees (inverse of
7493     'COSD(X)').
7494
7495     This function is for compatibility only and should be avoided in
7496     favor of standard constructs wherever possible.
7497
7498_Standard_:
7499     GNU Extension, enabled with '-fdec-math'
7500
7501_Class_:
7502     Elemental function
7503
7504_Syntax_:
7505     'RESULT = ACOSD(X)'
7506
7507_Arguments_:
7508     X           The type shall either be 'REAL' with a magnitude
7509                 that is less than or equal to one - or the type
7510                 shall be 'COMPLEX'.
7511
7512_Return value_:
7513     The return value is of the same type and kind as X.  The real part
7514     of the result is in degrees and lies in the range 0 \leq \Re
7515     \acos(x) \leq 180.
7516
7517_Example_:
7518          program test_acosd
7519            real(8) :: x = 0.866_8
7520            x = acosd(x)
7521          end program test_acosd
7522
7523_Specific names_:
7524     Name           Argument       Return type    Standard
7525     'ACOSD(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
7526     'DACOSD(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
7527
7528_See also_:
7529     Inverse function: *note COSD:: Radians function: *note ACOS::
7530
7531
7532File: gfortran.info,  Node: ACOSH,  Next: ADJUSTL,  Prev: ACOSD,  Up: Intrinsic Procedures
7533
75349.8 'ACOSH' -- Inverse hyperbolic cosine function
7535=================================================
7536
7537_Description_:
7538     'ACOSH(X)' computes the inverse hyperbolic cosine of X.
7539
7540_Standard_:
7541     Fortran 2008 and later
7542
7543_Class_:
7544     Elemental function
7545
7546_Syntax_:
7547     'RESULT = ACOSH(X)'
7548
7549_Arguments_:
7550     X           The type shall be 'REAL' or 'COMPLEX'.
7551
7552_Return value_:
7553     The return value has the same type and kind as X.  If X is complex,
7554     the imaginary part of the result is in radians and lies between 0
7555     \leq \Im \acosh(x) \leq \pi.
7556
7557_Example_:
7558          PROGRAM test_acosh
7559            REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /)
7560            WRITE (*,*) ACOSH(x)
7561          END PROGRAM
7562
7563_Specific names_:
7564     Name           Argument       Return type    Standard
7565     'DACOSH(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
7566
7567_See also_:
7568     Inverse function: *note COSH::
7569
7570
7571File: gfortran.info,  Node: ADJUSTL,  Next: ADJUSTR,  Prev: ACOSH,  Up: Intrinsic Procedures
7572
75739.9 'ADJUSTL' -- Left adjust a string
7574=====================================
7575
7576_Description_:
7577     'ADJUSTL(STRING)' will left adjust a string by removing leading
7578     spaces.  Spaces are inserted at the end of the string as needed.
7579
7580_Standard_:
7581     Fortran 90 and later
7582
7583_Class_:
7584     Elemental function
7585
7586_Syntax_:
7587     'RESULT = ADJUSTL(STRING)'
7588
7589_Arguments_:
7590     STRING      The type shall be 'CHARACTER'.
7591
7592_Return value_:
7593     The return value is of type 'CHARACTER' and of the same kind as
7594     STRING where leading spaces are removed and the same number of
7595     spaces are inserted on the end of STRING.
7596
7597_Example_:
7598          program test_adjustl
7599            character(len=20) :: str = '   gfortran'
7600            str = adjustl(str)
7601            print *, str
7602          end program test_adjustl
7603
7604_See also_:
7605     *note ADJUSTR::, *note TRIM::
7606
7607
7608File: gfortran.info,  Node: ADJUSTR,  Next: AIMAG,  Prev: ADJUSTL,  Up: Intrinsic Procedures
7609
76109.10 'ADJUSTR' -- Right adjust a string
7611=======================================
7612
7613_Description_:
7614     'ADJUSTR(STRING)' will right adjust a string by removing trailing
7615     spaces.  Spaces are inserted at the start of the string as needed.
7616
7617_Standard_:
7618     Fortran 95 and later
7619
7620_Class_:
7621     Elemental function
7622
7623_Syntax_:
7624     'RESULT = ADJUSTR(STRING)'
7625
7626_Arguments_:
7627     STR         The type shall be 'CHARACTER'.
7628
7629_Return value_:
7630     The return value is of type 'CHARACTER' and of the same kind as
7631     STRING where trailing spaces are removed and the same number of
7632     spaces are inserted at the start of STRING.
7633
7634_Example_:
7635          program test_adjustr
7636            character(len=20) :: str = 'gfortran'
7637            str = adjustr(str)
7638            print *, str
7639          end program test_adjustr
7640
7641_See also_:
7642     *note ADJUSTL::, *note TRIM::
7643
7644
7645File: gfortran.info,  Node: AIMAG,  Next: AINT,  Prev: ADJUSTR,  Up: Intrinsic Procedures
7646
76479.11 'AIMAG' -- Imaginary part of complex number
7648================================================
7649
7650_Description_:
7651     'AIMAG(Z)' yields the imaginary part of complex argument 'Z'.  The
7652     'IMAG(Z)' and 'IMAGPART(Z)' intrinsic functions are provided for
7653     compatibility with 'g77', and their use in new code is strongly
7654     discouraged.
7655
7656_Standard_:
7657     Fortran 77 and later, has overloads that are GNU extensions
7658
7659_Class_:
7660     Elemental function
7661
7662_Syntax_:
7663     'RESULT = AIMAG(Z)'
7664
7665_Arguments_:
7666     Z           The type of the argument shall be 'COMPLEX'.
7667
7668_Return value_:
7669     The return value is of type 'REAL' with the kind type parameter of
7670     the argument.
7671
7672_Example_:
7673          program test_aimag
7674            complex(4) z4
7675            complex(8) z8
7676            z4 = cmplx(1.e0_4, 0.e0_4)
7677            z8 = cmplx(0.e0_8, 1.e0_8)
7678            print *, aimag(z4), dimag(z8)
7679          end program test_aimag
7680
7681_Specific names_:
7682     Name           Argument       Return type    Standard
7683     'AIMAG(Z)'     'COMPLEX Z'    'REAL'         GNU extension
7684     'DIMAG(Z)'     'COMPLEX(8)    'REAL(8)'      GNU extension
7685                    Z'
7686     'IMAG(Z)'      'COMPLEX Z'    'REAL'         GNU extension
7687     'IMAGPART(Z)'  'COMPLEX Z'    'REAL'         GNU extension
7688
7689
7690File: gfortran.info,  Node: AINT,  Next: ALARM,  Prev: AIMAG,  Up: Intrinsic Procedures
7691
76929.12 'AINT' -- Truncate to a whole number
7693=========================================
7694
7695_Description_:
7696     'AINT(A [, KIND])' truncates its argument to a whole number.
7697
7698_Standard_:
7699     Fortran 77 and later
7700
7701_Class_:
7702     Elemental function
7703
7704_Syntax_:
7705     'RESULT = AINT(A [, KIND])'
7706
7707_Arguments_:
7708     A           The type of the argument shall be 'REAL'.
7709     KIND        (Optional) An 'INTEGER' initialization
7710                 expression indicating the kind parameter of the
7711                 result.
7712
7713_Return value_:
7714     The return value is of type 'REAL' with the kind type parameter of
7715     the argument if the optional KIND is absent; otherwise, the kind
7716     type parameter will be given by KIND.  If the magnitude of X is
7717     less than one, 'AINT(X)' returns zero.  If the magnitude is equal
7718     to or greater than one then it returns the largest whole number
7719     that does not exceed its magnitude.  The sign is the same as the
7720     sign of X.
7721
7722_Example_:
7723          program test_aint
7724            real(4) x4
7725            real(8) x8
7726            x4 = 1.234E0_4
7727            x8 = 4.321_8
7728            print *, aint(x4), dint(x8)
7729            x8 = aint(x4,8)
7730          end program test_aint
7731
7732_Specific names_:
7733     Name           Argument       Return type    Standard
7734     'AINT(A)'      'REAL(4) A'    'REAL(4)'      Fortran 77 and
7735                                                  later
7736     'DINT(A)'      'REAL(8) A'    'REAL(8)'      Fortran 77 and
7737                                                  later
7738
7739
7740File: gfortran.info,  Node: ALARM,  Next: ALL,  Prev: AINT,  Up: Intrinsic Procedures
7741
77429.13 'ALARM' -- Execute a routine after a given delay
7743=====================================================
7744
7745_Description_:
7746     'ALARM(SECONDS, HANDLER [, STATUS])' causes external subroutine
7747     HANDLER to be executed after a delay of SECONDS by using 'alarm(2)'
7748     to set up a signal and 'signal(2)' to catch it.  If STATUS is
7749     supplied, it will be returned with the number of seconds remaining
7750     until any previously scheduled alarm was due to be delivered, or
7751     zero if there was no previously scheduled alarm.
7752
7753_Standard_:
7754     GNU extension
7755
7756_Class_:
7757     Subroutine
7758
7759_Syntax_:
7760     'CALL ALARM(SECONDS, HANDLER [, STATUS])'
7761
7762_Arguments_:
7763     SECONDS     The type of the argument shall be a scalar
7764                 'INTEGER'.  It is 'INTENT(IN)'.
7765     HANDLER     Signal handler ('INTEGER FUNCTION' or
7766                 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
7767                 The scalar values may be either 'SIG_IGN=1' to
7768                 ignore the alarm generated or 'SIG_DFL=0' to set
7769                 the default action.  It is 'INTENT(IN)'.
7770     STATUS      (Optional) STATUS shall be a scalar variable of
7771                 the default 'INTEGER' kind.  It is
7772                 'INTENT(OUT)'.
7773
7774_Example_:
7775          program test_alarm
7776            external handler_print
7777            integer i
7778            call alarm (3, handler_print, i)
7779            print *, i
7780            call sleep(10)
7781          end program test_alarm
7782     This will cause the external routine HANDLER_PRINT to be called
7783     after 3 seconds.
7784
7785
7786File: gfortran.info,  Node: ALL,  Next: ALLOCATED,  Prev: ALARM,  Up: Intrinsic Procedures
7787
77889.14 'ALL' -- All values in MASK along DIM are true
7789===================================================
7790
7791_Description_:
7792     'ALL(MASK [, DIM])' determines if all the values are true in MASK
7793     in the array along dimension DIM.
7794
7795_Standard_:
7796     Fortran 95 and later
7797
7798_Class_:
7799     Transformational function
7800
7801_Syntax_:
7802     'RESULT = ALL(MASK [, DIM])'
7803
7804_Arguments_:
7805     MASK        The type of the argument shall be 'LOGICAL' and
7806                 it shall not be scalar.
7807     DIM         (Optional) DIM shall be a scalar integer with a
7808                 value that lies between one and the rank of
7809                 MASK.
7810
7811_Return value_:
7812     'ALL(MASK)' returns a scalar value of type 'LOGICAL' where the kind
7813     type parameter is the same as the kind type parameter of MASK.  If
7814     DIM is present, then 'ALL(MASK, DIM)' returns an array with the
7815     rank of MASK minus 1.  The shape is determined from the shape of
7816     MASK where the DIM dimension is elided.
7817
7818     (A)
7819          'ALL(MASK)' is true if all elements of MASK are true.  It also
7820          is true if MASK has zero size; otherwise, it is false.
7821     (B)
7822          If the rank of MASK is one, then 'ALL(MASK,DIM)' is equivalent
7823          to 'ALL(MASK)'.  If the rank is greater than one, then
7824          'ALL(MASK,DIM)' is determined by applying 'ALL' to the array
7825          sections.
7826
7827_Example_:
7828          program test_all
7829            logical l
7830            l = all((/.true., .true., .true./))
7831            print *, l
7832            call section
7833            contains
7834              subroutine section
7835                integer a(2,3), b(2,3)
7836                a = 1
7837                b = 1
7838                b(2,2) = 2
7839                print *, all(a .eq. b, 1)
7840                print *, all(a .eq. b, 2)
7841              end subroutine section
7842          end program test_all
7843
7844
7845File: gfortran.info,  Node: ALLOCATED,  Next: AND,  Prev: ALL,  Up: Intrinsic Procedures
7846
78479.15 'ALLOCATED' -- Status of an allocatable entity
7848===================================================
7849
7850_Description_:
7851     'ALLOCATED(ARRAY)' and 'ALLOCATED(SCALAR)' check the allocation
7852     status of ARRAY and SCALAR, respectively.
7853
7854_Standard_:
7855     Fortran 95 and later.  Note, the 'SCALAR=' keyword and allocatable
7856     scalar entities are available in Fortran 2003 and later.
7857
7858_Class_:
7859     Inquiry function
7860
7861_Syntax_:
7862     'RESULT = ALLOCATED(ARRAY)'
7863     'RESULT = ALLOCATED(SCALAR)'
7864
7865_Arguments_:
7866     ARRAY       The argument shall be an 'ALLOCATABLE' array.
7867     SCALAR      The argument shall be an 'ALLOCATABLE' scalar.
7868
7869_Return value_:
7870     The return value is a scalar 'LOGICAL' with the default logical
7871     kind type parameter.  If the argument is allocated, then the result
7872     is '.TRUE.'; otherwise, it returns '.FALSE.'
7873
7874_Example_:
7875          program test_allocated
7876            integer :: i = 4
7877            real(4), allocatable :: x(:)
7878            if (.not. allocated(x)) allocate(x(i))
7879          end program test_allocated
7880
7881
7882File: gfortran.info,  Node: AND,  Next: ANINT,  Prev: ALLOCATED,  Up: Intrinsic Procedures
7883
78849.16 'AND' -- Bitwise logical AND
7885=================================
7886
7887_Description_:
7888     Bitwise logical 'AND'.
7889
7890     This intrinsic routine is provided for backwards compatibility with
7891     GNU Fortran 77.  For integer arguments, programmers should consider
7892     the use of the *note IAND:: intrinsic defined by the Fortran
7893     standard.
7894
7895_Standard_:
7896     GNU extension
7897
7898_Class_:
7899     Function
7900
7901_Syntax_:
7902     'RESULT = AND(I, J)'
7903
7904_Arguments_:
7905     I           The type shall be either a scalar 'INTEGER' type
7906                 or a scalar 'LOGICAL' type or a
7907                 boz-literal-constant.
7908     J           The type shall be the same as the type of I or a
7909                 boz-literal-constant.  I and J shall not both be
7910                 boz-literal-constants.  If either I or J is a
7911                 boz-literal-constant, then the other argument
7912                 must be a scalar 'INTEGER'.
7913
7914_Return value_:
7915     The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
7916     If the kind type parameters differ, then the smaller kind type is
7917     implicitly converted to larger kind, and the return has the larger
7918     kind.  A boz-literal-constant is converted to an 'INTEGER' with the
7919     kind type parameter of the other argument as-if a call to *note
7920     INT:: occurred.
7921
7922_Example_:
7923          PROGRAM test_and
7924            LOGICAL :: T = .TRUE., F = .FALSE.
7925            INTEGER :: a, b
7926            DATA a / Z'F' /, b / Z'3' /
7927
7928            WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
7929            WRITE (*,*) AND(a, b)
7930          END PROGRAM
7931
7932_See also_:
7933     Fortran 95 elemental function: *note IAND::
7934
7935
7936File: gfortran.info,  Node: ANINT,  Next: ANY,  Prev: AND,  Up: Intrinsic Procedures
7937
79389.17 'ANINT' -- Nearest whole number
7939====================================
7940
7941_Description_:
7942     'ANINT(A [, KIND])' rounds its argument to the nearest whole
7943     number.
7944
7945_Standard_:
7946     Fortran 77 and later
7947
7948_Class_:
7949     Elemental function
7950
7951_Syntax_:
7952     'RESULT = ANINT(A [, KIND])'
7953
7954_Arguments_:
7955     A           The type of the argument shall be 'REAL'.
7956     KIND        (Optional) An 'INTEGER' initialization
7957                 expression indicating the kind parameter of the
7958                 result.
7959
7960_Return value_:
7961     The return value is of type real with the kind type parameter of
7962     the argument if the optional KIND is absent; otherwise, the kind
7963     type parameter will be given by KIND.  If A is greater than zero,
7964     'ANINT(A)' returns 'AINT(X+0.5)'.  If A is less than or equal to
7965     zero then it returns 'AINT(X-0.5)'.
7966
7967_Example_:
7968          program test_anint
7969            real(4) x4
7970            real(8) x8
7971            x4 = 1.234E0_4
7972            x8 = 4.321_8
7973            print *, anint(x4), dnint(x8)
7974            x8 = anint(x4,8)
7975          end program test_anint
7976
7977_Specific names_:
7978     Name           Argument       Return type    Standard
7979     'AINT(A)'      'REAL(4) A'    'REAL(4)'      Fortran 77 and
7980                                                  later
7981     'DNINT(A)'     'REAL(8) A'    'REAL(8)'      Fortran 77 and
7982                                                  later
7983
7984
7985File: gfortran.info,  Node: ANY,  Next: ASIN,  Prev: ANINT,  Up: Intrinsic Procedures
7986
79879.18 'ANY' -- Any value in MASK along DIM is true
7988=================================================
7989
7990_Description_:
7991     'ANY(MASK [, DIM])' determines if any of the values in the logical
7992     array MASK along dimension DIM are '.TRUE.'.
7993
7994_Standard_:
7995     Fortran 95 and later
7996
7997_Class_:
7998     Transformational function
7999
8000_Syntax_:
8001     'RESULT = ANY(MASK [, DIM])'
8002
8003_Arguments_:
8004     MASK        The type of the argument shall be 'LOGICAL' and
8005                 it shall not be scalar.
8006     DIM         (Optional) DIM shall be a scalar integer with a
8007                 value that lies between one and the rank of
8008                 MASK.
8009
8010_Return value_:
8011     'ANY(MASK)' returns a scalar value of type 'LOGICAL' where the kind
8012     type parameter is the same as the kind type parameter of MASK.  If
8013     DIM is present, then 'ANY(MASK, DIM)' returns an array with the
8014     rank of MASK minus 1.  The shape is determined from the shape of
8015     MASK where the DIM dimension is elided.
8016
8017     (A)
8018          'ANY(MASK)' is true if any element of MASK is true; otherwise,
8019          it is false.  It also is false if MASK has zero size.
8020     (B)
8021          If the rank of MASK is one, then 'ANY(MASK,DIM)' is equivalent
8022          to 'ANY(MASK)'.  If the rank is greater than one, then
8023          'ANY(MASK,DIM)' is determined by applying 'ANY' to the array
8024          sections.
8025
8026_Example_:
8027          program test_any
8028            logical l
8029            l = any((/.true., .true., .true./))
8030            print *, l
8031            call section
8032            contains
8033              subroutine section
8034                integer a(2,3), b(2,3)
8035                a = 1
8036                b = 1
8037                b(2,2) = 2
8038                print *, any(a .eq. b, 1)
8039                print *, any(a .eq. b, 2)
8040              end subroutine section
8041          end program test_any
8042
8043
8044File: gfortran.info,  Node: ASIN,  Next: ASIND,  Prev: ANY,  Up: Intrinsic Procedures
8045
80469.19 'ASIN' -- Arcsine function
8047===============================
8048
8049_Description_:
8050     'ASIN(X)' computes the arcsine of its X (inverse of 'SIN(X)').
8051
8052_Standard_:
8053     Fortran 77 and later, for a complex argument Fortran 2008 or later
8054
8055_Class_:
8056     Elemental function
8057
8058_Syntax_:
8059     'RESULT = ASIN(X)'
8060
8061_Arguments_:
8062     X           The type shall be either 'REAL' and a magnitude
8063                 that is less than or equal to one - or be
8064                 'COMPLEX'.
8065
8066_Return value_:
8067     The return value is of the same type and kind as X.  The real part
8068     of the result is in radians and lies in the range -\pi/2 \leq \Re
8069     \asin(x) \leq \pi/2.
8070
8071_Example_:
8072          program test_asin
8073            real(8) :: x = 0.866_8
8074            x = asin(x)
8075          end program test_asin
8076
8077_Specific names_:
8078     Name           Argument       Return type    Standard
8079     'ASIN(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
8080                                                  later
8081     'DASIN(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
8082                                                  later
8083
8084_See also_:
8085     Inverse function: *note SIN:: Degrees function: *note ASIND::
8086
8087
8088File: gfortran.info,  Node: ASIND,  Next: ASINH,  Prev: ASIN,  Up: Intrinsic Procedures
8089
80909.20 'ASIND' -- Arcsine function, degrees
8091=========================================
8092
8093_Description_:
8094     'ASIND(X)' computes the arcsine of its X in degrees (inverse of
8095     'SIND(X)').
8096
8097     This function is for compatibility only and should be avoided in
8098     favor of standard constructs wherever possible.
8099
8100_Standard_:
8101     GNU Extension, enabled with '-fdec-math'.
8102
8103_Class_:
8104     Elemental function
8105
8106_Syntax_:
8107     'RESULT = ASIND(X)'
8108
8109_Arguments_:
8110     X           The type shall be either 'REAL' and a magnitude
8111                 that is less than or equal to one - or be
8112                 'COMPLEX'.
8113
8114_Return value_:
8115     The return value is of the same type and kind as X.  The real part
8116     of the result is in degrees and lies in the range -90 \leq \Re
8117     \asin(x) \leq 90.
8118
8119_Example_:
8120          program test_asind
8121            real(8) :: x = 0.866_8
8122            x = asind(x)
8123          end program test_asind
8124
8125_Specific names_:
8126     Name           Argument       Return type    Standard
8127     'ASIND(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
8128     'DASIND(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
8129
8130_See also_:
8131     Inverse function: *note SIND:: Radians function: *note ASIN::
8132
8133
8134File: gfortran.info,  Node: ASINH,  Next: ASSOCIATED,  Prev: ASIND,  Up: Intrinsic Procedures
8135
81369.21 'ASINH' -- Inverse hyperbolic sine function
8137================================================
8138
8139_Description_:
8140     'ASINH(X)' computes the inverse hyperbolic sine of X.
8141
8142_Standard_:
8143     Fortran 2008 and later
8144
8145_Class_:
8146     Elemental function
8147
8148_Syntax_:
8149     'RESULT = ASINH(X)'
8150
8151_Arguments_:
8152     X           The type shall be 'REAL' or 'COMPLEX'.
8153
8154_Return value_:
8155     The return value is of the same type and kind as X.  If X is
8156     complex, the imaginary part of the result is in radians and lies
8157     between -\pi/2 \leq \Im \asinh(x) \leq \pi/2.
8158
8159_Example_:
8160          PROGRAM test_asinh
8161            REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
8162            WRITE (*,*) ASINH(x)
8163          END PROGRAM
8164
8165_Specific names_:
8166     Name           Argument       Return type    Standard
8167     'DASINH(X)'    'REAL(8) X'    'REAL(8)'      GNU extension.
8168
8169_See also_:
8170     Inverse function: *note SINH::
8171
8172
8173File: gfortran.info,  Node: ASSOCIATED,  Next: ATAN,  Prev: ASINH,  Up: Intrinsic Procedures
8174
81759.22 'ASSOCIATED' -- Status of a pointer or pointer/target pair
8176===============================================================
8177
8178_Description_:
8179     'ASSOCIATED(POINTER [, TARGET])' determines the status of the
8180     pointer POINTER or if POINTER is associated with the target TARGET.
8181
8182_Standard_:
8183     Fortran 95 and later
8184
8185_Class_:
8186     Inquiry function
8187
8188_Syntax_:
8189     'RESULT = ASSOCIATED(POINTER [, TARGET])'
8190
8191_Arguments_:
8192     POINTER     POINTER shall have the 'POINTER' attribute and
8193                 it can be of any type.
8194     TARGET      (Optional) TARGET shall be a pointer or a
8195                 target.  It must have the same type, kind type
8196                 parameter, and array rank as POINTER.
8197     The association status of neither POINTER nor TARGET shall be
8198     undefined.
8199
8200_Return value_:
8201     'ASSOCIATED(POINTER)' returns a scalar value of type 'LOGICAL(4)'.
8202     There are several cases:
8203     (A) When the optional TARGET is not present then
8204          'ASSOCIATED(POINTER)' is true if POINTER is associated with a
8205          target; otherwise, it returns false.
8206     (B) If TARGET is present and a scalar target, the result is true if
8207          TARGET is not a zero-sized storage sequence and the target
8208          associated with POINTER occupies the same storage units.  If
8209          POINTER is disassociated, the result is false.
8210     (C) If TARGET is present and an array target, the result is true if
8211          TARGET and POINTER have the same shape, are not zero-sized
8212          arrays, are arrays whose elements are not zero-sized storage
8213          sequences, and TARGET and POINTER occupy the same storage
8214          units in array element order.  As in case(B), the result is
8215          false, if POINTER is disassociated.
8216     (D) If TARGET is present and an scalar pointer, the result is true
8217          if TARGET is associated with POINTER, the target associated
8218          with TARGET are not zero-sized storage sequences and occupy
8219          the same storage units.  The result is false, if either TARGET
8220          or POINTER is disassociated.
8221     (E) If TARGET is present and an array pointer, the result is true if
8222          target associated with POINTER and the target associated with
8223          TARGET have the same shape, are not zero-sized arrays, are
8224          arrays whose elements are not zero-sized storage sequences,
8225          and TARGET and POINTER occupy the same storage units in array
8226          element order.  The result is false, if either TARGET or
8227          POINTER is disassociated.
8228
8229_Example_:
8230          program test_associated
8231             implicit none
8232             real, target  :: tgt(2) = (/1., 2./)
8233             real, pointer :: ptr(:)
8234             ptr => tgt
8235             if (associated(ptr)     .eqv. .false.) call abort
8236             if (associated(ptr,tgt) .eqv. .false.) call abort
8237          end program test_associated
8238
8239_See also_:
8240     *note NULL::
8241
8242
8243File: gfortran.info,  Node: ATAN,  Next: ATAND,  Prev: ASSOCIATED,  Up: Intrinsic Procedures
8244
82459.23 'ATAN' -- Arctangent function
8246==================================
8247
8248_Description_:
8249     'ATAN(X)' computes the arctangent of X.
8250
8251_Standard_:
8252     Fortran 77 and later, for a complex argument and for two arguments
8253     Fortran 2008 or later
8254
8255_Class_:
8256     Elemental function
8257
8258_Syntax_:
8259     'RESULT = ATAN(X)'
8260     'RESULT = ATAN(Y, X)'
8261
8262_Arguments_:
8263     X           The type shall be 'REAL' or 'COMPLEX'; if Y is
8264                 present, X shall be REAL.
8265     Y shall
8266     be of the
8267     same type
8268     and kind
8269     as X.
8270
8271_Return value_:
8272     The return value is of the same type and kind as X.  If Y is
8273     present, the result is identical to 'ATAN2(Y,X)'.  Otherwise, it
8274     the arcus tangent of X, where the real part of the result is in
8275     radians and lies in the range -\pi/2 \leq \Re \atan(x) \leq \pi/2.
8276
8277_Example_:
8278          program test_atan
8279            real(8) :: x = 2.866_8
8280            x = atan(x)
8281          end program test_atan
8282
8283_Specific names_:
8284     Name           Argument       Return type    Standard
8285     'ATAN(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
8286                                                  later
8287     'DATAN(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
8288                                                  later
8289
8290_See also_:
8291     Inverse function: *note TAN:: Degrees function: *note ATAND::
8292
8293
8294File: gfortran.info,  Node: ATAND,  Next: ATAN2,  Prev: ATAN,  Up: Intrinsic Procedures
8295
82969.24 'ATAND' -- Arctangent function, degrees
8297============================================
8298
8299_Description_:
8300     'ATAND(X)' computes the arctangent of X in degrees (inverse of
8301     *note TAND::).
8302
8303     This function is for compatibility only and should be avoided in
8304     favor of standard constructs wherever possible.
8305
8306_Standard_:
8307     GNU Extension, enabled with '-fdec-math'.
8308
8309_Class_:
8310     Elemental function
8311
8312_Syntax_:
8313     'RESULT = ATAND(X)'
8314     'RESULT = ATAND(Y, X)'
8315
8316_Arguments_:
8317     X           The type shall be 'REAL' or 'COMPLEX'; if Y is
8318                 present, X shall be REAL.
8319     Y shall
8320     be of the
8321     same type
8322     and kind
8323     as X.
8324
8325_Return value_:
8326     The return value is of the same type and kind as X.  If Y is
8327     present, the result is identical to 'ATAND2(Y,X)'.  Otherwise, it
8328     is the arcus tangent of X, where the real part of the result is in
8329     degrees and lies in the range -90 \leq \Re \atand(x) \leq 90.
8330
8331_Example_:
8332          program test_atand
8333            real(8) :: x = 2.866_8
8334            x = atand(x)
8335          end program test_atand
8336
8337_Specific names_:
8338     Name           Argument       Return type    Standard
8339     'ATAND(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
8340     'DATAND(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
8341
8342_See also_:
8343     Inverse function: *note TAND:: Radians function: *note ATAN::
8344
8345
8346File: gfortran.info,  Node: ATAN2,  Next: ATAN2D,  Prev: ATAND,  Up: Intrinsic Procedures
8347
83489.25 'ATAN2' -- Arctangent function
8349===================================
8350
8351_Description_:
8352     'ATAN2(Y, X)' computes the principal value of the argument function
8353     of the complex number X + i Y. This function can be used to
8354     transform from Cartesian into polar coordinates and allows to
8355     determine the angle in the correct quadrant.
8356
8357_Standard_:
8358     Fortran 77 and later
8359
8360_Class_:
8361     Elemental function
8362
8363_Syntax_:
8364     'RESULT = ATAN2(Y, X)'
8365
8366_Arguments_:
8367     Y           The type shall be 'REAL'.
8368     X           The type and kind type parameter shall be the
8369                 same as Y.  If Y is zero, then X must be
8370                 nonzero.
8371
8372_Return value_:
8373     The return value has the same type and kind type parameter as Y.
8374     It is the principal value of the complex number X + i Y. If X is
8375     nonzero, then it lies in the range -\pi \le \atan (x) \leq \pi.
8376     The sign is positive if Y is positive.  If Y is zero, then the
8377     return value is zero if X is strictly positive, \pi if X is
8378     negative and Y is positive zero (or the processor does not handle
8379     signed zeros), and -\pi if X is negative and Y is negative zero.
8380     Finally, if X is zero, then the magnitude of the result is \pi/2.
8381
8382_Example_:
8383          program test_atan2
8384            real(4) :: x = 1.e0_4, y = 0.5e0_4
8385            x = atan2(y,x)
8386          end program test_atan2
8387
8388_Specific names_:
8389     Name           Argument       Return type    Standard
8390     'ATAN2(X,      'REAL(4) X,    'REAL(4)'      Fortran 77 and
8391     Y)'            Y'                            later
8392     'DATAN2(X,     'REAL(8) X,    'REAL(8)'      Fortran 77 and
8393     Y)'            Y'                            later
8394
8395_See also_:
8396     Alias: *note ATAN:: Degrees function: *note ATAN2D::
8397
8398
8399File: gfortran.info,  Node: ATAN2D,  Next: ATANH,  Prev: ATAN2,  Up: Intrinsic Procedures
8400
84019.26 'ATAN2D' -- Arctangent function, degrees
8402=============================================
8403
8404_Description_:
8405     'ATAN2D(Y, X)' computes the principal value of the argument
8406     function of the complex number X + i Y in degrees.  This function
8407     can be used to transform from Cartesian into polar coordinates and
8408     allows to determine the angle in the correct quadrant.
8409
8410     This function is for compatibility only and should be avoided in
8411     favor of standard constructs wherever possible.
8412
8413_Standard_:
8414     GNU Extension, enabled with '-fdec-math'.
8415
8416_Class_:
8417     Elemental function
8418
8419_Syntax_:
8420     'RESULT = ATAN2D(Y, X)'
8421
8422_Arguments_:
8423     Y           The type shall be 'REAL'.
8424     X           The type and kind type parameter shall be the
8425                 same as Y.  If Y is zero, then X must be
8426                 nonzero.
8427
8428_Return value_:
8429     The return value has the same type and kind type parameter as Y.
8430     It is the principal value of the complex number X + i Y. If X is
8431     nonzero, then it lies in the range -180 \le \atan (x) \leq 180.
8432     The sign is positive if Y is positive.  If Y is zero, then the
8433     return value is zero if X is strictly positive, 180 if X is
8434     negative and Y is positive zero (or the processor does not handle
8435     signed zeros), and -180 if X is negative and Y is negative zero.
8436     Finally, if X is zero, then the magnitude of the result is 90.
8437
8438_Example_:
8439          program test_atan2d
8440            real(4) :: x = 1.e0_4, y = 0.5e0_4
8441            x = atan2d(y,x)
8442          end program test_atan2d
8443
8444_Specific names_:
8445     Name           Argument       Return type    Standard
8446     'ATAN2D(X,     'REAL(4) X,    'REAL(4)'      GNU Extension
8447     Y)'            Y'
8448     'DATAN2D(X,    'REAL(8) X,    'REAL(8)'      GNU Extension
8449     Y)'            Y'
8450
8451_See also_:
8452     Alias: *note ATAND:: Radians function: *note ATAN2::
8453
8454
8455File: gfortran.info,  Node: ATANH,  Next: ATOMIC_ADD,  Prev: ATAN2D,  Up: Intrinsic Procedures
8456
84579.27 'ATANH' -- Inverse hyperbolic tangent function
8458===================================================
8459
8460_Description_:
8461     'ATANH(X)' computes the inverse hyperbolic tangent of X.
8462
8463_Standard_:
8464     Fortran 2008 and later
8465
8466_Class_:
8467     Elemental function
8468
8469_Syntax_:
8470     'RESULT = ATANH(X)'
8471
8472_Arguments_:
8473     X           The type shall be 'REAL' or 'COMPLEX'.
8474
8475_Return value_:
8476     The return value has same type and kind as X.  If X is complex, the
8477     imaginary part of the result is in radians and lies between -\pi/2
8478     \leq \Im \atanh(x) \leq \pi/2.
8479
8480_Example_:
8481          PROGRAM test_atanh
8482            REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
8483            WRITE (*,*) ATANH(x)
8484          END PROGRAM
8485
8486_Specific names_:
8487     Name           Argument       Return type    Standard
8488     'DATANH(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
8489
8490_See also_:
8491     Inverse function: *note TANH::
8492
8493
8494File: gfortran.info,  Node: ATOMIC_ADD,  Next: ATOMIC_AND,  Prev: ATANH,  Up: Intrinsic Procedures
8495
84969.28 'ATOMIC_ADD' -- Atomic ADD operation
8497=========================================
8498
8499_Description_:
8500     'ATOMIC_ADD(ATOM, VALUE)' atomically adds the value of VAR to the
8501     variable ATOM.  When STAT is present and the invocation was
8502     successful, it is assigned the value 0.  If it is present and the
8503     invocation has failed, it is assigned a positive value; in
8504     particular, for a coindexed ATOM, if the remote image has stopped,
8505     it is assigned the value of 'ISO_FORTRAN_ENV''s
8506     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8507     'STAT_FAILED_IMAGE'.
8508
8509_Standard_:
8510     TS 18508 or later
8511
8512_Class_:
8513     Atomic subroutine
8514
8515_Syntax_:
8516     'CALL ATOMIC_ADD (ATOM, VALUE [, STAT])'
8517
8518_Arguments_:
8519     ATOM        Scalar coarray or coindexed variable of integer
8520                 type with 'ATOMIC_INT_KIND' kind.
8521     VALUE       Scalar of the same type as ATOM.  If the kind is
8522                 different, the value is converted to the kind of
8523                 ATOM.
8524     STAT        (optional) Scalar default-kind integer variable.
8525
8526_Example_:
8527          program atomic
8528            use iso_fortran_env
8529            integer(atomic_int_kind) :: atom[*]
8530            call atomic_add (atom[1], this_image())
8531          end program atomic
8532
8533_See also_:
8534     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_ADD::, *note
8535     ISO_FORTRAN_ENV::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
8536     ATOMIC_XOR::
8537
8538
8539File: gfortran.info,  Node: ATOMIC_AND,  Next: ATOMIC_CAS,  Prev: ATOMIC_ADD,  Up: Intrinsic Procedures
8540
85419.29 'ATOMIC_AND' -- Atomic bitwise AND operation
8542=================================================
8543
8544_Description_:
8545     'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
8546     AND between the values of ATOM and VALUE.  When STAT is present and
8547     the invocation was successful, it is assigned the value 0.  If it
8548     is present and the invocation has failed, it is assigned a positive
8549     value; in particular, for a coindexed ATOM, if the remote image has
8550     stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
8551     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8552     'STAT_FAILED_IMAGE'.
8553
8554_Standard_:
8555     TS 18508 or later
8556
8557_Class_:
8558     Atomic subroutine
8559
8560_Syntax_:
8561     'CALL ATOMIC_AND (ATOM, VALUE [, STAT])'
8562
8563_Arguments_:
8564     ATOM        Scalar coarray or coindexed variable of integer
8565                 type with 'ATOMIC_INT_KIND' kind.
8566     VALUE       Scalar of the same type as ATOM.  If the kind is
8567                 different, the value is converted to the kind of
8568                 ATOM.
8569     STAT        (optional) Scalar default-kind integer variable.
8570
8571_Example_:
8572          program atomic
8573            use iso_fortran_env
8574            integer(atomic_int_kind) :: atom[*]
8575            call atomic_and (atom[1], int(b'10100011101'))
8576          end program atomic
8577
8578_See also_:
8579     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_AND::, *note
8580     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
8581     ATOMIC_XOR::
8582
8583
8584File: gfortran.info,  Node: ATOMIC_CAS,  Next: ATOMIC_DEFINE,  Prev: ATOMIC_AND,  Up: Intrinsic Procedures
8585
85869.30 'ATOMIC_CAS' -- Atomic compare and swap
8587============================================
8588
8589_Description_:
8590     'ATOMIC_CAS' compares the variable ATOM with the value of COMPARE;
8591     if the value is the same, ATOM is set to the value of NEW.
8592     Additionally, OLD is set to the value of ATOM that was used for the
8593     comparison.  When STAT is present and the invocation was
8594     successful, it is assigned the value 0.  If it is present and the
8595     invocation has failed, it is assigned a positive value; in
8596     particular, for a coindexed ATOM, if the remote image has stopped,
8597     it is assigned the value of 'ISO_FORTRAN_ENV''s
8598     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8599     'STAT_FAILED_IMAGE'.
8600
8601_Standard_:
8602     TS 18508 or later
8603
8604_Class_:
8605     Atomic subroutine
8606
8607_Syntax_:
8608     'CALL ATOMIC_CAS (ATOM, OLD, COMPARE, NEW [, STAT])'
8609
8610_Arguments_:
8611     ATOM        Scalar coarray or coindexed variable of either
8612                 integer type with 'ATOMIC_INT_KIND' kind or
8613                 logical type with 'ATOMIC_LOGICAL_KIND' kind.
8614     OLD         Scalar of the same type and kind as ATOM.
8615     COMPARE     Scalar variable of the same type and kind as
8616                 ATOM.
8617     NEW         Scalar variable of the same type as ATOM.  If
8618                 kind is different, the value is converted to the
8619                 kind of ATOM.
8620     STAT        (optional) Scalar default-kind integer variable.
8621
8622_Example_:
8623          program atomic
8624            use iso_fortran_env
8625            logical(atomic_logical_kind) :: atom[*], prev
8626            call atomic_cas (atom[1], prev, .false., .true.))
8627          end program atomic
8628
8629_See also_:
8630     *note ATOMIC_DEFINE::, *note ATOMIC_REF::, *note ISO_FORTRAN_ENV::
8631
8632
8633File: gfortran.info,  Node: ATOMIC_DEFINE,  Next: ATOMIC_FETCH_ADD,  Prev: ATOMIC_CAS,  Up: Intrinsic Procedures
8634
86359.31 'ATOMIC_DEFINE' -- Setting a variable atomically
8636=====================================================
8637
8638_Description_:
8639     'ATOMIC_DEFINE(ATOM, VALUE)' defines the variable ATOM with the
8640     value VALUE atomically.  When STAT is present and the invocation
8641     was successful, it is assigned the value 0.  If it is present and
8642     the invocation has failed, it is assigned a positive value; in
8643     particular, for a coindexed ATOM, if the remote image has stopped,
8644     it is assigned the value of 'ISO_FORTRAN_ENV''s
8645     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8646     'STAT_FAILED_IMAGE'.
8647
8648_Standard_:
8649     Fortran 2008 and later; with STAT, TS 18508 or later
8650
8651_Class_:
8652     Atomic subroutine
8653
8654_Syntax_:
8655     'CALL ATOMIC_DEFINE (ATOM, VALUE [, STAT])'
8656
8657_Arguments_:
8658     ATOM        Scalar coarray or coindexed variable of either
8659                 integer type with 'ATOMIC_INT_KIND' kind or
8660                 logical type with 'ATOMIC_LOGICAL_KIND' kind.
8661
8662     VALUE       Scalar of the same type as ATOM.  If the kind is
8663                 different, the value is converted to the kind of
8664                 ATOM.
8665     STAT        (optional) Scalar default-kind integer variable.
8666
8667_Example_:
8668          program atomic
8669            use iso_fortran_env
8670            integer(atomic_int_kind) :: atom[*]
8671            call atomic_define (atom[1], this_image())
8672          end program atomic
8673
8674_See also_:
8675     *note ATOMIC_REF::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
8676     *note ATOMIC_ADD::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note
8677     ATOMIC_XOR::
8678
8679
8680File: gfortran.info,  Node: ATOMIC_FETCH_ADD,  Next: ATOMIC_FETCH_AND,  Prev: ATOMIC_DEFINE,  Up: Intrinsic Procedures
8681
86829.32 'ATOMIC_FETCH_ADD' -- Atomic ADD operation with prior fetch
8683================================================================
8684
8685_Description_:
8686     'ATOMIC_FETCH_ADD(ATOM, VALUE, OLD)' atomically stores the value of
8687     ATOM in OLD and adds the value of VAR to the variable ATOM.  When
8688     STAT is present and the invocation was successful, it is assigned
8689     the value 0.  If it is present and the invocation has failed, it is
8690     assigned a positive value; in particular, for a coindexed ATOM, if
8691     the remote image has stopped, it is assigned the value of
8692     'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote image
8693     has failed, the value 'STAT_FAILED_IMAGE'.
8694
8695_Standard_:
8696     TS 18508 or later
8697
8698_Class_:
8699     Atomic subroutine
8700
8701_Syntax_:
8702     'CALL ATOMIC_FETCH_ADD (ATOM, VALUE, old [, STAT])'
8703
8704_Arguments_:
8705     ATOM        Scalar coarray or coindexed variable of integer
8706                 type with 'ATOMIC_INT_KIND' kind.
8707                 'ATOMIC_LOGICAL_KIND' kind.
8708
8709     VALUE       Scalar of the same type as ATOM.  If the kind is
8710                 different, the value is converted to the kind of
8711                 ATOM.
8712     OLD         Scalar of the same type and kind as ATOM.
8713     STAT        (optional) Scalar default-kind integer variable.
8714
8715_Example_:
8716          program atomic
8717            use iso_fortran_env
8718            integer(atomic_int_kind) :: atom[*], old
8719            call atomic_add (atom[1], this_image(), old)
8720          end program atomic
8721
8722_See also_:
8723     *note ATOMIC_DEFINE::, *note ATOMIC_ADD::, *note ISO_FORTRAN_ENV::,
8724     *note ATOMIC_FETCH_AND::, *note ATOMIC_FETCH_OR::, *note
8725     ATOMIC_FETCH_XOR::
8726
8727
8728File: gfortran.info,  Node: ATOMIC_FETCH_AND,  Next: ATOMIC_FETCH_OR,  Prev: ATOMIC_FETCH_ADD,  Up: Intrinsic Procedures
8729
87309.33 'ATOMIC_FETCH_AND' -- Atomic bitwise AND operation with prior fetch
8731========================================================================
8732
8733_Description_:
8734     'ATOMIC_AND(ATOM, VALUE)' atomically stores the value of ATOM in
8735     OLD and defines ATOM with the bitwise AND between the values of
8736     ATOM and VALUE.  When STAT is present and the invocation was
8737     successful, it is assigned the value 0.  If it is present and the
8738     invocation has failed, it is assigned a positive value; in
8739     particular, for a coindexed ATOM, if the remote image has stopped,
8740     it is assigned the value of 'ISO_FORTRAN_ENV''s
8741     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8742     'STAT_FAILED_IMAGE'.
8743
8744_Standard_:
8745     TS 18508 or later
8746
8747_Class_:
8748     Atomic subroutine
8749
8750_Syntax_:
8751     'CALL ATOMIC_FETCH_AND (ATOM, VALUE, OLD [, STAT])'
8752
8753_Arguments_:
8754     ATOM        Scalar coarray or coindexed variable of integer
8755                 type with 'ATOMIC_INT_KIND' kind.
8756     VALUE       Scalar of the same type as ATOM.  If the kind is
8757                 different, the value is converted to the kind of
8758                 ATOM.
8759     OLD         Scalar of the same type and kind as ATOM.
8760     STAT        (optional) Scalar default-kind integer variable.
8761
8762_Example_:
8763          program atomic
8764            use iso_fortran_env
8765            integer(atomic_int_kind) :: atom[*], old
8766            call atomic_fetch_and (atom[1], int(b'10100011101'), old)
8767          end program atomic
8768
8769_See also_:
8770     *note ATOMIC_DEFINE::, *note ATOMIC_AND::, *note ISO_FORTRAN_ENV::,
8771     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_OR::, *note
8772     ATOMIC_FETCH_XOR::
8773
8774
8775File: gfortran.info,  Node: ATOMIC_FETCH_OR,  Next: ATOMIC_FETCH_XOR,  Prev: ATOMIC_FETCH_AND,  Up: Intrinsic Procedures
8776
87779.34 'ATOMIC_FETCH_OR' -- Atomic bitwise OR operation with prior fetch
8778======================================================================
8779
8780_Description_:
8781     'ATOMIC_OR(ATOM, VALUE)' atomically stores the value of ATOM in OLD
8782     and defines ATOM with the bitwise OR between the values of ATOM and
8783     VALUE.  When STAT is present and the invocation was successful, it
8784     is assigned the value 0.  If it is present and the invocation has
8785     failed, it is assigned a positive value; in particular, for a
8786     coindexed ATOM, if the remote image has stopped, it is assigned the
8787     value of 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote
8788     image has failed, the value 'STAT_FAILED_IMAGE'.
8789
8790_Standard_:
8791     TS 18508 or later
8792
8793_Class_:
8794     Atomic subroutine
8795
8796_Syntax_:
8797     'CALL ATOMIC_FETCH_OR (ATOM, VALUE, OLD [, STAT])'
8798
8799_Arguments_:
8800     ATOM        Scalar coarray or coindexed variable of integer
8801                 type with 'ATOMIC_INT_KIND' kind.
8802     VALUE       Scalar of the same type as ATOM.  If the kind is
8803                 different, the value is converted to the kind of
8804                 ATOM.
8805     OLD         Scalar of the same type and kind as ATOM.
8806     STAT        (optional) Scalar default-kind integer variable.
8807
8808_Example_:
8809          program atomic
8810            use iso_fortran_env
8811            integer(atomic_int_kind) :: atom[*], old
8812            call atomic_fetch_or (atom[1], int(b'10100011101'), old)
8813          end program atomic
8814
8815_See also_:
8816     *note ATOMIC_DEFINE::, *note ATOMIC_OR::, *note ISO_FORTRAN_ENV::,
8817     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
8818     ATOMIC_FETCH_XOR::
8819
8820
8821File: gfortran.info,  Node: ATOMIC_FETCH_XOR,  Next: ATOMIC_OR,  Prev: ATOMIC_FETCH_OR,  Up: Intrinsic Procedures
8822
88239.35 'ATOMIC_FETCH_XOR' -- Atomic bitwise XOR operation with prior fetch
8824========================================================================
8825
8826_Description_:
8827     'ATOMIC_XOR(ATOM, VALUE)' atomically stores the value of ATOM in
8828     OLD and defines ATOM with the bitwise XOR between the values of
8829     ATOM and VALUE.  When STAT is present and the invocation was
8830     successful, it is assigned the value 0.  If it is present and the
8831     invocation has failed, it is assigned a positive value; in
8832     particular, for a coindexed ATOM, if the remote image has stopped,
8833     it is assigned the value of 'ISO_FORTRAN_ENV''s
8834     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8835     'STAT_FAILED_IMAGE'.
8836
8837_Standard_:
8838     TS 18508 or later
8839
8840_Class_:
8841     Atomic subroutine
8842
8843_Syntax_:
8844     'CALL ATOMIC_FETCH_XOR (ATOM, VALUE, OLD [, STAT])'
8845
8846_Arguments_:
8847     ATOM        Scalar coarray or coindexed variable of integer
8848                 type with 'ATOMIC_INT_KIND' kind.
8849     VALUE       Scalar of the same type as ATOM.  If the kind is
8850                 different, the value is converted to the kind of
8851                 ATOM.
8852     OLD         Scalar of the same type and kind as ATOM.
8853     STAT        (optional) Scalar default-kind integer variable.
8854
8855_Example_:
8856          program atomic
8857            use iso_fortran_env
8858            integer(atomic_int_kind) :: atom[*], old
8859            call atomic_fetch_xor (atom[1], int(b'10100011101'), old)
8860          end program atomic
8861
8862_See also_:
8863     *note ATOMIC_DEFINE::, *note ATOMIC_XOR::, *note ISO_FORTRAN_ENV::,
8864     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
8865     ATOMIC_FETCH_OR::
8866
8867
8868File: gfortran.info,  Node: ATOMIC_OR,  Next: ATOMIC_REF,  Prev: ATOMIC_FETCH_XOR,  Up: Intrinsic Procedures
8869
88709.36 'ATOMIC_OR' -- Atomic bitwise OR operation
8871===============================================
8872
8873_Description_:
8874     'ATOMIC_OR(ATOM, VALUE)' atomically defines ATOM with the bitwise
8875     AND between the values of ATOM and VALUE.  When STAT is present and
8876     the invocation was successful, it is assigned the value 0.  If it
8877     is present and the invocation has failed, it is assigned a positive
8878     value; in particular, for a coindexed ATOM, if the remote image has
8879     stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
8880     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8881     'STAT_FAILED_IMAGE'.
8882
8883_Standard_:
8884     TS 18508 or later
8885
8886_Class_:
8887     Atomic subroutine
8888
8889_Syntax_:
8890     'CALL ATOMIC_OR (ATOM, VALUE [, STAT])'
8891
8892_Arguments_:
8893     ATOM        Scalar coarray or coindexed variable of integer
8894                 type with 'ATOMIC_INT_KIND' kind.
8895     VALUE       Scalar of the same type as ATOM.  If the kind is
8896                 different, the value is converted to the kind of
8897                 ATOM.
8898     STAT        (optional) Scalar default-kind integer variable.
8899
8900_Example_:
8901          program atomic
8902            use iso_fortran_env
8903            integer(atomic_int_kind) :: atom[*]
8904            call atomic_or (atom[1], int(b'10100011101'))
8905          end program atomic
8906
8907_See also_:
8908     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_OR::, *note
8909     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
8910     ATOMIC_XOR::
8911
8912
8913File: gfortran.info,  Node: ATOMIC_REF,  Next: ATOMIC_XOR,  Prev: ATOMIC_OR,  Up: Intrinsic Procedures
8914
89159.37 'ATOMIC_REF' -- Obtaining the value of a variable atomically
8916=================================================================
8917
8918_Description_:
8919     'ATOMIC_DEFINE(ATOM, VALUE)' atomically assigns the value of the
8920     variable ATOM to VALUE.  When STAT is present and the invocation
8921     was successful, it is assigned the value 0.  If it is present and
8922     the invocation has failed, it is assigned a positive value; in
8923     particular, for a coindexed ATOM, if the remote image has stopped,
8924     it is assigned the value of 'ISO_FORTRAN_ENV''s
8925     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8926     'STAT_FAILED_IMAGE'.
8927
8928_Standard_:
8929     Fortran 2008 and later; with STAT, TS 18508 or later
8930
8931_Class_:
8932     Atomic subroutine
8933
8934_Syntax_:
8935     'CALL ATOMIC_REF(VALUE, ATOM [, STAT])'
8936
8937_Arguments_:
8938     VALUE       Scalar of the same type as ATOM.  If the kind is
8939                 different, the value is converted to the kind of
8940                 ATOM.
8941     ATOM        Scalar coarray or coindexed variable of either
8942                 integer type with 'ATOMIC_INT_KIND' kind or
8943                 logical type with 'ATOMIC_LOGICAL_KIND' kind.
8944     STAT        (optional) Scalar default-kind integer variable.
8945
8946_Example_:
8947          program atomic
8948            use iso_fortran_env
8949            logical(atomic_logical_kind) :: atom[*]
8950            logical :: val
8951            call atomic_ref (atom, .false.)
8952            ! ...
8953            call atomic_ref (atom, val)
8954            if (val) then
8955              print *, "Obtained"
8956            end if
8957          end program atomic
8958
8959_See also_:
8960     *note ATOMIC_DEFINE::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::,
8961     *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note
8962     ATOMIC_FETCH_OR::, *note ATOMIC_FETCH_XOR::
8963
8964
8965File: gfortran.info,  Node: ATOMIC_XOR,  Next: BACKTRACE,  Prev: ATOMIC_REF,  Up: Intrinsic Procedures
8966
89679.38 'ATOMIC_XOR' -- Atomic bitwise OR operation
8968================================================
8969
8970_Description_:
8971     'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise
8972     XOR between the values of ATOM and VALUE.  When STAT is present and
8973     the invocation was successful, it is assigned the value 0.  If it
8974     is present and the invocation has failed, it is assigned a positive
8975     value; in particular, for a coindexed ATOM, if the remote image has
8976     stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s
8977     'STAT_STOPPED_IMAGE' and if the remote image has failed, the value
8978     'STAT_FAILED_IMAGE'.
8979
8980_Standard_:
8981     TS 18508 or later
8982
8983_Class_:
8984     Atomic subroutine
8985
8986_Syntax_:
8987     'CALL ATOMIC_XOR (ATOM, VALUE [, STAT])'
8988
8989_Arguments_:
8990     ATOM        Scalar coarray or coindexed variable of integer
8991                 type with 'ATOMIC_INT_KIND' kind.
8992     VALUE       Scalar of the same type as ATOM.  If the kind is
8993                 different, the value is converted to the kind of
8994                 ATOM.
8995     STAT        (optional) Scalar default-kind integer variable.
8996
8997_Example_:
8998          program atomic
8999            use iso_fortran_env
9000            integer(atomic_int_kind) :: atom[*]
9001            call atomic_xor (atom[1], int(b'10100011101'))
9002          end program atomic
9003
9004_See also_:
9005     *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_XOR::, *note
9006     ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note
9007     ATOMIC_XOR::
9008
9009
9010File: gfortran.info,  Node: BACKTRACE,  Next: BESSEL_J0,  Prev: ATOMIC_XOR,  Up: Intrinsic Procedures
9011
90129.39 'BACKTRACE' -- Show a backtrace
9013====================================
9014
9015_Description_:
9016     'BACKTRACE' shows a backtrace at an arbitrary place in user code.
9017     Program execution continues normally afterwards.  The backtrace
9018     information is printed to the unit corresponding to 'ERROR_UNIT' in
9019     'ISO_FORTRAN_ENV'.
9020
9021_Standard_:
9022     GNU Extension
9023
9024_Class_:
9025     Subroutine
9026
9027_Syntax_:
9028     'CALL BACKTRACE'
9029
9030_Arguments_:
9031     None
9032
9033_See also_:
9034     *note ABORT::
9035
9036
9037File: gfortran.info,  Node: BESSEL_J0,  Next: BESSEL_J1,  Prev: BACKTRACE,  Up: Intrinsic Procedures
9038
90399.40 'BESSEL_J0' -- Bessel function of the first kind of order 0
9040================================================================
9041
9042_Description_:
9043     'BESSEL_J0(X)' computes the Bessel function of the first kind of
9044     order 0 of X.  This function is available under the name 'BESJ0' as
9045     a GNU extension.
9046
9047_Standard_:
9048     Fortran 2008 and later
9049
9050_Class_:
9051     Elemental function
9052
9053_Syntax_:
9054     'RESULT = BESSEL_J0(X)'
9055
9056_Arguments_:
9057     X           The type shall be 'REAL'.
9058
9059_Return value_:
9060     The return value is of type 'REAL' and lies in the range -
9061     0.4027... \leq Bessel (0,x) \leq 1.  It has the same kind as X.
9062
9063_Example_:
9064          program test_besj0
9065            real(8) :: x = 0.0_8
9066            x = bessel_j0(x)
9067          end program test_besj0
9068
9069_Specific names_:
9070     Name           Argument       Return type    Standard
9071     'DBESJ0(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
9072
9073
9074File: gfortran.info,  Node: BESSEL_J1,  Next: BESSEL_JN,  Prev: BESSEL_J0,  Up: Intrinsic Procedures
9075
90769.41 'BESSEL_J1' -- Bessel function of the first kind of order 1
9077================================================================
9078
9079_Description_:
9080     'BESSEL_J1(X)' computes the Bessel function of the first kind of
9081     order 1 of X.  This function is available under the name 'BESJ1' as
9082     a GNU extension.
9083
9084_Standard_:
9085     Fortran 2008
9086
9087_Class_:
9088     Elemental function
9089
9090_Syntax_:
9091     'RESULT = BESSEL_J1(X)'
9092
9093_Arguments_:
9094     X           The type shall be 'REAL'.
9095
9096_Return value_:
9097     The return value is of type 'REAL' and lies in the range -
9098     0.5818... \leq Bessel (0,x) \leq 0.5818 .  It has the same kind as
9099     X.
9100
9101_Example_:
9102          program test_besj1
9103            real(8) :: x = 1.0_8
9104            x = bessel_j1(x)
9105          end program test_besj1
9106
9107_Specific names_:
9108     Name           Argument       Return type    Standard
9109     'DBESJ1(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
9110
9111
9112File: gfortran.info,  Node: BESSEL_JN,  Next: BESSEL_Y0,  Prev: BESSEL_J1,  Up: Intrinsic Procedures
9113
91149.42 'BESSEL_JN' -- Bessel function of the first kind
9115=====================================================
9116
9117_Description_:
9118     'BESSEL_JN(N, X)' computes the Bessel function of the first kind of
9119     order N of X.  This function is available under the name 'BESJN' as
9120     a GNU extension.  If N and X are arrays, their ranks and shapes
9121     shall conform.
9122
9123     'BESSEL_JN(N1, N2, X)' returns an array with the Bessel functions
9124     of the first kind of the orders N1 to N2.
9125
9126_Standard_:
9127     Fortran 2008 and later, negative N is allowed as GNU extension
9128
9129_Class_:
9130     Elemental function, except for the transformational function
9131     'BESSEL_JN(N1, N2, X)'
9132
9133_Syntax_:
9134     'RESULT = BESSEL_JN(N, X)'
9135     'RESULT = BESSEL_JN(N1, N2, X)'
9136
9137_Arguments_:
9138     N           Shall be a scalar or an array of type 'INTEGER'.
9139     N1          Shall be a non-negative scalar of type
9140                 'INTEGER'.
9141     N2          Shall be a non-negative scalar of type
9142                 'INTEGER'.
9143     X           Shall be a scalar or an array of type 'REAL';
9144                 for 'BESSEL_JN(N1, N2, X)' it shall be scalar.
9145
9146_Return value_:
9147     The return value is a scalar of type 'REAL'.  It has the same kind
9148     as X.
9149
9150_Note_:
9151     The transformational function uses a recurrence algorithm which
9152     might, for some values of X, lead to different results than calls
9153     to the elemental function.
9154
9155_Example_:
9156          program test_besjn
9157            real(8) :: x = 1.0_8
9158            x = bessel_jn(5,x)
9159          end program test_besjn
9160
9161_Specific names_:
9162     Name           Argument       Return type    Standard
9163     'DBESJN(N,     'INTEGER N'    'REAL(8)'      GNU extension
9164     X)'
9165                    'REAL(8) X'
9166
9167
9168File: gfortran.info,  Node: BESSEL_Y0,  Next: BESSEL_Y1,  Prev: BESSEL_JN,  Up: Intrinsic Procedures
9169
91709.43 'BESSEL_Y0' -- Bessel function of the second kind of order 0
9171=================================================================
9172
9173_Description_:
9174     'BESSEL_Y0(X)' computes the Bessel function of the second kind of
9175     order 0 of X.  This function is available under the name 'BESY0' as
9176     a GNU extension.
9177
9178_Standard_:
9179     Fortran 2008 and later
9180
9181_Class_:
9182     Elemental function
9183
9184_Syntax_:
9185     'RESULT = BESSEL_Y0(X)'
9186
9187_Arguments_:
9188     X           The type shall be 'REAL'.
9189
9190_Return value_:
9191     The return value is of type 'REAL'.  It has the same kind as X.
9192
9193_Example_:
9194          program test_besy0
9195            real(8) :: x = 0.0_8
9196            x = bessel_y0(x)
9197          end program test_besy0
9198
9199_Specific names_:
9200     Name           Argument       Return type    Standard
9201     'DBESY0(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
9202
9203
9204File: gfortran.info,  Node: BESSEL_Y1,  Next: BESSEL_YN,  Prev: BESSEL_Y0,  Up: Intrinsic Procedures
9205
92069.44 'BESSEL_Y1' -- Bessel function of the second kind of order 1
9207=================================================================
9208
9209_Description_:
9210     'BESSEL_Y1(X)' computes the Bessel function of the second kind of
9211     order 1 of X.  This function is available under the name 'BESY1' as
9212     a GNU extension.
9213
9214_Standard_:
9215     Fortran 2008 and later
9216
9217_Class_:
9218     Elemental function
9219
9220_Syntax_:
9221     'RESULT = BESSEL_Y1(X)'
9222
9223_Arguments_:
9224     X           The type shall be 'REAL'.
9225
9226_Return value_:
9227     The return value is of type 'REAL'.  It has the same kind as X.
9228
9229_Example_:
9230          program test_besy1
9231            real(8) :: x = 1.0_8
9232            x = bessel_y1(x)
9233          end program test_besy1
9234
9235_Specific names_:
9236     Name           Argument       Return type    Standard
9237     'DBESY1(X)'    'REAL(8) X'    'REAL(8)'      GNU extension
9238
9239
9240File: gfortran.info,  Node: BESSEL_YN,  Next: BGE,  Prev: BESSEL_Y1,  Up: Intrinsic Procedures
9241
92429.45 'BESSEL_YN' -- Bessel function of the second kind
9243======================================================
9244
9245_Description_:
9246     'BESSEL_YN(N, X)' computes the Bessel function of the second kind
9247     of order N of X.  This function is available under the name 'BESYN'
9248     as a GNU extension.  If N and X are arrays, their ranks and shapes
9249     shall conform.
9250
9251     'BESSEL_YN(N1, N2, X)' returns an array with the Bessel functions
9252     of the first kind of the orders N1 to N2.
9253
9254_Standard_:
9255     Fortran 2008 and later, negative N is allowed as GNU extension
9256
9257_Class_:
9258     Elemental function, except for the transformational function
9259     'BESSEL_YN(N1, N2, X)'
9260
9261_Syntax_:
9262     'RESULT = BESSEL_YN(N, X)'
9263     'RESULT = BESSEL_YN(N1, N2, X)'
9264
9265_Arguments_:
9266     N           Shall be a scalar or an array of type 'INTEGER'
9267                 .
9268     N1          Shall be a non-negative scalar of type
9269                 'INTEGER'.
9270     N2          Shall be a non-negative scalar of type
9271                 'INTEGER'.
9272     X           Shall be a scalar or an array of type 'REAL';
9273                 for 'BESSEL_YN(N1, N2, X)' it shall be scalar.
9274
9275_Return value_:
9276     The return value is a scalar of type 'REAL'.  It has the same kind
9277     as X.
9278
9279_Note_:
9280     The transformational function uses a recurrence algorithm which
9281     might, for some values of X, lead to different results than calls
9282     to the elemental function.
9283
9284_Example_:
9285          program test_besyn
9286            real(8) :: x = 1.0_8
9287            x = bessel_yn(5,x)
9288          end program test_besyn
9289
9290_Specific names_:
9291     Name           Argument       Return type    Standard
9292     'DBESYN(N,X)'  'INTEGER N'    'REAL(8)'      GNU extension
9293                    'REAL(8) X'
9294
9295
9296File: gfortran.info,  Node: BGE,  Next: BGT,  Prev: BESSEL_YN,  Up: Intrinsic Procedures
9297
92989.46 'BGE' -- Bitwise greater than or equal to
9299==============================================
9300
9301_Description_:
9302     Determines whether an integral is a bitwise greater than or equal
9303     to another.
9304
9305_Standard_:
9306     Fortran 2008 and later
9307
9308_Class_:
9309     Elemental function
9310
9311_Syntax_:
9312     'RESULT = BGE(I, J)'
9313
9314_Arguments_:
9315     I           Shall be of 'INTEGER' type.
9316     J           Shall be of 'INTEGER' type, and of the same kind
9317                 as I.
9318
9319_Return value_:
9320     The return value is of type 'LOGICAL' and of the default kind.
9321
9322_See also_:
9323     *note BGT::, *note BLE::, *note BLT::
9324
9325
9326File: gfortran.info,  Node: BGT,  Next: BIT_SIZE,  Prev: BGE,  Up: Intrinsic Procedures
9327
93289.47 'BGT' -- Bitwise greater than
9329==================================
9330
9331_Description_:
9332     Determines whether an integral is a bitwise greater than another.
9333
9334_Standard_:
9335     Fortran 2008 and later
9336
9337_Class_:
9338     Elemental function
9339
9340_Syntax_:
9341     'RESULT = BGT(I, J)'
9342
9343_Arguments_:
9344     I           Shall be of 'INTEGER' type.
9345     J           Shall be of 'INTEGER' type, and of the same kind
9346                 as I.
9347
9348_Return value_:
9349     The return value is of type 'LOGICAL' and of the default kind.
9350
9351_See also_:
9352     *note BGE::, *note BLE::, *note BLT::
9353
9354
9355File: gfortran.info,  Node: BIT_SIZE,  Next: BLE,  Prev: BGT,  Up: Intrinsic Procedures
9356
93579.48 'BIT_SIZE' -- Bit size inquiry function
9358============================================
9359
9360_Description_:
9361     'BIT_SIZE(I)' returns the number of bits (integer precision plus
9362     sign bit) represented by the type of I.  The result of
9363     'BIT_SIZE(I)' is independent of the actual value of I.
9364
9365_Standard_:
9366     Fortran 95 and later
9367
9368_Class_:
9369     Inquiry function
9370
9371_Syntax_:
9372     'RESULT = BIT_SIZE(I)'
9373
9374_Arguments_:
9375     I           The type shall be 'INTEGER'.
9376
9377_Return value_:
9378     The return value is of type 'INTEGER'
9379
9380_Example_:
9381          program test_bit_size
9382              integer :: i = 123
9383              integer :: size
9384              size = bit_size(i)
9385              print *, size
9386          end program test_bit_size
9387
9388
9389File: gfortran.info,  Node: BLE,  Next: BLT,  Prev: BIT_SIZE,  Up: Intrinsic Procedures
9390
93919.49 'BLE' -- Bitwise less than or equal to
9392===========================================
9393
9394_Description_:
9395     Determines whether an integral is a bitwise less than or equal to
9396     another.
9397
9398_Standard_:
9399     Fortran 2008 and later
9400
9401_Class_:
9402     Elemental function
9403
9404_Syntax_:
9405     'RESULT = BLE(I, J)'
9406
9407_Arguments_:
9408     I           Shall be of 'INTEGER' type.
9409     J           Shall be of 'INTEGER' type, and of the same kind
9410                 as I.
9411
9412_Return value_:
9413     The return value is of type 'LOGICAL' and of the default kind.
9414
9415_See also_:
9416     *note BGT::, *note BGE::, *note BLT::
9417
9418
9419File: gfortran.info,  Node: BLT,  Next: BTEST,  Prev: BLE,  Up: Intrinsic Procedures
9420
94219.50 'BLT' -- Bitwise less than
9422===============================
9423
9424_Description_:
9425     Determines whether an integral is a bitwise less than another.
9426
9427_Standard_:
9428     Fortran 2008 and later
9429
9430_Class_:
9431     Elemental function
9432
9433_Syntax_:
9434     'RESULT = BLT(I, J)'
9435
9436_Arguments_:
9437     I           Shall be of 'INTEGER' type.
9438     J           Shall be of 'INTEGER' type, and of the same kind
9439                 as I.
9440
9441_Return value_:
9442     The return value is of type 'LOGICAL' and of the default kind.
9443
9444_See also_:
9445     *note BGE::, *note BGT::, *note BLE::
9446
9447
9448File: gfortran.info,  Node: BTEST,  Next: C_ASSOCIATED,  Prev: BLT,  Up: Intrinsic Procedures
9449
94509.51 'BTEST' -- Bit test function
9451=================================
9452
9453_Description_:
9454     'BTEST(I,POS)' returns logical '.TRUE.' if the bit at POS in I is
9455     set.  The counting of the bits starts at 0.
9456
9457_Standard_:
9458     Fortran 95 and later, has overloads that are GNU extensions
9459
9460_Class_:
9461     Elemental function
9462
9463_Syntax_:
9464     'RESULT = BTEST(I, POS)'
9465
9466_Arguments_:
9467     I           The type shall be 'INTEGER'.
9468     POS         The type shall be 'INTEGER'.
9469
9470_Return value_:
9471     The return value is of type 'LOGICAL'
9472
9473_Example_:
9474          program test_btest
9475              integer :: i = 32768 + 1024 + 64
9476              integer :: pos
9477              logical :: bool
9478              do pos=0,16
9479                  bool = btest(i, pos)
9480                  print *, pos, bool
9481              end do
9482          end program test_btest
9483
9484_Specific names_:
9485     Name           Argument       Return type    Standard
9486     'BTEST(I,POS)' 'INTEGER       'LOGICAL'      F95 and later
9487                    I,POS'
9488     'BBTEST(I,POS)''INTEGER(1)    'LOGICAL(1)'   GNU extension
9489                    I,POS'
9490     'BITEST(I,POS)''INTEGER(2)    'LOGICAL(2)'   GNU extension
9491                    I,POS'
9492     'BJTEST(I,POS)''INTEGER(4)    'LOGICAL(4)'   GNU extension
9493                    I,POS'
9494     'BKTEST(I,POS)''INTEGER(8)    'LOGICAL(8)'   GNU extension
9495                    I,POS'
9496
9497
9498File: gfortran.info,  Node: C_ASSOCIATED,  Next: C_F_POINTER,  Prev: BTEST,  Up: Intrinsic Procedures
9499
95009.52 'C_ASSOCIATED' -- Status of a C pointer
9501============================================
9502
9503_Description_:
9504     'C_ASSOCIATED(c_ptr_1[, c_ptr_2])' determines the status of the C
9505     pointer C_PTR_1 or if C_PTR_1 is associated with the target
9506     C_PTR_2.
9507
9508_Standard_:
9509     Fortran 2003 and later
9510
9511_Class_:
9512     Inquiry function
9513
9514_Syntax_:
9515     'RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])'
9516
9517_Arguments_:
9518     C_PTR_1     Scalar of the type 'C_PTR' or 'C_FUNPTR'.
9519     C_PTR_2     (Optional) Scalar of the same type as C_PTR_1.
9520
9521_Return value_:
9522     The return value is of type 'LOGICAL'; it is '.false.' if either
9523     C_PTR_1 is a C NULL pointer or if C_PTR1 and C_PTR_2 point to
9524     different addresses.
9525
9526_Example_:
9527          subroutine association_test(a,b)
9528            use iso_c_binding, only: c_associated, c_loc, c_ptr
9529            implicit none
9530            real, pointer :: a
9531            type(c_ptr) :: b
9532            if(c_associated(b, c_loc(a))) &
9533               stop 'b and a do not point to same target'
9534          end subroutine association_test
9535
9536_See also_:
9537     *note C_LOC::, *note C_FUNLOC::
9538
9539
9540File: gfortran.info,  Node: C_F_POINTER,  Next: C_F_PROCPOINTER,  Prev: C_ASSOCIATED,  Up: Intrinsic Procedures
9541
95429.53 'C_F_POINTER' -- Convert C into Fortran pointer
9543====================================================
9544
9545_Description_:
9546     'C_F_POINTER(CPTR, FPTR[, SHAPE])' assigns the target of the C
9547     pointer CPTR to the Fortran pointer FPTR and specifies its shape.
9548
9549_Standard_:
9550     Fortran 2003 and later
9551
9552_Class_:
9553     Subroutine
9554
9555_Syntax_:
9556     'CALL C_F_POINTER(CPTR, FPTR[, SHAPE])'
9557
9558_Arguments_:
9559     CPTR        scalar of the type 'C_PTR'.  It is 'INTENT(IN)'.
9560     FPTR        pointer interoperable with CPTR.  It is
9561                 'INTENT(OUT)'.
9562     SHAPE       (Optional) Rank-one array of type 'INTEGER' with
9563                 'INTENT(IN)'.  It shall be present if and only
9564                 if FPTR is an array.  The size must be equal to
9565                 the rank of FPTR.
9566
9567_Example_:
9568          program main
9569            use iso_c_binding
9570            implicit none
9571            interface
9572              subroutine my_routine(p) bind(c,name='myC_func')
9573                import :: c_ptr
9574                type(c_ptr), intent(out) :: p
9575              end subroutine
9576            end interface
9577            type(c_ptr) :: cptr
9578            real,pointer :: a(:)
9579            call my_routine(cptr)
9580            call c_f_pointer(cptr, a, [12])
9581          end program main
9582
9583_See also_:
9584     *note C_LOC::, *note C_F_PROCPOINTER::
9585
9586
9587File: gfortran.info,  Node: C_F_PROCPOINTER,  Next: C_FUNLOC,  Prev: C_F_POINTER,  Up: Intrinsic Procedures
9588
95899.54 'C_F_PROCPOINTER' -- Convert C into Fortran procedure pointer
9590==================================================================
9591
9592_Description_:
9593     'C_F_PROCPOINTER(CPTR, FPTR)' Assign the target of the C function
9594     pointer CPTR to the Fortran procedure pointer FPTR.
9595
9596_Standard_:
9597     Fortran 2003 and later
9598
9599_Class_:
9600     Subroutine
9601
9602_Syntax_:
9603     'CALL C_F_PROCPOINTER(cptr, fptr)'
9604
9605_Arguments_:
9606     CPTR        scalar of the type 'C_FUNPTR'.  It is
9607                 'INTENT(IN)'.
9608     FPTR        procedure pointer interoperable with CPTR.  It
9609                 is 'INTENT(OUT)'.
9610
9611_Example_:
9612          program main
9613            use iso_c_binding
9614            implicit none
9615            abstract interface
9616              function func(a)
9617                import :: c_float
9618                real(c_float), intent(in) :: a
9619                real(c_float) :: func
9620              end function
9621            end interface
9622            interface
9623               function getIterFunc() bind(c,name="getIterFunc")
9624                 import :: c_funptr
9625                 type(c_funptr) :: getIterFunc
9626               end function
9627            end interface
9628            type(c_funptr) :: cfunptr
9629            procedure(func), pointer :: myFunc
9630            cfunptr = getIterFunc()
9631            call c_f_procpointer(cfunptr, myFunc)
9632          end program main
9633
9634_See also_:
9635     *note C_LOC::, *note C_F_POINTER::
9636
9637
9638File: gfortran.info,  Node: C_FUNLOC,  Next: C_LOC,  Prev: C_F_PROCPOINTER,  Up: Intrinsic Procedures
9639
96409.55 'C_FUNLOC' -- Obtain the C address of a procedure
9641======================================================
9642
9643_Description_:
9644     'C_FUNLOC(x)' determines the C address of the argument.
9645
9646_Standard_:
9647     Fortran 2003 and later
9648
9649_Class_:
9650     Inquiry function
9651
9652_Syntax_:
9653     'RESULT = C_FUNLOC(x)'
9654
9655_Arguments_:
9656     X           Interoperable function or pointer to such
9657                 function.
9658
9659_Return value_:
9660     The return value is of type 'C_FUNPTR' and contains the C address
9661     of the argument.
9662
9663_Example_:
9664          module x
9665            use iso_c_binding
9666            implicit none
9667          contains
9668            subroutine sub(a) bind(c)
9669              real(c_float) :: a
9670              a = sqrt(a)+5.0
9671            end subroutine sub
9672          end module x
9673          program main
9674            use iso_c_binding
9675            use x
9676            implicit none
9677            interface
9678              subroutine my_routine(p) bind(c,name='myC_func')
9679                import :: c_funptr
9680                type(c_funptr), intent(in) :: p
9681              end subroutine
9682            end interface
9683            call my_routine(c_funloc(sub))
9684          end program main
9685
9686_See also_:
9687     *note C_ASSOCIATED::, *note C_LOC::, *note C_F_POINTER::, *note
9688     C_F_PROCPOINTER::
9689
9690
9691File: gfortran.info,  Node: C_LOC,  Next: C_SIZEOF,  Prev: C_FUNLOC,  Up: Intrinsic Procedures
9692
96939.56 'C_LOC' -- Obtain the C address of an object
9694=================================================
9695
9696_Description_:
9697     'C_LOC(X)' determines the C address of the argument.
9698
9699_Standard_:
9700     Fortran 2003 and later
9701
9702_Class_:
9703     Inquiry function
9704
9705_Syntax_:
9706     'RESULT = C_LOC(X)'
9707
9708_Arguments_:
9709     X       Shall have either the POINTER or TARGET attribute.
9710             It shall not be a coindexed object.  It shall either
9711             be a variable with interoperable type and kind type
9712             parameters, or be a scalar, nonpolymorphic variable
9713             with no length type parameters.
9714
9715
9716_Return value_:
9717     The return value is of type 'C_PTR' and contains the C address of
9718     the argument.
9719
9720_Example_:
9721          subroutine association_test(a,b)
9722            use iso_c_binding, only: c_associated, c_loc, c_ptr
9723            implicit none
9724            real, pointer :: a
9725            type(c_ptr) :: b
9726            if(c_associated(b, c_loc(a))) &
9727               stop 'b and a do not point to same target'
9728          end subroutine association_test
9729
9730_See also_:
9731     *note C_ASSOCIATED::, *note C_FUNLOC::, *note C_F_POINTER::, *note
9732     C_F_PROCPOINTER::
9733
9734
9735File: gfortran.info,  Node: C_SIZEOF,  Next: CEILING,  Prev: C_LOC,  Up: Intrinsic Procedures
9736
97379.57 'C_SIZEOF' -- Size in bytes of an expression
9738=================================================
9739
9740_Description_:
9741     'C_SIZEOF(X)' calculates the number of bytes of storage the
9742     expression 'X' occupies.
9743
9744_Standard_:
9745     Fortran 2008
9746
9747_Class_:
9748     Inquiry function of the module 'ISO_C_BINDING'
9749
9750_Syntax_:
9751     'N = C_SIZEOF(X)'
9752
9753_Arguments_:
9754     X           The argument shall be an interoperable data
9755                 entity.
9756
9757_Return value_:
9758     The return value is of type integer and of the system-dependent
9759     kind 'C_SIZE_T' (from the 'ISO_C_BINDING' module).  Its value is
9760     the number of bytes occupied by the argument.  If the argument has
9761     the 'POINTER' attribute, the number of bytes of the storage area
9762     pointed to is returned.  If the argument is of a derived type with
9763     'POINTER' or 'ALLOCATABLE' components, the return value does not
9764     account for the sizes of the data pointed to by these components.
9765
9766_Example_:
9767             use iso_c_binding
9768             integer(c_int) :: i
9769             real(c_float) :: r, s(5)
9770             print *, (c_sizeof(s)/c_sizeof(r) == 5)
9771             end
9772     The example will print '.TRUE.' unless you are using a platform
9773     where default 'REAL' variables are unusually padded.
9774
9775_See also_:
9776     *note SIZEOF::, *note STORAGE_SIZE::
9777
9778
9779File: gfortran.info,  Node: CEILING,  Next: CHAR,  Prev: C_SIZEOF,  Up: Intrinsic Procedures
9780
97819.58 'CEILING' -- Integer ceiling function
9782==========================================
9783
9784_Description_:
9785     'CEILING(A)' returns the least integer greater than or equal to A.
9786
9787_Standard_:
9788     Fortran 95 and later
9789
9790_Class_:
9791     Elemental function
9792
9793_Syntax_:
9794     'RESULT = CEILING(A [, KIND])'
9795
9796_Arguments_:
9797     A           The type shall be 'REAL'.
9798     KIND        (Optional) An 'INTEGER' initialization
9799                 expression indicating the kind parameter of the
9800                 result.
9801
9802_Return value_:
9803     The return value is of type 'INTEGER(KIND)' if KIND is present and
9804     a default-kind 'INTEGER' otherwise.
9805
9806_Example_:
9807          program test_ceiling
9808              real :: x = 63.29
9809              real :: y = -63.59
9810              print *, ceiling(x) ! returns 64
9811              print *, ceiling(y) ! returns -63
9812          end program test_ceiling
9813
9814_See also_:
9815     *note FLOOR::, *note NINT::
9816
9817
9818File: gfortran.info,  Node: CHAR,  Next: CHDIR,  Prev: CEILING,  Up: Intrinsic Procedures
9819
98209.59 'CHAR' -- Character conversion function
9821============================================
9822
9823_Description_:
9824     'CHAR(I [, KIND])' returns the character represented by the integer
9825     I.
9826
9827_Standard_:
9828     Fortran 77 and later
9829
9830_Class_:
9831     Elemental function
9832
9833_Syntax_:
9834     'RESULT = CHAR(I [, KIND])'
9835
9836_Arguments_:
9837     I           The type shall be 'INTEGER'.
9838     KIND        (Optional) An 'INTEGER' initialization
9839                 expression indicating the kind parameter of the
9840                 result.
9841
9842_Return value_:
9843     The return value is of type 'CHARACTER(1)'
9844
9845_Example_:
9846          program test_char
9847              integer :: i = 74
9848              character(1) :: c
9849              c = char(i)
9850              print *, i, c ! returns 'J'
9851          end program test_char
9852
9853_Specific names_:
9854     Name           Argument       Return type    Standard
9855     'CHAR(I)'      'INTEGER I'    'CHARACTER(LEN=1)'F77 and later
9856
9857_Note_:
9858     See *note ICHAR:: for a discussion of converting between numerical
9859     values and formatted string representations.
9860
9861_See also_:
9862     *note ACHAR::, *note IACHAR::, *note ICHAR::
9863
9864
9865File: gfortran.info,  Node: CHDIR,  Next: CHMOD,  Prev: CHAR,  Up: Intrinsic Procedures
9866
98679.60 'CHDIR' -- Change working directory
9868========================================
9869
9870_Description_:
9871     Change current working directory to a specified path.
9872
9873     This intrinsic is provided in both subroutine and function forms;
9874     however, only one form can be used in any given program unit.
9875
9876_Standard_:
9877     GNU extension
9878
9879_Class_:
9880     Subroutine, function
9881
9882_Syntax_:
9883     'CALL CHDIR(NAME [, STATUS])'
9884     'STATUS = CHDIR(NAME)'
9885
9886_Arguments_:
9887     NAME        The type shall be 'CHARACTER' of default kind
9888                 and shall specify a valid path within the file
9889                 system.
9890     STATUS      (Optional) 'INTEGER' status flag of the default
9891                 kind.  Returns 0 on success, and a system
9892                 specific and nonzero error code otherwise.
9893
9894_Example_:
9895          PROGRAM test_chdir
9896            CHARACTER(len=255) :: path
9897            CALL getcwd(path)
9898            WRITE(*,*) TRIM(path)
9899            CALL chdir("/tmp")
9900            CALL getcwd(path)
9901            WRITE(*,*) TRIM(path)
9902          END PROGRAM
9903
9904_See also_:
9905     *note GETCWD::
9906
9907
9908File: gfortran.info,  Node: CHMOD,  Next: CMPLX,  Prev: CHDIR,  Up: Intrinsic Procedures
9909
99109.61 'CHMOD' -- Change access permissions of files
9911==================================================
9912
9913_Description_:
9914     'CHMOD' changes the permissions of a file.
9915
9916     This intrinsic is provided in both subroutine and function forms;
9917     however, only one form can be used in any given program unit.
9918
9919_Standard_:
9920     GNU extension
9921
9922_Class_:
9923     Subroutine, function
9924
9925_Syntax_:
9926     'CALL CHMOD(NAME, MODE[, STATUS])'
9927     'STATUS = CHMOD(NAME, MODE)'
9928
9929_Arguments_:
9930
9931     NAME        Scalar 'CHARACTER' of default kind with the file
9932                 name.  Trailing blanks are ignored unless the
9933                 character 'achar(0)' is present, then all
9934                 characters up to and excluding 'achar(0)' are
9935                 used as the file name.
9936
9937     MODE        Scalar 'CHARACTER' of default kind giving the
9938                 file permission.  MODE uses the same syntax as
9939                 the 'chmod' utility as defined by the POSIX
9940                 standard.  The argument shall either be a string
9941                 of a nonnegative octal number or a symbolic
9942                 mode.
9943
9944     STATUS      (optional) scalar 'INTEGER', which is '0' on
9945                 success and nonzero otherwise.
9946
9947_Return value_:
9948     In either syntax, STATUS is set to '0' on success and nonzero
9949     otherwise.
9950
9951_Example_:
9952     'CHMOD' as subroutine
9953          program chmod_test
9954            implicit none
9955            integer :: status
9956            call chmod('test.dat','u+x',status)
9957            print *, 'Status: ', status
9958          end program chmod_test
9959     'CHMOD' as function:
9960          program chmod_test
9961            implicit none
9962            integer :: status
9963            status = chmod('test.dat','u+x')
9964            print *, 'Status: ', status
9965          end program chmod_test
9966
9967
9968File: gfortran.info,  Node: CMPLX,  Next: CO_BROADCAST,  Prev: CHMOD,  Up: Intrinsic Procedures
9969
99709.62 'CMPLX' -- Complex conversion function
9971===========================================
9972
9973_Description_:
9974     'CMPLX(X [, Y [, KIND]])' returns a complex number where X is
9975     converted to the real component.  If Y is present it is converted
9976     to the imaginary component.  If Y is not present then the imaginary
9977     component is set to 0.0.  If X is complex then Y must not be
9978     present.
9979
9980_Standard_:
9981     Fortran 77 and later
9982
9983_Class_:
9984     Elemental function
9985
9986_Syntax_:
9987     'RESULT = CMPLX(X [, Y [, KIND]])'
9988
9989_Arguments_:
9990     X           The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
9991     Y           (Optional; only allowed if X is not 'COMPLEX'.)
9992                 May be 'INTEGER' or 'REAL'.
9993     KIND        (Optional) An 'INTEGER' initialization
9994                 expression indicating the kind parameter of the
9995                 result.
9996
9997_Return value_:
9998     The return value is of 'COMPLEX' type, with a kind equal to KIND if
9999     it is specified.  If KIND is not specified, the result is of the
10000     default 'COMPLEX' kind, regardless of the kinds of X and Y.
10001
10002_Example_:
10003          program test_cmplx
10004              integer :: i = 42
10005              real :: x = 3.14
10006              complex :: z
10007              z = cmplx(i, x)
10008              print *, z, cmplx(x)
10009          end program test_cmplx
10010
10011_See also_:
10012     *note COMPLEX::
10013
10014
10015File: gfortran.info,  Node: CO_BROADCAST,  Next: CO_MAX,  Prev: CMPLX,  Up: Intrinsic Procedures
10016
100179.63 'CO_BROADCAST' -- Copy a value to all images the current set of images
10018===========================================================================
10019
10020_Description_:
10021     'CO_BROADCAST' copies the value of argument A on the image with
10022     image index 'SOURCE_IMAGE' to all images in the current team.  A
10023     becomes defined as if by intrinsic assignment.  If the execution
10024     was successful and STAT is present, it is assigned the value zero.
10025     If the execution failed, STAT gets assigned a nonzero value and, if
10026     present, ERRMSG gets assigned a value describing the occurred
10027     error.
10028
10029_Standard_:
10030     Technical Specification (TS) 18508 or later
10031
10032_Class_:
10033     Collective subroutine
10034
10035_Syntax_:
10036     'CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])'
10037
10038_Arguments_:
10039     A           INTENT(INOUT) argument; shall have the same
10040                 dynamic type and type paramters on all images of
10041                 the current team.  If it is an array, it shall
10042                 have the same shape on all images.
10043     SOURCE_IMAGEa scalar integer expression.  It shall have the
10044                 same the same value on all images and refer to
10045                 an image of the current team.
10046     STAT        (optional) a scalar integer variable
10047     ERRMSG      (optional) a scalar character variable
10048
10049_Example_:
10050          program test
10051            integer :: val(3)
10052            if (this_image() == 1) then
10053              val = [1, 5, 3]
10054            end if
10055            call co_broadcast (val, source_image=1)
10056            print *, this_image, ":", val
10057          end program test
10058
10059_See also_:
10060     *note CO_MAX::, *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::
10061
10062
10063File: gfortran.info,  Node: CO_MAX,  Next: CO_MIN,  Prev: CO_BROADCAST,  Up: Intrinsic Procedures
10064
100659.64 'CO_MAX' -- Maximal value on the current set of images
10066===========================================================
10067
10068_Description_:
10069     'CO_MAX' determines element-wise the maximal value of A on all
10070     images of the current team.  If RESULT_IMAGE is present, the
10071     maximum values are returned in A on the specified image only and
10072     the value of A on the other images become undefined.  If
10073     RESULT_IMAGE is not present, the value is returned on all images.
10074     If the execution was successful and STAT is present, it is assigned
10075     the value zero.  If the execution failed, STAT gets assigned a
10076     nonzero value and, if present, ERRMSG gets assigned a value
10077     describing the occurred error.
10078
10079_Standard_:
10080     Technical Specification (TS) 18508 or later
10081
10082_Class_:
10083     Collective subroutine
10084
10085_Syntax_:
10086     'CALL CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])'
10087
10088_Arguments_:
10089     A           shall be an integer, real or character variable,
10090                 which has the same type and type parameters on
10091                 all images of the team.
10092     RESULT_IMAGE(optional) a scalar integer expression; if
10093                 present, it shall have the same the same value
10094                 on all images and refer to an image of the
10095                 current team.
10096     STAT        (optional) a scalar integer variable
10097     ERRMSG      (optional) a scalar character variable
10098
10099_Example_:
10100          program test
10101            integer :: val
10102            val = this_image ()
10103            call co_max (val, result_image=1)
10104            if (this_image() == 1) then
10105              write(*,*) "Maximal value", val  ! prints num_images()
10106            end if
10107          end program test
10108
10109_See also_:
10110     *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::, *note
10111     CO_BROADCAST::
10112
10113
10114File: gfortran.info,  Node: CO_MIN,  Next: CO_REDUCE,  Prev: CO_MAX,  Up: Intrinsic Procedures
10115
101169.65 'CO_MIN' -- Minimal value on the current set of images
10117===========================================================
10118
10119_Description_:
10120     'CO_MIN' determines element-wise the minimal value of A on all
10121     images of the current team.  If RESULT_IMAGE is present, the
10122     minimal values are returned in A on the specified image only and
10123     the value of A on the other images become undefined.  If
10124     RESULT_IMAGE is not present, the value is returned on all images.
10125     If the execution was successful and STAT is present, it is assigned
10126     the value zero.  If the execution failed, STAT gets assigned a
10127     nonzero value and, if present, ERRMSG gets assigned a value
10128     describing the occurred error.
10129
10130_Standard_:
10131     Technical Specification (TS) 18508 or later
10132
10133_Class_:
10134     Collective subroutine
10135
10136_Syntax_:
10137     'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
10138
10139_Arguments_:
10140     A           shall be an integer, real or character variable,
10141                 which has the same type and type parameters on
10142                 all images of the team.
10143     RESULT_IMAGE(optional) a scalar integer expression; if
10144                 present, it shall have the same the same value
10145                 on all images and refer to an image of the
10146                 current team.
10147     STAT        (optional) a scalar integer variable
10148     ERRMSG      (optional) a scalar character variable
10149
10150_Example_:
10151          program test
10152            integer :: val
10153            val = this_image ()
10154            call co_min (val, result_image=1)
10155            if (this_image() == 1) then
10156              write(*,*) "Minimal value", val  ! prints 1
10157            end if
10158          end program test
10159
10160_See also_:
10161     *note CO_MAX::, *note CO_SUM::, *note CO_REDUCE::, *note
10162     CO_BROADCAST::
10163
10164
10165File: gfortran.info,  Node: CO_REDUCE,  Next: CO_SUM,  Prev: CO_MIN,  Up: Intrinsic Procedures
10166
101679.66 'CO_REDUCE' -- Reduction of values on the current set of images
10168====================================================================
10169
10170_Description_:
10171     'CO_REDUCE' determines element-wise the reduction of the value of A
10172     on all images of the current team.  The pure function passed as
10173     OPERATOR is used to pairwise reduce the values of A by passing
10174     either the value of A of different images or the result values of
10175     such a reduction as argument.  If A is an array, the deduction is
10176     done element wise.  If RESULT_IMAGE is present, the result values
10177     are returned in A on the specified image only and the value of A on
10178     the other images become undefined.  If RESULT_IMAGE is not present,
10179     the value is returned on all images.  If the execution was
10180     successful and STAT is present, it is assigned the value zero.  If
10181     the execution failed, STAT gets assigned a nonzero value and, if
10182     present, ERRMSG gets assigned a value describing the occurred
10183     error.
10184
10185_Standard_:
10186     Technical Specification (TS) 18508 or later
10187
10188_Class_:
10189     Collective subroutine
10190
10191_Syntax_:
10192     'CALL CO_REDUCE(A, OPERATOR, [, RESULT_IMAGE, STAT, ERRMSG])'
10193
10194_Arguments_:
10195     A           is an 'INTENT(INOUT)' argument and shall be
10196                 nonpolymorphic.  If it is allocatable, it shall
10197                 be allocated; if it is a pointer, it shall be
10198                 associated.  A shall have the same type and type
10199                 parameters on all images of the team; if it is
10200                 an array, it shall have the same shape on all
10201                 images.
10202     OPERATOR    pure function with two scalar nonallocatable
10203                 arguments, which shall be nonpolymorphic and
10204                 have the same type and type parameters as A.
10205                 The function shall return a nonallocatable
10206                 scalar of the same type and type parameters as
10207                 A.  The function shall be the same on all images
10208                 and with regards to the arguments mathematically
10209                 commutative and associative.  Note that OPERATOR
10210                 may not be an elemental function, unless it is
10211                 an intrisic function.
10212     RESULT_IMAGE(optional) a scalar integer expression; if
10213                 present, it shall have the same the same value
10214                 on all images and refer to an image of the
10215                 current team.
10216     STAT        (optional) a scalar integer variable
10217     ERRMSG      (optional) a scalar character variable
10218
10219_Example_:
10220          program test
10221            integer :: val
10222            val = this_image ()
10223            call co_reduce (val, result_image=1, operator=myprod)
10224            if (this_image() == 1) then
10225              write(*,*) "Product value", val  ! prints num_images() factorial
10226            end if
10227          contains
10228            pure function myprod(a, b)
10229              integer, value :: a, b
10230              integer :: myprod
10231              myprod = a * b
10232            end function myprod
10233          end program test
10234
10235_Note_:
10236     While the rules permit in principle an intrinsic function, none of
10237     the intrinsics in the standard fulfill the criteria of having a
10238     specific function, which takes two arguments of the same type and
10239     returning that type as result.
10240
10241_See also_:
10242     *note CO_MIN::, *note CO_MAX::, *note CO_SUM::, *note
10243     CO_BROADCAST::
10244
10245
10246File: gfortran.info,  Node: CO_SUM,  Next: COMMAND_ARGUMENT_COUNT,  Prev: CO_REDUCE,  Up: Intrinsic Procedures
10247
102489.67 'CO_SUM' -- Sum of values on the current set of images
10249===========================================================
10250
10251_Description_:
10252     'CO_SUM' sums up the values of each element of A on all images of
10253     the current team.  If RESULT_IMAGE is present, the summed-up values
10254     are returned in A on the specified image only and the value of A on
10255     the other images become undefined.  If RESULT_IMAGE is not present,
10256     the value is returned on all images.  If the execution was
10257     successful and STAT is present, it is assigned the value zero.  If
10258     the execution failed, STAT gets assigned a nonzero value and, if
10259     present, ERRMSG gets assigned a value describing the occurred
10260     error.
10261
10262_Standard_:
10263     Technical Specification (TS) 18508 or later
10264
10265_Class_:
10266     Collective subroutine
10267
10268_Syntax_:
10269     'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])'
10270
10271_Arguments_:
10272     A           shall be an integer, real or complex variable,
10273                 which has the same type and type parameters on
10274                 all images of the team.
10275     RESULT_IMAGE(optional) a scalar integer expression; if
10276                 present, it shall have the same the same value
10277                 on all images and refer to an image of the
10278                 current team.
10279     STAT        (optional) a scalar integer variable
10280     ERRMSG      (optional) a scalar character variable
10281
10282_Example_:
10283          program test
10284            integer :: val
10285            val = this_image ()
10286            call co_sum (val, result_image=1)
10287            if (this_image() == 1) then
10288              write(*,*) "The sum is ", val ! prints (n**2 + n)/2, with n = num_images()
10289            end if
10290          end program test
10291
10292_See also_:
10293     *note CO_MAX::, *note CO_MIN::, *note CO_REDUCE::, *note
10294     CO_BROADCAST::
10295
10296
10297File: gfortran.info,  Node: COMMAND_ARGUMENT_COUNT,  Next: COMPILER_OPTIONS,  Prev: CO_SUM,  Up: Intrinsic Procedures
10298
102999.68 'COMMAND_ARGUMENT_COUNT' -- Get number of command line arguments
10300=====================================================================
10301
10302_Description_:
10303     'COMMAND_ARGUMENT_COUNT' returns the number of arguments passed on
10304     the command line when the containing program was invoked.
10305
10306_Standard_:
10307     Fortran 2003 and later
10308
10309_Class_:
10310     Inquiry function
10311
10312_Syntax_:
10313     'RESULT = COMMAND_ARGUMENT_COUNT()'
10314
10315_Arguments_:
10316     None
10317
10318_Return value_:
10319     The return value is an 'INTEGER' of default kind.
10320
10321_Example_:
10322          program test_command_argument_count
10323              integer :: count
10324              count = command_argument_count()
10325              print *, count
10326          end program test_command_argument_count
10327
10328_See also_:
10329     *note GET_COMMAND::, *note GET_COMMAND_ARGUMENT::
10330
10331
10332File: gfortran.info,  Node: COMPILER_OPTIONS,  Next: COMPILER_VERSION,  Prev: COMMAND_ARGUMENT_COUNT,  Up: Intrinsic Procedures
10333
103349.69 'COMPILER_OPTIONS' -- Options passed to the compiler
10335=========================================================
10336
10337_Description_:
10338     'COMPILER_OPTIONS' returns a string with the options used for
10339     compiling.
10340
10341_Standard_:
10342     Fortran 2008
10343
10344_Class_:
10345     Inquiry function of the module 'ISO_FORTRAN_ENV'
10346
10347_Syntax_:
10348     'STR = COMPILER_OPTIONS()'
10349
10350_Arguments_:
10351     None.
10352
10353_Return value_:
10354     The return value is a default-kind string with system-dependent
10355     length.  It contains the compiler flags used to compile the file,
10356     which called the 'COMPILER_OPTIONS' intrinsic.
10357
10358_Example_:
10359             use iso_fortran_env
10360             print '(4a)', 'This file was compiled by ', &
10361                           compiler_version(), ' using the options ', &
10362                           compiler_options()
10363             end
10364
10365_See also_:
10366     *note COMPILER_VERSION::, *note ISO_FORTRAN_ENV::
10367
10368
10369File: gfortran.info,  Node: COMPILER_VERSION,  Next: COMPLEX,  Prev: COMPILER_OPTIONS,  Up: Intrinsic Procedures
10370
103719.70 'COMPILER_VERSION' -- Compiler version string
10372==================================================
10373
10374_Description_:
10375     'COMPILER_VERSION' returns a string with the name and the version
10376     of the compiler.
10377
10378_Standard_:
10379     Fortran 2008
10380
10381_Class_:
10382     Inquiry function of the module 'ISO_FORTRAN_ENV'
10383
10384_Syntax_:
10385     'STR = COMPILER_VERSION()'
10386
10387_Arguments_:
10388     None.
10389
10390_Return value_:
10391     The return value is a default-kind string with system-dependent
10392     length.  It contains the name of the compiler and its version
10393     number.
10394
10395_Example_:
10396             use iso_fortran_env
10397             print '(4a)', 'This file was compiled by ', &
10398                           compiler_version(), ' using the options ', &
10399                           compiler_options()
10400             end
10401
10402_See also_:
10403     *note COMPILER_OPTIONS::, *note ISO_FORTRAN_ENV::
10404
10405
10406File: gfortran.info,  Node: COMPLEX,  Next: CONJG,  Prev: COMPILER_VERSION,  Up: Intrinsic Procedures
10407
104089.71 'COMPLEX' -- Complex conversion function
10409=============================================
10410
10411_Description_:
10412     'COMPLEX(X, Y)' returns a complex number where X is converted to
10413     the real component and Y is converted to the imaginary component.
10414
10415_Standard_:
10416     GNU extension
10417
10418_Class_:
10419     Elemental function
10420
10421_Syntax_:
10422     'RESULT = COMPLEX(X, Y)'
10423
10424_Arguments_:
10425     X           The type may be 'INTEGER' or 'REAL'.
10426     Y           The type may be 'INTEGER' or 'REAL'.
10427
10428_Return value_:
10429     If X and Y are both of 'INTEGER' type, then the return value is of
10430     default 'COMPLEX' type.
10431
10432     If X and Y are of 'REAL' type, or one is of 'REAL' type and one is
10433     of 'INTEGER' type, then the return value is of 'COMPLEX' type with
10434     a kind equal to that of the 'REAL' argument with the highest
10435     precision.
10436
10437_Example_:
10438          program test_complex
10439              integer :: i = 42
10440              real :: x = 3.14
10441              print *, complex(i, x)
10442          end program test_complex
10443
10444_See also_:
10445     *note CMPLX::
10446
10447
10448File: gfortran.info,  Node: CONJG,  Next: COS,  Prev: COMPLEX,  Up: Intrinsic Procedures
10449
104509.72 'CONJG' -- Complex conjugate function
10451==========================================
10452
10453_Description_:
10454     'CONJG(Z)' returns the conjugate of Z.  If Z is '(x, y)' then the
10455     result is '(x, -y)'
10456
10457_Standard_:
10458     Fortran 77 and later, has overloads that are GNU extensions
10459
10460_Class_:
10461     Elemental function
10462
10463_Syntax_:
10464     'Z = CONJG(Z)'
10465
10466_Arguments_:
10467     Z           The type shall be 'COMPLEX'.
10468
10469_Return value_:
10470     The return value is of type 'COMPLEX'.
10471
10472_Example_:
10473          program test_conjg
10474              complex :: z = (2.0, 3.0)
10475              complex(8) :: dz = (2.71_8, -3.14_8)
10476              z= conjg(z)
10477              print *, z
10478              dz = dconjg(dz)
10479              print *, dz
10480          end program test_conjg
10481
10482_Specific names_:
10483     Name           Argument       Return type    Standard
10484     'CONJG(Z)'     'COMPLEX Z'    'COMPLEX'      GNU extension
10485     'DCONJG(Z)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10486                    Z'
10487
10488
10489File: gfortran.info,  Node: COS,  Next: COSD,  Prev: CONJG,  Up: Intrinsic Procedures
10490
104919.73 'COS' -- Cosine function
10492=============================
10493
10494_Description_:
10495     'COS(X)' computes the cosine of X.
10496
10497_Standard_:
10498     Fortran 77 and later, has overloads that are GNU extensions
10499
10500_Class_:
10501     Elemental function
10502
10503_Syntax_:
10504     'RESULT = COS(X)'
10505
10506_Arguments_:
10507     X           The type shall be 'REAL' or 'COMPLEX'.
10508
10509_Return value_:
10510     The return value is of the same type and kind as X.  The real part
10511     of the result is in radians.  If X is of the type 'REAL', the
10512     return value lies in the range -1 \leq \cos (x) \leq 1.
10513
10514_Example_:
10515          program test_cos
10516            real :: x = 0.0
10517            x = cos(x)
10518          end program test_cos
10519
10520_Specific names_:
10521     Name           Argument       Return type    Standard
10522     'COS(X)'       'REAL(4) X'    'REAL(4)'      Fortran 77 and
10523                                                  later
10524     'DCOS(X)'      'REAL(8) X'    'REAL(8)'      Fortran 77 and
10525                                                  later
10526     'CCOS(X)'      'COMPLEX(4)    'COMPLEX(4)'   Fortran 77 and
10527                    X'                            later
10528     'ZCOS(X)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10529                    X'
10530     'CDCOS(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10531                    X'
10532
10533_See also_:
10534     Inverse function: *note ACOS:: Degrees function: *note COSD::
10535
10536
10537File: gfortran.info,  Node: COSD,  Next: COSH,  Prev: COS,  Up: Intrinsic Procedures
10538
105399.74 'COSD' -- Cosine function, degrees
10540=======================================
10541
10542_Description_:
10543     'COSD(X)' computes the cosine of X in degrees.
10544
10545     This function is for compatibility only and should be avoided in
10546     favor of standard constructs wherever possible.
10547
10548_Standard_:
10549     GNU Extension, enabled with '-fdec-math'.
10550
10551_Class_:
10552     Elemental function
10553
10554_Syntax_:
10555     'RESULT = COSD(X)'
10556
10557_Arguments_:
10558     X           The type shall be 'REAL' or 'COMPLEX'.
10559
10560_Return value_:
10561     The return value is of the same type and kind as X.  The real part
10562     of the result is in degrees.  If X is of the type 'REAL', the
10563     return value lies in the range -1 \leq \cosd (x) \leq 1.
10564
10565_Example_:
10566          program test_cosd
10567            real :: x = 0.0
10568            x = cosd(x)
10569          end program test_cosd
10570
10571_Specific names_:
10572     Name           Argument       Return type    Standard
10573     'COSD(X)'      'REAL(4) X'    'REAL(4)'      GNU Extension
10574     'DCOSD(X)'     'REAL(8) X'    'REAL(8)'      GNU Extension
10575     'CCOSD(X)'     'COMPLEX(4)    'COMPLEX(4)'   GNU Extension
10576                    X'
10577     'ZCOSD(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10578                    X'
10579     'CDCOSD(X)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
10580                    X'
10581
10582_See also_:
10583     Inverse function: *note ACOSD:: Radians function: *note COS::
10584
10585
10586File: gfortran.info,  Node: COSH,  Next: COTAN,  Prev: COSD,  Up: Intrinsic Procedures
10587
105889.75 'COSH' -- Hyperbolic cosine function
10589=========================================
10590
10591_Description_:
10592     'COSH(X)' computes the hyperbolic cosine of X.
10593
10594_Standard_:
10595     Fortran 77 and later, for a complex argument Fortran 2008 or later
10596
10597_Class_:
10598     Elemental function
10599
10600_Syntax_:
10601     'X = COSH(X)'
10602
10603_Arguments_:
10604     X           The type shall be 'REAL' or 'COMPLEX'.
10605
10606_Return value_:
10607     The return value has same type and kind as X.  If X is complex, the
10608     imaginary part of the result is in radians.  If X is 'REAL', the
10609     return value has a lower bound of one, \cosh (x) \geq 1.
10610
10611_Example_:
10612          program test_cosh
10613            real(8) :: x = 1.0_8
10614            x = cosh(x)
10615          end program test_cosh
10616
10617_Specific names_:
10618     Name           Argument       Return type    Standard
10619     'COSH(X)'      'REAL(4) X'    'REAL(4)'      Fortran 77 and
10620                                                  later
10621     'DCOSH(X)'     'REAL(8) X'    'REAL(8)'      Fortran 77 and
10622                                                  later
10623
10624_See also_:
10625     Inverse function: *note ACOSH::
10626
10627
10628File: gfortran.info,  Node: COTAN,  Next: COTAND,  Prev: COSH,  Up: Intrinsic Procedures
10629
106309.76 'COTAN' -- Cotangent function
10631==================================
10632
10633_Description_:
10634     'COTAN(X)' computes the cotangent of X.  Equivalent to 'COS(x)'
10635     divided by 'SIN(x)', or '1 / TAN(x)'.
10636
10637     This function is for compatibility only and should be avoided in
10638     favor of standard constructs wherever possible.
10639
10640_Standard_:
10641     GNU Extension, enabled with '-fdec-math'.
10642
10643_Class_:
10644     Elemental function
10645
10646_Syntax_:
10647     'RESULT = COTAN(X)'
10648
10649_Arguments_:
10650     X           The type shall be 'REAL' or 'COMPLEX'.
10651
10652_Return value_:
10653     The return value has same type and kind as X, and its value is in
10654     radians.
10655
10656_Example_:
10657          program test_cotan
10658            real(8) :: x = 0.165_8
10659            x = cotan(x)
10660          end program test_cotan
10661
10662_Specific names_:
10663     Name           Argument       Return type    Standard
10664     'COTAN(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
10665     'DCOTAN(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
10666
10667_See also_:
10668     Converse function: *note TAN:: Degrees function: *note COTAND::
10669
10670
10671File: gfortran.info,  Node: COTAND,  Next: COUNT,  Prev: COTAN,  Up: Intrinsic Procedures
10672
106739.77 'COTAND' -- Cotangent function, degrees
10674============================================
10675
10676_Description_:
10677     'COTAND(X)' computes the cotangent of X in degrees.  Equivalent to
10678     'COSD(x)' divided by 'SIND(x)', or '1 / TAND(x)'.
10679
10680_Standard_:
10681     GNU Extension, enabled with '-fdec-math'.
10682
10683     This function is for compatibility only and should be avoided in
10684     favor of standard constructs wherever possible.
10685
10686_Class_:
10687     Elemental function
10688
10689_Syntax_:
10690     'RESULT = COTAND(X)'
10691
10692_Arguments_:
10693     X           The type shall be 'REAL' or 'COMPLEX'.
10694
10695_Return value_:
10696     The return value has same type and kind as X, and its value is in
10697     degrees.
10698
10699_Example_:
10700          program test_cotand
10701            real(8) :: x = 0.165_8
10702            x = cotand(x)
10703          end program test_cotand
10704
10705_Specific names_:
10706     Name           Argument       Return type    Standard
10707     'COTAND(X)'    'REAL(4) X'    'REAL(4)'      GNU Extension
10708     'DCOTAND(X)'   'REAL(8) X'    'REAL(8)'      GNU Extension
10709
10710_See also_:
10711     Converse function: *note TAND:: Radians function: *note COTAN::
10712
10713
10714File: gfortran.info,  Node: COUNT,  Next: CPU_TIME,  Prev: COTAND,  Up: Intrinsic Procedures
10715
107169.78 'COUNT' -- Count function
10717==============================
10718
10719_Description_:
10720
10721     Counts the number of '.TRUE.' elements in a logical MASK, or, if
10722     the DIM argument is supplied, counts the number of elements along
10723     each row of the array in the DIM direction.  If the array has zero
10724     size, or all of the elements of MASK are '.FALSE.', then the result
10725     is '0'.
10726
10727_Standard_:
10728     Fortran 95 and later, with KIND argument Fortran 2003 and later
10729
10730_Class_:
10731     Transformational function
10732
10733_Syntax_:
10734     'RESULT = COUNT(MASK [, DIM, KIND])'
10735
10736_Arguments_:
10737     MASK        The type shall be 'LOGICAL'.
10738     DIM         (Optional) The type shall be 'INTEGER'.
10739     KIND        (Optional) An 'INTEGER' initialization
10740                 expression indicating the kind parameter of the
10741                 result.
10742
10743_Return value_:
10744     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
10745     absent, the return value is of default integer kind.  If DIM is
10746     present, the result is an array with a rank one less than the rank
10747     of ARRAY, and a size corresponding to the shape of ARRAY with the
10748     DIM dimension removed.
10749
10750_Example_:
10751          program test_count
10752              integer, dimension(2,3) :: a, b
10753              logical, dimension(2,3) :: mask
10754              a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
10755              b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
10756              print '(3i3)', a(1,:)
10757              print '(3i3)', a(2,:)
10758              print *
10759              print '(3i3)', b(1,:)
10760              print '(3i3)', b(2,:)
10761              print *
10762              mask = a.ne.b
10763              print '(3l3)', mask(1,:)
10764              print '(3l3)', mask(2,:)
10765              print *
10766              print '(3i3)', count(mask)
10767              print *
10768              print '(3i3)', count(mask, 1)
10769              print *
10770              print '(3i3)', count(mask, 2)
10771          end program test_count
10772
10773
10774File: gfortran.info,  Node: CPU_TIME,  Next: CSHIFT,  Prev: COUNT,  Up: Intrinsic Procedures
10775
107769.79 'CPU_TIME' -- CPU elapsed time in seconds
10777==============================================
10778
10779_Description_:
10780     Returns a 'REAL' value representing the elapsed CPU time in
10781     seconds.  This is useful for testing segments of code to determine
10782     execution time.
10783
10784     If a time source is available, time will be reported with
10785     microsecond resolution.  If no time source is available, TIME is
10786     set to '-1.0'.
10787
10788     Note that TIME may contain a, system dependent, arbitrary offset
10789     and may not start with '0.0'.  For 'CPU_TIME', the absolute value
10790     is meaningless, only differences between subsequent calls to this
10791     subroutine, as shown in the example below, should be used.
10792
10793_Standard_:
10794     Fortran 95 and later
10795
10796_Class_:
10797     Subroutine
10798
10799_Syntax_:
10800     'CALL CPU_TIME(TIME)'
10801
10802_Arguments_:
10803     TIME        The type shall be 'REAL' with 'INTENT(OUT)'.
10804
10805_Return value_:
10806     None
10807
10808_Example_:
10809          program test_cpu_time
10810              real :: start, finish
10811              call cpu_time(start)
10812                  ! put code to test here
10813              call cpu_time(finish)
10814              print '("Time = ",f6.3," seconds.")',finish-start
10815          end program test_cpu_time
10816
10817_See also_:
10818     *note SYSTEM_CLOCK::, *note DATE_AND_TIME::
10819
10820
10821File: gfortran.info,  Node: CSHIFT,  Next: CTIME,  Prev: CPU_TIME,  Up: Intrinsic Procedures
10822
108239.80 'CSHIFT' -- Circular shift elements of an array
10824====================================================
10825
10826_Description_:
10827     'CSHIFT(ARRAY, SHIFT [, DIM])' performs a circular shift on
10828     elements of ARRAY along the dimension of DIM.  If DIM is omitted it
10829     is taken to be '1'.  DIM is a scalar of type 'INTEGER' in the range
10830     of 1 \leq DIM \leq n) where n is the rank of ARRAY.  If the rank of
10831     ARRAY is one, then all elements of ARRAY are shifted by SHIFT
10832     places.  If rank is greater than one, then all complete rank one
10833     sections of ARRAY along the given dimension are shifted.  Elements
10834     shifted out one end of each rank one section are shifted back in
10835     the other end.
10836
10837_Standard_:
10838     Fortran 95 and later
10839
10840_Class_:
10841     Transformational function
10842
10843_Syntax_:
10844     'RESULT = CSHIFT(ARRAY, SHIFT [, DIM])'
10845
10846_Arguments_:
10847     ARRAY       Shall be an array of any type.
10848     SHIFT       The type shall be 'INTEGER'.
10849     DIM         The type shall be 'INTEGER'.
10850
10851_Return value_:
10852     Returns an array of same type and rank as the ARRAY argument.
10853
10854_Example_:
10855          program test_cshift
10856              integer, dimension(3,3) :: a
10857              a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
10858              print '(3i3)', a(1,:)
10859              print '(3i3)', a(2,:)
10860              print '(3i3)', a(3,:)
10861              a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
10862              print *
10863              print '(3i3)', a(1,:)
10864              print '(3i3)', a(2,:)
10865              print '(3i3)', a(3,:)
10866          end program test_cshift
10867
10868
10869File: gfortran.info,  Node: CTIME,  Next: DATE_AND_TIME,  Prev: CSHIFT,  Up: Intrinsic Procedures
10870
108719.81 'CTIME' -- Convert a time into a string
10872============================================
10873
10874_Description_:
10875     'CTIME' converts a system time value, such as returned by *note
10876     TIME8::, to a string.  The output will be of the form 'Sat Aug 19
10877     18:13:14 1995'.
10878
10879     This intrinsic is provided in both subroutine and function forms;
10880     however, only one form can be used in any given program unit.
10881
10882_Standard_:
10883     GNU extension
10884
10885_Class_:
10886     Subroutine, function
10887
10888_Syntax_:
10889     'CALL CTIME(TIME, RESULT)'.
10890     'RESULT = CTIME(TIME)'.
10891
10892_Arguments_:
10893     TIME        The type shall be of type 'INTEGER'.
10894     RESULT      The type shall be of type 'CHARACTER' and of
10895                 default kind.  It is an 'INTENT(OUT)' argument.
10896                 If the length of this variable is too short for
10897                 the time and date string to fit completely, it
10898                 will be blank on procedure return.
10899
10900_Return value_:
10901     The converted date and time as a string.
10902
10903_Example_:
10904          program test_ctime
10905              integer(8) :: i
10906              character(len=30) :: date
10907              i = time8()
10908
10909              ! Do something, main part of the program
10910
10911              call ctime(i,date)
10912              print *, 'Program was started on ', date
10913          end program test_ctime
10914
10915_See Also_:
10916     *note DATE_AND_TIME::, *note GMTIME::, *note LTIME::, *note TIME::,
10917     *note TIME8::
10918
10919
10920File: gfortran.info,  Node: DATE_AND_TIME,  Next: DBLE,  Prev: CTIME,  Up: Intrinsic Procedures
10921
109229.82 'DATE_AND_TIME' -- Date and time subroutine
10923================================================
10924
10925_Description_:
10926     'DATE_AND_TIME(DATE, TIME, ZONE, VALUES)' gets the corresponding
10927     date and time information from the real-time system clock.  DATE is
10928     'INTENT(OUT)' and has form ccyymmdd.  TIME is 'INTENT(OUT)' and has
10929     form hhmmss.sss.  ZONE is 'INTENT(OUT)' and has form (+-)hhmm,
10930     representing the difference with respect to Coordinated Universal
10931     Time (UTC). Unavailable time and date parameters return blanks.
10932
10933     VALUES is 'INTENT(OUT)' and provides the following:
10934
10935                 'VALUE(1)':            The year
10936                 'VALUE(2)':            The month
10937                 'VALUE(3)':            The day of the month
10938                 'VALUE(4)':            Time difference with UTC in
10939                                        minutes
10940                 'VALUE(5)':            The hour of the day
10941                 'VALUE(6)':            The minutes of the hour
10942                 'VALUE(7)':            The seconds of the minute
10943                 'VALUE(8)':            The milliseconds of the
10944                                        second
10945
10946_Standard_:
10947     Fortran 95 and later
10948
10949_Class_:
10950     Subroutine
10951
10952_Syntax_:
10953     'CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])'
10954
10955_Arguments_:
10956     DATE        (Optional) The type shall be 'CHARACTER(LEN=8)'
10957                 or larger, and of default kind.
10958     TIME        (Optional) The type shall be 'CHARACTER(LEN=10)'
10959                 or larger, and of default kind.
10960     ZONE        (Optional) The type shall be 'CHARACTER(LEN=5)'
10961                 or larger, and of default kind.
10962     VALUES      (Optional) The type shall be 'INTEGER(8)'.
10963
10964_Return value_:
10965     None
10966
10967_Example_:
10968          program test_time_and_date
10969              character(8)  :: date
10970              character(10) :: time
10971              character(5)  :: zone
10972              integer,dimension(8) :: values
10973              ! using keyword arguments
10974              call date_and_time(date,time,zone,values)
10975              call date_and_time(DATE=date,ZONE=zone)
10976              call date_and_time(TIME=time)
10977              call date_and_time(VALUES=values)
10978              print '(a,2x,a,2x,a)', date, time, zone
10979              print '(8i5)', values
10980          end program test_time_and_date
10981
10982_See also_:
10983     *note CPU_TIME::, *note SYSTEM_CLOCK::
10984
10985
10986File: gfortran.info,  Node: DBLE,  Next: DCMPLX,  Prev: DATE_AND_TIME,  Up: Intrinsic Procedures
10987
109889.83 'DBLE' -- Double conversion function
10989=========================================
10990
10991_Description_:
10992     'DBLE(A)' Converts A to double precision real type.
10993
10994_Standard_:
10995     Fortran 77 and later
10996
10997_Class_:
10998     Elemental function
10999
11000_Syntax_:
11001     'RESULT = DBLE(A)'
11002
11003_Arguments_:
11004     A           The type shall be 'INTEGER', 'REAL', or
11005                 'COMPLEX'.
11006
11007_Return value_:
11008     The return value is of type double precision real.
11009
11010_Example_:
11011          program test_dble
11012              real    :: x = 2.18
11013              integer :: i = 5
11014              complex :: z = (2.3,1.14)
11015              print *, dble(x), dble(i), dble(z)
11016          end program test_dble
11017
11018_See also_:
11019     *note REAL::
11020
11021
11022File: gfortran.info,  Node: DCMPLX,  Next: DIGITS,  Prev: DBLE,  Up: Intrinsic Procedures
11023
110249.84 'DCMPLX' -- Double complex conversion function
11025===================================================
11026
11027_Description_:
11028     'DCMPLX(X [,Y])' returns a double complex number where X is
11029     converted to the real component.  If Y is present it is converted
11030     to the imaginary component.  If Y is not present then the imaginary
11031     component is set to 0.0.  If X is complex then Y must not be
11032     present.
11033
11034_Standard_:
11035     GNU extension
11036
11037_Class_:
11038     Elemental function
11039
11040_Syntax_:
11041     'RESULT = DCMPLX(X [, Y])'
11042
11043_Arguments_:
11044     X           The type may be 'INTEGER', 'REAL', or 'COMPLEX'.
11045     Y           (Optional if X is not 'COMPLEX'.)  May be
11046                 'INTEGER' or 'REAL'.
11047
11048_Return value_:
11049     The return value is of type 'COMPLEX(8)'
11050
11051_Example_:
11052          program test_dcmplx
11053              integer :: i = 42
11054              real :: x = 3.14
11055              complex :: z
11056              z = cmplx(i, x)
11057              print *, dcmplx(i)
11058              print *, dcmplx(x)
11059              print *, dcmplx(z)
11060              print *, dcmplx(x,i)
11061          end program test_dcmplx
11062
11063
11064File: gfortran.info,  Node: DIGITS,  Next: DIM,  Prev: DCMPLX,  Up: Intrinsic Procedures
11065
110669.85 'DIGITS' -- Significant binary digits function
11067===================================================
11068
11069_Description_:
11070     'DIGITS(X)' returns the number of significant binary digits of the
11071     internal model representation of X.  For example, on a system using
11072     a 32-bit floating point representation, a default real number would
11073     likely return 24.
11074
11075_Standard_:
11076     Fortran 95 and later
11077
11078_Class_:
11079     Inquiry function
11080
11081_Syntax_:
11082     'RESULT = DIGITS(X)'
11083
11084_Arguments_:
11085     X           The type may be 'INTEGER' or 'REAL'.
11086
11087_Return value_:
11088     The return value is of type 'INTEGER'.
11089
11090_Example_:
11091          program test_digits
11092              integer :: i = 12345
11093              real :: x = 3.143
11094              real(8) :: y = 2.33
11095              print *, digits(i)
11096              print *, digits(x)
11097              print *, digits(y)
11098          end program test_digits
11099
11100
11101File: gfortran.info,  Node: DIM,  Next: DOT_PRODUCT,  Prev: DIGITS,  Up: Intrinsic Procedures
11102
111039.86 'DIM' -- Positive difference
11104=================================
11105
11106_Description_:
11107     'DIM(X,Y)' returns the difference 'X-Y' if the result is positive;
11108     otherwise returns zero.
11109
11110_Standard_:
11111     Fortran 77 and later
11112
11113_Class_:
11114     Elemental function
11115
11116_Syntax_:
11117     'RESULT = DIM(X, Y)'
11118
11119_Arguments_:
11120     X           The type shall be 'INTEGER' or 'REAL'
11121     Y           The type shall be the same type and kind as X.
11122
11123_Return value_:
11124     The return value is of type 'INTEGER' or 'REAL'.
11125
11126_Example_:
11127          program test_dim
11128              integer :: i
11129              real(8) :: x
11130              i = dim(4, 15)
11131              x = dim(4.345_8, 2.111_8)
11132              print *, i
11133              print *, x
11134          end program test_dim
11135
11136_Specific names_:
11137     Name           Argument       Return type    Standard
11138     'DIM(X,Y)'     'REAL(4) X,    'REAL(4)'      Fortran 77 and
11139                    Y'                            later
11140     'IDIM(X,Y)'    'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
11141                    X, Y'                         later
11142     'DDIM(X,Y)'    'REAL(8) X,    'REAL(8)'      Fortran 77 and
11143                    Y'                            later
11144
11145
11146File: gfortran.info,  Node: DOT_PRODUCT,  Next: DPROD,  Prev: DIM,  Up: Intrinsic Procedures
11147
111489.87 'DOT_PRODUCT' -- Dot product function
11149==========================================
11150
11151_Description_:
11152     'DOT_PRODUCT(VECTOR_A, VECTOR_B)' computes the dot product
11153     multiplication of two vectors VECTOR_A and VECTOR_B.  The two
11154     vectors may be either numeric or logical and must be arrays of rank
11155     one and of equal size.  If the vectors are 'INTEGER' or 'REAL', the
11156     result is 'SUM(VECTOR_A*VECTOR_B)'.  If the vectors are 'COMPLEX',
11157     the result is 'SUM(CONJG(VECTOR_A)*VECTOR_B)'.  If the vectors are
11158     'LOGICAL', the result is 'ANY(VECTOR_A .AND. VECTOR_B)'.
11159
11160_Standard_:
11161     Fortran 95 and later
11162
11163_Class_:
11164     Transformational function
11165
11166_Syntax_:
11167     'RESULT = DOT_PRODUCT(VECTOR_A, VECTOR_B)'
11168
11169_Arguments_:
11170     VECTOR_A    The type shall be numeric or 'LOGICAL', rank 1.
11171     VECTOR_B    The type shall be numeric if VECTOR_A is of
11172                 numeric type or 'LOGICAL' if VECTOR_A is of type
11173                 'LOGICAL'.  VECTOR_B shall be a rank-one array.
11174
11175_Return value_:
11176     If the arguments are numeric, the return value is a scalar of
11177     numeric type, 'INTEGER', 'REAL', or 'COMPLEX'.  If the arguments
11178     are 'LOGICAL', the return value is '.TRUE.' or '.FALSE.'.
11179
11180_Example_:
11181          program test_dot_prod
11182              integer, dimension(3) :: a, b
11183              a = (/ 1, 2, 3 /)
11184              b = (/ 4, 5, 6 /)
11185              print '(3i3)', a
11186              print *
11187              print '(3i3)', b
11188              print *
11189              print *, dot_product(a,b)
11190          end program test_dot_prod
11191
11192
11193File: gfortran.info,  Node: DPROD,  Next: DREAL,  Prev: DOT_PRODUCT,  Up: Intrinsic Procedures
11194
111959.88 'DPROD' -- Double product function
11196=======================================
11197
11198_Description_:
11199     'DPROD(X,Y)' returns the product 'X*Y'.
11200
11201_Standard_:
11202     Fortran 77 and later
11203
11204_Class_:
11205     Elemental function
11206
11207_Syntax_:
11208     'RESULT = DPROD(X, Y)'
11209
11210_Arguments_:
11211     X           The type shall be 'REAL'.
11212     Y           The type shall be 'REAL'.
11213
11214_Return value_:
11215     The return value is of type 'REAL(8)'.
11216
11217_Example_:
11218          program test_dprod
11219              real :: x = 5.2
11220              real :: y = 2.3
11221              real(8) :: d
11222              d = dprod(x,y)
11223              print *, d
11224          end program test_dprod
11225
11226_Specific names_:
11227     Name           Argument       Return type    Standard
11228     'DPROD(X,Y)'   'REAL(4) X,    'REAL(8)'      Fortran 77 and
11229                    Y'                            later
11230
11231
11232File: gfortran.info,  Node: DREAL,  Next: DSHIFTL,  Prev: DPROD,  Up: Intrinsic Procedures
11233
112349.89 'DREAL' -- Double real part function
11235=========================================
11236
11237_Description_:
11238     'DREAL(Z)' returns the real part of complex variable Z.
11239
11240_Standard_:
11241     GNU extension
11242
11243_Class_:
11244     Elemental function
11245
11246_Syntax_:
11247     'RESULT = DREAL(A)'
11248
11249_Arguments_:
11250     A           The type shall be 'COMPLEX(8)'.
11251
11252_Return value_:
11253     The return value is of type 'REAL(8)'.
11254
11255_Example_:
11256          program test_dreal
11257              complex(8) :: z = (1.3_8,7.2_8)
11258              print *, dreal(z)
11259          end program test_dreal
11260
11261_See also_:
11262     *note AIMAG::
11263
11264
11265File: gfortran.info,  Node: DSHIFTL,  Next: DSHIFTR,  Prev: DREAL,  Up: Intrinsic Procedures
11266
112679.90 'DSHIFTL' -- Combined left shift
11268=====================================
11269
11270_Description_:
11271     'DSHIFTL(I, J, SHIFT)' combines bits of I and J.  The rightmost
11272     SHIFT bits of the result are the leftmost SHIFT bits of J, and the
11273     remaining bits are the rightmost bits of I.
11274
11275_Standard_:
11276     Fortran 2008 and later
11277
11278_Class_:
11279     Elemental function
11280
11281_Syntax_:
11282     'RESULT = DSHIFTL(I, J, SHIFT)'
11283
11284_Arguments_:
11285     I           Shall be of type 'INTEGER' or a BOZ constant.
11286     J           Shall be of type 'INTEGER' or a BOZ constant.
11287                 If both I and J have integer type, then they
11288                 shall have the same kind type parameter.  I and
11289                 J shall not both be BOZ constants.
11290     SHIFT       Shall be of type 'INTEGER'.  It shall be
11291                 nonnegative.  If I is not a BOZ constant, then
11292                 SHIFT shall be less than or equal to
11293                 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
11294                 than or equal to 'BIT_SIZE(J)'.
11295
11296_Return value_:
11297     If either I or J is a BOZ constant, it is first converted as if by
11298     the intrinsic function 'INT' to an integer type with the kind type
11299     parameter of the other.
11300
11301_See also_:
11302     *note DSHIFTR::
11303
11304
11305File: gfortran.info,  Node: DSHIFTR,  Next: DTIME,  Prev: DSHIFTL,  Up: Intrinsic Procedures
11306
113079.91 'DSHIFTR' -- Combined right shift
11308======================================
11309
11310_Description_:
11311     'DSHIFTR(I, J, SHIFT)' combines bits of I and J.  The leftmost
11312     SHIFT bits of the result are the rightmost SHIFT bits of I, and the
11313     remaining bits are the leftmost bits of J.
11314
11315_Standard_:
11316     Fortran 2008 and later
11317
11318_Class_:
11319     Elemental function
11320
11321_Syntax_:
11322     'RESULT = DSHIFTR(I, J, SHIFT)'
11323
11324_Arguments_:
11325     I           Shall be of type 'INTEGER' or a BOZ constant.
11326     J           Shall be of type 'INTEGER' or a BOZ constant.
11327                 If both I and J have integer type, then they
11328                 shall have the same kind type parameter.  I and
11329                 J shall not both be BOZ constants.
11330     SHIFT       Shall be of type 'INTEGER'.  It shall be
11331                 nonnegative.  If I is not a BOZ constant, then
11332                 SHIFT shall be less than or equal to
11333                 'BIT_SIZE(I)'; otherwise, SHIFT shall be less
11334                 than or equal to 'BIT_SIZE(J)'.
11335
11336_Return value_:
11337     If either I or J is a BOZ constant, it is first converted as if by
11338     the intrinsic function 'INT' to an integer type with the kind type
11339     parameter of the other.
11340
11341_See also_:
11342     *note DSHIFTL::
11343
11344
11345File: gfortran.info,  Node: DTIME,  Next: EOSHIFT,  Prev: DSHIFTR,  Up: Intrinsic Procedures
11346
113479.92 'DTIME' -- Execution time subroutine (or function)
11348=======================================================
11349
11350_Description_:
11351     'DTIME(VALUES, TIME)' initially returns the number of seconds of
11352     runtime since the start of the process's execution in TIME.  VALUES
11353     returns the user and system components of this time in 'VALUES(1)'
11354     and 'VALUES(2)' respectively.  TIME is equal to 'VALUES(1) +
11355     VALUES(2)'.
11356
11357     Subsequent invocations of 'DTIME' return values accumulated since
11358     the previous invocation.
11359
11360     On some systems, the underlying timings are represented using types
11361     with sufficiently small limits that overflows (wrap around) are
11362     possible, such as 32-bit types.  Therefore, the values returned by
11363     this intrinsic might be, or become, negative, or numerically less
11364     than previous values, during a single run of the compiled program.
11365
11366     Please note, that this implementation is thread safe if used within
11367     OpenMP directives, i.e., its state will be consistent while called
11368     from multiple threads.  However, if 'DTIME' is called from multiple
11369     threads, the result is still the time since the last invocation.
11370     This may not give the intended results.  If possible, use
11371     'CPU_TIME' instead.
11372
11373     This intrinsic is provided in both subroutine and function forms;
11374     however, only one form can be used in any given program unit.
11375
11376     VALUES and TIME are 'INTENT(OUT)' and provide the following:
11377
11378                 'VALUES(1)':           User time in seconds.
11379                 'VALUES(2)':           System time in seconds.
11380                 'TIME':                Run time since start in
11381                                        seconds.
11382
11383_Standard_:
11384     GNU extension
11385
11386_Class_:
11387     Subroutine, function
11388
11389_Syntax_:
11390     'CALL DTIME(VALUES, TIME)'.
11391     'TIME = DTIME(VALUES)', (not recommended).
11392
11393_Arguments_:
11394     VALUES      The type shall be 'REAL(4), DIMENSION(2)'.
11395     TIME        The type shall be 'REAL(4)'.
11396
11397_Return value_:
11398     Elapsed time in seconds since the last invocation or since the
11399     start of program execution if not called before.
11400
11401_Example_:
11402          program test_dtime
11403              integer(8) :: i, j
11404              real, dimension(2) :: tarray
11405              real :: result
11406              call dtime(tarray, result)
11407              print *, result
11408              print *, tarray(1)
11409              print *, tarray(2)
11410              do i=1,100000000    ! Just a delay
11411                  j = i * i - i
11412              end do
11413              call dtime(tarray, result)
11414              print *, result
11415              print *, tarray(1)
11416              print *, tarray(2)
11417          end program test_dtime
11418
11419_See also_:
11420     *note CPU_TIME::
11421
11422
11423File: gfortran.info,  Node: EOSHIFT,  Next: EPSILON,  Prev: DTIME,  Up: Intrinsic Procedures
11424
114259.93 'EOSHIFT' -- End-off shift elements of an array
11426====================================================
11427
11428_Description_:
11429     'EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])' performs an end-off shift
11430     on elements of ARRAY along the dimension of DIM.  If DIM is omitted
11431     it is taken to be '1'.  DIM is a scalar of type 'INTEGER' in the
11432     range of 1 \leq DIM \leq n) where n is the rank of ARRAY.  If the
11433     rank of ARRAY is one, then all elements of ARRAY are shifted by
11434     SHIFT places.  If rank is greater than one, then all complete rank
11435     one sections of ARRAY along the given dimension are shifted.
11436     Elements shifted out one end of each rank one section are dropped.
11437     If BOUNDARY is present then the corresponding value of from
11438     BOUNDARY is copied back in the other end.  If BOUNDARY is not
11439     present then the following are copied in depending on the type of
11440     ARRAY.
11441
11442     _Array      _Boundary Value_
11443     Type_
11444     Numeric     0 of the type and kind of ARRAY.
11445     Logical     '.FALSE.'.
11446     Character(LEN)LEN blanks.
11447
11448_Standard_:
11449     Fortran 95 and later
11450
11451_Class_:
11452     Transformational function
11453
11454_Syntax_:
11455     'RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])'
11456
11457_Arguments_:
11458     ARRAY       May be any type, not scalar.
11459     SHIFT       The type shall be 'INTEGER'.
11460     BOUNDARY    Same type as ARRAY.
11461     DIM         The type shall be 'INTEGER'.
11462
11463_Return value_:
11464     Returns an array of same type and rank as the ARRAY argument.
11465
11466_Example_:
11467          program test_eoshift
11468              integer, dimension(3,3) :: a
11469              a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
11470              print '(3i3)', a(1,:)
11471              print '(3i3)', a(2,:)
11472              print '(3i3)', a(3,:)
11473              a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
11474              print *
11475              print '(3i3)', a(1,:)
11476              print '(3i3)', a(2,:)
11477              print '(3i3)', a(3,:)
11478          end program test_eoshift
11479
11480
11481File: gfortran.info,  Node: EPSILON,  Next: ERF,  Prev: EOSHIFT,  Up: Intrinsic Procedures
11482
114839.94 'EPSILON' -- Epsilon function
11484==================================
11485
11486_Description_:
11487     'EPSILON(X)' returns the smallest number E of the same kind as X
11488     such that 1 + E > 1.
11489
11490_Standard_:
11491     Fortran 95 and later
11492
11493_Class_:
11494     Inquiry function
11495
11496_Syntax_:
11497     'RESULT = EPSILON(X)'
11498
11499_Arguments_:
11500     X           The type shall be 'REAL'.
11501
11502_Return value_:
11503     The return value is of same type as the argument.
11504
11505_Example_:
11506          program test_epsilon
11507              real :: x = 3.143
11508              real(8) :: y = 2.33
11509              print *, EPSILON(x)
11510              print *, EPSILON(y)
11511          end program test_epsilon
11512
11513
11514File: gfortran.info,  Node: ERF,  Next: ERFC,  Prev: EPSILON,  Up: Intrinsic Procedures
11515
115169.95 'ERF' -- Error function
11517============================
11518
11519_Description_:
11520     'ERF(X)' computes the error function of X.
11521
11522_Standard_:
11523     Fortran 2008 and later
11524
11525_Class_:
11526     Elemental function
11527
11528_Syntax_:
11529     'RESULT = ERF(X)'
11530
11531_Arguments_:
11532     X           The type shall be 'REAL'.
11533
11534_Return value_:
11535     The return value is of type 'REAL', of the same kind as X and lies
11536     in the range -1 \leq erf (x) \leq 1 .
11537
11538_Example_:
11539          program test_erf
11540            real(8) :: x = 0.17_8
11541            x = erf(x)
11542          end program test_erf
11543
11544_Specific names_:
11545     Name           Argument       Return type    Standard
11546     'DERF(X)'      'REAL(8) X'    'REAL(8)'      GNU extension
11547
11548
11549File: gfortran.info,  Node: ERFC,  Next: ERFC_SCALED,  Prev: ERF,  Up: Intrinsic Procedures
11550
115519.96 'ERFC' -- Error function
11552=============================
11553
11554_Description_:
11555     'ERFC(X)' computes the complementary error function of X.
11556
11557_Standard_:
11558     Fortran 2008 and later
11559
11560_Class_:
11561     Elemental function
11562
11563_Syntax_:
11564     'RESULT = ERFC(X)'
11565
11566_Arguments_:
11567     X           The type shall be 'REAL'.
11568
11569_Return value_:
11570     The return value is of type 'REAL' and of the same kind as X.  It
11571     lies in the range 0 \leq erfc (x) \leq 2 .
11572
11573_Example_:
11574          program test_erfc
11575            real(8) :: x = 0.17_8
11576            x = erfc(x)
11577          end program test_erfc
11578
11579_Specific names_:
11580     Name           Argument       Return type    Standard
11581     'DERFC(X)'     'REAL(8) X'    'REAL(8)'      GNU extension
11582
11583
11584File: gfortran.info,  Node: ERFC_SCALED,  Next: ETIME,  Prev: ERFC,  Up: Intrinsic Procedures
11585
115869.97 'ERFC_SCALED' -- Error function
11587====================================
11588
11589_Description_:
11590     'ERFC_SCALED(X)' computes the exponentially-scaled complementary
11591     error function of X.
11592
11593_Standard_:
11594     Fortran 2008 and later
11595
11596_Class_:
11597     Elemental function
11598
11599_Syntax_:
11600     'RESULT = ERFC_SCALED(X)'
11601
11602_Arguments_:
11603     X           The type shall be 'REAL'.
11604
11605_Return value_:
11606     The return value is of type 'REAL' and of the same kind as X.
11607
11608_Example_:
11609          program test_erfc_scaled
11610            real(8) :: x = 0.17_8
11611            x = erfc_scaled(x)
11612          end program test_erfc_scaled
11613
11614
11615File: gfortran.info,  Node: ETIME,  Next: EVENT_QUERY,  Prev: ERFC_SCALED,  Up: Intrinsic Procedures
11616
116179.98 'ETIME' -- Execution time subroutine (or function)
11618=======================================================
11619
11620_Description_:
11621     'ETIME(VALUES, TIME)' returns the number of seconds of runtime
11622     since the start of the process's execution in TIME.  VALUES returns
11623     the user and system components of this time in 'VALUES(1)' and
11624     'VALUES(2)' respectively.  TIME is equal to 'VALUES(1) +
11625     VALUES(2)'.
11626
11627     On some systems, the underlying timings are represented using types
11628     with sufficiently small limits that overflows (wrap around) are
11629     possible, such as 32-bit types.  Therefore, the values returned by
11630     this intrinsic might be, or become, negative, or numerically less
11631     than previous values, during a single run of the compiled program.
11632
11633     This intrinsic is provided in both subroutine and function forms;
11634     however, only one form can be used in any given program unit.
11635
11636     VALUES and TIME are 'INTENT(OUT)' and provide the following:
11637
11638                 'VALUES(1)':           User time in seconds.
11639                 'VALUES(2)':           System time in seconds.
11640                 'TIME':                Run time since start in seconds.
11641
11642_Standard_:
11643     GNU extension
11644
11645_Class_:
11646     Subroutine, function
11647
11648_Syntax_:
11649     'CALL ETIME(VALUES, TIME)'.
11650     'TIME = ETIME(VALUES)', (not recommended).
11651
11652_Arguments_:
11653     VALUES      The type shall be 'REAL(4), DIMENSION(2)'.
11654     TIME        The type shall be 'REAL(4)'.
11655
11656_Return value_:
11657     Elapsed time in seconds since the start of program execution.
11658
11659_Example_:
11660          program test_etime
11661              integer(8) :: i, j
11662              real, dimension(2) :: tarray
11663              real :: result
11664              call ETIME(tarray, result)
11665              print *, result
11666              print *, tarray(1)
11667              print *, tarray(2)
11668              do i=1,100000000    ! Just a delay
11669                  j = i * i - i
11670              end do
11671              call ETIME(tarray, result)
11672              print *, result
11673              print *, tarray(1)
11674              print *, tarray(2)
11675          end program test_etime
11676
11677_See also_:
11678     *note CPU_TIME::
11679
11680
11681File: gfortran.info,  Node: EVENT_QUERY,  Next: EXECUTE_COMMAND_LINE,  Prev: ETIME,  Up: Intrinsic Procedures
11682
116839.99 'EVENT_QUERY' -- Query whether a coarray event has occurred
11684================================================================
11685
11686_Description_:
11687     'EVENT_QUERY' assignes the number of events to COUNT which have
11688     been posted to the EVENT variable and not yet been removed by
11689     calling 'EVENT WAIT'.  When STAT is present and the invocation was
11690     successful, it is assigned the value 0.  If it is present and the
11691     invocation has failed, it is assigned a positive value and COUNT is
11692     assigned the value -1.
11693
11694_Standard_:
11695     TS 18508 or later
11696
11697_Class_:
11698     subroutine
11699
11700_Syntax_:
11701     'CALL EVENT_QUERY (EVENT, COUNT [, STAT])'
11702
11703_Arguments_:
11704     EVENT       (intent(IN)) Scalar of type 'EVENT_TYPE',
11705                 defined in 'ISO_FORTRAN_ENV'; shall not be
11706                 coindexed.
11707     COUNT       (intent(out))Scalar integer with at least the
11708                 precision of default integer.
11709     STAT        (optional) Scalar default-kind integer variable.
11710
11711_Example_:
11712          program atomic
11713            use iso_fortran_env
11714            implicit none
11715            type(event_type) :: event_value_has_been_set[*]
11716            integer :: cnt
11717            if (this_image() == 1) then
11718              call event_query (event_value_has_been_set, cnt)
11719              if (cnt > 0) write(*,*) "Value has been set"
11720            elseif (this_image() == 2) then
11721              event post (event_value_has_been_set[1])
11722            end if
11723          end program atomic
11724
11725
11726File: gfortran.info,  Node: EXECUTE_COMMAND_LINE,  Next: EXIT,  Prev: EVENT_QUERY,  Up: Intrinsic Procedures
11727
117289.100 'EXECUTE_COMMAND_LINE' -- Execute a shell command
11729=======================================================
11730
11731_Description_:
11732     'EXECUTE_COMMAND_LINE' runs a shell command, synchronously or
11733     asynchronously.
11734
11735     The 'COMMAND' argument is passed to the shell and executed (The
11736     shell is 'sh' on Unix systems, and 'cmd.exe' on Windows.).  If
11737     'WAIT' is present and has the value false, the execution of the
11738     command is asynchronous if the system supports it; otherwise, the
11739     command is executed synchronously using the C library's 'system'
11740     call.
11741
11742     The three last arguments allow the user to get status information.
11743     After synchronous execution, 'EXITSTAT' contains the integer exit
11744     code of the command, as returned by 'system'.  'CMDSTAT' is set to
11745     zero if the command line was executed (whatever its exit status
11746     was).  'CMDMSG' is assigned an error message if an error has
11747     occurred.
11748
11749     Note that the 'system' function need not be thread-safe.  It is the
11750     responsibility of the user to ensure that 'system' is not called
11751     concurrently.
11752
11753     For asynchronous execution on supported targets, the POSIX
11754     'posix_spawn' or 'fork' functions are used.  Also, a signal handler
11755     for the 'SIGCHLD' signal is installed.
11756
11757_Standard_:
11758     Fortran 2008 and later
11759
11760_Class_:
11761     Subroutine
11762
11763_Syntax_:
11764     'CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT,
11765     CMDMSG ])'
11766
11767_Arguments_:
11768     COMMAND     Shall be a default 'CHARACTER' scalar.
11769     WAIT        (Optional) Shall be a default 'LOGICAL' scalar.
11770     EXITSTAT    (Optional) Shall be an 'INTEGER' of the default
11771                 kind.
11772     CMDSTAT     (Optional) Shall be an 'INTEGER' of the default
11773                 kind.
11774     CMDMSG      (Optional) Shall be an 'CHARACTER' scalar of the
11775                 default kind.
11776
11777_Example_:
11778          program test_exec
11779            integer :: i
11780
11781            call execute_command_line ("external_prog.exe", exitstat=i)
11782            print *, "Exit status of external_prog.exe was ", i
11783
11784            call execute_command_line ("reindex_files.exe", wait=.false.)
11785            print *, "Now reindexing files in the background"
11786
11787          end program test_exec
11788
11789_Note_:
11790
11791     Because this intrinsic is implemented in terms of the 'system'
11792     function call, its behavior with respect to signaling is processor
11793     dependent.  In particular, on POSIX-compliant systems, the SIGINT
11794     and SIGQUIT signals will be ignored, and the SIGCHLD will be
11795     blocked.  As such, if the parent process is terminated, the child
11796     process might not be terminated alongside.
11797
11798_See also_:
11799     *note SYSTEM::
11800
11801
11802File: gfortran.info,  Node: EXIT,  Next: EXP,  Prev: EXECUTE_COMMAND_LINE,  Up: Intrinsic Procedures
11803
118049.101 'EXIT' -- Exit the program with status.
11805=============================================
11806
11807_Description_:
11808     'EXIT' causes immediate termination of the program with status.  If
11809     status is omitted it returns the canonical _success_ for the
11810     system.  All Fortran I/O units are closed.
11811
11812_Standard_:
11813     GNU extension
11814
11815_Class_:
11816     Subroutine
11817
11818_Syntax_:
11819     'CALL EXIT([STATUS])'
11820
11821_Arguments_:
11822     STATUS      Shall be an 'INTEGER' of the default kind.
11823
11824_Return value_:
11825     'STATUS' is passed to the parent process on exit.
11826
11827_Example_:
11828          program test_exit
11829            integer :: STATUS = 0
11830            print *, 'This program is going to exit.'
11831            call EXIT(STATUS)
11832          end program test_exit
11833
11834_See also_:
11835     *note ABORT::, *note KILL::
11836
11837
11838File: gfortran.info,  Node: EXP,  Next: EXPONENT,  Prev: EXIT,  Up: Intrinsic Procedures
11839
118409.102 'EXP' -- Exponential function
11841===================================
11842
11843_Description_:
11844     'EXP(X)' computes the base e exponential of X.
11845
11846_Standard_:
11847     Fortran 77 and later, has overloads that are GNU extensions
11848
11849_Class_:
11850     Elemental function
11851
11852_Syntax_:
11853     'RESULT = EXP(X)'
11854
11855_Arguments_:
11856     X           The type shall be 'REAL' or 'COMPLEX'.
11857
11858_Return value_:
11859     The return value has same type and kind as X.
11860
11861_Example_:
11862          program test_exp
11863            real :: x = 1.0
11864            x = exp(x)
11865          end program test_exp
11866
11867_Specific names_:
11868     Name           Argument       Return type    Standard
11869     'EXP(X)'       'REAL(4) X'    'REAL(4)'      Fortran 77 and
11870                                                  later
11871     'DEXP(X)'      'REAL(8) X'    'REAL(8)'      Fortran 77 and
11872                                                  later
11873     'CEXP(X)'      'COMPLEX(4)    'COMPLEX(4)'   Fortran 77 and
11874                    X'                            later
11875     'ZEXP(X)'      'COMPLEX(8)    'COMPLEX(8)'   GNU extension
11876                    X'
11877     'CDEXP(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
11878                    X'
11879
11880
11881File: gfortran.info,  Node: EXPONENT,  Next: EXTENDS_TYPE_OF,  Prev: EXP,  Up: Intrinsic Procedures
11882
118839.103 'EXPONENT' -- Exponent function
11884=====================================
11885
11886_Description_:
11887     'EXPONENT(X)' returns the value of the exponent part of X.  If X is
11888     zero the value returned is zero.
11889
11890_Standard_:
11891     Fortran 95 and later
11892
11893_Class_:
11894     Elemental function
11895
11896_Syntax_:
11897     'RESULT = EXPONENT(X)'
11898
11899_Arguments_:
11900     X           The type shall be 'REAL'.
11901
11902_Return value_:
11903     The return value is of type default 'INTEGER'.
11904
11905_Example_:
11906          program test_exponent
11907            real :: x = 1.0
11908            integer :: i
11909            i = exponent(x)
11910            print *, i
11911            print *, exponent(0.0)
11912          end program test_exponent
11913
11914
11915File: gfortran.info,  Node: EXTENDS_TYPE_OF,  Next: FDATE,  Prev: EXPONENT,  Up: Intrinsic Procedures
11916
119179.104 'EXTENDS_TYPE_OF' -- Query dynamic type for extension
11918===========================================================
11919
11920_Description_:
11921     Query dynamic type for extension.
11922
11923_Standard_:
11924     Fortran 2003 and later
11925
11926_Class_:
11927     Inquiry function
11928
11929_Syntax_:
11930     'RESULT = EXTENDS_TYPE_OF(A, MOLD)'
11931
11932_Arguments_:
11933     A           Shall be an object of extensible declared type
11934                 or unlimited polymorphic.
11935     MOLD        Shall be an object of extensible declared type
11936                 or unlimited polymorphic.
11937
11938_Return value_:
11939     The return value is a scalar of type default logical.  It is true
11940     if and only if the dynamic type of A is an extension type of the
11941     dynamic type of MOLD.
11942
11943_See also_:
11944     *note SAME_TYPE_AS::
11945
11946
11947File: gfortran.info,  Node: FDATE,  Next: FGET,  Prev: EXTENDS_TYPE_OF,  Up: Intrinsic Procedures
11948
119499.105 'FDATE' -- Get the current time as a string
11950=================================================
11951
11952_Description_:
11953     'FDATE(DATE)' returns the current date (using the same format as
11954     *note CTIME::) in DATE.  It is equivalent to 'CALL CTIME(DATE,
11955     TIME())'.
11956
11957     This intrinsic is provided in both subroutine and function forms;
11958     however, only one form can be used in any given program unit.
11959
11960_Standard_:
11961     GNU extension
11962
11963_Class_:
11964     Subroutine, function
11965
11966_Syntax_:
11967     'CALL FDATE(DATE)'.
11968     'DATE = FDATE()'.
11969
11970_Arguments_:
11971     DATE        The type shall be of type 'CHARACTER' of the
11972                 default kind.  It is an 'INTENT(OUT)' argument.
11973                 If the length of this variable is too short for
11974                 the date and time string to fit completely, it
11975                 will be blank on procedure return.
11976
11977_Return value_:
11978     The current date and time as a string.
11979
11980_Example_:
11981          program test_fdate
11982              integer(8) :: i, j
11983              character(len=30) :: date
11984              call fdate(date)
11985              print *, 'Program started on ', date
11986              do i = 1, 100000000 ! Just a delay
11987                  j = i * i - i
11988              end do
11989              call fdate(date)
11990              print *, 'Program ended on ', date
11991          end program test_fdate
11992
11993_See also_:
11994     *note DATE_AND_TIME::, *note CTIME::
11995
11996
11997File: gfortran.info,  Node: FGET,  Next: FGETC,  Prev: FDATE,  Up: Intrinsic Procedures
11998
119999.106 'FGET' -- Read a single character in stream mode from stdin
12000=================================================================
12001
12002_Description_:
12003     Read a single character in stream mode from stdin by bypassing
12004     normal formatted output.  Stream I/O should not be mixed with
12005     normal record-oriented (formatted or unformatted) I/O on the same
12006     unit; the results are unpredictable.
12007
12008     This intrinsic is provided in both subroutine and function forms;
12009     however, only one form can be used in any given program unit.
12010
12011     Note that the 'FGET' intrinsic is provided for backwards
12012     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
12013     Stream facility.  Programmers should consider the use of new stream
12014     IO feature in new code for future portability.  See also *note
12015     Fortran 2003 status::.
12016
12017_Standard_:
12018     GNU extension
12019
12020_Class_:
12021     Subroutine, function
12022
12023_Syntax_:
12024     'CALL FGET(C [, STATUS])'
12025     'STATUS = FGET(C)'
12026
12027_Arguments_:
12028     C           The type shall be 'CHARACTER' and of default
12029                 kind.
12030     STATUS      (Optional) status flag of type 'INTEGER'.
12031                 Returns 0 on success, -1 on end-of-file, and a
12032                 system specific positive error code otherwise.
12033
12034_Example_:
12035          PROGRAM test_fget
12036            INTEGER, PARAMETER :: strlen = 100
12037            INTEGER :: status, i = 1
12038            CHARACTER(len=strlen) :: str = ""
12039
12040            WRITE (*,*) 'Enter text:'
12041            DO
12042              CALL fget(str(i:i), status)
12043              if (status /= 0 .OR. i > strlen) exit
12044              i = i + 1
12045            END DO
12046            WRITE (*,*) TRIM(str)
12047          END PROGRAM
12048
12049_See also_:
12050     *note FGETC::, *note FPUT::, *note FPUTC::
12051
12052
12053File: gfortran.info,  Node: FGETC,  Next: FINDLOC,  Prev: FGET,  Up: Intrinsic Procedures
12054
120559.107 'FGETC' -- Read a single character in stream mode
12056=======================================================
12057
12058_Description_:
12059     Read a single character in stream mode by bypassing normal
12060     formatted output.  Stream I/O should not be mixed with normal
12061     record-oriented (formatted or unformatted) I/O on the same unit;
12062     the results are unpredictable.
12063
12064     This intrinsic is provided in both subroutine and function forms;
12065     however, only one form can be used in any given program unit.
12066
12067     Note that the 'FGET' intrinsic is provided for backwards
12068     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
12069     Stream facility.  Programmers should consider the use of new stream
12070     IO feature in new code for future portability.  See also *note
12071     Fortran 2003 status::.
12072
12073_Standard_:
12074     GNU extension
12075
12076_Class_:
12077     Subroutine, function
12078
12079_Syntax_:
12080     'CALL FGETC(UNIT, C [, STATUS])'
12081     'STATUS = FGETC(UNIT, C)'
12082
12083_Arguments_:
12084     UNIT        The type shall be 'INTEGER'.
12085     C           The type shall be 'CHARACTER' and of default
12086                 kind.
12087     STATUS      (Optional) status flag of type 'INTEGER'.
12088                 Returns 0 on success, -1 on end-of-file and a
12089                 system specific positive error code otherwise.
12090
12091_Example_:
12092          PROGRAM test_fgetc
12093            INTEGER :: fd = 42, status
12094            CHARACTER :: c
12095
12096            OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD")
12097            DO
12098              CALL fgetc(fd, c, status)
12099              IF (status /= 0) EXIT
12100              call fput(c)
12101            END DO
12102            CLOSE(UNIT=fd)
12103          END PROGRAM
12104
12105_See also_:
12106     *note FGET::, *note FPUT::, *note FPUTC::
12107
12108
12109File: gfortran.info,  Node: FINDLOC,  Next: FLOOR,  Prev: FGETC,  Up: Intrinsic Procedures
12110
121119.108 'FINDLOC' -- Search an array for a value
12112==============================================
12113
12114_Description_:
12115     Determines the location of the element in the array with the value
12116     given in the VALUE argument, or, if the DIM argument is supplied,
12117     determines the locations of the maximum element along each row of
12118     the array in the DIM direction.  If MASK is present, only the
12119     elements for which MASK is '.TRUE.' are considered.  If more than
12120     one element in the array has the value VALUE, the location returned
12121     is that of the first such element in array element order if the
12122     BACK is not present or if it is '.FALSE.'.  If BACK is true, the
12123     location returned is that of the last such element.  If the array
12124     has zero size, or all of the elements of MASK are '.FALSE.', then
12125     the result is an array of zeroes.  Similarly, if DIM is supplied
12126     and all of the elements of MASK along a given row are zero, the
12127     result value for that row is zero.
12128
12129_Standard_:
12130     Fortran 2008 and later.
12131
12132_Class_:
12133     Transformational function
12134
12135_Syntax_:
12136     'RESULT = FINDLOC(ARRAY, VALUE, DIM [, MASK] [,KIND]
12137     [,BACK])'
12138     'RESULT = FINDLOC(ARRAY, VALUE, [, MASK] [,KIND]
12139     [,BACK])'
12140
12141_Arguments_:
12142     ARRAY       Shall be an array of intrinsic type.
12143     VALUE       A scalar of intrinsic type which is in type
12144                 conformance with ARRAY.
12145     DIM         (Optional) Shall be a scalar of type 'INTEGER',
12146                 with a value between one and the rank of ARRAY,
12147                 inclusive.  It may not be an optional dummy
12148                 argument.
12149     KIND        (Optional) An 'INTEGER' initialization
12150                 expression indicating the kind parameter of the
12151                 result.
12152     BACK        (Optional) A scalar of type 'LOGICAL'.
12153
12154_Return value_:
12155     If DIM is absent, the result is a rank-one array with a length
12156     equal to the rank of ARRAY.  If DIM is present, the result is an
12157     array with a rank one less than the rank of ARRAY, and a size
12158     corresponding to the size of ARRAY with the DIM dimension removed.
12159     If DIM is present and ARRAY has a rank of one, the result is a
12160     scalar.  If the optional argument KIND is present, the result is an
12161     integer of kind KIND, otherwise it is of default kind.
12162
12163_See also_:
12164     *note MAXLOC::, *note MINLOC::
12165
12166
12167File: gfortran.info,  Node: FLOOR,  Next: FLUSH,  Prev: FINDLOC,  Up: Intrinsic Procedures
12168
121699.109 'FLOOR' -- Integer floor function
12170=======================================
12171
12172_Description_:
12173     'FLOOR(A)' returns the greatest integer less than or equal to X.
12174
12175_Standard_:
12176     Fortran 95 and later
12177
12178_Class_:
12179     Elemental function
12180
12181_Syntax_:
12182     'RESULT = FLOOR(A [, KIND])'
12183
12184_Arguments_:
12185     A           The type shall be 'REAL'.
12186     KIND        (Optional) An 'INTEGER' initialization
12187                 expression indicating the kind parameter of the
12188                 result.
12189
12190_Return value_:
12191     The return value is of type 'INTEGER(KIND)' if KIND is present and
12192     of default-kind 'INTEGER' otherwise.
12193
12194_Example_:
12195          program test_floor
12196              real :: x = 63.29
12197              real :: y = -63.59
12198              print *, floor(x) ! returns 63
12199              print *, floor(y) ! returns -64
12200          end program test_floor
12201
12202_See also_:
12203     *note CEILING::, *note NINT::
12204
12205
12206File: gfortran.info,  Node: FLUSH,  Next: FNUM,  Prev: FLOOR,  Up: Intrinsic Procedures
12207
122089.110 'FLUSH' -- Flush I/O unit(s)
12209==================================
12210
12211_Description_:
12212     Flushes Fortran unit(s) currently open for output.  Without the
12213     optional argument, all units are flushed, otherwise just the unit
12214     specified.
12215
12216_Standard_:
12217     GNU extension
12218
12219_Class_:
12220     Subroutine
12221
12222_Syntax_:
12223     'CALL FLUSH(UNIT)'
12224
12225_Arguments_:
12226     UNIT        (Optional) The type shall be 'INTEGER'.
12227
12228_Note_:
12229     Beginning with the Fortran 2003 standard, there is a 'FLUSH'
12230     statement that should be preferred over the 'FLUSH' intrinsic.
12231
12232     The 'FLUSH' intrinsic and the Fortran 2003 'FLUSH' statement have
12233     identical effect: they flush the runtime library's I/O buffer so
12234     that the data becomes visible to other processes.  This does not
12235     guarantee that the data is committed to disk.
12236
12237     On POSIX systems, you can request that all data is transferred to
12238     the storage device by calling the 'fsync' function, with the POSIX
12239     file descriptor of the I/O unit as argument (retrieved with GNU
12240     intrinsic 'FNUM').  The following example shows how:
12241
12242            ! Declare the interface for POSIX fsync function
12243            interface
12244              function fsync (fd) bind(c,name="fsync")
12245              use iso_c_binding, only: c_int
12246                integer(c_int), value :: fd
12247                integer(c_int) :: fsync
12248              end function fsync
12249            end interface
12250
12251            ! Variable declaration
12252            integer :: ret
12253
12254            ! Opening unit 10
12255            open (10,file="foo")
12256
12257            ! ...
12258            ! Perform I/O on unit 10
12259            ! ...
12260
12261            ! Flush and sync
12262            flush(10)
12263            ret = fsync(fnum(10))
12264
12265            ! Handle possible error
12266            if (ret /= 0) stop "Error calling FSYNC"
12267
12268
12269File: gfortran.info,  Node: FNUM,  Next: FPUT,  Prev: FLUSH,  Up: Intrinsic Procedures
12270
122719.111 'FNUM' -- File number function
12272====================================
12273
12274_Description_:
12275     'FNUM(UNIT)' returns the POSIX file descriptor number corresponding
12276     to the open Fortran I/O unit 'UNIT'.
12277
12278_Standard_:
12279     GNU extension
12280
12281_Class_:
12282     Function
12283
12284_Syntax_:
12285     'RESULT = FNUM(UNIT)'
12286
12287_Arguments_:
12288     UNIT        The type shall be 'INTEGER'.
12289
12290_Return value_:
12291     The return value is of type 'INTEGER'
12292
12293_Example_:
12294          program test_fnum
12295            integer :: i
12296            open (unit=10, status = "scratch")
12297            i = fnum(10)
12298            print *, i
12299            close (10)
12300          end program test_fnum
12301
12302
12303File: gfortran.info,  Node: FPUT,  Next: FPUTC,  Prev: FNUM,  Up: Intrinsic Procedures
12304
123059.112 'FPUT' -- Write a single character in stream mode to stdout
12306=================================================================
12307
12308_Description_:
12309     Write a single character in stream mode to stdout by bypassing
12310     normal formatted output.  Stream I/O should not be mixed with
12311     normal record-oriented (formatted or unformatted) I/O on the same
12312     unit; the results are unpredictable.
12313
12314     This intrinsic is provided in both subroutine and function forms;
12315     however, only one form can be used in any given program unit.
12316
12317     Note that the 'FGET' intrinsic is provided for backwards
12318     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
12319     Stream facility.  Programmers should consider the use of new stream
12320     IO feature in new code for future portability.  See also *note
12321     Fortran 2003 status::.
12322
12323_Standard_:
12324     GNU extension
12325
12326_Class_:
12327     Subroutine, function
12328
12329_Syntax_:
12330     'CALL FPUT(C [, STATUS])'
12331     'STATUS = FPUT(C)'
12332
12333_Arguments_:
12334     C           The type shall be 'CHARACTER' and of default
12335                 kind.
12336     STATUS      (Optional) status flag of type 'INTEGER'.
12337                 Returns 0 on success, -1 on end-of-file and a
12338                 system specific positive error code otherwise.
12339
12340_Example_:
12341          PROGRAM test_fput
12342            CHARACTER(len=10) :: str = "gfortran"
12343            INTEGER :: i
12344            DO i = 1, len_trim(str)
12345              CALL fput(str(i:i))
12346            END DO
12347          END PROGRAM
12348
12349_See also_:
12350     *note FPUTC::, *note FGET::, *note FGETC::
12351
12352
12353File: gfortran.info,  Node: FPUTC,  Next: FRACTION,  Prev: FPUT,  Up: Intrinsic Procedures
12354
123559.113 'FPUTC' -- Write a single character in stream mode
12356========================================================
12357
12358_Description_:
12359     Write a single character in stream mode by bypassing normal
12360     formatted output.  Stream I/O should not be mixed with normal
12361     record-oriented (formatted or unformatted) I/O on the same unit;
12362     the results are unpredictable.
12363
12364     This intrinsic is provided in both subroutine and function forms;
12365     however, only one form can be used in any given program unit.
12366
12367     Note that the 'FGET' intrinsic is provided for backwards
12368     compatibility with 'g77'.  GNU Fortran provides the Fortran 2003
12369     Stream facility.  Programmers should consider the use of new stream
12370     IO feature in new code for future portability.  See also *note
12371     Fortran 2003 status::.
12372
12373_Standard_:
12374     GNU extension
12375
12376_Class_:
12377     Subroutine, function
12378
12379_Syntax_:
12380     'CALL FPUTC(UNIT, C [, STATUS])'
12381     'STATUS = FPUTC(UNIT, C)'
12382
12383_Arguments_:
12384     UNIT        The type shall be 'INTEGER'.
12385     C           The type shall be 'CHARACTER' and of default
12386                 kind.
12387     STATUS      (Optional) status flag of type 'INTEGER'.
12388                 Returns 0 on success, -1 on end-of-file and a
12389                 system specific positive error code otherwise.
12390
12391_Example_:
12392          PROGRAM test_fputc
12393            CHARACTER(len=10) :: str = "gfortran"
12394            INTEGER :: fd = 42, i
12395
12396            OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
12397            DO i = 1, len_trim(str)
12398              CALL fputc(fd, str(i:i))
12399            END DO
12400            CLOSE(fd)
12401          END PROGRAM
12402
12403_See also_:
12404     *note FPUT::, *note FGET::, *note FGETC::
12405
12406
12407File: gfortran.info,  Node: FRACTION,  Next: FREE,  Prev: FPUTC,  Up: Intrinsic Procedures
12408
124099.114 'FRACTION' -- Fractional part of the model representation
12410===============================================================
12411
12412_Description_:
12413     'FRACTION(X)' returns the fractional part of the model
12414     representation of 'X'.
12415
12416_Standard_:
12417     Fortran 95 and later
12418
12419_Class_:
12420     Elemental function
12421
12422_Syntax_:
12423     'Y = FRACTION(X)'
12424
12425_Arguments_:
12426     X           The type of the argument shall be a 'REAL'.
12427
12428_Return value_:
12429     The return value is of the same type and kind as the argument.  The
12430     fractional part of the model representation of 'X' is returned; it
12431     is 'X * RADIX(X)**(-EXPONENT(X))'.
12432
12433_Example_:
12434          program test_fraction
12435            real :: x
12436            x = 178.1387e-4
12437            print *, fraction(x), x * radix(x)**(-exponent(x))
12438          end program test_fraction
12439
12440
12441File: gfortran.info,  Node: FREE,  Next: FSEEK,  Prev: FRACTION,  Up: Intrinsic Procedures
12442
124439.115 'FREE' -- Frees memory
12444============================
12445
12446_Description_:
12447     Frees memory previously allocated by 'MALLOC'.  The 'FREE'
12448     intrinsic is an extension intended to be used with Cray pointers,
12449     and is provided in GNU Fortran to allow user to compile legacy
12450     code.  For new code using Fortran 95 pointers, the memory
12451     de-allocation intrinsic is 'DEALLOCATE'.
12452
12453_Standard_:
12454     GNU extension
12455
12456_Class_:
12457     Subroutine
12458
12459_Syntax_:
12460     'CALL FREE(PTR)'
12461
12462_Arguments_:
12463     PTR         The type shall be 'INTEGER'.  It represents the
12464                 location of the memory that should be
12465                 de-allocated.
12466
12467_Return value_:
12468     None
12469
12470_Example_:
12471     See 'MALLOC' for an example.
12472
12473_See also_:
12474     *note MALLOC::
12475
12476
12477File: gfortran.info,  Node: FSEEK,  Next: FSTAT,  Prev: FREE,  Up: Intrinsic Procedures
12478
124799.116 'FSEEK' -- Low level file positioning subroutine
12480======================================================
12481
12482_Description_:
12483     Moves UNIT to the specified OFFSET.  If WHENCE is set to 0, the
12484     OFFSET is taken as an absolute value 'SEEK_SET', if set to 1,
12485     OFFSET is taken to be relative to the current position 'SEEK_CUR',
12486     and if set to 2 relative to the end of the file 'SEEK_END'.  On
12487     error, STATUS is set to a nonzero value.  If STATUS the seek fails
12488     silently.
12489
12490     This intrinsic routine is not fully backwards compatible with
12491     'g77'.  In 'g77', the 'FSEEK' takes a statement label instead of a
12492     STATUS variable.  If FSEEK is used in old code, change
12493            CALL FSEEK(UNIT, OFFSET, WHENCE, *label)
12494     to
12495            INTEGER :: status
12496            CALL FSEEK(UNIT, OFFSET, WHENCE, status)
12497            IF (status /= 0) GOTO label
12498
12499     Please note that GNU Fortran provides the Fortran 2003 Stream
12500     facility.  Programmers should consider the use of new stream IO
12501     feature in new code for future portability.  See also *note Fortran
12502     2003 status::.
12503
12504_Standard_:
12505     GNU extension
12506
12507_Class_:
12508     Subroutine
12509
12510_Syntax_:
12511     'CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])'
12512
12513_Arguments_:
12514     UNIT        Shall be a scalar of type 'INTEGER'.
12515     OFFSET      Shall be a scalar of type 'INTEGER'.
12516     WHENCE      Shall be a scalar of type 'INTEGER'.  Its value
12517                 shall be either 0, 1 or 2.
12518     STATUS      (Optional) shall be a scalar of type
12519                 'INTEGER(4)'.
12520
12521_Example_:
12522          PROGRAM test_fseek
12523            INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2
12524            INTEGER :: fd, offset, ierr
12525
12526            ierr   = 0
12527            offset = 5
12528            fd     = 10
12529
12530            OPEN(UNIT=fd, FILE="fseek.test")
12531            CALL FSEEK(fd, offset, SEEK_SET, ierr)  ! move to OFFSET
12532            print *, FTELL(fd), ierr
12533
12534            CALL FSEEK(fd, 0, SEEK_END, ierr)       ! move to end
12535            print *, FTELL(fd), ierr
12536
12537            CALL FSEEK(fd, 0, SEEK_SET, ierr)       ! move to beginning
12538            print *, FTELL(fd), ierr
12539
12540            CLOSE(UNIT=fd)
12541          END PROGRAM
12542
12543_See also_:
12544     *note FTELL::
12545
12546
12547File: gfortran.info,  Node: FSTAT,  Next: FTELL,  Prev: FSEEK,  Up: Intrinsic Procedures
12548
125499.117 'FSTAT' -- Get file status
12550================================
12551
12552_Description_:
12553     'FSTAT' is identical to *note STAT::, except that information about
12554     an already opened file is obtained.
12555
12556     The elements in 'VALUES' are the same as described by *note STAT::.
12557
12558     This intrinsic is provided in both subroutine and function forms;
12559     however, only one form can be used in any given program unit.
12560
12561_Standard_:
12562     GNU extension
12563
12564_Class_:
12565     Subroutine, function
12566
12567_Syntax_:
12568     'CALL FSTAT(UNIT, VALUES [, STATUS])'
12569     'STATUS = FSTAT(UNIT, VALUES)'
12570
12571_Arguments_:
12572     UNIT        An open I/O unit number of type 'INTEGER'.
12573     VALUES      The type shall be 'INTEGER(4), DIMENSION(13)'.
12574     STATUS      (Optional) status flag of type 'INTEGER(4)'.
12575                 Returns 0 on success and a system specific error
12576                 code otherwise.
12577
12578_Example_:
12579     See *note STAT:: for an example.
12580
12581_See also_:
12582     To stat a link: *note LSTAT::, to stat a file: *note STAT::
12583
12584
12585File: gfortran.info,  Node: FTELL,  Next: GAMMA,  Prev: FSTAT,  Up: Intrinsic Procedures
12586
125879.118 'FTELL' -- Current stream position
12588========================================
12589
12590_Description_:
12591     Retrieves the current position within an open file.
12592
12593     This intrinsic is provided in both subroutine and function forms;
12594     however, only one form can be used in any given program unit.
12595
12596_Standard_:
12597     GNU extension
12598
12599_Class_:
12600     Subroutine, function
12601
12602_Syntax_:
12603     'CALL FTELL(UNIT, OFFSET)'
12604     'OFFSET = FTELL(UNIT)'
12605
12606_Arguments_:
12607     OFFSET      Shall of type 'INTEGER'.
12608     UNIT        Shall of type 'INTEGER'.
12609
12610_Return value_:
12611     In either syntax, OFFSET is set to the current offset of unit
12612     number UNIT, or to -1 if the unit is not currently open.
12613
12614_Example_:
12615          PROGRAM test_ftell
12616            INTEGER :: i
12617            OPEN(10, FILE="temp.dat")
12618            CALL ftell(10,i)
12619            WRITE(*,*) i
12620          END PROGRAM
12621
12622_See also_:
12623     *note FSEEK::
12624
12625
12626File: gfortran.info,  Node: GAMMA,  Next: GERROR,  Prev: FTELL,  Up: Intrinsic Procedures
12627
126289.119 'GAMMA' -- Gamma function
12629===============================
12630
12631_Description_:
12632     'GAMMA(X)' computes Gamma (\Gamma) of X.  For positive, integer
12633     values of X the Gamma function simplifies to the factorial function
12634     \Gamma(x)=(x-1)!.
12635
12636_Standard_:
12637     Fortran 2008 and later
12638
12639_Class_:
12640     Elemental function
12641
12642_Syntax_:
12643     'X = GAMMA(X)'
12644
12645_Arguments_:
12646     X           Shall be of type 'REAL' and neither zero nor a
12647                 negative integer.
12648
12649_Return value_:
12650     The return value is of type 'REAL' of the same kind as X.
12651
12652_Example_:
12653          program test_gamma
12654            real :: x = 1.0
12655            x = gamma(x) ! returns 1.0
12656          end program test_gamma
12657
12658_Specific names_:
12659     Name           Argument       Return type    Standard
12660     'GAMMA(X)'     'REAL(4) X'    'REAL(4)'      GNU Extension
12661     'DGAMMA(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
12662
12663_See also_:
12664     Logarithm of the Gamma function: *note LOG_GAMMA::
12665
12666
12667File: gfortran.info,  Node: GERROR,  Next: GETARG,  Prev: GAMMA,  Up: Intrinsic Procedures
12668
126699.120 'GERROR' -- Get last system error message
12670===============================================
12671
12672_Description_:
12673     Returns the system error message corresponding to the last system
12674     error.  This resembles the functionality of 'strerror(3)' in C.
12675
12676_Standard_:
12677     GNU extension
12678
12679_Class_:
12680     Subroutine
12681
12682_Syntax_:
12683     'CALL GERROR(RESULT)'
12684
12685_Arguments_:
12686     RESULT      Shall of type 'CHARACTER' and of default
12687
12688_Example_:
12689          PROGRAM test_gerror
12690            CHARACTER(len=100) :: msg
12691            CALL gerror(msg)
12692            WRITE(*,*) msg
12693          END PROGRAM
12694
12695_See also_:
12696     *note IERRNO::, *note PERROR::
12697
12698
12699File: gfortran.info,  Node: GETARG,  Next: GET_COMMAND,  Prev: GERROR,  Up: Intrinsic Procedures
12700
127019.121 'GETARG' -- Get command line arguments
12702============================================
12703
12704_Description_:
12705     Retrieve the POS-th argument that was passed on the command line
12706     when the containing program was invoked.
12707
12708     This intrinsic routine is provided for backwards compatibility with
12709     GNU Fortran 77.  In new code, programmers should consider the use
12710     of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the
12711     Fortran 2003 standard.
12712
12713_Standard_:
12714     GNU extension
12715
12716_Class_:
12717     Subroutine
12718
12719_Syntax_:
12720     'CALL GETARG(POS, VALUE)'
12721
12722_Arguments_:
12723     POS         Shall be of type 'INTEGER' and not wider than
12724                 the default integer kind; POS \geq 0
12725     VALUE       Shall be of type 'CHARACTER' and of default
12726                 kind.
12727     VALUE       Shall be of type 'CHARACTER'.
12728
12729_Return value_:
12730     After 'GETARG' returns, the VALUE argument holds the POSth command
12731     line argument.  If VALUE cannot hold the argument, it is truncated
12732     to fit the length of VALUE.  If there are less than POS arguments
12733     specified at the command line, VALUE will be filled with blanks.
12734     If POS = 0, VALUE is set to the name of the program (on systems
12735     that support this feature).
12736
12737_Example_:
12738          PROGRAM test_getarg
12739            INTEGER :: i
12740            CHARACTER(len=32) :: arg
12741
12742            DO i = 1, iargc()
12743              CALL getarg(i, arg)
12744              WRITE (*,*) arg
12745            END DO
12746          END PROGRAM
12747
12748_See also_:
12749     GNU Fortran 77 compatibility function: *note IARGC::
12750
12751     Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note
12752     GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
12753
12754
12755File: gfortran.info,  Node: GET_COMMAND,  Next: GET_COMMAND_ARGUMENT,  Prev: GETARG,  Up: Intrinsic Procedures
12756
127579.122 'GET_COMMAND' -- Get the entire command line
12758==================================================
12759
12760_Description_:
12761     Retrieve the entire command line that was used to invoke the
12762     program.
12763
12764_Standard_:
12765     Fortran 2003 and later
12766
12767_Class_:
12768     Subroutine
12769
12770_Syntax_:
12771     'CALL GET_COMMAND([COMMAND, LENGTH, STATUS])'
12772
12773_Arguments_:
12774     COMMAND     (Optional) shall be of type 'CHARACTER' and of
12775                 default kind.
12776     LENGTH      (Optional) Shall be of type 'INTEGER' and of
12777                 default kind.
12778     STATUS      (Optional) Shall be of type 'INTEGER' and of
12779                 default kind.
12780
12781_Return value_:
12782     If COMMAND is present, stores the entire command line that was used
12783     to invoke the program in COMMAND.  If LENGTH is present, it is
12784     assigned the length of the command line.  If STATUS is present, it
12785     is assigned 0 upon success of the command, -1 if COMMAND is too
12786     short to store the command line, or a positive value in case of an
12787     error.
12788
12789_Example_:
12790          PROGRAM test_get_command
12791            CHARACTER(len=255) :: cmd
12792            CALL get_command(cmd)
12793            WRITE (*,*) TRIM(cmd)
12794          END PROGRAM
12795
12796_See also_:
12797     *note GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
12798
12799
12800File: gfortran.info,  Node: GET_COMMAND_ARGUMENT,  Next: GETCWD,  Prev: GET_COMMAND,  Up: Intrinsic Procedures
12801
128029.123 'GET_COMMAND_ARGUMENT' -- Get command line arguments
12803==========================================================
12804
12805_Description_:
12806     Retrieve the NUMBER-th argument that was passed on the command line
12807     when the containing program was invoked.
12808
12809_Standard_:
12810     Fortran 2003 and later
12811
12812_Class_:
12813     Subroutine
12814
12815_Syntax_:
12816     'CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])'
12817
12818_Arguments_:
12819     NUMBER      Shall be a scalar of type 'INTEGER' and of
12820                 default kind, NUMBER \geq 0
12821     VALUE       (Optional) Shall be a scalar of type 'CHARACTER'
12822                 and of default kind.
12823     LENGTH      (Optional) Shall be a scalar of type 'INTEGER'
12824                 and of default kind.
12825     STATUS      (Optional) Shall be a scalar of type 'INTEGER'
12826                 and of default kind.
12827
12828_Return value_:
12829     After 'GET_COMMAND_ARGUMENT' returns, the VALUE argument holds the
12830     NUMBER-th command line argument.  If VALUE cannot hold the
12831     argument, it is truncated to fit the length of VALUE.  If there are
12832     less than NUMBER arguments specified at the command line, VALUE
12833     will be filled with blanks.  If NUMBER = 0, VALUE is set to the
12834     name of the program (on systems that support this feature).  The
12835     LENGTH argument contains the length of the NUMBER-th command line
12836     argument.  If the argument retrieval fails, STATUS is a positive
12837     number; if VALUE contains a truncated command line argument, STATUS
12838     is -1; and otherwise the STATUS is zero.
12839
12840_Example_:
12841          PROGRAM test_get_command_argument
12842            INTEGER :: i
12843            CHARACTER(len=32) :: arg
12844
12845            i = 0
12846            DO
12847              CALL get_command_argument(i, arg)
12848              IF (LEN_TRIM(arg) == 0) EXIT
12849
12850              WRITE (*,*) TRIM(arg)
12851              i = i+1
12852            END DO
12853          END PROGRAM
12854
12855_See also_:
12856     *note GET_COMMAND::, *note COMMAND_ARGUMENT_COUNT::
12857
12858
12859File: gfortran.info,  Node: GETCWD,  Next: GETENV,  Prev: GET_COMMAND_ARGUMENT,  Up: Intrinsic Procedures
12860
128619.124 'GETCWD' -- Get current working directory
12862===============================================
12863
12864_Description_:
12865     Get current working directory.
12866
12867     This intrinsic is provided in both subroutine and function forms;
12868     however, only one form can be used in any given program unit.
12869
12870_Standard_:
12871     GNU extension
12872
12873_Class_:
12874     Subroutine, function
12875
12876_Syntax_:
12877     'CALL GETCWD(C [, STATUS])'
12878     'STATUS = GETCWD(C)'
12879
12880_Arguments_:
12881     C           The type shall be 'CHARACTER' and of default
12882                 kind.
12883     STATUS      (Optional) status flag.  Returns 0 on success, a
12884                 system specific and nonzero error code
12885                 otherwise.
12886
12887_Example_:
12888          PROGRAM test_getcwd
12889            CHARACTER(len=255) :: cwd
12890            CALL getcwd(cwd)
12891            WRITE(*,*) TRIM(cwd)
12892          END PROGRAM
12893
12894_See also_:
12895     *note CHDIR::
12896
12897
12898File: gfortran.info,  Node: GETENV,  Next: GET_ENVIRONMENT_VARIABLE,  Prev: GETCWD,  Up: Intrinsic Procedures
12899
129009.125 'GETENV' -- Get an environmental variable
12901===============================================
12902
12903_Description_:
12904     Get the VALUE of the environmental variable NAME.
12905
12906     This intrinsic routine is provided for backwards compatibility with
12907     GNU Fortran 77.  In new code, programmers should consider the use
12908     of the *note GET_ENVIRONMENT_VARIABLE:: intrinsic defined by the
12909     Fortran 2003 standard.
12910
12911     Note that 'GETENV' need not be thread-safe.  It is the
12912     responsibility of the user to ensure that the environment is not
12913     being updated concurrently with a call to the 'GETENV' intrinsic.
12914
12915_Standard_:
12916     GNU extension
12917
12918_Class_:
12919     Subroutine
12920
12921_Syntax_:
12922     'CALL GETENV(NAME, VALUE)'
12923
12924_Arguments_:
12925     NAME        Shall be of type 'CHARACTER' and of default
12926                 kind.
12927     VALUE       Shall be of type 'CHARACTER' and of default
12928                 kind.
12929
12930_Return value_:
12931     Stores the value of NAME in VALUE.  If VALUE is not large enough to
12932     hold the data, it is truncated.  If NAME is not set, VALUE will be
12933     filled with blanks.
12934
12935_Example_:
12936          PROGRAM test_getenv
12937            CHARACTER(len=255) :: homedir
12938            CALL getenv("HOME", homedir)
12939            WRITE (*,*) TRIM(homedir)
12940          END PROGRAM
12941
12942_See also_:
12943     *note GET_ENVIRONMENT_VARIABLE::
12944
12945
12946File: gfortran.info,  Node: GET_ENVIRONMENT_VARIABLE,  Next: GETGID,  Prev: GETENV,  Up: Intrinsic Procedures
12947
129489.126 'GET_ENVIRONMENT_VARIABLE' -- Get an environmental variable
12949=================================================================
12950
12951_Description_:
12952     Get the VALUE of the environmental variable NAME.
12953
12954     Note that 'GET_ENVIRONMENT_VARIABLE' need not be thread-safe.  It
12955     is the responsibility of the user to ensure that the environment is
12956     not being updated concurrently with a call to the
12957     'GET_ENVIRONMENT_VARIABLE' intrinsic.
12958
12959_Standard_:
12960     Fortran 2003 and later
12961
12962_Class_:
12963     Subroutine
12964
12965_Syntax_:
12966     'CALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS,
12967     TRIM_NAME)'
12968
12969_Arguments_:
12970     NAME        Shall be a scalar of type 'CHARACTER' and of
12971                 default kind.
12972     VALUE       (Optional) Shall be a scalar of type 'CHARACTER'
12973                 and of default kind.
12974     LENGTH      (Optional) Shall be a scalar of type 'INTEGER'
12975                 and of default kind.
12976     STATUS      (Optional) Shall be a scalar of type 'INTEGER'
12977                 and of default kind.
12978     TRIM_NAME   (Optional) Shall be a scalar of type 'LOGICAL'
12979                 and of default kind.
12980
12981_Return value_:
12982     Stores the value of NAME in VALUE.  If VALUE is not large enough to
12983     hold the data, it is truncated.  If NAME is not set, VALUE will be
12984     filled with blanks.  Argument LENGTH contains the length needed for
12985     storing the environment variable NAME or zero if it is not present.
12986     STATUS is -1 if VALUE is present but too short for the environment
12987     variable; it is 1 if the environment variable does not exist and 2
12988     if the processor does not support environment variables; in all
12989     other cases STATUS is zero.  If TRIM_NAME is present with the value
12990     '.FALSE.', the trailing blanks in NAME are significant; otherwise
12991     they are not part of the environment variable name.
12992
12993_Example_:
12994          PROGRAM test_getenv
12995            CHARACTER(len=255) :: homedir
12996            CALL get_environment_variable("HOME", homedir)
12997            WRITE (*,*) TRIM(homedir)
12998          END PROGRAM
12999
13000
13001File: gfortran.info,  Node: GETGID,  Next: GETLOG,  Prev: GET_ENVIRONMENT_VARIABLE,  Up: Intrinsic Procedures
13002
130039.127 'GETGID' -- Group ID function
13004===================================
13005
13006_Description_:
13007     Returns the numerical group ID of the current process.
13008
13009_Standard_:
13010     GNU extension
13011
13012_Class_:
13013     Function
13014
13015_Syntax_:
13016     'RESULT = GETGID()'
13017
13018_Return value_:
13019     The return value of 'GETGID' is an 'INTEGER' of the default kind.
13020
13021_Example_:
13022     See 'GETPID' for an example.
13023
13024_See also_:
13025     *note GETPID::, *note GETUID::
13026
13027
13028File: gfortran.info,  Node: GETLOG,  Next: GETPID,  Prev: GETGID,  Up: Intrinsic Procedures
13029
130309.128 'GETLOG' -- Get login name
13031================================
13032
13033_Description_:
13034     Gets the username under which the program is running.
13035
13036_Standard_:
13037     GNU extension
13038
13039_Class_:
13040     Subroutine
13041
13042_Syntax_:
13043     'CALL GETLOG(C)'
13044
13045_Arguments_:
13046     C           Shall be of type 'CHARACTER' and of default
13047                 kind.
13048
13049_Return value_:
13050     Stores the current user name in LOGIN.  (On systems where POSIX
13051     functions 'geteuid' and 'getpwuid' are not available, and the
13052     'getlogin' function is not implemented either, this will return a
13053     blank string.)
13054
13055_Example_:
13056          PROGRAM TEST_GETLOG
13057            CHARACTER(32) :: login
13058            CALL GETLOG(login)
13059            WRITE(*,*) login
13060          END PROGRAM
13061
13062_See also_:
13063     *note GETUID::
13064
13065
13066File: gfortran.info,  Node: GETPID,  Next: GETUID,  Prev: GETLOG,  Up: Intrinsic Procedures
13067
130689.129 'GETPID' -- Process ID function
13069=====================================
13070
13071_Description_:
13072     Returns the numerical process identifier of the current process.
13073
13074_Standard_:
13075     GNU extension
13076
13077_Class_:
13078     Function
13079
13080_Syntax_:
13081     'RESULT = GETPID()'
13082
13083_Return value_:
13084     The return value of 'GETPID' is an 'INTEGER' of the default kind.
13085
13086_Example_:
13087          program info
13088            print *, "The current process ID is ", getpid()
13089            print *, "Your numerical user ID is ", getuid()
13090            print *, "Your numerical group ID is ", getgid()
13091          end program info
13092
13093_See also_:
13094     *note GETGID::, *note GETUID::
13095
13096
13097File: gfortran.info,  Node: GETUID,  Next: GMTIME,  Prev: GETPID,  Up: Intrinsic Procedures
13098
130999.130 'GETUID' -- User ID function
13100==================================
13101
13102_Description_:
13103     Returns the numerical user ID of the current process.
13104
13105_Standard_:
13106     GNU extension
13107
13108_Class_:
13109     Function
13110
13111_Syntax_:
13112     'RESULT = GETUID()'
13113
13114_Return value_:
13115     The return value of 'GETUID' is an 'INTEGER' of the default kind.
13116
13117_Example_:
13118     See 'GETPID' for an example.
13119
13120_See also_:
13121     *note GETPID::, *note GETLOG::
13122
13123
13124File: gfortran.info,  Node: GMTIME,  Next: HOSTNM,  Prev: GETUID,  Up: Intrinsic Procedures
13125
131269.131 'GMTIME' -- Convert time to GMT info
13127==========================================
13128
13129_Description_:
13130     Given a system time value TIME (as provided by the *note TIME::
13131     intrinsic), fills VALUES with values extracted from it appropriate
13132     to the UTC time zone (Universal Coordinated Time, also known in
13133     some countries as GMT, Greenwich Mean Time), using 'gmtime(3)'.
13134
13135     This intrinsic routine is provided for backwards compatibility with
13136     GNU Fortran 77.  In new code, programmers should consider the use
13137     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
13138     standard.
13139
13140_Standard_:
13141     GNU extension
13142
13143_Class_:
13144     Subroutine
13145
13146_Syntax_:
13147     'CALL GMTIME(TIME, VALUES)'
13148
13149_Arguments_:
13150     TIME        An 'INTEGER' scalar expression corresponding to
13151                 a system time, with 'INTENT(IN)'.
13152     VALUES      A default 'INTEGER' array with 9 elements, with
13153                 'INTENT(OUT)'.
13154
13155_Return value_:
13156     The elements of VALUES are assigned as follows:
13157       1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
13158          seconds
13159       2. Minutes after the hour, range 0-59
13160       3. Hours past midnight, range 0-23
13161       4. Day of month, range 1-31
13162       5. Number of months since January, range 0-11
13163       6. Years since 1900
13164       7. Number of days since Sunday, range 0-6
13165       8. Days since January 1, range 0-365
13166       9. Daylight savings indicator: positive if daylight savings is in
13167          effect, zero if not, and negative if the information is not
13168          available.
13169
13170_See also_:
13171     *note DATE_AND_TIME::, *note CTIME::, *note LTIME::, *note TIME::,
13172     *note TIME8::
13173
13174
13175File: gfortran.info,  Node: HOSTNM,  Next: HUGE,  Prev: GMTIME,  Up: Intrinsic Procedures
13176
131779.132 'HOSTNM' -- Get system host name
13178======================================
13179
13180_Description_:
13181     Retrieves the host name of the system on which the program is
13182     running.
13183
13184     This intrinsic is provided in both subroutine and function forms;
13185     however, only one form can be used in any given program unit.
13186
13187_Standard_:
13188     GNU extension
13189
13190_Class_:
13191     Subroutine, function
13192
13193_Syntax_:
13194     'CALL HOSTNM(C [, STATUS])'
13195     'STATUS = HOSTNM(NAME)'
13196
13197_Arguments_:
13198     C           Shall of type 'CHARACTER' and of default kind.
13199     STATUS      (Optional) status flag of type 'INTEGER'.
13200                 Returns 0 on success, or a system specific error
13201                 code otherwise.
13202
13203_Return value_:
13204     In either syntax, NAME is set to the current hostname if it can be
13205     obtained, or to a blank string otherwise.
13206
13207
13208File: gfortran.info,  Node: HUGE,  Next: HYPOT,  Prev: HOSTNM,  Up: Intrinsic Procedures
13209
132109.133 'HUGE' -- Largest number of a kind
13211========================================
13212
13213_Description_:
13214     'HUGE(X)' returns the largest number that is not an infinity in the
13215     model of the type of 'X'.
13216
13217_Standard_:
13218     Fortran 95 and later
13219
13220_Class_:
13221     Inquiry function
13222
13223_Syntax_:
13224     'RESULT = HUGE(X)'
13225
13226_Arguments_:
13227     X           Shall be of type 'REAL' or 'INTEGER'.
13228
13229_Return value_:
13230     The return value is of the same type and kind as X
13231
13232_Example_:
13233          program test_huge_tiny
13234            print *, huge(0), huge(0.0), huge(0.0d0)
13235            print *, tiny(0.0), tiny(0.0d0)
13236          end program test_huge_tiny
13237
13238
13239File: gfortran.info,  Node: HYPOT,  Next: IACHAR,  Prev: HUGE,  Up: Intrinsic Procedures
13240
132419.134 'HYPOT' -- Euclidean distance function
13242============================================
13243
13244_Description_:
13245     'HYPOT(X,Y)' is the Euclidean distance function.  It is equal to
13246     \sqrt{X^2 + Y^2}, without undue underflow or overflow.
13247
13248_Standard_:
13249     Fortran 2008 and later
13250
13251_Class_:
13252     Elemental function
13253
13254_Syntax_:
13255     'RESULT = HYPOT(X, Y)'
13256
13257_Arguments_:
13258     X           The type shall be 'REAL'.
13259     Y           The type and kind type parameter shall be the
13260                 same as X.
13261
13262_Return value_:
13263     The return value has the same type and kind type parameter as X.
13264
13265_Example_:
13266          program test_hypot
13267            real(4) :: x = 1.e0_4, y = 0.5e0_4
13268            x = hypot(x,y)
13269          end program test_hypot
13270
13271
13272File: gfortran.info,  Node: IACHAR,  Next: IALL,  Prev: HYPOT,  Up: Intrinsic Procedures
13273
132749.135 'IACHAR' -- Code in ASCII collating sequence
13275==================================================
13276
13277_Description_:
13278     'IACHAR(C)' returns the code for the ASCII character in the first
13279     character position of 'C'.
13280
13281_Standard_:
13282     Fortran 95 and later, with KIND argument Fortran 2003 and later
13283
13284_Class_:
13285     Elemental function
13286
13287_Syntax_:
13288     'RESULT = IACHAR(C [, KIND])'
13289
13290_Arguments_:
13291     C           Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13292     KIND        (Optional) An 'INTEGER' initialization
13293                 expression indicating the kind parameter of the
13294                 result.
13295
13296_Return value_:
13297     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
13298     absent, the return value is of default integer kind.
13299
13300_Example_:
13301          program test_iachar
13302            integer i
13303            i = iachar(' ')
13304          end program test_iachar
13305
13306_Note_:
13307     See *note ICHAR:: for a discussion of converting between numerical
13308     values and formatted string representations.
13309
13310_See also_:
13311     *note ACHAR::, *note CHAR::, *note ICHAR::
13312
13313
13314File: gfortran.info,  Node: IALL,  Next: IAND,  Prev: IACHAR,  Up: Intrinsic Procedures
13315
133169.136 'IALL' -- Bitwise AND of array elements
13317=============================================
13318
13319_Description_:
13320     Reduces with bitwise AND the elements of ARRAY along dimension DIM
13321     if the corresponding element in MASK is 'TRUE'.
13322
13323_Standard_:
13324     Fortran 2008 and later
13325
13326_Class_:
13327     Transformational function
13328
13329_Syntax_:
13330     'RESULT = IALL(ARRAY[, MASK])'
13331     'RESULT = IALL(ARRAY, DIM[, MASK])'
13332
13333_Arguments_:
13334     ARRAY       Shall be an array of type 'INTEGER'
13335     DIM         (Optional) shall be a scalar of type 'INTEGER'
13336                 with a value in the range from 1 to n, where n
13337                 equals the rank of ARRAY.
13338     MASK        (Optional) shall be of type 'LOGICAL' and either
13339                 be a scalar or an array of the same shape as
13340                 ARRAY.
13341
13342_Return value_:
13343     The result is of the same type as ARRAY.
13344
13345     If DIM is absent, a scalar with the bitwise ALL of all elements in
13346     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
13347     the rank of ARRAY, and a shape similar to that of ARRAY with
13348     dimension DIM dropped is returned.
13349
13350_Example_:
13351          PROGRAM test_iall
13352            INTEGER(1) :: a(2)
13353
13354            a(1) = b'00100100'
13355            a(2) = b'01101010'
13356
13357            ! prints 00100000
13358            PRINT '(b8.8)', IALL(a)
13359          END PROGRAM
13360
13361_See also_:
13362     *note IANY::, *note IPARITY::, *note IAND::
13363
13364
13365File: gfortran.info,  Node: IAND,  Next: IANY,  Prev: IALL,  Up: Intrinsic Procedures
13366
133679.137 'IAND' -- Bitwise logical and
13368===================================
13369
13370_Description_:
13371     Bitwise logical 'AND'.
13372
13373_Standard_:
13374     Fortran 95 and later, has overloads that are GNU extensions
13375
13376_Class_:
13377     Elemental function
13378
13379_Syntax_:
13380     'RESULT = IAND(I, J)'
13381
13382_Arguments_:
13383     I           The type shall be 'INTEGER' or a
13384                 boz-literal-constant.
13385     J           The type shall be 'INTEGER' with the same kind
13386                 type parameter as I or a boz-literal-constant.
13387                 I and J shall not both be boz-literal-constants.
13388
13389_Return value_:
13390     The return type is 'INTEGER' with the kind type parameter of the
13391     arguments.  A boz-literal-constant is converted to an 'INTEGER'
13392     with the kind type parameter of the other argument as-if a call to
13393     *note INT:: occurred.
13394
13395_Example_:
13396          PROGRAM test_iand
13397            INTEGER :: a, b
13398            DATA a / Z'F' /, b / Z'3' /
13399            WRITE (*,*) IAND(a, b)
13400          END PROGRAM
13401
13402_Specific names_:
13403     Name           Argument       Return type    Standard
13404     'IAND(A)'      'INTEGER A'    'INTEGER'      Fortran 95 and
13405                                                  later
13406     'BIAND(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13407                    A'
13408     'IIAND(A)'     'INTEGER(2)    'INTEGER(2)'   GNU extension
13409                    A'
13410     'JIAND(A)'     'INTEGER(4)    'INTEGER(4)'   GNU extension
13411                    A'
13412     'KIAND(A)'     'INTEGER(8)    'INTEGER(8)'   GNU extension
13413                    A'
13414
13415_See also_:
13416     *note IOR::, *note IEOR::, *note IBITS::, *note IBSET::, *note
13417     IBCLR::, *note NOT::
13418
13419
13420File: gfortran.info,  Node: IANY,  Next: IARGC,  Prev: IAND,  Up: Intrinsic Procedures
13421
134229.138 'IANY' -- Bitwise OR of array elements
13423============================================
13424
13425_Description_:
13426     Reduces with bitwise OR (inclusive or) the elements of ARRAY along
13427     dimension DIM if the corresponding element in MASK is 'TRUE'.
13428
13429_Standard_:
13430     Fortran 2008 and later
13431
13432_Class_:
13433     Transformational function
13434
13435_Syntax_:
13436     'RESULT = IANY(ARRAY[, MASK])'
13437     'RESULT = IANY(ARRAY, DIM[, MASK])'
13438
13439_Arguments_:
13440     ARRAY       Shall be an array of type 'INTEGER'
13441     DIM         (Optional) shall be a scalar of type 'INTEGER'
13442                 with a value in the range from 1 to n, where n
13443                 equals the rank of ARRAY.
13444     MASK        (Optional) shall be of type 'LOGICAL' and either
13445                 be a scalar or an array of the same shape as
13446                 ARRAY.
13447
13448_Return value_:
13449     The result is of the same type as ARRAY.
13450
13451     If DIM is absent, a scalar with the bitwise OR of all elements in
13452     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
13453     the rank of ARRAY, and a shape similar to that of ARRAY with
13454     dimension DIM dropped is returned.
13455
13456_Example_:
13457          PROGRAM test_iany
13458            INTEGER(1) :: a(2)
13459
13460            a(1) = b'00100100'
13461            a(2) = b'01101010'
13462
13463            ! prints 01101110
13464            PRINT '(b8.8)', IANY(a)
13465          END PROGRAM
13466
13467_See also_:
13468     *note IPARITY::, *note IALL::, *note IOR::
13469
13470
13471File: gfortran.info,  Node: IARGC,  Next: IBCLR,  Prev: IANY,  Up: Intrinsic Procedures
13472
134739.139 'IARGC' -- Get the number of command line arguments
13474=========================================================
13475
13476_Description_:
13477     'IARGC' returns the number of arguments passed on the command line
13478     when the containing program was invoked.
13479
13480     This intrinsic routine is provided for backwards compatibility with
13481     GNU Fortran 77.  In new code, programmers should consider the use
13482     of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the
13483     Fortran 2003 standard.
13484
13485_Standard_:
13486     GNU extension
13487
13488_Class_:
13489     Function
13490
13491_Syntax_:
13492     'RESULT = IARGC()'
13493
13494_Arguments_:
13495     None.
13496
13497_Return value_:
13498     The number of command line arguments, type 'INTEGER(4)'.
13499
13500_Example_:
13501     See *note GETARG::
13502
13503_See also_:
13504     GNU Fortran 77 compatibility subroutine: *note GETARG::
13505
13506     Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note
13507     GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT::
13508
13509
13510File: gfortran.info,  Node: IBCLR,  Next: IBITS,  Prev: IARGC,  Up: Intrinsic Procedures
13511
135129.140 'IBCLR' -- Clear bit
13513==========================
13514
13515_Description_:
13516     'IBCLR' returns the value of I with the bit at position POS set to
13517     zero.
13518
13519_Standard_:
13520     Fortran 95 and later, has overloads that are GNU extensions
13521
13522_Class_:
13523     Elemental function
13524
13525_Syntax_:
13526     'RESULT = IBCLR(I, POS)'
13527
13528_Arguments_:
13529     I           The type shall be 'INTEGER'.
13530     POS         The type shall be 'INTEGER'.
13531
13532_Return value_:
13533     The return value is of type 'INTEGER' and of the same kind as I.
13534
13535_Specific names_:
13536     Name           Argument       Return type    Standard
13537     'IBCLR(A)'     'INTEGER A'    'INTEGER'      Fortran 95 and
13538                                                  later
13539     'BBCLR(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13540                    A'
13541     'IIBCLR(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13542                    A'
13543     'JIBCLR(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13544                    A'
13545     'KIBCLR(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13546                    A'
13547
13548_See also_:
13549     *note IBITS::, *note IBSET::, *note IAND::, *note IOR::, *note
13550     IEOR::, *note MVBITS::
13551
13552
13553File: gfortran.info,  Node: IBITS,  Next: IBSET,  Prev: IBCLR,  Up: Intrinsic Procedures
13554
135559.141 'IBITS' -- Bit extraction
13556===============================
13557
13558_Description_:
13559     'IBITS' extracts a field of length LEN from I, starting from bit
13560     position POS and extending left for LEN bits.  The result is
13561     right-justified and the remaining bits are zeroed.  The value of
13562     'POS+LEN' must be less than or equal to the value 'BIT_SIZE(I)'.
13563
13564_Standard_:
13565     Fortran 95 and later, has overloads that are GNU extensions
13566
13567_Class_:
13568     Elemental function
13569
13570_Syntax_:
13571     'RESULT = IBITS(I, POS, LEN)'
13572
13573_Arguments_:
13574     I           The type shall be 'INTEGER'.
13575     POS         The type shall be 'INTEGER'.
13576     LEN         The type shall be 'INTEGER'.
13577
13578_Return value_:
13579     The return value is of type 'INTEGER' and of the same kind as I.
13580
13581_Specific names_:
13582     Name           Argument       Return type    Standard
13583     'IBITS(A)'     'INTEGER A'    'INTEGER'      Fortran 95 and
13584                                                  later
13585     'BBITS(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13586                    A'
13587     'IIBITS(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13588                    A'
13589     'JIBITS(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13590                    A'
13591     'KIBITS(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13592                    A'
13593
13594_See also_:
13595     *note BIT_SIZE::, *note IBCLR::, *note IBSET::, *note IAND::, *note
13596     IOR::, *note IEOR::
13597
13598
13599File: gfortran.info,  Node: IBSET,  Next: ICHAR,  Prev: IBITS,  Up: Intrinsic Procedures
13600
136019.142 'IBSET' -- Set bit
13602========================
13603
13604_Description_:
13605     'IBSET' returns the value of I with the bit at position POS set to
13606     one.
13607
13608_Standard_:
13609     Fortran 95 and later, has overloads that are GNU extensions
13610
13611_Class_:
13612     Elemental function
13613
13614_Syntax_:
13615     'RESULT = IBSET(I, POS)'
13616
13617_Arguments_:
13618     I           The type shall be 'INTEGER'.
13619     POS         The type shall be 'INTEGER'.
13620
13621_Return value_:
13622     The return value is of type 'INTEGER' and of the same kind as I.
13623
13624_Specific names_:
13625     Name           Argument       Return type    Standard
13626     'IBSET(A)'     'INTEGER A'    'INTEGER'      Fortran 95 and
13627                                                  later
13628     'BBSET(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13629                    A'
13630     'IIBSET(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
13631                    A'
13632     'JIBSET(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
13633                    A'
13634     'KIBSET(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
13635                    A'
13636
13637_See also_:
13638     *note IBCLR::, *note IBITS::, *note IAND::, *note IOR::, *note
13639     IEOR::, *note MVBITS::
13640
13641
13642File: gfortran.info,  Node: ICHAR,  Next: IDATE,  Prev: IBSET,  Up: Intrinsic Procedures
13643
136449.143 'ICHAR' -- Character-to-integer conversion function
13645=========================================================
13646
13647_Description_:
13648     'ICHAR(C)' returns the code for the character in the first
13649     character position of 'C' in the system's native character set.
13650     The correspondence between characters and their codes is not
13651     necessarily the same across different GNU Fortran implementations.
13652
13653_Standard_:
13654     Fortran 95 and later, with KIND argument Fortran 2003 and later
13655
13656_Class_:
13657     Elemental function
13658
13659_Syntax_:
13660     'RESULT = ICHAR(C [, KIND])'
13661
13662_Arguments_:
13663     C           Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13664     KIND        (Optional) An 'INTEGER' initialization
13665                 expression indicating the kind parameter of the
13666                 result.
13667
13668_Return value_:
13669     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
13670     absent, the return value is of default integer kind.
13671
13672_Example_:
13673          program test_ichar
13674            integer i
13675            i = ichar(' ')
13676          end program test_ichar
13677
13678_Specific names_:
13679     Name           Argument       Return type    Standard
13680     'ICHAR(C)'     'CHARACTER     'INTEGER(4)'   Fortran 77 and
13681                    C'                            later
13682
13683_Note_:
13684     No intrinsic exists to convert between a numeric value and a
13685     formatted character string representation - for instance, given the
13686     'CHARACTER' value ''154'', obtaining an 'INTEGER' or 'REAL' value
13687     with the value 154, or vice versa.  Instead, this functionality is
13688     provided by internal-file I/O, as in the following example:
13689          program read_val
13690            integer value
13691            character(len=10) string, string2
13692            string = '154'
13693
13694            ! Convert a string to a numeric value
13695            read (string,'(I10)') value
13696            print *, value
13697
13698            ! Convert a value to a formatted string
13699            write (string2,'(I10)') value
13700            print *, string2
13701          end program read_val
13702
13703_See also_:
13704     *note ACHAR::, *note CHAR::, *note IACHAR::
13705
13706
13707File: gfortran.info,  Node: IDATE,  Next: IEOR,  Prev: ICHAR,  Up: Intrinsic Procedures
13708
137099.144 'IDATE' -- Get current local time subroutine (day/month/year)
13710===================================================================
13711
13712_Description_:
13713     'IDATE(VALUES)' Fills VALUES with the numerical values at the
13714     current local time.  The day (in the range 1-31), month (in the
13715     range 1-12), and year appear in elements 1, 2, and 3 of VALUES,
13716     respectively.  The year has four significant digits.
13717
13718     This intrinsic routine is provided for backwards compatibility with
13719     GNU Fortran 77.  In new code, programmers should consider the use
13720     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
13721     standard.
13722
13723_Standard_:
13724     GNU extension
13725
13726_Class_:
13727     Subroutine
13728
13729_Syntax_:
13730     'CALL IDATE(VALUES)'
13731
13732_Arguments_:
13733     VALUES      The type shall be 'INTEGER, DIMENSION(3)' and
13734                 the kind shall be the default integer kind.
13735
13736_Return value_:
13737     Does not return anything.
13738
13739_Example_:
13740          program test_idate
13741            integer, dimension(3) :: tarray
13742            call idate(tarray)
13743            print *, tarray(1)
13744            print *, tarray(2)
13745            print *, tarray(3)
13746          end program test_idate
13747
13748_See also_:
13749     *note DATE_AND_TIME::
13750
13751
13752File: gfortran.info,  Node: IEOR,  Next: IERRNO,  Prev: IDATE,  Up: Intrinsic Procedures
13753
137549.145 'IEOR' -- Bitwise logical exclusive or
13755============================================
13756
13757_Description_:
13758     'IEOR' returns the bitwise Boolean exclusive-OR of I and J.
13759
13760_Standard_:
13761     Fortran 95 and later, has overloads that are GNU extensions
13762
13763_Class_:
13764     Elemental function
13765
13766_Syntax_:
13767     'RESULT = IEOR(I, J)'
13768
13769_Arguments_:
13770     I           The type shall be 'INTEGER' or a
13771                 boz-literal-constant.
13772     J           The type shall be 'INTEGER' with the same kind
13773                 type parameter as I or a boz-literal-constant.
13774                 I and J shall not both be boz-literal-constants.
13775
13776_Return value_:
13777     The return type is 'INTEGER' with the kind type parameter of the
13778     arguments.  A boz-literal-constant is converted to an 'INTEGER'
13779     with the kind type parameter of the other argument as-if a call to
13780     *note INT:: occurred.
13781
13782_Specific names_:
13783     Name           Argument       Return type    Standard
13784     'IEOR(A)'      'INTEGER A'    'INTEGER'      Fortran 95 and
13785                                                  later
13786     'BIEOR(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
13787                    A'
13788     'IIEOR(A)'     'INTEGER(2)    'INTEGER(2)'   GNU extension
13789                    A'
13790     'JIEOR(A)'     'INTEGER(4)    'INTEGER(4)'   GNU extension
13791                    A'
13792     'KIEOR(A)'     'INTEGER(8)    'INTEGER(8)'   GNU extension
13793                    A'
13794
13795_See also_:
13796     *note IOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
13797     IBCLR::, *note NOT::
13798
13799
13800File: gfortran.info,  Node: IERRNO,  Next: IMAGE_INDEX,  Prev: IEOR,  Up: Intrinsic Procedures
13801
138029.146 'IERRNO' -- Get the last system error number
13803==================================================
13804
13805_Description_:
13806     Returns the last system error number, as given by the C 'errno'
13807     variable.
13808
13809_Standard_:
13810     GNU extension
13811
13812_Class_:
13813     Function
13814
13815_Syntax_:
13816     'RESULT = IERRNO()'
13817
13818_Arguments_:
13819     None.
13820
13821_Return value_:
13822     The return value is of type 'INTEGER' and of the default integer
13823     kind.
13824
13825_See also_:
13826     *note PERROR::
13827
13828
13829File: gfortran.info,  Node: IMAGE_INDEX,  Next: INDEX intrinsic,  Prev: IERRNO,  Up: Intrinsic Procedures
13830
138319.147 'IMAGE_INDEX' -- Function that converts a cosubscript to an image index
13832=============================================================================
13833
13834_Description_:
13835     Returns the image index belonging to a cosubscript.
13836
13837_Standard_:
13838     Fortran 2008 and later
13839
13840_Class_:
13841     Inquiry function.
13842
13843_Syntax_:
13844     'RESULT = IMAGE_INDEX(COARRAY, SUB)'
13845
13846_Arguments_: None.
13847     COARRAY     Coarray of any type.
13848     SUB         default integer rank-1 array of a size equal to
13849                 the corank of COARRAY.
13850
13851_Return value_:
13852     Scalar default integer with the value of the image index which
13853     corresponds to the cosubscripts.  For invalid cosubscripts the
13854     result is zero.
13855
13856_Example_:
13857          INTEGER :: array[2,-1:4,8,*]
13858          ! Writes  28 (or 0 if there are fewer than 28 images)
13859          WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1])
13860
13861_See also_:
13862     *note THIS_IMAGE::, *note NUM_IMAGES::
13863
13864
13865File: gfortran.info,  Node: INDEX intrinsic,  Next: INT,  Prev: IMAGE_INDEX,  Up: Intrinsic Procedures
13866
138679.148 'INDEX' -- Position of a substring within a string
13868========================================================
13869
13870_Description_:
13871     Returns the position of the start of the first occurrence of string
13872     SUBSTRING as a substring in STRING, counting from one.  If
13873     SUBSTRING is not present in STRING, zero is returned.  If the BACK
13874     argument is present and true, the return value is the start of the
13875     last occurrence rather than the first.
13876
13877_Standard_:
13878     Fortran 77 and later, with KIND argument Fortran 2003 and later
13879
13880_Class_:
13881     Elemental function
13882
13883_Syntax_:
13884     'RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])'
13885
13886_Arguments_:
13887     STRING      Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13888     SUBSTRING   Shall be a scalar 'CHARACTER', with 'INTENT(IN)'
13889     BACK        (Optional) Shall be a scalar 'LOGICAL', with
13890                 'INTENT(IN)'
13891     KIND        (Optional) An 'INTEGER' initialization
13892                 expression indicating the kind parameter of the
13893                 result.
13894
13895_Return value_:
13896     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
13897     absent, the return value is of default integer kind.
13898
13899_Specific names_:
13900     Name           Argument       Return type    Standard
13901     'INDEX(STRING, 'CHARACTER'    'INTEGER(4)'   Fortran 77 and
13902     SUBSTRING)'                                  later
13903
13904_See also_:
13905     *note SCAN::, *note VERIFY::
13906
13907
13908File: gfortran.info,  Node: INT,  Next: INT2,  Prev: INDEX intrinsic,  Up: Intrinsic Procedures
13909
139109.149 'INT' -- Convert to integer type
13911======================================
13912
13913_Description_:
13914     Convert to integer type
13915
13916_Standard_:
13917     Fortran 77 and later
13918
13919_Class_:
13920     Elemental function
13921
13922_Syntax_:
13923     'RESULT = INT(A [, KIND))'
13924
13925_Arguments_:
13926     A           Shall be of type 'INTEGER', 'REAL', or
13927                 'COMPLEX'.
13928     KIND        (Optional) An 'INTEGER' initialization
13929                 expression indicating the kind parameter of the
13930                 result.
13931
13932_Return value_:
13933     These functions return a 'INTEGER' variable or array under the
13934     following rules:
13935
13936     (A)
13937          If A is of type 'INTEGER', 'INT(A) = A'
13938     (B)
13939          If A is of type 'REAL' and |A| < 1, 'INT(A)' equals '0'.  If
13940          |A| \geq 1, then 'INT(A)' is the integer whose magnitude is
13941          the largest integer that does not exceed the magnitude of A
13942          and whose sign is the same as the sign of A.
13943     (C)
13944          If A is of type 'COMPLEX', rule B is applied to the real part
13945          of A.
13946
13947_Example_:
13948          program test_int
13949            integer :: i = 42
13950            complex :: z = (-3.7, 1.0)
13951            print *, int(i)
13952            print *, int(z), int(z,8)
13953          end program
13954
13955_Specific names_:
13956     Name           Argument       Return type    Standard
13957     'INT(A)'       'REAL(4) A'    'INTEGER'      Fortran 77 and
13958                                                  later
13959     'IFIX(A)'      'REAL(4) A'    'INTEGER'      Fortran 77 and
13960                                                  later
13961     'IDINT(A)'     'REAL(8) A'    'INTEGER'      Fortran 77 and
13962                                                  later
13963
13964
13965File: gfortran.info,  Node: INT2,  Next: INT8,  Prev: INT,  Up: Intrinsic Procedures
13966
139679.150 'INT2' -- Convert to 16-bit integer type
13968==============================================
13969
13970_Description_:
13971     Convert to a 'KIND=2' integer type.  This is equivalent to the
13972     standard 'INT' intrinsic with an optional argument of 'KIND=2', and
13973     is only included for backwards compatibility.
13974
13975     The 'SHORT' intrinsic is equivalent to 'INT2'.
13976
13977_Standard_:
13978     GNU extension
13979
13980_Class_:
13981     Elemental function
13982
13983_Syntax_:
13984     'RESULT = INT2(A)'
13985
13986_Arguments_:
13987     A           Shall be of type 'INTEGER', 'REAL', or
13988                 'COMPLEX'.
13989
13990_Return value_:
13991     The return value is a 'INTEGER(2)' variable.
13992
13993_See also_:
13994     *note INT::, *note INT8::, *note LONG::
13995
13996
13997File: gfortran.info,  Node: INT8,  Next: IOR,  Prev: INT2,  Up: Intrinsic Procedures
13998
139999.151 'INT8' -- Convert to 64-bit integer type
14000==============================================
14001
14002_Description_:
14003     Convert to a 'KIND=8' integer type.  This is equivalent to the
14004     standard 'INT' intrinsic with an optional argument of 'KIND=8', and
14005     is only included for backwards compatibility.
14006
14007_Standard_:
14008     GNU extension
14009
14010_Class_:
14011     Elemental function
14012
14013_Syntax_:
14014     'RESULT = INT8(A)'
14015
14016_Arguments_:
14017     A           Shall be of type 'INTEGER', 'REAL', or
14018                 'COMPLEX'.
14019
14020_Return value_:
14021     The return value is a 'INTEGER(8)' variable.
14022
14023_See also_:
14024     *note INT::, *note INT2::, *note LONG::
14025
14026
14027File: gfortran.info,  Node: IOR,  Next: IPARITY,  Prev: INT8,  Up: Intrinsic Procedures
14028
140299.152 'IOR' -- Bitwise logical or
14030=================================
14031
14032_Description_:
14033     'IOR' returns the bitwise Boolean inclusive-OR of I and J.
14034
14035_Standard_:
14036     Fortran 95 and later, has overloads that are GNU extensions
14037
14038_Class_:
14039     Elemental function
14040
14041_Syntax_:
14042     'RESULT = IOR(I, J)'
14043
14044_Arguments_:
14045     I           The type shall be 'INTEGER' or a
14046                 boz-literal-constant.
14047     J           The type shall be 'INTEGER' with the same kind
14048                 type parameter as I or a boz-literal-constant.
14049                 I and J shall not both be boz-literal-constants.
14050
14051_Return value_:
14052     The return type is 'INTEGER' with the kind type parameter of the
14053     arguments.  A boz-literal-constant is converted to an 'INTEGER'
14054     with the kind type parameter of the other argument as-if a call to
14055     *note INT:: occurred.
14056
14057_Specific names_:
14058     Name           Argument       Return type    Standard
14059     'IOR(A)'       'INTEGER A'    'INTEGER'      Fortran 95 and
14060                                                  later
14061     'BIOR(A)'      'INTEGER(1)    'INTEGER(1)'   GNU extension
14062                    A'
14063     'IIOR(A)'      'INTEGER(2)    'INTEGER(2)'   GNU extension
14064                    A'
14065     'JIOR(A)'      'INTEGER(4)    'INTEGER(4)'   GNU extension
14066                    A'
14067     'KIOR(A)'      'INTEGER(8)    'INTEGER(8)'   GNU extension
14068                    A'
14069
14070_See also_:
14071     *note IEOR::, *note IAND::, *note IBITS::, *note IBSET::, *note
14072     IBCLR::, *note NOT::
14073
14074
14075File: gfortran.info,  Node: IPARITY,  Next: IRAND,  Prev: IOR,  Up: Intrinsic Procedures
14076
140779.153 'IPARITY' -- Bitwise XOR of array elements
14078================================================
14079
14080_Description_:
14081     Reduces with bitwise XOR (exclusive or) the elements of ARRAY along
14082     dimension DIM if the corresponding element in MASK is 'TRUE'.
14083
14084_Standard_:
14085     Fortran 2008 and later
14086
14087_Class_:
14088     Transformational function
14089
14090_Syntax_:
14091     'RESULT = IPARITY(ARRAY[, MASK])'
14092     'RESULT = IPARITY(ARRAY, DIM[, MASK])'
14093
14094_Arguments_:
14095     ARRAY       Shall be an array of type 'INTEGER'
14096     DIM         (Optional) shall be a scalar of type 'INTEGER'
14097                 with a value in the range from 1 to n, where n
14098                 equals the rank of ARRAY.
14099     MASK        (Optional) shall be of type 'LOGICAL' and either
14100                 be a scalar or an array of the same shape as
14101                 ARRAY.
14102
14103_Return value_:
14104     The result is of the same type as ARRAY.
14105
14106     If DIM is absent, a scalar with the bitwise XOR of all elements in
14107     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
14108     the rank of ARRAY, and a shape similar to that of ARRAY with
14109     dimension DIM dropped is returned.
14110
14111_Example_:
14112          PROGRAM test_iparity
14113            INTEGER(1) :: a(2)
14114
14115            a(1) = b'00100100'
14116            a(2) = b'01101010'
14117
14118            ! prints 01001110
14119            PRINT '(b8.8)', IPARITY(a)
14120          END PROGRAM
14121
14122_See also_:
14123     *note IANY::, *note IALL::, *note IEOR::, *note PARITY::
14124
14125
14126File: gfortran.info,  Node: IRAND,  Next: IS_CONTIGUOUS,  Prev: IPARITY,  Up: Intrinsic Procedures
14127
141289.154 'IRAND' -- Integer pseudo-random number
14129=============================================
14130
14131_Description_:
14132     'IRAND(FLAG)' returns a pseudo-random number from a uniform
14133     distribution between 0 and a system-dependent limit (which is in
14134     most cases 2147483647).  If FLAG is 0, the next number in the
14135     current sequence is returned; if FLAG is 1, the generator is
14136     restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
14137     used as a new seed with 'SRAND'.
14138
14139     This intrinsic routine is provided for backwards compatibility with
14140     GNU Fortran 77.  It implements a simple modulo generator as
14141     provided by 'g77'.  For new code, one should consider the use of
14142     *note RANDOM_NUMBER:: as it implements a superior algorithm.
14143
14144_Standard_:
14145     GNU extension
14146
14147_Class_:
14148     Function
14149
14150_Syntax_:
14151     'RESULT = IRAND(I)'
14152
14153_Arguments_:
14154     I           Shall be a scalar 'INTEGER' of kind 4.
14155
14156_Return value_:
14157     The return value is of 'INTEGER(kind=4)' type.
14158
14159_Example_:
14160          program test_irand
14161            integer,parameter :: seed = 86456
14162
14163            call srand(seed)
14164            print *, irand(), irand(), irand(), irand()
14165            print *, irand(seed), irand(), irand(), irand()
14166          end program test_irand
14167
14168
14169File: gfortran.info,  Node: IS_CONTIGUOUS,  Next: IS_IOSTAT_END,  Prev: IRAND,  Up: Intrinsic Procedures
14170
141719.155 'IS_CONTIGUOUS' -- Test whether an array is contiguous
14172============================================================
14173
14174_Description_:
14175     'IS_CONTIGUOUS' tests whether an array is contiguous.
14176
14177_Standard_:
14178     Fortran 2008 and later
14179
14180_Class_:
14181     Inquiry function
14182
14183_Syntax_:
14184     'RESULT = IS_CONTIGUOUS(ARRAY)'
14185
14186_Arguments_:
14187     ARRAY       Shall be an array of any type.
14188
14189_Return value_:
14190     Returns a 'LOGICAL' of the default kind, which '.TRUE.' if ARRAY is
14191     contiguous and false otherwise.
14192
14193_Example_:
14194          program test
14195            integer :: a(10)
14196            a = [1,2,3,4,5,6,7,8,9,10]
14197            call sub (a)      ! every element, is contiguous
14198            call sub (a(::2)) ! every other element, is noncontiguous
14199          contains
14200            subroutine sub (x)
14201              integer :: x(:)
14202              if (is_contiguous (x)) then
14203                write (*,*) 'X is contiguous'
14204              else
14205                write (*,*) 'X is not contiguous'
14206              end if
14207            end subroutine sub
14208          end program test
14209
14210
14211File: gfortran.info,  Node: IS_IOSTAT_END,  Next: IS_IOSTAT_EOR,  Prev: IS_CONTIGUOUS,  Up: Intrinsic Procedures
14212
142139.156 'IS_IOSTAT_END' -- Test for end-of-file value
14214===================================================
14215
14216_Description_:
14217     'IS_IOSTAT_END' tests whether an variable has the value of the I/O
14218     status "end of file".  The function is equivalent to comparing the
14219     variable with the 'IOSTAT_END' parameter of the intrinsic module
14220     'ISO_FORTRAN_ENV'.
14221
14222_Standard_:
14223     Fortran 2003 and later
14224
14225_Class_:
14226     Elemental function
14227
14228_Syntax_:
14229     'RESULT = IS_IOSTAT_END(I)'
14230
14231_Arguments_:
14232     I           Shall be of the type 'INTEGER'.
14233
14234_Return value_:
14235     Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
14236     the value which indicates an end of file condition for 'IOSTAT='
14237     specifiers, and is '.FALSE.' otherwise.
14238
14239_Example_:
14240          PROGRAM iostat
14241            IMPLICIT NONE
14242            INTEGER :: stat, i
14243            OPEN(88, FILE='test.dat')
14244            READ(88, *, IOSTAT=stat) i
14245            IF(IS_IOSTAT_END(stat)) STOP 'END OF FILE'
14246          END PROGRAM
14247
14248
14249File: gfortran.info,  Node: IS_IOSTAT_EOR,  Next: ISATTY,  Prev: IS_IOSTAT_END,  Up: Intrinsic Procedures
14250
142519.157 'IS_IOSTAT_EOR' -- Test for end-of-record value
14252=====================================================
14253
14254_Description_:
14255     'IS_IOSTAT_EOR' tests whether an variable has the value of the I/O
14256     status "end of record".  The function is equivalent to comparing
14257     the variable with the 'IOSTAT_EOR' parameter of the intrinsic
14258     module 'ISO_FORTRAN_ENV'.
14259
14260_Standard_:
14261     Fortran 2003 and later
14262
14263_Class_:
14264     Elemental function
14265
14266_Syntax_:
14267     'RESULT = IS_IOSTAT_EOR(I)'
14268
14269_Arguments_:
14270     I           Shall be of the type 'INTEGER'.
14271
14272_Return value_:
14273     Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has
14274     the value which indicates an end of file condition for 'IOSTAT='
14275     specifiers, and is '.FALSE.' otherwise.
14276
14277_Example_:
14278          PROGRAM iostat
14279            IMPLICIT NONE
14280            INTEGER :: stat, i(50)
14281            OPEN(88, FILE='test.dat', FORM='UNFORMATTED')
14282            READ(88, IOSTAT=stat) i
14283            IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD'
14284          END PROGRAM
14285
14286
14287File: gfortran.info,  Node: ISATTY,  Next: ISHFT,  Prev: IS_IOSTAT_EOR,  Up: Intrinsic Procedures
14288
142899.158 'ISATTY' -- Whether a unit is a terminal device.
14290======================================================
14291
14292_Description_:
14293     Determine whether a unit is connected to a terminal device.
14294
14295_Standard_:
14296     GNU extension
14297
14298_Class_:
14299     Function
14300
14301_Syntax_:
14302     'RESULT = ISATTY(UNIT)'
14303
14304_Arguments_:
14305     UNIT        Shall be a scalar 'INTEGER'.
14306
14307_Return value_:
14308     Returns '.TRUE.' if the UNIT is connected to a terminal device,
14309     '.FALSE.' otherwise.
14310
14311_Example_:
14312          PROGRAM test_isatty
14313            INTEGER(kind=1) :: unit
14314            DO unit = 1, 10
14315              write(*,*) isatty(unit=unit)
14316            END DO
14317          END PROGRAM
14318_See also_:
14319     *note TTYNAM::
14320
14321
14322File: gfortran.info,  Node: ISHFT,  Next: ISHFTC,  Prev: ISATTY,  Up: Intrinsic Procedures
14323
143249.159 'ISHFT' -- Shift bits
14325===========================
14326
14327_Description_:
14328     'ISHFT' returns a value corresponding to I with all of the bits
14329     shifted SHIFT places.  A value of SHIFT greater than zero
14330     corresponds to a left shift, a value of zero corresponds to no
14331     shift, and a value less than zero corresponds to a right shift.  If
14332     the absolute value of SHIFT is greater than 'BIT_SIZE(I)', the
14333     value is undefined.  Bits shifted out from the left end or right
14334     end are lost; zeros are shifted in from the opposite end.
14335
14336_Standard_:
14337     Fortran 95 and later, has overloads that are GNU extensions
14338
14339_Class_:
14340     Elemental function
14341
14342_Syntax_:
14343     'RESULT = ISHFT(I, SHIFT)'
14344
14345_Arguments_:
14346     I           The type shall be 'INTEGER'.
14347     SHIFT       The type shall be 'INTEGER'.
14348
14349_Return value_:
14350     The return value is of type 'INTEGER' and of the same kind as I.
14351
14352_Specific names_:
14353     Name           Argument       Return type    Standard
14354     'ISHFT(A)'     'INTEGER A'    'INTEGER'      Fortran 95 and
14355                                                  later
14356     'BSHFT(A)'     'INTEGER(1)    'INTEGER(1)'   GNU extension
14357                    A'
14358     'IISHFT(A)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
14359                    A'
14360     'JISHFT(A)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
14361                    A'
14362     'KISHFT(A)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
14363                    A'
14364
14365_See also_:
14366     *note ISHFTC::
14367
14368
14369File: gfortran.info,  Node: ISHFTC,  Next: ISNAN,  Prev: ISHFT,  Up: Intrinsic Procedures
14370
143719.160 'ISHFTC' -- Shift bits circularly
14372=======================================
14373
14374_Description_:
14375     'ISHFTC' returns a value corresponding to I with the rightmost SIZE
14376     bits shifted circularly SHIFT places; that is, bits shifted out one
14377     end are shifted into the opposite end.  A value of SHIFT greater
14378     than zero corresponds to a left shift, a value of zero corresponds
14379     to no shift, and a value less than zero corresponds to a right
14380     shift.  The absolute value of SHIFT must be less than SIZE.  If the
14381     SIZE argument is omitted, it is taken to be equivalent to
14382     'BIT_SIZE(I)'.
14383
14384_Standard_:
14385     Fortran 95 and later, has overloads that are GNU extensions
14386
14387_Class_:
14388     Elemental function
14389
14390_Syntax_:
14391     'RESULT = ISHFTC(I, SHIFT [, SIZE])'
14392
14393_Arguments_:
14394     I           The type shall be 'INTEGER'.
14395     SHIFT       The type shall be 'INTEGER'.
14396     SIZE        (Optional) The type shall be 'INTEGER'; the
14397                 value must be greater than zero and less than or
14398                 equal to 'BIT_SIZE(I)'.
14399
14400_Return value_:
14401     The return value is of type 'INTEGER' and of the same kind as I.
14402
14403_Specific names_:
14404     Name           Argument       Return type    Standard
14405     'ISHFTC(A)'    'INTEGER A'    'INTEGER'      Fortran 95 and
14406                                                  later
14407     'BSHFTC(A)'    'INTEGER(1)    'INTEGER(1)'   GNU extension
14408                    A'
14409     'IISHFTC(A)'   'INTEGER(2)    'INTEGER(2)'   GNU extension
14410                    A'
14411     'JISHFTC(A)'   'INTEGER(4)    'INTEGER(4)'   GNU extension
14412                    A'
14413     'KISHFTC(A)'   'INTEGER(8)    'INTEGER(8)'   GNU extension
14414                    A'
14415
14416_See also_:
14417     *note ISHFT::
14418
14419
14420File: gfortran.info,  Node: ISNAN,  Next: ITIME,  Prev: ISHFTC,  Up: Intrinsic Procedures
14421
144229.161 'ISNAN' -- Test for a NaN
14423===============================
14424
14425_Description_:
14426     'ISNAN' tests whether a floating-point value is an IEEE
14427     Not-a-Number (NaN).
14428_Standard_:
14429     GNU extension
14430
14431_Class_:
14432     Elemental function
14433
14434_Syntax_:
14435     'ISNAN(X)'
14436
14437_Arguments_:
14438     X           Variable of the type 'REAL'.
14439
14440
14441_Return value_:
14442     Returns a default-kind 'LOGICAL'.  The returned value is 'TRUE' if
14443     X is a NaN and 'FALSE' otherwise.
14444
14445_Example_:
14446          program test_nan
14447            implicit none
14448            real :: x
14449            x = -1.0
14450            x = sqrt(x)
14451            if (isnan(x)) stop '"x" is a NaN'
14452          end program test_nan
14453
14454
14455File: gfortran.info,  Node: ITIME,  Next: KILL,  Prev: ISNAN,  Up: Intrinsic Procedures
14456
144579.162 'ITIME' -- Get current local time subroutine (hour/minutes/seconds)
14458=========================================================================
14459
14460_Description_:
14461     'ITIME(VALUES)' Fills VALUES with the numerical values at the
14462     current local time.  The hour (in the range 1-24), minute (in the
14463     range 1-60), and seconds (in the range 1-60) appear in elements 1,
14464     2, and 3 of VALUES, respectively.
14465
14466     This intrinsic routine is provided for backwards compatibility with
14467     GNU Fortran 77.  In new code, programmers should consider the use
14468     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
14469     standard.
14470
14471_Standard_:
14472     GNU extension
14473
14474_Class_:
14475     Subroutine
14476
14477_Syntax_:
14478     'CALL ITIME(VALUES)'
14479
14480_Arguments_:
14481     VALUES      The type shall be 'INTEGER, DIMENSION(3)' and
14482                 the kind shall be the default integer kind.
14483
14484_Return value_:
14485     Does not return anything.
14486
14487_Example_:
14488          program test_itime
14489            integer, dimension(3) :: tarray
14490            call itime(tarray)
14491            print *, tarray(1)
14492            print *, tarray(2)
14493            print *, tarray(3)
14494          end program test_itime
14495
14496_See also_:
14497     *note DATE_AND_TIME::
14498
14499
14500File: gfortran.info,  Node: KILL,  Next: KIND,  Prev: ITIME,  Up: Intrinsic Procedures
14501
145029.163 'KILL' -- Send a signal to a process
14503==========================================
14504
14505_Description_:
14506_Standard_:
14507     Sends the signal specified by SIG to the process PID.  See
14508     'kill(2)'.
14509
14510     This intrinsic is provided in both subroutine and function forms;
14511     however, only one form can be used in any given program unit.
14512
14513_Class_:
14514     Subroutine, function
14515
14516_Syntax_:
14517     'CALL KILL(PID, SIG [, STATUS])'
14518     'STATUS = KILL(PID, SIG)'
14519
14520_Arguments_:
14521     PID         Shall be a scalar 'INTEGER' with 'INTENT(IN)'.
14522     SIG         Shall be a scalar 'INTEGER' with 'INTENT(IN)'.
14523     STATUS      [Subroutine](Optional) Shall be a scalar
14524                 'INTEGER'.  Returns 0 on success; otherwise a
14525                 system-specific error code is returned.
14526     STATUS      [Function] The kind type parameter is that of
14527                 'pid'.  Returns 0 on success; otherwise a
14528                 system-specific error code is returned.
14529
14530_See also_:
14531     *note ABORT::, *note EXIT::
14532
14533
14534File: gfortran.info,  Node: KIND,  Next: LBOUND,  Prev: KILL,  Up: Intrinsic Procedures
14535
145369.164 'KIND' -- Kind of an entity
14537=================================
14538
14539_Description_:
14540     'KIND(X)' returns the kind value of the entity X.
14541
14542_Standard_:
14543     Fortran 95 and later
14544
14545_Class_:
14546     Inquiry function
14547
14548_Syntax_:
14549     'K = KIND(X)'
14550
14551_Arguments_:
14552     X           Shall be of type 'LOGICAL', 'INTEGER', 'REAL',
14553                 'COMPLEX' or 'CHARACTER'.
14554
14555_Return value_:
14556     The return value is a scalar of type 'INTEGER' and of the default
14557     integer kind.
14558
14559_Example_:
14560          program test_kind
14561            integer,parameter :: kc = kind(' ')
14562            integer,parameter :: kl = kind(.true.)
14563
14564            print *, "The default character kind is ", kc
14565            print *, "The default logical kind is ", kl
14566          end program test_kind
14567
14568
14569File: gfortran.info,  Node: LBOUND,  Next: LCOBOUND,  Prev: KIND,  Up: Intrinsic Procedures
14570
145719.165 'LBOUND' -- Lower dimension bounds of an array
14572====================================================
14573
14574_Description_:
14575     Returns the lower bounds of an array, or a single lower bound along
14576     the DIM dimension.
14577_Standard_:
14578     Fortran 95 and later, with KIND argument Fortran 2003 and later
14579
14580_Class_:
14581     Inquiry function
14582
14583_Syntax_:
14584     'RESULT = LBOUND(ARRAY [, DIM [, KIND]])'
14585
14586_Arguments_:
14587     ARRAY       Shall be an array, of any type.
14588     DIM         (Optional) Shall be a scalar 'INTEGER'.
14589     KIND        (Optional) An 'INTEGER' initialization
14590                 expression indicating the kind parameter of the
14591                 result.
14592
14593_Return value_:
14594     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14595     absent, the return value is of default integer kind.  If DIM is
14596     absent, the result is an array of the lower bounds of ARRAY.  If
14597     DIM is present, the result is a scalar corresponding to the lower
14598     bound of the array along that dimension.  If ARRAY is an expression
14599     rather than a whole array or array structure component, or if it
14600     has a zero extent along the relevant dimension, the lower bound is
14601     taken to be 1.
14602
14603_See also_:
14604     *note UBOUND::, *note LCOBOUND::
14605
14606
14607File: gfortran.info,  Node: LCOBOUND,  Next: LEADZ,  Prev: LBOUND,  Up: Intrinsic Procedures
14608
146099.166 'LCOBOUND' -- Lower codimension bounds of an array
14610========================================================
14611
14612_Description_:
14613     Returns the lower bounds of a coarray, or a single lower cobound
14614     along the DIM codimension.
14615_Standard_:
14616     Fortran 2008 and later
14617
14618_Class_:
14619     Inquiry function
14620
14621_Syntax_:
14622     'RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])'
14623
14624_Arguments_:
14625     ARRAY       Shall be an coarray, of any type.
14626     DIM         (Optional) Shall be a scalar 'INTEGER'.
14627     KIND        (Optional) An 'INTEGER' initialization
14628                 expression indicating the kind parameter of the
14629                 result.
14630
14631_Return value_:
14632     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14633     absent, the return value is of default integer kind.  If DIM is
14634     absent, the result is an array of the lower cobounds of COARRAY.
14635     If DIM is present, the result is a scalar corresponding to the
14636     lower cobound of the array along that codimension.
14637
14638_See also_:
14639     *note UCOBOUND::, *note LBOUND::
14640
14641
14642File: gfortran.info,  Node: LEADZ,  Next: LEN,  Prev: LCOBOUND,  Up: Intrinsic Procedures
14643
146449.167 'LEADZ' -- Number of leading zero bits of an integer
14645==========================================================
14646
14647_Description_:
14648     'LEADZ' returns the number of leading zero bits of an integer.
14649
14650_Standard_:
14651     Fortran 2008 and later
14652
14653_Class_:
14654     Elemental function
14655
14656_Syntax_:
14657     'RESULT = LEADZ(I)'
14658
14659_Arguments_:
14660     I           Shall be of type 'INTEGER'.
14661
14662_Return value_:
14663     The type of the return value is the default 'INTEGER'.  If all the
14664     bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
14665
14666_Example_:
14667          PROGRAM test_leadz
14668            WRITE (*,*) BIT_SIZE(1)  ! prints 32
14669            WRITE (*,*) LEADZ(1)     ! prints 31
14670          END PROGRAM
14671
14672_See also_:
14673     *note BIT_SIZE::, *note TRAILZ::, *note POPCNT::, *note POPPAR::
14674
14675
14676File: gfortran.info,  Node: LEN,  Next: LEN_TRIM,  Prev: LEADZ,  Up: Intrinsic Procedures
14677
146789.168 'LEN' -- Length of a character entity
14679===========================================
14680
14681_Description_:
14682     Returns the length of a character string.  If STRING is an array,
14683     the length of an element of STRING is returned.  Note that STRING
14684     need not be defined when this intrinsic is invoked, since only the
14685     length, not the content, of STRING is needed.
14686
14687_Standard_:
14688     Fortran 77 and later, with KIND argument Fortran 2003 and later
14689
14690_Class_:
14691     Inquiry function
14692
14693_Syntax_:
14694     'L = LEN(STRING [, KIND])'
14695
14696_Arguments_:
14697     STRING      Shall be a scalar or array of type 'CHARACTER',
14698                 with 'INTENT(IN)'
14699     KIND        (Optional) An 'INTEGER' initialization
14700                 expression indicating the kind parameter of the
14701                 result.
14702
14703_Return value_:
14704     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14705     absent, the return value is of default integer kind.
14706
14707_Specific names_:
14708     Name           Argument       Return type    Standard
14709     'LEN(STRING)'  'CHARACTER'    'INTEGER'      Fortran 77 and
14710                                                  later
14711
14712_See also_:
14713     *note LEN_TRIM::, *note ADJUSTL::, *note ADJUSTR::
14714
14715
14716File: gfortran.info,  Node: LEN_TRIM,  Next: LGE,  Prev: LEN,  Up: Intrinsic Procedures
14717
147189.169 'LEN_TRIM' -- Length of a character entity without trailing blank characters
14719==================================================================================
14720
14721_Description_:
14722     Returns the length of a character string, ignoring any trailing
14723     blanks.
14724
14725_Standard_:
14726     Fortran 95 and later, with KIND argument Fortran 2003 and later
14727
14728_Class_:
14729     Elemental function
14730
14731_Syntax_:
14732     'RESULT = LEN_TRIM(STRING [, KIND])'
14733
14734_Arguments_:
14735     STRING      Shall be a scalar of type 'CHARACTER', with
14736                 'INTENT(IN)'
14737     KIND        (Optional) An 'INTEGER' initialization
14738                 expression indicating the kind parameter of the
14739                 result.
14740
14741_Return value_:
14742     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
14743     absent, the return value is of default integer kind.
14744
14745_See also_:
14746     *note LEN::, *note ADJUSTL::, *note ADJUSTR::
14747
14748
14749File: gfortran.info,  Node: LGE,  Next: LGT,  Prev: LEN_TRIM,  Up: Intrinsic Procedures
14750
147519.170 'LGE' -- Lexical greater than or equal
14752============================================
14753
14754_Description_:
14755     Determines whether one string is lexically greater than or equal to
14756     another string, where the two strings are interpreted as containing
14757     ASCII character codes.  If the String A and String B are not the
14758     same length, the shorter is compared as if spaces were appended to
14759     it to form a value that has the same length as the longer.
14760
14761     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14762     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14763     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14764     character ordering (which is not ASCII on some targets), whereas
14765     the former always use the ASCII ordering.
14766
14767_Standard_:
14768     Fortran 77 and later
14769
14770_Class_:
14771     Elemental function
14772
14773_Syntax_:
14774     'RESULT = LGE(STRING_A, STRING_B)'
14775
14776_Arguments_:
14777     STRING_A    Shall be of default 'CHARACTER' type.
14778     STRING_B    Shall be of default 'CHARACTER' type.
14779
14780_Return value_:
14781     Returns '.TRUE.' if 'STRING_A >= STRING_B', and '.FALSE.'
14782     otherwise, based on the ASCII ordering.
14783
14784_Specific names_:
14785     Name           Argument       Return type    Standard
14786     'LGE(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14787     STRING_B)'                                   later
14788
14789_See also_:
14790     *note LGT::, *note LLE::, *note LLT::
14791
14792
14793File: gfortran.info,  Node: LGT,  Next: LINK,  Prev: LGE,  Up: Intrinsic Procedures
14794
147959.171 'LGT' -- Lexical greater than
14796===================================
14797
14798_Description_:
14799     Determines whether one string is lexically greater than another
14800     string, where the two strings are interpreted as containing ASCII
14801     character codes.  If the String A and String B are not the same
14802     length, the shorter is compared as if spaces were appended to it to
14803     form a value that has the same length as the longer.
14804
14805     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14806     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14807     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14808     character ordering (which is not ASCII on some targets), whereas
14809     the former always use the ASCII ordering.
14810
14811_Standard_:
14812     Fortran 77 and later
14813
14814_Class_:
14815     Elemental function
14816
14817_Syntax_:
14818     'RESULT = LGT(STRING_A, STRING_B)'
14819
14820_Arguments_:
14821     STRING_A    Shall be of default 'CHARACTER' type.
14822     STRING_B    Shall be of default 'CHARACTER' type.
14823
14824_Return value_:
14825     Returns '.TRUE.' if 'STRING_A > STRING_B', and '.FALSE.' otherwise,
14826     based on the ASCII ordering.
14827
14828_Specific names_:
14829     Name           Argument       Return type    Standard
14830     'LGT(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14831     STRING_B)'                                   later
14832
14833_See also_:
14834     *note LGE::, *note LLE::, *note LLT::
14835
14836
14837File: gfortran.info,  Node: LINK,  Next: LLE,  Prev: LGT,  Up: Intrinsic Procedures
14838
148399.172 'LINK' -- Create a hard link
14840==================================
14841
14842_Description_:
14843     Makes a (hard) link from file PATH1 to PATH2.  A null character
14844     ('CHAR(0)') can be used to mark the end of the names in PATH1 and
14845     PATH2; otherwise, trailing blanks in the file names are ignored.
14846     If the STATUS argument is supplied, it contains 0 on success or a
14847     nonzero error code upon return; see 'link(2)'.
14848
14849     This intrinsic is provided in both subroutine and function forms;
14850     however, only one form can be used in any given program unit.
14851
14852_Standard_:
14853     GNU extension
14854
14855_Class_:
14856     Subroutine, function
14857
14858_Syntax_:
14859     'CALL LINK(PATH1, PATH2 [, STATUS])'
14860     'STATUS = LINK(PATH1, PATH2)'
14861
14862_Arguments_:
14863     PATH1       Shall be of default 'CHARACTER' type.
14864     PATH2       Shall be of default 'CHARACTER' type.
14865     STATUS      (Optional) Shall be of default 'INTEGER' type.
14866
14867_See also_:
14868     *note SYMLNK::, *note UNLINK::
14869
14870
14871File: gfortran.info,  Node: LLE,  Next: LLT,  Prev: LINK,  Up: Intrinsic Procedures
14872
148739.173 'LLE' -- Lexical less than or equal
14874=========================================
14875
14876_Description_:
14877     Determines whether one string is lexically less than or equal to
14878     another string, where the two strings are interpreted as containing
14879     ASCII character codes.  If the String A and String B are not the
14880     same length, the shorter is compared as if spaces were appended to
14881     it to form a value that has the same length as the longer.
14882
14883     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14884     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14885     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14886     character ordering (which is not ASCII on some targets), whereas
14887     the former always use the ASCII ordering.
14888
14889_Standard_:
14890     Fortran 77 and later
14891
14892_Class_:
14893     Elemental function
14894
14895_Syntax_:
14896     'RESULT = LLE(STRING_A, STRING_B)'
14897
14898_Arguments_:
14899     STRING_A    Shall be of default 'CHARACTER' type.
14900     STRING_B    Shall be of default 'CHARACTER' type.
14901
14902_Return value_:
14903     Returns '.TRUE.' if 'STRING_A <= STRING_B', and '.FALSE.'
14904     otherwise, based on the ASCII ordering.
14905
14906_Specific names_:
14907     Name           Argument       Return type    Standard
14908     'LLE(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14909     STRING_B)'                                   later
14910
14911_See also_:
14912     *note LGE::, *note LGT::, *note LLT::
14913
14914
14915File: gfortran.info,  Node: LLT,  Next: LNBLNK,  Prev: LLE,  Up: Intrinsic Procedures
14916
149179.174 'LLT' -- Lexical less than
14918================================
14919
14920_Description_:
14921     Determines whether one string is lexically less than another
14922     string, where the two strings are interpreted as containing ASCII
14923     character codes.  If the String A and String B are not the same
14924     length, the shorter is compared as if spaces were appended to it to
14925     form a value that has the same length as the longer.
14926
14927     In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE',
14928     and 'LLT' differ from the corresponding intrinsic operators '.GE.',
14929     '.GT.', '.LE.', and '.LT.', in that the latter use the processor's
14930     character ordering (which is not ASCII on some targets), whereas
14931     the former always use the ASCII ordering.
14932
14933_Standard_:
14934     Fortran 77 and later
14935
14936_Class_:
14937     Elemental function
14938
14939_Syntax_:
14940     'RESULT = LLT(STRING_A, STRING_B)'
14941
14942_Arguments_:
14943     STRING_A    Shall be of default 'CHARACTER' type.
14944     STRING_B    Shall be of default 'CHARACTER' type.
14945
14946_Return value_:
14947     Returns '.TRUE.' if 'STRING_A < STRING_B', and '.FALSE.' otherwise,
14948     based on the ASCII ordering.
14949
14950_Specific names_:
14951     Name           Argument       Return type    Standard
14952     'LLT(STRING_A, 'CHARACTER'    'LOGICAL'      Fortran 77 and
14953     STRING_B)'                                   later
14954
14955_See also_:
14956     *note LGE::, *note LGT::, *note LLE::
14957
14958
14959File: gfortran.info,  Node: LNBLNK,  Next: LOC,  Prev: LLT,  Up: Intrinsic Procedures
14960
149619.175 'LNBLNK' -- Index of the last non-blank character in a string
14962===================================================================
14963
14964_Description_:
14965     Returns the length of a character string, ignoring any trailing
14966     blanks.  This is identical to the standard 'LEN_TRIM' intrinsic,
14967     and is only included for backwards compatibility.
14968
14969_Standard_:
14970     GNU extension
14971
14972_Class_:
14973     Elemental function
14974
14975_Syntax_:
14976     'RESULT = LNBLNK(STRING)'
14977
14978_Arguments_:
14979     STRING      Shall be a scalar of type 'CHARACTER', with
14980                 'INTENT(IN)'
14981
14982_Return value_:
14983     The return value is of 'INTEGER(kind=4)' type.
14984
14985_See also_:
14986     *note INDEX intrinsic::, *note LEN_TRIM::
14987
14988
14989File: gfortran.info,  Node: LOC,  Next: LOG,  Prev: LNBLNK,  Up: Intrinsic Procedures
14990
149919.176 'LOC' -- Returns the address of a variable
14992================================================
14993
14994_Description_:
14995     'LOC(X)' returns the address of X as an integer.
14996
14997_Standard_:
14998     GNU extension
14999
15000_Class_:
15001     Inquiry function
15002
15003_Syntax_:
15004     'RESULT = LOC(X)'
15005
15006_Arguments_:
15007     X           Variable of any type.
15008
15009_Return value_:
15010     The return value is of type 'INTEGER', with a 'KIND' corresponding
15011     to the size (in bytes) of a memory address on the target machine.
15012
15013_Example_:
15014          program test_loc
15015            integer :: i
15016            real :: r
15017            i = loc(r)
15018            print *, i
15019          end program test_loc
15020
15021
15022File: gfortran.info,  Node: LOG,  Next: LOG10,  Prev: LOC,  Up: Intrinsic Procedures
15023
150249.177 'LOG' -- Natural logarithm function
15025=========================================
15026
15027_Description_:
15028     'LOG(X)' computes the natural logarithm of X, i.e.  the logarithm
15029     to the base e.
15030
15031_Standard_:
15032     Fortran 77 and later
15033
15034_Class_:
15035     Elemental function
15036
15037_Syntax_:
15038     'RESULT = LOG(X)'
15039
15040_Arguments_:
15041     X           The type shall be 'REAL' or 'COMPLEX'.
15042
15043_Return value_:
15044     The return value is of type 'REAL' or 'COMPLEX'.  The kind type
15045     parameter is the same as X.  If X is 'COMPLEX', the imaginary part
15046     \omega is in the range -\pi < \omega \leq \pi.
15047
15048_Example_:
15049          program test_log
15050            real(8) :: x = 2.7182818284590451_8
15051            complex :: z = (1.0, 2.0)
15052            x = log(x)    ! will yield (approximately) 1
15053            z = log(z)
15054          end program test_log
15055
15056_Specific names_:
15057     Name           Argument       Return type    Standard
15058     'ALOG(X)'      'REAL(4) X'    'REAL(4)'      f95, gnu
15059     'DLOG(X)'      'REAL(8) X'    'REAL(8)'      f95, gnu
15060     'CLOG(X)'      'COMPLEX(4)    'COMPLEX(4)'   f95, gnu
15061                    X'
15062     'ZLOG(X)'      'COMPLEX(8)    'COMPLEX(8)'   f95, gnu
15063                    X'
15064     'CDLOG(X)'     'COMPLEX(8)    'COMPLEX(8)'   f95, gnu
15065                    X'
15066
15067
15068File: gfortran.info,  Node: LOG10,  Next: LOG_GAMMA,  Prev: LOG,  Up: Intrinsic Procedures
15069
150709.178 'LOG10' -- Base 10 logarithm function
15071===========================================
15072
15073_Description_:
15074     'LOG10(X)' computes the base 10 logarithm of X.
15075
15076_Standard_:
15077     Fortran 77 and later
15078
15079_Class_:
15080     Elemental function
15081
15082_Syntax_:
15083     'RESULT = LOG10(X)'
15084
15085_Arguments_:
15086     X           The type shall be 'REAL'.
15087
15088_Return value_:
15089     The return value is of type 'REAL' or 'COMPLEX'.  The kind type
15090     parameter is the same as X.
15091
15092_Example_:
15093          program test_log10
15094            real(8) :: x = 10.0_8
15095            x = log10(x)
15096          end program test_log10
15097
15098_Specific names_:
15099     Name           Argument       Return type    Standard
15100     'ALOG10(X)'    'REAL(4) X'    'REAL(4)'      Fortran 95 and
15101                                                  later
15102     'DLOG10(X)'    'REAL(8) X'    'REAL(8)'      Fortran 95 and
15103                                                  later
15104
15105
15106File: gfortran.info,  Node: LOG_GAMMA,  Next: LOGICAL,  Prev: LOG10,  Up: Intrinsic Procedures
15107
151089.179 'LOG_GAMMA' -- Logarithm of the Gamma function
15109====================================================
15110
15111_Description_:
15112     'LOG_GAMMA(X)' computes the natural logarithm of the absolute value
15113     of the Gamma (\Gamma) function.
15114
15115_Standard_:
15116     Fortran 2008 and later
15117
15118_Class_:
15119     Elemental function
15120
15121_Syntax_:
15122     'X = LOG_GAMMA(X)'
15123
15124_Arguments_:
15125     X           Shall be of type 'REAL' and neither zero nor a
15126                 negative integer.
15127
15128_Return value_:
15129     The return value is of type 'REAL' of the same kind as X.
15130
15131_Example_:
15132          program test_log_gamma
15133            real :: x = 1.0
15134            x = lgamma(x) ! returns 0.0
15135          end program test_log_gamma
15136
15137_Specific names_:
15138     Name           Argument       Return type    Standard
15139     'LGAMMA(X)'    'REAL(4) X'    'REAL(4)'      GNU Extension
15140     'ALGAMA(X)'    'REAL(4) X'    'REAL(4)'      GNU Extension
15141     'DLGAMA(X)'    'REAL(8) X'    'REAL(8)'      GNU Extension
15142
15143_See also_:
15144     Gamma function: *note GAMMA::
15145
15146
15147File: gfortran.info,  Node: LOGICAL,  Next: LONG,  Prev: LOG_GAMMA,  Up: Intrinsic Procedures
15148
151499.180 'LOGICAL' -- Convert to logical type
15150==========================================
15151
15152_Description_:
15153     Converts one kind of 'LOGICAL' variable to another.
15154
15155_Standard_:
15156     Fortran 95 and later
15157
15158_Class_:
15159     Elemental function
15160
15161_Syntax_:
15162     'RESULT = LOGICAL(L [, KIND])'
15163
15164_Arguments_:
15165     L           The type shall be 'LOGICAL'.
15166     KIND        (Optional) An 'INTEGER' initialization
15167                 expression indicating the kind parameter of the
15168                 result.
15169
15170_Return value_:
15171     The return value is a 'LOGICAL' value equal to L, with a kind
15172     corresponding to KIND, or of the default logical kind if KIND is
15173     not given.
15174
15175_See also_:
15176     *note INT::, *note REAL::, *note CMPLX::
15177
15178
15179File: gfortran.info,  Node: LONG,  Next: LSHIFT,  Prev: LOGICAL,  Up: Intrinsic Procedures
15180
151819.181 'LONG' -- Convert to integer type
15182=======================================
15183
15184_Description_:
15185     Convert to a 'KIND=4' integer type, which is the same size as a C
15186     'long' integer.  This is equivalent to the standard 'INT' intrinsic
15187     with an optional argument of 'KIND=4', and is only included for
15188     backwards compatibility.
15189
15190_Standard_:
15191     GNU extension
15192
15193_Class_:
15194     Elemental function
15195
15196_Syntax_:
15197     'RESULT = LONG(A)'
15198
15199_Arguments_:
15200     A           Shall be of type 'INTEGER', 'REAL', or
15201                 'COMPLEX'.
15202
15203_Return value_:
15204     The return value is a 'INTEGER(4)' variable.
15205
15206_See also_:
15207     *note INT::, *note INT2::, *note INT8::
15208
15209
15210File: gfortran.info,  Node: LSHIFT,  Next: LSTAT,  Prev: LONG,  Up: Intrinsic Procedures
15211
152129.182 'LSHIFT' -- Left shift bits
15213=================================
15214
15215_Description_:
15216     'LSHIFT' returns a value corresponding to I with all of the bits
15217     shifted left by SHIFT places.  SHIFT shall be nonnegative and less
15218     than or equal to 'BIT_SIZE(I)', otherwise the result value is
15219     undefined.  Bits shifted out from the left end are lost; zeros are
15220     shifted in from the opposite end.
15221
15222     This function has been superseded by the 'ISHFT' intrinsic, which
15223     is standard in Fortran 95 and later, and the 'SHIFTL' intrinsic,
15224     which is standard in Fortran 2008 and later.
15225
15226_Standard_:
15227     GNU extension
15228
15229_Class_:
15230     Elemental function
15231
15232_Syntax_:
15233     'RESULT = LSHIFT(I, SHIFT)'
15234
15235_Arguments_:
15236     I           The type shall be 'INTEGER'.
15237     SHIFT       The type shall be 'INTEGER'.
15238
15239_Return value_:
15240     The return value is of type 'INTEGER' and of the same kind as I.
15241
15242_See also_:
15243     *note ISHFT::, *note ISHFTC::, *note RSHIFT::, *note SHIFTA::,
15244     *note SHIFTL::, *note SHIFTR::
15245
15246
15247File: gfortran.info,  Node: LSTAT,  Next: LTIME,  Prev: LSHIFT,  Up: Intrinsic Procedures
15248
152499.183 'LSTAT' -- Get file status
15250================================
15251
15252_Description_:
15253     'LSTAT' is identical to *note STAT::, except that if path is a
15254     symbolic link, then the link itself is statted, not the file that
15255     it refers to.
15256
15257     The elements in 'VALUES' are the same as described by *note STAT::.
15258
15259     This intrinsic is provided in both subroutine and function forms;
15260     however, only one form can be used in any given program unit.
15261
15262_Standard_:
15263     GNU extension
15264
15265_Class_:
15266     Subroutine, function
15267
15268_Syntax_:
15269     'CALL LSTAT(NAME, VALUES [, STATUS])'
15270     'STATUS = LSTAT(NAME, VALUES)'
15271
15272_Arguments_:
15273     NAME        The type shall be 'CHARACTER' of the default
15274                 kind, a valid path within the file system.
15275     VALUES      The type shall be 'INTEGER(4), DIMENSION(13)'.
15276     STATUS      (Optional) status flag of type 'INTEGER(4)'.
15277                 Returns 0 on success and a system specific error
15278                 code otherwise.
15279
15280_Example_:
15281     See *note STAT:: for an example.
15282
15283_See also_:
15284     To stat an open file: *note FSTAT::, to stat a file: *note STAT::
15285
15286
15287File: gfortran.info,  Node: LTIME,  Next: MALLOC,  Prev: LSTAT,  Up: Intrinsic Procedures
15288
152899.184 'LTIME' -- Convert time to local time info
15290================================================
15291
15292_Description_:
15293     Given a system time value TIME (as provided by the *note TIME::
15294     intrinsic), fills VALUES with values extracted from it appropriate
15295     to the local time zone using 'localtime(3)'.
15296
15297     This intrinsic routine is provided for backwards compatibility with
15298     GNU Fortran 77.  In new code, programmers should consider the use
15299     of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95
15300     standard.
15301
15302_Standard_:
15303     GNU extension
15304
15305_Class_:
15306     Subroutine
15307
15308_Syntax_:
15309     'CALL LTIME(TIME, VALUES)'
15310
15311_Arguments_:
15312     TIME        An 'INTEGER' scalar expression corresponding to
15313                 a system time, with 'INTENT(IN)'.
15314     VALUES      A default 'INTEGER' array with 9 elements, with
15315                 'INTENT(OUT)'.
15316
15317_Return value_:
15318     The elements of VALUES are assigned as follows:
15319       1. Seconds after the minute, range 0-59 or 0-61 to allow for leap
15320          seconds
15321       2. Minutes after the hour, range 0-59
15322       3. Hours past midnight, range 0-23
15323       4. Day of month, range 1-31
15324       5. Number of months since January, range 0-11
15325       6. Years since 1900
15326       7. Number of days since Sunday, range 0-6
15327       8. Days since January 1, range 0-365
15328       9. Daylight savings indicator: positive if daylight savings is in
15329          effect, zero if not, and negative if the information is not
15330          available.
15331
15332_See also_:
15333     *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note TIME::,
15334     *note TIME8::
15335
15336
15337File: gfortran.info,  Node: MALLOC,  Next: MASKL,  Prev: LTIME,  Up: Intrinsic Procedures
15338
153399.185 'MALLOC' -- Allocate dynamic memory
15340=========================================
15341
15342_Description_:
15343     'MALLOC(SIZE)' allocates SIZE bytes of dynamic memory and returns
15344     the address of the allocated memory.  The 'MALLOC' intrinsic is an
15345     extension intended to be used with Cray pointers, and is provided
15346     in GNU Fortran to allow the user to compile legacy code.  For new
15347     code using Fortran 95 pointers, the memory allocation intrinsic is
15348     'ALLOCATE'.
15349
15350_Standard_:
15351     GNU extension
15352
15353_Class_:
15354     Function
15355
15356_Syntax_:
15357     'PTR = MALLOC(SIZE)'
15358
15359_Arguments_:
15360     SIZE        The type shall be 'INTEGER'.
15361
15362_Return value_:
15363     The return value is of type 'INTEGER(K)', with K such that
15364     variables of type 'INTEGER(K)' have the same size as C pointers
15365     ('sizeof(void *)').
15366
15367_Example_:
15368     The following example demonstrates the use of 'MALLOC' and 'FREE'
15369     with Cray pointers.
15370
15371          program test_malloc
15372            implicit none
15373            integer i
15374            real*8 x(*), z
15375            pointer(ptr_x,x)
15376
15377            ptr_x = malloc(20*8)
15378            do i = 1, 20
15379              x(i) = sqrt(1.0d0 / i)
15380            end do
15381            z = 0
15382            do i = 1, 20
15383              z = z + x(i)
15384              print *, z
15385            end do
15386            call free(ptr_x)
15387          end program test_malloc
15388
15389_See also_:
15390     *note FREE::
15391
15392
15393File: gfortran.info,  Node: MASKL,  Next: MASKR,  Prev: MALLOC,  Up: Intrinsic Procedures
15394
153959.186 'MASKL' -- Left justified mask
15396====================================
15397
15398_Description_:
15399     'MASKL(I[, KIND])' has its leftmost I bits set to 1, and the
15400     remaining bits set to 0.
15401
15402_Standard_:
15403     Fortran 2008 and later
15404
15405_Class_:
15406     Elemental function
15407
15408_Syntax_:
15409     'RESULT = MASKL(I[, KIND])'
15410
15411_Arguments_:
15412     I           Shall be of type 'INTEGER'.
15413     KIND        Shall be a scalar constant expression of type
15414                 'INTEGER'.
15415
15416_Return value_:
15417     The return value is of type 'INTEGER'.  If KIND is present, it
15418     specifies the kind value of the return type; otherwise, it is of
15419     the default integer kind.
15420
15421_See also_:
15422     *note MASKR::
15423
15424
15425File: gfortran.info,  Node: MASKR,  Next: MATMUL,  Prev: MASKL,  Up: Intrinsic Procedures
15426
154279.187 'MASKR' -- Right justified mask
15428=====================================
15429
15430_Description_:
15431     'MASKL(I[, KIND])' has its rightmost I bits set to 1, and the
15432     remaining bits set to 0.
15433
15434_Standard_:
15435     Fortran 2008 and later
15436
15437_Class_:
15438     Elemental function
15439
15440_Syntax_:
15441     'RESULT = MASKR(I[, KIND])'
15442
15443_Arguments_:
15444     I           Shall be of type 'INTEGER'.
15445     KIND        Shall be a scalar constant expression of type
15446                 'INTEGER'.
15447
15448_Return value_:
15449     The return value is of type 'INTEGER'.  If KIND is present, it
15450     specifies the kind value of the return type; otherwise, it is of
15451     the default integer kind.
15452
15453_See also_:
15454     *note MASKL::
15455
15456
15457File: gfortran.info,  Node: MATMUL,  Next: MAX,  Prev: MASKR,  Up: Intrinsic Procedures
15458
154599.188 'MATMUL' -- matrix multiplication
15460=======================================
15461
15462_Description_:
15463     Performs a matrix multiplication on numeric or logical arguments.
15464
15465_Standard_:
15466     Fortran 95 and later
15467
15468_Class_:
15469     Transformational function
15470
15471_Syntax_:
15472     'RESULT = MATMUL(MATRIX_A, MATRIX_B)'
15473
15474_Arguments_:
15475     MATRIX_A    An array of 'INTEGER', 'REAL', 'COMPLEX', or
15476                 'LOGICAL' type, with a rank of one or two.
15477     MATRIX_B    An array of 'INTEGER', 'REAL', or 'COMPLEX' type
15478                 if MATRIX_A is of a numeric type; otherwise, an
15479                 array of 'LOGICAL' type.  The rank shall be one
15480                 or two, and the first (or only) dimension of
15481                 MATRIX_B shall be equal to the last (or only)
15482                 dimension of MATRIX_A.  MATRIX_A and MATRIX_B
15483                 shall not both be rank one arrays.
15484
15485_Return value_:
15486     The matrix product of MATRIX_A and MATRIX_B.  The type and kind of
15487     the result follow the usual type and kind promotion rules, as for
15488     the '*' or '.AND.' operators.
15489
15490_See also_:
15491
15492
15493File: gfortran.info,  Node: MAX,  Next: MAXEXPONENT,  Prev: MATMUL,  Up: Intrinsic Procedures
15494
154959.189 'MAX' -- Maximum value of an argument list
15496================================================
15497
15498_Description_:
15499     Returns the argument with the largest (most positive) value.
15500
15501_Standard_:
15502     Fortran 77 and later
15503
15504_Class_:
15505     Elemental function
15506
15507_Syntax_:
15508     'RESULT = MAX(A1, A2 [, A3 [, ...]])'
15509
15510_Arguments_:
15511     A1          The type shall be 'INTEGER' or 'REAL'.
15512     A2, A3,     An expression of the same type and kind as A1.
15513     ...         (As a GNU extension, arguments of different
15514                 kinds are permitted.)
15515
15516_Return value_:
15517     The return value corresponds to the maximum value among the
15518     arguments, and has the same type and kind as the first argument.
15519
15520_Specific names_:
15521     Name           Argument       Return type    Standard
15522     'MAX0(A1)'     'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
15523                    A1'                           later
15524     'AMAX0(A1)'    'INTEGER(4)    'REAL(MAX(X))' Fortran 77 and
15525                    A1'                           later
15526     'MAX1(A1)'     'REAL A1'      'INT(MAX(X))'  Fortran 77 and
15527                                                  later
15528     'AMAX1(A1)'    'REAL(4) A1'   'REAL(4)'      Fortran 77 and
15529                                                  later
15530     'DMAX1(A1)'    'REAL(8) A1'   'REAL(8)'      Fortran 77 and
15531                                                  later
15532
15533_See also_:
15534     *note MAXLOC:: *note MAXVAL::, *note MIN::
15535
15536
15537File: gfortran.info,  Node: MAXEXPONENT,  Next: MAXLOC,  Prev: MAX,  Up: Intrinsic Procedures
15538
155399.190 'MAXEXPONENT' -- Maximum exponent of a real kind
15540======================================================
15541
15542_Description_:
15543     'MAXEXPONENT(X)' returns the maximum exponent in the model of the
15544     type of 'X'.
15545
15546_Standard_:
15547     Fortran 95 and later
15548
15549_Class_:
15550     Inquiry function
15551
15552_Syntax_:
15553     'RESULT = MAXEXPONENT(X)'
15554
15555_Arguments_:
15556     X           Shall be of type 'REAL'.
15557
15558_Return value_:
15559     The return value is of type 'INTEGER' and of the default integer
15560     kind.
15561
15562_Example_:
15563          program exponents
15564            real(kind=4) :: x
15565            real(kind=8) :: y
15566
15567            print *, minexponent(x), maxexponent(x)
15568            print *, minexponent(y), maxexponent(y)
15569          end program exponents
15570
15571
15572File: gfortran.info,  Node: MAXLOC,  Next: MAXVAL,  Prev: MAXEXPONENT,  Up: Intrinsic Procedures
15573
155749.191 'MAXLOC' -- Location of the maximum value within an array
15575===============================================================
15576
15577_Description_:
15578     Determines the location of the element in the array with the
15579     maximum value, or, if the DIM argument is supplied, determines the
15580     locations of the maximum element along each row of the array in the
15581     DIM direction.  If MASK is present, only the elements for which
15582     MASK is '.TRUE.' are considered.  If more than one element in the
15583     array has the maximum value, the location returned is that of the
15584     first such element in array element order if the BACK is not
15585     present, or is false; if BACK is true, the location returned is
15586     that of the last such element.  If the array has zero size, or all
15587     of the elements of MASK are '.FALSE.', then the result is an array
15588     of zeroes.  Similarly, if DIM is supplied and all of the elements
15589     of MASK along a given row are zero, the result value for that row
15590     is zero.
15591
15592_Standard_:
15593     Fortran 95 and later; ARRAY of 'CHARACTER' and the KIND argument
15594     are available in Fortran 2003 and later.  The BACK argument is
15595     available in Fortran 2008 and later.
15596
15597_Class_:
15598     Transformational function
15599
15600_Syntax_:
15601     'RESULT = MAXLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])'
15602     'RESULT = MAXLOC(ARRAY [, MASK] [,KIND] [,BACK])'
15603
15604_Arguments_:
15605     ARRAY       Shall be an array of type 'INTEGER' or 'REAL'.
15606     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15607                 with a value between one and the rank of ARRAY,
15608                 inclusive.  It may not be an optional dummy
15609                 argument.
15610     MASK        Shall be an array of type 'LOGICAL', and
15611                 conformable with ARRAY.
15612     KIND        (Optional) An 'INTEGER' initialization
15613                 expression indicating the kind parameter of the
15614                 result.
15615     BACK        (Optional) A scalar of type 'LOGICAL'.
15616
15617_Return value_:
15618     If DIM is absent, the result is a rank-one array with a length
15619     equal to the rank of ARRAY.  If DIM is present, the result is an
15620     array with a rank one less than the rank of ARRAY, and a size
15621     corresponding to the size of ARRAY with the DIM dimension removed.
15622     If DIM is present and ARRAY has a rank of one, the result is a
15623     scalar.  If the optional argument KIND is present, the result is an
15624     integer of kind KIND, otherwise it is of default kind.
15625
15626_See also_:
15627     *note FINDLOC::, *note MAX::, *note MAXVAL::
15628
15629
15630File: gfortran.info,  Node: MAXVAL,  Next: MCLOCK,  Prev: MAXLOC,  Up: Intrinsic Procedures
15631
156329.192 'MAXVAL' -- Maximum value of an array
15633===========================================
15634
15635_Description_:
15636     Determines the maximum value of the elements in an array value, or,
15637     if the DIM argument is supplied, determines the maximum value along
15638     each row of the array in the DIM direction.  If MASK is present,
15639     only the elements for which MASK is '.TRUE.' are considered.  If
15640     the array has zero size, or all of the elements of MASK are
15641     '.FALSE.', then the result is '-HUGE(ARRAY)' if ARRAY is numeric,
15642     or a string of nulls if ARRAY is of character type.
15643
15644_Standard_:
15645     Fortran 95 and later
15646
15647_Class_:
15648     Transformational function
15649
15650_Syntax_:
15651     'RESULT = MAXVAL(ARRAY, DIM [, MASK])'
15652     'RESULT = MAXVAL(ARRAY [, MASK])'
15653
15654_Arguments_:
15655     ARRAY       Shall be an array of type 'INTEGER' or 'REAL'.
15656     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15657                 with a value between one and the rank of ARRAY,
15658                 inclusive.  It may not be an optional dummy
15659                 argument.
15660     MASK        Shall be an array of type 'LOGICAL', and
15661                 conformable with ARRAY.
15662
15663_Return value_:
15664     If DIM is absent, or if ARRAY has a rank of one, the result is a
15665     scalar.  If DIM is present, the result is an array with a rank one
15666     less than the rank of ARRAY, and a size corresponding to the size
15667     of ARRAY with the DIM dimension removed.  In all cases, the result
15668     is of the same type and kind as ARRAY.
15669
15670_See also_:
15671     *note MAX::, *note MAXLOC::
15672
15673
15674File: gfortran.info,  Node: MCLOCK,  Next: MCLOCK8,  Prev: MAXVAL,  Up: Intrinsic Procedures
15675
156769.193 'MCLOCK' -- Time function
15677===============================
15678
15679_Description_:
15680     Returns the number of clock ticks since the start of the process,
15681     based on the function 'clock(3)' in the C standard library.
15682
15683     This intrinsic is not fully portable, such as to systems with
15684     32-bit 'INTEGER' types but supporting times wider than 32 bits.
15685     Therefore, the values returned by this intrinsic might be, or
15686     become, negative, or numerically less than previous values, during
15687     a single run of the compiled program.
15688
15689_Standard_:
15690     GNU extension
15691
15692_Class_:
15693     Function
15694
15695_Syntax_:
15696     'RESULT = MCLOCK()'
15697
15698_Return value_:
15699     The return value is a scalar of type 'INTEGER(4)', equal to the
15700     number of clock ticks since the start of the process, or '-1' if
15701     the system does not support 'clock(3)'.
15702
15703_See also_:
15704     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
15705     TIME::
15706
15707
15708File: gfortran.info,  Node: MCLOCK8,  Next: MERGE,  Prev: MCLOCK,  Up: Intrinsic Procedures
15709
157109.194 'MCLOCK8' -- Time function (64-bit)
15711=========================================
15712
15713_Description_:
15714     Returns the number of clock ticks since the start of the process,
15715     based on the function 'clock(3)' in the C standard library.
15716
15717     _Warning:_ this intrinsic does not increase the range of the timing
15718     values over that returned by 'clock(3)'.  On a system with a 32-bit
15719     'clock(3)', 'MCLOCK8' will return a 32-bit value, even though it is
15720     converted to a 64-bit 'INTEGER(8)' value.  That means overflows of
15721     the 32-bit value can still occur.  Therefore, the values returned
15722     by this intrinsic might be or become negative or numerically less
15723     than previous values during a single run of the compiled program.
15724
15725_Standard_:
15726     GNU extension
15727
15728_Class_:
15729     Function
15730
15731_Syntax_:
15732     'RESULT = MCLOCK8()'
15733
15734_Return value_:
15735     The return value is a scalar of type 'INTEGER(8)', equal to the
15736     number of clock ticks since the start of the process, or '-1' if
15737     the system does not support 'clock(3)'.
15738
15739_See also_:
15740     *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note
15741     TIME8::
15742
15743
15744File: gfortran.info,  Node: MERGE,  Next: MERGE_BITS,  Prev: MCLOCK8,  Up: Intrinsic Procedures
15745
157469.195 'MERGE' -- Merge variables
15747================================
15748
15749_Description_:
15750     Select values from two arrays according to a logical mask.  The
15751     result is equal to TSOURCE if MASK is '.TRUE.', or equal to FSOURCE
15752     if it is '.FALSE.'.
15753
15754_Standard_:
15755     Fortran 95 and later
15756
15757_Class_:
15758     Elemental function
15759
15760_Syntax_:
15761     'RESULT = MERGE(TSOURCE, FSOURCE, MASK)'
15762
15763_Arguments_:
15764     TSOURCE     May be of any type.
15765     FSOURCE     Shall be of the same type and type parameters as
15766                 TSOURCE.
15767     MASK        Shall be of type 'LOGICAL'.
15768
15769_Return value_:
15770     The result is of the same type and type parameters as TSOURCE.
15771
15772
15773File: gfortran.info,  Node: MERGE_BITS,  Next: MIN,  Prev: MERGE,  Up: Intrinsic Procedures
15774
157759.196 'MERGE_BITS' -- Merge of bits under mask
15776==============================================
15777
15778_Description_:
15779     'MERGE_BITS(I, J, MASK)' merges the bits of I and J as determined
15780     by the mask.  The i-th bit of the result is equal to the i-th bit
15781     of I if the i-th bit of MASK is 1; it is equal to the i-th bit of J
15782     otherwise.
15783
15784_Standard_:
15785     Fortran 2008 and later
15786
15787_Class_:
15788     Elemental function
15789
15790_Syntax_:
15791     'RESULT = MERGE_BITS(I, J, MASK)'
15792
15793_Arguments_:
15794     I           Shall be of type 'INTEGER' or a
15795                 boz-literal-constant.
15796     J           Shall be of type 'INTEGER' with the same kind
15797                 type parameter as I or a boz-literal-constant.
15798                 I and J shall not both be boz-literal-constants.
15799     MASK        Shall be of type 'INTEGER' or a
15800                 boz-literal-constant and of the same kind as I.
15801
15802_Return value_:
15803     The result is of the same type and kind as I.
15804
15805
15806File: gfortran.info,  Node: MIN,  Next: MINEXPONENT,  Prev: MERGE_BITS,  Up: Intrinsic Procedures
15807
158089.197 'MIN' -- Minimum value of an argument list
15809================================================
15810
15811_Description_:
15812     Returns the argument with the smallest (most negative) value.
15813
15814_Standard_:
15815     Fortran 77 and later
15816
15817_Class_:
15818     Elemental function
15819
15820_Syntax_:
15821     'RESULT = MIN(A1, A2 [, A3, ...])'
15822
15823_Arguments_:
15824     A1          The type shall be 'INTEGER' or 'REAL'.
15825     A2, A3,     An expression of the same type and kind as A1.
15826     ...         (As a GNU extension, arguments of different
15827                 kinds are permitted.)
15828
15829_Return value_:
15830     The return value corresponds to the maximum value among the
15831     arguments, and has the same type and kind as the first argument.
15832
15833_Specific names_:
15834     Name           Argument       Return type    Standard
15835     'MIN0(A1)'     'INTEGER(4)    'INTEGER(4)'   Fortran 77 and
15836                    A1'                           later
15837     'AMIN0(A1)'    'INTEGER(4)    'REAL(4)'      Fortran 77 and
15838                    A1'                           later
15839     'MIN1(A1)'     'REAL A1'      'INTEGER(4)'   Fortran 77 and
15840                                                  later
15841     'AMIN1(A1)'    'REAL(4) A1'   'REAL(4)'      Fortran 77 and
15842                                                  later
15843     'DMIN1(A1)'    'REAL(8) A1'   'REAL(8)'      Fortran 77 and
15844                                                  later
15845
15846_See also_:
15847     *note MAX::, *note MINLOC::, *note MINVAL::
15848
15849
15850File: gfortran.info,  Node: MINEXPONENT,  Next: MINLOC,  Prev: MIN,  Up: Intrinsic Procedures
15851
158529.198 'MINEXPONENT' -- Minimum exponent of a real kind
15853======================================================
15854
15855_Description_:
15856     'MINEXPONENT(X)' returns the minimum exponent in the model of the
15857     type of 'X'.
15858
15859_Standard_:
15860     Fortran 95 and later
15861
15862_Class_:
15863     Inquiry function
15864
15865_Syntax_:
15866     'RESULT = MINEXPONENT(X)'
15867
15868_Arguments_:
15869     X           Shall be of type 'REAL'.
15870
15871_Return value_:
15872     The return value is of type 'INTEGER' and of the default integer
15873     kind.
15874
15875_Example_:
15876     See 'MAXEXPONENT' for an example.
15877
15878
15879File: gfortran.info,  Node: MINLOC,  Next: MINVAL,  Prev: MINEXPONENT,  Up: Intrinsic Procedures
15880
158819.199 'MINLOC' -- Location of the minimum value within an array
15882===============================================================
15883
15884_Description_:
15885     Determines the location of the element in the array with the
15886     minimum value, or, if the DIM argument is supplied, determines the
15887     locations of the minimum element along each row of the array in the
15888     DIM direction.  If MASK is present, only the elements for which
15889     MASK is '.TRUE.' are considered.  If more than one element in the
15890     array has the minimum value, the location returned is that of the
15891     first such element in array element order if the BACK is not
15892     present, or is false; if BACK is true, the location returned is
15893     that of the last such element.  If the array has zero size, or all
15894     of the elements of MASK are '.FALSE.', then the result is an array
15895     of zeroes.  Similarly, if DIM is supplied and all of the elements
15896     of MASK along a given row are zero, the result value for that row
15897     is zero.
15898
15899_Standard_:
15900     Fortran 95 and later; ARRAY of 'CHARACTER' and the KIND argument
15901     are available in Fortran 2003 and later.  The BACK argument is
15902     available in Fortran 2008 and later.
15903
15904_Class_:
15905     Transformational function
15906
15907_Syntax_:
15908     'RESULT = MINLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])'
15909     'RESULT = MINLOC(ARRAY [, MASK], [,KIND] [,BACK])'
15910
15911_Arguments_:
15912     ARRAY       Shall be an array of type 'INTEGER', 'REAL' or
15913                 'CHARACTER'.
15914     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15915                 with a value between one and the rank of ARRAY,
15916                 inclusive.  It may not be an optional dummy
15917                 argument.
15918     MASK        Shall be an array of type 'LOGICAL', and
15919                 conformable with ARRAY.
15920     KIND        (Optional) An 'INTEGER' initialization
15921                 expression indicating the kind parameter of the
15922                 result.
15923     BACK        (Optional) A scalar of type 'LOGICAL'.
15924
15925_Return value_:
15926     If DIM is absent, the result is a rank-one array with a length
15927     equal to the rank of ARRAY.  If DIM is present, the result is an
15928     array with a rank one less than the rank of ARRAY, and a size
15929     corresponding to the size of ARRAY with the DIM dimension removed.
15930     If DIM is present and ARRAY has a rank of one, the result is a
15931     scalar.  If the optional argument KIND is present, the result is an
15932     integer of kind KIND, otherwise it is of default kind.
15933
15934_See also_:
15935     *note FINDLOC::, *note MIN::, *note MINVAL::
15936
15937
15938File: gfortran.info,  Node: MINVAL,  Next: MOD,  Prev: MINLOC,  Up: Intrinsic Procedures
15939
159409.200 'MINVAL' -- Minimum value of an array
15941===========================================
15942
15943_Description_:
15944     Determines the minimum value of the elements in an array value, or,
15945     if the DIM argument is supplied, determines the minimum value along
15946     each row of the array in the DIM direction.  If MASK is present,
15947     only the elements for which MASK is '.TRUE.' are considered.  If
15948     the array has zero size, or all of the elements of MASK are
15949     '.FALSE.', then the result is 'HUGE(ARRAY)' if ARRAY is numeric, or
15950     a string of 'CHAR(255)' characters if ARRAY is of character type.
15951
15952_Standard_:
15953     Fortran 95 and later
15954
15955_Class_:
15956     Transformational function
15957
15958_Syntax_:
15959     'RESULT = MINVAL(ARRAY, DIM [, MASK])'
15960     'RESULT = MINVAL(ARRAY [, MASK])'
15961
15962_Arguments_:
15963     ARRAY       Shall be an array of type 'INTEGER' or 'REAL'.
15964     DIM         (Optional) Shall be a scalar of type 'INTEGER',
15965                 with a value between one and the rank of ARRAY,
15966                 inclusive.  It may not be an optional dummy
15967                 argument.
15968     MASK        Shall be an array of type 'LOGICAL', and
15969                 conformable with ARRAY.
15970
15971_Return value_:
15972     If DIM is absent, or if ARRAY has a rank of one, the result is a
15973     scalar.  If DIM is present, the result is an array with a rank one
15974     less than the rank of ARRAY, and a size corresponding to the size
15975     of ARRAY with the DIM dimension removed.  In all cases, the result
15976     is of the same type and kind as ARRAY.
15977
15978_See also_:
15979     *note MIN::, *note MINLOC::
15980
15981
15982File: gfortran.info,  Node: MOD,  Next: MODULO,  Prev: MINVAL,  Up: Intrinsic Procedures
15983
159849.201 'MOD' -- Remainder function
15985=================================
15986
15987_Description_:
15988     'MOD(A,P)' computes the remainder of the division of A by P.
15989
15990_Standard_:
15991     Fortran 77 and later, has overloads that are GNU extensions
15992
15993_Class_:
15994     Elemental function
15995
15996_Syntax_:
15997     'RESULT = MOD(A, P)'
15998
15999_Arguments_:
16000     A           Shall be a scalar of type 'INTEGER' or 'REAL'.
16001     P           Shall be a scalar of the same type and kind as A
16002                 and not equal to zero.
16003
16004_Return value_:
16005     The return value is the result of 'A - (INT(A/P) * P)'.  The type
16006     and kind of the return value is the same as that of the arguments.
16007     The returned value has the same sign as A and a magnitude less than
16008     the magnitude of P.
16009
16010_Example_:
16011          program test_mod
16012            print *, mod(17,3)
16013            print *, mod(17.5,5.5)
16014            print *, mod(17.5d0,5.5)
16015            print *, mod(17.5,5.5d0)
16016
16017            print *, mod(-17,3)
16018            print *, mod(-17.5,5.5)
16019            print *, mod(-17.5d0,5.5)
16020            print *, mod(-17.5,5.5d0)
16021
16022            print *, mod(17,-3)
16023            print *, mod(17.5,-5.5)
16024            print *, mod(17.5d0,-5.5)
16025            print *, mod(17.5,-5.5d0)
16026          end program test_mod
16027
16028_Specific names_:
16029     Name           Arguments      Return type    Standard
16030     'MOD(A,P)'     'INTEGER       'INTEGER'      Fortran 95 and
16031                    A,P'                          later
16032     'AMOD(A,P)'    'REAL(4)       'REAL(4)'      Fortran 95 and
16033                    A,P'                          later
16034     'DMOD(A,P)'    'REAL(8)       'REAL(8)'      Fortran 95 and
16035                    A,P'                          later
16036     'BMOD(A,P)'    'INTEGER(1)    'INTEGER(1)'   GNU extension
16037                    A,P'
16038     'IMOD(A,P)'    'INTEGER(2)    'INTEGER(2)'   GNU extension
16039                    A,P'
16040     'JMOD(A,P)'    'INTEGER(4)    'INTEGER(4)'   GNU extension
16041                    A,P'
16042     'KMOD(A,P)'    'INTEGER(8)    'INTEGER(8)'   GNU extension
16043                    A,P'
16044
16045_See also_:
16046     *note MODULO::
16047
16048
16049File: gfortran.info,  Node: MODULO,  Next: MOVE_ALLOC,  Prev: MOD,  Up: Intrinsic Procedures
16050
160519.202 'MODULO' -- Modulo function
16052=================================
16053
16054_Description_:
16055     'MODULO(A,P)' computes the A modulo P.
16056
16057_Standard_:
16058     Fortran 95 and later
16059
16060_Class_:
16061     Elemental function
16062
16063_Syntax_:
16064     'RESULT = MODULO(A, P)'
16065
16066_Arguments_:
16067     A           Shall be a scalar of type 'INTEGER' or 'REAL'.
16068     P           Shall be a scalar of the same type and kind as
16069                 A.  It shall not be zero.
16070
16071_Return value_:
16072     The type and kind of the result are those of the arguments.
16073     If A and P are of type 'INTEGER':
16074          'MODULO(A,P)' has the value R such that 'A=Q*P+R', where Q is
16075          an integer and R is between 0 (inclusive) and P (exclusive).
16076     If A and P are of type 'REAL':
16077          'MODULO(A,P)' has the value of 'A - FLOOR (A / P) * P'.
16078     The returned value has the same sign as P and a magnitude less than
16079     the magnitude of P.
16080
16081_Example_:
16082          program test_modulo
16083            print *, modulo(17,3)
16084            print *, modulo(17.5,5.5)
16085
16086            print *, modulo(-17,3)
16087            print *, modulo(-17.5,5.5)
16088
16089            print *, modulo(17,-3)
16090            print *, modulo(17.5,-5.5)
16091          end program
16092
16093_See also_:
16094     *note MOD::
16095
16096
16097File: gfortran.info,  Node: MOVE_ALLOC,  Next: MVBITS,  Prev: MODULO,  Up: Intrinsic Procedures
16098
160999.203 'MOVE_ALLOC' -- Move allocation from one object to another
16100================================================================
16101
16102_Description_:
16103     'MOVE_ALLOC(FROM, TO)' moves the allocation from FROM to TO.  FROM
16104     will become deallocated in the process.
16105
16106_Standard_:
16107     Fortran 2003 and later
16108
16109_Class_:
16110     Pure subroutine
16111
16112_Syntax_:
16113     'CALL MOVE_ALLOC(FROM, TO)'
16114
16115_Arguments_:
16116     FROM        'ALLOCATABLE', 'INTENT(INOUT)', may be of any
16117                 type and kind.
16118     TO          'ALLOCATABLE', 'INTENT(OUT)', shall be of the
16119                 same type, kind and rank as FROM.
16120
16121_Return value_:
16122     None
16123
16124_Example_:
16125          program test_move_alloc
16126              integer, allocatable :: a(:), b(:)
16127
16128              allocate(a(3))
16129              a = [ 1, 2, 3 ]
16130              call move_alloc(a, b)
16131              print *, allocated(a), allocated(b)
16132              print *, b
16133          end program test_move_alloc
16134
16135
16136File: gfortran.info,  Node: MVBITS,  Next: NEAREST,  Prev: MOVE_ALLOC,  Up: Intrinsic Procedures
16137
161389.204 'MVBITS' -- Move bits from one integer to another
16139=======================================================
16140
16141_Description_:
16142     Moves LEN bits from positions FROMPOS through 'FROMPOS+LEN-1' of
16143     FROM to positions TOPOS through 'TOPOS+LEN-1' of TO.  The portion
16144     of argument TO not affected by the movement of bits is unchanged.
16145     The values of 'FROMPOS+LEN-1' and 'TOPOS+LEN-1' must be less than
16146     'BIT_SIZE(FROM)'.
16147
16148_Standard_:
16149     Fortran 95 and later, has overloads that are GNU extensions
16150
16151_Class_:
16152     Elemental subroutine
16153
16154_Syntax_:
16155     'CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)'
16156
16157_Arguments_:
16158     FROM        The type shall be 'INTEGER'.
16159     FROMPOS     The type shall be 'INTEGER'.
16160     LEN         The type shall be 'INTEGER'.
16161     TO          The type shall be 'INTEGER', of the same kind as
16162                 FROM.
16163     TOPOS       The type shall be 'INTEGER'.
16164
16165_Specific names_:
16166     Name           Argument       Return type    Standard
16167     'MVBITS(A)'    'INTEGER A'    'INTEGER'      Fortran 95 and
16168                                                  later
16169     'BMVBITS(A)'   'INTEGER(1)    'INTEGER(1)'   GNU extension
16170                    A'
16171     'IMVBITS(A)'   'INTEGER(2)    'INTEGER(2)'   GNU extension
16172                    A'
16173     'JMVBITS(A)'   'INTEGER(4)    'INTEGER(4)'   GNU extension
16174                    A'
16175     'KMVBITS(A)'   'INTEGER(8)    'INTEGER(8)'   GNU extension
16176                    A'
16177
16178_See also_:
16179     *note IBCLR::, *note IBSET::, *note IBITS::, *note IAND::, *note
16180     IOR::, *note IEOR::
16181
16182
16183File: gfortran.info,  Node: NEAREST,  Next: NEW_LINE,  Prev: MVBITS,  Up: Intrinsic Procedures
16184
161859.205 'NEAREST' -- Nearest representable number
16186===============================================
16187
16188_Description_:
16189     'NEAREST(X, S)' returns the processor-representable number nearest
16190     to 'X' in the direction indicated by the sign of 'S'.
16191
16192_Standard_:
16193     Fortran 95 and later
16194
16195_Class_:
16196     Elemental function
16197
16198_Syntax_:
16199     'RESULT = NEAREST(X, S)'
16200
16201_Arguments_:
16202     X           Shall be of type 'REAL'.
16203     S           Shall be of type 'REAL' and not equal to zero.
16204
16205_Return value_:
16206     The return value is of the same type as 'X'.  If 'S' is positive,
16207     'NEAREST' returns the processor-representable number greater than
16208     'X' and nearest to it.  If 'S' is negative, 'NEAREST' returns the
16209     processor-representable number smaller than 'X' and nearest to it.
16210
16211_Example_:
16212          program test_nearest
16213            real :: x, y
16214            x = nearest(42.0, 1.0)
16215            y = nearest(42.0, -1.0)
16216            write (*,"(3(G20.15))") x, y, x - y
16217          end program test_nearest
16218
16219
16220File: gfortran.info,  Node: NEW_LINE,  Next: NINT,  Prev: NEAREST,  Up: Intrinsic Procedures
16221
162229.206 'NEW_LINE' -- New line character
16223======================================
16224
16225_Description_:
16226     'NEW_LINE(C)' returns the new-line character.
16227
16228_Standard_:
16229     Fortran 2003 and later
16230
16231_Class_:
16232     Inquiry function
16233
16234_Syntax_:
16235     'RESULT = NEW_LINE(C)'
16236
16237_Arguments_:
16238     C           The argument shall be a scalar or array of the
16239                 type 'CHARACTER'.
16240
16241_Return value_:
16242     Returns a CHARACTER scalar of length one with the new-line
16243     character of the same kind as parameter C.
16244
16245_Example_:
16246          program newline
16247            implicit none
16248            write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'
16249          end program newline
16250
16251
16252File: gfortran.info,  Node: NINT,  Next: NORM2,  Prev: NEW_LINE,  Up: Intrinsic Procedures
16253
162549.207 'NINT' -- Nearest whole number
16255====================================
16256
16257_Description_:
16258     'NINT(A)' rounds its argument to the nearest whole number.
16259
16260_Standard_:
16261     Fortran 77 and later, with KIND argument Fortran 90 and later
16262
16263_Class_:
16264     Elemental function
16265
16266_Syntax_:
16267     'RESULT = NINT(A [, KIND])'
16268
16269_Arguments_:
16270     A           The type of the argument shall be 'REAL'.
16271     KIND        (Optional) An 'INTEGER' initialization
16272                 expression indicating the kind parameter of the
16273                 result.
16274
16275_Return value_:
16276     Returns A with the fractional portion of its magnitude eliminated
16277     by rounding to the nearest whole number and with its sign
16278     preserved, converted to an 'INTEGER' of the default kind.
16279
16280_Example_:
16281          program test_nint
16282            real(4) x4
16283            real(8) x8
16284            x4 = 1.234E0_4
16285            x8 = 4.321_8
16286            print *, nint(x4), idnint(x8)
16287          end program test_nint
16288
16289_Specific names_:
16290     Name           Argument       Return Type    Standard
16291     'NINT(A)'      'REAL(4) A'    'INTEGER'      Fortran 95 and
16292                                                  later
16293     'IDNINT(A)'    'REAL(8) A'    'INTEGER'      Fortran 95 and
16294                                                  later
16295
16296_See also_:
16297     *note CEILING::, *note FLOOR::
16298
16299
16300File: gfortran.info,  Node: NORM2,  Next: NOT,  Prev: NINT,  Up: Intrinsic Procedures
16301
163029.208 'NORM2' -- Euclidean vector norms
16303=======================================
16304
16305_Description_:
16306     Calculates the Euclidean vector norm (L_2 norm) of of ARRAY along
16307     dimension DIM.
16308
16309_Standard_:
16310     Fortran 2008 and later
16311
16312_Class_:
16313     Transformational function
16314
16315_Syntax_:
16316     'RESULT = NORM2(ARRAY[, DIM])'
16317
16318_Arguments_:
16319     ARRAY       Shall be an array of type 'REAL'
16320     DIM         (Optional) shall be a scalar of type 'INTEGER'
16321                 with a value in the range from 1 to n, where n
16322                 equals the rank of ARRAY.
16323
16324_Return value_:
16325     The result is of the same type as ARRAY.
16326
16327     If DIM is absent, a scalar with the square root of the sum of all
16328     elements in ARRAY squared is returned.  Otherwise, an array of rank
16329     n-1, where n equals the rank of ARRAY, and a shape similar to that
16330     of ARRAY with dimension DIM dropped is returned.
16331
16332_Example_:
16333          PROGRAM test_sum
16334            REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ]
16335            print *, NORM2(x)  ! = sqrt(55.) ~ 7.416
16336          END PROGRAM
16337
16338
16339File: gfortran.info,  Node: NOT,  Next: NULL,  Prev: NORM2,  Up: Intrinsic Procedures
16340
163419.209 'NOT' -- Logical negation
16342===============================
16343
16344_Description_:
16345     'NOT' returns the bitwise Boolean inverse of I.
16346
16347_Standard_:
16348     Fortran 95 and later, has overloads that are GNU extensions
16349
16350_Class_:
16351     Elemental function
16352
16353_Syntax_:
16354     'RESULT = NOT(I)'
16355
16356_Arguments_:
16357     I           The type shall be 'INTEGER'.
16358
16359_Return value_:
16360     The return type is 'INTEGER', of the same kind as the argument.
16361
16362_Specific names_:
16363     Name           Argument       Return type    Standard
16364     'NOT(A)'       'INTEGER A'    'INTEGER'      Fortran 95 and
16365                                                  later
16366     'BNOT(A)'      'INTEGER(1)    'INTEGER(1)'   GNU extension
16367                    A'
16368     'INOT(A)'      'INTEGER(2)    'INTEGER(2)'   GNU extension
16369                    A'
16370     'JNOT(A)'      'INTEGER(4)    'INTEGER(4)'   GNU extension
16371                    A'
16372     'KNOT(A)'      'INTEGER(8)    'INTEGER(8)'   GNU extension
16373                    A'
16374
16375_See also_:
16376     *note IAND::, *note IEOR::, *note IOR::, *note IBITS::, *note
16377     IBSET::, *note IBCLR::
16378
16379
16380File: gfortran.info,  Node: NULL,  Next: NUM_IMAGES,  Prev: NOT,  Up: Intrinsic Procedures
16381
163829.210 'NULL' -- Function that returns an disassociated pointer
16383==============================================================
16384
16385_Description_:
16386     Returns a disassociated pointer.
16387
16388     If MOLD is present, a disassociated pointer of the same type is
16389     returned, otherwise the type is determined by context.
16390
16391     In Fortran 95, MOLD is optional.  Please note that Fortran 2003
16392     includes cases where it is required.
16393
16394_Standard_:
16395     Fortran 95 and later
16396
16397_Class_:
16398     Transformational function
16399
16400_Syntax_:
16401     'PTR => NULL([MOLD])'
16402
16403_Arguments_:
16404     MOLD        (Optional) shall be a pointer of any association
16405                 status and of any type.
16406
16407_Return value_:
16408     A disassociated pointer.
16409
16410_Example_:
16411          REAL, POINTER, DIMENSION(:) :: VEC => NULL ()
16412
16413_See also_:
16414     *note ASSOCIATED::
16415
16416
16417File: gfortran.info,  Node: NUM_IMAGES,  Next: OR,  Prev: NULL,  Up: Intrinsic Procedures
16418
164199.211 'NUM_IMAGES' -- Function that returns the number of images
16420================================================================
16421
16422_Description_:
16423     Returns the number of images.
16424
16425_Standard_:
16426     Fortran 2008 and later.  With DISTANCE or FAILED argument,
16427     Technical Specification (TS) 18508 or later
16428
16429_Class_:
16430     Transformational function
16431
16432_Syntax_:
16433     'RESULT = NUM_IMAGES(DISTANCE, FAILED)'
16434
16435_Arguments_:
16436     DISTANCE    (optional, intent(in)) Nonnegative scalar
16437                 integer
16438     FAILED      (optional, intent(in)) Scalar logical expression
16439
16440_Return value_:
16441     Scalar default-kind integer.  If DISTANCE is not present or has
16442     value 0, the number of images in the current team is returned.  For
16443     values smaller or equal distance to the initial team, it returns
16444     the number of images index on the ancestor team which has a
16445     distance of DISTANCE from the invoking team.  If DISTANCE is larger
16446     than the distance to the initial team, the number of images of the
16447     initial team is returned.  If FAILED is not present the total
16448     number of images is returned; if it has the value '.TRUE.', the
16449     number of failed images is returned, otherwise, the number of
16450     images which do have not the failed status.
16451
16452_Example_:
16453          INTEGER :: value[*]
16454          INTEGER :: i
16455          value = THIS_IMAGE()
16456          SYNC ALL
16457          IF (THIS_IMAGE() == 1) THEN
16458            DO i = 1, NUM_IMAGES()
16459              WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
16460            END DO
16461          END IF
16462
16463_See also_:
16464     *note THIS_IMAGE::, *note IMAGE_INDEX::
16465
16466
16467File: gfortran.info,  Node: OR,  Next: PACK,  Prev: NUM_IMAGES,  Up: Intrinsic Procedures
16468
164699.212 'OR' -- Bitwise logical OR
16470================================
16471
16472_Description_:
16473     Bitwise logical 'OR'.
16474
16475     This intrinsic routine is provided for backwards compatibility with
16476     GNU Fortran 77.  For integer arguments, programmers should consider
16477     the use of the *note IOR:: intrinsic defined by the Fortran
16478     standard.
16479
16480_Standard_:
16481     GNU extension
16482
16483_Class_:
16484     Function
16485
16486_Syntax_:
16487     'RESULT = OR(I, J)'
16488
16489_Arguments_:
16490     I           The type shall be either a scalar 'INTEGER' type
16491                 or a scalar 'LOGICAL' type or a
16492                 boz-literal-constant.
16493     J           The type shall be the same as the type of I or a
16494                 boz-literal-constant.  I and J shall not both be
16495                 boz-literal-constants.  If either I and J is a
16496                 boz-literal-constant, then the other argument
16497                 must be a scalar 'INTEGER'.
16498
16499_Return value_:
16500     The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
16501     If the kind type parameters differ, then the smaller kind type is
16502     implicitly converted to larger kind, and the return has the larger
16503     kind.  A boz-literal-constant is converted to an 'INTEGER' with the
16504     kind type parameter of the other argument as-if a call to *note
16505     INT:: occurred.
16506
16507_Example_:
16508          PROGRAM test_or
16509            LOGICAL :: T = .TRUE., F = .FALSE.
16510            INTEGER :: a, b
16511            DATA a / Z'F' /, b / Z'3' /
16512
16513            WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F)
16514            WRITE (*,*) OR(a, b)
16515          END PROGRAM
16516
16517_See also_:
16518     Fortran 95 elemental function: *note IOR::
16519
16520
16521File: gfortran.info,  Node: PACK,  Next: PARITY,  Prev: OR,  Up: Intrinsic Procedures
16522
165239.213 'PACK' -- Pack an array into an array of rank one
16524=======================================================
16525
16526_Description_:
16527     Stores the elements of ARRAY in an array of rank one.
16528
16529     The beginning of the resulting array is made up of elements whose
16530     MASK equals 'TRUE'.  Afterwards, positions are filled with elements
16531     taken from VECTOR.
16532
16533_Standard_:
16534     Fortran 95 and later
16535
16536_Class_:
16537     Transformational function
16538
16539_Syntax_:
16540     'RESULT = PACK(ARRAY, MASK[,VECTOR])'
16541
16542_Arguments_:
16543     ARRAY       Shall be an array of any type.
16544     MASK        Shall be an array of type 'LOGICAL' and of the
16545                 same size as ARRAY.  Alternatively, it may be a
16546                 'LOGICAL' scalar.
16547     VECTOR      (Optional) shall be an array of the same type as
16548                 ARRAY and of rank one.  If present, the number
16549                 of elements in VECTOR shall be equal to or
16550                 greater than the number of true elements in
16551                 MASK.  If MASK is scalar, the number of elements
16552                 in VECTOR shall be equal to or greater than the
16553                 number of elements in ARRAY.
16554
16555_Return value_:
16556     The result is an array of rank one and the same type as that of
16557     ARRAY.  If VECTOR is present, the result size is that of VECTOR,
16558     the number of 'TRUE' values in MASK otherwise.
16559
16560_Example_:
16561     Gathering nonzero elements from an array:
16562          PROGRAM test_pack_1
16563            INTEGER :: m(6)
16564            m = (/ 1, 0, 0, 0, 5, 0 /)
16565            WRITE(*, FMT="(6(I0, ' '))") pack(m, m /= 0)  ! "1 5"
16566          END PROGRAM
16567
16568     Gathering nonzero elements from an array and appending elements
16569     from VECTOR:
16570          PROGRAM test_pack_2
16571            INTEGER :: m(4)
16572            m = (/ 1, 0, 0, 2 /)
16573            WRITE(*, FMT="(4(I0, ' '))") pack(m, m /= 0, (/ 0, 0, 3, 4 /))  ! "1 2 3 4"
16574          END PROGRAM
16575
16576_See also_:
16577     *note UNPACK::
16578
16579
16580File: gfortran.info,  Node: PARITY,  Next: PERROR,  Prev: PACK,  Up: Intrinsic Procedures
16581
165829.214 'PARITY' -- Reduction with exclusive OR
16583=============================================
16584
16585_Description_:
16586     Calculates the parity, i.e.  the reduction using '.XOR.', of MASK
16587     along dimension DIM.
16588
16589_Standard_:
16590     Fortran 2008 and later
16591
16592_Class_:
16593     Transformational function
16594
16595_Syntax_:
16596     'RESULT = PARITY(MASK[, DIM])'
16597
16598_Arguments_:
16599     LOGICAL     Shall be an array of type 'LOGICAL'
16600     DIM         (Optional) shall be a scalar of type 'INTEGER'
16601                 with a value in the range from 1 to n, where n
16602                 equals the rank of MASK.
16603
16604_Return value_:
16605     The result is of the same type as MASK.
16606
16607     If DIM is absent, a scalar with the parity of all elements in MASK
16608     is returned, i.e.  true if an odd number of elements is '.true.'
16609     and false otherwise.  If DIM is present, an array of rank n-1,
16610     where n equals the rank of ARRAY, and a shape similar to that of
16611     MASK with dimension DIM dropped is returned.
16612
16613_Example_:
16614          PROGRAM test_sum
16615            LOGICAL :: x(2) = [ .true., .false. ]
16616            print *, PARITY(x) ! prints "T" (true).
16617          END PROGRAM
16618
16619
16620File: gfortran.info,  Node: PERROR,  Next: POPCNT,  Prev: PARITY,  Up: Intrinsic Procedures
16621
166229.215 'PERROR' -- Print system error message
16623============================================
16624
16625_Description_:
16626     Prints (on the C 'stderr' stream) a newline-terminated error
16627     message corresponding to the last system error.  This is prefixed
16628     by STRING, a colon and a space.  See 'perror(3)'.
16629
16630_Standard_:
16631     GNU extension
16632
16633_Class_:
16634     Subroutine
16635
16636_Syntax_:
16637     'CALL PERROR(STRING)'
16638
16639_Arguments_:
16640     STRING      A scalar of type 'CHARACTER' and of the default
16641                 kind.
16642
16643_See also_:
16644     *note IERRNO::
16645
16646
16647File: gfortran.info,  Node: POPCNT,  Next: POPPAR,  Prev: PERROR,  Up: Intrinsic Procedures
16648
166499.216 'POPCNT' -- Number of bits set
16650====================================
16651
16652_Description_:
16653     'POPCNT(I)' returns the number of bits set ('1' bits) in the binary
16654     representation of 'I'.
16655
16656_Standard_:
16657     Fortran 2008 and later
16658
16659_Class_:
16660     Elemental function
16661
16662_Syntax_:
16663     'RESULT = POPCNT(I)'
16664
16665_Arguments_:
16666     I           Shall be of type 'INTEGER'.
16667
16668_Return value_:
16669     The return value is of type 'INTEGER' and of the default integer
16670     kind.
16671
16672_See also_:
16673     *note POPPAR::, *note LEADZ::, *note TRAILZ::
16674
16675_Example_:
16676          program test_population
16677            print *, popcnt(127),       poppar(127)
16678            print *, popcnt(huge(0_4)), poppar(huge(0_4))
16679            print *, popcnt(huge(0_8)), poppar(huge(0_8))
16680          end program test_population
16681
16682
16683File: gfortran.info,  Node: POPPAR,  Next: PRECISION,  Prev: POPCNT,  Up: Intrinsic Procedures
16684
166859.217 'POPPAR' -- Parity of the number of bits set
16686==================================================
16687
16688_Description_:
16689     'POPPAR(I)' returns parity of the integer 'I', i.e.  the parity of
16690     the number of bits set ('1' bits) in the binary representation of
16691     'I'.  It is equal to 0 if 'I' has an even number of bits set, and 1
16692     for an odd number of '1' bits.
16693
16694_Standard_:
16695     Fortran 2008 and later
16696
16697_Class_:
16698     Elemental function
16699
16700_Syntax_:
16701     'RESULT = POPPAR(I)'
16702
16703_Arguments_:
16704     I           Shall be of type 'INTEGER'.
16705
16706_Return value_:
16707     The return value is of type 'INTEGER' and of the default integer
16708     kind.
16709
16710_See also_:
16711     *note POPCNT::, *note LEADZ::, *note TRAILZ::
16712
16713_Example_:
16714          program test_population
16715            print *, popcnt(127),       poppar(127)
16716            print *, popcnt(huge(0_4)), poppar(huge(0_4))
16717            print *, popcnt(huge(0_8)), poppar(huge(0_8))
16718          end program test_population
16719
16720
16721File: gfortran.info,  Node: PRECISION,  Next: PRESENT,  Prev: POPPAR,  Up: Intrinsic Procedures
16722
167239.218 'PRECISION' -- Decimal precision of a real kind
16724=====================================================
16725
16726_Description_:
16727     'PRECISION(X)' returns the decimal precision in the model of the
16728     type of 'X'.
16729
16730_Standard_:
16731     Fortran 95 and later
16732
16733_Class_:
16734     Inquiry function
16735
16736_Syntax_:
16737     'RESULT = PRECISION(X)'
16738
16739_Arguments_:
16740     X           Shall be of type 'REAL' or 'COMPLEX'.
16741
16742_Return value_:
16743     The return value is of type 'INTEGER' and of the default integer
16744     kind.
16745
16746_See also_:
16747     *note SELECTED_REAL_KIND::, *note RANGE::
16748
16749_Example_:
16750          program prec_and_range
16751            real(kind=4) :: x(2)
16752            complex(kind=8) :: y
16753
16754            print *, precision(x), range(x)
16755            print *, precision(y), range(y)
16756          end program prec_and_range
16757
16758
16759File: gfortran.info,  Node: PRESENT,  Next: PRODUCT,  Prev: PRECISION,  Up: Intrinsic Procedures
16760
167619.219 'PRESENT' -- Determine whether an optional dummy argument is specified
16762============================================================================
16763
16764_Description_:
16765     Determines whether an optional dummy argument is present.
16766
16767_Standard_:
16768     Fortran 95 and later
16769
16770_Class_:
16771     Inquiry function
16772
16773_Syntax_:
16774     'RESULT = PRESENT(A)'
16775
16776_Arguments_:
16777     A           May be of any type and may be a pointer, scalar
16778                 or array value, or a dummy procedure.  It shall
16779                 be the name of an optional dummy argument
16780                 accessible within the current subroutine or
16781                 function.
16782
16783_Return value_:
16784     Returns either 'TRUE' if the optional argument A is present, or
16785     'FALSE' otherwise.
16786
16787_Example_:
16788          PROGRAM test_present
16789            WRITE(*,*) f(), f(42)      ! "F T"
16790          CONTAINS
16791            LOGICAL FUNCTION f(x)
16792              INTEGER, INTENT(IN), OPTIONAL :: x
16793              f = PRESENT(x)
16794            END FUNCTION
16795          END PROGRAM
16796
16797
16798File: gfortran.info,  Node: PRODUCT,  Next: RADIX,  Prev: PRESENT,  Up: Intrinsic Procedures
16799
168009.220 'PRODUCT' -- Product of array elements
16801============================================
16802
16803_Description_:
16804     Multiplies the elements of ARRAY along dimension DIM if the
16805     corresponding element in MASK is 'TRUE'.
16806
16807_Standard_:
16808     Fortran 95 and later
16809
16810_Class_:
16811     Transformational function
16812
16813_Syntax_:
16814     'RESULT = PRODUCT(ARRAY[, MASK])'
16815     'RESULT = PRODUCT(ARRAY, DIM[, MASK])'
16816
16817_Arguments_:
16818     ARRAY       Shall be an array of type 'INTEGER', 'REAL' or
16819                 'COMPLEX'.
16820     DIM         (Optional) shall be a scalar of type 'INTEGER'
16821                 with a value in the range from 1 to n, where n
16822                 equals the rank of ARRAY.
16823     MASK        (Optional) shall be of type 'LOGICAL' and either
16824                 be a scalar or an array of the same shape as
16825                 ARRAY.
16826
16827_Return value_:
16828     The result is of the same type as ARRAY.
16829
16830     If DIM is absent, a scalar with the product of all elements in
16831     ARRAY is returned.  Otherwise, an array of rank n-1, where n equals
16832     the rank of ARRAY, and a shape similar to that of ARRAY with
16833     dimension DIM dropped is returned.
16834
16835_Example_:
16836          PROGRAM test_product
16837            INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
16838            print *, PRODUCT(x)                    ! all elements, product = 120
16839            print *, PRODUCT(x, MASK=MOD(x, 2)==1) ! odd elements, product = 15
16840          END PROGRAM
16841
16842_See also_:
16843     *note SUM::
16844
16845
16846File: gfortran.info,  Node: RADIX,  Next: RAN,  Prev: PRODUCT,  Up: Intrinsic Procedures
16847
168489.221 'RADIX' -- Base of a model number
16849=======================================
16850
16851_Description_:
16852     'RADIX(X)' returns the base of the model representing the entity X.
16853
16854_Standard_:
16855     Fortran 95 and later
16856
16857_Class_:
16858     Inquiry function
16859
16860_Syntax_:
16861     'RESULT = RADIX(X)'
16862
16863_Arguments_:
16864     X           Shall be of type 'INTEGER' or 'REAL'
16865
16866_Return value_:
16867     The return value is a scalar of type 'INTEGER' and of the default
16868     integer kind.
16869
16870_See also_:
16871     *note SELECTED_REAL_KIND::
16872
16873_Example_:
16874          program test_radix
16875            print *, "The radix for the default integer kind is", radix(0)
16876            print *, "The radix for the default real kind is", radix(0.0)
16877          end program test_radix
16878
16879
16880File: gfortran.info,  Node: RAN,  Next: RAND,  Prev: RADIX,  Up: Intrinsic Procedures
16881
168829.222 'RAN' -- Real pseudo-random number
16883========================================
16884
16885_Description_:
16886     For compatibility with HP FORTRAN 77/iX, the 'RAN' intrinsic is
16887     provided as an alias for 'RAND'.  See *note RAND:: for complete
16888     documentation.
16889
16890_Standard_:
16891     GNU extension
16892
16893_Class_:
16894     Function
16895
16896_See also_:
16897     *note RAND::, *note RANDOM_NUMBER::
16898
16899
16900File: gfortran.info,  Node: RAND,  Next: RANDOM_INIT,  Prev: RAN,  Up: Intrinsic Procedures
16901
169029.223 'RAND' -- Real pseudo-random number
16903=========================================
16904
16905_Description_:
16906     'RAND(FLAG)' returns a pseudo-random number from a uniform
16907     distribution between 0 and 1.  If FLAG is 0, the next number in the
16908     current sequence is returned; if FLAG is 1, the generator is
16909     restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is
16910     used as a new seed with 'SRAND'.
16911
16912     This intrinsic routine is provided for backwards compatibility with
16913     GNU Fortran 77.  It implements a simple modulo generator as
16914     provided by 'g77'.  For new code, one should consider the use of
16915     *note RANDOM_NUMBER:: as it implements a superior algorithm.
16916
16917_Standard_:
16918     GNU extension
16919
16920_Class_:
16921     Function
16922
16923_Syntax_:
16924     'RESULT = RAND(I)'
16925
16926_Arguments_:
16927     I           Shall be a scalar 'INTEGER' of kind 4.
16928
16929_Return value_:
16930     The return value is of 'REAL' type and the default kind.
16931
16932_Example_:
16933          program test_rand
16934            integer,parameter :: seed = 86456
16935
16936            call srand(seed)
16937            print *, rand(), rand(), rand(), rand()
16938            print *, rand(seed), rand(), rand(), rand()
16939          end program test_rand
16940
16941_See also_:
16942     *note SRAND::, *note RANDOM_NUMBER::
16943
16944
16945File: gfortran.info,  Node: RANDOM_INIT,  Next: RANDOM_NUMBER,  Prev: RAND,  Up: Intrinsic Procedures
16946
169479.224 'RANDOM_INIT' -- Initialize a pseudo-random number generator
16948==================================================================
16949
16950_Description_:
16951     Initializes the state of the pseudorandom number generator used by
16952     'RANDOM_NUMBER'.
16953
16954_Standard_:
16955     Fortran 2018
16956
16957_Class_:
16958     Subroutine
16959
16960_Syntax_:
16961     'CALL RANDOM_INIT(REPEATABLE, IMAGE_DISTINCT)'
16962
16963_Arguments_:
16964     REPEATABLE     Shall be a scalar with a 'LOGICAL' type, and it is
16965                    'INTENT(IN)'.  If it is '.true.', the seed is set to
16966                    a processor-dependent value that is the same each
16967                    time 'RANDOM_INIT' is called from the same image.
16968                    The term "same image" means a single instance of
16969                    program execution.  The sequence of random numbers
16970                    is different for repeated execution of the program.
16971                    If it is '.false.', the seed is set to a
16972                    processor-dependent value.
16973     IMAGE_DISTINCT Shall be a scalar with a 'LOGICAL' type, and it is
16974                    'INTENT(IN)'.  If it is '.true.', the seed is set to
16975                    a processor-dependent value that is distinct from th
16976                    seed set by a call to 'RANDOM_INIT' in another
16977                    image.  If it is '.false.', the seed is set value
16978                    that does depend which image called 'RANDOM_INIT'.
16979
16980_Example_:
16981          program test_random_seed
16982            implicit none
16983            real x(3), y(3)
16984            call random_init(.true., .true.)
16985            call random_number(x)
16986            call random_init(.true., .true.)
16987            call random_number(y)
16988            ! x and y are the same sequence
16989            if (any(x /= y)) call abort
16990          end program test_random_seed
16991
16992_See also_:
16993     *note RANDOM_NUMBER::, *note RANDOM_SEED::
16994
16995
16996File: gfortran.info,  Node: RANDOM_NUMBER,  Next: RANDOM_SEED,  Prev: RANDOM_INIT,  Up: Intrinsic Procedures
16997
169989.225 'RANDOM_NUMBER' -- Pseudo-random number
16999=============================================
17000
17001_Description_:
17002     Returns a single pseudorandom number or an array of pseudorandom
17003     numbers from the uniform distribution over the range 0 \leq x < 1.
17004
17005     The runtime-library implements the xorshift1024* random number
17006     generator (RNG). This generator has a period of 2^{1024} - 1, and
17007     when using multiple threads up to 2^{512} threads can each generate
17008     2^{512} random numbers before any aliasing occurs.
17009
17010     Note that in a multi-threaded program (e.g.  using OpenMP
17011     directives), each thread will have its own random number state.
17012     For details of the seeding procedure, see the documentation for the
17013     'RANDOM_SEED' intrinsic.
17014
17015_Standard_:
17016     Fortran 95 and later
17017
17018_Class_:
17019     Subroutine
17020
17021_Syntax_:
17022     'RANDOM_NUMBER(HARVEST)'
17023
17024_Arguments_:
17025     HARVEST     Shall be a scalar or an array of type 'REAL'.
17026
17027_Example_:
17028          program test_random_number
17029            REAL :: r(5,5)
17030            CALL RANDOM_NUMBER(r)
17031          end program
17032
17033_See also_:
17034     *note RANDOM_SEED::, *note RANDOM_INIT::
17035
17036
17037File: gfortran.info,  Node: RANDOM_SEED,  Next: RANGE,  Prev: RANDOM_NUMBER,  Up: Intrinsic Procedures
17038
170399.226 'RANDOM_SEED' -- Initialize a pseudo-random number sequence
17040=================================================================
17041
17042_Description_:
17043     Restarts or queries the state of the pseudorandom number generator
17044     used by 'RANDOM_NUMBER'.
17045
17046     If 'RANDOM_SEED' is called without arguments, it is seeded with
17047     random data retrieved from the operating system.
17048
17049     As an extension to the Fortran standard, the GFortran
17050     'RANDOM_NUMBER' supports multiple threads.  Each thread in a
17051     multi-threaded program has its own seed.  When 'RANDOM_SEED' is
17052     called either without arguments or with the PUT argument, the given
17053     seed is copied into a master seed as well as the seed of the
17054     current thread.  When a new thread uses 'RANDOM_NUMBER' for the
17055     first time, the seed is copied from the master seed, and forwarded
17056     N * 2^{512} steps to guarantee that the random stream does not
17057     alias any other stream in the system, where N is the number of
17058     threads that have used 'RANDOM_NUMBER' so far during the program
17059     execution.
17060
17061_Standard_:
17062     Fortran 95 and later
17063
17064_Class_:
17065     Subroutine
17066
17067_Syntax_:
17068     'CALL RANDOM_SEED([SIZE, PUT, GET])'
17069
17070_Arguments_:
17071     SIZE        (Optional) Shall be a scalar and of type default
17072                 'INTEGER', with 'INTENT(OUT)'.  It specifies the
17073                 minimum size of the arrays used with the PUT and
17074                 GET arguments.
17075     PUT         (Optional) Shall be an array of type default
17076                 'INTEGER' and rank one.  It is 'INTENT(IN)' and
17077                 the size of the array must be larger than or
17078                 equal to the number returned by the SIZE
17079                 argument.
17080     GET         (Optional) Shall be an array of type default
17081                 'INTEGER' and rank one.  It is 'INTENT(OUT)' and
17082                 the size of the array must be larger than or
17083                 equal to the number returned by the SIZE
17084                 argument.
17085
17086_Example_:
17087          program test_random_seed
17088            implicit none
17089            integer, allocatable :: seed(:)
17090            integer :: n
17091
17092            call random_seed(size = n)
17093            allocate(seed(n))
17094            call random_seed(get=seed)
17095            write (*, *) seed
17096          end program test_random_seed
17097
17098_See also_:
17099     *note RANDOM_NUMBER::, *note RANDOM_INIT::
17100
17101
17102File: gfortran.info,  Node: RANGE,  Next: RANK,  Prev: RANDOM_SEED,  Up: Intrinsic Procedures
17103
171049.227 'RANGE' -- Decimal exponent range
17105=======================================
17106
17107_Description_:
17108     'RANGE(X)' returns the decimal exponent range in the model of the
17109     type of 'X'.
17110
17111_Standard_:
17112     Fortran 95 and later
17113
17114_Class_:
17115     Inquiry function
17116
17117_Syntax_:
17118     'RESULT = RANGE(X)'
17119
17120_Arguments_:
17121     X           Shall be of type 'INTEGER', 'REAL' or 'COMPLEX'.
17122
17123_Return value_:
17124     The return value is of type 'INTEGER' and of the default integer
17125     kind.
17126
17127_See also_:
17128     *note SELECTED_REAL_KIND::, *note PRECISION::
17129
17130_Example_:
17131     See 'PRECISION' for an example.
17132
17133
17134File: gfortran.info,  Node: RANK,  Next: REAL,  Prev: RANGE,  Up: Intrinsic Procedures
17135
171369.228 'RANK' -- Rank of a data object
17137=====================================
17138
17139_Description_:
17140     'RANK(A)' returns the rank of a scalar or array data object.
17141
17142_Standard_:
17143     Technical Specification (TS) 29113
17144
17145_Class_:
17146     Inquiry function
17147
17148_Syntax_:
17149     'RESULT = RANK(A)'
17150
17151_Arguments_:
17152     A           can be of any type
17153
17154_Return value_:
17155     The return value is of type 'INTEGER' and of the default integer
17156     kind.  For arrays, their rank is returned; for scalars zero is
17157     returned.
17158
17159_Example_:
17160          program test_rank
17161            integer :: a
17162            real, allocatable :: b(:,:)
17163
17164            print *, rank(a), rank(b) ! Prints:  0  2
17165          end program test_rank
17166
17167
17168File: gfortran.info,  Node: REAL,  Next: RENAME,  Prev: RANK,  Up: Intrinsic Procedures
17169
171709.229 'REAL' -- Convert to real type
17171====================================
17172
17173_Description_:
17174     'REAL(A [, KIND])' converts its argument A to a real type.  The
17175     'REALPART' function is provided for compatibility with 'g77', and
17176     its use is strongly discouraged.
17177
17178_Standard_:
17179     Fortran 77 and later
17180
17181_Class_:
17182     Elemental function
17183
17184_Syntax_:
17185     'RESULT = REAL(A [, KIND])'
17186     'RESULT = REALPART(Z)'
17187
17188_Arguments_:
17189     A           Shall be 'INTEGER', 'REAL', or 'COMPLEX'.
17190     KIND        (Optional) An 'INTEGER' initialization
17191                 expression indicating the kind parameter of the
17192                 result.
17193
17194_Return value_:
17195     These functions return a 'REAL' variable or array under the
17196     following rules:
17197
17198     (A)
17199          'REAL(A)' is converted to a default real type if A is an
17200          integer or real variable.
17201     (B)
17202          'REAL(A)' is converted to a real type with the kind type
17203          parameter of A if A is a complex variable.
17204     (C)
17205          'REAL(A, KIND)' is converted to a real type with kind type
17206          parameter KIND if A is a complex, integer, or real variable.
17207
17208_Example_:
17209          program test_real
17210            complex :: x = (1.0, 2.0)
17211            print *, real(x), real(x,8), realpart(x)
17212          end program test_real
17213
17214_Specific names_:
17215     Name           Argument       Return type    Standard
17216     'FLOAT(A)'     'INTEGER(4)'   'REAL(4)'      Fortran 77 and
17217                                                  later
17218     'DFLOAT(A)'    'INTEGER(4)'   'REAL(8)'      GNU extension
17219     'FLOATI(A)'    'INTEGER(2)'   'REAL(4)'      GNU extension
17220     'FLOATJ(A)'    'INTEGER(4)'   'REAL(4)'      GNU extension
17221     'FLOATK(A)'    'INTEGER(8)'   'REAL(4)'      GNU extension
17222     'SNGL(A)'      'INTEGER(8)'   'REAL(4)'      Fortran 77 and
17223                                                  later
17224
17225_See also_:
17226     *note DBLE::
17227
17228
17229File: gfortran.info,  Node: RENAME,  Next: REPEAT,  Prev: REAL,  Up: Intrinsic Procedures
17230
172319.230 'RENAME' -- Rename a file
17232===============================
17233
17234_Description_:
17235     Renames a file from file PATH1 to PATH2.  A null character
17236     ('CHAR(0)') can be used to mark the end of the names in PATH1 and
17237     PATH2; otherwise, trailing blanks in the file names are ignored.
17238     If the STATUS argument is supplied, it contains 0 on success or a
17239     nonzero error code upon return; see 'rename(2)'.
17240
17241     This intrinsic is provided in both subroutine and function forms;
17242     however, only one form can be used in any given program unit.
17243
17244_Standard_:
17245     GNU extension
17246
17247_Class_:
17248     Subroutine, function
17249
17250_Syntax_:
17251     'CALL RENAME(PATH1, PATH2 [, STATUS])'
17252     'STATUS = RENAME(PATH1, PATH2)'
17253
17254_Arguments_:
17255     PATH1       Shall be of default 'CHARACTER' type.
17256     PATH2       Shall be of default 'CHARACTER' type.
17257     STATUS      (Optional) Shall be of default 'INTEGER' type.
17258
17259_See also_:
17260     *note LINK::
17261
17262
17263File: gfortran.info,  Node: REPEAT,  Next: RESHAPE,  Prev: RENAME,  Up: Intrinsic Procedures
17264
172659.231 'REPEAT' -- Repeated string concatenation
17266===============================================
17267
17268_Description_:
17269     Concatenates NCOPIES copies of a string.
17270
17271_Standard_:
17272     Fortran 95 and later
17273
17274_Class_:
17275     Transformational function
17276
17277_Syntax_:
17278     'RESULT = REPEAT(STRING, NCOPIES)'
17279
17280_Arguments_:
17281     STRING      Shall be scalar and of type 'CHARACTER'.
17282     NCOPIES     Shall be scalar and of type 'INTEGER'.
17283
17284_Return value_:
17285     A new scalar of type 'CHARACTER' built up from NCOPIES copies of
17286     STRING.
17287
17288_Example_:
17289          program test_repeat
17290            write(*,*) repeat("x", 5)   ! "xxxxx"
17291          end program
17292
17293
17294File: gfortran.info,  Node: RESHAPE,  Next: RRSPACING,  Prev: REPEAT,  Up: Intrinsic Procedures
17295
172969.232 'RESHAPE' -- Function to reshape an array
17297===============================================
17298
17299_Description_:
17300     Reshapes SOURCE to correspond to SHAPE.  If necessary, the new
17301     array may be padded with elements from PAD or permuted as defined
17302     by ORDER.
17303
17304_Standard_:
17305     Fortran 95 and later
17306
17307_Class_:
17308     Transformational function
17309
17310_Syntax_:
17311     'RESULT = RESHAPE(SOURCE, SHAPE[, PAD, ORDER])'
17312
17313_Arguments_:
17314     SOURCE      Shall be an array of any type.
17315     SHAPE       Shall be of type 'INTEGER' and an array of rank
17316                 one.  Its values must be positive or zero.
17317     PAD         (Optional) shall be an array of the same type as
17318                 SOURCE.
17319     ORDER       (Optional) shall be of type 'INTEGER' and an
17320                 array of the same shape as SHAPE.  Its values
17321                 shall be a permutation of the numbers from 1 to
17322                 n, where n is the size of SHAPE.  If ORDER is
17323                 absent, the natural ordering shall be assumed.
17324
17325_Return value_:
17326     The result is an array of shape SHAPE with the same type as SOURCE.
17327
17328_Example_:
17329          PROGRAM test_reshape
17330            INTEGER, DIMENSION(4) :: x
17331            WRITE(*,*) SHAPE(x)                       ! prints "4"
17332            WRITE(*,*) SHAPE(RESHAPE(x, (/2, 2/)))    ! prints "2 2"
17333          END PROGRAM
17334
17335_See also_:
17336     *note SHAPE::
17337
17338
17339File: gfortran.info,  Node: RRSPACING,  Next: RSHIFT,  Prev: RESHAPE,  Up: Intrinsic Procedures
17340
173419.233 'RRSPACING' -- Reciprocal of the relative spacing
17342=======================================================
17343
17344_Description_:
17345     'RRSPACING(X)' returns the reciprocal of the relative spacing of
17346     model numbers near X.
17347
17348_Standard_:
17349     Fortran 95 and later
17350
17351_Class_:
17352     Elemental function
17353
17354_Syntax_:
17355     'RESULT = RRSPACING(X)'
17356
17357_Arguments_:
17358     X           Shall be of type 'REAL'.
17359
17360_Return value_:
17361     The return value is of the same type and kind as X.  The value
17362     returned is equal to 'ABS(FRACTION(X)) *
17363     FLOAT(RADIX(X))**DIGITS(X)'.
17364
17365_See also_:
17366     *note SPACING::
17367
17368
17369File: gfortran.info,  Node: RSHIFT,  Next: SAME_TYPE_AS,  Prev: RRSPACING,  Up: Intrinsic Procedures
17370
173719.234 'RSHIFT' -- Right shift bits
17372==================================
17373
17374_Description_:
17375     'RSHIFT' returns a value corresponding to I with all of the bits
17376     shifted right by SHIFT places.  SHIFT shall be nonnegative and less
17377     than or equal to 'BIT_SIZE(I)', otherwise the result value is
17378     undefined.  Bits shifted out from the right end are lost.  The fill
17379     is arithmetic: the bits shifted in from the left end are equal to
17380     the leftmost bit, which in two's complement representation is the
17381     sign bit.
17382
17383     This function has been superseded by the 'SHIFTA' intrinsic, which
17384     is standard in Fortran 2008 and later.
17385
17386_Standard_:
17387     GNU extension
17388
17389_Class_:
17390     Elemental function
17391
17392_Syntax_:
17393     'RESULT = RSHIFT(I, SHIFT)'
17394
17395_Arguments_:
17396     I           The type shall be 'INTEGER'.
17397     SHIFT       The type shall be 'INTEGER'.
17398
17399_Return value_:
17400     The return value is of type 'INTEGER' and of the same kind as I.
17401
17402_See also_:
17403     *note ISHFT::, *note ISHFTC::, *note LSHIFT::, *note SHIFTA::,
17404     *note SHIFTR::, *note SHIFTL::
17405
17406
17407File: gfortran.info,  Node: SAME_TYPE_AS,  Next: SCALE,  Prev: RSHIFT,  Up: Intrinsic Procedures
17408
174099.235 'SAME_TYPE_AS' -- Query dynamic types for equality
17410========================================================
17411
17412_Description_:
17413     Query dynamic types for equality.
17414
17415_Standard_:
17416     Fortran 2003 and later
17417
17418_Class_:
17419     Inquiry function
17420
17421_Syntax_:
17422     'RESULT = SAME_TYPE_AS(A, B)'
17423
17424_Arguments_:
17425     A           Shall be an object of extensible declared type
17426                 or unlimited polymorphic.
17427     B           Shall be an object of extensible declared type
17428                 or unlimited polymorphic.
17429
17430_Return value_:
17431     The return value is a scalar of type default logical.  It is true
17432     if and only if the dynamic type of A is the same as the dynamic
17433     type of B.
17434
17435_See also_:
17436     *note EXTENDS_TYPE_OF::
17437
17438
17439File: gfortran.info,  Node: SCALE,  Next: SCAN,  Prev: SAME_TYPE_AS,  Up: Intrinsic Procedures
17440
174419.236 'SCALE' -- Scale a real value
17442===================================
17443
17444_Description_:
17445     'SCALE(X,I)' returns 'X * RADIX(X)**I'.
17446
17447_Standard_:
17448     Fortran 95 and later
17449
17450_Class_:
17451     Elemental function
17452
17453_Syntax_:
17454     'RESULT = SCALE(X, I)'
17455
17456_Arguments_:
17457     X           The type of the argument shall be a 'REAL'.
17458     I           The type of the argument shall be a 'INTEGER'.
17459
17460_Return value_:
17461     The return value is of the same type and kind as X.  Its value is
17462     'X * RADIX(X)**I'.
17463
17464_Example_:
17465          program test_scale
17466            real :: x = 178.1387e-4
17467            integer :: i = 5
17468            print *, scale(x,i), x*radix(x)**i
17469          end program test_scale
17470
17471
17472File: gfortran.info,  Node: SCAN,  Next: SECNDS,  Prev: SCALE,  Up: Intrinsic Procedures
17473
174749.237 'SCAN' -- Scan a string for the presence of a set of characters
17475=====================================================================
17476
17477_Description_:
17478     Scans a STRING for any of the characters in a SET of characters.
17479
17480     If BACK is either absent or equals 'FALSE', this function returns
17481     the position of the leftmost character of STRING that is in SET.
17482     If BACK equals 'TRUE', the rightmost position is returned.  If no
17483     character of SET is found in STRING, the result is zero.
17484
17485_Standard_:
17486     Fortran 95 and later, with KIND argument Fortran 2003 and later
17487
17488_Class_:
17489     Elemental function
17490
17491_Syntax_:
17492     'RESULT = SCAN(STRING, SET[, BACK [, KIND]])'
17493
17494_Arguments_:
17495     STRING      Shall be of type 'CHARACTER'.
17496     SET         Shall be of type 'CHARACTER'.
17497     BACK        (Optional) shall be of type 'LOGICAL'.
17498     KIND        (Optional) An 'INTEGER' initialization
17499                 expression indicating the kind parameter of the
17500                 result.
17501
17502_Return value_:
17503     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
17504     absent, the return value is of default integer kind.
17505
17506_Example_:
17507          PROGRAM test_scan
17508            WRITE(*,*) SCAN("FORTRAN", "AO")          ! 2, found 'O'
17509            WRITE(*,*) SCAN("FORTRAN", "AO", .TRUE.)  ! 6, found 'A'
17510            WRITE(*,*) SCAN("FORTRAN", "C++")         ! 0, found none
17511          END PROGRAM
17512
17513_See also_:
17514     *note INDEX intrinsic::, *note VERIFY::
17515
17516
17517File: gfortran.info,  Node: SECNDS,  Next: SECOND,  Prev: SCAN,  Up: Intrinsic Procedures
17518
175199.238 'SECNDS' -- Time function
17520===============================
17521
17522_Description_:
17523     'SECNDS(X)' gets the time in seconds from the real-time system
17524     clock.  X is a reference time, also in seconds.  If this is zero,
17525     the time in seconds from midnight is returned.  This function is
17526     non-standard and its use is discouraged.
17527
17528_Standard_:
17529     GNU extension
17530
17531_Class_:
17532     Function
17533
17534_Syntax_:
17535     'RESULT = SECNDS (X)'
17536
17537_Arguments_:
17538     T           Shall be of type 'REAL(4)'.
17539     X           Shall be of type 'REAL(4)'.
17540
17541_Return value_:
17542     None
17543
17544_Example_:
17545          program test_secnds
17546              integer :: i
17547              real(4) :: t1, t2
17548              print *, secnds (0.0)   ! seconds since midnight
17549              t1 = secnds (0.0)       ! reference time
17550              do i = 1, 10000000      ! do something
17551              end do
17552              t2 = secnds (t1)        ! elapsed time
17553              print *, "Something took ", t2, " seconds."
17554          end program test_secnds
17555
17556
17557File: gfortran.info,  Node: SECOND,  Next: SELECTED_CHAR_KIND,  Prev: SECNDS,  Up: Intrinsic Procedures
17558
175599.239 'SECOND' -- CPU time function
17560===================================
17561
17562_Description_:
17563     Returns a 'REAL(4)' value representing the elapsed CPU time in
17564     seconds.  This provides the same functionality as the standard
17565     'CPU_TIME' intrinsic, and is only included for backwards
17566     compatibility.
17567
17568     This intrinsic is provided in both subroutine and function forms;
17569     however, only one form can be used in any given program unit.
17570
17571_Standard_:
17572     GNU extension
17573
17574_Class_:
17575     Subroutine, function
17576
17577_Syntax_:
17578     'CALL SECOND(TIME)'
17579     'TIME = SECOND()'
17580
17581_Arguments_:
17582     TIME        Shall be of type 'REAL(4)'.
17583
17584_Return value_:
17585     In either syntax, TIME is set to the process's current runtime in
17586     seconds.
17587
17588_See also_:
17589     *note CPU_TIME::
17590
17591
17592File: gfortran.info,  Node: SELECTED_CHAR_KIND,  Next: SELECTED_INT_KIND,  Prev: SECOND,  Up: Intrinsic Procedures
17593
175949.240 'SELECTED_CHAR_KIND' -- Choose character kind
17595===================================================
17596
17597_Description_:
17598
17599     'SELECTED_CHAR_KIND(NAME)' returns the kind value for the character
17600     set named NAME, if a character set with such a name is supported,
17601     or -1 otherwise.  Currently, supported character sets include
17602     "ASCII" and "DEFAULT", which are equivalent, and "ISO_10646"
17603     (Universal Character Set, UCS-4) which is commonly known as
17604     Unicode.
17605
17606_Standard_:
17607     Fortran 2003 and later
17608
17609_Class_:
17610     Transformational function
17611
17612_Syntax_:
17613     'RESULT = SELECTED_CHAR_KIND(NAME)'
17614
17615_Arguments_:
17616     NAME        Shall be a scalar and of the default character
17617                 type.
17618
17619_Example_:
17620          program character_kind
17621            use iso_fortran_env
17622            implicit none
17623            integer, parameter :: ascii = selected_char_kind ("ascii")
17624            integer, parameter :: ucs4  = selected_char_kind ('ISO_10646')
17625
17626            character(kind=ascii, len=26) :: alphabet
17627            character(kind=ucs4,  len=30) :: hello_world
17628
17629            alphabet = ascii_"abcdefghijklmnopqrstuvwxyz"
17630            hello_world = ucs4_'Hello World and Ni Hao -- ' &
17631                          // char (int (z'4F60'), ucs4)     &
17632                          // char (int (z'597D'), ucs4)
17633
17634            write (*,*) alphabet
17635
17636            open (output_unit, encoding='UTF-8')
17637            write (*,*) trim (hello_world)
17638          end program character_kind
17639
17640
17641File: gfortran.info,  Node: SELECTED_INT_KIND,  Next: SELECTED_REAL_KIND,  Prev: SELECTED_CHAR_KIND,  Up: Intrinsic Procedures
17642
176439.241 'SELECTED_INT_KIND' -- Choose integer kind
17644================================================
17645
17646_Description_:
17647     'SELECTED_INT_KIND(R)' return the kind value of the smallest
17648     integer type that can represent all values ranging from -10^R
17649     (exclusive) to 10^R (exclusive).  If there is no integer kind that
17650     accommodates this range, 'SELECTED_INT_KIND' returns -1.
17651
17652_Standard_:
17653     Fortran 95 and later
17654
17655_Class_:
17656     Transformational function
17657
17658_Syntax_:
17659     'RESULT = SELECTED_INT_KIND(R)'
17660
17661_Arguments_:
17662     R           Shall be a scalar and of type 'INTEGER'.
17663
17664_Example_:
17665          program large_integers
17666            integer,parameter :: k5 = selected_int_kind(5)
17667            integer,parameter :: k15 = selected_int_kind(15)
17668            integer(kind=k5) :: i5
17669            integer(kind=k15) :: i15
17670
17671            print *, huge(i5), huge(i15)
17672
17673            ! The following inequalities are always true
17674            print *, huge(i5) >= 10_k5**5-1
17675            print *, huge(i15) >= 10_k15**15-1
17676          end program large_integers
17677
17678
17679File: gfortran.info,  Node: SELECTED_REAL_KIND,  Next: SET_EXPONENT,  Prev: SELECTED_INT_KIND,  Up: Intrinsic Procedures
17680
176819.242 'SELECTED_REAL_KIND' -- Choose real kind
17682==============================================
17683
17684_Description_:
17685     'SELECTED_REAL_KIND(P,R)' returns the kind value of a real data
17686     type with decimal precision of at least 'P' digits, exponent range
17687     of at least 'R', and with a radix of 'RADIX'.
17688
17689_Standard_:
17690     Fortran 95 and later, with 'RADIX' Fortran 2008 or later
17691
17692_Class_:
17693     Transformational function
17694
17695_Syntax_:
17696     'RESULT = SELECTED_REAL_KIND([P, R, RADIX])'
17697
17698_Arguments_:
17699     P           (Optional) shall be a scalar and of type
17700                 'INTEGER'.
17701     R           (Optional) shall be a scalar and of type
17702                 'INTEGER'.
17703     RADIX       (Optional) shall be a scalar and of type
17704                 'INTEGER'.
17705     Before Fortran 2008, at least one of the arguments R or P shall be
17706     present; since Fortran 2008, they are assumed to be zero if absent.
17707
17708_Return value_:
17709
17710     'SELECTED_REAL_KIND' returns the value of the kind type parameter
17711     of a real data type with decimal precision of at least 'P' digits,
17712     a decimal exponent range of at least 'R', and with the requested
17713     'RADIX'.  If the 'RADIX' parameter is absent, real kinds with any
17714     radix can be returned.  If more than one real data type meet the
17715     criteria, the kind of the data type with the smallest decimal
17716     precision is returned.  If no real data type matches the criteria,
17717     the result is
17718     -1 if the processor does not support a real data type with a
17719          precision greater than or equal to 'P', but the 'R' and
17720          'RADIX' requirements can be fulfilled
17721     -2 if the processor does not support a real type with an exponent
17722          range greater than or equal to 'R', but 'P' and 'RADIX' are
17723          fulfillable
17724     -3 if 'RADIX' but not 'P' and 'R' requirements
17725          are fulfillable
17726     -4 if 'RADIX' and either 'P' or 'R' requirements
17727          are fulfillable
17728     -5 if there is no real type with the given 'RADIX'
17729
17730_See also_:
17731     *note PRECISION::, *note RANGE::, *note RADIX::
17732
17733_Example_:
17734          program real_kinds
17735            integer,parameter :: p6 = selected_real_kind(6)
17736            integer,parameter :: p10r100 = selected_real_kind(10,100)
17737            integer,parameter :: r400 = selected_real_kind(r=400)
17738            real(kind=p6) :: x
17739            real(kind=p10r100) :: y
17740            real(kind=r400) :: z
17741
17742            print *, precision(x), range(x)
17743            print *, precision(y), range(y)
17744            print *, precision(z), range(z)
17745          end program real_kinds
17746
17747
17748File: gfortran.info,  Node: SET_EXPONENT,  Next: SHAPE,  Prev: SELECTED_REAL_KIND,  Up: Intrinsic Procedures
17749
177509.243 'SET_EXPONENT' -- Set the exponent of the model
17751=====================================================
17752
17753_Description_:
17754     'SET_EXPONENT(X, I)' returns the real number whose fractional part
17755     is that that of X and whose exponent part is I.
17756
17757_Standard_:
17758     Fortran 95 and later
17759
17760_Class_:
17761     Elemental function
17762
17763_Syntax_:
17764     'RESULT = SET_EXPONENT(X, I)'
17765
17766_Arguments_:
17767     X           Shall be of type 'REAL'.
17768     I           Shall be of type 'INTEGER'.
17769
17770_Return value_:
17771     The return value is of the same type and kind as X.  The real
17772     number whose fractional part is that that of X and whose exponent
17773     part if I is returned; it is 'FRACTION(X) * RADIX(X)**I'.
17774
17775_Example_:
17776          PROGRAM test_setexp
17777            REAL :: x = 178.1387e-4
17778            INTEGER :: i = 17
17779            PRINT *, SET_EXPONENT(x, i), FRACTION(x) * RADIX(x)**i
17780          END PROGRAM
17781
17782
17783File: gfortran.info,  Node: SHAPE,  Next: SHIFTA,  Prev: SET_EXPONENT,  Up: Intrinsic Procedures
17784
177859.244 'SHAPE' -- Determine the shape of an array
17786================================================
17787
17788_Description_:
17789     Determines the shape of an array.
17790
17791_Standard_:
17792     Fortran 95 and later, with KIND argument Fortran 2003 and later
17793
17794_Class_:
17795     Inquiry function
17796
17797_Syntax_:
17798     'RESULT = SHAPE(SOURCE [, KIND])'
17799
17800_Arguments_:
17801     SOURCE      Shall be an array or scalar of any type.  If
17802                 SOURCE is a pointer it must be associated and
17803                 allocatable arrays must be allocated.
17804     KIND        (Optional) An 'INTEGER' initialization
17805                 expression indicating the kind parameter of the
17806                 result.
17807
17808_Return value_:
17809     An 'INTEGER' array of rank one with as many elements as SOURCE has
17810     dimensions.  The elements of the resulting array correspond to the
17811     extend of SOURCE along the respective dimensions.  If SOURCE is a
17812     scalar, the result is the rank one array of size zero.  If KIND is
17813     absent, the return value has the default integer kind otherwise the
17814     specified kind.
17815
17816_Example_:
17817          PROGRAM test_shape
17818            INTEGER, DIMENSION(-1:1, -1:2) :: A
17819            WRITE(*,*) SHAPE(A)             ! (/ 3, 4 /)
17820            WRITE(*,*) SIZE(SHAPE(42))      ! (/ /)
17821          END PROGRAM
17822
17823_See also_:
17824     *note RESHAPE::, *note SIZE::
17825
17826
17827File: gfortran.info,  Node: SHIFTA,  Next: SHIFTL,  Prev: SHAPE,  Up: Intrinsic Procedures
17828
178299.245 'SHIFTA' -- Right shift with fill
17830=======================================
17831
17832_Description_:
17833     'SHIFTA' returns a value corresponding to I with all of the bits
17834     shifted right by SHIFT places.  SHIFT that be nonnegative and less
17835     than or equal to 'BIT_SIZE(I)', otherwise the result value is
17836     undefined.  Bits shifted out from the right end are lost.  The fill
17837     is arithmetic: the bits shifted in from the left end are equal to
17838     the leftmost bit, which in two's complement representation is the
17839     sign bit.
17840
17841_Standard_:
17842     Fortran 2008 and later
17843
17844_Class_:
17845     Elemental function
17846
17847_Syntax_:
17848     'RESULT = SHIFTA(I, SHIFT)'
17849
17850_Arguments_:
17851     I           The type shall be 'INTEGER'.
17852     SHIFT       The type shall be 'INTEGER'.
17853
17854_Return value_:
17855     The return value is of type 'INTEGER' and of the same kind as I.
17856
17857_See also_:
17858     *note SHIFTL::, *note SHIFTR::
17859
17860
17861File: gfortran.info,  Node: SHIFTL,  Next: SHIFTR,  Prev: SHIFTA,  Up: Intrinsic Procedures
17862
178639.246 'SHIFTL' -- Left shift
17864============================
17865
17866_Description_:
17867     'SHIFTL' returns a value corresponding to I with all of the bits
17868     shifted left by SHIFT places.  SHIFT shall be nonnegative and less
17869     than or equal to 'BIT_SIZE(I)', otherwise the result value is
17870     undefined.  Bits shifted out from the left end are lost, and bits
17871     shifted in from the right end are set to 0.
17872
17873_Standard_:
17874     Fortran 2008 and later
17875
17876_Class_:
17877     Elemental function
17878
17879_Syntax_:
17880     'RESULT = SHIFTL(I, SHIFT)'
17881
17882_Arguments_:
17883     I           The type shall be 'INTEGER'.
17884     SHIFT       The type shall be 'INTEGER'.
17885
17886_Return value_:
17887     The return value is of type 'INTEGER' and of the same kind as I.
17888
17889_See also_:
17890     *note SHIFTA::, *note SHIFTR::
17891
17892
17893File: gfortran.info,  Node: SHIFTR,  Next: SIGN,  Prev: SHIFTL,  Up: Intrinsic Procedures
17894
178959.247 'SHIFTR' -- Right shift
17896=============================
17897
17898_Description_:
17899     'SHIFTR' returns a value corresponding to I with all of the bits
17900     shifted right by SHIFT places.  SHIFT shall be nonnegative and less
17901     than or equal to 'BIT_SIZE(I)', otherwise the result value is
17902     undefined.  Bits shifted out from the right end are lost, and bits
17903     shifted in from the left end are set to 0.
17904
17905_Standard_:
17906     Fortran 2008 and later
17907
17908_Class_:
17909     Elemental function
17910
17911_Syntax_:
17912     'RESULT = SHIFTR(I, SHIFT)'
17913
17914_Arguments_:
17915     I           The type shall be 'INTEGER'.
17916     SHIFT       The type shall be 'INTEGER'.
17917
17918_Return value_:
17919     The return value is of type 'INTEGER' and of the same kind as I.
17920
17921_See also_:
17922     *note SHIFTA::, *note SHIFTL::
17923
17924
17925File: gfortran.info,  Node: SIGN,  Next: SIGNAL,  Prev: SHIFTR,  Up: Intrinsic Procedures
17926
179279.248 'SIGN' -- Sign copying function
17928=====================================
17929
17930_Description_:
17931     'SIGN(A,B)' returns the value of A with the sign of B.
17932
17933_Standard_:
17934     Fortran 77 and later
17935
17936_Class_:
17937     Elemental function
17938
17939_Syntax_:
17940     'RESULT = SIGN(A, B)'
17941
17942_Arguments_:
17943     A           Shall be of type 'INTEGER' or 'REAL'
17944     B           Shall be of the same type and kind as A
17945
17946_Return value_:
17947     The kind of the return value is that of A and B.  If B\ge 0 then
17948     the result is 'ABS(A)', else it is '-ABS(A)'.
17949
17950_Example_:
17951          program test_sign
17952            print *, sign(-12,1)
17953            print *, sign(-12,0)
17954            print *, sign(-12,-1)
17955
17956            print *, sign(-12.,1.)
17957            print *, sign(-12.,0.)
17958            print *, sign(-12.,-1.)
17959          end program test_sign
17960
17961_Specific names_:
17962     Name           Arguments      Return type    Standard
17963     'SIGN(A,B)'    'REAL(4) A,    'REAL(4)'      f77, gnu
17964                    B'
17965     'ISIGN(A,B)'   'INTEGER(4)    'INTEGER(4)'   f77, gnu
17966                    A, B'
17967     'DSIGN(A,B)'   'REAL(8) A,    'REAL(8)'      f77, gnu
17968                    B'
17969
17970
17971File: gfortran.info,  Node: SIGNAL,  Next: SIN,  Prev: SIGN,  Up: Intrinsic Procedures
17972
179739.249 'SIGNAL' -- Signal handling subroutine (or function)
17974==========================================================
17975
17976_Description_:
17977     'SIGNAL(NUMBER, HANDLER [, STATUS])' causes external subroutine
17978     HANDLER to be executed with a single integer argument when signal
17979     NUMBER occurs.  If HANDLER is an integer, it can be used to turn
17980     off handling of signal NUMBER or revert to its default action.  See
17981     'signal(2)'.
17982
17983     If 'SIGNAL' is called as a subroutine and the STATUS argument is
17984     supplied, it is set to the value returned by 'signal(2)'.
17985
17986_Standard_:
17987     GNU extension
17988
17989_Class_:
17990     Subroutine, function
17991
17992_Syntax_:
17993     'CALL SIGNAL(NUMBER, HANDLER [, STATUS])'
17994     'STATUS = SIGNAL(NUMBER, HANDLER)'
17995
17996_Arguments_:
17997     NUMBER      Shall be a scalar integer, with 'INTENT(IN)'
17998     HANDLER     Signal handler ('INTEGER FUNCTION' or
17999                 'SUBROUTINE') or dummy/global 'INTEGER' scalar.
18000                 'INTEGER'.  It is 'INTENT(IN)'.
18001     STATUS      (Optional) STATUS shall be a scalar integer.  It
18002                 has 'INTENT(OUT)'.
18003
18004_Return value_:
18005     The 'SIGNAL' function returns the value returned by 'signal(2)'.
18006
18007_Example_:
18008          program test_signal
18009            intrinsic signal
18010            external handler_print
18011
18012            call signal (12, handler_print)
18013            call signal (10, 1)
18014
18015            call sleep (30)
18016          end program test_signal
18017
18018
18019File: gfortran.info,  Node: SIN,  Next: SIND,  Prev: SIGNAL,  Up: Intrinsic Procedures
18020
180219.250 'SIN' -- Sine function
18022============================
18023
18024_Description_:
18025     'SIN(X)' computes the sine of X.
18026
18027_Standard_:
18028     Fortran 77 and later
18029
18030_Class_:
18031     Elemental function
18032
18033_Syntax_:
18034     'RESULT = SIN(X)'
18035
18036_Arguments_:
18037     X           The type shall be 'REAL' or 'COMPLEX'.
18038
18039_Return value_:
18040     The return value has same type and kind as X.
18041
18042_Example_:
18043          program test_sin
18044            real :: x = 0.0
18045            x = sin(x)
18046          end program test_sin
18047
18048_Specific names_:
18049     Name           Argument       Return type    Standard
18050     'SIN(X)'       'REAL(4) X'    'REAL(4)'      f77, gnu
18051     'DSIN(X)'      'REAL(8) X'    'REAL(8)'      f95, gnu
18052     'CSIN(X)'      'COMPLEX(4)    'COMPLEX(4)'   f95, gnu
18053                    X'
18054     'ZSIN(X)'      'COMPLEX(8)    'COMPLEX(8)'   f95, gnu
18055                    X'
18056     'CDSIN(X)'     'COMPLEX(8)    'COMPLEX(8)'   f95, gnu
18057                    X'
18058
18059_See also_:
18060     Inverse function: *note ASIN:: Degrees function: *note SIND::
18061
18062
18063File: gfortran.info,  Node: SIND,  Next: SINH,  Prev: SIN,  Up: Intrinsic Procedures
18064
180659.251 'SIND' -- Sine function, degrees
18066======================================
18067
18068_Description_:
18069     'SIND(X)' computes the sine of X in degrees.
18070
18071     This function is for compatibility only and should be avoided in
18072     favor of standard constructs wherever possible.
18073
18074_Standard_:
18075     GNU Extension, enabled with '-fdec-math'.
18076
18077_Class_:
18078     Elemental function
18079
18080_Syntax_:
18081     'RESULT = SIND(X)'
18082
18083_Arguments_:
18084     X           The type shall be 'REAL' or 'COMPLEX'.
18085
18086_Return value_:
18087     The return value has same type and kind as X, and its value is in
18088     degrees.
18089
18090_Example_:
18091          program test_sind
18092            real :: x = 0.0
18093            x = sind(x)
18094          end program test_sind
18095
18096_Specific names_:
18097     Name           Argument       Return type    Standard
18098     'SIND(X)'      'REAL(4) X'    'REAL(4)'      GNU Extension
18099     'DSIND(X)'     'REAL(8) X'    'REAL(8)'      GNU Extension
18100     'CSIND(X)'     'COMPLEX(4)    'COMPLEX(4)'   GNU Extension
18101                    X'
18102     'ZSIND(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU Extension
18103                    X'
18104     'CDSIND(X)'    'COMPLEX(8)    'COMPLEX(8)'   GNU Extension
18105                    X'
18106
18107_See also_:
18108     Inverse function: *note ASIND:: Radians function: *note SIN::
18109
18110
18111File: gfortran.info,  Node: SINH,  Next: SIZE,  Prev: SIND,  Up: Intrinsic Procedures
18112
181139.252 'SINH' -- Hyperbolic sine function
18114========================================
18115
18116_Description_:
18117     'SINH(X)' computes the hyperbolic sine of X.
18118
18119_Standard_:
18120     Fortran 95 and later, for a complex argument Fortran 2008 or later
18121
18122_Class_:
18123     Elemental function
18124
18125_Syntax_:
18126     'RESULT = SINH(X)'
18127
18128_Arguments_:
18129     X           The type shall be 'REAL' or 'COMPLEX'.
18130
18131_Return value_:
18132     The return value has same type and kind as X.
18133
18134_Example_:
18135          program test_sinh
18136            real(8) :: x = - 1.0_8
18137            x = sinh(x)
18138          end program test_sinh
18139
18140_Specific names_:
18141     Name           Argument       Return type    Standard
18142     'SINH(X)'      'REAL(4) X'    'REAL(4)'      Fortran 95 and
18143                                                  later
18144     'DSINH(X)'     'REAL(8) X'    'REAL(8)'      Fortran 95 and
18145                                                  later
18146
18147_See also_:
18148     *note ASINH::
18149
18150
18151File: gfortran.info,  Node: SIZE,  Next: SIZEOF,  Prev: SINH,  Up: Intrinsic Procedures
18152
181539.253 'SIZE' -- Determine the size of an array
18154==============================================
18155
18156_Description_:
18157     Determine the extent of ARRAY along a specified dimension DIM, or
18158     the total number of elements in ARRAY if DIM is absent.
18159
18160_Standard_:
18161     Fortran 95 and later, with KIND argument Fortran 2003 and later
18162
18163_Class_:
18164     Inquiry function
18165
18166_Syntax_:
18167     'RESULT = SIZE(ARRAY[, DIM [, KIND]])'
18168
18169_Arguments_:
18170     ARRAY       Shall be an array of any type.  If ARRAY is a
18171                 pointer it must be associated and allocatable
18172                 arrays must be allocated.
18173     DIM         (Optional) shall be a scalar of type 'INTEGER'
18174                 and its value shall be in the range from 1 to n,
18175                 where n equals the rank of ARRAY.
18176     KIND        (Optional) An 'INTEGER' initialization
18177                 expression indicating the kind parameter of the
18178                 result.
18179
18180_Return value_:
18181     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
18182     absent, the return value is of default integer kind.
18183
18184_Example_:
18185          PROGRAM test_size
18186            WRITE(*,*) SIZE((/ 1, 2 /))    ! 2
18187          END PROGRAM
18188
18189_See also_:
18190     *note SHAPE::, *note RESHAPE::
18191
18192
18193File: gfortran.info,  Node: SIZEOF,  Next: SLEEP,  Prev: SIZE,  Up: Intrinsic Procedures
18194
181959.254 'SIZEOF' -- Size in bytes of an expression
18196================================================
18197
18198_Description_:
18199     'SIZEOF(X)' calculates the number of bytes of storage the
18200     expression 'X' occupies.
18201
18202_Standard_:
18203     GNU extension
18204
18205_Class_:
18206     Inquiry function
18207
18208_Syntax_:
18209     'N = SIZEOF(X)'
18210
18211_Arguments_:
18212     X           The argument shall be of any type, rank or
18213                 shape.
18214
18215_Return value_:
18216     The return value is of type integer and of the system-dependent
18217     kind C_SIZE_T (from the ISO_C_BINDING module).  Its value is the
18218     number of bytes occupied by the argument.  If the argument has the
18219     'POINTER' attribute, the number of bytes of the storage area
18220     pointed to is returned.  If the argument is of a derived type with
18221     'POINTER' or 'ALLOCATABLE' components, the return value does not
18222     account for the sizes of the data pointed to by these components.
18223     If the argument is polymorphic, the size according to the dynamic
18224     type is returned.  The argument may not be a procedure or procedure
18225     pointer.  Note that the code assumes for arrays that those are
18226     contiguous; for contiguous arrays, it returns the storage or an
18227     array element multiplied by the size of the array.
18228
18229_Example_:
18230             integer :: i
18231             real :: r, s(5)
18232             print *, (sizeof(s)/sizeof(r) == 5)
18233             end
18234     The example will print '.TRUE.' unless you are using a platform
18235     where default 'REAL' variables are unusually padded.
18236
18237_See also_:
18238     *note C_SIZEOF::, *note STORAGE_SIZE::
18239
18240
18241File: gfortran.info,  Node: SLEEP,  Next: SPACING,  Prev: SIZEOF,  Up: Intrinsic Procedures
18242
182439.255 'SLEEP' -- Sleep for the specified number of seconds
18244==========================================================
18245
18246_Description_:
18247     Calling this subroutine causes the process to pause for SECONDS
18248     seconds.
18249
18250_Standard_:
18251     GNU extension
18252
18253_Class_:
18254     Subroutine
18255
18256_Syntax_:
18257     'CALL SLEEP(SECONDS)'
18258
18259_Arguments_:
18260     SECONDS     The type shall be of default 'INTEGER'.
18261
18262_Example_:
18263          program test_sleep
18264            call sleep(5)
18265          end
18266
18267
18268File: gfortran.info,  Node: SPACING,  Next: SPREAD,  Prev: SLEEP,  Up: Intrinsic Procedures
18269
182709.256 'SPACING' -- Smallest distance between two numbers of a given type
18271========================================================================
18272
18273_Description_:
18274     Determines the distance between the argument X and the nearest
18275     adjacent number of the same type.
18276
18277_Standard_:
18278     Fortran 95 and later
18279
18280_Class_:
18281     Elemental function
18282
18283_Syntax_:
18284     'RESULT = SPACING(X)'
18285
18286_Arguments_:
18287     X           Shall be of type 'REAL'.
18288
18289_Return value_:
18290     The result is of the same type as the input argument X.
18291
18292_Example_:
18293          PROGRAM test_spacing
18294            INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37)
18295            INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200)
18296
18297            WRITE(*,*) spacing(1.0_SGL)      ! "1.1920929E-07"          on i686
18298            WRITE(*,*) spacing(1.0_DBL)      ! "2.220446049250313E-016" on i686
18299          END PROGRAM
18300
18301_See also_:
18302     *note RRSPACING::
18303
18304
18305File: gfortran.info,  Node: SPREAD,  Next: SQRT,  Prev: SPACING,  Up: Intrinsic Procedures
18306
183079.257 'SPREAD' -- Add a dimension to an array
18308=============================================
18309
18310_Description_:
18311     Replicates a SOURCE array NCOPIES times along a specified dimension
18312     DIM.
18313
18314_Standard_:
18315     Fortran 95 and later
18316
18317_Class_:
18318     Transformational function
18319
18320_Syntax_:
18321     'RESULT = SPREAD(SOURCE, DIM, NCOPIES)'
18322
18323_Arguments_:
18324     SOURCE      Shall be a scalar or an array of any type and a
18325                 rank less than seven.
18326     DIM         Shall be a scalar of type 'INTEGER' with a value
18327                 in the range from 1 to n+1, where n equals the
18328                 rank of SOURCE.
18329     NCOPIES     Shall be a scalar of type 'INTEGER'.
18330
18331_Return value_:
18332     The result is an array of the same type as SOURCE and has rank n+1
18333     where n equals the rank of SOURCE.
18334
18335_Example_:
18336          PROGRAM test_spread
18337            INTEGER :: a = 1, b(2) = (/ 1, 2 /)
18338            WRITE(*,*) SPREAD(A, 1, 2)            ! "1 1"
18339            WRITE(*,*) SPREAD(B, 1, 2)            ! "1 1 2 2"
18340          END PROGRAM
18341
18342_See also_:
18343     *note UNPACK::
18344
18345
18346File: gfortran.info,  Node: SQRT,  Next: SRAND,  Prev: SPREAD,  Up: Intrinsic Procedures
18347
183489.258 'SQRT' -- Square-root function
18349====================================
18350
18351_Description_:
18352     'SQRT(X)' computes the square root of X.
18353
18354_Standard_:
18355     Fortran 77 and later
18356
18357_Class_:
18358     Elemental function
18359
18360_Syntax_:
18361     'RESULT = SQRT(X)'
18362
18363_Arguments_:
18364     X           The type shall be 'REAL' or 'COMPLEX'.
18365
18366_Return value_:
18367     The return value is of type 'REAL' or 'COMPLEX'.  The kind type
18368     parameter is the same as X.
18369
18370_Example_:
18371          program test_sqrt
18372            real(8) :: x = 2.0_8
18373            complex :: z = (1.0, 2.0)
18374            x = sqrt(x)
18375            z = sqrt(z)
18376          end program test_sqrt
18377
18378_Specific names_:
18379     Name           Argument       Return type    Standard
18380     'SQRT(X)'      'REAL(4) X'    'REAL(4)'      Fortran 95 and
18381                                                  later
18382     'DSQRT(X)'     'REAL(8) X'    'REAL(8)'      Fortran 95 and
18383                                                  later
18384     'CSQRT(X)'     'COMPLEX(4)    'COMPLEX(4)'   Fortran 95 and
18385                    X'                            later
18386     'ZSQRT(X)'     'COMPLEX(8)    'COMPLEX(8)'   GNU extension
18387                    X'
18388     'CDSQRT(X)'    'COMPLEX(8)    'COMPLEX(8)'   GNU extension
18389                    X'
18390
18391
18392File: gfortran.info,  Node: SRAND,  Next: STAT,  Prev: SQRT,  Up: Intrinsic Procedures
18393
183949.259 'SRAND' -- Reinitialize the random number generator
18395=========================================================
18396
18397_Description_:
18398     'SRAND' reinitializes the pseudo-random number generator called by
18399     'RAND' and 'IRAND'.  The new seed used by the generator is
18400     specified by the required argument SEED.
18401
18402_Standard_:
18403     GNU extension
18404
18405_Class_:
18406     Subroutine
18407
18408_Syntax_:
18409     'CALL SRAND(SEED)'
18410
18411_Arguments_:
18412     SEED        Shall be a scalar 'INTEGER(kind=4)'.
18413
18414_Return value_:
18415     Does not return anything.
18416
18417_Example_:
18418     See 'RAND' and 'IRAND' for examples.
18419
18420_Notes_:
18421     The Fortran standard specifies the intrinsic subroutines
18422     'RANDOM_SEED' to initialize the pseudo-random number generator and
18423     'RANDOM_NUMBER' to generate pseudo-random numbers.  These
18424     subroutines should be used in new codes.
18425
18426     Please note that in GNU Fortran, these two sets of intrinsics
18427     ('RAND', 'IRAND' and 'SRAND' on the one hand, 'RANDOM_NUMBER' and
18428     'RANDOM_SEED' on the other hand) access two independent
18429     pseudo-random number generators.
18430
18431_See also_:
18432     *note RAND::, *note RANDOM_SEED::, *note RANDOM_NUMBER::
18433
18434
18435File: gfortran.info,  Node: STAT,  Next: STORAGE_SIZE,  Prev: SRAND,  Up: Intrinsic Procedures
18436
184379.260 'STAT' -- Get file status
18438===============================
18439
18440_Description_:
18441     This function returns information about a file.  No permissions are
18442     required on the file itself, but execute (search) permission is
18443     required on all of the directories in path that lead to the file.
18444
18445     The elements that are obtained and stored in the array 'VALUES':
18446     'VALUES(1)' Device ID
18447     'VALUES(2)' Inode number
18448     'VALUES(3)' File mode
18449     'VALUES(4)' Number of links
18450     'VALUES(5)' Owner's uid
18451     'VALUES(6)' Owner's gid
18452     'VALUES(7)' ID of device containing directory entry for file
18453                 (0 if not available)
18454     'VALUES(8)' File size (bytes)
18455     'VALUES(9)' Last access time
18456     'VALUES(10)'Last modification time
18457     'VALUES(11)'Last file status change time
18458     'VALUES(12)'Preferred I/O block size (-1 if not available)
18459     'VALUES(13)'Number of blocks allocated (-1 if not available)
18460
18461     Not all these elements are relevant on all systems.  If an element
18462     is not relevant, it is returned as 0.
18463
18464     This intrinsic is provided in both subroutine and function forms;
18465     however, only one form can be used in any given program unit.
18466
18467_Standard_:
18468     GNU extension
18469
18470_Class_:
18471     Subroutine, function
18472
18473_Syntax_:
18474     'CALL STAT(NAME, VALUES [, STATUS])'
18475     'STATUS = STAT(NAME, VALUES)'
18476
18477_Arguments_:
18478     NAME        The type shall be 'CHARACTER', of the default
18479                 kind and a valid path within the file system.
18480     VALUES      The type shall be 'INTEGER(4), DIMENSION(13)'.
18481     STATUS      (Optional) status flag of type 'INTEGER(4)'.
18482                 Returns 0 on success and a system specific error
18483                 code otherwise.
18484
18485_Example_:
18486          PROGRAM test_stat
18487            INTEGER, DIMENSION(13) :: buff
18488            INTEGER :: status
18489
18490            CALL STAT("/etc/passwd", buff, status)
18491
18492            IF (status == 0) THEN
18493              WRITE (*, FMT="('Device ID:',               T30, I19)") buff(1)
18494              WRITE (*, FMT="('Inode number:',            T30, I19)") buff(2)
18495              WRITE (*, FMT="('File mode (octal):',       T30, O19)") buff(3)
18496              WRITE (*, FMT="('Number of links:',         T30, I19)") buff(4)
18497              WRITE (*, FMT="('Owner''s uid:',            T30, I19)") buff(5)
18498              WRITE (*, FMT="('Owner''s gid:',            T30, I19)") buff(6)
18499              WRITE (*, FMT="('Device where located:',    T30, I19)") buff(7)
18500              WRITE (*, FMT="('File size:',               T30, I19)") buff(8)
18501              WRITE (*, FMT="('Last access time:',        T30, A19)") CTIME(buff(9))
18502              WRITE (*, FMT="('Last modification time',   T30, A19)") CTIME(buff(10))
18503              WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11))
18504              WRITE (*, FMT="('Preferred block size:',    T30, I19)") buff(12)
18505              WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13)
18506            END IF
18507          END PROGRAM
18508
18509_See also_:
18510     To stat an open file: *note FSTAT::, to stat a link: *note LSTAT::
18511
18512
18513File: gfortran.info,  Node: STORAGE_SIZE,  Next: SUM,  Prev: STAT,  Up: Intrinsic Procedures
18514
185159.261 'STORAGE_SIZE' -- Storage size in bits
18516============================================
18517
18518_Description_:
18519     Returns the storage size of argument A in bits.
18520_Standard_:
18521     Fortran 2008 and later
18522_Class_:
18523     Inquiry function
18524_Syntax_:
18525     'RESULT = STORAGE_SIZE(A [, KIND])'
18526
18527_Arguments_:
18528     A           Shall be a scalar or array of any type.
18529     KIND        (Optional) shall be a scalar integer constant
18530                 expression.
18531
18532_Return Value_:
18533     The result is a scalar integer with the kind type parameter
18534     specified by KIND (or default integer type if KIND is missing).
18535     The result value is the size expressed in bits for an element of an
18536     array that has the dynamic type and type parameters of A.
18537
18538_See also_:
18539     *note C_SIZEOF::, *note SIZEOF::
18540
18541
18542File: gfortran.info,  Node: SUM,  Next: SYMLNK,  Prev: STORAGE_SIZE,  Up: Intrinsic Procedures
18543
185449.262 'SUM' -- Sum of array elements
18545====================================
18546
18547_Description_:
18548     Adds the elements of ARRAY along dimension DIM if the corresponding
18549     element in MASK is 'TRUE'.
18550
18551_Standard_:
18552     Fortran 95 and later
18553
18554_Class_:
18555     Transformational function
18556
18557_Syntax_:
18558     'RESULT = SUM(ARRAY[, MASK])'
18559     'RESULT = SUM(ARRAY, DIM[, MASK])'
18560
18561_Arguments_:
18562     ARRAY       Shall be an array of type 'INTEGER', 'REAL' or
18563                 'COMPLEX'.
18564     DIM         (Optional) shall be a scalar of type 'INTEGER'
18565                 with a value in the range from 1 to n, where n
18566                 equals the rank of ARRAY.
18567     MASK        (Optional) shall be of type 'LOGICAL' and either
18568                 be a scalar or an array of the same shape as
18569                 ARRAY.
18570
18571_Return value_:
18572     The result is of the same type as ARRAY.
18573
18574     If DIM is absent, a scalar with the sum of all elements in ARRAY is
18575     returned.  Otherwise, an array of rank n-1, where n equals the rank
18576     of ARRAY, and a shape similar to that of ARRAY with dimension DIM
18577     dropped is returned.
18578
18579_Example_:
18580          PROGRAM test_sum
18581            INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /)
18582            print *, SUM(x)                        ! all elements, sum = 15
18583            print *, SUM(x, MASK=MOD(x, 2)==1)     ! odd elements, sum = 9
18584          END PROGRAM
18585
18586_See also_:
18587     *note PRODUCT::
18588
18589
18590File: gfortran.info,  Node: SYMLNK,  Next: SYSTEM,  Prev: SUM,  Up: Intrinsic Procedures
18591
185929.263 'SYMLNK' -- Create a symbolic link
18593========================================
18594
18595_Description_:
18596     Makes a symbolic link from file PATH1 to PATH2.  A null character
18597     ('CHAR(0)') can be used to mark the end of the names in PATH1 and
18598     PATH2; otherwise, trailing blanks in the file names are ignored.
18599     If the STATUS argument is supplied, it contains 0 on success or a
18600     nonzero error code upon return; see 'symlink(2)'.  If the system
18601     does not supply 'symlink(2)', 'ENOSYS' is returned.
18602
18603     This intrinsic is provided in both subroutine and function forms;
18604     however, only one form can be used in any given program unit.
18605
18606_Standard_:
18607     GNU extension
18608
18609_Class_:
18610     Subroutine, function
18611
18612_Syntax_:
18613     'CALL SYMLNK(PATH1, PATH2 [, STATUS])'
18614     'STATUS = SYMLNK(PATH1, PATH2)'
18615
18616_Arguments_:
18617     PATH1       Shall be of default 'CHARACTER' type.
18618     PATH2       Shall be of default 'CHARACTER' type.
18619     STATUS      (Optional) Shall be of default 'INTEGER' type.
18620
18621_See also_:
18622     *note LINK::, *note UNLINK::
18623
18624
18625File: gfortran.info,  Node: SYSTEM,  Next: SYSTEM_CLOCK,  Prev: SYMLNK,  Up: Intrinsic Procedures
18626
186279.264 'SYSTEM' -- Execute a shell command
18628=========================================
18629
18630_Description_:
18631     Passes the command COMMAND to a shell (see 'system(3)').  If
18632     argument STATUS is present, it contains the value returned by
18633     'system(3)', which is presumably 0 if the shell command succeeded.
18634     Note that which shell is used to invoke the command is
18635     system-dependent and environment-dependent.
18636
18637     This intrinsic is provided in both subroutine and function forms;
18638     however, only one form can be used in any given program unit.
18639
18640     Note that the 'system' function need not be thread-safe.  It is the
18641     responsibility of the user to ensure that 'system' is not called
18642     concurrently.
18643
18644_Standard_:
18645     GNU extension
18646
18647_Class_:
18648     Subroutine, function
18649
18650_Syntax_:
18651     'CALL SYSTEM(COMMAND [, STATUS])'
18652     'STATUS = SYSTEM(COMMAND)'
18653
18654_Arguments_:
18655     COMMAND     Shall be of default 'CHARACTER' type.
18656     STATUS      (Optional) Shall be of default 'INTEGER' type.
18657
18658_See also_:
18659     *note EXECUTE_COMMAND_LINE::, which is part of the Fortran 2008
18660     standard and should considered in new code for future portability.
18661
18662
18663File: gfortran.info,  Node: SYSTEM_CLOCK,  Next: TAN,  Prev: SYSTEM,  Up: Intrinsic Procedures
18664
186659.265 'SYSTEM_CLOCK' -- Time function
18666=====================================
18667
18668_Description_:
18669     Determines the COUNT of a processor clock since an unspecified time
18670     in the past modulo COUNT_MAX, COUNT_RATE determines the number of
18671     clock ticks per second.  If the platform supports a monotonic
18672     clock, that clock is used and can, depending on the platform clock
18673     implementation, provide up to nanosecond resolution.  If a
18674     monotonic clock is not available, the implementation falls back to
18675     a realtime clock.
18676
18677     COUNT_RATE is system dependent and can vary depending on the kind
18678     of the arguments.  For KIND=4 arguments (and smaller integer
18679     kinds), COUNT represents milliseconds, while for KIND=8 arguments
18680     (and larger integer kinds), COUNT typically represents micro- or
18681     nanoseconds depending on resolution of the underlying platform
18682     clock.  COUNT_MAX usually equals 'HUGE(COUNT_MAX)'.  Note that the
18683     millisecond resolution of the KIND=4 version implies that the COUNT
18684     will wrap around in roughly 25 days.  In order to avoid issues with
18685     the wrap around and for more precise timing, please use the KIND=8
18686     version.
18687
18688     If there is no clock, or querying the clock fails, COUNT is set to
18689     '-HUGE(COUNT)', and COUNT_RATE and COUNT_MAX are set to zero.
18690
18691     When running on a platform using the GNU C library (glibc) version
18692     2.16 or older, or a derivative thereof, the high resolution
18693     monotonic clock is available only when linking with the RT library.
18694     This can be done explicitly by adding the '-lrt' flag when linking
18695     the application, but is also done implicitly when using OpenMP.
18696
18697     On the Windows platform, the version with KIND=4 arguments uses the
18698     'GetTickCount' function, whereas the KIND=8 version uses
18699     'QueryPerformanceCounter' and 'QueryPerformanceCounterFrequency'.
18700     For more information, and potential caveats, please see the
18701     platform documentation.
18702
18703_Standard_:
18704     Fortran 95 and later
18705
18706_Class_:
18707     Subroutine
18708
18709_Syntax_:
18710     'CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])'
18711
18712_Arguments_:
18713     COUNT       (Optional) shall be a scalar of type 'INTEGER'
18714                 with 'INTENT(OUT)'.
18715     COUNT_RATE  (Optional) shall be a scalar of type 'INTEGER'
18716                 or 'REAL', with 'INTENT(OUT)'.
18717     COUNT_MAX   (Optional) shall be a scalar of type 'INTEGER'
18718                 with 'INTENT(OUT)'.
18719
18720_Example_:
18721          PROGRAM test_system_clock
18722            INTEGER :: count, count_rate, count_max
18723            CALL SYSTEM_CLOCK(count, count_rate, count_max)
18724            WRITE(*,*) count, count_rate, count_max
18725          END PROGRAM
18726
18727_See also_:
18728     *note DATE_AND_TIME::, *note CPU_TIME::
18729
18730
18731File: gfortran.info,  Node: TAN,  Next: TAND,  Prev: SYSTEM_CLOCK,  Up: Intrinsic Procedures
18732
187339.266 'TAN' -- Tangent function
18734===============================
18735
18736_Description_:
18737     'TAN(X)' computes the tangent of X.
18738
18739_Standard_:
18740     Fortran 77 and later, for a complex argument Fortran 2008 or later
18741
18742_Class_:
18743     Elemental function
18744
18745_Syntax_:
18746     'RESULT = TAN(X)'
18747
18748_Arguments_:
18749     X           The type shall be 'REAL' or 'COMPLEX'.
18750
18751_Return value_:
18752     The return value has same type and kind as X, and its value is in
18753     radians.
18754
18755_Example_:
18756          program test_tan
18757            real(8) :: x = 0.165_8
18758            x = tan(x)
18759          end program test_tan
18760
18761_Specific names_:
18762     Name           Argument       Return type    Standard
18763     'TAN(X)'       'REAL(4) X'    'REAL(4)'      Fortran 95 and
18764                                                  later
18765     'DTAN(X)'      'REAL(8) X'    'REAL(8)'      Fortran 95 and
18766                                                  later
18767
18768_See also_:
18769     Inverse function: *note ATAN:: Degrees function: *note TAND::
18770
18771
18772File: gfortran.info,  Node: TAND,  Next: TANH,  Prev: TAN,  Up: Intrinsic Procedures
18773
187749.267 'TAND' -- Tangent function, degrees
18775=========================================
18776
18777_Description_:
18778     'TAND(X)' computes the tangent of X in degrees.
18779
18780     This function is for compatibility only and should be avoided in
18781     favor of standard constructs wherever possible.
18782
18783_Standard_:
18784     GNU Extension, enabled with '-fdec-math'.
18785
18786_Class_:
18787     Elemental function
18788
18789_Syntax_:
18790     'RESULT = TAND(X)'
18791
18792_Arguments_:
18793     X           The type shall be 'REAL' or 'COMPLEX'.
18794
18795_Return value_:
18796     The return value has same type and kind as X, and its value is in
18797     degrees.
18798
18799_Example_:
18800          program test_tand
18801            real(8) :: x = 0.165_8
18802            x = tand(x)
18803          end program test_tand
18804
18805_Specific names_:
18806     Name           Argument       Return type    Standard
18807     'TAND(X)'      'REAL(4) X'    'REAL(4)'      GNU Extension
18808     'DTAND(X)'     'REAL(8) X'    'REAL(8)'      GNU Extension
18809
18810_See also_:
18811     Inverse function: *note ATAND:: Radians function: *note TAN::
18812
18813
18814File: gfortran.info,  Node: TANH,  Next: THIS_IMAGE,  Prev: TAND,  Up: Intrinsic Procedures
18815
188169.268 'TANH' -- Hyperbolic tangent function
18817===========================================
18818
18819_Description_:
18820     'TANH(X)' computes the hyperbolic tangent of X.
18821
18822_Standard_:
18823     Fortran 77 and later, for a complex argument Fortran 2008 or later
18824
18825_Class_:
18826     Elemental function
18827
18828_Syntax_:
18829     'X = TANH(X)'
18830
18831_Arguments_:
18832     X           The type shall be 'REAL' or 'COMPLEX'.
18833
18834_Return value_:
18835     The return value has same type and kind as X.  If X is complex, the
18836     imaginary part of the result is in radians.  If X is 'REAL', the
18837     return value lies in the range - 1 \leq tanh(x) \leq 1 .
18838
18839_Example_:
18840          program test_tanh
18841            real(8) :: x = 2.1_8
18842            x = tanh(x)
18843          end program test_tanh
18844
18845_Specific names_:
18846     Name           Argument       Return type    Standard
18847     'TANH(X)'      'REAL(4) X'    'REAL(4)'      Fortran 95 and
18848                                                  later
18849     'DTANH(X)'     'REAL(8) X'    'REAL(8)'      Fortran 95 and
18850                                                  later
18851
18852_See also_:
18853     *note ATANH::
18854
18855
18856File: gfortran.info,  Node: THIS_IMAGE,  Next: TIME,  Prev: TANH,  Up: Intrinsic Procedures
18857
188589.269 'THIS_IMAGE' -- Function that returns the cosubscript index of this image
18859===============================================================================
18860
18861_Description_:
18862     Returns the cosubscript for this image.
18863
18864_Standard_:
18865     Fortran 2008 and later.  With DISTANCE argument, Technical
18866     Specification (TS) 18508 or later
18867
18868_Class_:
18869     Transformational function
18870
18871_Syntax_:
18872     'RESULT = THIS_IMAGE()'
18873     'RESULT = THIS_IMAGE(DISTANCE)'
18874     'RESULT = THIS_IMAGE(COARRAY [, DIM])'
18875
18876_Arguments_:
18877     DISTANCE    (optional, intent(in)) Nonnegative scalar
18878                 integer (not permitted together with COARRAY).
18879     COARRAY     Coarray of any type (optional; if DIM present,
18880                 required).
18881     DIM         default integer scalar (optional).  If present,
18882                 DIM shall be between one and the corank of
18883                 COARRAY.
18884
18885_Return value_:
18886     Default integer.  If COARRAY is not present, it is scalar; if
18887     DISTANCE is not present or has value 0, its value is the image
18888     index on the invoking image for the current team, for values
18889     smaller or equal distance to the initial team, it returns the image
18890     index on the ancestor team which has a distance of DISTANCE from
18891     the invoking team.  If DISTANCE is larger than the distance to the
18892     initial team, the image index of the initial team is returned.
18893     Otherwise when the COARRAY is present, if DIM is not present, a
18894     rank-1 array with corank elements is returned, containing the
18895     cosubscripts for COARRAY specifying the invoking image.  If DIM is
18896     present, a scalar is returned, with the value of the DIM element of
18897     'THIS_IMAGE(COARRAY)'.
18898
18899_Example_:
18900          INTEGER :: value[*]
18901          INTEGER :: i
18902          value = THIS_IMAGE()
18903          SYNC ALL
18904          IF (THIS_IMAGE() == 1) THEN
18905            DO i = 1, NUM_IMAGES()
18906              WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i]
18907            END DO
18908          END IF
18909
18910          ! Check whether the current image is the initial image
18911          IF (THIS_IMAGE(HUGE(1)) /= THIS_IMAGE())
18912            error stop "something is rotten here"
18913
18914_See also_:
18915     *note NUM_IMAGES::, *note IMAGE_INDEX::
18916
18917
18918File: gfortran.info,  Node: TIME,  Next: TIME8,  Prev: THIS_IMAGE,  Up: Intrinsic Procedures
18919
189209.270 'TIME' -- Time function
18921=============================
18922
18923_Description_:
18924     Returns the current time encoded as an integer (in the manner of
18925     the function 'time(3)' in the C standard library).  This value is
18926     suitable for passing to *note CTIME::, *note GMTIME::, and *note
18927     LTIME::.
18928
18929     This intrinsic is not fully portable, such as to systems with
18930     32-bit 'INTEGER' types but supporting times wider than 32 bits.
18931     Therefore, the values returned by this intrinsic might be, or
18932     become, negative, or numerically less than previous values, during
18933     a single run of the compiled program.
18934
18935     See *note TIME8::, for information on a similar intrinsic that
18936     might be portable to more GNU Fortran implementations, though to
18937     fewer Fortran compilers.
18938
18939_Standard_:
18940     GNU extension
18941
18942_Class_:
18943     Function
18944
18945_Syntax_:
18946     'RESULT = TIME()'
18947
18948_Return value_:
18949     The return value is a scalar of type 'INTEGER(4)'.
18950
18951_See also_:
18952     *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
18953     LTIME::, *note MCLOCK::, *note TIME8::
18954
18955
18956File: gfortran.info,  Node: TIME8,  Next: TINY,  Prev: TIME,  Up: Intrinsic Procedures
18957
189589.271 'TIME8' -- Time function (64-bit)
18959=======================================
18960
18961_Description_:
18962     Returns the current time encoded as an integer (in the manner of
18963     the function 'time(3)' in the C standard library).  This value is
18964     suitable for passing to *note CTIME::, *note GMTIME::, and *note
18965     LTIME::.
18966
18967     _Warning:_ this intrinsic does not increase the range of the timing
18968     values over that returned by 'time(3)'.  On a system with a 32-bit
18969     'time(3)', 'TIME8' will return a 32-bit value, even though it is
18970     converted to a 64-bit 'INTEGER(8)' value.  That means overflows of
18971     the 32-bit value can still occur.  Therefore, the values returned
18972     by this intrinsic might be or become negative or numerically less
18973     than previous values during a single run of the compiled program.
18974
18975_Standard_:
18976     GNU extension
18977
18978_Class_:
18979     Function
18980
18981_Syntax_:
18982     'RESULT = TIME8()'
18983
18984_Return value_:
18985     The return value is a scalar of type 'INTEGER(8)'.
18986
18987_See also_:
18988     *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note
18989     LTIME::, *note MCLOCK8::, *note TIME::
18990
18991
18992File: gfortran.info,  Node: TINY,  Next: TRAILZ,  Prev: TIME8,  Up: Intrinsic Procedures
18993
189949.272 'TINY' -- Smallest positive number of a real kind
18995=======================================================
18996
18997_Description_:
18998     'TINY(X)' returns the smallest positive (non zero) number in the
18999     model of the type of 'X'.
19000
19001_Standard_:
19002     Fortran 95 and later
19003
19004_Class_:
19005     Inquiry function
19006
19007_Syntax_:
19008     'RESULT = TINY(X)'
19009
19010_Arguments_:
19011     X           Shall be of type 'REAL'.
19012
19013_Return value_:
19014     The return value is of the same type and kind as X
19015
19016_Example_:
19017     See 'HUGE' for an example.
19018
19019
19020File: gfortran.info,  Node: TRAILZ,  Next: TRANSFER,  Prev: TINY,  Up: Intrinsic Procedures
19021
190229.273 'TRAILZ' -- Number of trailing zero bits of an integer
19023============================================================
19024
19025_Description_:
19026     'TRAILZ' returns the number of trailing zero bits of an integer.
19027
19028_Standard_:
19029     Fortran 2008 and later
19030
19031_Class_:
19032     Elemental function
19033
19034_Syntax_:
19035     'RESULT = TRAILZ(I)'
19036
19037_Arguments_:
19038     I           Shall be of type 'INTEGER'.
19039
19040_Return value_:
19041     The type of the return value is the default 'INTEGER'.  If all the
19042     bits of 'I' are zero, the result value is 'BIT_SIZE(I)'.
19043
19044_Example_:
19045          PROGRAM test_trailz
19046            WRITE (*,*) TRAILZ(8)  ! prints 3
19047          END PROGRAM
19048
19049_See also_:
19050     *note BIT_SIZE::, *note LEADZ::, *note POPPAR::, *note POPCNT::
19051
19052
19053File: gfortran.info,  Node: TRANSFER,  Next: TRANSPOSE,  Prev: TRAILZ,  Up: Intrinsic Procedures
19054
190559.274 'TRANSFER' -- Transfer bit patterns
19056=========================================
19057
19058_Description_:
19059     Interprets the bitwise representation of SOURCE in memory as if it
19060     is the representation of a variable or array of the same type and
19061     type parameters as MOLD.
19062
19063     This is approximately equivalent to the C concept of _casting_ one
19064     type to another.
19065
19066_Standard_:
19067     Fortran 95 and later
19068
19069_Class_:
19070     Transformational function
19071
19072_Syntax_:
19073     'RESULT = TRANSFER(SOURCE, MOLD[, SIZE])'
19074
19075_Arguments_:
19076     SOURCE      Shall be a scalar or an array of any type.
19077     MOLD        Shall be a scalar or an array of any type.
19078     SIZE        (Optional) shall be a scalar of type 'INTEGER'.
19079
19080_Return value_:
19081     The result has the same type as MOLD, with the bit level
19082     representation of SOURCE.  If SIZE is present, the result is a
19083     one-dimensional array of length SIZE.  If SIZE is absent but MOLD
19084     is an array (of any size or shape), the result is a one-
19085     dimensional array of the minimum length needed to contain the
19086     entirety of the bitwise representation of SOURCE.  If SIZE is
19087     absent and MOLD is a scalar, the result is a scalar.
19088
19089     If the bitwise representation of the result is longer than that of
19090     SOURCE, then the leading bits of the result correspond to those of
19091     SOURCE and any trailing bits are filled arbitrarily.
19092
19093     When the resulting bit representation does not correspond to a
19094     valid representation of a variable of the same type as MOLD, the
19095     results are undefined, and subsequent operations on the result
19096     cannot be guaranteed to produce sensible behavior.  For example, it
19097     is possible to create 'LOGICAL' variables for which 'VAR' and
19098     '.NOT.VAR' both appear to be true.
19099
19100_Example_:
19101          PROGRAM test_transfer
19102            integer :: x = 2143289344
19103            print *, transfer(x, 1.0)    ! prints "NaN" on i686
19104          END PROGRAM
19105
19106
19107File: gfortran.info,  Node: TRANSPOSE,  Next: TRIM,  Prev: TRANSFER,  Up: Intrinsic Procedures
19108
191099.275 'TRANSPOSE' -- Transpose an array of rank two
19110===================================================
19111
19112_Description_:
19113     Transpose an array of rank two.  Element (i, j) of the result has
19114     the value 'MATRIX(j, i)', for all i, j.
19115
19116_Standard_:
19117     Fortran 95 and later
19118
19119_Class_:
19120     Transformational function
19121
19122_Syntax_:
19123     'RESULT = TRANSPOSE(MATRIX)'
19124
19125_Arguments_:
19126     MATRIX      Shall be an array of any type and have a rank of
19127                 two.
19128
19129_Return value_:
19130     The result has the same type as MATRIX, and has shape '(/ m, n /)'
19131     if MATRIX has shape '(/ n, m /)'.
19132
19133
19134File: gfortran.info,  Node: TRIM,  Next: TTYNAM,  Prev: TRANSPOSE,  Up: Intrinsic Procedures
19135
191369.276 'TRIM' -- Remove trailing blank characters of a string
19137============================================================
19138
19139_Description_:
19140     Removes trailing blank characters of a string.
19141
19142_Standard_:
19143     Fortran 95 and later
19144
19145_Class_:
19146     Transformational function
19147
19148_Syntax_:
19149     'RESULT = TRIM(STRING)'
19150
19151_Arguments_:
19152     STRING      Shall be a scalar of type 'CHARACTER'.
19153
19154_Return value_:
19155     A scalar of type 'CHARACTER' which length is that of STRING less
19156     the number of trailing blanks.
19157
19158_Example_:
19159          PROGRAM test_trim
19160            CHARACTER(len=10), PARAMETER :: s = "GFORTRAN  "
19161            WRITE(*,*) LEN(s), LEN(TRIM(s))  ! "10 8", with/without trailing blanks
19162          END PROGRAM
19163
19164_See also_:
19165     *note ADJUSTL::, *note ADJUSTR::
19166
19167
19168File: gfortran.info,  Node: TTYNAM,  Next: UBOUND,  Prev: TRIM,  Up: Intrinsic Procedures
19169
191709.277 'TTYNAM' -- Get the name of a terminal device.
19171====================================================
19172
19173_Description_:
19174     Get the name of a terminal device.  For more information, see
19175     'ttyname(3)'.
19176
19177     This intrinsic is provided in both subroutine and function forms;
19178     however, only one form can be used in any given program unit.
19179
19180_Standard_:
19181     GNU extension
19182
19183_Class_:
19184     Subroutine, function
19185
19186_Syntax_:
19187     'CALL TTYNAM(UNIT, NAME)'
19188     'NAME = TTYNAM(UNIT)'
19189
19190_Arguments_:
19191     UNIT        Shall be a scalar 'INTEGER'.
19192     NAME        Shall be of type 'CHARACTER'.
19193
19194_Example_:
19195          PROGRAM test_ttynam
19196            INTEGER :: unit
19197            DO unit = 1, 10
19198              IF (isatty(unit=unit)) write(*,*) ttynam(unit)
19199            END DO
19200          END PROGRAM
19201
19202_See also_:
19203     *note ISATTY::
19204
19205
19206File: gfortran.info,  Node: UBOUND,  Next: UCOBOUND,  Prev: TTYNAM,  Up: Intrinsic Procedures
19207
192089.278 'UBOUND' -- Upper dimension bounds of an array
19209====================================================
19210
19211_Description_:
19212     Returns the upper bounds of an array, or a single upper bound along
19213     the DIM dimension.
19214_Standard_:
19215     Fortran 95 and later, with KIND argument Fortran 2003 and later
19216
19217_Class_:
19218     Inquiry function
19219
19220_Syntax_:
19221     'RESULT = UBOUND(ARRAY [, DIM [, KIND]])'
19222
19223_Arguments_:
19224     ARRAY       Shall be an array, of any type.
19225     DIM         (Optional) Shall be a scalar 'INTEGER'.
19226     KIND        (Optional) An 'INTEGER' initialization
19227                 expression indicating the kind parameter of the
19228                 result.
19229
19230_Return value_:
19231     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
19232     absent, the return value is of default integer kind.  If DIM is
19233     absent, the result is an array of the upper bounds of ARRAY.  If
19234     DIM is present, the result is a scalar corresponding to the upper
19235     bound of the array along that dimension.  If ARRAY is an expression
19236     rather than a whole array or array structure component, or if it
19237     has a zero extent along the relevant dimension, the upper bound is
19238     taken to be the number of elements along the relevant dimension.
19239
19240_See also_:
19241     *note LBOUND::, *note LCOBOUND::
19242
19243
19244File: gfortran.info,  Node: UCOBOUND,  Next: UMASK,  Prev: UBOUND,  Up: Intrinsic Procedures
19245
192469.279 'UCOBOUND' -- Upper codimension bounds of an array
19247========================================================
19248
19249_Description_:
19250     Returns the upper cobounds of a coarray, or a single upper cobound
19251     along the DIM codimension.
19252_Standard_:
19253     Fortran 2008 and later
19254
19255_Class_:
19256     Inquiry function
19257
19258_Syntax_:
19259     'RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])'
19260
19261_Arguments_:
19262     ARRAY       Shall be an coarray, of any type.
19263     DIM         (Optional) Shall be a scalar 'INTEGER'.
19264     KIND        (Optional) An 'INTEGER' initialization
19265                 expression indicating the kind parameter of the
19266                 result.
19267
19268_Return value_:
19269     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
19270     absent, the return value is of default integer kind.  If DIM is
19271     absent, the result is an array of the lower cobounds of COARRAY.
19272     If DIM is present, the result is a scalar corresponding to the
19273     lower cobound of the array along that codimension.
19274
19275_See also_:
19276     *note LCOBOUND::, *note LBOUND::
19277
19278
19279File: gfortran.info,  Node: UMASK,  Next: UNLINK,  Prev: UCOBOUND,  Up: Intrinsic Procedures
19280
192819.280 'UMASK' -- Set the file creation mask
19282===========================================
19283
19284_Description_:
19285     Sets the file creation mask to MASK.  If called as a function, it
19286     returns the old value.  If called as a subroutine and argument OLD
19287     if it is supplied, it is set to the old value.  See 'umask(2)'.
19288
19289_Standard_:
19290     GNU extension
19291
19292_Class_:
19293     Subroutine, function
19294
19295_Syntax_:
19296     'CALL UMASK(MASK [, OLD])'
19297     'OLD = UMASK(MASK)'
19298
19299_Arguments_:
19300     MASK        Shall be a scalar of type 'INTEGER'.
19301     OLD         (Optional) Shall be a scalar of type 'INTEGER'.
19302
19303
19304File: gfortran.info,  Node: UNLINK,  Next: UNPACK,  Prev: UMASK,  Up: Intrinsic Procedures
19305
193069.281 'UNLINK' -- Remove a file from the file system
19307====================================================
19308
19309_Description_:
19310     Unlinks the file PATH.  A null character ('CHAR(0)') can be used to
19311     mark the end of the name in PATH; otherwise, trailing blanks in the
19312     file name are ignored.  If the STATUS argument is supplied, it
19313     contains 0 on success or a nonzero error code upon return; see
19314     'unlink(2)'.
19315
19316     This intrinsic is provided in both subroutine and function forms;
19317     however, only one form can be used in any given program unit.
19318
19319_Standard_:
19320     GNU extension
19321
19322_Class_:
19323     Subroutine, function
19324
19325_Syntax_:
19326     'CALL UNLINK(PATH [, STATUS])'
19327     'STATUS = UNLINK(PATH)'
19328
19329_Arguments_:
19330     PATH        Shall be of default 'CHARACTER' type.
19331     STATUS      (Optional) Shall be of default 'INTEGER' type.
19332
19333_See also_:
19334     *note LINK::, *note SYMLNK::
19335
19336
19337File: gfortran.info,  Node: UNPACK,  Next: VERIFY,  Prev: UNLINK,  Up: Intrinsic Procedures
19338
193399.282 'UNPACK' -- Unpack an array of rank one into an array
19340===========================================================
19341
19342_Description_:
19343     Store the elements of VECTOR in an array of higher rank.
19344
19345_Standard_:
19346     Fortran 95 and later
19347
19348_Class_:
19349     Transformational function
19350
19351_Syntax_:
19352     'RESULT = UNPACK(VECTOR, MASK, FIELD)'
19353
19354_Arguments_:
19355     VECTOR      Shall be an array of any type and rank one.  It
19356                 shall have at least as many elements as MASK has
19357                 'TRUE' values.
19358     MASK        Shall be an array of type 'LOGICAL'.
19359     FIELD       Shall be of the same type as VECTOR and have the
19360                 same shape as MASK.
19361
19362_Return value_:
19363     The resulting array corresponds to FIELD with 'TRUE' elements of
19364     MASK replaced by values from VECTOR in array element order.
19365
19366_Example_:
19367          PROGRAM test_unpack
19368            integer :: vector(2)  = (/1,1/)
19369            logical :: mask(4)  = (/ .TRUE., .FALSE., .FALSE., .TRUE. /)
19370            integer :: field(2,2) = 0, unity(2,2)
19371
19372            ! result: unity matrix
19373            unity = unpack(vector, reshape(mask, (/2,2/)), field)
19374          END PROGRAM
19375
19376_See also_:
19377     *note PACK::, *note SPREAD::
19378
19379
19380File: gfortran.info,  Node: VERIFY,  Next: XOR,  Prev: UNPACK,  Up: Intrinsic Procedures
19381
193829.283 'VERIFY' -- Scan a string for characters not a given set
19383==============================================================
19384
19385_Description_:
19386     Verifies that all the characters in STRING belong to the set of
19387     characters in SET.
19388
19389     If BACK is either absent or equals 'FALSE', this function returns
19390     the position of the leftmost character of STRING that is not in
19391     SET.  If BACK equals 'TRUE', the rightmost position is returned.
19392     If all characters of STRING are found in SET, the result is zero.
19393
19394_Standard_:
19395     Fortran 95 and later, with KIND argument Fortran 2003 and later
19396
19397_Class_:
19398     Elemental function
19399
19400_Syntax_:
19401     'RESULT = VERIFY(STRING, SET[, BACK [, KIND]])'
19402
19403_Arguments_:
19404     STRING      Shall be of type 'CHARACTER'.
19405     SET         Shall be of type 'CHARACTER'.
19406     BACK        (Optional) shall be of type 'LOGICAL'.
19407     KIND        (Optional) An 'INTEGER' initialization
19408                 expression indicating the kind parameter of the
19409                 result.
19410
19411_Return value_:
19412     The return value is of type 'INTEGER' and of kind KIND.  If KIND is
19413     absent, the return value is of default integer kind.
19414
19415_Example_:
19416          PROGRAM test_verify
19417            WRITE(*,*) VERIFY("FORTRAN", "AO")           ! 1, found 'F'
19418            WRITE(*,*) VERIFY("FORTRAN", "FOO")          ! 3, found 'R'
19419            WRITE(*,*) VERIFY("FORTRAN", "C++")          ! 1, found 'F'
19420            WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.)  ! 7, found 'N'
19421            WRITE(*,*) VERIFY("FORTRAN", "FORTRAN")      ! 0' found none
19422          END PROGRAM
19423
19424_See also_:
19425     *note SCAN::, *note INDEX intrinsic::
19426
19427
19428File: gfortran.info,  Node: XOR,  Prev: VERIFY,  Up: Intrinsic Procedures
19429
194309.284 'XOR' -- Bitwise logical exclusive OR
19431===========================================
19432
19433_Description_:
19434     Bitwise logical exclusive or.
19435
19436     This intrinsic routine is provided for backwards compatibility with
19437     GNU Fortran 77.  For integer arguments, programmers should consider
19438     the use of the *note IEOR:: intrinsic and for logical arguments the
19439     '.NEQV.' operator, which are both defined by the Fortran standard.
19440
19441_Standard_:
19442     GNU extension
19443
19444_Class_:
19445     Function
19446
19447_Syntax_:
19448     'RESULT = XOR(I, J)'
19449
19450_Arguments_:
19451     I           The type shall be either a scalar 'INTEGER' type
19452                 or a scalar 'LOGICAL' type or a
19453                 boz-literal-constant.
19454     J           The type shall be the same as the type of I or a
19455                 boz-literal-constant.  I and J shall not both be
19456                 boz-literal-constants.  If either I and J is a
19457                 boz-literal-constant, then the other argument
19458                 must be a scalar 'INTEGER'.
19459
19460_Return value_:
19461     The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'.
19462     If the kind type parameters differ, then the smaller kind type is
19463     implicitly converted to larger kind, and the return has the larger
19464     kind.  A boz-literal-constant is converted to an 'INTEGER' with the
19465     kind type parameter of the other argument as-if a call to *note
19466     INT:: occurred.
19467
19468_Example_:
19469          PROGRAM test_xor
19470            LOGICAL :: T = .TRUE., F = .FALSE.
19471            INTEGER :: a, b
19472            DATA a / Z'F' /, b / Z'3' /
19473
19474            WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F)
19475            WRITE (*,*) XOR(a, b)
19476          END PROGRAM
19477
19478_See also_:
19479     Fortran 95 elemental function: *note IEOR::
19480
19481
19482File: gfortran.info,  Node: Intrinsic Modules,  Next: Contributing,  Prev: Intrinsic Procedures,  Up: Top
19483
1948410 Intrinsic Modules
19485********************
19486
19487* Menu:
19488
19489* ISO_FORTRAN_ENV::
19490* ISO_C_BINDING::
19491* IEEE modules::
19492* OpenMP Modules OMP_LIB and OMP_LIB_KINDS::
19493* OpenACC Module OPENACC::
19494
19495
19496File: gfortran.info,  Node: ISO_FORTRAN_ENV,  Next: ISO_C_BINDING,  Up: Intrinsic Modules
19497
1949810.1 'ISO_FORTRAN_ENV'
19499======================
19500
19501_Standard_:
19502     Fortran 2003 and later, except when otherwise noted
19503
19504   The 'ISO_FORTRAN_ENV' module provides the following scalar
19505default-integer named constants:
19506
19507'ATOMIC_INT_KIND':
19508     Default-kind integer constant to be used as kind parameter when
19509     defining integer variables used in atomic operations.  (Fortran
19510     2008 or later.)
19511
19512'ATOMIC_LOGICAL_KIND':
19513     Default-kind integer constant to be used as kind parameter when
19514     defining logical variables used in atomic operations.  (Fortran
19515     2008 or later.)
19516
19517'CHARACTER_KINDS':
19518     Default-kind integer constant array of rank one containing the
19519     supported kind parameters of the 'CHARACTER' type.  (Fortran 2008
19520     or later.)
19521
19522'CHARACTER_STORAGE_SIZE':
19523     Size in bits of the character storage unit.
19524
19525'ERROR_UNIT':
19526     Identifies the preconnected unit used for error reporting.
19527
19528'FILE_STORAGE_SIZE':
19529     Size in bits of the file-storage unit.
19530
19531'INPUT_UNIT':
19532     Identifies the preconnected unit identified by the asterisk ('*')
19533     in 'READ' statement.
19534
19535'INT8', 'INT16', 'INT32', 'INT64':
19536     Kind type parameters to specify an INTEGER type with a storage size
19537     of 16, 32, and 64 bits.  It is negative if a target platform does
19538     not support the particular kind.  (Fortran 2008 or later.)
19539
19540'INTEGER_KINDS':
19541     Default-kind integer constant array of rank one containing the
19542     supported kind parameters of the 'INTEGER' type.  (Fortran 2008 or
19543     later.)
19544
19545'IOSTAT_END':
19546     The value assigned to the variable passed to the 'IOSTAT='
19547     specifier of an input/output statement if an end-of-file condition
19548     occurred.
19549
19550'IOSTAT_EOR':
19551     The value assigned to the variable passed to the 'IOSTAT='
19552     specifier of an input/output statement if an end-of-record
19553     condition occurred.
19554
19555'IOSTAT_INQUIRE_INTERNAL_UNIT':
19556     Scalar default-integer constant, used by 'INQUIRE' for the
19557     'IOSTAT=' specifier to denote an that a unit number identifies an
19558     internal unit.  (Fortran 2008 or later.)
19559
19560'NUMERIC_STORAGE_SIZE':
19561     The size in bits of the numeric storage unit.
19562
19563'LOGICAL_KINDS':
19564     Default-kind integer constant array of rank one containing the
19565     supported kind parameters of the 'LOGICAL' type.  (Fortran 2008 or
19566     later.)
19567
19568'OUTPUT_UNIT':
19569     Identifies the preconnected unit identified by the asterisk ('*')
19570     in 'WRITE' statement.
19571
19572'REAL32', 'REAL64', 'REAL128':
19573     Kind type parameters to specify a REAL type with a storage size of
19574     32, 64, and 128 bits.  It is negative if a target platform does not
19575     support the particular kind.  (Fortran 2008 or later.)
19576
19577'REAL_KINDS':
19578     Default-kind integer constant array of rank one containing the
19579     supported kind parameters of the 'REAL' type.  (Fortran 2008 or
19580     later.)
19581
19582'STAT_LOCKED':
19583     Scalar default-integer constant used as STAT= return value by
19584     'LOCK' to denote that the lock variable is locked by the executing
19585     image.  (Fortran 2008 or later.)
19586
19587'STAT_LOCKED_OTHER_IMAGE':
19588     Scalar default-integer constant used as STAT= return value by
19589     'UNLOCK' to denote that the lock variable is locked by another
19590     image.  (Fortran 2008 or later.)
19591
19592'STAT_STOPPED_IMAGE':
19593     Positive, scalar default-integer constant used as STAT= return
19594     value if the argument in the statement requires synchronisation
19595     with an image, which has initiated the termination of the
19596     execution.  (Fortran 2008 or later.)
19597
19598'STAT_FAILED_IMAGE':
19599     Positive, scalar default-integer constant used as STAT= return
19600     value if the argument in the statement requires communication with
19601     an image, which has is in the failed state.  (TS 18508 or later.)
19602
19603'STAT_UNLOCKED':
19604     Scalar default-integer constant used as STAT= return value by
19605     'UNLOCK' to denote that the lock variable is unlocked.  (Fortran
19606     2008 or later.)
19607
19608   The module provides the following derived type:
19609
19610'LOCK_TYPE':
19611     Derived type with private components to be use with the 'LOCK' and
19612     'UNLOCK' statement.  A variable of its type has to be always
19613     declared as coarray and may not appear in a variable-definition
19614     context.  (Fortran 2008 or later.)
19615
19616   The module also provides the following intrinsic procedures: *note
19617COMPILER_OPTIONS:: and *note COMPILER_VERSION::.
19618
19619
19620File: gfortran.info,  Node: ISO_C_BINDING,  Next: IEEE modules,  Prev: ISO_FORTRAN_ENV,  Up: Intrinsic Modules
19621
1962210.2 'ISO_C_BINDING'
19623====================
19624
19625_Standard_:
19626     Fortran 2003 and later, GNU extensions
19627
19628   The following intrinsic procedures are provided by the module; their
19629definition can be found in the section Intrinsic Procedures of this
19630manual.
19631
19632'C_ASSOCIATED'
19633'C_F_POINTER'
19634'C_F_PROCPOINTER'
19635'C_FUNLOC'
19636'C_LOC'
19637'C_SIZEOF'
19638
19639   The 'ISO_C_BINDING' module provides the following named constants of
19640type default integer, which can be used as KIND type parameters.
19641
19642   In addition to the integer named constants required by the Fortran
196432003 standard and 'C_PTRDIFF_T' of TS 29113, GNU Fortran provides as an
19644extension named constants for the 128-bit integer types supported by the
19645C compiler: 'C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T'.
19646Furthermore, if '__float128' is supported in C, the named constants
19647'C_FLOAT128, C_FLOAT128_COMPLEX' are defined.
19648
19649Fortran     Named constant            C type                    Extension
19650Type
19651'INTEGER'   'C_INT'                   'int'
19652'INTEGER'   'C_SHORT'                 'short int'
19653'INTEGER'   'C_LONG'                  'long int'
19654'INTEGER'   'C_LONG_LONG'             'long long int'
19655'INTEGER'   'C_SIGNED_CHAR'           'signed char'/'unsigned
19656                                      char'
19657'INTEGER'   'C_SIZE_T'                'size_t'
19658'INTEGER'   'C_INT8_T'                'int8_t'
19659'INTEGER'   'C_INT16_T'               'int16_t'
19660'INTEGER'   'C_INT32_T'               'int32_t'
19661'INTEGER'   'C_INT64_T'               'int64_t'
19662'INTEGER'   'C_INT128_T'              'int128_t'                Ext.
19663'INTEGER'   'C_INT_LEAST8_T'          'int_least8_t'
19664'INTEGER'   'C_INT_LEAST16_T'         'int_least16_t'
19665'INTEGER'   'C_INT_LEAST32_T'         'int_least32_t'
19666'INTEGER'   'C_INT_LEAST64_T'         'int_least64_t'
19667'INTEGER'   'C_INT_LEAST128_T'        'int_least128_t'          Ext.
19668'INTEGER'   'C_INT_FAST8_T'           'int_fast8_t'
19669'INTEGER'   'C_INT_FAST16_T'          'int_fast16_t'
19670'INTEGER'   'C_INT_FAST32_T'          'int_fast32_t'
19671'INTEGER'   'C_INT_FAST64_T'          'int_fast64_t'
19672'INTEGER'   'C_INT_FAST128_T'         'int_fast128_t'           Ext.
19673'INTEGER'   'C_INTMAX_T'              'intmax_t'
19674'INTEGER'   'C_INTPTR_T'              'intptr_t'
19675'INTEGER'   'C_PTRDIFF_T'             'ptrdiff_t'               TS 29113
19676'REAL'      'C_FLOAT'                 'float'
19677'REAL'      'C_DOUBLE'                'double'
19678'REAL'      'C_LONG_DOUBLE'           'long double'
19679'REAL'      'C_FLOAT128'              '__float128'              Ext.
19680'COMPLEX'   'C_FLOAT_COMPLEX'         'float _Complex'
19681'COMPLEX'   'C_DOUBLE_COMPLEX'        'double _Complex'
19682'COMPLEX'   'C_LONG_DOUBLE_COMPLEX'   'long double _Complex'
19683'REAL'      'C_FLOAT128_COMPLEX'      '__float128 _Complex'     Ext.
19684'LOGICAL'   'C_BOOL'                  '_Bool'
19685'CHARACTER' 'C_CHAR'                  'char'
19686
19687   Additionally, the following parameters of type
19688'CHARACTER(KIND=C_CHAR)' are defined.
19689
19690Name           C definition                     Value
19691'C_NULL_CHAR'  null character                   ''\0''
19692'C_ALERT'      alert                            ''\a''
19693'C_BACKSPACE'  backspace                        ''\b''
19694'C_FORM_FEED'  form feed                        ''\f''
19695'C_NEW_LINE'   new line                         ''\n''
19696'C_CARRIAGE_RETURN'carriage return              ''\r''
19697'C_HORIZONTAL_TAB'horizontal tab                ''\t''
19698'C_VERTICAL_TAB'vertical tab                    ''\v''
19699
19700   Moreover, the following two named constants are defined:
19701
19702Name           Type
19703'C_NULL_PTR'   'C_PTR'
19704'C_NULL_FUNPTR''C_FUNPTR'
19705
19706   Both are equivalent to the value 'NULL' in C.
19707
19708
19709File: gfortran.info,  Node: IEEE modules,  Next: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Prev: ISO_C_BINDING,  Up: Intrinsic Modules
19710
1971110.3 IEEE modules: 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
19712============================================================================
19713
19714_Standard_:
19715     Fortran 2003 and later
19716
19717   The 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES'
19718intrinsic modules provide support for exceptions and IEEE arithmetic, as
19719defined in Fortran 2003 and later standards, and the IEC 60559:1989
19720standard (_Binary floating-point arithmetic for microprocessor
19721systems_).  These modules are only provided on the following supported
19722platforms:
19723
19724   * i386 and x86_64 processors
19725   * platforms which use the GNU C Library (glibc)
19726   * platforms with support for SysV/386 routines for floating point
19727     interface (including Solaris and BSDs)
19728   * platforms with the AIX OS
19729
19730   For full compliance with the Fortran standards, code using the
19731'IEEE_EXCEPTIONS' or 'IEEE_ARITHMETIC' modules should be compiled with
19732the following options: '-fno-unsafe-math-optimizations -frounding-math
19733-fsignaling-nans'.
19734
19735
19736File: gfortran.info,  Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Next: OpenACC Module OPENACC,  Prev: IEEE modules,  Up: Intrinsic Modules
19737
1973810.4 OpenMP Modules 'OMP_LIB' and 'OMP_LIB_KINDS'
19739=================================================
19740
19741_Standard_:
19742     OpenMP Application Program Interface v4.5
19743
19744   The OpenMP Fortran runtime library routines are provided both in a
19745form of two Fortran 90 modules, named 'OMP_LIB' and 'OMP_LIB_KINDS', and
19746in a form of a Fortran 'include' file named 'omp_lib.h'.  The procedures
19747provided by 'OMP_LIB' can be found in the *note Introduction:
19748(libgomp)Top. manual, the named constants defined in the modules are
19749listed below.
19750
19751   For details refer to the actual OpenMP Application Program Interface
19752v4.5 (http://www.openmp.org/wp-content/uploads/openmp-4.5.pdf).  And for
19753the 'pause'-related constants to the OpenMP 5.0 specification.
19754
19755   'OMP_LIB_KINDS' provides the following scalar default-integer named
19756constants:
19757
19758'omp_lock_kind'
19759'omp_lock_hint_kind'
19760'omp_nest_lock_kind'
19761'omp_pause_resource_kind'
19762'omp_proc_bind_kind'
19763'omp_sched_kind'
19764
19765   'OMP_LIB' provides the scalar default-integer named constant
19766'openmp_version' with a value of the form YYYYMM, where 'yyyy' is the
19767year and MM the month of the OpenMP version; for OpenMP v4.5 the value
19768is '201511'.
19769
19770   The following scalar integer named constants of the kind
19771'omp_sched_kind':
19772
19773'omp_sched_static'
19774'omp_sched_dynamic'
19775'omp_sched_guided'
19776'omp_sched_auto'
19777
19778   And the following scalar integer named constants of the kind
19779'omp_proc_bind_kind':
19780
19781'omp_proc_bind_false'
19782'omp_proc_bind_true'
19783'omp_proc_bind_master'
19784'omp_proc_bind_close'
19785'omp_proc_bind_spread'
19786
19787   The following scalar integer named constants are of the kind
19788'omp_lock_hint_kind':
19789
19790'omp_lock_hint_none'
19791'omp_lock_hint_uncontended'
19792'omp_lock_hint_contended'
19793'omp_lock_hint_nonspeculative'
19794'omp_lock_hint_speculative'
19795
19796   And the following two scalar integer named constants are of the kind
19797'omp_pause_resource_kind':
19798
19799'omp_pause_soft'
19800'omp_pause_hard'
19801
19802
19803File: gfortran.info,  Node: OpenACC Module OPENACC,  Prev: OpenMP Modules OMP_LIB and OMP_LIB_KINDS,  Up: Intrinsic Modules
19804
1980510.5 OpenACC Module 'OPENACC'
19806=============================
19807
19808_Standard_:
19809     OpenACC Application Programming Interface v2.0
19810
19811   The OpenACC Fortran runtime library routines are provided both in a
19812form of a Fortran 90 module, named 'OPENACC', and in form of a Fortran
19813'include' file named 'openacc_lib.h'.  The procedures provided by
19814'OPENACC' can be found in the *note Introduction: (libgomp)Top. manual,
19815the named constants defined in the modules are listed below.
19816
19817   For details refer to the actual OpenACC Application Programming
19818Interface v2.0 (http://www.openacc.org/).
19819
19820   'OPENACC' provides the scalar default-integer named constant
19821'openacc_version' with a value of the form YYYYMM, where 'yyyy' is the
19822year and MM the month of the OpenACC version; for OpenACC v2.0 the value
19823is '201306'.
19824
19825
19826File: gfortran.info,  Node: Contributing,  Next: Copying,  Prev: Intrinsic Modules,  Up: Top
19827
19828Contributing
19829************
19830
19831Free software is only possible if people contribute to efforts to create
19832it.  We're always in need of more people helping out with ideas and
19833comments, writing documentation and contributing code.
19834
19835   If you want to contribute to GNU Fortran, have a look at the long
19836lists of projects you can take on.  Some of these projects are small,
19837some of them are large; some are completely orthogonal to the rest of
19838what is happening on GNU Fortran, but others are "mainstream" projects
19839in need of enthusiastic hackers.  All of these projects are important!
19840We will eventually get around to the things here, but they are also
19841things doable by someone who is willing and able.
19842
19843* Menu:
19844
19845* Contributors::
19846* Projects::
19847* Proposed Extensions::
19848
19849
19850File: gfortran.info,  Node: Contributors,  Next: Projects,  Up: Contributing
19851
19852Contributors to GNU Fortran
19853===========================
19854
19855Most of the parser was hand-crafted by _Andy Vaught_, who is also the
19856initiator of the whole project.  Thanks Andy!  Most of the interface
19857with GCC was written by _Paul Brook_.
19858
19859   The following individuals have contributed code and/or ideas and
19860significant help to the GNU Fortran project (in alphabetical order):
19861
19862   - Janne Blomqvist
19863   - Steven Bosscher
19864   - Paul Brook
19865   - Tobias Burnus
19866   - Franc,ois-Xavier Coudert
19867   - Bud Davis
19868   - Jerry DeLisle
19869   - Erik Edelmann
19870   - Bernhard Fischer
19871   - Daniel Franke
19872   - Richard Guenther
19873   - Richard Henderson
19874   - Katherine Holcomb
19875   - Jakub Jelinek
19876   - Niels Kristian Bech Jensen
19877   - Steven Johnson
19878   - Steven G. Kargl
19879   - Thomas Koenig
19880   - Asher Langton
19881   - H. J. Lu
19882   - Toon Moene
19883   - Brooks Moses
19884   - Andrew Pinski
19885   - Tim Prince
19886   - Christopher D. Rickett
19887   - Richard Sandiford
19888   - Tobias Schlu"ter
19889   - Roger Sayle
19890   - Paul Thomas
19891   - Andy Vaught
19892   - Feng Wang
19893   - Janus Weil
19894   - Daniel Kraft
19895
19896   The following people have contributed bug reports, smaller or larger
19897patches, and much needed feedback and encouragement for the GNU Fortran
19898project:
19899
19900   - Bill Clodius
19901   - Dominique d'Humie`res
19902   - Kate Hedstrom
19903   - Erik Schnetter
19904   - Joost VandeVondele
19905
19906   Many other individuals have helped debug, test and improve the GNU
19907Fortran compiler over the past few years, and we welcome you to do the
19908same!  If you already have done so, and you would like to see your name
19909listed in the list above, please contact us.
19910
19911
19912File: gfortran.info,  Node: Projects,  Next: Proposed Extensions,  Prev: Contributors,  Up: Contributing
19913
19914Projects
19915========
19916
19917_Help build the test suite_
19918     Solicit more code for donation to the test suite: the more
19919     extensive the testsuite, the smaller the risk of breaking things in
19920     the future!  We can keep code private on request.
19921
19922_Bug hunting/squishing_
19923     Find bugs and write more test cases!  Test cases are especially
19924     very welcome, because it allows us to concentrate on fixing bugs
19925     instead of isolating them.  Going through the bugzilla database at
19926     <https://gcc.gnu.org/bugzilla/> to reduce testcases posted there
19927     and add more information (for example, for which version does the
19928     testcase work, for which versions does it fail?)  is also very
19929     helpful.
19930
19931
19932File: gfortran.info,  Node: Proposed Extensions,  Prev: Projects,  Up: Contributing
19933
19934Proposed Extensions
19935===================
19936
19937Here's a list of proposed extensions for the GNU Fortran compiler, in no
19938particular order.  Most of these are necessary to be fully compatible
19939with existing Fortran compilers, but they are not part of the official
19940J3 Fortran 95 standard.
19941
19942Compiler extensions:
19943--------------------
19944
19945   * User-specified alignment rules for structures.
19946
19947   * Automatically extend single precision constants to double.
19948
19949   * Compile code that conserves memory by dynamically allocating common
19950     and module storage either on stack or heap.
19951
19952   * Compile flag to generate code for array conformance checking
19953     (suggest -CC).
19954
19955   * User control of symbol names (underscores, etc).
19956
19957   * Compile setting for maximum size of stack frame size before
19958     spilling parts to static or heap.
19959
19960   * Flag to force local variables into static space.
19961
19962   * Flag to force local variables onto stack.
19963
19964Environment Options
19965-------------------
19966
19967   * Pluggable library modules for random numbers, linear algebra.  LA
19968     should use BLAS calling conventions.
19969
19970   * Environment variables controlling actions on arithmetic exceptions
19971     like overflow, underflow, precision loss--Generate NaN, abort,
19972     default.  action.
19973
19974   * Set precision for fp units that support it (i387).
19975
19976   * Variable for setting fp rounding mode.
19977
19978   * Variable to fill uninitialized variables with a user-defined bit
19979     pattern.
19980
19981   * Environment variable controlling filename that is opened for that
19982     unit number.
19983
19984   * Environment variable to clear/trash memory being freed.
19985
19986   * Environment variable to control tracing of allocations and frees.
19987
19988   * Environment variable to display allocated memory at normal program
19989     end.
19990
19991   * Environment variable for filename for * IO-unit.
19992
19993   * Environment variable for temporary file directory.
19994
19995   * Environment variable forcing standard output to be line buffered
19996     (Unix).
19997
19998
19999File: gfortran.info,  Node: Copying,  Next: GNU Free Documentation License,  Prev: Contributing,  Up: Top
20000
20001GNU General Public License
20002**************************
20003
20004                        Version 3, 29 June 2007
20005
20006     Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
20007
20008     Everyone is permitted to copy and distribute verbatim copies of this
20009     license document, but changing it is not allowed.
20010
20011Preamble
20012========
20013
20014The GNU General Public License is a free, copyleft license for software
20015and other kinds of works.
20016
20017   The licenses for most software and other practical works are designed
20018to take away your freedom to share and change the works.  By contrast,
20019the GNU General Public License is intended to guarantee your freedom to
20020share and change all versions of a program-to make sure it remains free
20021software for all its users.  We, the Free Software Foundation, use the
20022GNU General Public License for most of our software; it applies also to
20023any other work released this way by its authors.  You can apply it to
20024your programs, too.
20025
20026   When we speak of free software, we are referring to freedom, not
20027price.  Our General Public Licenses are designed to make sure that you
20028have the freedom to distribute copies of free software (and charge for
20029them if you wish), that you receive source code or can get it if you
20030want it, that you can change the software or use pieces of it in new
20031free programs, and that you know you can do these things.
20032
20033   To protect your rights, we need to prevent others from denying you
20034these rights or asking you to surrender the rights.  Therefore, you have
20035certain responsibilities if you distribute copies of the software, or if
20036you modify it: responsibilities to respect the freedom of others.
20037
20038   For example, if you distribute copies of such a program, whether
20039gratis or for a fee, you must pass on to the recipients the same
20040freedoms that you received.  You must make sure that they, too, receive
20041or can get the source code.  And you must show them these terms so they
20042know their rights.
20043
20044   Developers that use the GNU GPL protect your rights with two steps:
20045(1) assert copyright on the software, and (2) offer you this License
20046giving you legal permission to copy, distribute and/or modify it.
20047
20048   For the developers' and authors' protection, the GPL clearly explains
20049that there is no warranty for this free software.  For both users' and
20050authors' sake, the GPL requires that modified versions be marked as
20051changed, so that their problems will not be attributed erroneously to
20052authors of previous versions.
20053
20054   Some devices are designed to deny users access to install or run
20055modified versions of the software inside them, although the manufacturer
20056can do so.  This is fundamentally incompatible with the aim of
20057protecting users' freedom to change the software.  The systematic
20058pattern of such abuse occurs in the area of products for individuals to
20059use, which is precisely where it is most unacceptable.  Therefore, we
20060have designed this version of the GPL to prohibit the practice for those
20061products.  If such problems arise substantially in other domains, we
20062stand ready to extend this provision to those domains in future versions
20063of the GPL, as needed to protect the freedom of users.
20064
20065   Finally, every program is threatened constantly by software patents.
20066States should not allow patents to restrict development and use of
20067software on general-purpose computers, but in those that do, we wish to
20068avoid the special danger that patents applied to a free program could
20069make it effectively proprietary.  To prevent this, the GPL assures that
20070patents cannot be used to render the program non-free.
20071
20072   The precise terms and conditions for copying, distribution and
20073modification follow.
20074
20075TERMS AND CONDITIONS
20076====================
20077
20078  0. Definitions.
20079
20080     "This License" refers to version 3 of the GNU General Public
20081     License.
20082
20083     "Copyright" also means copyright-like laws that apply to other
20084     kinds of works, such as semiconductor masks.
20085
20086     "The Program" refers to any copyrightable work licensed under this
20087     License.  Each licensee is addressed as "you".  "Licensees" and
20088     "recipients" may be individuals or organizations.
20089
20090     To "modify" a work means to copy from or adapt all or part of the
20091     work in a fashion requiring copyright permission, other than the
20092     making of an exact copy.  The resulting work is called a "modified
20093     version" of the earlier work or a work "based on" the earlier work.
20094
20095     A "covered work" means either the unmodified Program or a work
20096     based on the Program.
20097
20098     To "propagate" a work means to do anything with it that, without
20099     permission, would make you directly or secondarily liable for
20100     infringement under applicable copyright law, except executing it on
20101     a computer or modifying a private copy.  Propagation includes
20102     copying, distribution (with or without modification), making
20103     available to the public, and in some countries other activities as
20104     well.
20105
20106     To "convey" a work means any kind of propagation that enables other
20107     parties to make or receive copies.  Mere interaction with a user
20108     through a computer network, with no transfer of a copy, is not
20109     conveying.
20110
20111     An interactive user interface displays "Appropriate Legal Notices"
20112     to the extent that it includes a convenient and prominently visible
20113     feature that (1) displays an appropriate copyright notice, and (2)
20114     tells the user that there is no warranty for the work (except to
20115     the extent that warranties are provided), that licensees may convey
20116     the work under this License, and how to view a copy of this
20117     License.  If the interface presents a list of user commands or
20118     options, such as a menu, a prominent item in the list meets this
20119     criterion.
20120
20121  1. Source Code.
20122
20123     The "source code" for a work means the preferred form of the work
20124     for making modifications to it.  "Object code" means any non-source
20125     form of a work.
20126
20127     A "Standard Interface" means an interface that either is an
20128     official standard defined by a recognized standards body, or, in
20129     the case of interfaces specified for a particular programming
20130     language, one that is widely used among developers working in that
20131     language.
20132
20133     The "System Libraries" of an executable work include anything,
20134     other than the work as a whole, that (a) is included in the normal
20135     form of packaging a Major Component, but which is not part of that
20136     Major Component, and (b) serves only to enable use of the work with
20137     that Major Component, or to implement a Standard Interface for
20138     which an implementation is available to the public in source code
20139     form.  A "Major Component", in this context, means a major
20140     essential component (kernel, window system, and so on) of the
20141     specific operating system (if any) on which the executable work
20142     runs, or a compiler used to produce the work, or an object code
20143     interpreter used to run it.
20144
20145     The "Corresponding Source" for a work in object code form means all
20146     the source code needed to generate, install, and (for an executable
20147     work) run the object code and to modify the work, including scripts
20148     to control those activities.  However, it does not include the
20149     work's System Libraries, or general-purpose tools or generally
20150     available free programs which are used unmodified in performing
20151     those activities but which are not part of the work.  For example,
20152     Corresponding Source includes interface definition files associated
20153     with source files for the work, and the source code for shared
20154     libraries and dynamically linked subprograms that the work is
20155     specifically designed to require, such as by intimate data
20156     communication or control flow between those subprograms and other
20157     parts of the work.
20158
20159     The Corresponding Source need not include anything that users can
20160     regenerate automatically from other parts of the Corresponding
20161     Source.
20162
20163     The Corresponding Source for a work in source code form is that
20164     same work.
20165
20166  2. Basic Permissions.
20167
20168     All rights granted under this License are granted for the term of
20169     copyright on the Program, and are irrevocable provided the stated
20170     conditions are met.  This License explicitly affirms your unlimited
20171     permission to run the unmodified Program.  The output from running
20172     a covered work is covered by this License only if the output, given
20173     its content, constitutes a covered work.  This License acknowledges
20174     your rights of fair use or other equivalent, as provided by
20175     copyright law.
20176
20177     You may make, run and propagate covered works that you do not
20178     convey, without conditions so long as your license otherwise
20179     remains in force.  You may convey covered works to others for the
20180     sole purpose of having them make modifications exclusively for you,
20181     or provide you with facilities for running those works, provided
20182     that you comply with the terms of this License in conveying all
20183     material for which you do not control copyright.  Those thus making
20184     or running the covered works for you must do so exclusively on your
20185     behalf, under your direction and control, on terms that prohibit
20186     them from making any copies of your copyrighted material outside
20187     their relationship with you.
20188
20189     Conveying under any other circumstances is permitted solely under
20190     the conditions stated below.  Sublicensing is not allowed; section
20191     10 makes it unnecessary.
20192
20193  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
20194
20195     No covered work shall be deemed part of an effective technological
20196     measure under any applicable law fulfilling obligations under
20197     article 11 of the WIPO copyright treaty adopted on 20 December
20198     1996, or similar laws prohibiting or restricting circumvention of
20199     such measures.
20200
20201     When you convey a covered work, you waive any legal power to forbid
20202     circumvention of technological measures to the extent such
20203     circumvention is effected by exercising rights under this License
20204     with respect to the covered work, and you disclaim any intention to
20205     limit operation or modification of the work as a means of
20206     enforcing, against the work's users, your or third parties' legal
20207     rights to forbid circumvention of technological measures.
20208
20209  4. Conveying Verbatim Copies.
20210
20211     You may convey verbatim copies of the Program's source code as you
20212     receive it, in any medium, provided that you conspicuously and
20213     appropriately publish on each copy an appropriate copyright notice;
20214     keep intact all notices stating that this License and any
20215     non-permissive terms added in accord with section 7 apply to the
20216     code; keep intact all notices of the absence of any warranty; and
20217     give all recipients a copy of this License along with the Program.
20218
20219     You may charge any price or no price for each copy that you convey,
20220     and you may offer support or warranty protection for a fee.
20221
20222  5. Conveying Modified Source Versions.
20223
20224     You may convey a work based on the Program, or the modifications to
20225     produce it from the Program, in the form of source code under the
20226     terms of section 4, provided that you also meet all of these
20227     conditions:
20228
20229       a. The work must carry prominent notices stating that you
20230          modified it, and giving a relevant date.
20231
20232       b. The work must carry prominent notices stating that it is
20233          released under this License and any conditions added under
20234          section 7.  This requirement modifies the requirement in
20235          section 4 to "keep intact all notices".
20236
20237       c. You must license the entire work, as a whole, under this
20238          License to anyone who comes into possession of a copy.  This
20239          License will therefore apply, along with any applicable
20240          section 7 additional terms, to the whole of the work, and all
20241          its parts, regardless of how they are packaged.  This License
20242          gives no permission to license the work in any other way, but
20243          it does not invalidate such permission if you have separately
20244          received it.
20245
20246       d. If the work has interactive user interfaces, each must display
20247          Appropriate Legal Notices; however, if the Program has
20248          interactive interfaces that do not display Appropriate Legal
20249          Notices, your work need not make them do so.
20250
20251     A compilation of a covered work with other separate and independent
20252     works, which are not by their nature extensions of the covered
20253     work, and which are not combined with it such as to form a larger
20254     program, in or on a volume of a storage or distribution medium, is
20255     called an "aggregate" if the compilation and its resulting
20256     copyright are not used to limit the access or legal rights of the
20257     compilation's users beyond what the individual works permit.
20258     Inclusion of a covered work in an aggregate does not cause this
20259     License to apply to the other parts of the aggregate.
20260
20261  6. Conveying Non-Source Forms.
20262
20263     You may convey a covered work in object code form under the terms
20264     of sections 4 and 5, provided that you also convey the
20265     machine-readable Corresponding Source under the terms of this
20266     License, in one of these ways:
20267
20268       a. Convey the object code in, or embodied in, a physical product
20269          (including a physical distribution medium), accompanied by the
20270          Corresponding Source fixed on a durable physical medium
20271          customarily used for software interchange.
20272
20273       b. Convey the object code in, or embodied in, a physical product
20274          (including a physical distribution medium), accompanied by a
20275          written offer, valid for at least three years and valid for as
20276          long as you offer spare parts or customer support for that
20277          product model, to give anyone who possesses the object code
20278          either (1) a copy of the Corresponding Source for all the
20279          software in the product that is covered by this License, on a
20280          durable physical medium customarily used for software
20281          interchange, for a price no more than your reasonable cost of
20282          physically performing this conveying of source, or (2) access
20283          to copy the Corresponding Source from a network server at no
20284          charge.
20285
20286       c. Convey individual copies of the object code with a copy of the
20287          written offer to provide the Corresponding Source.  This
20288          alternative is allowed only occasionally and noncommercially,
20289          and only if you received the object code with such an offer,
20290          in accord with subsection 6b.
20291
20292       d. Convey the object code by offering access from a designated
20293          place (gratis or for a charge), and offer equivalent access to
20294          the Corresponding Source in the same way through the same
20295          place at no further charge.  You need not require recipients
20296          to copy the Corresponding Source along with the object code.
20297          If the place to copy the object code is a network server, the
20298          Corresponding Source may be on a different server (operated by
20299          you or a third party) that supports equivalent copying
20300          facilities, provided you maintain clear directions next to the
20301          object code saying where to find the Corresponding Source.
20302          Regardless of what server hosts the Corresponding Source, you
20303          remain obligated to ensure that it is available for as long as
20304          needed to satisfy these requirements.
20305
20306       e. Convey the object code using peer-to-peer transmission,
20307          provided you inform other peers where the object code and
20308          Corresponding Source of the work are being offered to the
20309          general public at no charge under subsection 6d.
20310
20311     A separable portion of the object code, whose source code is
20312     excluded from the Corresponding Source as a System Library, need
20313     not be included in conveying the object code work.
20314
20315     A "User Product" is either (1) a "consumer product", which means
20316     any tangible personal property which is normally used for personal,
20317     family, or household purposes, or (2) anything designed or sold for
20318     incorporation into a dwelling.  In determining whether a product is
20319     a consumer product, doubtful cases shall be resolved in favor of
20320     coverage.  For a particular product received by a particular user,
20321     "normally used" refers to a typical or common use of that class of
20322     product, regardless of the status of the particular user or of the
20323     way in which the particular user actually uses, or expects or is
20324     expected to use, the product.  A product is a consumer product
20325     regardless of whether the product has substantial commercial,
20326     industrial or non-consumer uses, unless such uses represent the
20327     only significant mode of use of the product.
20328
20329     "Installation Information" for a User Product means any methods,
20330     procedures, authorization keys, or other information required to
20331     install and execute modified versions of a covered work in that
20332     User Product from a modified version of its Corresponding Source.
20333     The information must suffice to ensure that the continued
20334     functioning of the modified object code is in no case prevented or
20335     interfered with solely because modification has been made.
20336
20337     If you convey an object code work under this section in, or with,
20338     or specifically for use in, a User Product, and the conveying
20339     occurs as part of a transaction in which the right of possession
20340     and use of the User Product is transferred to the recipient in
20341     perpetuity or for a fixed term (regardless of how the transaction
20342     is characterized), the Corresponding Source conveyed under this
20343     section must be accompanied by the Installation Information.  But
20344     this requirement does not apply if neither you nor any third party
20345     retains the ability to install modified object code on the User
20346     Product (for example, the work has been installed in ROM).
20347
20348     The requirement to provide Installation Information does not
20349     include a requirement to continue to provide support service,
20350     warranty, or updates for a work that has been modified or installed
20351     by the recipient, or for the User Product in which it has been
20352     modified or installed.  Access to a network may be denied when the
20353     modification itself materially and adversely affects the operation
20354     of the network or violates the rules and protocols for
20355     communication across the network.
20356
20357     Corresponding Source conveyed, and Installation Information
20358     provided, in accord with this section must be in a format that is
20359     publicly documented (and with an implementation available to the
20360     public in source code form), and must require no special password
20361     or key for unpacking, reading or copying.
20362
20363  7. Additional Terms.
20364
20365     "Additional permissions" are terms that supplement the terms of
20366     this License by making exceptions from one or more of its
20367     conditions.  Additional permissions that are applicable to the
20368     entire Program shall be treated as though they were included in
20369     this License, to the extent that they are valid under applicable
20370     law.  If additional permissions apply only to part of the Program,
20371     that part may be used separately under those permissions, but the
20372     entire Program remains governed by this License without regard to
20373     the additional permissions.
20374
20375     When you convey a copy of a covered work, you may at your option
20376     remove any additional permissions from that copy, or from any part
20377     of it.  (Additional permissions may be written to require their own
20378     removal in certain cases when you modify the work.)  You may place
20379     additional permissions on material, added by you to a covered work,
20380     for which you have or can give appropriate copyright permission.
20381
20382     Notwithstanding any other provision of this License, for material
20383     you add to a covered work, you may (if authorized by the copyright
20384     holders of that material) supplement the terms of this License with
20385     terms:
20386
20387       a. Disclaiming warranty or limiting liability differently from
20388          the terms of sections 15 and 16 of this License; or
20389
20390       b. Requiring preservation of specified reasonable legal notices
20391          or author attributions in that material or in the Appropriate
20392          Legal Notices displayed by works containing it; or
20393
20394       c. Prohibiting misrepresentation of the origin of that material,
20395          or requiring that modified versions of such material be marked
20396          in reasonable ways as different from the original version; or
20397
20398       d. Limiting the use for publicity purposes of names of licensors
20399          or authors of the material; or
20400
20401       e. Declining to grant rights under trademark law for use of some
20402          trade names, trademarks, or service marks; or
20403
20404       f. Requiring indemnification of licensors and authors of that
20405          material by anyone who conveys the material (or modified
20406          versions of it) with contractual assumptions of liability to
20407          the recipient, for any liability that these contractual
20408          assumptions directly impose on those licensors and authors.
20409
20410     All other non-permissive additional terms are considered "further
20411     restrictions" within the meaning of section 10.  If the Program as
20412     you received it, or any part of it, contains a notice stating that
20413     it is governed by this License along with a term that is a further
20414     restriction, you may remove that term.  If a license document
20415     contains a further restriction but permits relicensing or conveying
20416     under this License, you may add to a covered work material governed
20417     by the terms of that license document, provided that the further
20418     restriction does not survive such relicensing or conveying.
20419
20420     If you add terms to a covered work in accord with this section, you
20421     must place, in the relevant source files, a statement of the
20422     additional terms that apply to those files, or a notice indicating
20423     where to find the applicable terms.
20424
20425     Additional terms, permissive or non-permissive, may be stated in
20426     the form of a separately written license, or stated as exceptions;
20427     the above requirements apply either way.
20428
20429  8. Termination.
20430
20431     You may not propagate or modify a covered work except as expressly
20432     provided under this License.  Any attempt otherwise to propagate or
20433     modify it is void, and will automatically terminate your rights
20434     under this License (including any patent licenses granted under the
20435     third paragraph of section 11).
20436
20437     However, if you cease all violation of this License, then your
20438     license from a particular copyright holder is reinstated (a)
20439     provisionally, unless and until the copyright holder explicitly and
20440     finally terminates your license, and (b) permanently, if the
20441     copyright holder fails to notify you of the violation by some
20442     reasonable means prior to 60 days after the cessation.
20443
20444     Moreover, your license from a particular copyright holder is
20445     reinstated permanently if the copyright holder notifies you of the
20446     violation by some reasonable means, this is the first time you have
20447     received notice of violation of this License (for any work) from
20448     that copyright holder, and you cure the violation prior to 30 days
20449     after your receipt of the notice.
20450
20451     Termination of your rights under this section does not terminate
20452     the licenses of parties who have received copies or rights from you
20453     under this License.  If your rights have been terminated and not
20454     permanently reinstated, you do not qualify to receive new licenses
20455     for the same material under section 10.
20456
20457  9. Acceptance Not Required for Having Copies.
20458
20459     You are not required to accept this License in order to receive or
20460     run a copy of the Program.  Ancillary propagation of a covered work
20461     occurring solely as a consequence of using peer-to-peer
20462     transmission to receive a copy likewise does not require
20463     acceptance.  However, nothing other than this License grants you
20464     permission to propagate or modify any covered work.  These actions
20465     infringe copyright if you do not accept this License.  Therefore,
20466     by modifying or propagating a covered work, you indicate your
20467     acceptance of this License to do so.
20468
20469  10. Automatic Licensing of Downstream Recipients.
20470
20471     Each time you convey a covered work, the recipient automatically
20472     receives a license from the original licensors, to run, modify and
20473     propagate that work, subject to this License.  You are not
20474     responsible for enforcing compliance by third parties with this
20475     License.
20476
20477     An "entity transaction" is a transaction transferring control of an
20478     organization, or substantially all assets of one, or subdividing an
20479     organization, or merging organizations.  If propagation of a
20480     covered work results from an entity transaction, each party to that
20481     transaction who receives a copy of the work also receives whatever
20482     licenses to the work the party's predecessor in interest had or
20483     could give under the previous paragraph, plus a right to possession
20484     of the Corresponding Source of the work from the predecessor in
20485     interest, if the predecessor has it or can get it with reasonable
20486     efforts.
20487
20488     You may not impose any further restrictions on the exercise of the
20489     rights granted or affirmed under this License.  For example, you
20490     may not impose a license fee, royalty, or other charge for exercise
20491     of rights granted under this License, and you may not initiate
20492     litigation (including a cross-claim or counterclaim in a lawsuit)
20493     alleging that any patent claim is infringed by making, using,
20494     selling, offering for sale, or importing the Program or any portion
20495     of it.
20496
20497  11. Patents.
20498
20499     A "contributor" is a copyright holder who authorizes use under this
20500     License of the Program or a work on which the Program is based.
20501     The work thus licensed is called the contributor's "contributor
20502     version".
20503
20504     A contributor's "essential patent claims" are all patent claims
20505     owned or controlled by the contributor, whether already acquired or
20506     hereafter acquired, that would be infringed by some manner,
20507     permitted by this License, of making, using, or selling its
20508     contributor version, but do not include claims that would be
20509     infringed only as a consequence of further modification of the
20510     contributor version.  For purposes of this definition, "control"
20511     includes the right to grant patent sublicenses in a manner
20512     consistent with the requirements of this License.
20513
20514     Each contributor grants you a non-exclusive, worldwide,
20515     royalty-free patent license under the contributor's essential
20516     patent claims, to make, use, sell, offer for sale, import and
20517     otherwise run, modify and propagate the contents of its contributor
20518     version.
20519
20520     In the following three paragraphs, a "patent license" is any
20521     express agreement or commitment, however denominated, not to
20522     enforce a patent (such as an express permission to practice a
20523     patent or covenant not to sue for patent infringement).  To "grant"
20524     such a patent license to a party means to make such an agreement or
20525     commitment not to enforce a patent against the party.
20526
20527     If you convey a covered work, knowingly relying on a patent
20528     license, and the Corresponding Source of the work is not available
20529     for anyone to copy, free of charge and under the terms of this
20530     License, through a publicly available network server or other
20531     readily accessible means, then you must either (1) cause the
20532     Corresponding Source to be so available, or (2) arrange to deprive
20533     yourself of the benefit of the patent license for this particular
20534     work, or (3) arrange, in a manner consistent with the requirements
20535     of this License, to extend the patent license to downstream
20536     recipients.  "Knowingly relying" means you have actual knowledge
20537     that, but for the patent license, your conveying the covered work
20538     in a country, or your recipient's use of the covered work in a
20539     country, would infringe one or more identifiable patents in that
20540     country that you have reason to believe are valid.
20541
20542     If, pursuant to or in connection with a single transaction or
20543     arrangement, you convey, or propagate by procuring conveyance of, a
20544     covered work, and grant a patent license to some of the parties
20545     receiving the covered work authorizing them to use, propagate,
20546     modify or convey a specific copy of the covered work, then the
20547     patent license you grant is automatically extended to all
20548     recipients of the covered work and works based on it.
20549
20550     A patent license is "discriminatory" if it does not include within
20551     the scope of its coverage, prohibits the exercise of, or is
20552     conditioned on the non-exercise of one or more of the rights that
20553     are specifically granted under this License.  You may not convey a
20554     covered work if you are a party to an arrangement with a third
20555     party that is in the business of distributing software, under which
20556     you make payment to the third party based on the extent of your
20557     activity of conveying the work, and under which the third party
20558     grants, to any of the parties who would receive the covered work
20559     from you, a discriminatory patent license (a) in connection with
20560     copies of the covered work conveyed by you (or copies made from
20561     those copies), or (b) primarily for and in connection with specific
20562     products or compilations that contain the covered work, unless you
20563     entered into that arrangement, or that patent license was granted,
20564     prior to 28 March 2007.
20565
20566     Nothing in this License shall be construed as excluding or limiting
20567     any implied license or other defenses to infringement that may
20568     otherwise be available to you under applicable patent law.
20569
20570  12. No Surrender of Others' Freedom.
20571
20572     If conditions are imposed on you (whether by court order, agreement
20573     or otherwise) that contradict the conditions of this License, they
20574     do not excuse you from the conditions of this License.  If you
20575     cannot convey a covered work so as to satisfy simultaneously your
20576     obligations under this License and any other pertinent obligations,
20577     then as a consequence you may not convey it at all.  For example,
20578     if you agree to terms that obligate you to collect a royalty for
20579     further conveying from those to whom you convey the Program, the
20580     only way you could satisfy both those terms and this License would
20581     be to refrain entirely from conveying the Program.
20582
20583  13. Use with the GNU Affero General Public License.
20584
20585     Notwithstanding any other provision of this License, you have
20586     permission to link or combine any covered work with a work licensed
20587     under version 3 of the GNU Affero General Public License into a
20588     single combined work, and to convey the resulting work.  The terms
20589     of this License will continue to apply to the part which is the
20590     covered work, but the special requirements of the GNU Affero
20591     General Public License, section 13, concerning interaction through
20592     a network will apply to the combination as such.
20593
20594  14. Revised Versions of this License.
20595
20596     The Free Software Foundation may publish revised and/or new
20597     versions of the GNU General Public License from time to time.  Such
20598     new versions will be similar in spirit to the present version, but
20599     may differ in detail to address new problems or concerns.
20600
20601     Each version is given a distinguishing version number.  If the
20602     Program specifies that a certain numbered version of the GNU
20603     General Public License "or any later version" applies to it, you
20604     have the option of following the terms and conditions either of
20605     that numbered version or of any later version published by the Free
20606     Software Foundation.  If the Program does not specify a version
20607     number of the GNU General Public License, you may choose any
20608     version ever published by the Free Software Foundation.
20609
20610     If the Program specifies that a proxy can decide which future
20611     versions of the GNU General Public License can be used, that
20612     proxy's public statement of acceptance of a version permanently
20613     authorizes you to choose that version for the Program.
20614
20615     Later license versions may give you additional or different
20616     permissions.  However, no additional obligations are imposed on any
20617     author or copyright holder as a result of your choosing to follow a
20618     later version.
20619
20620  15. Disclaimer of Warranty.
20621
20622     THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
20623     APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
20624     COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
20625     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
20626     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20627     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE
20628     RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
20629     SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
20630     NECESSARY SERVICING, REPAIR OR CORRECTION.
20631
20632  16. Limitation of Liability.
20633
20634     IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
20635     WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES
20636     AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR
20637     DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
20638     CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
20639     THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
20640     BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
20641     PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
20642     PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF
20643     THE POSSIBILITY OF SUCH DAMAGES.
20644
20645  17. Interpretation of Sections 15 and 16.
20646
20647     If the disclaimer of warranty and limitation of liability provided
20648     above cannot be given local legal effect according to their terms,
20649     reviewing courts shall apply local law that most closely
20650     approximates an absolute waiver of all civil liability in
20651     connection with the Program, unless a warranty or assumption of
20652     liability accompanies a copy of the Program in return for a fee.
20653
20654END OF TERMS AND CONDITIONS
20655===========================
20656
20657How to Apply These Terms to Your New Programs
20658=============================================
20659
20660If you develop a new program, and you want it to be of the greatest
20661possible use to the public, the best way to achieve this is to make it
20662free software which everyone can redistribute and change under these
20663terms.
20664
20665   To do so, attach the following notices to the program.  It is safest
20666to attach them to the start of each source file to most effectively
20667state the exclusion of warranty; and each file should have at least the
20668"copyright" line and a pointer to where the full notice is found.
20669
20670     ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
20671     Copyright (C) YEAR NAME OF AUTHOR
20672
20673     This program is free software: you can redistribute it and/or modify
20674     it under the terms of the GNU General Public License as published by
20675     the Free Software Foundation, either version 3 of the License, or (at
20676     your option) any later version.
20677
20678     This program is distributed in the hope that it will be useful, but
20679     WITHOUT ANY WARRANTY; without even the implied warranty of
20680     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20681     General Public License for more details.
20682
20683     You should have received a copy of the GNU General Public License
20684     along with this program.  If not, see <http://www.gnu.org/licenses/>.
20685
20686   Also add information on how to contact you by electronic and paper
20687mail.
20688
20689   If the program does terminal interaction, make it output a short
20690notice like this when it starts in an interactive mode:
20691
20692     PROGRAM Copyright (C) YEAR NAME OF AUTHOR
20693     This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
20694     This is free software, and you are welcome to redistribute it
20695     under certain conditions; type 'show c' for details.
20696
20697   The hypothetical commands 'show w' and 'show c' should show the
20698appropriate parts of the General Public License.  Of course, your
20699program's commands might be different; for a GUI interface, you would
20700use an "about box".
20701
20702   You should also get your employer (if you work as a programmer) or
20703school, if any, to sign a "copyright disclaimer" for the program, if
20704necessary.  For more information on this, and how to apply and follow
20705the GNU GPL, see <http://www.gnu.org/licenses/>.
20706
20707   The GNU General Public License does not permit incorporating your
20708program into proprietary programs.  If your program is a subroutine
20709library, you may consider it more useful to permit linking proprietary
20710applications with the library.  If this is what you want to do, use the
20711GNU Lesser General Public License instead of this License.  But first,
20712please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
20713
20714
20715File: gfortran.info,  Node: GNU Free Documentation License,  Next: Funding,  Prev: Copying,  Up: Top
20716
20717GNU Free Documentation License
20718******************************
20719
20720                     Version 1.3, 3 November 2008
20721
20722     Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
20723     <http://fsf.org/>
20724
20725     Everyone is permitted to copy and distribute verbatim copies
20726     of this license document, but changing it is not allowed.
20727
20728  0. PREAMBLE
20729
20730     The purpose of this License is to make a manual, textbook, or other
20731     functional and useful document "free" in the sense of freedom: to
20732     assure everyone the effective freedom to copy and redistribute it,
20733     with or without modifying it, either commercially or
20734     noncommercially.  Secondarily, this License preserves for the
20735     author and publisher a way to get credit for their work, while not
20736     being considered responsible for modifications made by others.
20737
20738     This License is a kind of "copyleft", which means that derivative
20739     works of the document must themselves be free in the same sense.
20740     It complements the GNU General Public License, which is a copyleft
20741     license designed for free software.
20742
20743     We have designed this License in order to use it for manuals for
20744     free software, because free software needs free documentation: a
20745     free program should come with manuals providing the same freedoms
20746     that the software does.  But this License is not limited to
20747     software manuals; it can be used for any textual work, regardless
20748     of subject matter or whether it is published as a printed book.  We
20749     recommend this License principally for works whose purpose is
20750     instruction or reference.
20751
20752  1. APPLICABILITY AND DEFINITIONS
20753
20754     This License applies to any manual or other work, in any medium,
20755     that contains a notice placed by the copyright holder saying it can
20756     be distributed under the terms of this License.  Such a notice
20757     grants a world-wide, royalty-free license, unlimited in duration,
20758     to use that work under the conditions stated herein.  The
20759     "Document", below, refers to any such manual or work.  Any member
20760     of the public is a licensee, and is addressed as "you".  You accept
20761     the license if you copy, modify or distribute the work in a way
20762     requiring permission under copyright law.
20763
20764     A "Modified Version" of the Document means any work containing the
20765     Document or a portion of it, either copied verbatim, or with
20766     modifications and/or translated into another language.
20767
20768     A "Secondary Section" is a named appendix or a front-matter section
20769     of the Document that deals exclusively with the relationship of the
20770     publishers or authors of the Document to the Document's overall
20771     subject (or to related matters) and contains nothing that could
20772     fall directly within that overall subject.  (Thus, if the Document
20773     is in part a textbook of mathematics, a Secondary Section may not
20774     explain any mathematics.)  The relationship could be a matter of
20775     historical connection with the subject or with related matters, or
20776     of legal, commercial, philosophical, ethical or political position
20777     regarding them.
20778
20779     The "Invariant Sections" are certain Secondary Sections whose
20780     titles are designated, as being those of Invariant Sections, in the
20781     notice that says that the Document is released under this License.
20782     If a section does not fit the above definition of Secondary then it
20783     is not allowed to be designated as Invariant.  The Document may
20784     contain zero Invariant Sections.  If the Document does not identify
20785     any Invariant Sections then there are none.
20786
20787     The "Cover Texts" are certain short passages of text that are
20788     listed, as Front-Cover Texts or Back-Cover Texts, in the notice
20789     that says that the Document is released under this License.  A
20790     Front-Cover Text may be at most 5 words, and a Back-Cover Text may
20791     be at most 25 words.
20792
20793     A "Transparent" copy of the Document means a machine-readable copy,
20794     represented in a format whose specification is available to the
20795     general public, that is suitable for revising the document
20796     straightforwardly with generic text editors or (for images composed
20797     of pixels) generic paint programs or (for drawings) some widely
20798     available drawing editor, and that is suitable for input to text
20799     formatters or for automatic translation to a variety of formats
20800     suitable for input to text formatters.  A copy made in an otherwise
20801     Transparent file format whose markup, or absence of markup, has
20802     been arranged to thwart or discourage subsequent modification by
20803     readers is not Transparent.  An image format is not Transparent if
20804     used for any substantial amount of text.  A copy that is not
20805     "Transparent" is called "Opaque".
20806
20807     Examples of suitable formats for Transparent copies include plain
20808     ASCII without markup, Texinfo input format, LaTeX input format,
20809     SGML or XML using a publicly available DTD, and standard-conforming
20810     simple HTML, PostScript or PDF designed for human modification.
20811     Examples of transparent image formats include PNG, XCF and JPG.
20812     Opaque formats include proprietary formats that can be read and
20813     edited only by proprietary word processors, SGML or XML for which
20814     the DTD and/or processing tools are not generally available, and
20815     the machine-generated HTML, PostScript or PDF produced by some word
20816     processors for output purposes only.
20817
20818     The "Title Page" means, for a printed book, the title page itself,
20819     plus such following pages as are needed to hold, legibly, the
20820     material this License requires to appear in the title page.  For
20821     works in formats which do not have any title page as such, "Title
20822     Page" means the text near the most prominent appearance of the
20823     work's title, preceding the beginning of the body of the text.
20824
20825     The "publisher" means any person or entity that distributes copies
20826     of the Document to the public.
20827
20828     A section "Entitled XYZ" means a named subunit of the Document
20829     whose title either is precisely XYZ or contains XYZ in parentheses
20830     following text that translates XYZ in another language.  (Here XYZ
20831     stands for a specific section name mentioned below, such as
20832     "Acknowledgements", "Dedications", "Endorsements", or "History".)
20833     To "Preserve the Title" of such a section when you modify the
20834     Document means that it remains a section "Entitled XYZ" according
20835     to this definition.
20836
20837     The Document may include Warranty Disclaimers next to the notice
20838     which states that this License applies to the Document.  These
20839     Warranty Disclaimers are considered to be included by reference in
20840     this License, but only as regards disclaiming warranties: any other
20841     implication that these Warranty Disclaimers may have is void and
20842     has no effect on the meaning of this License.
20843
20844  2. VERBATIM COPYING
20845
20846     You may copy and distribute the Document in any medium, either
20847     commercially or noncommercially, provided that this License, the
20848     copyright notices, and the license notice saying this License
20849     applies to the Document are reproduced in all copies, and that you
20850     add no other conditions whatsoever to those of this License.  You
20851     may not use technical measures to obstruct or control the reading
20852     or further copying of the copies you make or distribute.  However,
20853     you may accept compensation in exchange for copies.  If you
20854     distribute a large enough number of copies you must also follow the
20855     conditions in section 3.
20856
20857     You may also lend copies, under the same conditions stated above,
20858     and you may publicly display copies.
20859
20860  3. COPYING IN QUANTITY
20861
20862     If you publish printed copies (or copies in media that commonly
20863     have printed covers) of the Document, numbering more than 100, and
20864     the Document's license notice requires Cover Texts, you must
20865     enclose the copies in covers that carry, clearly and legibly, all
20866     these Cover Texts: Front-Cover Texts on the front cover, and
20867     Back-Cover Texts on the back cover.  Both covers must also clearly
20868     and legibly identify you as the publisher of these copies.  The
20869     front cover must present the full title with all words of the title
20870     equally prominent and visible.  You may add other material on the
20871     covers in addition.  Copying with changes limited to the covers, as
20872     long as they preserve the title of the Document and satisfy these
20873     conditions, can be treated as verbatim copying in other respects.
20874
20875     If the required texts for either cover are too voluminous to fit
20876     legibly, you should put the first ones listed (as many as fit
20877     reasonably) on the actual cover, and continue the rest onto
20878     adjacent pages.
20879
20880     If you publish or distribute Opaque copies of the Document
20881     numbering more than 100, you must either include a machine-readable
20882     Transparent copy along with each Opaque copy, or state in or with
20883     each Opaque copy a computer-network location from which the general
20884     network-using public has access to download using public-standard
20885     network protocols a complete Transparent copy of the Document, free
20886     of added material.  If you use the latter option, you must take
20887     reasonably prudent steps, when you begin distribution of Opaque
20888     copies in quantity, to ensure that this Transparent copy will
20889     remain thus accessible at the stated location until at least one
20890     year after the last time you distribute an Opaque copy (directly or
20891     through your agents or retailers) of that edition to the public.
20892
20893     It is requested, but not required, that you contact the authors of
20894     the Document well before redistributing any large number of copies,
20895     to give them a chance to provide you with an updated version of the
20896     Document.
20897
20898  4. MODIFICATIONS
20899
20900     You may copy and distribute a Modified Version of the Document
20901     under the conditions of sections 2 and 3 above, provided that you
20902     release the Modified Version under precisely this License, with the
20903     Modified Version filling the role of the Document, thus licensing
20904     distribution and modification of the Modified Version to whoever
20905     possesses a copy of it.  In addition, you must do these things in
20906     the Modified Version:
20907
20908       A. Use in the Title Page (and on the covers, if any) a title
20909          distinct from that of the Document, and from those of previous
20910          versions (which should, if there were any, be listed in the
20911          History section of the Document).  You may use the same title
20912          as a previous version if the original publisher of that
20913          version gives permission.
20914
20915       B. List on the Title Page, as authors, one or more persons or
20916          entities responsible for authorship of the modifications in
20917          the Modified Version, together with at least five of the
20918          principal authors of the Document (all of its principal
20919          authors, if it has fewer than five), unless they release you
20920          from this requirement.
20921
20922       C. State on the Title page the name of the publisher of the
20923          Modified Version, as the publisher.
20924
20925       D. Preserve all the copyright notices of the Document.
20926
20927       E. Add an appropriate copyright notice for your modifications
20928          adjacent to the other copyright notices.
20929
20930       F. Include, immediately after the copyright notices, a license
20931          notice giving the public permission to use the Modified
20932          Version under the terms of this License, in the form shown in
20933          the Addendum below.
20934
20935       G. Preserve in that license notice the full lists of Invariant
20936          Sections and required Cover Texts given in the Document's
20937          license notice.
20938
20939       H. Include an unaltered copy of this License.
20940
20941       I. Preserve the section Entitled "History", Preserve its Title,
20942          and add to it an item stating at least the title, year, new
20943          authors, and publisher of the Modified Version as given on the
20944          Title Page.  If there is no section Entitled "History" in the
20945          Document, create one stating the title, year, authors, and
20946          publisher of the Document as given on its Title Page, then add
20947          an item describing the Modified Version as stated in the
20948          previous sentence.
20949
20950       J. Preserve the network location, if any, given in the Document
20951          for public access to a Transparent copy of the Document, and
20952          likewise the network locations given in the Document for
20953          previous versions it was based on.  These may be placed in the
20954          "History" section.  You may omit a network location for a work
20955          that was published at least four years before the Document
20956          itself, or if the original publisher of the version it refers
20957          to gives permission.
20958
20959       K. For any section Entitled "Acknowledgements" or "Dedications",
20960          Preserve the Title of the section, and preserve in the section
20961          all the substance and tone of each of the contributor
20962          acknowledgements and/or dedications given therein.
20963
20964       L. Preserve all the Invariant Sections of the Document, unaltered
20965          in their text and in their titles.  Section numbers or the
20966          equivalent are not considered part of the section titles.
20967
20968       M. Delete any section Entitled "Endorsements".  Such a section
20969          may not be included in the Modified Version.
20970
20971       N. Do not retitle any existing section to be Entitled
20972          "Endorsements" or to conflict in title with any Invariant
20973          Section.
20974
20975       O. Preserve any Warranty Disclaimers.
20976
20977     If the Modified Version includes new front-matter sections or
20978     appendices that qualify as Secondary Sections and contain no
20979     material copied from the Document, you may at your option designate
20980     some or all of these sections as invariant.  To do this, add their
20981     titles to the list of Invariant Sections in the Modified Version's
20982     license notice.  These titles must be distinct from any other
20983     section titles.
20984
20985     You may add a section Entitled "Endorsements", provided it contains
20986     nothing but endorsements of your Modified Version by various
20987     parties--for example, statements of peer review or that the text
20988     has been approved by an organization as the authoritative
20989     definition of a standard.
20990
20991     You may add a passage of up to five words as a Front-Cover Text,
20992     and a passage of up to 25 words as a Back-Cover Text, to the end of
20993     the list of Cover Texts in the Modified Version.  Only one passage
20994     of Front-Cover Text and one of Back-Cover Text may be added by (or
20995     through arrangements made by) any one entity.  If the Document
20996     already includes a cover text for the same cover, previously added
20997     by you or by arrangement made by the same entity you are acting on
20998     behalf of, you may not add another; but you may replace the old
20999     one, on explicit permission from the previous publisher that added
21000     the old one.
21001
21002     The author(s) and publisher(s) of the Document do not by this
21003     License give permission to use their names for publicity for or to
21004     assert or imply endorsement of any Modified Version.
21005
21006  5. COMBINING DOCUMENTS
21007
21008     You may combine the Document with other documents released under
21009     this License, under the terms defined in section 4 above for
21010     modified versions, provided that you include in the combination all
21011     of the Invariant Sections of all of the original documents,
21012     unmodified, and list them all as Invariant Sections of your
21013     combined work in its license notice, and that you preserve all
21014     their Warranty Disclaimers.
21015
21016     The combined work need only contain one copy of this License, and
21017     multiple identical Invariant Sections may be replaced with a single
21018     copy.  If there are multiple Invariant Sections with the same name
21019     but different contents, make the title of each such section unique
21020     by adding at the end of it, in parentheses, the name of the
21021     original author or publisher of that section if known, or else a
21022     unique number.  Make the same adjustment to the section titles in
21023     the list of Invariant Sections in the license notice of the
21024     combined work.
21025
21026     In the combination, you must combine any sections Entitled
21027     "History" in the various original documents, forming one section
21028     Entitled "History"; likewise combine any sections Entitled
21029     "Acknowledgements", and any sections Entitled "Dedications".  You
21030     must delete all sections Entitled "Endorsements."
21031
21032  6. COLLECTIONS OF DOCUMENTS
21033
21034     You may make a collection consisting of the Document and other
21035     documents released under this License, and replace the individual
21036     copies of this License in the various documents with a single copy
21037     that is included in the collection, provided that you follow the
21038     rules of this License for verbatim copying of each of the documents
21039     in all other respects.
21040
21041     You may extract a single document from such a collection, and
21042     distribute it individually under this License, provided you insert
21043     a copy of this License into the extracted document, and follow this
21044     License in all other respects regarding verbatim copying of that
21045     document.
21046
21047  7. AGGREGATION WITH INDEPENDENT WORKS
21048
21049     A compilation of the Document or its derivatives with other
21050     separate and independent documents or works, in or on a volume of a
21051     storage or distribution medium, is called an "aggregate" if the
21052     copyright resulting from the compilation is not used to limit the
21053     legal rights of the compilation's users beyond what the individual
21054     works permit.  When the Document is included in an aggregate, this
21055     License does not apply to the other works in the aggregate which
21056     are not themselves derivative works of the Document.
21057
21058     If the Cover Text requirement of section 3 is applicable to these
21059     copies of the Document, then if the Document is less than one half
21060     of the entire aggregate, the Document's Cover Texts may be placed
21061     on covers that bracket the Document within the aggregate, or the
21062     electronic equivalent of covers if the Document is in electronic
21063     form.  Otherwise they must appear on printed covers that bracket
21064     the whole aggregate.
21065
21066  8. TRANSLATION
21067
21068     Translation is considered a kind of modification, so you may
21069     distribute translations of the Document under the terms of section
21070     4.  Replacing Invariant Sections with translations requires special
21071     permission from their copyright holders, but you may include
21072     translations of some or all Invariant Sections in addition to the
21073     original versions of these Invariant Sections.  You may include a
21074     translation of this License, and all the license notices in the
21075     Document, and any Warranty Disclaimers, provided that you also
21076     include the original English version of this License and the
21077     original versions of those notices and disclaimers.  In case of a
21078     disagreement between the translation and the original version of
21079     this License or a notice or disclaimer, the original version will
21080     prevail.
21081
21082     If a section in the Document is Entitled "Acknowledgements",
21083     "Dedications", or "History", the requirement (section 4) to
21084     Preserve its Title (section 1) will typically require changing the
21085     actual title.
21086
21087  9. TERMINATION
21088
21089     You may not copy, modify, sublicense, or distribute the Document
21090     except as expressly provided under this License.  Any attempt
21091     otherwise to copy, modify, sublicense, or distribute it is void,
21092     and will automatically terminate your rights under this License.
21093
21094     However, if you cease all violation of this License, then your
21095     license from a particular copyright holder is reinstated (a)
21096     provisionally, unless and until the copyright holder explicitly and
21097     finally terminates your license, and (b) permanently, if the
21098     copyright holder fails to notify you of the violation by some
21099     reasonable means prior to 60 days after the cessation.
21100
21101     Moreover, your license from a particular copyright holder is
21102     reinstated permanently if the copyright holder notifies you of the
21103     violation by some reasonable means, this is the first time you have
21104     received notice of violation of this License (for any work) from
21105     that copyright holder, and you cure the violation prior to 30 days
21106     after your receipt of the notice.
21107
21108     Termination of your rights under this section does not terminate
21109     the licenses of parties who have received copies or rights from you
21110     under this License.  If your rights have been terminated and not
21111     permanently reinstated, receipt of a copy of some or all of the
21112     same material does not give you any rights to use it.
21113
21114  10. FUTURE REVISIONS OF THIS LICENSE
21115
21116     The Free Software Foundation may publish new, revised versions of
21117     the GNU Free Documentation License from time to time.  Such new
21118     versions will be similar in spirit to the present version, but may
21119     differ in detail to address new problems or concerns.  See
21120     <http://www.gnu.org/copyleft/>.
21121
21122     Each version of the License is given a distinguishing version
21123     number.  If the Document specifies that a particular numbered
21124     version of this License "or any later version" applies to it, you
21125     have the option of following the terms and conditions either of
21126     that specified version or of any later version that has been
21127     published (not as a draft) by the Free Software Foundation.  If the
21128     Document does not specify a version number of this License, you may
21129     choose any version ever published (not as a draft) by the Free
21130     Software Foundation.  If the Document specifies that a proxy can
21131     decide which future versions of this License can be used, that
21132     proxy's public statement of acceptance of a version permanently
21133     authorizes you to choose that version for the Document.
21134
21135  11. RELICENSING
21136
21137     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
21138     World Wide Web server that publishes copyrightable works and also
21139     provides prominent facilities for anybody to edit those works.  A
21140     public wiki that anybody can edit is an example of such a server.
21141     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
21142     site means any set of copyrightable works thus published on the MMC
21143     site.
21144
21145     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
21146     license published by Creative Commons Corporation, a not-for-profit
21147     corporation with a principal place of business in San Francisco,
21148     California, as well as future copyleft versions of that license
21149     published by that same organization.
21150
21151     "Incorporate" means to publish or republish a Document, in whole or
21152     in part, as part of another Document.
21153
21154     An MMC is "eligible for relicensing" if it is licensed under this
21155     License, and if all works that were first published under this
21156     License somewhere other than this MMC, and subsequently
21157     incorporated in whole or in part into the MMC, (1) had no cover
21158     texts or invariant sections, and (2) were thus incorporated prior
21159     to November 1, 2008.
21160
21161     The operator of an MMC Site may republish an MMC contained in the
21162     site under CC-BY-SA on the same site at any time before August 1,
21163     2009, provided the MMC is eligible for relicensing.
21164
21165ADDENDUM: How to use this License for your documents
21166====================================================
21167
21168To use this License in a document you have written, include a copy of
21169the License in the document and put the following copyright and license
21170notices just after the title page:
21171
21172       Copyright (C)  YEAR  YOUR NAME.
21173       Permission is granted to copy, distribute and/or modify this document
21174       under the terms of the GNU Free Documentation License, Version 1.3
21175       or any later version published by the Free Software Foundation;
21176       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
21177       Texts.  A copy of the license is included in the section entitled ``GNU
21178       Free Documentation License''.
21179
21180   If you have Invariant Sections, Front-Cover Texts and Back-Cover
21181Texts, replace the "with...Texts."  line with this:
21182
21183         with the Invariant Sections being LIST THEIR TITLES, with
21184         the Front-Cover Texts being LIST, and with the Back-Cover Texts
21185         being LIST.
21186
21187   If you have Invariant Sections without Cover Texts, or some other
21188combination of the three, merge those two alternatives to suit the
21189situation.
21190
21191   If your document contains nontrivial examples of program code, we
21192recommend releasing these examples in parallel under your choice of free
21193software license, such as the GNU General Public License, to permit
21194their use in free software.
21195
21196
21197File: gfortran.info,  Node: Funding,  Next: Option Index,  Prev: GNU Free Documentation License,  Up: Top
21198
21199Funding Free Software
21200*********************
21201
21202If you want to have more free software a few years from now, it makes
21203sense for you to help encourage people to contribute funds for its
21204development.  The most effective approach known is to encourage
21205commercial redistributors to donate.
21206
21207   Users of free software systems can boost the pace of development by
21208encouraging for-a-fee distributors to donate part of their selling price
21209to free software developers--the Free Software Foundation, and others.
21210
21211   The way to convince distributors to do this is to demand it and
21212expect it from them.  So when you compare distributors, judge them
21213partly by how much they give to free software development.  Show
21214distributors they must compete to be the one who gives the most.
21215
21216   To make this approach work, you must insist on numbers that you can
21217compare, such as, "We will donate ten dollars to the Frobnitz project
21218for each disk sold."  Don't be satisfied with a vague promise, such as
21219"A portion of the profits are donated," since it doesn't give a basis
21220for comparison.
21221
21222   Even a precise fraction "of the profits from this disk" is not very
21223meaningful, since creative accounting and unrelated business decisions
21224can greatly alter what fraction of the sales price counts as profit.  If
21225the price you pay is $50, ten percent of the profit is probably less
21226than a dollar; it might be a few cents, or nothing at all.
21227
21228   Some redistributors do development work themselves.  This is useful
21229too; but to keep everyone honest, you need to inquire how much they do,
21230and what kind.  Some kinds of development make much more long-term
21231difference than others.  For example, maintaining a separate version of
21232a program contributes very little; maintaining the standard version of a
21233program for the whole community contributes much.  Easy new ports
21234contribute little, since someone else would surely do them; difficult
21235ports such as adding a new CPU to the GNU Compiler Collection contribute
21236more; major new features or packages contribute the most.
21237
21238   By establishing the idea that supporting further development is "the
21239proper thing to do" when distributing free software for a fee, we can
21240assure a steady flow of resources into making more free software.
21241
21242     Copyright (C) 1994 Free Software Foundation, Inc.
21243     Verbatim copying and redistribution of this section is permitted
21244     without royalty; alteration is not permitted.
21245
21246
21247File: gfortran.info,  Node: Option Index,  Next: Keyword Index,  Prev: Funding,  Up: Top
21248
21249Option Index
21250************
21251
21252'gfortran''s command line options are indexed here without any initial
21253'-' or '--'.  Where an option has both positive and negative forms (such
21254as -foption and -fno-option), relevant entries in the manual are indexed
21255under the most appropriate form; it may sometimes be useful to look up
21256both forms.
21257
21258�[index�]
21259* Menu:
21260
21261* A-PREDICATE=ANSWER:                    Preprocessing Options.
21262                                                              (line 119)
21263* APREDICATE=ANSWER:                     Preprocessing Options.
21264                                                              (line 113)
21265* backslash:                             Fortran Dialect Options.
21266                                                              (line  79)
21267* C:                                     Preprocessing Options.
21268                                                              (line 122)
21269* c-prototypes:                          Interoperability Options.
21270                                                              (line   7)
21271* c-prototypes-external:                 Interoperability Options.
21272                                                              (line  25)
21273* CC:                                    Preprocessing Options.
21274                                                              (line 137)
21275* cpp:                                   Preprocessing Options.
21276                                                              (line  12)
21277* dD:                                    Preprocessing Options.
21278                                                              (line  35)
21279* dI:                                    Preprocessing Options.
21280                                                              (line  51)
21281* dM:                                    Preprocessing Options.
21282                                                              (line  26)
21283* dN:                                    Preprocessing Options.
21284                                                              (line  41)
21285* DNAME:                                 Preprocessing Options.
21286                                                              (line 151)
21287* DNAME=DEFINITION:                      Preprocessing Options.
21288                                                              (line 154)
21289* dU:                                    Preprocessing Options.
21290                                                              (line  44)
21291* faggressive-function-elimination:      Code Gen Options.    (line 406)
21292* falign-commons:                        Code Gen Options.    (line 379)
21293* fall-intrinsics:                       Fortran Dialect Options.
21294                                                              (line  17)
21295* fblas-matmul-limit:                    Code Gen Options.    (line 308)
21296* fbounds-check:                         Code Gen Options.    (line 201)
21297* fcheck:                                Code Gen Options.    (line 144)
21298* fcheck-array-temporaries:              Code Gen Options.    (line 235)
21299* fcoarray:                              Code Gen Options.    (line 130)
21300* fconvert=CONVERSION:                   Runtime Options.     (line  10)
21301* fcray-pointer:                         Fortran Dialect Options.
21302                                                              (line 134)
21303* fd-lines-as-code:                      Fortran Dialect Options.
21304                                                              (line  27)
21305* fd-lines-as-comments:                  Fortran Dialect Options.
21306                                                              (line  27)
21307* fdec:                                  Fortran Dialect Options.
21308                                                              (line  34)
21309* fdec-include:                          Fortran Dialect Options.
21310                                                              (line  68)
21311* fdec-intrinsic-ints:                   Fortran Dialect Options.
21312                                                              (line  54)
21313* fdec-math:                             Fortran Dialect Options.
21314                                                              (line  59)
21315* fdec-static:                           Fortran Dialect Options.
21316                                                              (line  64)
21317* fdec-structure:                        Fortran Dialect Options.
21318                                                              (line  48)
21319* fdefault-double-8:                     Fortran Dialect Options.
21320                                                              (line 205)
21321* fdefault-integer-8:                    Fortran Dialect Options.
21322                                                              (line 169)
21323* fdefault-real-10:                      Fortran Dialect Options.
21324                                                              (line 185)
21325* fdefault-real-16:                      Fortran Dialect Options.
21326                                                              (line 195)
21327* fdefault-real-8:                       Fortran Dialect Options.
21328                                                              (line 175)
21329* fdollar-ok:                            Fortran Dialect Options.
21330                                                              (line  73)
21331* fdump-fortran-global:                  Debugging Options.   (line  33)
21332* fdump-fortran-optimized:               Debugging Options.   (line  18)
21333* fdump-fortran-original:                Debugging Options.   (line  10)
21334* fdump-parse-tree:                      Debugging Options.   (line  25)
21335* fexternal-blas:                        Code Gen Options.    (line 300)
21336* ff2c:                                  Code Gen Options.    (line  28)
21337* ffixed-form:                           Fortran Dialect Options.
21338                                                              (line  11)
21339* ffixed-line-length-N:                  Fortran Dialect Options.
21340                                                              (line  96)
21341* ffpe-summary=LIST:                     Debugging Options.   (line  73)
21342* ffpe-trap=LIST:                        Debugging Options.   (line  40)
21343* ffree-form:                            Fortran Dialect Options.
21344                                                              (line  11)
21345* ffree-line-length-N:                   Fortran Dialect Options.
21346                                                              (line 118)
21347* fimplicit-none:                        Fortran Dialect Options.
21348                                                              (line 129)
21349* finit-character:                       Code Gen Options.    (line 343)
21350* finit-derived:                         Code Gen Options.    (line 343)
21351* finit-integer:                         Code Gen Options.    (line 343)
21352* finit-local-zero:                      Code Gen Options.    (line 343)
21353* finit-logical:                         Code Gen Options.    (line 343)
21354* finit-real:                            Code Gen Options.    (line 343)
21355* finline-matmul-limit:                  Code Gen Options.    (line 319)
21356* finteger-4-integer-8:                  Fortran Dialect Options.
21357                                                              (line 213)
21358* fintrinsic-modules-path DIR:           Directory Options.   (line  36)
21359* fmax-array-constructor:                Code Gen Options.    (line 238)
21360* fmax-errors=N:                         Error and Warning Options.
21361                                                              (line  27)
21362* fmax-identifier-length=N:              Fortran Dialect Options.
21363                                                              (line 125)
21364* fmax-stack-var-size:                   Code Gen Options.    (line 256)
21365* fmax-subrecord-length=LENGTH:          Runtime Options.     (line  29)
21366* fmodule-private:                       Fortran Dialect Options.
21367                                                              (line  91)
21368* fno-automatic:                         Code Gen Options.    (line  15)
21369* fno-backtrace:                         Debugging Options.   (line  86)
21370* fno-protect-parens:                    Code Gen Options.    (line 391)
21371* fno-underscoring:                      Code Gen Options.    (line  57)
21372* fopenacc:                              Fortran Dialect Options.
21373                                                              (line 138)
21374* fopenmp:                               Fortran Dialect Options.
21375                                                              (line 149)
21376* fpack-derived:                         Code Gen Options.    (line 278)
21377* fpad-source:                           Fortran Dialect Options.
21378                                                              (line 110)
21379* fpp:                                   Preprocessing Options.
21380                                                              (line  12)
21381* frange-check:                          Fortran Dialect Options.
21382                                                              (line 157)
21383* freal-4-real-10:                       Fortran Dialect Options.
21384                                                              (line 228)
21385* freal-4-real-16:                       Fortran Dialect Options.
21386                                                              (line 228)
21387* freal-4-real-8:                        Fortran Dialect Options.
21388                                                              (line 228)
21389* freal-8-real-10:                       Fortran Dialect Options.
21390                                                              (line 228)
21391* freal-8-real-16:                       Fortran Dialect Options.
21392                                                              (line 228)
21393* freal-8-real-4:                        Fortran Dialect Options.
21394                                                              (line 228)
21395* frealloc-lhs:                          Code Gen Options.    (line 400)
21396* frecord-marker=LENGTH:                 Runtime Options.     (line  21)
21397* frecursive:                            Code Gen Options.    (line 333)
21398* frepack-arrays:                        Code Gen Options.    (line 284)
21399* frontend-loop-interchange:             Code Gen Options.    (line 427)
21400* frontend-optimize:                     Code Gen Options.    (line 414)
21401* fsecond-underscore:                    Code Gen Options.    (line 113)
21402* fshort-enums:                          Code Gen Options.    (line 294)
21403* fshort-enums <1>:                      Fortran 2003 status. (line  92)
21404* fsign-zero:                            Runtime Options.     (line  34)
21405* fstack-arrays:                         Code Gen Options.    (line 270)
21406* fsyntax-only:                          Error and Warning Options.
21407                                                              (line  33)
21408* ftest-forall-temp:                     Fortran Dialect Options.
21409                                                              (line 258)
21410* fworking-directory:                    Preprocessing Options.
21411                                                              (line  55)
21412* H:                                     Preprocessing Options.
21413                                                              (line 174)
21414* IDIR:                                  Directory Options.   (line  14)
21415* idirafter DIR:                         Preprocessing Options.
21416                                                              (line  69)
21417* imultilib DIR:                         Preprocessing Options.
21418                                                              (line  76)
21419* iprefix PREFIX:                        Preprocessing Options.
21420                                                              (line  80)
21421* iquote DIR:                            Preprocessing Options.
21422                                                              (line  89)
21423* isysroot DIR:                          Preprocessing Options.
21424                                                              (line  85)
21425* isystem DIR:                           Preprocessing Options.
21426                                                              (line  96)
21427* JDIR:                                  Directory Options.   (line  29)
21428* MDIR:                                  Directory Options.   (line  29)
21429* nostdinc:                              Preprocessing Options.
21430                                                              (line 104)
21431* P:                                     Preprocessing Options.
21432                                                              (line 179)
21433* pedantic:                              Error and Warning Options.
21434                                                              (line  39)
21435* pedantic-errors:                       Error and Warning Options.
21436                                                              (line  58)
21437* static-libgfortran:                    Link Options.        (line  11)
21438* std=STD option:                        Fortran Dialect Options.
21439                                                              (line 239)
21440* tail-call-workaround:                  Code Gen Options.    (line 205)
21441* UNAME:                                 Preprocessing Options.
21442                                                              (line 185)
21443* undef:                                 Preprocessing Options.
21444                                                              (line 109)
21445* Waliasing:                             Error and Warning Options.
21446                                                              (line  71)
21447* Walign-commons:                        Error and Warning Options.
21448                                                              (line 226)
21449* Wall:                                  Error and Warning Options.
21450                                                              (line  62)
21451* Wampersand:                            Error and Warning Options.
21452                                                              (line  88)
21453* Wargument-mismatch:                    Error and Warning Options.
21454                                                              (line  96)
21455* Warray-temporaries:                    Error and Warning Options.
21456                                                              (line 101)
21457* Wc-binding-type:                       Error and Warning Options.
21458                                                              (line 106)
21459* Wcharacter-truncation:                 Error and Warning Options.
21460                                                              (line 113)
21461* Wcompare-reals:                        Error and Warning Options.
21462                                                              (line 254)
21463* Wconversion:                           Error and Warning Options.
21464                                                              (line 122)
21465* Wconversion-extra:                     Error and Warning Options.
21466                                                              (line 126)
21467* Wdo-subscript:                         Error and Warning Options.
21468                                                              (line 266)
21469* Werror:                                Error and Warning Options.
21470                                                              (line 278)
21471* Wextra:                                Error and Warning Options.
21472                                                              (line 130)
21473* Wfrontend-loop-interchange:            Error and Warning Options.
21474                                                              (line 135)
21475* Wfunction-elimination:                 Error and Warning Options.
21476                                                              (line 232)
21477* Wimplicit-interface:                   Error and Warning Options.
21478                                                              (line 139)
21479* Wimplicit-procedure:                   Error and Warning Options.
21480                                                              (line 145)
21481* Winteger-division:                     Error and Warning Options.
21482                                                              (line 149)
21483* Wintrinsic-shadow:                     Error and Warning Options.
21484                                                              (line 204)
21485* Wintrinsics-std:                       Error and Warning Options.
21486                                                              (line 153)
21487* Wline-truncation:                      Error and Warning Options.
21488                                                              (line 116)
21489* Wpedantic:                             Error and Warning Options.
21490                                                              (line  39)
21491* Wreal-q-constant:                      Error and Warning Options.
21492                                                              (line 160)
21493* Wrealloc-lhs:                          Error and Warning Options.
21494                                                              (line 237)
21495* Wrealloc-lhs-all:                      Error and Warning Options.
21496                                                              (line 249)
21497* Wsurprising:                           Error and Warning Options.
21498                                                              (line 164)
21499* Wtabs:                                 Error and Warning Options.
21500                                                              (line 186)
21501* Wtargt-lifetime:                       Error and Warning Options.
21502                                                              (line 258)
21503* Wundefined-do-loop:                    Error and Warning Options.
21504                                                              (line 194)
21505* Wunderflow:                            Error and Warning Options.
21506                                                              (line 199)
21507* Wunused-dummy-argument:                Error and Warning Options.
21508                                                              (line 215)
21509* Wunused-parameter:                     Error and Warning Options.
21510                                                              (line 219)
21511* Wuse-without-only:                     Error and Warning Options.
21512                                                              (line 211)
21513* Wzerotrip:                             Error and Warning Options.
21514                                                              (line 262)
21515
21516
21517File: gfortran.info,  Node: Keyword Index,  Prev: Option Index,  Up: Top
21518
21519Keyword Index
21520*************
21521
21522�[index�]
21523* Menu:
21524
21525* $:                                     Fortran Dialect Options.
21526                                                              (line  73)
21527* %LOC:                                  Argument list functions.
21528                                                              (line   6)
21529* %REF:                                  Argument list functions.
21530                                                              (line   6)
21531* %VAL:                                  Argument list functions.
21532                                                              (line   6)
21533* &:                                     Error and Warning Options.
21534                                                              (line  88)
21535* [...]:                                 Fortran 2003 status. (line  78)
21536* _gfortran_set_args:                    _gfortran_set_args.  (line   6)
21537* _gfortran_set_convert:                 _gfortran_set_convert.
21538                                                              (line   6)
21539* _gfortran_set_fpe:                     _gfortran_set_fpe.   (line   6)
21540* _gfortran_set_max_subrecord_length:    _gfortran_set_max_subrecord_length.
21541                                                              (line   6)
21542* _gfortran_set_options:                 _gfortran_set_options.
21543                                                              (line   6)
21544* _gfortran_set_record_marker:           _gfortran_set_record_marker.
21545                                                              (line   6)
21546* ABORT:                                 ABORT.               (line   6)
21547* ABS:                                   ABS.                 (line   6)
21548* absolute value:                        ABS.                 (line   6)
21549* ACCESS:                                ACCESS.              (line   6)
21550* ACCESS='STREAM' I/O:                   Fortran 2003 status. (line 102)
21551* ACHAR:                                 ACHAR.               (line   6)
21552* ACOS:                                  ACOS.                (line   6)
21553* ACOSD:                                 ACOSD.               (line   6)
21554* ACOSH:                                 ACOSH.               (line   6)
21555* adjust string:                         ADJUSTL.             (line   6)
21556* adjust string <1>:                     ADJUSTR.             (line   6)
21557* ADJUSTL:                               ADJUSTL.             (line   6)
21558* ADJUSTR:                               ADJUSTR.             (line   6)
21559* AIMAG:                                 AIMAG.               (line   6)
21560* AINT:                                  AINT.                (line   6)
21561* ALARM:                                 ALARM.               (line   6)
21562* ALGAMA:                                LOG_GAMMA.           (line   6)
21563* aliasing:                              Error and Warning Options.
21564                                                              (line  71)
21565* alignment of COMMON blocks:            Error and Warning Options.
21566                                                              (line 226)
21567* alignment of COMMON blocks <1>:        Code Gen Options.    (line 379)
21568* ALL:                                   ALL.                 (line   6)
21569* all warnings:                          Error and Warning Options.
21570                                                              (line  62)
21571* ALLOCATABLE components of derived types: Fortran 2003 status.
21572                                                              (line 100)
21573* ALLOCATABLE dummy arguments:           Fortran 2003 status. (line  98)
21574* ALLOCATABLE function results:          Fortran 2003 status. (line  99)
21575* ALLOCATED:                             ALLOCATED.           (line   6)
21576* allocation, moving:                    MOVE_ALLOC.          (line   6)
21577* allocation, status:                    ALLOCATED.           (line   6)
21578* ALOG:                                  LOG.                 (line   6)
21579* ALOG10:                                LOG10.               (line   6)
21580* AMAX0:                                 MAX.                 (line   6)
21581* AMAX1:                                 MAX.                 (line   6)
21582* AMIN0:                                 MIN.                 (line   6)
21583* AMIN1:                                 MIN.                 (line   6)
21584* AMOD:                                  MOD.                 (line   6)
21585* AND:                                   AND.                 (line   6)
21586* ANINT:                                 ANINT.               (line   6)
21587* ANY:                                   ANY.                 (line   6)
21588* area hyperbolic cosine:                ACOSH.               (line   6)
21589* area hyperbolic sine:                  ASINH.               (line   6)
21590* area hyperbolic tangent:               ATANH.               (line   6)
21591* argument list functions:               Argument list functions.
21592                                                              (line   6)
21593* arguments, to program:                 COMMAND_ARGUMENT_COUNT.
21594                                                              (line   6)
21595* arguments, to program <1>:             GETARG.              (line   6)
21596* arguments, to program <2>:             GET_COMMAND.         (line   6)
21597* arguments, to program <3>:             GET_COMMAND_ARGUMENT.
21598                                                              (line   6)
21599* arguments, to program <4>:             IARGC.               (line   6)
21600* array, add elements:                   SUM.                 (line   6)
21601* array, AND:                            IALL.                (line   6)
21602* array, apply condition:                ALL.                 (line   6)
21603* array, apply condition <1>:            ANY.                 (line   6)
21604* array, bounds checking:                Code Gen Options.    (line 144)
21605* array, change dimensions:              RESHAPE.             (line   6)
21606* array, combine arrays:                 MERGE.               (line   6)
21607* array, condition testing:              ALL.                 (line   6)
21608* array, condition testing <1>:          ANY.                 (line   6)
21609* array, conditionally add elements:     SUM.                 (line   6)
21610* array, conditionally count elements:   COUNT.               (line   6)
21611* array, conditionally multiply elements: PRODUCT.            (line   6)
21612* array, constructors:                   Fortran 2003 status. (line  78)
21613* array, contiguity:                     IS_CONTIGUOUS.       (line   6)
21614* array, count elements:                 SIZE.                (line   6)
21615* array, duplicate dimensions:           SPREAD.              (line   6)
21616* array, duplicate elements:             SPREAD.              (line   6)
21617* array, element counting:               COUNT.               (line   6)
21618* array, gather elements:                PACK.                (line   6)
21619* array, increase dimension:             SPREAD.              (line   6)
21620* array, increase dimension <1>:         UNPACK.              (line   6)
21621* array, indices of type real:           Real array indices.  (line   6)
21622* array, location of maximum element:    MAXLOC.              (line   6)
21623* array, location of minimum element:    MINLOC.              (line   6)
21624* array, lower bound:                    LBOUND.              (line   6)
21625* array, maximum value:                  MAXVAL.              (line   6)
21626* array, merge arrays:                   MERGE.               (line   6)
21627* array, minimum value:                  MINVAL.              (line   6)
21628* array, multiply elements:              PRODUCT.             (line   6)
21629* array, number of elements:             COUNT.               (line   6)
21630* array, number of elements <1>:         SIZE.                (line   6)
21631* array, OR:                             IANY.                (line   6)
21632* array, packing:                        PACK.                (line   6)
21633* array, parity:                         IPARITY.             (line   6)
21634* array, permutation:                    CSHIFT.              (line   6)
21635* array, product:                        PRODUCT.             (line   6)
21636* array, reduce dimension:               PACK.                (line   6)
21637* array, rotate:                         CSHIFT.              (line   6)
21638* array, scatter elements:               UNPACK.              (line   6)
21639* array, shape:                          SHAPE.               (line   6)
21640* array, shift:                          EOSHIFT.             (line   6)
21641* array, shift circularly:               CSHIFT.              (line   6)
21642* array, size:                           SIZE.                (line   6)
21643* array, sum:                            SUM.                 (line   6)
21644* array, transmogrify:                   RESHAPE.             (line   6)
21645* array, transpose:                      TRANSPOSE.           (line   6)
21646* array, unpacking:                      UNPACK.              (line   6)
21647* array, upper bound:                    UBOUND.              (line   6)
21648* array, XOR:                            IPARITY.             (line   6)
21649* ASCII collating sequence:              ACHAR.               (line   6)
21650* ASCII collating sequence <1>:          IACHAR.              (line   6)
21651* ASIN:                                  ASIN.                (line   6)
21652* ASIND:                                 ASIND.               (line   6)
21653* ASINH:                                 ASINH.               (line   6)
21654* ASSOCIATED:                            ASSOCIATED.          (line   6)
21655* association status:                    ASSOCIATED.          (line   6)
21656* association status, C pointer:         C_ASSOCIATED.        (line   6)
21657* asynchronous I/O:                      Asynchronous I/O.    (line   6)
21658* ATAN:                                  ATAN.                (line   6)
21659* ATAN2:                                 ATAN2.               (line   6)
21660* ATAN2D:                                ATAN2D.              (line   6)
21661* ATAND:                                 ATAND.               (line   6)
21662* ATANH:                                 ATANH.               (line   6)
21663* Atomic subroutine, add:                ATOMIC_ADD.          (line   6)
21664* Atomic subroutine, ADD with fetch:     ATOMIC_FETCH_ADD.    (line   6)
21665* Atomic subroutine, AND:                ATOMIC_AND.          (line   6)
21666* Atomic subroutine, AND with fetch:     ATOMIC_FETCH_AND.    (line   6)
21667* Atomic subroutine, compare and swap:   ATOMIC_CAS.          (line   6)
21668* Atomic subroutine, define:             ATOMIC_DEFINE.       (line   6)
21669* Atomic subroutine, OR:                 ATOMIC_OR.           (line   6)
21670* Atomic subroutine, OR with fetch:      ATOMIC_FETCH_OR.     (line   6)
21671* Atomic subroutine, reference:          ATOMIC_REF.          (line   6)
21672* Atomic subroutine, XOR:                ATOMIC_XOR.          (line   6)
21673* Atomic subroutine, XOR with fetch:     ATOMIC_FETCH_XOR.    (line   6)
21674* ATOMIC_ADD:                            ATOMIC_ADD.          (line   6)
21675* ATOMIC_AND:                            ATOMIC_AND.          (line   6)
21676* ATOMIC_DEFINE:                         ATOMIC_CAS.          (line   6)
21677* ATOMIC_DEFINE <1>:                     ATOMIC_DEFINE.       (line   6)
21678* ATOMIC_FETCH_ADD:                      ATOMIC_FETCH_ADD.    (line   6)
21679* ATOMIC_FETCH_AND:                      ATOMIC_FETCH_AND.    (line   6)
21680* ATOMIC_FETCH_OR:                       ATOMIC_FETCH_OR.     (line   6)
21681* ATOMIC_FETCH_XOR:                      ATOMIC_FETCH_XOR.    (line   6)
21682* ATOMIC_OR:                             ATOMIC_OR.           (line   6)
21683* ATOMIC_REF:                            ATOMIC_REF.          (line   6)
21684* ATOMIC_XOR:                            ATOMIC_XOR.          (line   6)
21685* Authors:                               Contributors.        (line   6)
21686* AUTOMATIC:                             AUTOMATIC and STATIC attributes.
21687                                                              (line   6)
21688* BABS:                                  ABS.                 (line   6)
21689* backslash:                             Fortran Dialect Options.
21690                                                              (line  79)
21691* BACKSPACE:                             Read/Write after EOF marker.
21692                                                              (line   6)
21693* BACKTRACE:                             BACKTRACE.           (line   6)
21694* backtrace:                             Debugging Options.   (line  86)
21695* backtrace <1>:                         BACKTRACE.           (line   6)
21696* base 10 logarithm function:            LOG10.               (line   6)
21697* BBCLR:                                 IBCLR.               (line   6)
21698* BBITS:                                 IBITS.               (line   6)
21699* BBSET:                                 IBSET.               (line   6)
21700* BBTEST:                                BTEST.               (line   6)
21701* BESJ0:                                 BESSEL_J0.           (line   6)
21702* BESJ1:                                 BESSEL_J1.           (line   6)
21703* BESJN:                                 BESSEL_JN.           (line   6)
21704* Bessel function, first kind:           BESSEL_J0.           (line   6)
21705* Bessel function, first kind <1>:       BESSEL_J1.           (line   6)
21706* Bessel function, first kind <2>:       BESSEL_JN.           (line   6)
21707* Bessel function, second kind:          BESSEL_Y0.           (line   6)
21708* Bessel function, second kind <1>:      BESSEL_Y1.           (line   6)
21709* Bessel function, second kind <2>:      BESSEL_YN.           (line   6)
21710* BESSEL_J0:                             BESSEL_J0.           (line   6)
21711* BESSEL_J1:                             BESSEL_J1.           (line   6)
21712* BESSEL_JN:                             BESSEL_JN.           (line   6)
21713* BESSEL_Y0:                             BESSEL_Y0.           (line   6)
21714* BESSEL_Y1:                             BESSEL_Y1.           (line   6)
21715* BESSEL_YN:                             BESSEL_YN.           (line   6)
21716* BESY0:                                 BESSEL_Y0.           (line   6)
21717* BESY1:                                 BESSEL_Y1.           (line   6)
21718* BESYN:                                 BESSEL_YN.           (line   6)
21719* BGE:                                   BGE.                 (line   6)
21720* BGT:                                   BGT.                 (line   6)
21721* BIAND:                                 IAND.                (line   6)
21722* BIEOR:                                 IEOR.                (line   6)
21723* binary representation:                 POPCNT.              (line   6)
21724* binary representation <1>:             POPPAR.              (line   6)
21725* BIOR:                                  IOR.                 (line   6)
21726* BITEST:                                BTEST.               (line   6)
21727* bits set:                              POPCNT.              (line   6)
21728* bits, AND of array elements:           IALL.                (line   6)
21729* bits, clear:                           IBCLR.               (line   6)
21730* bits, extract:                         IBITS.               (line   6)
21731* bits, get:                             IBITS.               (line   6)
21732* bits, merge:                           MERGE_BITS.          (line   6)
21733* bits, move:                            MVBITS.              (line   6)
21734* bits, move <1>:                        TRANSFER.            (line   6)
21735* bits, negate:                          NOT.                 (line   6)
21736* bits, number of:                       BIT_SIZE.            (line   6)
21737* bits, OR of array elements:            IANY.                (line   6)
21738* bits, set:                             IBSET.               (line   6)
21739* bits, shift:                           ISHFT.               (line   6)
21740* bits, shift circular:                  ISHFTC.              (line   6)
21741* bits, shift left:                      LSHIFT.              (line   6)
21742* bits, shift left <1>:                  SHIFTL.              (line   6)
21743* bits, shift right:                     RSHIFT.              (line   6)
21744* bits, shift right <1>:                 SHIFTA.              (line   6)
21745* bits, shift right <2>:                 SHIFTR.              (line   6)
21746* bits, testing:                         BTEST.               (line   6)
21747* bits, unset:                           IBCLR.               (line   6)
21748* bits, XOR of array elements:           IPARITY.             (line   6)
21749* bitwise comparison:                    BGE.                 (line   6)
21750* bitwise comparison <1>:                BGT.                 (line   6)
21751* bitwise comparison <2>:                BLE.                 (line   6)
21752* bitwise comparison <3>:                BLT.                 (line   6)
21753* bitwise logical and:                   AND.                 (line   6)
21754* bitwise logical and <1>:               IAND.                (line   6)
21755* bitwise logical exclusive or:          IEOR.                (line   6)
21756* bitwise logical exclusive or <1>:      XOR.                 (line   6)
21757* bitwise logical not:                   NOT.                 (line   6)
21758* bitwise logical or:                    IOR.                 (line   6)
21759* bitwise logical or <1>:                OR.                  (line   6)
21760* BIT_SIZE:                              BIT_SIZE.            (line   6)
21761* BJTEST:                                BTEST.               (line   6)
21762* BKTEST:                                BTEST.               (line   6)
21763* BLE:                                   BLE.                 (line   6)
21764* BLT:                                   BLT.                 (line   6)
21765* BMOD:                                  MOD.                 (line   6)
21766* BMVBITS:                               MVBITS.              (line   6)
21767* BNOT:                                  NOT.                 (line   6)
21768* bounds checking:                       Code Gen Options.    (line 144)
21769* BOZ literal constants:                 BOZ literal constants.
21770                                                              (line   6)
21771* BSHFT:                                 ISHFT.               (line   6)
21772* BSHFTC:                                ISHFTC.              (line   6)
21773* BTEST:                                 BTEST.               (line   6)
21774* CABS:                                  ABS.                 (line   6)
21775* calling convention:                    Code Gen Options.    (line  28)
21776* CARRIAGECONTROL:                       Extended I/O specifiers.
21777                                                              (line   6)
21778* CCOS:                                  COS.                 (line   6)
21779* CCOSD:                                 COSD.                (line   6)
21780* CDABS:                                 ABS.                 (line   6)
21781* CDCOS:                                 COS.                 (line   6)
21782* CDCOSD:                                COSD.                (line   6)
21783* CDEXP:                                 EXP.                 (line   6)
21784* CDLOG:                                 LOG.                 (line   6)
21785* CDSIN:                                 SIN.                 (line   6)
21786* CDSIND:                                SIND.                (line   6)
21787* CDSQRT:                                SQRT.                (line   6)
21788* CEILING:                               CEILING.             (line   6)
21789* ceiling:                               ANINT.               (line   6)
21790* ceiling <1>:                           CEILING.             (line   6)
21791* CEXP:                                  EXP.                 (line   6)
21792* CHAR:                                  CHAR.                (line   6)
21793* character kind:                        SELECTED_CHAR_KIND.  (line   6)
21794* character set:                         Fortran Dialect Options.
21795                                                              (line  73)
21796* CHDIR:                                 CHDIR.               (line   6)
21797* checking array temporaries:            Code Gen Options.    (line 144)
21798* checking subscripts:                   Code Gen Options.    (line 144)
21799* CHMOD:                                 CHMOD.               (line   6)
21800* clock ticks:                           MCLOCK.              (line   6)
21801* clock ticks <1>:                       MCLOCK8.             (line   6)
21802* clock ticks <2>:                       SYSTEM_CLOCK.        (line   6)
21803* CLOG:                                  LOG.                 (line   6)
21804* CMPLX:                                 CMPLX.               (line   6)
21805* coarray, IMAGE_INDEX:                  IMAGE_INDEX.         (line   6)
21806* coarray, lower bound:                  LCOBOUND.            (line   6)
21807* coarray, NUM_IMAGES:                   NUM_IMAGES.          (line   6)
21808* coarray, THIS_IMAGE:                   THIS_IMAGE.          (line   6)
21809* coarray, upper bound:                  UCOBOUND.            (line   6)
21810* Coarray, _gfortran_caf_atomic_cas:     _gfortran_caf_atomic_cas.
21811                                                              (line   6)
21812* Coarray, _gfortran_caf_atomic_define:  _gfortran_caf_atomic_define.
21813                                                              (line   6)
21814* Coarray, _gfortran_caf_atomic_op:      _gfortran_caf_atomic_op.
21815                                                              (line   6)
21816* Coarray, _gfortran_caf_atomic_ref:     _gfortran_caf_atomic_ref.
21817                                                              (line   6)
21818* Coarray, _gfortran_caf_co_broadcast:   _gfortran_caf_co_broadcast.
21819                                                              (line   6)
21820* Coarray, _gfortran_caf_co_max:         _gfortran_caf_co_max.
21821                                                              (line   6)
21822* Coarray, _gfortran_caf_co_min:         _gfortran_caf_co_min.
21823                                                              (line   6)
21824* Coarray, _gfortran_caf_co_reduce:      _gfortran_caf_co_reduce.
21825                                                              (line   6)
21826* Coarray, _gfortran_caf_co_sum:         _gfortran_caf_co_sum.
21827                                                              (line   6)
21828* Coarray, _gfortran_caf_deregister:     _gfortran_caf_deregister.
21829                                                              (line   6)
21830* Coarray, _gfortran_caf_error_stop:     _gfortran_caf_error_stop.
21831                                                              (line   6)
21832* Coarray, _gfortran_caf_error_stop_str: _gfortran_caf_error_stop_str.
21833                                                              (line   6)
21834* Coarray, _gfortran_caf_event_post:     _gfortran_caf_event_post.
21835                                                              (line   6)
21836* Coarray, _gfortran_caf_event_query:    _gfortran_caf_event_query.
21837                                                              (line   6)
21838* Coarray, _gfortran_caf_event_wait:     _gfortran_caf_event_wait.
21839                                                              (line   6)
21840* Coarray, _gfortran_caf_failed_images:  _gfortran_caf_failed_images.
21841                                                              (line   6)
21842* Coarray, _gfortran_caf_fail_image:     _gfortran_caf_fail_image.
21843                                                              (line   6)
21844* Coarray, _gfortran_caf_finish:         _gfortran_caf_finish.
21845                                                              (line   6)
21846* Coarray, _gfortran_caf_get:            _gfortran_caf_get.   (line   6)
21847* Coarray, _gfortran_caf_get_by_ref:     _gfortran_caf_get_by_ref.
21848                                                              (line   6)
21849* Coarray, _gfortran_caf_image_status:   _gfortran_caf_image_status.
21850                                                              (line   6)
21851* Coarray, _gfortran_caf_init:           _gfortran_caf_init.  (line   6)
21852* Coarray, _gfortran_caf_is_present:     _gfortran_caf_is_present.
21853                                                              (line   6)
21854* Coarray, _gfortran_caf_lock:           _gfortran_caf_lock.  (line   6)
21855* Coarray, _gfortran_caf_num_images:     _gfortran_caf_num_images.
21856                                                              (line   6)
21857* Coarray, _gfortran_caf_register:       _gfortran_caf_register.
21858                                                              (line   6)
21859* Coarray, _gfortran_caf_send:           _gfortran_caf_send.  (line   6)
21860* Coarray, _gfortran_caf_sendget:        _gfortran_caf_sendget.
21861                                                              (line   6)
21862* Coarray, _gfortran_caf_sendget_by_ref: _gfortran_caf_sendget_by_ref.
21863                                                              (line   6)
21864* Coarray, _gfortran_caf_send_by_ref:    _gfortran_caf_send_by_ref.
21865                                                              (line   6)
21866* Coarray, _gfortran_caf_stopped_images: _gfortran_caf_stopped_images.
21867                                                              (line   6)
21868* Coarray, _gfortran_caf_sync_all:       _gfortran_caf_sync_all.
21869                                                              (line   6)
21870* Coarray, _gfortran_caf_sync_images:    _gfortran_caf_sync_images.
21871                                                              (line   6)
21872* Coarray, _gfortran_caf_sync_memory:    _gfortran_caf_sync_memory.
21873                                                              (line   6)
21874* Coarray, _gfortran_caf_this_image:     _gfortran_caf_this_image.
21875                                                              (line   6)
21876* Coarray, _gfortran_caf_unlock:         _gfortran_caf_unlock.
21877                                                              (line   6)
21878* coarrays:                              Code Gen Options.    (line 130)
21879* Coarrays:                              Coarray Programming. (line   6)
21880* code generation, conventions:          Code Gen Options.    (line   6)
21881* collating sequence, ASCII:             ACHAR.               (line   6)
21882* collating sequence, ASCII <1>:         IACHAR.              (line   6)
21883* Collectives, generic reduction:        CO_REDUCE.           (line   6)
21884* Collectives, maximal value:            CO_MAX.              (line   6)
21885* Collectives, minimal value:            CO_MIN.              (line   6)
21886* Collectives, sum of values:            CO_SUM.              (line   6)
21887* Collectives, value broadcasting:       CO_BROADCAST.        (line   6)
21888* command line:                          EXECUTE_COMMAND_LINE.
21889                                                              (line   6)
21890* command options:                       Invoking GNU Fortran.
21891                                                              (line   6)
21892* command-line arguments:                COMMAND_ARGUMENT_COUNT.
21893                                                              (line   6)
21894* command-line arguments <1>:            GETARG.              (line   6)
21895* command-line arguments <2>:            GET_COMMAND.         (line   6)
21896* command-line arguments <3>:            GET_COMMAND_ARGUMENT.
21897                                                              (line   6)
21898* command-line arguments <4>:            IARGC.               (line   6)
21899* command-line arguments, number of:     COMMAND_ARGUMENT_COUNT.
21900                                                              (line   6)
21901* command-line arguments, number of <1>: IARGC.               (line   6)
21902* COMMAND_ARGUMENT_COUNT:                COMMAND_ARGUMENT_COUNT.
21903                                                              (line   6)
21904* COMMON:                                Volatile COMMON blocks.
21905                                                              (line   6)
21906* compiler flags inquiry function:       COMPILER_OPTIONS.    (line   6)
21907* compiler, name and version:            COMPILER_VERSION.    (line   6)
21908* COMPILER_OPTIONS:                      COMPILER_OPTIONS.    (line   6)
21909* COMPILER_VERSION:                      COMPILER_VERSION.    (line   6)
21910* COMPLEX:                               COMPLEX.             (line   6)
21911* complex conjugate:                     CONJG.               (line   6)
21912* Complex function:                      Alternate complex function syntax.
21913                                                              (line   6)
21914* complex numbers, conversion to:        CMPLX.               (line   6)
21915* complex numbers, conversion to <1>:    COMPLEX.             (line   6)
21916* complex numbers, conversion to <2>:    DCMPLX.              (line   6)
21917* complex numbers, imaginary part:       AIMAG.               (line   6)
21918* complex numbers, real part:            DREAL.               (line   6)
21919* complex numbers, real part <1>:        REAL.                (line   6)
21920* Conditional compilation:               Preprocessing and conditional compilation.
21921                                                              (line   6)
21922* CONJG:                                 CONJG.               (line   6)
21923* consistency, durability:               Data consistency and durability.
21924                                                              (line   6)
21925* Contributing:                          Contributing.        (line   6)
21926* Contributors:                          Contributors.        (line   6)
21927* conversion:                            Error and Warning Options.
21928                                                              (line 122)
21929* conversion <1>:                        Error and Warning Options.
21930                                                              (line 126)
21931* conversion, to character:              CHAR.                (line   6)
21932* conversion, to complex:                CMPLX.               (line   6)
21933* conversion, to complex <1>:            COMPLEX.             (line   6)
21934* conversion, to complex <2>:            DCMPLX.              (line   6)
21935* conversion, to integer:                Implicitly convert LOGICAL and INTEGER values.
21936                                                              (line   6)
21937* conversion, to integer <1>:            IACHAR.              (line   6)
21938* conversion, to integer <2>:            ICHAR.               (line   6)
21939* conversion, to integer <3>:            INT.                 (line   6)
21940* conversion, to integer <4>:            INT2.                (line   6)
21941* conversion, to integer <5>:            INT8.                (line   6)
21942* conversion, to integer <6>:            LONG.                (line   6)
21943* conversion, to logical:                Implicitly convert LOGICAL and INTEGER values.
21944                                                              (line   6)
21945* conversion, to logical <1>:            LOGICAL.             (line   6)
21946* conversion, to real:                   DBLE.                (line   6)
21947* conversion, to real <1>:               REAL.                (line   6)
21948* conversion, to string:                 CTIME.               (line   6)
21949* CONVERT specifier:                     CONVERT specifier.   (line   6)
21950* core, dump:                            ABORT.               (line   6)
21951* COS:                                   COS.                 (line   6)
21952* COSD:                                  COSD.                (line   6)
21953* COSH:                                  COSH.                (line   6)
21954* cosine:                                COS.                 (line   6)
21955* cosine, degrees:                       COSD.                (line   6)
21956* cosine, hyperbolic:                    COSH.                (line   6)
21957* cosine, hyperbolic, inverse:           ACOSH.               (line   6)
21958* cosine, inverse:                       ACOS.                (line   6)
21959* cosine, inverse, degrees:              ACOSD.               (line   6)
21960* COTAN:                                 COTAN.               (line   6)
21961* COTAND:                                COTAND.              (line   6)
21962* cotangent:                             COTAN.               (line   6)
21963* cotangent, degrees:                    COTAND.              (line   6)
21964* COUNT:                                 COUNT.               (line   6)
21965* CO_BROADCAST:                          CO_BROADCAST.        (line   6)
21966* CO_MAX:                                CO_MAX.              (line   6)
21967* CO_MIN:                                CO_MIN.              (line   6)
21968* CO_REDUCE:                             CO_REDUCE.           (line   6)
21969* CO_SUM:                                CO_SUM.              (line   6)
21970* CPP:                                   Preprocessing and conditional compilation.
21971                                                              (line   6)
21972* CPP <1>:                               Preprocessing Options.
21973                                                              (line   6)
21974* CPU_TIME:                              CPU_TIME.            (line   6)
21975* Credits:                               Contributors.        (line   6)
21976* CSHIFT:                                CSHIFT.              (line   6)
21977* CSIN:                                  SIN.                 (line   6)
21978* CSIND:                                 SIND.                (line   6)
21979* CSQRT:                                 SQRT.                (line   6)
21980* CTIME:                                 CTIME.               (line   6)
21981* current date:                          DATE_AND_TIME.       (line   6)
21982* current date <1>:                      FDATE.               (line   6)
21983* current date <2>:                      IDATE.               (line   6)
21984* current time:                          DATE_AND_TIME.       (line   6)
21985* current time <1>:                      FDATE.               (line   6)
21986* current time <2>:                      ITIME.               (line   6)
21987* current time <3>:                      TIME.                (line   6)
21988* current time <4>:                      TIME8.               (line   6)
21989* C_ASSOCIATED:                          C_ASSOCIATED.        (line   6)
21990* C_FUNLOC:                              C_FUNLOC.            (line   6)
21991* C_F_POINTER:                           C_F_POINTER.         (line   6)
21992* C_F_PROCPOINTER:                       C_F_PROCPOINTER.     (line   6)
21993* C_LOC:                                 C_LOC.               (line   6)
21994* C_SIZEOF:                              C_SIZEOF.            (line   6)
21995* DABS:                                  ABS.                 (line   6)
21996* DACOS:                                 ACOS.                (line   6)
21997* DACOSD:                                ACOSD.               (line   6)
21998* DACOSH:                                ACOSH.               (line   6)
21999* DASIN:                                 ASIN.                (line   6)
22000* DASIND:                                ASIND.               (line   6)
22001* DASINH:                                ASINH.               (line   6)
22002* DATAN:                                 ATAN.                (line   6)
22003* DATAN2:                                ATAN2.               (line   6)
22004* DATAN2D:                               ATAN2D.              (line   6)
22005* DATAND:                                ATAND.               (line   6)
22006* DATANH:                                ATANH.               (line   6)
22007* date, current:                         DATE_AND_TIME.       (line   6)
22008* date, current <1>:                     FDATE.               (line   6)
22009* date, current <2>:                     IDATE.               (line   6)
22010* DATE_AND_TIME:                         DATE_AND_TIME.       (line   6)
22011* DBESJ0:                                BESSEL_J0.           (line   6)
22012* DBESJ1:                                BESSEL_J1.           (line   6)
22013* DBESJN:                                BESSEL_JN.           (line   6)
22014* DBESY0:                                BESSEL_Y0.           (line   6)
22015* DBESY1:                                BESSEL_Y1.           (line   6)
22016* DBESYN:                                BESSEL_YN.           (line   6)
22017* DBLE:                                  DBLE.                (line   6)
22018* DCMPLX:                                DCMPLX.              (line   6)
22019* DCONJG:                                CONJG.               (line   6)
22020* DCOS:                                  COS.                 (line   6)
22021* DCOSD:                                 COSD.                (line   6)
22022* DCOSH:                                 COSH.                (line   6)
22023* DCOTAN:                                COTAN.               (line   6)
22024* DCOTAND:                               COTAND.              (line   6)
22025* DDIM:                                  DIM.                 (line   6)
22026* debugging information options:         Debugging Options.   (line   6)
22027* debugging, preprocessor:               Preprocessing Options.
22028                                                              (line  26)
22029* debugging, preprocessor <1>:           Preprocessing Options.
22030                                                              (line  35)
22031* debugging, preprocessor <2>:           Preprocessing Options.
22032                                                              (line  41)
22033* debugging, preprocessor <3>:           Preprocessing Options.
22034                                                              (line  44)
22035* debugging, preprocessor <4>:           Preprocessing Options.
22036                                                              (line  51)
22037* DECODE:                                ENCODE and DECODE statements.
22038                                                              (line   6)
22039* delayed execution:                     ALARM.               (line   6)
22040* delayed execution <1>:                 SLEEP.               (line   6)
22041* DEXP:                                  EXP.                 (line   6)
22042* DFLOAT:                                REAL.                (line   6)
22043* DGAMMA:                                GAMMA.               (line   6)
22044* dialect options:                       Fortran Dialect Options.
22045                                                              (line   6)
22046* DIGITS:                                DIGITS.              (line   6)
22047* DIM:                                   DIM.                 (line   6)
22048* DIMAG:                                 AIMAG.               (line   6)
22049* DINT:                                  AINT.                (line   6)
22050* directive, INCLUDE:                    Directory Options.   (line   6)
22051* directory, options:                    Directory Options.   (line   6)
22052* directory, search paths for inclusion: Directory Options.   (line  14)
22053* division, modulo:                      MODULO.              (line   6)
22054* division, remainder:                   MOD.                 (line   6)
22055* DLGAMA:                                LOG_GAMMA.           (line   6)
22056* DLOG:                                  LOG.                 (line   6)
22057* DLOG10:                                LOG10.               (line   6)
22058* DMAX1:                                 MAX.                 (line   6)
22059* DMIN1:                                 MIN.                 (line   6)
22060* DMOD:                                  MOD.                 (line   6)
22061* DNINT:                                 ANINT.               (line   6)
22062* dot product:                           DOT_PRODUCT.         (line   6)
22063* DOT_PRODUCT:                           DOT_PRODUCT.         (line   6)
22064* DPROD:                                 DPROD.               (line   6)
22065* DREAL:                                 DREAL.               (line   6)
22066* DSHIFTL:                               DSHIFTL.             (line   6)
22067* DSHIFTR:                               DSHIFTR.             (line   6)
22068* DSIGN:                                 SIGN.                (line   6)
22069* DSIN:                                  SIN.                 (line   6)
22070* DSIND:                                 SIND.                (line   6)
22071* DSINH:                                 SINH.                (line   6)
22072* DSQRT:                                 SQRT.                (line   6)
22073* DTAN:                                  TAN.                 (line   6)
22074* DTAND:                                 TAND.                (line   6)
22075* DTANH:                                 TANH.                (line   6)
22076* DTIME:                                 DTIME.               (line   6)
22077* dummy argument, unused:                Error and Warning Options.
22078                                                              (line 215)
22079* elapsed time:                          DTIME.               (line   6)
22080* elapsed time <1>:                      SECNDS.              (line   6)
22081* elapsed time <2>:                      SECOND.              (line   6)
22082* Elimination of functions with identical argument lists: Code Gen Options.
22083                                                              (line 406)
22084* ENCODE:                                ENCODE and DECODE statements.
22085                                                              (line   6)
22086* ENUM statement:                        Fortran 2003 status. (line  92)
22087* ENUMERATOR statement:                  Fortran 2003 status. (line  92)
22088* environment variable:                  Environment Variables.
22089                                                              (line   6)
22090* environment variable <1>:              Runtime.             (line   6)
22091* environment variable <2>:              GETENV.              (line   6)
22092* environment variable <3>:              GET_ENVIRONMENT_VARIABLE.
22093                                                              (line   6)
22094* EOF:                                   Read/Write after EOF marker.
22095                                                              (line   6)
22096* EOSHIFT:                               EOSHIFT.             (line   6)
22097* EPSILON:                               EPSILON.             (line   6)
22098* ERF:                                   ERF.                 (line   6)
22099* ERFC:                                  ERFC.                (line   6)
22100* ERFC_SCALED:                           ERFC_SCALED.         (line   6)
22101* error function:                        ERF.                 (line   6)
22102* error function, complementary:         ERFC.                (line   6)
22103* error function, complementary, exponentially-scaled: ERFC_SCALED.
22104                                                              (line   6)
22105* errors, limiting:                      Error and Warning Options.
22106                                                              (line  27)
22107* escape characters:                     Fortran Dialect Options.
22108                                                              (line  79)
22109* ETIME:                                 ETIME.               (line   6)
22110* Euclidean distance:                    HYPOT.               (line   6)
22111* Euclidean vector norm:                 NORM2.               (line   6)
22112* Events, EVENT_QUERY:                   EVENT_QUERY.         (line   6)
22113* EVENT_QUERY:                           EVENT_QUERY.         (line   6)
22114* EXECUTE_COMMAND_LINE:                  EXECUTE_COMMAND_LINE.
22115                                                              (line   6)
22116* EXIT:                                  EXIT.                (line   6)
22117* EXP:                                   EXP.                 (line   6)
22118* EXPONENT:                              EXPONENT.            (line   6)
22119* exponent:                              Default exponents.   (line   6)
22120* exponential function:                  EXP.                 (line   6)
22121* exponential function, inverse:         LOG.                 (line   6)
22122* exponential function, inverse <1>:     LOG10.               (line   6)
22123* expression size:                       C_SIZEOF.            (line   6)
22124* expression size <1>:                   SIZEOF.              (line   6)
22125* EXTENDS_TYPE_OF:                       EXTENDS_TYPE_OF.     (line   6)
22126* extensions:                            Extensions.          (line   6)
22127* extensions, implemented:               Extensions implemented in GNU Fortran.
22128                                                              (line   6)
22129* extensions, not implemented:           Extensions not implemented in GNU Fortran.
22130                                                              (line   6)
22131* extra warnings:                        Error and Warning Options.
22132                                                              (line 130)
22133* f2c calling convention:                Code Gen Options.    (line  28)
22134* f2c calling convention <1>:            Code Gen Options.    (line 113)
22135* Factorial function:                    GAMMA.               (line   6)
22136* FDATE:                                 FDATE.               (line   6)
22137* FDL, GNU Free Documentation License:   GNU Free Documentation License.
22138                                                              (line   6)
22139* FGET:                                  FGET.                (line   6)
22140* FGETC:                                 FGETC.               (line   6)
22141* file format, fixed:                    Fortran Dialect Options.
22142                                                              (line  11)
22143* file format, fixed <1>:                Fortran Dialect Options.
22144                                                              (line  96)
22145* file format, free:                     Fortran Dialect Options.
22146                                                              (line  11)
22147* file format, free <1>:                 Fortran Dialect Options.
22148                                                              (line 118)
22149* file operation, file number:           FNUM.                (line   6)
22150* file operation, flush:                 FLUSH.               (line   6)
22151* file operation, position:              FSEEK.               (line   6)
22152* file operation, position <1>:          FTELL.               (line   6)
22153* file operation, read character:        FGET.                (line   6)
22154* file operation, read character <1>:    FGETC.               (line   6)
22155* file operation, seek:                  FSEEK.               (line   6)
22156* file operation, write character:       FPUT.                (line   6)
22157* file operation, write character <1>:   FPUTC.               (line   6)
22158* file system, access mode:              ACCESS.              (line   6)
22159* file system, change access mode:       CHMOD.               (line   6)
22160* file system, create link:              LINK.                (line   6)
22161* file system, create link <1>:          SYMLNK.              (line   6)
22162* file system, file creation mask:       UMASK.               (line   6)
22163* file system, file status:              FSTAT.               (line   6)
22164* file system, file status <1>:          LSTAT.               (line   6)
22165* file system, file status <2>:          STAT.                (line   6)
22166* file system, hard link:                LINK.                (line   6)
22167* file system, remove file:              UNLINK.              (line   6)
22168* file system, rename file:              RENAME.              (line   6)
22169* file system, soft link:                SYMLNK.              (line   6)
22170* file, symbolic link:                   File operations on symbolic links.
22171                                                              (line   6)
22172* file, unformatted sequential:          File format of unformatted sequential files.
22173                                                              (line   6)
22174* FINDLOC:                               FINDLOC.             (line   6)
22175* findloc:                               FINDLOC.             (line   6)
22176* flags inquiry function:                COMPILER_OPTIONS.    (line   6)
22177* FLOAT:                                 REAL.                (line   6)
22178* FLOATI:                                REAL.                (line   6)
22179* floating point, exponent:              EXPONENT.            (line   6)
22180* floating point, fraction:              FRACTION.            (line   6)
22181* floating point, nearest different:     NEAREST.             (line   6)
22182* floating point, relative spacing:      RRSPACING.           (line   6)
22183* floating point, relative spacing <1>:  SPACING.             (line   6)
22184* floating point, scale:                 SCALE.               (line   6)
22185* floating point, set exponent:          SET_EXPONENT.        (line   6)
22186* FLOATJ:                                REAL.                (line   6)
22187* FLOATK:                                REAL.                (line   6)
22188* FLOOR:                                 FLOOR.               (line   6)
22189* floor:                                 AINT.                (line   6)
22190* floor <1>:                             FLOOR.               (line   6)
22191* FLUSH:                                 FLUSH.               (line   6)
22192* FLUSH statement:                       Fortran 2003 status. (line  88)
22193* FNUM:                                  FNUM.                (line   6)
22194* form feed whitespace:                  Form feed as whitespace.
22195                                                              (line   6)
22196* FORMAT:                                Variable FORMAT expressions.
22197                                                              (line   6)
22198* Fortran 77:                            GNU Fortran and G77. (line   6)
22199* FPP:                                   Preprocessing and conditional compilation.
22200                                                              (line   6)
22201* FPUT:                                  FPUT.                (line   6)
22202* FPUTC:                                 FPUTC.               (line   6)
22203* FRACTION:                              FRACTION.            (line   6)
22204* FREE:                                  FREE.                (line   6)
22205* Front-end optimization:                Code Gen Options.    (line 414)
22206* FSEEK:                                 FSEEK.               (line   6)
22207* FSTAT:                                 FSTAT.               (line   6)
22208* FTELL:                                 FTELL.               (line   6)
22209* function elimination:                  Error and Warning Options.
22210                                                              (line 232)
22211* g77:                                   GNU Fortran and G77. (line   6)
22212* g77 calling convention:                Code Gen Options.    (line  28)
22213* g77 calling convention <1>:            Code Gen Options.    (line 113)
22214* GAMMA:                                 GAMMA.               (line   6)
22215* Gamma function:                        GAMMA.               (line   6)
22216* Gamma function, logarithm of:          LOG_GAMMA.           (line   6)
22217* GCC:                                   GNU Fortran and GCC. (line   6)
22218* Generating C prototypes from external procedures: Interoperability Options.
22219                                                              (line  25)
22220* Generating C prototypes from Fortran BIND(C) enteties: Interoperability Options.
22221                                                              (line   7)
22222* GERROR:                                GERROR.              (line   6)
22223* GETARG:                                GETARG.              (line   6)
22224* GETCWD:                                GETCWD.              (line   6)
22225* GETENV:                                GETENV.              (line   6)
22226* GETGID:                                GETGID.              (line   6)
22227* GETLOG:                                GETLOG.              (line   6)
22228* GETPID:                                GETPID.              (line   6)
22229* GETUID:                                GETUID.              (line   6)
22230* GET_COMMAND:                           GET_COMMAND.         (line   6)
22231* GET_COMMAND_ARGUMENT:                  GET_COMMAND_ARGUMENT.
22232                                                              (line   6)
22233* GET_ENVIRONMENT_VARIABLE:              GET_ENVIRONMENT_VARIABLE.
22234                                                              (line   6)
22235* GMTIME:                                GMTIME.              (line   6)
22236* GNU Compiler Collection:               GNU Fortran and GCC. (line   6)
22237* GNU Fortran command options:           Invoking GNU Fortran.
22238                                                              (line   6)
22239* Hollerith constants:                   Hollerith constants support.
22240                                                              (line   6)
22241* HOSTNM:                                HOSTNM.              (line   6)
22242* HUGE:                                  HUGE.                (line   6)
22243* hyperbolic cosine:                     COSH.                (line   6)
22244* hyperbolic function, cosine:           COSH.                (line   6)
22245* hyperbolic function, cosine, inverse:  ACOSH.               (line   6)
22246* hyperbolic function, sine:             SINH.                (line   6)
22247* hyperbolic function, sine, inverse:    ASINH.               (line   6)
22248* hyperbolic function, tangent:          TANH.                (line   6)
22249* hyperbolic function, tangent, inverse: ATANH.               (line   6)
22250* hyperbolic sine:                       SINH.                (line   6)
22251* hyperbolic tangent:                    TANH.                (line   6)
22252* HYPOT:                                 HYPOT.               (line   6)
22253* I/O item lists:                        I/O item lists.      (line   6)
22254* I/O specifiers:                        Extended I/O specifiers.
22255                                                              (line   6)
22256* IABS:                                  ABS.                 (line   6)
22257* IACHAR:                                IACHAR.              (line   6)
22258* IALL:                                  IALL.                (line   6)
22259* IAND:                                  IAND.                (line   6)
22260* IANY:                                  IANY.                (line   6)
22261* IARGC:                                 IARGC.               (line   6)
22262* IBCLR:                                 IBCLR.               (line   6)
22263* IBITS:                                 IBITS.               (line   6)
22264* IBSET:                                 IBSET.               (line   6)
22265* ICHAR:                                 ICHAR.               (line   6)
22266* IDATE:                                 IDATE.               (line   6)
22267* IDIM:                                  DIM.                 (line   6)
22268* IDINT:                                 INT.                 (line   6)
22269* IDNINT:                                NINT.                (line   6)
22270* IEEE, ISNAN:                           ISNAN.               (line   6)
22271* IEOR:                                  IEOR.                (line   6)
22272* IERRNO:                                IERRNO.              (line   6)
22273* IFIX:                                  INT.                 (line   6)
22274* IIABS:                                 ABS.                 (line   6)
22275* IIAND:                                 IAND.                (line   6)
22276* IIBCLR:                                IBCLR.               (line   6)
22277* IIBITS:                                IBITS.               (line   6)
22278* IIBSET:                                IBSET.               (line   6)
22279* IIEOR:                                 IEOR.                (line   6)
22280* IIOR:                                  IOR.                 (line   6)
22281* IISHFT:                                ISHFT.               (line   6)
22282* IISHFTC:                               ISHFTC.              (line   6)
22283* IMAG:                                  AIMAG.               (line   6)
22284* images, cosubscript to image index conversion: IMAGE_INDEX. (line   6)
22285* images, index of this image:           THIS_IMAGE.          (line   6)
22286* images, number of:                     NUM_IMAGES.          (line   6)
22287* IMAGE_INDEX:                           IMAGE_INDEX.         (line   6)
22288* IMAGPART:                              AIMAG.               (line   6)
22289* IMOD:                                  MOD.                 (line   6)
22290* IMPORT statement:                      Fortran 2003 status. (line 119)
22291* IMVBITS:                               MVBITS.              (line   6)
22292* INCLUDE directive:                     Directory Options.   (line   6)
22293* inclusion, directory search paths for: Directory Options.   (line  14)
22294* INDEX:                                 INDEX intrinsic.     (line   6)
22295* INOT:                                  NOT.                 (line   6)
22296* input/output, asynchronous:            Asynchronous I/O.    (line   6)
22297* INT:                                   INT.                 (line   6)
22298* INT2:                                  INT2.                (line   6)
22299* INT8:                                  INT8.                (line   6)
22300* integer kind:                          SELECTED_INT_KIND.   (line   6)
22301* Interoperability:                      Mixed-Language Programming.
22302                                                              (line   6)
22303* intrinsic:                             Error and Warning Options.
22304                                                              (line 204)
22305* intrinsic <1>:                         Error and Warning Options.
22306                                                              (line 211)
22307* intrinsic Modules:                     Intrinsic Modules.   (line   6)
22308* intrinsic procedures:                  Intrinsic Procedures.
22309                                                              (line   6)
22310* intrinsics, integer:                   Type variants for integer intrinsics.
22311                                                              (line   6)
22312* intrinsics, math:                      Extended math intrinsics.
22313                                                              (line   6)
22314* intrinsics, trigonometric functions:   Extended math intrinsics.
22315                                                              (line   6)
22316* Introduction:                          Top.                 (line   6)
22317* inverse hyperbolic cosine:             ACOSH.               (line   6)
22318* inverse hyperbolic sine:               ASINH.               (line   6)
22319* inverse hyperbolic tangent:            ATANH.               (line   6)
22320* IOMSG= specifier:                      Fortran 2003 status. (line  90)
22321* IOR:                                   IOR.                 (line   6)
22322* IOSTAT, end of file:                   IS_IOSTAT_END.       (line   6)
22323* IOSTAT, end of record:                 IS_IOSTAT_EOR.       (line   6)
22324* IPARITY:                               IPARITY.             (line   6)
22325* IRAND:                                 IRAND.               (line   6)
22326* ISATTY:                                ISATTY.              (line   6)
22327* ISHFT:                                 ISHFT.               (line   6)
22328* ISHFTC:                                ISHFTC.              (line   6)
22329* ISIGN:                                 SIGN.                (line   6)
22330* ISNAN:                                 ISNAN.               (line   6)
22331* ISO_FORTRAN_ENV statement:             Fortran 2003 status. (line 127)
22332* IS_IOSTAT_END:                         IS_IOSTAT_END.       (line   6)
22333* IS_IOSTAT_EOR:                         IS_CONTIGUOUS.       (line   6)
22334* IS_IOSTAT_EOR <1>:                     IS_IOSTAT_EOR.       (line   6)
22335* ITIME:                                 ITIME.               (line   6)
22336* JIABS:                                 ABS.                 (line   6)
22337* JIAND:                                 IAND.                (line   6)
22338* JIBCLR:                                IBCLR.               (line   6)
22339* JIBITS:                                IBITS.               (line   6)
22340* JIBSET:                                IBSET.               (line   6)
22341* JIEOR:                                 IEOR.                (line   6)
22342* JIOR:                                  IOR.                 (line   6)
22343* JISHFT:                                ISHFT.               (line   6)
22344* JISHFTC:                               ISHFTC.              (line   6)
22345* JMOD:                                  MOD.                 (line   6)
22346* JMVBITS:                               MVBITS.              (line   6)
22347* JNOT:                                  NOT.                 (line   6)
22348* KIABS:                                 ABS.                 (line   6)
22349* KIAND:                                 IAND.                (line   6)
22350* KIBCLR:                                IBCLR.               (line   6)
22351* KIBITS:                                IBITS.               (line   6)
22352* KIBSET:                                IBSET.               (line   6)
22353* KIEOR:                                 IEOR.                (line   6)
22354* KILL:                                  KILL.                (line   6)
22355* kind:                                  KIND Type Parameters.
22356                                                              (line   6)
22357* KIND:                                  KIND.                (line   6)
22358* kind <1>:                              KIND.                (line   6)
22359* kind, character:                       SELECTED_CHAR_KIND.  (line   6)
22360* kind, integer:                         SELECTED_INT_KIND.   (line   6)
22361* kind, old-style:                       Old-style kind specifications.
22362                                                              (line   6)
22363* kind, real:                            SELECTED_REAL_KIND.  (line   6)
22364* KIOR:                                  IOR.                 (line   6)
22365* KISHFT:                                ISHFT.               (line   6)
22366* KISHFTC:                               ISHFTC.              (line   6)
22367* KMOD:                                  MOD.                 (line   6)
22368* KMVBITS:                               MVBITS.              (line   6)
22369* KNOT:                                  NOT.                 (line   6)
22370* L2 vector norm:                        NORM2.               (line   6)
22371* language, dialect options:             Fortran Dialect Options.
22372                                                              (line   6)
22373* LBOUND:                                LBOUND.              (line   6)
22374* LCOBOUND:                              LCOBOUND.            (line   6)
22375* LEADZ:                                 LEADZ.               (line   6)
22376* left shift, combined:                  DSHIFTL.             (line   6)
22377* LEN:                                   LEN.                 (line   6)
22378* LEN_TRIM:                              LEN_TRIM.            (line   6)
22379* lexical comparison of strings:         LGE.                 (line   6)
22380* lexical comparison of strings <1>:     LGT.                 (line   6)
22381* lexical comparison of strings <2>:     LLE.                 (line   6)
22382* lexical comparison of strings <3>:     LLT.                 (line   6)
22383* LGAMMA:                                LOG_GAMMA.           (line   6)
22384* LGE:                                   LGE.                 (line   6)
22385* LGT:                                   LGT.                 (line   6)
22386* libf2c calling convention:             Code Gen Options.    (line  28)
22387* libf2c calling convention <1>:         Code Gen Options.    (line 113)
22388* libgfortran initialization, set_args:  _gfortran_set_args.  (line   6)
22389* libgfortran initialization, set_convert: _gfortran_set_convert.
22390                                                              (line   6)
22391* libgfortran initialization, set_fpe:   _gfortran_set_fpe.   (line   6)
22392* libgfortran initialization, set_max_subrecord_length: _gfortran_set_max_subrecord_length.
22393                                                              (line   6)
22394* libgfortran initialization, set_options: _gfortran_set_options.
22395                                                              (line   6)
22396* libgfortran initialization, set_record_marker: _gfortran_set_record_marker.
22397                                                              (line   6)
22398* limits, largest number:                HUGE.                (line   6)
22399* limits, smallest number:               TINY.                (line   6)
22400* LINK:                                  LINK.                (line   6)
22401* linking, static:                       Link Options.        (line   6)
22402* LLE:                                   LLE.                 (line   6)
22403* LLT:                                   LLT.                 (line   6)
22404* LNBLNK:                                LNBLNK.              (line   6)
22405* LOC:                                   %LOC as an rvalue.   (line   6)
22406* LOC <1>:                               LOC.                 (line   6)
22407* location of a variable in memory:      LOC.                 (line   6)
22408* LOG:                                   LOG.                 (line   6)
22409* LOG10:                                 LOG10.               (line   6)
22410* logarithm function:                    LOG.                 (line   6)
22411* logarithm function with base 10:       LOG10.               (line   6)
22412* logarithm function, inverse:           EXP.                 (line   6)
22413* LOGICAL:                               LOGICAL.             (line   6)
22414* logical and, bitwise:                  AND.                 (line   6)
22415* logical and, bitwise <1>:              IAND.                (line   6)
22416* logical exclusive or, bitwise:         IEOR.                (line   6)
22417* logical exclusive or, bitwise <1>:     XOR.                 (line   6)
22418* logical not, bitwise:                  NOT.                 (line   6)
22419* logical or, bitwise:                   IOR.                 (line   6)
22420* logical or, bitwise <1>:               OR.                  (line   6)
22421* logical, bitwise:                      Bitwise logical operators.
22422                                                              (line   6)
22423* logical, variable representation:      Internal representation of LOGICAL variables.
22424                                                              (line   6)
22425* login name:                            GETLOG.              (line   6)
22426* LOG_GAMMA:                             LOG_GAMMA.           (line   6)
22427* LONG:                                  LONG.                (line   6)
22428* loop interchange, Fortran:             Code Gen Options.    (line 427)
22429* loop interchange, warning:             Error and Warning Options.
22430                                                              (line 135)
22431* LSHIFT:                                LSHIFT.              (line   6)
22432* LSTAT:                                 LSTAT.               (line   6)
22433* LTIME:                                 LTIME.               (line   6)
22434* MALLOC:                                MALLOC.              (line   6)
22435* MAP:                                   UNION and MAP.       (line   6)
22436* mask, left justified:                  MASKL.               (line   6)
22437* mask, right justified:                 MASKR.               (line   6)
22438* MASKL:                                 MASKL.               (line   6)
22439* MASKR:                                 MASKR.               (line   6)
22440* MATMUL:                                MATMUL.              (line   6)
22441* matrix multiplication:                 MATMUL.              (line   6)
22442* matrix, transpose:                     TRANSPOSE.           (line   6)
22443* MAX:                                   MAX.                 (line   6)
22444* MAX, MIN, NaN:                         MAX and MIN intrinsics with REAL NaN arguments.
22445                                                              (line   6)
22446* MAX0:                                  MAX.                 (line   6)
22447* MAX1:                                  MAX.                 (line   6)
22448* MAXEXPONENT:                           MAXEXPONENT.         (line   6)
22449* maximum value:                         MAX.                 (line   6)
22450* maximum value <1>:                     MAXVAL.              (line   6)
22451* MAXLOC:                                MAXLOC.              (line   6)
22452* MAXVAL:                                MAXVAL.              (line   6)
22453* MCLOCK:                                MCLOCK.              (line   6)
22454* MCLOCK8:                               MCLOCK8.             (line   6)
22455* memory checking:                       Code Gen Options.    (line 144)
22456* MERGE:                                 MERGE.               (line   6)
22457* MERGE_BITS:                            MERGE_BITS.          (line   6)
22458* messages, error:                       Error and Warning Options.
22459                                                              (line   6)
22460* messages, warning:                     Error and Warning Options.
22461                                                              (line   6)
22462* MIN:                                   MIN.                 (line   6)
22463* MIN0:                                  MIN.                 (line   6)
22464* MIN1:                                  MIN.                 (line   6)
22465* MINEXPONENT:                           MINEXPONENT.         (line   6)
22466* minimum value:                         MIN.                 (line   6)
22467* minimum value <1>:                     MINVAL.              (line   6)
22468* MINLOC:                                MINLOC.              (line   6)
22469* MINVAL:                                MINVAL.              (line   6)
22470* Mixed-language programming:            Mixed-Language Programming.
22471                                                              (line   6)
22472* MOD:                                   MOD.                 (line   6)
22473* model representation, base:            RADIX.               (line   6)
22474* model representation, epsilon:         EPSILON.             (line   6)
22475* model representation, largest number:  HUGE.                (line   6)
22476* model representation, maximum exponent: MAXEXPONENT.        (line   6)
22477* model representation, minimum exponent: MINEXPONENT.        (line   6)
22478* model representation, precision:       PRECISION.           (line   6)
22479* model representation, radix:           RADIX.               (line   6)
22480* model representation, range:           RANGE.               (line   6)
22481* model representation, significant digits: DIGITS.           (line   6)
22482* model representation, smallest number: TINY.                (line   6)
22483* module entities:                       Fortran Dialect Options.
22484                                                              (line  91)
22485* module search path:                    Directory Options.   (line  14)
22486* module search path <1>:                Directory Options.   (line  29)
22487* module search path <2>:                Directory Options.   (line  36)
22488* MODULO:                                MODULO.              (line   6)
22489* modulo:                                MODULO.              (line   6)
22490* MOVE_ALLOC:                            MOVE_ALLOC.          (line   6)
22491* moving allocation:                     MOVE_ALLOC.          (line   6)
22492* multiply array elements:               PRODUCT.             (line   6)
22493* MVBITS:                                MVBITS.              (line   6)
22494* NAME:                                  OPEN( ... NAME=).    (line   6)
22495* Namelist:                              Extensions to namelist.
22496                                                              (line   6)
22497* natural logarithm function:            LOG.                 (line   6)
22498* NEAREST:                               NEAREST.             (line   6)
22499* newline:                               NEW_LINE.            (line   6)
22500* NEW_LINE:                              NEW_LINE.            (line   6)
22501* NINT:                                  NINT.                (line   6)
22502* norm, Euclidean:                       NORM2.               (line   6)
22503* NORM2:                                 NORM2.               (line   6)
22504* NOSHARED:                              Extended I/O specifiers.
22505                                                              (line   6)
22506* NOT:                                   NOT.                 (line   6)
22507* NULL:                                  NULL.                (line   6)
22508* NUM_IMAGES:                            NUM_IMAGES.          (line   6)
22509* open, action:                          Files opened without an explicit ACTION= specifier.
22510                                                              (line   6)
22511* OpenACC:                               Fortran Dialect Options.
22512                                                              (line 138)
22513* OpenACC <1>:                           OpenACC.             (line   6)
22514* OpenMP:                                Fortran Dialect Options.
22515                                                              (line 149)
22516* OpenMP <1>:                            OpenMP.              (line   6)
22517* operators, unary:                      Unary operators.     (line   6)
22518* operators, xor:                        .XOR. operator.      (line   6)
22519* options inquiry function:              COMPILER_OPTIONS.    (line   6)
22520* options, code generation:              Code Gen Options.    (line   6)
22521* options, debugging:                    Debugging Options.   (line   6)
22522* options, dialect:                      Fortran Dialect Options.
22523                                                              (line   6)
22524* options, directory search:             Directory Options.   (line   6)
22525* options, errors:                       Error and Warning Options.
22526                                                              (line   6)
22527* options, Fortran dialect:              Fortran Dialect Options.
22528                                                              (line  11)
22529* options, gfortran command:             Invoking GNU Fortran.
22530                                                              (line   6)
22531* options, linking:                      Link Options.        (line   6)
22532* options, negative forms:               Invoking GNU Fortran.
22533                                                              (line  13)
22534* options, preprocessor:                 Preprocessing Options.
22535                                                              (line   6)
22536* options, real kind type promotion:     Fortran Dialect Options.
22537                                                              (line 228)
22538* options, run-time:                     Code Gen Options.    (line   6)
22539* options, runtime:                      Runtime Options.     (line   6)
22540* options, warnings:                     Error and Warning Options.
22541                                                              (line   6)
22542* OR:                                    OR.                  (line   6)
22543* output, newline:                       NEW_LINE.            (line   6)
22544* PACK:                                  PACK.                (line   6)
22545* PARAMETER:                             Legacy PARAMETER statements.
22546                                                              (line   6)
22547* PARITY:                                PARITY.              (line   6)
22548* Parity:                                PARITY.              (line   6)
22549* parity:                                POPPAR.              (line   6)
22550* paths, search:                         Directory Options.   (line  14)
22551* paths, search <1>:                     Directory Options.   (line  29)
22552* paths, search <2>:                     Directory Options.   (line  36)
22553* PERROR:                                PERROR.              (line   6)
22554* pointer checking:                      Code Gen Options.    (line 144)
22555* pointer, C address of pointers:        C_F_PROCPOINTER.     (line   6)
22556* pointer, C address of procedures:      C_FUNLOC.            (line   6)
22557* pointer, C association status:         C_ASSOCIATED.        (line   6)
22558* pointer, convert C to Fortran:         C_F_POINTER.         (line   6)
22559* pointer, Cray:                         Cray pointers.       (line   6)
22560* pointer, cray:                         FREE.                (line   6)
22561* pointer, cray <1>:                     MALLOC.              (line   6)
22562* pointer, disassociated:                NULL.                (line   6)
22563* pointer, status:                       ASSOCIATED.          (line   6)
22564* pointer, status <1>:                   NULL.                (line   6)
22565* POPCNT:                                POPCNT.              (line   6)
22566* POPPAR:                                POPPAR.              (line   6)
22567* positive difference:                   DIM.                 (line   6)
22568* PRECISION:                             PRECISION.           (line   6)
22569* Preprocessing:                         Preprocessing and conditional compilation.
22570                                                              (line   6)
22571* preprocessing, assertion:              Preprocessing Options.
22572                                                              (line 113)
22573* preprocessing, assertion <1>:          Preprocessing Options.
22574                                                              (line 119)
22575* preprocessing, define macros:          Preprocessing Options.
22576                                                              (line 151)
22577* preprocessing, define macros <1>:      Preprocessing Options.
22578                                                              (line 154)
22579* preprocessing, include path:           Preprocessing Options.
22580                                                              (line  69)
22581* preprocessing, include path <1>:       Preprocessing Options.
22582                                                              (line  76)
22583* preprocessing, include path <2>:       Preprocessing Options.
22584                                                              (line  80)
22585* preprocessing, include path <3>:       Preprocessing Options.
22586                                                              (line  85)
22587* preprocessing, include path <4>:       Preprocessing Options.
22588                                                              (line  89)
22589* preprocessing, include path <5>:       Preprocessing Options.
22590                                                              (line  96)
22591* preprocessing, keep comments:          Preprocessing Options.
22592                                                              (line 122)
22593* preprocessing, keep comments <1>:      Preprocessing Options.
22594                                                              (line 137)
22595* preprocessing, no linemarkers:         Preprocessing Options.
22596                                                              (line 179)
22597* preprocessing, undefine macros:        Preprocessing Options.
22598                                                              (line 185)
22599* preprocessor:                          Preprocessing Options.
22600                                                              (line   6)
22601* preprocessor, debugging:               Preprocessing Options.
22602                                                              (line  26)
22603* preprocessor, debugging <1>:           Preprocessing Options.
22604                                                              (line  35)
22605* preprocessor, debugging <2>:           Preprocessing Options.
22606                                                              (line  41)
22607* preprocessor, debugging <3>:           Preprocessing Options.
22608                                                              (line  44)
22609* preprocessor, debugging <4>:           Preprocessing Options.
22610                                                              (line  51)
22611* preprocessor, disable:                 Preprocessing Options.
22612                                                              (line  12)
22613* preprocessor, enable:                  Preprocessing Options.
22614                                                              (line  12)
22615* preprocessor, include file handling:   Preprocessing and conditional compilation.
22616                                                              (line   6)
22617* preprocessor, working directory:       Preprocessing Options.
22618                                                              (line  55)
22619* PRESENT:                               PRESENT.             (line   6)
22620* private:                               Fortran Dialect Options.
22621                                                              (line  91)
22622* procedure pointer, convert C to Fortran: C_LOC.             (line   6)
22623* process ID:                            GETPID.              (line   6)
22624* PRODUCT:                               PRODUCT.             (line   6)
22625* product, double-precision:             DPROD.               (line   6)
22626* product, matrix:                       MATMUL.              (line   6)
22627* product, vector:                       DOT_PRODUCT.         (line   6)
22628* program termination:                   EXIT.                (line   6)
22629* program termination, with core dump:   ABORT.               (line   6)
22630* PROTECTED statement:                   Fortran 2003 status. (line 113)
22631* Q edit descriptor:                     Q edit descriptor.   (line   6)
22632* Q exponent-letter:                     Q exponent-letter.   (line   6)
22633* RADIX:                                 RADIX.               (line   6)
22634* radix, real:                           SELECTED_REAL_KIND.  (line   6)
22635* RAN:                                   RAN.                 (line   6)
22636* RAND:                                  RAND.                (line   6)
22637* random number generation:              IRAND.               (line   6)
22638* random number generation <1>:          RAN.                 (line   6)
22639* random number generation <2>:          RAND.                (line   6)
22640* random number generation <3>:          RANDOM_NUMBER.       (line   6)
22641* random number generation, initialization: RANDOM_INIT.      (line   6)
22642* random number generation, seeding:     RANDOM_SEED.         (line   6)
22643* random number generation, seeding <1>: SRAND.               (line   6)
22644* RANDOM_INIT:                           RANDOM_INIT.         (line   6)
22645* RANDOM_NUMBER:                         RANDOM_NUMBER.       (line   6)
22646* RANDOM_SEED:                           RANDOM_SEED.         (line   6)
22647* RANGE:                                 RANGE.               (line   6)
22648* range checking:                        Code Gen Options.    (line 144)
22649* RANK:                                  RANK.                (line   6)
22650* rank:                                  RANK.                (line   6)
22651* re-association of parenthesized expressions: Code Gen Options.
22652                                                              (line 391)
22653* read character, stream mode:           FGET.                (line   6)
22654* read character, stream mode <1>:       FGETC.               (line   6)
22655* READONLY:                              Extended I/O specifiers.
22656                                                              (line   6)
22657* REAL:                                  REAL.                (line   6)
22658* real kind:                             SELECTED_REAL_KIND.  (line   6)
22659* real number, exponent:                 EXPONENT.            (line   6)
22660* real number, fraction:                 FRACTION.            (line   6)
22661* real number, nearest different:        NEAREST.             (line   6)
22662* real number, relative spacing:         RRSPACING.           (line   6)
22663* real number, relative spacing <1>:     SPACING.             (line   6)
22664* real number, scale:                    SCALE.               (line   6)
22665* real number, set exponent:             SET_EXPONENT.        (line   6)
22666* Reallocate the LHS in assignments:     Code Gen Options.    (line 400)
22667* Reallocate the LHS in assignments, notification: Error and Warning Options.
22668                                                              (line 237)
22669* REALPART:                              REAL.                (line   6)
22670* RECORD:                                STRUCTURE and RECORD.
22671                                                              (line   6)
22672* record marker:                         File format of unformatted sequential files.
22673                                                              (line   6)
22674* Reduction, XOR:                        PARITY.              (line   6)
22675* remainder:                             MOD.                 (line   6)
22676* RENAME:                                RENAME.              (line   6)
22677* repacking arrays:                      Code Gen Options.    (line 284)
22678* REPEAT:                                REPEAT.              (line   6)
22679* RESHAPE:                               RESHAPE.             (line   6)
22680* REWIND:                                Read/Write after EOF marker.
22681                                                              (line   6)
22682* right shift, combined:                 DSHIFTR.             (line   6)
22683* root:                                  SQRT.                (line   6)
22684* rounding, ceiling:                     ANINT.               (line   6)
22685* rounding, ceiling <1>:                 CEILING.             (line   6)
22686* rounding, floor:                       AINT.                (line   6)
22687* rounding, floor <1>:                   FLOOR.               (line   6)
22688* rounding, nearest whole number:        NINT.                (line   6)
22689* RRSPACING:                             RRSPACING.           (line   6)
22690* RSHIFT:                                RSHIFT.              (line   6)
22691* run-time checking:                     Code Gen Options.    (line 144)
22692* SAME_TYPE_AS:                          SAME_TYPE_AS.        (line   6)
22693* SAVE statement:                        Code Gen Options.    (line  15)
22694* SCALE:                                 SCALE.               (line   6)
22695* SCAN:                                  SCAN.                (line   6)
22696* search path:                           Directory Options.   (line   6)
22697* search paths, for included files:      Directory Options.   (line  14)
22698* SECNDS:                                SECNDS.              (line   6)
22699* SECOND:                                SECOND.              (line   6)
22700* seeding a random number generator:     RANDOM_SEED.         (line   6)
22701* seeding a random number generator <1>: SRAND.               (line   6)
22702* SELECTED_CHAR_KIND:                    SELECTED_CHAR_KIND.  (line   6)
22703* SELECTED_INT_KIND:                     SELECTED_INT_KIND.   (line   6)
22704* SELECTED_REAL_KIND:                    SELECTED_REAL_KIND.  (line   6)
22705* sequential, unformatted:               File format of unformatted sequential files.
22706                                                              (line   6)
22707* SET_EXPONENT:                          SET_EXPONENT.        (line   6)
22708* SHAPE:                                 SHAPE.               (line   6)
22709* SHARE:                                 Extended I/O specifiers.
22710                                                              (line   6)
22711* SHARED:                                Extended I/O specifiers.
22712                                                              (line   6)
22713* shift, left:                           DSHIFTL.             (line   6)
22714* shift, left <1>:                       SHIFTL.              (line   6)
22715* shift, right:                          DSHIFTR.             (line   6)
22716* shift, right <1>:                      SHIFTR.              (line   6)
22717* shift, right with fill:                SHIFTA.              (line   6)
22718* SHIFTA:                                SHIFTA.              (line   6)
22719* SHIFTL:                                SHIFTL.              (line   6)
22720* SHIFTR:                                SHIFTR.              (line   6)
22721* SHORT:                                 INT2.                (line   6)
22722* SIGN:                                  SIGN.                (line   6)
22723* sign copying:                          SIGN.                (line   6)
22724* SIGNAL:                                SIGNAL.              (line   6)
22725* SIN:                                   SIN.                 (line   6)
22726* SIND:                                  SIND.                (line   6)
22727* sine:                                  SIN.                 (line   6)
22728* sine, degrees:                         SIND.                (line   6)
22729* sine, hyperbolic:                      SINH.                (line   6)
22730* sine, hyperbolic, inverse:             ASINH.               (line   6)
22731* sine, inverse:                         ASIN.                (line   6)
22732* sine, inverse, degrees:                ASIND.               (line   6)
22733* SINH:                                  SINH.                (line   6)
22734* SIZE:                                  SIZE.                (line   6)
22735* size of a variable, in bits:           BIT_SIZE.            (line   6)
22736* size of an expression:                 C_SIZEOF.            (line   6)
22737* size of an expression <1>:             SIZEOF.              (line   6)
22738* SIZEOF:                                SIZEOF.              (line   6)
22739* SLEEP:                                 SLEEP.               (line   6)
22740* SNGL:                                  REAL.                (line   6)
22741* SPACING:                               SPACING.             (line   6)
22742* SPREAD:                                SPREAD.              (line   6)
22743* SQRT:                                  SQRT.                (line   6)
22744* square-root:                           SQRT.                (line   6)
22745* SRAND:                                 SRAND.               (line   6)
22746* Standards:                             Standards.           (line   6)
22747* STAT:                                  STAT.                (line   6)
22748* statement, ENUM:                       Fortran 2003 status. (line  92)
22749* statement, ENUMERATOR:                 Fortran 2003 status. (line  92)
22750* statement, FLUSH:                      Fortran 2003 status. (line  88)
22751* statement, IMPORT:                     Fortran 2003 status. (line 119)
22752* statement, ISO_FORTRAN_ENV:            Fortran 2003 status. (line 127)
22753* statement, PROTECTED:                  Fortran 2003 status. (line 113)
22754* statement, SAVE:                       Code Gen Options.    (line  15)
22755* statement, USE, INTRINSIC:             Fortran 2003 status. (line 127)
22756* statement, VALUE:                      Fortran 2003 status. (line 115)
22757* statement, VOLATILE:                   Fortran 2003 status. (line 117)
22758* STATIC:                                AUTOMATIC and STATIC attributes.
22759                                                              (line   6)
22760* storage size:                          STORAGE_SIZE.        (line   6)
22761* STORAGE_SIZE:                          STORAGE_SIZE.        (line   6)
22762* STREAM I/O:                            Fortran 2003 status. (line 102)
22763* stream mode, read character:           FGET.                (line   6)
22764* stream mode, read character <1>:       FGETC.               (line   6)
22765* stream mode, write character:          FPUT.                (line   6)
22766* stream mode, write character <1>:      FPUTC.               (line   6)
22767* string, adjust left:                   ADJUSTL.             (line   6)
22768* string, adjust right:                  ADJUSTR.             (line   6)
22769* string, comparison:                    LGE.                 (line   6)
22770* string, comparison <1>:                LGT.                 (line   6)
22771* string, comparison <2>:                LLE.                 (line   6)
22772* string, comparison <3>:                LLT.                 (line   6)
22773* string, concatenate:                   REPEAT.              (line   6)
22774* string, find missing set:              VERIFY.              (line   6)
22775* string, find non-blank character:      LNBLNK.              (line   6)
22776* string, find subset:                   SCAN.                (line   6)
22777* string, find substring:                INDEX intrinsic.     (line   6)
22778* string, length:                        LEN.                 (line   6)
22779* string, length, without trailing whitespace: LEN_TRIM.      (line   6)
22780* string, remove trailing whitespace:    TRIM.                (line   6)
22781* string, repeat:                        REPEAT.              (line   6)
22782* strings, varying length:               Varying Length Character Strings.
22783                                                              (line   6)
22784* STRUCTURE:                             STRUCTURE and RECORD.
22785                                                              (line   6)
22786* structure packing:                     Code Gen Options.    (line 278)
22787* subrecord:                             File format of unformatted sequential files.
22788                                                              (line   6)
22789* subscript checking:                    Code Gen Options.    (line 144)
22790* substring position:                    INDEX intrinsic.     (line   6)
22791* SUM:                                   SUM.                 (line   6)
22792* sum array elements:                    SUM.                 (line   6)
22793* suppressing warnings:                  Error and Warning Options.
22794                                                              (line   6)
22795* symbol names:                          Fortran Dialect Options.
22796                                                              (line  73)
22797* symbol names, transforming:            Code Gen Options.    (line  57)
22798* symbol names, transforming <1>:        Code Gen Options.    (line 113)
22799* symbol names, underscores:             Code Gen Options.    (line  57)
22800* symbol names, underscores <1>:         Code Gen Options.    (line 113)
22801* SYMLNK:                                SYMLNK.              (line   6)
22802* syntax checking:                       Error and Warning Options.
22803                                                              (line  33)
22804* SYSTEM:                                SYSTEM.              (line   6)
22805* system, error handling:                GERROR.              (line   6)
22806* system, error handling <1>:            IERRNO.              (line   6)
22807* system, error handling <2>:            PERROR.              (line   6)
22808* system, group ID:                      GETGID.              (line   6)
22809* system, host name:                     HOSTNM.              (line   6)
22810* system, login name:                    GETLOG.              (line   6)
22811* system, process ID:                    GETPID.              (line   6)
22812* system, signal handling:               SIGNAL.              (line   6)
22813* system, system call:                   EXECUTE_COMMAND_LINE.
22814                                                              (line   6)
22815* system, system call <1>:               SYSTEM.              (line   6)
22816* system, terminal:                      ISATTY.              (line   6)
22817* system, terminal <1>:                  TTYNAM.              (line   6)
22818* system, user ID:                       GETUID.              (line   6)
22819* system, working directory:             CHDIR.               (line   6)
22820* system, working directory <1>:         GETCWD.              (line   6)
22821* SYSTEM_CLOCK:                          SYSTEM_CLOCK.        (line   6)
22822* tabulators:                            Error and Warning Options.
22823                                                              (line 186)
22824* TAN:                                   TAN.                 (line   6)
22825* TAND:                                  TAND.                (line   6)
22826* tangent:                               TAN.                 (line   6)
22827* tangent, degrees:                      TAND.                (line   6)
22828* tangent, hyperbolic:                   TANH.                (line   6)
22829* tangent, hyperbolic, inverse:          ATANH.               (line   6)
22830* tangent, inverse:                      ATAN.                (line   6)
22831* tangent, inverse <1>:                  ATAN2.               (line   6)
22832* tangent, inverse, degrees:             ATAND.               (line   6)
22833* tangent, inverse, degrees <1>:         ATAN2D.              (line   6)
22834* TANH:                                  TANH.                (line   6)
22835* terminate program:                     EXIT.                (line   6)
22836* terminate program, with core dump:     ABORT.               (line   6)
22837* THIS_IMAGE:                            THIS_IMAGE.          (line   6)
22838* thread-safety, threads:                Thread-safety of the runtime library.
22839                                                              (line   6)
22840* TIME:                                  TIME.                (line   6)
22841* time, clock ticks:                     MCLOCK.              (line   6)
22842* time, clock ticks <1>:                 MCLOCK8.             (line   6)
22843* time, clock ticks <2>:                 SYSTEM_CLOCK.        (line   6)
22844* time, conversion to GMT info:          GMTIME.              (line   6)
22845* time, conversion to local time info:   LTIME.               (line   6)
22846* time, conversion to string:            CTIME.               (line   6)
22847* time, current:                         DATE_AND_TIME.       (line   6)
22848* time, current <1>:                     FDATE.               (line   6)
22849* time, current <2>:                     ITIME.               (line   6)
22850* time, current <3>:                     TIME.                (line   6)
22851* time, current <4>:                     TIME8.               (line   6)
22852* time, elapsed:                         CPU_TIME.            (line   6)
22853* time, elapsed <1>:                     DTIME.               (line   6)
22854* time, elapsed <2>:                     ETIME.               (line   6)
22855* time, elapsed <3>:                     SECNDS.              (line   6)
22856* time, elapsed <4>:                     SECOND.              (line   6)
22857* TIME8:                                 TIME8.               (line   6)
22858* TINY:                                  TINY.                (line   6)
22859* TR 15581:                              Fortran 2003 status. (line  97)
22860* trace:                                 Debugging Options.   (line  86)
22861* TRAILZ:                                TRAILZ.              (line   6)
22862* TRANSFER:                              TRANSFER.            (line   6)
22863* transforming symbol names:             Code Gen Options.    (line  57)
22864* transforming symbol names <1>:         Code Gen Options.    (line 113)
22865* TRANSPOSE:                             TRANSPOSE.           (line   6)
22866* transpose:                             TRANSPOSE.           (line   6)
22867* trigonometric function, cosine:        COS.                 (line   6)
22868* trigonometric function, cosine, degrees: COSD.              (line   6)
22869* trigonometric function, cosine, inverse: ACOS.              (line   6)
22870* trigonometric function, cosine, inverse, degrees: ACOSD.    (line   6)
22871* trigonometric function, cotangent:     COTAN.               (line   6)
22872* trigonometric function, cotangent, degrees: COTAND.         (line   6)
22873* trigonometric function, sine:          SIN.                 (line   6)
22874* trigonometric function, sine, degrees: SIND.                (line   6)
22875* trigonometric function, sine, inverse: ASIN.                (line   6)
22876* trigonometric function, sine, inverse, degrees: ASIND.      (line   6)
22877* trigonometric function, tangent:       TAN.                 (line   6)
22878* trigonometric function, tangent, degrees: TAND.             (line   6)
22879* trigonometric function, tangent, inverse: ATAN.             (line   6)
22880* trigonometric function, tangent, inverse <1>: ATAN2.        (line   6)
22881* trigonometric function, tangent, inverse, degrees: ATAND.   (line   6)
22882* trigonometric function, tangent, inverse, degrees <1>: ATAN2D.
22883                                                              (line   6)
22884* TRIM:                                  TRIM.                (line   6)
22885* TTYNAM:                                TTYNAM.              (line   6)
22886* type alias print:                      TYPE as an alias for PRINT.
22887                                                              (line   6)
22888* type cast:                             TRANSFER.            (line   6)
22889* UBOUND:                                UBOUND.              (line   6)
22890* UCOBOUND:                              UCOBOUND.            (line   6)
22891* UMASK:                                 UMASK.               (line   6)
22892* underflow:                             Error and Warning Options.
22893                                                              (line 199)
22894* underscore:                            Code Gen Options.    (line  57)
22895* underscore <1>:                        Code Gen Options.    (line 113)
22896* unformatted sequential:                File format of unformatted sequential files.
22897                                                              (line   6)
22898* UNION:                                 UNION and MAP.       (line   6)
22899* UNLINK:                                UNLINK.              (line   6)
22900* UNPACK:                                UNPACK.              (line   6)
22901* unused dummy argument:                 Error and Warning Options.
22902                                                              (line 215)
22903* unused parameter:                      Error and Warning Options.
22904                                                              (line 219)
22905* USE, INTRINSIC statement:              Fortran 2003 status. (line 127)
22906* user id:                               GETUID.              (line   6)
22907* VALUE statement:                       Fortran 2003 status. (line 115)
22908* variable attributes:                   AUTOMATIC and STATIC attributes.
22909                                                              (line   6)
22910* Varying length character strings:      Varying Length Character Strings.
22911                                                              (line   6)
22912* Varying length strings:                Varying Length Character Strings.
22913                                                              (line   6)
22914* vector product:                        DOT_PRODUCT.         (line   6)
22915* VERIFY:                                VERIFY.              (line   6)
22916* version of the compiler:               COMPILER_VERSION.    (line   6)
22917* VOLATILE:                              Volatile COMMON blocks.
22918                                                              (line   6)
22919* VOLATILE statement:                    Fortran 2003 status. (line 117)
22920* warning, C binding type:               Error and Warning Options.
22921                                                              (line 106)
22922* warnings, aliasing:                    Error and Warning Options.
22923                                                              (line  71)
22924* warnings, alignment of COMMON blocks:  Error and Warning Options.
22925                                                              (line 226)
22926* warnings, all:                         Error and Warning Options.
22927                                                              (line  62)
22928* warnings, ampersand:                   Error and Warning Options.
22929                                                              (line  88)
22930* warnings, argument mismatch:           Error and Warning Options.
22931                                                              (line  96)
22932* warnings, array temporaries:           Error and Warning Options.
22933                                                              (line 101)
22934* warnings, character truncation:        Error and Warning Options.
22935                                                              (line 113)
22936* warnings, conversion:                  Error and Warning Options.
22937                                                              (line 122)
22938* warnings, conversion <1>:              Error and Warning Options.
22939                                                              (line 126)
22940* warnings, division of integers:        Error and Warning Options.
22941                                                              (line 149)
22942* warnings, extra:                       Error and Warning Options.
22943                                                              (line 130)
22944* warnings, function elimination:        Error and Warning Options.
22945                                                              (line 232)
22946* warnings, implicit interface:          Error and Warning Options.
22947                                                              (line 139)
22948* warnings, implicit procedure:          Error and Warning Options.
22949                                                              (line 145)
22950* warnings, integer division:            Error and Warning Options.
22951                                                              (line 149)
22952* warnings, interface mismatch:          Error and Warning Options.
22953                                                              (line  96)
22954* warnings, intrinsic:                   Error and Warning Options.
22955                                                              (line 204)
22956* warnings, intrinsics of other standards: Error and Warning Options.
22957                                                              (line 153)
22958* warnings, line truncation:             Error and Warning Options.
22959                                                              (line 116)
22960* warnings, loop interchange:            Error and Warning Options.
22961                                                              (line 135)
22962* warnings, non-standard intrinsics:     Error and Warning Options.
22963                                                              (line 153)
22964* warnings, parameter mismatch:          Error and Warning Options.
22965                                                              (line  96)
22966* warnings, q exponent-letter:           Error and Warning Options.
22967                                                              (line 160)
22968* warnings, suppressing:                 Error and Warning Options.
22969                                                              (line   6)
22970* warnings, suspicious code:             Error and Warning Options.
22971                                                              (line 164)
22972* warnings, tabs:                        Error and Warning Options.
22973                                                              (line 186)
22974* warnings, to errors:                   Error and Warning Options.
22975                                                              (line 278)
22976* warnings, undefined do loop:           Error and Warning Options.
22977                                                              (line 194)
22978* warnings, underflow:                   Error and Warning Options.
22979                                                              (line 199)
22980* warnings, unused dummy argument:       Error and Warning Options.
22981                                                              (line 215)
22982* warnings, unused parameter:            Error and Warning Options.
22983                                                              (line 219)
22984* warnings, use statements:              Error and Warning Options.
22985                                                              (line 211)
22986* write character, stream mode:          FPUT.                (line   6)
22987* write character, stream mode <1>:      FPUTC.               (line   6)
22988* XOR:                                   XOR.                 (line   6)
22989* XOR reduction:                         PARITY.              (line   6)
22990* ZABS:                                  ABS.                 (line   6)
22991* ZCOS:                                  COS.                 (line   6)
22992* ZCOSD:                                 COSD.                (line   6)
22993* zero bits:                             LEADZ.               (line   6)
22994* zero bits <1>:                         TRAILZ.              (line   6)
22995* ZEXP:                                  EXP.                 (line   6)
22996* ZLOG:                                  LOG.                 (line   6)
22997* ZSIN:                                  SIN.                 (line   6)
22998* ZSIND:                                 SIND.                (line   6)
22999* ZSQRT:                                 SQRT.                (line   6)
23000
23001
23002
23003Tag Table:
23004Node: Top1950
23005Node: Introduction3367
23006Node: About GNU Fortran4116
23007Node: GNU Fortran and GCC8117
23008Node: Preprocessing and conditional compilation10231
23009Node: GNU Fortran and G7712320
23010Node: Project Status12893
23011Node: Standards15635
23012Node: Varying Length Character Strings16972
23013Node: Invoking GNU Fortran17724
23014Node: Option Summary19558
23015Node: Fortran Dialect Options23579
23016Node: Preprocessing Options36166
23017Node: Error and Warning Options44407
23018Node: Debugging Options56189
23019Node: Directory Options60961
23020Node: Link Options62396
23021Node: Runtime Options63022
23022Node: Code Gen Options64929
23023Node: Interoperability Options84787
23024Node: Environment Variables86865
23025Node: Runtime87478
23026Node: TMPDIR88652
23027Node: GFORTRAN_STDIN_UNIT89322
23028Node: GFORTRAN_STDOUT_UNIT89704
23029Node: GFORTRAN_STDERR_UNIT90105
23030Node: GFORTRAN_UNBUFFERED_ALL90507
23031Node: GFORTRAN_UNBUFFERED_PRECONNECTED91038
23032Node: GFORTRAN_SHOW_LOCUS91682
23033Node: GFORTRAN_OPTIONAL_PLUS92178
23034Node: GFORTRAN_LIST_SEPARATOR92656
23035Node: GFORTRAN_CONVERT_UNIT93264
23036Node: GFORTRAN_ERROR_BACKTRACE96119
23037Node: GFORTRAN_FORMATTED_BUFFER_SIZE96715
23038Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE97163
23039Node: Fortran standards status97592
23040Node: Fortran 2003 status97844
23041Node: Fortran 2008 status102999
23042Node: Fortran 2018 status108377
23043Node: Compiler Characteristics110735
23044Node: KIND Type Parameters111518
23045Node: Internal representation of LOGICAL variables112946
23046Node: Evaluation of logical expressions113803
23047Node: MAX and MIN intrinsics with REAL NaN arguments114654
23048Node: Thread-safety of the runtime library115475
23049Node: Data consistency and durability117880
23050Node: Files opened without an explicit ACTION= specifier120993
23051Node: File operations on symbolic links121684
23052Node: File format of unformatted sequential files122804
23053Node: Asynchronous I/O125176
23054Node: Extensions125876
23055Node: Extensions implemented in GNU Fortran126481
23056Node: Old-style kind specifications128377
23057Node: Old-style variable initialization129479
23058Node: Extensions to namelist130791
23059Node: X format descriptor without count field133094
23060Node: Commas in FORMAT specifications133621
23061Node: Missing period in FORMAT specifications134138
23062Node: I/O item lists134700
23063Node: Q exponent-letter135085
23064Node: BOZ literal constants135683
23065Node: Real array indices138262
23066Node: Unary operators138561
23067Node: Implicitly convert LOGICAL and INTEGER values138975
23068Node: Hollerith constants support139934
23069Node: Cray pointers141706
23070Node: CONVERT specifier147214
23071Node: OpenMP149209
23072Node: OpenACC151467
23073Node: Argument list functions152776
23074Node: Read/Write after EOF marker154419
23075Node: STRUCTURE and RECORD155022
23076Node: UNION and MAP160109
23077Node: Type variants for integer intrinsics163077
23078Node: AUTOMATIC and STATIC attributes164972
23079Node: Extended math intrinsics166506
23080Node: Form feed as whitespace168302
23081Node: TYPE as an alias for PRINT168848
23082Node: %LOC as an rvalue169313
23083Node: .XOR. operator169960
23084Node: Bitwise logical operators170360
23085Node: Extended I/O specifiers171861
23086Node: Legacy PARAMETER statements175581
23087Node: Default exponents176186
23088Node: Extensions not implemented in GNU Fortran176538
23089Node: ENCODE and DECODE statements177505
23090Node: Variable FORMAT expressions178836
23091Node: Alternate complex function syntax179941
23092Node: Volatile COMMON blocks180491
23093Node: OPEN( ... NAME=)180993
23094Node: Q edit descriptor181421
23095Node: Mixed-Language Programming182373
23096Node: Interoperability with C182953
23097Node: Intrinsic Types184287
23098Node: Derived Types and struct185283
23099Node: Interoperable Global Variables186641
23100Node: Interoperable Subroutines and Functions187916
23101Node: Working with Pointers191710
23102Node: Further Interoperability of Fortran with C196186
23103Node: GNU Fortran Compiler Directives199758
23104Node: ATTRIBUTES directive200134
23105Node: UNROLL directive203322
23106Node: BUILTIN directive203855
23107Node: IVDEP directive204697
23108Node: VECTOR directive205516
23109Node: NOVECTOR directive205914
23110Node: Non-Fortran Main Program206299
23111Node: _gfortran_set_args208487
23112Node: _gfortran_set_options209425
23113Node: _gfortran_set_convert213032
23114Node: _gfortran_set_record_marker213900
23115Node: _gfortran_set_fpe214710
23116Node: _gfortran_set_max_subrecord_length215908
23117Node: Naming and argument-passing conventions216831
23118Node: Naming conventions217550
23119Node: Argument passing conventions219022
23120Node: Coarray Programming224327
23121Node: Type and enum ABI Documentation224574
23122Node: caf_token_t224872
23123Node: caf_register_t225108
23124Node: caf_deregister_t226319
23125Node: caf_reference_t226821
23126Node: caf_team_t231145
23127Node: Function ABI Documentation231444
23128Node: _gfortran_caf_init233894
23129Node: _gfortran_caf_finish235320
23130Node: _gfortran_caf_this_image236259
23131Node: _gfortran_caf_num_images237014
23132Node: _gfortran_caf_image_status238125
23133Node: _gfortran_caf_failed_images239245
23134Node: _gfortran_caf_stopped_images240415
23135Node: _gfortran_caf_register241588
23136Node: _gfortran_caf_deregister245770
23137Node: _gfortran_caf_is_present247376
23138Node: _gfortran_caf_send248455
23139Node: _gfortran_caf_get251645
23140Node: _gfortran_caf_sendget254726
23141Node: _gfortran_caf_send_by_ref258637
23142Node: _gfortran_caf_get_by_ref262246
23143Node: _gfortran_caf_sendget_by_ref265765
23144Node: _gfortran_caf_lock270061
23145Node: _gfortran_caf_unlock271847
23146Node: _gfortran_caf_event_post273328
23147Node: _gfortran_caf_event_wait274777
23148Node: _gfortran_caf_event_query276884
23149Node: _gfortran_caf_sync_all278215
23150Node: _gfortran_caf_sync_images279143
23151Node: _gfortran_caf_sync_memory280678
23152Node: _gfortran_caf_error_stop281670
23153Node: _gfortran_caf_error_stop_str282274
23154Node: _gfortran_caf_fail_image282979
23155Node: _gfortran_caf_atomic_define283515
23156Node: _gfortran_caf_atomic_ref284830
23157Node: _gfortran_caf_atomic_cas286134
23158Node: _gfortran_caf_atomic_op287895
23159Node: _gfortran_caf_co_broadcast289997
23160Node: _gfortran_caf_co_max291102
23161Node: _gfortran_caf_co_min292728
23162Node: _gfortran_caf_co_sum294348
23163Node: _gfortran_caf_co_reduce295888
23164Node: Intrinsic Procedures298532
23165Node: Introduction to Intrinsics315791
23166Node: ABORT318141
23167Node: ABS318886
23168Node: ACCESS320836
23169Node: ACHAR322766
23170Node: ACOS323970
23171Node: ACOSD325256
23172Node: ACOSH326568
23173Node: ADJUSTL327564
23174Node: ADJUSTR328506
23175Node: AIMAG329456
23176Node: AINT330828
23177Node: ALARM332434
23178Node: ALL334066
23179Node: ALLOCATED335990
23180Node: AND337129
23181Node: ANINT338864
23182Node: ANY340361
23183Node: ASIN342287
23184Node: ASIND343562
23185Node: ASINH344860
23186Node: ASSOCIATED345866
23187Node: ATAN348877
23188Node: ATAND350327
23189Node: ATAN2351797
23190Node: ATAN2D353660
23191Node: ATANH355634
23192Node: ATOMIC_ADD356640
23193Node: ATOMIC_AND358172
23194Node: ATOMIC_CAS359760
23195Node: ATOMIC_DEFINE361619
23196Node: ATOMIC_FETCH_ADD363338
23197Node: ATOMIC_FETCH_AND365138
23198Node: ATOMIC_FETCH_OR366928
23199Node: ATOMIC_FETCH_XOR368705
23200Node: ATOMIC_OR370488
23201Node: ATOMIC_REF372073
23202Node: ATOMIC_XOR373969
23203Node: BACKTRACE375554
23204Node: BESSEL_J0376134
23205Node: BESSEL_J1377150
23206Node: BESSEL_JN378167
23207Node: BESSEL_Y0379992
23208Node: BESSEL_Y1380947
23209Node: BESSEL_YN381902
23210Node: BGE383733
23211Node: BGT384425
23212Node: BIT_SIZE385075
23213Node: BLE385897
23214Node: BLT386579
23215Node: BTEST387217
23216Node: C_ASSOCIATED388674
23217Node: C_F_POINTER389885
23218Node: C_F_PROCPOINTER391320
23219Node: C_FUNLOC392827
23220Node: C_LOC394198
23221Node: C_SIZEOF395477
23222Node: CEILING396890
23223Node: CHAR397898
23224Node: CHDIR399110
23225Node: CHMOD400284
23226Node: CMPLX402199
23227Node: CO_BROADCAST403642
23228Node: CO_MAX405415
23229Node: CO_MIN407295
23230Node: CO_REDUCE409161
23231Node: CO_SUM412664
23232Node: COMMAND_ARGUMENT_COUNT414571
23233Node: COMPILER_OPTIONS415488
23234Node: COMPILER_VERSION416514
23235Node: COMPLEX417478
23236Node: CONJG418617
23237Node: COS419673
23238Node: COSD421128
23239Node: COSH422577
23240Node: COTAN423760
23241Node: COTAND424899
23242Node: COUNT426078
23243Node: CPU_TIME428103
23244Node: CSHIFT429460
23245Node: CTIME431120
23246Node: DATE_AND_TIME432628
23247Node: DBLE435108
23248Node: DCMPLX435903
23249Node: DIGITS437085
23250Node: DIM438052
23251Node: DOT_PRODUCT439333
23252Node: DPROD440976
23253Node: DREAL441903
23254Node: DSHIFTL442569
23255Node: DSHIFTR443902
23256Node: DTIME445236
23257Node: EOSHIFT448051
23258Node: EPSILON450124
23259Node: ERF450851
23260Node: ERFC451632
23261Node: ERFC_SCALED452442
23262Node: ETIME453135
23263Node: EVENT_QUERY455374
23264Node: EXECUTE_COMMAND_LINE456963
23265Node: EXIT459743
23266Node: EXP460621
23267Node: EXPONENT461874
23268Node: EXTENDS_TYPE_OF462638
23269Node: FDATE463496
23270Node: FGET464982
23271Node: FGETC466809
23272Node: FINDLOC468619
23273Node: FLOOR471079
23274Node: FLUSH472070
23275Node: FNUM473949
23276Node: FPUT474674
23277Node: FPUTC476308
23278Node: FRACTION478089
23279Node: FREE478993
23280Node: FSEEK479836
23281Node: FSTAT482142
23282Node: FTELL483229
23283Node: GAMMA484211
23284Node: GERROR485265
23285Node: GETARG485987
23286Node: GET_COMMAND487759
23287Node: GET_COMMAND_ARGUMENT489133
23288Node: GETCWD491180
23289Node: GETENV492160
23290Node: GET_ENVIRONMENT_VARIABLE493592
23291Node: GETGID495755
23292Node: GETLOG496292
23293Node: GETPID497154
23294Node: GETUID497884
23295Node: GMTIME498400
23296Node: HOSTNM500160
23297Node: HUGE501081
23298Node: HYPOT501803
23299Node: IACHAR502629
23300Node: IALL503797
23301Node: IAND505282
23302Node: IANY507009
23303Node: IARGC508503
23304Node: IBCLR509524
23305Node: IBITS510772
23306Node: IBSET512276
23307Node: ICHAR513519
23308Node: IDATE515689
23309Node: IEOR516989
23310Node: IERRNO518609
23311Node: IMAGE_INDEX519158
23312Node: INDEX intrinsic520186
23313Node: INT521712
23314Node: INT2523471
23315Node: INT8524239
23316Node: IOR524954
23317Node: IPARITY526550
23318Node: IRAND528082
23319Node: IS_CONTIGUOUS529441
23320Node: IS_IOSTAT_END530607
23321Node: IS_IOSTAT_EOR531714
23322Node: ISATTY532843
23323Node: ISHFT533626
23324Node: ISHFTC535195
23325Node: ISNAN537002
23326Node: ITIME537769
23327Node: KILL539067
23328Node: KIND540152
23329Node: LBOUND540998
23330Node: LCOBOUND542336
23331Node: LEADZ543471
23332Node: LEN544332
23333Node: LEN_TRIM545628
23334Node: LGE546616
23335Node: LGT548129
23336Node: LINK549607
23337Node: LLE550646
23338Node: LLT552146
23339Node: LNBLNK553617
23340Node: LOC554395
23341Node: LOG555127
23342Node: LOG10556472
23343Node: LOG_GAMMA557462
23344Node: LOGICAL558564
23345Node: LONG559376
23346Node: LSHIFT560134
23347Node: LSTAT561243
23348Node: LTIME562443
23349Node: MALLOC564125
23350Node: MASKL565587
23351Node: MASKR566354
23352Node: MATMUL567124
23353Node: MAX568297
23354Node: MAXEXPONENT569832
23355Node: MAXLOC570649
23356Node: MAXVAL573266
23357Node: MCLOCK574906
23358Node: MCLOCK8575929
23359Node: MERGE577159
23360Node: MERGE_BITS577911
23361Node: MIN578950
23362Node: MINEXPONENT580488
23363Node: MINLOC581119
23364Node: MINVAL583767
23365Node: MOD585420
23366Node: MODULO587584
23367Node: MOVE_ALLOC588887
23368Node: MVBITS589920
23369Node: NEAREST591572
23370Node: NEW_LINE592672
23371Node: NINT593445
23372Node: NORM2594866
23373Node: NOT596008
23374Node: NULL597178
23375Node: NUM_IMAGES598086
23376Node: OR599787
23377Node: PACK601510
23378Node: PARITY603518
23379Node: PERROR604739
23380Node: POPCNT605364
23381Node: POPPAR606236
23382Node: PRECISION607290
23383Node: PRESENT608177
23384Node: PRODUCT609289
23385Node: RADIX610823
23386Node: RAN611635
23387Node: RAND612091
23388Node: RANDOM_INIT613424
23389Node: RANDOM_NUMBER615380
23390Node: RANDOM_SEED616622
23391Node: RANGE619092
23392Node: RANK619773
23393Node: REAL620554
23394Node: RENAME622543
23395Node: REPEAT623565
23396Node: RESHAPE624293
23397Node: RRSPACING625760
23398Node: RSHIFT626453
23399Node: SAME_TYPE_AS627621
23400Node: SCALE628453
23401Node: SCAN629234
23402Node: SECNDS630792
23403Node: SECOND631884
23404Node: SELECTED_CHAR_KIND632760
23405Node: SELECTED_INT_KIND634355
23406Node: SELECTED_REAL_KIND635532
23407Node: SET_EXPONENT638209
23408Node: SHAPE639206
23409Node: SHIFTA640630
23410Node: SHIFTL641621
23411Node: SHIFTR642481
23412Node: SIGN643342
23413Node: SIGNAL644568
23414Node: SIN646074
23415Node: SIND647165
23416Node: SINH648494
23417Node: SIZE649507
23418Node: SIZEOF650826
23419Node: SLEEP652481
23420Node: SPACING653042
23421Node: SPREAD654056
23422Node: SQRT655207
23423Node: SRAND656539
23424Node: STAT657773
23425Node: STORAGE_SIZE660941
23426Node: SUM661820
23427Node: SYMLNK663312
23428Node: SYSTEM664447
23429Node: SYSTEM_CLOCK665702
23430Node: TAN668532
23431Node: TAND669603
23432Node: TANH670687
23433Node: THIS_IMAGE671862
23434Node: TIME674162
23435Node: TIME8675333
23436Node: TINY676532
23437Node: TRAILZ677133
23438Node: TRANSFER677951
23439Node: TRANSPOSE679987
23440Node: TRIM680677
23441Node: TTYNAM681535
23442Node: UBOUND682453
23443Node: UCOBOUND683843
23444Node: UMASK684980
23445Node: UNLINK685662
23446Node: UNPACK686642
23447Node: VERIFY687937
23448Node: XOR689666
23449Node: Intrinsic Modules691476
23450Node: ISO_FORTRAN_ENV691765
23451Node: ISO_C_BINDING696168
23452Node: IEEE modules699874
23453Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS701017
23454Node: OpenACC Module OPENACC703033
23455Node: Contributing703960
23456Node: Contributors704814
23457Node: Projects706445
23458Node: Proposed Extensions707252
23459Node: Copying709262
23460Node: GNU Free Documentation License746808
23461Node: Funding771932
23462Node: Option Index774458
23463Node: Keyword Index792751
23464
23465End Tag Table
23466