1This is doc/gfortran.info, produced by makeinfo version 4.13 from 2/d/gcc-4.8.1/gcc-4.8.1/gcc/fortran/gfortran.texi. 3 4Copyright (C) 1999-2013 Free Software Foundation, Inc. 5 6 Permission is granted to copy, distribute and/or modify this document 7under the terms of the GNU Free Documentation License, Version 1.3 or 8any later version published by the Free Software Foundation; with the 9Invariant Sections being "Funding Free Software", the Front-Cover Texts 10being (a) (see below), and with the Back-Cover Texts being (b) (see 11below). A copy of the license is included in the section entitled "GNU 12Free Documentation License". 13 14 (a) The FSF's Front-Cover Text is: 15 16 A GNU Manual 17 18 (b) The FSF's Back-Cover Text is: 19 20 You have freedom to copy and modify this GNU Manual, like GNU 21software. Copies published by the Free Software Foundation raise 22funds for GNU development. 23 24INFO-DIR-SECTION Software development 25START-INFO-DIR-ENTRY 26* gfortran: (gfortran). The GNU Fortran Compiler. 27END-INFO-DIR-ENTRY 28 This file documents the use and the internals of the GNU Fortran 29compiler, (`gfortran'). 30 31 Published by the Free Software Foundation 51 Franklin Street, Fifth 32Floor Boston, MA 02110-1301 USA 33 34 Copyright (C) 1999-2013 Free Software Foundation, Inc. 35 36 Permission is granted to copy, distribute and/or modify this document 37under the terms of the GNU Free Documentation License, Version 1.3 or 38any later version published by the Free Software Foundation; with the 39Invariant Sections being "Funding Free Software", the Front-Cover Texts 40being (a) (see below), and with the Back-Cover Texts being (b) (see 41below). A copy of the license is included in the section entitled "GNU 42Free Documentation License". 43 44 (a) The FSF's Front-Cover Text is: 45 46 A GNU Manual 47 48 (b) The FSF's Back-Cover Text is: 49 50 You have freedom to copy and modify this GNU Manual, like GNU 51software. Copies published by the Free Software Foundation raise 52funds for GNU development. 53 54 55File: gfortran.info, Node: Top, Next: Introduction, Up: (dir) 56 57Introduction 58************ 59 60This manual documents the use of `gfortran', the GNU Fortran compiler. 61You can find in this manual how to invoke `gfortran', as well as its 62features and incompatibilities. 63 64* Menu: 65 66* Introduction:: 67 68Part I: Invoking GNU Fortran 69* Invoking GNU Fortran:: Command options supported by `gfortran'. 70* Runtime:: Influencing runtime behavior with environment variables. 71 72Part II: Language Reference 73* Fortran 2003 and 2008 status:: Fortran 2003 and 2008 features supported by GNU Fortran. 74* Compiler Characteristics:: User-visible implementation details. 75* Extensions:: Language extensions implemented by GNU Fortran. 76* Mixed-Language Programming:: Interoperability with C 77* Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran. 78* Intrinsic Modules:: Intrinsic modules supported by GNU Fortran. 79 80* Contributing:: How you can help. 81* Copying:: GNU General Public License says 82 how you can copy and share GNU Fortran. 83* GNU Free Documentation License:: 84 How you can copy and share this manual. 85* Funding:: How to help assure continued work for free software. 86* Option Index:: Index of command line options 87* Keyword Index:: Index of concepts 88 89 90File: gfortran.info, Node: Introduction, Next: Invoking GNU Fortran, Prev: Top, Up: Top 91 921 Introduction 93************** 94 95The GNU Fortran compiler front end was designed initially as a free 96replacement for, or alternative to, the Unix `f95' command; `gfortran' 97is the command you will use to invoke the compiler. 98 99* Menu: 100 101* About GNU Fortran:: What you should know about the GNU Fortran compiler. 102* GNU Fortran and GCC:: You can compile Fortran, C, or other programs. 103* Preprocessing and conditional compilation:: The Fortran preprocessor 104* GNU Fortran and G77:: Why we chose to start from scratch. 105* Project Status:: Status of GNU Fortran, roadmap, proposed extensions. 106* Standards:: Standards supported by GNU Fortran. 107 108 109File: gfortran.info, Node: About GNU Fortran, Next: GNU Fortran and GCC, Up: Introduction 110 1111.1 About GNU Fortran 112===================== 113 114The GNU Fortran compiler supports the Fortran 77, 90 and 95 standards 115completely, parts of the Fortran 2003 and Fortran 2008 standards, and 116several vendor extensions. The development goal is to provide the 117following features: 118 119 * Read a user's program, stored in a file and containing 120 instructions written in Fortran 77, Fortran 90, Fortran 95, 121 Fortran 2003 or Fortran 2008. This file contains "source code". 122 123 * Translate the user's program into instructions a computer can 124 carry out more quickly than it takes to translate the instructions 125 in the first place. The result after compilation of a program is 126 "machine code", code designed to be efficiently translated and 127 processed by a machine such as your computer. Humans usually are 128 not as good writing machine code as they are at writing Fortran 129 (or C++, Ada, or Java), because it is easy to make tiny mistakes 130 writing machine code. 131 132 * Provide the user with information about the reasons why the 133 compiler is unable to create a binary from the source code. 134 Usually this will be the case if the source code is flawed. The 135 Fortran 90 standard requires that the compiler can point out 136 mistakes to the user. An incorrect usage of the language causes 137 an "error message". 138 139 The compiler will also attempt to diagnose cases where the user's 140 program contains a correct usage of the language, but instructs 141 the computer to do something questionable. This kind of 142 diagnostics message is called a "warning message". 143 144 * Provide optional information about the translation passes from the 145 source code to machine code. This can help a user of the compiler 146 to find the cause of certain bugs which may not be obvious in the 147 source code, but may be more easily found at a lower level 148 compiler output. It also helps developers to find bugs in the 149 compiler itself. 150 151 * Provide information in the generated machine code that can make it 152 easier to find bugs in the program (using a debugging tool, called 153 a "debugger", such as the GNU Debugger `gdb'). 154 155 * Locate and gather machine code already generated to perform 156 actions requested by statements in the user's program. This 157 machine code is organized into "modules" and is located and 158 "linked" to the user program. 159 160 The GNU Fortran compiler consists of several components: 161 162 * A version of the `gcc' command (which also might be installed as 163 the system's `cc' command) that also understands and accepts 164 Fortran source code. The `gcc' command is the "driver" program for 165 all the languages in the GNU Compiler Collection (GCC); With `gcc', 166 you can compile the source code of any language for which a front 167 end is available in GCC. 168 169 * The `gfortran' command itself, which also might be installed as the 170 system's `f95' command. `gfortran' is just another driver program, 171 but specifically for the Fortran compiler only. The difference 172 with `gcc' is that `gfortran' will automatically link the correct 173 libraries to your program. 174 175 * A collection of run-time libraries. These libraries contain the 176 machine code needed to support capabilities of the Fortran 177 language that are not directly provided by the machine code 178 generated by the `gfortran' compilation phase, such as intrinsic 179 functions and subroutines, and routines for interaction with files 180 and the operating system. 181 182 * The Fortran compiler itself, (`f951'). This is the GNU Fortran 183 parser and code generator, linked to and interfaced with the GCC 184 backend library. `f951' "translates" the source code to assembler 185 code. You would typically not use this program directly; instead, 186 the `gcc' or `gfortran' driver programs will call it for you. 187 188 189File: gfortran.info, Node: GNU Fortran and GCC, Next: Preprocessing and conditional compilation, Prev: About GNU Fortran, Up: Introduction 190 1911.2 GNU Fortran and GCC 192======================= 193 194GNU Fortran is a part of GCC, the "GNU Compiler Collection". GCC 195consists of a collection of front ends for various languages, which 196translate the source code into a language-independent form called 197"GENERIC". This is then processed by a common middle end which 198provides optimization, and then passed to one of a collection of back 199ends which generate code for different computer architectures and 200operating systems. 201 202 Functionally, this is implemented with a driver program (`gcc') 203which provides the command-line interface for the compiler. It calls 204the relevant compiler front-end program (e.g., `f951' for Fortran) for 205each file in the source code, and then calls the assembler and linker 206as appropriate to produce the compiled output. In a copy of GCC which 207has been compiled with Fortran language support enabled, `gcc' will 208recognize files with `.f', `.for', `.ftn', `.f90', `.f95', `.f03' and 209`.f08' extensions as Fortran source code, and compile it accordingly. 210A `gfortran' driver program is also provided, which is identical to 211`gcc' except that it automatically links the Fortran runtime libraries 212into the compiled program. 213 214 Source files with `.f', `.for', `.fpp', `.ftn', `.F', `.FOR', 215`.FPP', and `.FTN' extensions are treated as fixed form. Source files 216with `.f90', `.f95', `.f03', `.f08', `.F90', `.F95', `.F03' and `.F08' 217extensions are treated as free form. The capitalized versions of 218either form are run through preprocessing. Source files with the lower 219case `.fpp' extension are also run through preprocessing. 220 221 This manual specifically documents the Fortran front end, which 222handles the programming language's syntax and semantics. The aspects 223of GCC which relate to the optimization passes and the back-end code 224generation are documented in the GCC manual; see *note Introduction: 225(gcc)Top. The two manuals together provide a complete reference for 226the GNU Fortran compiler. 227 228 229File: gfortran.info, Node: Preprocessing and conditional compilation, Next: GNU Fortran and G77, Prev: GNU Fortran and GCC, Up: Introduction 230 2311.3 Preprocessing and conditional compilation 232============================================= 233 234Many Fortran compilers including GNU Fortran allow passing the source 235code through a C preprocessor (CPP; sometimes also called the Fortran 236preprocessor, FPP) to allow for conditional compilation. In the case 237of GNU Fortran, this is the GNU C Preprocessor in the traditional mode. 238On systems with case-preserving file names, the preprocessor is 239automatically invoked if the filename extension is `.F', `.FOR', 240`.FTN', `.fpp', `.FPP', `.F90', `.F95', `.F03' or `.F08'. To manually 241invoke the preprocessor on any file, use `-cpp', to disable 242preprocessing on files where the preprocessor is run automatically, use 243`-nocpp'. 244 245 If a preprocessed file includes another file with the Fortran 246`INCLUDE' statement, the included file is not preprocessed. To 247preprocess included files, use the equivalent preprocessor statement 248`#include'. 249 250 If GNU Fortran invokes the preprocessor, `__GFORTRAN__' is defined 251and `__GNUC__', `__GNUC_MINOR__' and `__GNUC_PATCHLEVEL__' can be used 252to determine the version of the compiler. See *note Overview: 253(cpp)Top. for details. 254 255 While CPP is the de-facto standard for preprocessing Fortran code, 256Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines 257Conditional Compilation, which is not widely used and not directly 258supported by the GNU Fortran compiler. You can use the program coco to 259preprocess such files (`http://www.daniellnagle.com/coco.html'). 260 261 262File: gfortran.info, Node: GNU Fortran and G77, Next: Project Status, Prev: Preprocessing and conditional compilation, Up: Introduction 263 2641.4 GNU Fortran and G77 265======================= 266 267The GNU Fortran compiler is the successor to `g77', the Fortran 77 268front end included in GCC prior to version 4. It is an entirely new 269program that has been designed to provide Fortran 95 support and 270extensibility for future Fortran language standards, as well as 271providing backwards compatibility for Fortran 77 and nearly all of the 272GNU language extensions supported by `g77'. 273 274 275File: gfortran.info, Node: Project Status, Next: Standards, Prev: GNU Fortran and G77, Up: Introduction 276 2771.5 Project Status 278================== 279 280 As soon as `gfortran' can parse all of the statements correctly, 281 it will be in the "larva" state. When we generate code, the 282 "puppa" state. When `gfortran' is done, we'll see if it will be a 283 beautiful butterfly, or just a big bug.... 284 285 -Andy Vaught, April 2000 286 287 The start of the GNU Fortran 95 project was announced on the GCC 288homepage in March 18, 2000 (even though Andy had already been working 289on it for a while, of course). 290 291 The GNU Fortran compiler is able to compile nearly all 292standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs, 293including a number of standard and non-standard extensions, and can be 294used on real-world programs. In particular, the supported extensions 295include OpenMP, Cray-style pointers, and several Fortran 2003 and 296Fortran 2008 features, including TR 15581. However, it is still under 297development and has a few remaining rough edges. 298 299 At present, the GNU Fortran compiler passes the NIST Fortran 77 Test 300Suite (http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html), and 301produces acceptable results on the LAPACK Test Suite 302(http://www.netlib.org/lapack/faq.html#1.21). It also provides 303respectable performance on the Polyhedron Fortran compiler benchmarks 304(http://www.polyhedron.com/pb05.html) and the Livermore Fortran Kernels 305test 306(http://www.llnl.gov/asci_benchmarks/asci/limited/lfk/README.html). It 307has been used to compile a number of large real-world programs, 308including the HIRLAM weather-forecasting code 309(http://mysite.verizon.net/serveall/moene.pdf) and the Tonto quantum 310chemistry package (http://www.theochem.uwa.edu.au/tonto/); see 311`http://gcc.gnu.org/wiki/GfortranApps' for an extended list. 312 313 Among other things, the GNU Fortran compiler is intended as a 314replacement for G77. At this point, nearly all programs that could be 315compiled with G77 can be compiled with GNU Fortran, although there are 316a few minor known regressions. 317 318 The primary work remaining to be done on GNU Fortran falls into three 319categories: bug fixing (primarily regarding the treatment of invalid 320code and providing useful error messages), improving the compiler 321optimizations and the performance of compiled code, and extending the 322compiler to support future standards--in particular, Fortran 2003 and 323Fortran 2008. 324 325 326File: gfortran.info, Node: Standards, Prev: Project Status, Up: Introduction 327 3281.6 Standards 329============= 330 331* Menu: 332 333* Varying Length Character Strings:: 334 335 The GNU Fortran compiler implements ISO/IEC 1539:1997 (Fortran 95). 336As such, it can also compile essentially all standard-compliant Fortran 33790 and Fortran 77 programs. It also supports the ISO/IEC TR-15581 338enhancements to allocatable arrays. 339 340 GNU Fortran also have a partial support for ISO/IEC 1539-1:2004 341(Fortran 2003), ISO/IEC 1539-1:2010 (Fortran 2008), the Technical 342Specification `Further Interoperability of Fortran with C' (ISO/IEC TS 34329113:2012). Full support of those standards and future Fortran 344standards is planned. The current status of the support is can be 345found in the *note Fortran 2003 status::, *note Fortran 2008 status:: 346and *note TS 29113 status:: sections of the documentation. 347 348 Additionally, the GNU Fortran compilers supports the OpenMP 349specification (version 3.1, 350`http://openmp.org/wp/openmp-specifications/'). 351 352 353File: gfortran.info, Node: Varying Length Character Strings, Up: Standards 354 3551.6.1 Varying Length Character Strings 356-------------------------------------- 357 358The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000) 359varying length character strings. While GNU Fortran currently does not 360support such strings directly, there exist two Fortran implementations 361for them, which work with GNU Fortran. They can be found at 362`http://www.fortran.com/iso_varying_string.f95' and at 363`ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/'. 364 365 Deferred-length character strings of Fortran 2003 supports part of 366the features of `ISO_VARYING_STRING' and should be considered as 367replacement. (Namely, allocatable or pointers of the type 368`character(len=:)'.) 369 370 371File: gfortran.info, Node: Invoking GNU Fortran, Next: Runtime, Prev: Introduction, Up: Top 372 3732 GNU Fortran Command Options 374***************************** 375 376The `gfortran' command supports all the options supported by the `gcc' 377command. Only options specific to GNU Fortran are documented here. 378 379 *Note GCC Command Options: (gcc)Invoking GCC, for information on the 380non-Fortran-specific aspects of the `gcc' command (and, therefore, the 381`gfortran' command). 382 383 All GCC and GNU Fortran options are accepted both by `gfortran' and 384by `gcc' (as well as any other drivers built at the same time, such as 385`g++'), since adding GNU Fortran to the GCC distribution enables 386acceptance of GNU Fortran options by all of the relevant drivers. 387 388 In some cases, options have positive and negative forms; the 389negative form of `-ffoo' would be `-fno-foo'. This manual documents 390only one of these two forms, whichever one is not the default. 391 392* Menu: 393 394* Option Summary:: Brief list of all `gfortran' options, 395 without explanations. 396* Fortran Dialect Options:: Controlling the variant of Fortran language 397 compiled. 398* Preprocessing Options:: Enable and customize preprocessing. 399* Error and Warning Options:: How picky should the compiler be? 400* Debugging Options:: Symbol tables, measurements, and debugging dumps. 401* Directory Options:: Where to find module files 402* Link Options :: Influencing the linking step 403* Runtime Options:: Influencing runtime behavior 404* Code Gen Options:: Specifying conventions for function calls, data layout 405 and register usage. 406* Environment Variables:: Environment variables that affect `gfortran'. 407 408 409File: gfortran.info, Node: Option Summary, Next: Fortran Dialect Options, Up: Invoking GNU Fortran 410 4112.1 Option summary 412================== 413 414Here is a summary of all the options specific to GNU Fortran, grouped 415by type. Explanations are in the following sections. 416 417_Fortran Language Options_ 418 *Note Options controlling Fortran dialect: Fortran Dialect Options. 419 -fall-intrinsics -fbackslash -fcray-pointer -fd-lines-as-code 420 -fd-lines-as-comments -fdefault-double-8 -fdefault-integer-8 421 -fdefault-real-8 -fdollar-ok -ffixed-line-length-N 422 -ffixed-line-length-none -ffree-form -ffree-line-length-N 423 -ffree-line-length-none -fimplicit-none -finteger-4-integer-8 424 -fmax-identifier-length -fmodule-private -fno-fixed-form -fno-range-check 425 -fopenmp -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 426 -freal-8-real-10 -freal-8-real-16 -freal-8-real-4 -std=STD 427 428_Preprocessing Options_ 429 *Note Enable and customize preprocessing: Preprocessing Options. 430 -A-QUESTION[=ANSWER] 431 -AQUESTION=ANSWER -C -CC -DMACRO[=DEFN] 432 -H -P 433 -UMACRO -cpp -dD -dI -dM -dN -dU -fworking-directory 434 -imultilib DIR 435 -iprefix FILE -iquote -isysroot DIR -isystem DIR -nocpp 436 -nostdinc 437 -undef 438 439_Error and Warning Options_ 440 *Note Options to request or suppress errors and warnings: Error 441 and Warning Options. 442 -Waliasing -Wall -Wampersand -Warray-bounds 443 -Wc-binding-type -Wcharacter-truncation 444 -Wconversion -Wfunction-elimination -Wimplicit-interface 445 -Wimplicit-procedure -Wintrinsic-shadow -Wintrinsics-std 446 -Wline-truncation -Wno-align-commons -Wno-tabs -Wreal-q-constant 447 -Wsurprising -Wunderflow -Wunused-parameter -Wrealloc-lhs Wrealloc-lhs-all 448 -Wtarget-lifetime -fmax-errors=N -fsyntax-only -pedantic -pedantic-errors 449 450_Debugging Options_ 451 *Note Options for debugging your program or GNU Fortran: Debugging 452 Options. 453 -fbacktrace -fdump-fortran-optimized -fdump-fortran-original 454 -fdump-parse-tree -ffpe-trap=LIST 455 456_Directory Options_ 457 *Note Options for directory search: Directory Options. 458 -IDIR -JDIR -fintrinsic-modules-path DIR 459 460_Link Options_ 461 *Note Options for influencing the linking step: Link Options. 462 -static-libgfortran 463 464_Runtime Options_ 465 *Note Options for influencing runtime behavior: Runtime Options. 466 -fconvert=CONVERSION -fmax-subrecord-length=LENGTH 467 -frecord-marker=LENGTH -fsign-zero 468 469_Code Generation Options_ 470 *Note Options for code generation conventions: Code Gen Options. 471 -faggressive-function-elimination -fblas-matmul-limit=N 472 -fbounds-check -fcheck-array-temporaries 473 -fcheck=<ALL|ARRAY-TEMPS|BOUNDS|DO|MEM|POINTER|RECURSION> 474 -fcoarray=<NONE|SINGLE|LIB> -fexternal-blas -ff2c 475 -ffrontend-optimize 476 -finit-character=N -finit-integer=N -finit-local-zero 477 -finit-logical=<TRUE|FALSE> 478 -finit-real=<ZERO|INF|-INF|NAN|SNAN> 479 -fmax-array-constructor=N -fmax-stack-var-size=N 480 -fno-align-commons 481 -fno-automatic -fno-protect-parens -fno-underscoring -fno-whole-file 482 -fsecond-underscore -fpack-derived -frealloc-lhs -frecursive 483 -frepack-arrays -fshort-enums -fstack-arrays 484 485 486 487File: gfortran.info, Node: Fortran Dialect Options, Next: Preprocessing Options, Prev: Option Summary, Up: Invoking GNU Fortran 488 4892.2 Options controlling Fortran dialect 490======================================= 491 492The following options control the details of the Fortran dialect 493accepted by the compiler: 494 495`-ffree-form' 496`-ffixed-form' 497 Specify the layout used by the source file. The free form layout 498 was introduced in Fortran 90. Fixed form was traditionally used in 499 older Fortran programs. When neither option is specified, the 500 source form is determined by the file extension. 501 502`-fall-intrinsics' 503 This option causes all intrinsic procedures (including the 504 GNU-specific extensions) to be accepted. This can be useful with 505 `-std=f95' to force standard-compliance but get access to the full 506 range of intrinsics available with `gfortran'. As a consequence, 507 `-Wintrinsics-std' will be ignored and no user-defined procedure 508 with the same name as any intrinsic will be called except when it 509 is explicitly declared `EXTERNAL'. 510 511`-fd-lines-as-code' 512`-fd-lines-as-comments' 513 Enable special treatment for lines beginning with `d' or `D' in 514 fixed form sources. If the `-fd-lines-as-code' option is given 515 they are treated as if the first column contained a blank. If the 516 `-fd-lines-as-comments' option is given, they are treated as 517 comment lines. 518 519`-fdefault-double-8' 520 Set the `DOUBLE PRECISION' type to an 8 byte wide type. If 521 `-fdefault-real-8' is given, `DOUBLE PRECISION' would instead be 522 promoted to 16 bytes if possible, and `-fdefault-double-8' can be 523 used to prevent this. The kind of real constants like `1.d0' will 524 not be changed by `-fdefault-real-8' though, so also 525 `-fdefault-double-8' does not affect it. 526 527`-fdefault-integer-8' 528 Set the default integer and logical types to an 8 byte wide type. 529 Do nothing if this is already the default. This option also 530 affects the kind of integer constants like `42'. 531 532`-fdefault-real-8' 533 Set the default real type to an 8 byte wide type. Do nothing if 534 this is already the default. This option also affects the kind of 535 non-double real constants like `1.0', and does promote the default 536 width of `DOUBLE PRECISION' to 16 bytes if possible, unless 537 `-fdefault-double-8' is given, too. 538 539`-fdollar-ok' 540 Allow `$' as a valid non-first character in a symbol name. Symbols 541 that start with `$' are rejected since it is unclear which rules to 542 apply to implicit typing as different vendors implement different 543 rules. Using `$' in `IMPLICIT' statements is also rejected. 544 545`-fbackslash' 546 Change the interpretation of backslashes in string literals from a 547 single backslash character to "C-style" escape characters. The 548 following combinations are expanded `\a', `\b', `\f', `\n', `\r', 549 `\t', `\v', `\\', and `\0' to the ASCII characters alert, 550 backspace, form feed, newline, carriage return, horizontal tab, 551 vertical tab, backslash, and NUL, respectively. Additionally, 552 `\x'NN, `\u'NNNN and `\U'NNNNNNNN (where each N is a hexadecimal 553 digit) are translated into the Unicode characters corresponding to 554 the specified code points. All other combinations of a character 555 preceded by \ are unexpanded. 556 557`-fmodule-private' 558 Set the default accessibility of module entities to `PRIVATE'. 559 Use-associated entities will not be accessible unless they are 560 explicitly declared as `PUBLIC'. 561 562`-ffixed-line-length-N' 563 Set column after which characters are ignored in typical fixed-form 564 lines in the source file, and through which spaces are assumed (as 565 if padded to that length) after the ends of short fixed-form lines. 566 567 Popular values for N include 72 (the standard and the default), 80 568 (card image), and 132 (corresponding to "extended-source" options 569 in some popular compilers). N may also be `none', meaning that 570 the entire line is meaningful and that continued character 571 constants never have implicit spaces appended to them to fill out 572 the line. `-ffixed-line-length-0' means the same thing as 573 `-ffixed-line-length-none'. 574 575`-ffree-line-length-N' 576 Set column after which characters are ignored in typical free-form 577 lines in the source file. The default value is 132. N may be 578 `none', meaning that the entire line is meaningful. 579 `-ffree-line-length-0' means the same thing as 580 `-ffree-line-length-none'. 581 582`-fmax-identifier-length=N' 583 Specify the maximum allowed identifier length. Typical values are 584 31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008). 585 586`-fimplicit-none' 587 Specify that no implicit typing is allowed, unless overridden by 588 explicit `IMPLICIT' statements. This is the equivalent of adding 589 `implicit none' to the start of every procedure. 590 591`-finteger-4-integer-8' 592 Promote all `INTEGER(KIND=4)' entities to an `INTEGER(KIND=8)' 593 entities. If `KIND=8' is unavailable, then an error will be 594 issued. This option should be used with care and may not be 595 suitable for your codes. Areas of possible concern include calls 596 to external procedures, alignment in `EQUIVALENCE' and/or 597 `COMMON', generic interfaces, BOZ literal constant conversion, and 598 I/O. Inspection of the intermediate representation of the 599 translated Fortran code, produced by `-fdump-tree-original', is 600 suggested. 601 602`-fcray-pointer' 603 Enable the Cray pointer extension, which provides C-like pointer 604 functionality. 605 606`-fopenmp' 607 Enable the OpenMP extensions. This includes OpenMP `!$omp' 608 directives in free form and `c$omp', `*$omp' and `!$omp' 609 directives in fixed form, `!$' conditional compilation sentinels 610 in free form and `c$', `*$' and `!$' sentinels in fixed form, and 611 when linking arranges for the OpenMP runtime library to be linked 612 in. The option `-fopenmp' implies `-frecursive'. 613 614`-fno-range-check' 615 Disable range checking on results of simplification of constant 616 expressions during compilation. For example, GNU Fortran will give 617 an error at compile time when simplifying `a = 1. / 0'. With this 618 option, no error will be given and `a' will be assigned the value 619 `+Infinity'. If an expression evaluates to a value outside of the 620 relevant range of [`-HUGE()':`HUGE()'], then the expression will 621 be replaced by `-Inf' or `+Inf' as appropriate. Similarly, `DATA 622 i/Z'FFFFFFFF'/' will result in an integer overflow on most 623 systems, but with `-fno-range-check' the value will "wrap around" 624 and `i' will be initialized to -1 instead. 625 626`-freal-4-real-8' 627`-freal-4-real-10' 628`-freal-8-real-4' 629`-freal-8-real-10' 630`-freal-8-real-16' 631 Promote all `REAL(KIND=M)' entities to `REAL(KIND=N)' entities. 632 If `REAL(KIND=N)' is unavailable, then an error will be issued. 633 All other real kind types are unaffected by this option. These 634 options should be used with care and may not be suitable for your 635 codes. Areas of possible concern include calls to external 636 procedures, alignment in `EQUIVALENCE' and/or `COMMON', generic 637 interfaces, BOZ literal constant conversion, and I/O. Inspection 638 of the intermediate representation of the translated Fortran code, 639 produced by `-fdump-tree-original', is suggested. 640 641`-std=STD' 642 Specify the standard to which the program is expected to conform, 643 which may be one of `f95', `f2003', `f2008', `gnu', or `legacy'. 644 The default value for STD is `gnu', which specifies a superset of 645 the Fortran 95 standard that includes all of the extensions 646 supported by GNU Fortran, although warnings will be given for 647 obsolete extensions not recommended for use in new code. The 648 `legacy' value is equivalent but without the warnings for obsolete 649 extensions, and may be useful for old non-standard programs. The 650 `f95', `f2003' and `f2008' values specify strict conformance to 651 the Fortran 95, Fortran 2003 and Fortran 2008 standards, 652 respectively; errors are given for all extensions beyond the 653 relevant language standard, and warnings are given for the Fortran 654 77 features that are permitted but obsolescent in later standards. 655 `-std=f2008ts' allows the Fortran 2008 standard including the 656 additions of the Technical Specification (TS) 29113 on Further 657 Interoperability of Fortran with C. 658 659 660 661File: gfortran.info, Node: Preprocessing Options, Next: Error and Warning Options, Prev: Fortran Dialect Options, Up: Invoking GNU Fortran 662 6632.3 Enable and customize preprocessing 664====================================== 665 666Preprocessor related options. See section *note Preprocessing and 667conditional compilation:: for more detailed information on 668preprocessing in `gfortran'. 669 670`-cpp' 671`-nocpp' 672 Enable preprocessing. The preprocessor is automatically invoked if 673 the file extension is `.fpp', `.FPP', `.F', `.FOR', `.FTN', 674 `.F90', `.F95', `.F03' or `.F08'. Use this option to manually 675 enable preprocessing of any kind of Fortran file. 676 677 To disable preprocessing of files with any of the above listed 678 extensions, use the negative form: `-nocpp'. 679 680 The preprocessor is run in traditional mode. Any restrictions of 681 the file-format, especially the limits on line length, apply for 682 preprocessed output as well, so it might be advisable to use the 683 `-ffree-line-length-none' or `-ffixed-line-length-none' options. 684 685`-dM' 686 Instead of the normal output, generate a list of `'#define'' 687 directives for all the macros defined during the execution of the 688 preprocessor, including predefined macros. This gives you a way of 689 finding out what is predefined in your version of the preprocessor. 690 Assuming you have no file `foo.f90', the command 691 touch foo.f90; gfortran -cpp -E -dM foo.f90 692 will show all the predefined macros. 693 694`-dD' 695 Like `-dM' except in two respects: it does not include the 696 predefined macros, and it outputs both the `#define' directives 697 and the result of preprocessing. Both kinds of output go to the 698 standard output file. 699 700`-dN' 701 Like `-dD', but emit only the macro names, not their expansions. 702 703`-dU' 704 Like `dD' except that only macros that are expanded, or whose 705 definedness is tested in preprocessor directives, are output; the 706 output is delayed until the use or test of the macro; and 707 `'#undef'' directives are also output for macros tested but 708 undefined at the time. 709 710`-dI' 711 Output `'#include'' directives in addition to the result of 712 preprocessing. 713 714`-fworking-directory' 715 Enable generation of linemarkers in the preprocessor output that 716 will let the compiler know the current working directory at the 717 time of preprocessing. When this option is enabled, the 718 preprocessor will emit, after the initial linemarker, a second 719 linemarker with the current working directory followed by two 720 slashes. GCC will use this directory, when it is present in the 721 preprocessed input, as the directory emitted as the current 722 working directory in some debugging information formats. This 723 option is implicitly enabled if debugging information is enabled, 724 but this can be inhibited with the negated form 725 `-fno-working-directory'. If the `-P' flag is present in the 726 command line, this option has no effect, since no `#line' 727 directives are emitted whatsoever. 728 729`-idirafter DIR' 730 Search DIR for include files, but do it after all directories 731 specified with `-I' and the standard system directories have been 732 exhausted. DIR is treated as a system include directory. If dir 733 begins with `=', then the `=' will be replaced by the sysroot 734 prefix; see `--sysroot' and `-isysroot'. 735 736`-imultilib DIR' 737 Use DIR as a subdirectory of the directory containing 738 target-specific C++ headers. 739 740`-iprefix PREFIX' 741 Specify PREFIX as the prefix for subsequent `-iwithprefix' 742 options. If the PREFIX represents a directory, you should include 743 the final `'/''. 744 745`-isysroot DIR' 746 This option is like the `--sysroot' option, but applies only to 747 header files. See the `--sysroot' option for more information. 748 749`-iquote DIR' 750 Search DIR only for header files requested with `#include "file"'; 751 they are not searched for `#include <file>', before all directories 752 specified by `-I' and before the standard system directories. If 753 DIR begins with `=', then the `=' will be replaced by the sysroot 754 prefix; see `--sysroot' and `-isysroot'. 755 756`-isystem DIR' 757 Search DIR for header files, after all directories specified by 758 `-I' but before the standard system directories. Mark it as a 759 system directory, so that it gets the same special treatment as is 760 applied to the standard system directories. If DIR begins with 761 `=', then the `=' will be replaced by the sysroot prefix; see 762 `--sysroot' and `-isysroot'. 763 764`-nostdinc' 765 Do not search the standard system directories for header files. 766 Only the directories you have specified with `-I' options (and the 767 directory of the current file, if appropriate) are searched. 768 769`-undef' 770 Do not predefine any system-specific or GCC-specific macros. The 771 standard predefined macros remain defined. 772 773`-APREDICATE=ANSWER' 774 Make an assertion with the predicate PREDICATE and answer ANSWER. 775 This form is preferred to the older form -A predicate(answer), 776 which is still supported, because it does not use shell special 777 characters. 778 779`-A-PREDICATE=ANSWER' 780 Cancel an assertion with the predicate PREDICATE and answer ANSWER. 781 782`-C' 783 Do not discard comments. All comments are passed through to the 784 output file, except for comments in processed directives, which 785 are deleted along with the directive. 786 787 You should be prepared for side effects when using `-C'; it causes 788 the preprocessor to treat comments as tokens in their own right. 789 For example, comments appearing at the start of what would be a 790 directive line have the effect of turning that line into an 791 ordinary source line, since the first token on the line is no 792 longer a `'#''. 793 794 Warning: this currently handles C-Style comments only. The 795 preprocessor does not yet recognize Fortran-style comments. 796 797`-CC' 798 Do not discard comments, including during macro expansion. This is 799 like `-C', except that comments contained within macros are also 800 passed through to the output file where the macro is expanded. 801 802 In addition to the side-effects of the `-C' option, the `-CC' 803 option causes all C++-style comments inside a macro to be 804 converted to C-style comments. This is to prevent later use of 805 that macro from inadvertently commenting out the remainder of the 806 source line. The `-CC' option is generally used to support lint 807 comments. 808 809 Warning: this currently handles C- and C++-Style comments only. The 810 preprocessor does not yet recognize Fortran-style comments. 811 812`-DNAME' 813 Predefine name as a macro, with definition `1'. 814 815`-DNAME=DEFINITION' 816 The contents of DEFINITION are tokenized and processed as if they 817 appeared during translation phase three in a `'#define'' directive. 818 In particular, the definition will be truncated by embedded newline 819 characters. 820 821 If you are invoking the preprocessor from a shell or shell-like 822 program you may need to use the shell's quoting syntax to protect 823 characters such as spaces that have a meaning in the shell syntax. 824 825 If you wish to define a function-like macro on the command line, 826 write its argument list with surrounding parentheses before the 827 equals sign (if any). Parentheses are meaningful to most shells, 828 so you will need to quote the option. With sh and csh, 829 `-D'name(args...)=definition'' works. 830 831 `-D' and `-U' options are processed in the order they are given on 832 the command line. All -imacros file and -include file options are 833 processed after all -D and -U options. 834 835`-H' 836 Print the name of each header file used, in addition to other 837 normal activities. Each name is indented to show how deep in the 838 `'#include'' stack it is. 839 840`-P' 841 Inhibit generation of linemarkers in the output from the 842 preprocessor. This might be useful when running the preprocessor 843 on something that is not C code, and will be sent to a program 844 which might be confused by the linemarkers. 845 846`-UNAME' 847 Cancel any previous definition of NAME, either built in or provided 848 with a `-D' option. 849 850 851File: gfortran.info, Node: Error and Warning Options, Next: Debugging Options, Prev: Preprocessing Options, Up: Invoking GNU Fortran 852 8532.4 Options to request or suppress errors and warnings 854====================================================== 855 856Errors are diagnostic messages that report that the GNU Fortran compiler 857cannot compile the relevant piece of source code. The compiler will 858continue to process the program in an attempt to report further errors 859to aid in debugging, but will not produce any compiled output. 860 861 Warnings are diagnostic messages that report constructions which are 862not inherently erroneous but which are risky or suggest there is likely 863to be a bug in the program. Unless `-Werror' is specified, they do not 864prevent compilation of the program. 865 866 You can request many specific warnings with options beginning `-W', 867for example `-Wimplicit' to request warnings on implicit declarations. 868Each of these specific warning options also has a negative form 869beginning `-Wno-' to turn off warnings; for example, `-Wno-implicit'. 870This manual lists only one of the two forms, whichever is not the 871default. 872 873 These options control the amount and kinds of errors and warnings 874produced by GNU Fortran: 875 876`-fmax-errors=N' 877 Limits the maximum number of error messages to N, at which point 878 GNU Fortran bails out rather than attempting to continue 879 processing the source code. If N is 0, there is no limit on the 880 number of error messages produced. 881 882`-fsyntax-only' 883 Check the code for syntax errors, but do not actually compile it. 884 This will generate module files for each module present in the 885 code, but no other output file. 886 887`-pedantic' 888 Issue warnings for uses of extensions to Fortran 95. `-pedantic' 889 also applies to C-language constructs where they occur in GNU 890 Fortran source files, such as use of `\e' in a character constant 891 within a directive like `#include'. 892 893 Valid Fortran 95 programs should compile properly with or without 894 this option. However, without this option, certain GNU extensions 895 and traditional Fortran features are supported as well. With this 896 option, many of them are rejected. 897 898 Some users try to use `-pedantic' to check programs for 899 conformance. They soon find that it does not do quite what they 900 want--it finds some nonstandard practices, but not all. However, 901 improvements to GNU Fortran in this area are welcome. 902 903 This should be used in conjunction with `-std=f95', `-std=f2003' 904 or `-std=f2008'. 905 906`-pedantic-errors' 907 Like `-pedantic', except that errors are produced rather than 908 warnings. 909 910`-Wall' 911 Enables commonly used warning options pertaining to usage that we 912 recommend avoiding and that we believe are easy to avoid. This 913 currently includes `-Waliasing', `-Wampersand', `-Wconversion', 914 `-Wsurprising', `-Wc-binding-type', `-Wintrinsics-std', 915 `-Wno-tabs', `-Wintrinsic-shadow', `-Wline-truncation', 916 `-Wtarget-lifetime', `-Wreal-q-constant' and `-Wunused'. 917 918`-Waliasing' 919 Warn about possible aliasing of dummy arguments. Specifically, it 920 warns if the same actual argument is associated with a dummy 921 argument with `INTENT(IN)' and a dummy argument with `INTENT(OUT)' 922 in a call with an explicit interface. 923 924 The following example will trigger the warning. 925 interface 926 subroutine bar(a,b) 927 integer, intent(in) :: a 928 integer, intent(out) :: b 929 end subroutine 930 end interface 931 integer :: a 932 933 call bar(a,a) 934 935`-Wampersand' 936 Warn about missing ampersand in continued character constants. The 937 warning is given with `-Wampersand', `-pedantic', `-std=f95', 938 `-std=f2003' and `-std=f2008'. Note: With no ampersand given in a 939 continued character constant, GNU Fortran assumes continuation at 940 the first non-comment, non-whitespace character after the ampersand 941 that initiated the continuation. 942 943`-Warray-temporaries' 944 Warn about array temporaries generated by the compiler. The 945 information generated by this warning is sometimes useful in 946 optimization, in order to avoid such temporaries. 947 948`-Wc-binding-type' 949 Warn if the a variable might not be C interoperable. In 950 particular, warn if the variable has been declared using an 951 intrinsic type with default kind instead of using a kind parameter 952 defined for C interoperability in the intrinsic `ISO_C_Binding' 953 module. This option is implied by `-Wall'. 954 955`-Wcharacter-truncation' 956 Warn when a character assignment will truncate the assigned string. 957 958`-Wline-truncation' 959 Warn when a source code line will be truncated. This option is 960 implied by `-Wall'. 961 962`-Wconversion' 963 Warn about implicit conversions that are likely to change the 964 value of the expression after conversion. Implied by `-Wall'. 965 966`-Wconversion-extra' 967 Warn about implicit conversions between different types and kinds. 968 969`-Wextra' 970 Enables some warning options for usages of language features which 971 may be problematic. This currently includes `-Wcompare-reals' and 972 `-Wunused-parameter'. 973 974`-Wimplicit-interface' 975 Warn if a procedure is called without an explicit interface. Note 976 this only checks that an explicit interface is present. It does 977 not check that the declared interfaces are consistent across 978 program units. 979 980`-Wimplicit-procedure' 981 Warn if a procedure is called that has neither an explicit 982 interface nor has been declared as `EXTERNAL'. 983 984`-Wintrinsics-std' 985 Warn if `gfortran' finds a procedure named like an intrinsic not 986 available in the currently selected standard (with `-std') and 987 treats it as `EXTERNAL' procedure because of this. 988 `-fall-intrinsics' can be used to never trigger this behavior and 989 always link to the intrinsic regardless of the selected standard. 990 991`-Wreal-q-constant' 992 Produce a warning if a real-literal-constant contains a `q' 993 exponent-letter. 994 995`-Wsurprising' 996 Produce a warning when "suspicious" code constructs are 997 encountered. While technically legal these usually indicate that 998 an error has been made. 999 1000 This currently produces a warning under the following 1001 circumstances: 1002 1003 * An INTEGER SELECT construct has a CASE that can never be 1004 matched as its lower value is greater than its upper value. 1005 1006 * A LOGICAL SELECT construct has three CASE statements. 1007 1008 * A TRANSFER specifies a source that is shorter than the 1009 destination. 1010 1011 * The type of a function result is declared more than once with 1012 the same type. If `-pedantic' or standard-conforming mode is 1013 enabled, this is an error. 1014 1015 * A `CHARACTER' variable is declared with negative length. 1016 1017`-Wtabs' 1018 By default, tabs are accepted as whitespace, but tabs are not 1019 members of the Fortran Character Set. For continuation lines, a 1020 tab followed by a digit between 1 and 9 is supported. `-Wno-tabs' 1021 will cause a warning to be issued if a tab is encountered. Note, 1022 `-Wno-tabs' is active for `-pedantic', `-std=f95', `-std=f2003', 1023 `-std=f2008' and `-Wall'. 1024 1025`-Wunderflow' 1026 Produce a warning when numerical constant expressions are 1027 encountered, which yield an UNDERFLOW during compilation. 1028 1029`-Wintrinsic-shadow' 1030 Warn if a user-defined procedure or module procedure has the same 1031 name as an intrinsic; in this case, an explicit interface or 1032 `EXTERNAL' or `INTRINSIC' declaration might be needed to get calls 1033 later resolved to the desired intrinsic/procedure. This option is 1034 implied by `-Wall'. 1035 1036`-Wunused-dummy-argument' 1037 Warn about unused dummy arguments. This option is implied by 1038 `-Wall'. 1039 1040`-Wunused-parameter' 1041 Contrary to `gcc''s meaning of `-Wunused-parameter', `gfortran''s 1042 implementation of this option does not warn about unused dummy 1043 arguments (see `-Wunused-dummy-argument'), but about unused 1044 `PARAMETER' values. `-Wunused-parameter' is not included in 1045 `-Wall' but is implied by `-Wall -Wextra'. 1046 1047`-Walign-commons' 1048 By default, `gfortran' warns about any occasion of variables being 1049 padded for proper alignment inside a `COMMON' block. This warning 1050 can be turned off via `-Wno-align-commons'. See also 1051 `-falign-commons'. 1052 1053`-Wfunction-elimination' 1054 Warn if any calls to functions are eliminated by the optimizations 1055 enabled by the `-ffrontend-optimize' option. 1056 1057`-Wrealloc-lhs' 1058 Warn when the compiler might insert code to for allocation or 1059 reallocation of an allocatable array variable of intrinsic type in 1060 intrinsic assignments. In hot loops, the Fortran 2003 1061 reallocation feature may reduce the performance. If the array is 1062 already allocated with the correct shape, consider using a 1063 whole-array array-spec (e.g. `(:,:,:)') for the variable on the 1064 left-hand side to prevent the reallocation check. Note that in 1065 some cases the warning is shown, even if the compiler will 1066 optimize reallocation checks away. For instance, when the 1067 right-hand side contains the same variable multiplied by a scalar. 1068 See also `-frealloc-lhs'. 1069 1070`-Wrealloc-lhs-all' 1071 Warn when the compiler inserts code to for allocation or 1072 reallocation of an allocatable variable; this includes scalars and 1073 derived types. 1074 1075`-Wcompare-reals' 1076 Warn when comparing real or complex types for equality or 1077 inequality. This option is implied by `-Wextra'. 1078 1079`-Wtarget-lifetime' 1080 Warn if the pointer in a pointer assignment might be longer than 1081 the its target. This option is implied by `-Wall'. 1082 1083`-Werror' 1084 Turns all warnings into errors. 1085 1086 *Note Options to Request or Suppress Errors and Warnings: 1087(gcc)Warning Options, for information on more options offered by the 1088GBE shared by `gfortran', `gcc' and other GNU compilers. 1089 1090 Some of these have no effect when compiling programs written in 1091Fortran. 1092 1093 1094File: gfortran.info, Node: Debugging Options, Next: Directory Options, Prev: Error and Warning Options, Up: Invoking GNU Fortran 1095 10962.5 Options for debugging your program or GNU Fortran 1097===================================================== 1098 1099GNU Fortran has various special options that are used for debugging 1100either your program or the GNU Fortran compiler. 1101 1102`-fdump-fortran-original' 1103 Output the internal parse tree after translating the source program 1104 into internal representation. Only really useful for debugging the 1105 GNU Fortran compiler itself. 1106 1107`-fdump-optimized-tree' 1108 Output the parse tree after front-end optimization. Only really 1109 useful for debugging the GNU Fortran compiler itself. 1110 1111 Output the internal parse tree after translating the source program 1112 into internal representation. Only really useful for debugging the 1113 GNU Fortran compiler itself. This option is deprecated; use 1114 `-fdump-fortran-original' instead. 1115 1116`-ffpe-trap=LIST' 1117 Specify a list of floating point exception traps to enable. On 1118 most systems, if a floating point exception occurs and the trap 1119 for that exception is enabled, a SIGFPE signal will be sent and 1120 the program being aborted, producing a core file useful for 1121 debugging. LIST is a (possibly empty) comma-separated list of the 1122 following exceptions: `invalid' (invalid floating point operation, 1123 such as `SQRT(-1.0)'), `zero' (division by zero), `overflow' 1124 (overflow in a floating point operation), `underflow' (underflow 1125 in a floating point operation), `inexact' (loss of precision 1126 during operation), and `denormal' (operation performed on a 1127 denormal value). The first five exceptions correspond to the five 1128 IEEE 754 exceptions, whereas the last one (`denormal') is not part 1129 of the IEEE 754 standard but is available on some common 1130 architectures such as x86. 1131 1132 The first three exceptions (`invalid', `zero', and `overflow') 1133 often indicate serious errors, and unless the program has 1134 provisions for dealing with these exceptions, enabling traps for 1135 these three exceptions is probably a good idea. 1136 1137 Many, if not most, floating point operations incur loss of 1138 precision due to rounding, and hence the `ffpe-trap=inexact' is 1139 likely to be uninteresting in practice. 1140 1141 By default no exception traps are enabled. 1142 1143`-fno-backtrace' 1144 When a serious runtime error is encountered or a deadly signal is 1145 emitted (segmentation fault, illegal instruction, bus error, 1146 floating-point exception, and the other POSIX signals that have the 1147 action `core'), the Fortran runtime library tries to output a 1148 backtrace of the error. `-fno-backtrace' disables the backtrace 1149 generation. This option only has influence for compilation of the 1150 Fortran main program. 1151 1152 1153 *Note Options for Debugging Your Program or GCC: (gcc)Debugging 1154Options, for more information on debugging options. 1155 1156 1157File: gfortran.info, Node: Directory Options, Next: Link Options, Prev: Debugging Options, Up: Invoking GNU Fortran 1158 11592.6 Options for directory search 1160================================ 1161 1162These options affect how GNU Fortran searches for files specified by 1163the `INCLUDE' directive and where it searches for previously compiled 1164modules. 1165 1166 It also affects the search paths used by `cpp' when used to 1167preprocess Fortran source. 1168 1169`-IDIR' 1170 These affect interpretation of the `INCLUDE' directive (as well as 1171 of the `#include' directive of the `cpp' preprocessor). 1172 1173 Also note that the general behavior of `-I' and `INCLUDE' is 1174 pretty much the same as of `-I' with `#include' in the `cpp' 1175 preprocessor, with regard to looking for `header.gcc' files and 1176 other such things. 1177 1178 This path is also used to search for `.mod' files when previously 1179 compiled modules are required by a `USE' statement. 1180 1181 *Note Options for Directory Search: (gcc)Directory Options, for 1182 information on the `-I' option. 1183 1184`-JDIR' 1185 This option specifies where to put `.mod' files for compiled 1186 modules. It is also added to the list of directories to searched 1187 by an `USE' statement. 1188 1189 The default is the current directory. 1190 1191`-fintrinsic-modules-path DIR' 1192 This option specifies the location of pre-compiled intrinsic 1193 modules, if they are not in the default location expected by the 1194 compiler. 1195 1196 1197File: gfortran.info, Node: Link Options, Next: Runtime Options, Prev: Directory Options, Up: Invoking GNU Fortran 1198 11992.7 Influencing the linking step 1200================================ 1201 1202These options come into play when the compiler links object files into 1203an executable output file. They are meaningless if the compiler is not 1204doing a link step. 1205 1206`-static-libgfortran' 1207 On systems that provide `libgfortran' as a shared and a static 1208 library, this option forces the use of the static version. If no 1209 shared version of `libgfortran' was built when the compiler was 1210 configured, this option has no effect. 1211 1212 1213File: gfortran.info, Node: Runtime Options, Next: Code Gen Options, Prev: Link Options, Up: Invoking GNU Fortran 1214 12152.8 Influencing runtime behavior 1216================================ 1217 1218These options affect the runtime behavior of programs compiled with GNU 1219Fortran. 1220 1221`-fconvert=CONVERSION' 1222 Specify the representation of data for unformatted files. Valid 1223 values for conversion are: `native', the default; `swap', swap 1224 between big- and little-endian; `big-endian', use big-endian 1225 representation for unformatted files; `little-endian', use 1226 little-endian representation for unformatted files. 1227 1228 _This option has an effect only when used in the main program. 1229 The `CONVERT' specifier and the GFORTRAN_CONVERT_UNIT environment 1230 variable override the default specified by `-fconvert'._ 1231 1232`-frecord-marker=LENGTH' 1233 Specify the length of record markers for unformatted files. Valid 1234 values for LENGTH are 4 and 8. Default is 4. _This is different 1235 from previous versions of `gfortran'_, which specified a default 1236 record marker length of 8 on most systems. If you want to read or 1237 write files compatible with earlier versions of `gfortran', use 1238 `-frecord-marker=8'. 1239 1240`-fmax-subrecord-length=LENGTH' 1241 Specify the maximum length for a subrecord. The maximum permitted 1242 value for length is 2147483639, which is also the default. Only 1243 really useful for use by the gfortran testsuite. 1244 1245`-fsign-zero' 1246 When enabled, floating point numbers of value zero with the sign 1247 bit set are written as negative number in formatted output and 1248 treated as negative in the `SIGN' intrinsic. `-fno-sign-zero' 1249 does not print the negative sign of zero values (or values rounded 1250 to zero for I/O) and regards zero as positive number in the `SIGN' 1251 intrinsic for compatibility with Fortran 77. The default is 1252 `-fsign-zero'. 1253 1254 1255File: gfortran.info, Node: Code Gen Options, Next: Environment Variables, Prev: Runtime Options, Up: Invoking GNU Fortran 1256 12572.9 Options for code generation conventions 1258=========================================== 1259 1260These machine-independent options control the interface conventions 1261used in code generation. 1262 1263 Most of them have both positive and negative forms; the negative form 1264of `-ffoo' would be `-fno-foo'. In the table below, only one of the 1265forms is listed--the one which is not the default. You can figure out 1266the other form by either removing `no-' or adding it. 1267 1268`-fno-automatic' 1269 Treat each program unit (except those marked as RECURSIVE) as if 1270 the `SAVE' statement were specified for every local variable and 1271 array referenced in it. Does not affect common blocks. (Some 1272 Fortran compilers provide this option under the name `-static' or 1273 `-save'.) The default, which is `-fautomatic', uses the stack for 1274 local variables smaller than the value given by 1275 `-fmax-stack-var-size'. Use the option `-frecursive' to use no 1276 static memory. 1277 1278`-ff2c' 1279 Generate code designed to be compatible with code generated by 1280 `g77' and `f2c'. 1281 1282 The calling conventions used by `g77' (originally implemented in 1283 `f2c') require functions that return type default `REAL' to 1284 actually return the C type `double', and functions that return 1285 type `COMPLEX' to return the values via an extra argument in the 1286 calling sequence that points to where to store the return value. 1287 Under the default GNU calling conventions, such functions simply 1288 return their results as they would in GNU C--default `REAL' 1289 functions return the C type `float', and `COMPLEX' functions 1290 return the GNU C type `complex'. Additionally, this option 1291 implies the `-fsecond-underscore' option, unless 1292 `-fno-second-underscore' is explicitly requested. 1293 1294 This does not affect the generation of code that interfaces with 1295 the `libgfortran' library. 1296 1297 _Caution:_ It is not a good idea to mix Fortran code compiled with 1298 `-ff2c' with code compiled with the default `-fno-f2c' calling 1299 conventions as, calling `COMPLEX' or default `REAL' functions 1300 between program parts which were compiled with different calling 1301 conventions will break at execution time. 1302 1303 _Caution:_ This will break code which passes intrinsic functions 1304 of type default `REAL' or `COMPLEX' as actual arguments, as the 1305 library implementations use the `-fno-f2c' calling conventions. 1306 1307`-fno-underscoring' 1308 Do not transform names of entities specified in the Fortran source 1309 file by appending underscores to them. 1310 1311 With `-funderscoring' in effect, GNU Fortran appends one 1312 underscore to external names with no underscores. This is done to 1313 ensure compatibility with code produced by many UNIX Fortran 1314 compilers. 1315 1316 _Caution_: The default behavior of GNU Fortran is incompatible 1317 with `f2c' and `g77', please use the `-ff2c' option if you want 1318 object files compiled with GNU Fortran to be compatible with 1319 object code created with these tools. 1320 1321 Use of `-fno-underscoring' is not recommended unless you are 1322 experimenting with issues such as integration of GNU Fortran into 1323 existing system environments (vis-a`-vis existing libraries, tools, 1324 and so on). 1325 1326 For example, with `-funderscoring', and assuming other defaults 1327 like `-fcase-lower' and that `j()' and `max_count()' are external 1328 functions while `my_var' and `lvar' are local variables, a 1329 statement like 1330 I = J() + MAX_COUNT (MY_VAR, LVAR) 1331 is implemented as something akin to: 1332 i = j_() + max_count__(&my_var__, &lvar); 1333 1334 With `-fno-underscoring', the same statement is implemented as: 1335 1336 i = j() + max_count(&my_var, &lvar); 1337 1338 Use of `-fno-underscoring' allows direct specification of 1339 user-defined names while debugging and when interfacing GNU Fortran 1340 code with other languages. 1341 1342 Note that just because the names match does _not_ mean that the 1343 interface implemented by GNU Fortran for an external name matches 1344 the interface implemented by some other language for that same 1345 name. That is, getting code produced by GNU Fortran to link to 1346 code produced by some other compiler using this or any other 1347 method can be only a small part of the overall solution--getting 1348 the code generated by both compilers to agree on issues other than 1349 naming can require significant effort, and, unlike naming 1350 disagreements, linkers normally cannot detect disagreements in 1351 these other areas. 1352 1353 Also, note that with `-fno-underscoring', the lack of appended 1354 underscores introduces the very real possibility that a 1355 user-defined external name will conflict with a name in a system 1356 library, which could make finding unresolved-reference bugs quite 1357 difficult in some cases--they might occur at program run time, and 1358 show up only as buggy behavior at run time. 1359 1360 In future versions of GNU Fortran we hope to improve naming and 1361 linking issues so that debugging always involves using the names 1362 as they appear in the source, even if the names as seen by the 1363 linker are mangled to prevent accidental linking between 1364 procedures with incompatible interfaces. 1365 1366`-fno-whole-file' 1367 This flag causes the compiler to resolve and translate each 1368 procedure in a file separately. 1369 1370 By default, the whole file is parsed and placed in a single 1371 front-end tree. During resolution, in addition to all the usual 1372 checks and fixups, references to external procedures that are in 1373 the same file effect resolution of that procedure, if not already 1374 done, and a check of the interfaces. The dependences are resolved 1375 by changing the order in which the file is translated into the 1376 backend tree. Thus, a procedure that is referenced is translated 1377 before the reference and the duplication of backend tree 1378 declarations eliminated. 1379 1380 The `-fno-whole-file' option is deprecated and may lead to wrong 1381 code. 1382 1383`-fsecond-underscore' 1384 By default, GNU Fortran appends an underscore to external names. 1385 If this option is used GNU Fortran appends two underscores to 1386 names with underscores and one underscore to external names with 1387 no underscores. GNU Fortran also appends two underscores to 1388 internal names with underscores to avoid naming collisions with 1389 external names. 1390 1391 This option has no effect if `-fno-underscoring' is in effect. It 1392 is implied by the `-ff2c' option. 1393 1394 Otherwise, with this option, an external name such as `MAX_COUNT' 1395 is implemented as a reference to the link-time external symbol 1396 `max_count__', instead of `max_count_'. This is required for 1397 compatibility with `g77' and `f2c', and is implied by use of the 1398 `-ff2c' option. 1399 1400`-fcoarray=<KEYWORD>' 1401 1402 `none' 1403 Disable coarray support; using coarray declarations and 1404 image-control statements will produce a compile-time error. 1405 (Default) 1406 1407 `single' 1408 Single-image mode, i.e. `num_images()' is always one. 1409 1410 `lib' 1411 Library-based coarray parallelization; a suitable GNU Fortran 1412 coarray library needs to be linked. 1413 1414`-fcheck=<KEYWORD>' 1415 Enable the generation of run-time checks; the argument shall be a 1416 comma-delimited list of the following keywords. 1417 1418 `all' 1419 Enable all run-time test of `-fcheck'. 1420 1421 `array-temps' 1422 Warns at run time when for passing an actual argument a 1423 temporary array had to be generated. The information 1424 generated by this warning is sometimes useful in 1425 optimization, in order to avoid such temporaries. 1426 1427 Note: The warning is only printed once per location. 1428 1429 `bounds' 1430 Enable generation of run-time checks for array subscripts and 1431 against the declared minimum and maximum values. It also 1432 checks array indices for assumed and deferred shape arrays 1433 against the actual allocated bounds and ensures that all 1434 string lengths are equal for character array constructors 1435 without an explicit typespec. 1436 1437 Some checks require that `-fcheck=bounds' is set for the 1438 compilation of the main program. 1439 1440 Note: In the future this may also include other forms of 1441 checking, e.g., checking substring references. 1442 1443 `do' 1444 Enable generation of run-time checks for invalid modification 1445 of loop iteration variables. 1446 1447 `mem' 1448 Enable generation of run-time checks for memory allocation. 1449 Note: This option does not affect explicit allocations using 1450 the `ALLOCATE' statement, which will be always checked. 1451 1452 `pointer' 1453 Enable generation of run-time checks for pointers and 1454 allocatables. 1455 1456 `recursion' 1457 Enable generation of run-time checks for recursively called 1458 subroutines and functions which are not marked as recursive. 1459 See also `-frecursive'. Note: This check does not work for 1460 OpenMP programs and is disabled if used together with 1461 `-frecursive' and `-fopenmp'. 1462 1463`-fbounds-check' 1464 Deprecated alias for `-fcheck=bounds'. 1465 1466`-fcheck-array-temporaries' 1467 Deprecated alias for `-fcheck=array-temps'. 1468 1469`-fmax-array-constructor=N' 1470 This option can be used to increase the upper limit permitted in 1471 array constructors. The code below requires this option to expand 1472 the array at compile time. 1473 1474 program test 1475 implicit none 1476 integer j 1477 integer, parameter :: n = 100000 1478 integer, parameter :: i(n) = (/ (2*j, j = 1, n) /) 1479 print '(10(I0,1X))', i 1480 end program test 1481 1482 _Caution: This option can lead to long compile times and 1483 excessively large object files._ 1484 1485 The default value for N is 65535. 1486 1487`-fmax-stack-var-size=N' 1488 This option specifies the size in bytes of the largest array that 1489 will be put on the stack; if the size is exceeded static memory is 1490 used (except in procedures marked as RECURSIVE). Use the option 1491 `-frecursive' to allow for recursive procedures which do not have 1492 a RECURSIVE attribute or for parallel programs. Use 1493 `-fno-automatic' to never use the stack. 1494 1495 This option currently only affects local arrays declared with 1496 constant bounds, and may not apply to all character variables. 1497 Future versions of GNU Fortran may improve this behavior. 1498 1499 The default value for N is 32768. 1500 1501`-fstack-arrays' 1502 Adding this option will make the Fortran compiler put all local 1503 arrays, even those of unknown size onto stack memory. If your 1504 program uses very large local arrays it is possible that you will 1505 have to extend your runtime limits for stack memory on some 1506 operating systems. This flag is enabled by default at optimization 1507 level `-Ofast'. 1508 1509`-fpack-derived' 1510 This option tells GNU Fortran to pack derived type members as 1511 closely as possible. Code compiled with this option is likely to 1512 be incompatible with code compiled without this option, and may 1513 execute slower. 1514 1515`-frepack-arrays' 1516 In some circumstances GNU Fortran may pass assumed shape array 1517 sections via a descriptor describing a noncontiguous area of 1518 memory. This option adds code to the function prologue to repack 1519 the data into a contiguous block at runtime. 1520 1521 This should result in faster accesses to the array. However it 1522 can introduce significant overhead to the function call, 1523 especially when the passed data is noncontiguous. 1524 1525`-fshort-enums' 1526 This option is provided for interoperability with C code that was 1527 compiled with the `-fshort-enums' option. It will make GNU 1528 Fortran choose the smallest `INTEGER' kind a given enumerator set 1529 will fit in, and give all its enumerators this kind. 1530 1531`-fexternal-blas' 1532 This option will make `gfortran' generate calls to BLAS functions 1533 for some matrix operations like `MATMUL', instead of using our own 1534 algorithms, if the size of the matrices involved is larger than a 1535 given limit (see `-fblas-matmul-limit'). This may be profitable 1536 if an optimized vendor BLAS library is available. The BLAS 1537 library will have to be specified at link time. 1538 1539`-fblas-matmul-limit=N' 1540 Only significant when `-fexternal-blas' is in effect. Matrix 1541 multiplication of matrices with size larger than (or equal to) N 1542 will be performed by calls to BLAS functions, while others will be 1543 handled by `gfortran' internal algorithms. If the matrices 1544 involved are not square, the size comparison is performed using the 1545 geometric mean of the dimensions of the argument and result 1546 matrices. 1547 1548 The default value for N is 30. 1549 1550`-frecursive' 1551 Allow indirect recursion by forcing all local arrays to be 1552 allocated on the stack. This flag cannot be used together with 1553 `-fmax-stack-var-size=' or `-fno-automatic'. 1554 1555`-finit-local-zero' 1556`-finit-integer=N' 1557`-finit-real=<ZERO|INF|-INF|NAN|SNAN>' 1558`-finit-logical=<TRUE|FALSE>' 1559`-finit-character=N' 1560 The `-finit-local-zero' option instructs the compiler to 1561 initialize local `INTEGER', `REAL', and `COMPLEX' variables to 1562 zero, `LOGICAL' variables to false, and `CHARACTER' variables to a 1563 string of null bytes. Finer-grained initialization options are 1564 provided by the `-finit-integer=N', 1565 `-finit-real=<ZERO|INF|-INF|NAN|SNAN>' (which also initializes the 1566 real and imaginary parts of local `COMPLEX' variables), 1567 `-finit-logical=<TRUE|FALSE>', and `-finit-character=N' (where N 1568 is an ASCII character value) options. These options do not 1569 initialize 1570 * allocatable arrays 1571 1572 * components of derived type variables 1573 1574 * variables that appear in an `EQUIVALENCE' statement. 1575 (These limitations may be removed in future releases). 1576 1577 Note that the `-finit-real=nan' option initializes `REAL' and 1578 `COMPLEX' variables with a quiet NaN. For a signalling NaN use 1579 `-finit-real=snan'; note, however, that compile-time optimizations 1580 may convert them into quiet NaN and that trapping needs to be 1581 enabled (e.g. via `-ffpe-trap'). 1582 1583 Finally, note that enabling any of the `-finit-*' options will 1584 silence warnings that would have been emitted by `-Wuninitialized' 1585 for the affected local variables. 1586 1587`-falign-commons' 1588 By default, `gfortran' enforces proper alignment of all variables 1589 in a `COMMON' block by padding them as needed. On certain 1590 platforms this is mandatory, on others it increases performance. 1591 If a `COMMON' block is not declared with consistent data types 1592 everywhere, this padding can cause trouble, and 1593 `-fno-align-commons' can be used to disable automatic alignment. 1594 The same form of this option should be used for all files that 1595 share a `COMMON' block. To avoid potential alignment issues in 1596 `COMMON' blocks, it is recommended to order objects from largest 1597 to smallest. 1598 1599`-fno-protect-parens' 1600 By default the parentheses in expression are honored for all 1601 optimization levels such that the compiler does not do any 1602 re-association. Using `-fno-protect-parens' allows the compiler to 1603 reorder `REAL' and `COMPLEX' expressions to produce faster code. 1604 Note that for the re-association optimization `-fno-signed-zeros' 1605 and `-fno-trapping-math' need to be in effect. The parentheses 1606 protection is enabled by default, unless `-Ofast' is given. 1607 1608`-frealloc-lhs' 1609 An allocatable left-hand side of an intrinsic assignment is 1610 automatically (re)allocated if it is either unallocated or has a 1611 different shape. The option is enabled by default except when 1612 `-std=f95' is given. See also `-Wrealloc-lhs'. 1613 1614`-faggressive-function-elimination' 1615 Functions with identical argument lists are eliminated within 1616 statements, regardless of whether these functions are marked 1617 `PURE' or not. For example, in 1618 a = f(b,c) + f(b,c) 1619 there will only be a single call to `f'. This option only works 1620 if `-ffrontend-optimize' is in effect. 1621 1622`-ffrontend-optimize' 1623 This option performs front-end optimization, based on manipulating 1624 parts the Fortran parse tree. Enabled by default by any `-O' 1625 option. Optimizations enabled by this option include elimination 1626 of identical function calls within expressions, removing 1627 unnecessary calls to `TRIM' in comparisons and assignments and 1628 replacing `TRIM(a)' with `a(1:LEN_TRIM(a))'. It can be deselected 1629 by specifying `-fno-frontend-optimize'. 1630 1631 *Note Options for Code Generation Conventions: (gcc)Code Gen 1632Options, for information on more options offered by the GBE shared by 1633`gfortran', `gcc', and other GNU compilers. 1634 1635 1636File: gfortran.info, Node: Environment Variables, Prev: Code Gen Options, Up: Invoking GNU Fortran 1637 16382.10 Environment variables affecting `gfortran' 1639=============================================== 1640 1641The `gfortran' compiler currently does not make use of any environment 1642variables to control its operation above and beyond those that affect 1643the operation of `gcc'. 1644 1645 *Note Environment Variables Affecting GCC: (gcc)Environment 1646Variables, for information on environment variables. 1647 1648 *Note Runtime::, for environment variables that affect the run-time 1649behavior of programs compiled with GNU Fortran. 1650 1651 1652File: gfortran.info, Node: Runtime, Next: Fortran 2003 and 2008 status, Prev: Invoking GNU Fortran, Up: Top 1653 16543 Runtime: Influencing runtime behavior with environment variables 1655******************************************************************* 1656 1657The behavior of the `gfortran' can be influenced by environment 1658variables. 1659 1660 Malformed environment variables are silently ignored. 1661 1662* Menu: 1663 1664* TMPDIR:: Directory for scratch files 1665* GFORTRAN_STDIN_UNIT:: Unit number for standard input 1666* GFORTRAN_STDOUT_UNIT:: Unit number for standard output 1667* GFORTRAN_STDERR_UNIT:: Unit number for standard error 1668* GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units. 1669* GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units. 1670* GFORTRAN_SHOW_LOCUS:: Show location for runtime errors 1671* GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted 1672* GFORTRAN_DEFAULT_RECL:: Default record length for new files 1673* GFORTRAN_LIST_SEPARATOR:: Separator for list output 1674* GFORTRAN_CONVERT_UNIT:: Set endianness for unformatted I/O 1675* GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors 1676 1677 1678File: gfortran.info, Node: TMPDIR, Next: GFORTRAN_STDIN_UNIT, Up: Runtime 1679 16803.1 `TMPDIR'--Directory for scratch files 1681========================================= 1682 1683When opening a file with `STATUS='SCRATCH'', GNU Fortran tries to 1684create the file in one of the potential directories by testing each 1685directory in the order below. 1686 1687 1. The environment variable `TMPDIR', if it exists. 1688 1689 2. On the MinGW target, the directory returned by the `GetTempPath' 1690 function. Alternatively, on the Cygwin target, the `TMP' and 1691 `TEMP' environment variables, if they exist, in that order. 1692 1693 3. The `P_tmpdir' macro if it is defined, otherwise the directory 1694 `/tmp'. 1695 1696 1697File: gfortran.info, Node: GFORTRAN_STDIN_UNIT, Next: GFORTRAN_STDOUT_UNIT, Prev: TMPDIR, Up: Runtime 1698 16993.2 `GFORTRAN_STDIN_UNIT'--Unit number for standard input 1700========================================================= 1701 1702This environment variable can be used to select the unit number 1703preconnected to standard input. This must be a positive integer. The 1704default value is 5. 1705 1706 1707File: gfortran.info, Node: GFORTRAN_STDOUT_UNIT, Next: GFORTRAN_STDERR_UNIT, Prev: GFORTRAN_STDIN_UNIT, Up: Runtime 1708 17093.3 `GFORTRAN_STDOUT_UNIT'--Unit number for standard output 1710=========================================================== 1711 1712This environment variable can be used to select the unit number 1713preconnected to standard output. This must be a positive integer. The 1714default value is 6. 1715 1716 1717File: gfortran.info, Node: GFORTRAN_STDERR_UNIT, Next: GFORTRAN_UNBUFFERED_ALL, Prev: GFORTRAN_STDOUT_UNIT, Up: Runtime 1718 17193.4 `GFORTRAN_STDERR_UNIT'--Unit number for standard error 1720========================================================== 1721 1722This environment variable can be used to select the unit number 1723preconnected to standard error. This must be a positive integer. The 1724default value is 0. 1725 1726 1727File: gfortran.info, Node: GFORTRAN_UNBUFFERED_ALL, Next: GFORTRAN_UNBUFFERED_PRECONNECTED, Prev: GFORTRAN_STDERR_UNIT, Up: Runtime 1728 17293.5 `GFORTRAN_UNBUFFERED_ALL'--Do not buffer I/O on all units 1730============================================================= 1731 1732This environment variable controls whether all I/O is unbuffered. If 1733the first letter is `y', `Y' or `1', all I/O is unbuffered. This will 1734slow down small sequential reads and writes. If the first letter is 1735`n', `N' or `0', I/O is buffered. This is the default. 1736 1737 1738File: gfortran.info, Node: GFORTRAN_UNBUFFERED_PRECONNECTED, Next: GFORTRAN_SHOW_LOCUS, Prev: GFORTRAN_UNBUFFERED_ALL, Up: Runtime 1739 17403.6 `GFORTRAN_UNBUFFERED_PRECONNECTED'--Do not buffer I/O on preconnected units 1741=============================================================================== 1742 1743The environment variable named `GFORTRAN_UNBUFFERED_PRECONNECTED' 1744controls whether I/O on a preconnected unit (i.e. STDOUT or STDERR) is 1745unbuffered. If the first letter is `y', `Y' or `1', I/O is unbuffered. 1746This will slow down small sequential reads and writes. If the first 1747letter is `n', `N' or `0', I/O is buffered. This is the default. 1748 1749 1750File: gfortran.info, Node: GFORTRAN_SHOW_LOCUS, Next: GFORTRAN_OPTIONAL_PLUS, Prev: GFORTRAN_UNBUFFERED_PRECONNECTED, Up: Runtime 1751 17523.7 `GFORTRAN_SHOW_LOCUS'--Show location for runtime errors 1753=========================================================== 1754 1755If the first letter is `y', `Y' or `1', filename and line numbers for 1756runtime errors are printed. If the first letter is `n', `N' or `0', do 1757not print filename and line numbers for runtime errors. The default is 1758to print the location. 1759 1760 1761File: gfortran.info, Node: GFORTRAN_OPTIONAL_PLUS, Next: GFORTRAN_DEFAULT_RECL, Prev: GFORTRAN_SHOW_LOCUS, Up: Runtime 1762 17633.8 `GFORTRAN_OPTIONAL_PLUS'--Print leading + where permitted 1764============================================================= 1765 1766If the first letter is `y', `Y' or `1', a plus sign is printed where 1767permitted by the Fortran standard. If the first letter is `n', `N' or 1768`0', a plus sign is not printed in most cases. Default is not to print 1769plus signs. 1770 1771 1772File: gfortran.info, Node: GFORTRAN_DEFAULT_RECL, Next: GFORTRAN_LIST_SEPARATOR, Prev: GFORTRAN_OPTIONAL_PLUS, Up: Runtime 1773 17743.9 `GFORTRAN_DEFAULT_RECL'--Default record length for new files 1775================================================================ 1776 1777This environment variable specifies the default record length, in 1778bytes, for files which are opened without a `RECL' tag in the `OPEN' 1779statement. This must be a positive integer. The default value is 17801073741824 bytes (1 GB). 1781 1782 1783File: gfortran.info, Node: GFORTRAN_LIST_SEPARATOR, Next: GFORTRAN_CONVERT_UNIT, Prev: GFORTRAN_DEFAULT_RECL, Up: Runtime 1784 17853.10 `GFORTRAN_LIST_SEPARATOR'--Separator for list output 1786========================================================= 1787 1788This environment variable specifies the separator when writing 1789list-directed output. It may contain any number of spaces and at most 1790one comma. If you specify this on the command line, be sure to quote 1791spaces, as in 1792 $ GFORTRAN_LIST_SEPARATOR=' , ' ./a.out 1793 when `a.out' is the compiled Fortran program that you want to run. 1794Default is a single space. 1795 1796 1797File: gfortran.info, Node: GFORTRAN_CONVERT_UNIT, Next: GFORTRAN_ERROR_BACKTRACE, Prev: GFORTRAN_LIST_SEPARATOR, Up: Runtime 1798 17993.11 `GFORTRAN_CONVERT_UNIT'--Set endianness for unformatted I/O 1800================================================================ 1801 1802By setting the `GFORTRAN_CONVERT_UNIT' variable, it is possible to 1803change the representation of data for unformatted files. The syntax 1804for the `GFORTRAN_CONVERT_UNIT' variable is: 1805 GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ; 1806 mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ; 1807 exception: mode ':' unit_list | unit_list ; 1808 unit_list: unit_spec | unit_list unit_spec ; 1809 unit_spec: INTEGER | INTEGER '-' INTEGER ; 1810 The variable consists of an optional default mode, followed by a 1811list of optional exceptions, which are separated by semicolons from the 1812preceding default and each other. Each exception consists of a format 1813and a comma-separated list of units. Valid values for the modes are 1814the same as for the `CONVERT' specifier: 1815 1816 `NATIVE' Use the native format. This is the default. 1817 1818 `SWAP' Swap between little- and big-endian. 1819 1820 `LITTLE_ENDIAN' Use the little-endian format for unformatted files. 1821 1822 `BIG_ENDIAN' Use the big-endian format for unformatted files. 1823 A missing mode for an exception is taken to mean `BIG_ENDIAN'. 1824Examples of values for `GFORTRAN_CONVERT_UNIT' are: 1825 `'big_endian'' Do all unformatted I/O in big_endian mode. 1826 1827 `'little_endian;native:10-20,25'' Do all unformatted I/O in 1828 little_endian mode, except for units 10 to 20 and 25, which are in 1829 native format. 1830 1831 `'10-20'' Units 10 to 20 are big-endian, the rest is native. 1832 1833 Setting the environment variables should be done on the command line 1834or via the `export' command for `sh'-compatible shells and via `setenv' 1835for `csh'-compatible shells. 1836 1837 Example for `sh': 1838 $ gfortran foo.f90 1839 $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out 1840 1841 Example code for `csh': 1842 % gfortran foo.f90 1843 % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20' 1844 % ./a.out 1845 1846 Using anything but the native representation for unformatted data 1847carries a significant speed overhead. If speed in this area matters to 1848you, it is best if you use this only for data that needs to be portable. 1849 1850 *Note CONVERT specifier::, for an alternative way to specify the 1851data representation for unformatted files. *Note Runtime Options::, for 1852setting a default data representation for the whole program. The 1853`CONVERT' specifier overrides the `-fconvert' compile options. 1854 1855 _Note that the values specified via the GFORTRAN_CONVERT_UNIT 1856environment variable will override the CONVERT specifier in the open 1857statement_. This is to give control over data formats to users who do 1858not have the source code of their program available. 1859 1860 1861File: gfortran.info, Node: GFORTRAN_ERROR_BACKTRACE, Prev: GFORTRAN_CONVERT_UNIT, Up: Runtime 1862 18633.12 `GFORTRAN_ERROR_BACKTRACE'--Show backtrace on run-time errors 1864================================================================== 1865 1866If the `GFORTRAN_ERROR_BACKTRACE' variable is set to `y', `Y' or `1' 1867(only the first letter is relevant) then a backtrace is printed when a 1868serious run-time error occurs. To disable the backtracing, set the 1869variable to `n', `N', `0'. Default is to print a backtrace unless the 1870`-fno-backtrace' compile option was used. 1871 1872 1873File: gfortran.info, Node: Fortran 2003 and 2008 status, Next: Compiler Characteristics, Prev: Runtime, Up: Top 1874 18754 Fortran 2003 and 2008 Status 1876****************************** 1877 1878* Menu: 1879 1880* Fortran 2003 status:: 1881* Fortran 2008 status:: 1882* TS 29113 status:: 1883 1884 1885File: gfortran.info, Node: Fortran 2003 status, Next: Fortran 2008 status, Up: Fortran 2003 and 2008 status 1886 18874.1 Fortran 2003 status 1888======================= 1889 1890GNU Fortran supports several Fortran 2003 features; an incomplete list 1891can be found below. See also the wiki page 1892(http://gcc.gnu.org/wiki/Fortran2003) about Fortran 2003. 1893 1894 * Procedure pointers including procedure-pointer components with 1895 `PASS' attribute. 1896 1897 * Procedures which are bound to a derived type (type-bound 1898 procedures) including `PASS', `PROCEDURE' and `GENERIC', and 1899 operators bound to a type. 1900 1901 * Abstract interfaces and type extension with the possibility to 1902 override type-bound procedures or to have deferred binding. 1903 1904 * Polymorphic entities ("`CLASS'") for derived types - including 1905 `SAME_TYPE_AS', `EXTENDS_TYPE_OF' and `SELECT TYPE' for scalars 1906 and arrays, including unlimited polymorphism. 1907 1908 * Generic interface names, which have the same name as derived types, 1909 are now supported. This allows one to write constructor functions. 1910 Note that Fortran does not support static constructor functions. 1911 For static variables, only default initialization or 1912 structure-constructor initialization are available. 1913 1914 * The `ASSOCIATE' construct. 1915 1916 * Interoperability with C including enumerations, 1917 1918 * In structure constructors the components with default values may be 1919 omitted. 1920 1921 * Extensions to the `ALLOCATE' statement, allowing for a 1922 type-specification with type parameter and for allocation and 1923 initialization from a `SOURCE=' expression; `ALLOCATE' and 1924 `DEALLOCATE' optionally return an error message string via 1925 `ERRMSG='. 1926 1927 * Reallocation on assignment: If an intrinsic assignment is used, an 1928 allocatable variable on the left-hand side is automatically 1929 allocated (if unallocated) or reallocated (if the shape is 1930 different). Currently, scalar deferred character length left-hand 1931 sides are correctly handled but arrays are not yet fully 1932 implemented. 1933 1934 * Transferring of allocations via `MOVE_ALLOC'. 1935 1936 * The `PRIVATE' and `PUBLIC' attributes may be given individually to 1937 derived-type components. 1938 1939 * In pointer assignments, the lower bound may be specified and the 1940 remapping of elements is supported. 1941 1942 * For pointers an `INTENT' may be specified which affect the 1943 association status not the value of the pointer target. 1944 1945 * Intrinsics `command_argument_count', `get_command', 1946 `get_command_argument', and `get_environment_variable'. 1947 1948 * Support for Unicode characters (ISO 10646) and UTF-8, including 1949 the `SELECTED_CHAR_KIND' and `NEW_LINE' intrinsic functions. 1950 1951 * Support for binary, octal and hexadecimal (BOZ) constants in the 1952 intrinsic functions `INT', `REAL', `CMPLX' and `DBLE'. 1953 1954 * Support for namelist variables with allocatable and pointer 1955 attribute and nonconstant length type parameter. 1956 1957 * Array constructors using square brackets. That is, `[...]' rather 1958 than `(/.../)'. Type-specification for array constructors like 1959 `(/ some-type :: ... /)'. 1960 1961 * Extensions to the specification and initialization expressions, 1962 including the support for intrinsics with real and complex 1963 arguments. 1964 1965 * Support for the asynchronous input/output syntax; however, the 1966 data transfer is currently always synchronously performed. 1967 1968 * `FLUSH' statement. 1969 1970 * `IOMSG=' specifier for I/O statements. 1971 1972 * Support for the declaration of enumeration constants via the 1973 `ENUM' and `ENUMERATOR' statements. Interoperability with `gcc' 1974 is guaranteed also for the case where the `-fshort-enums' command 1975 line option is given. 1976 1977 * TR 15581: 1978 * `ALLOCATABLE' dummy arguments. 1979 1980 * `ALLOCATABLE' function results 1981 1982 * `ALLOCATABLE' components of derived types 1983 1984 * The `OPEN' statement supports the `ACCESS='STREAM'' specifier, 1985 allowing I/O without any record structure. 1986 1987 * Namelist input/output for internal files. 1988 1989 * Further I/O extensions: Rounding during formatted output, using of 1990 a decimal comma instead of a decimal point, setting whether a plus 1991 sign should appear for positive numbers. 1992 1993 * The `PROTECTED' statement and attribute. 1994 1995 * The `VALUE' statement and attribute. 1996 1997 * The `VOLATILE' statement and attribute. 1998 1999 * The `IMPORT' statement, allowing to import host-associated derived 2000 types. 2001 2002 * The intrinsic modules `ISO_FORTRAN_ENVIRONMENT' is supported, 2003 which contains parameters of the I/O units, storage sizes. 2004 Additionally, procedures for C interoperability are available in 2005 the `ISO_C_BINDING' module. 2006 2007 * `USE' statement with `INTRINSIC' and `NON_INTRINSIC' attribute; 2008 supported intrinsic modules: `ISO_FORTRAN_ENV', `ISO_C_BINDING', 2009 `OMP_LIB' and `OMP_LIB_KINDS'. 2010 2011 * Renaming of operators in the `USE' statement. 2012 2013 2014 2015File: gfortran.info, Node: Fortran 2008 status, Next: TS 29113 status, Prev: Fortran 2003 status, Up: Fortran 2003 and 2008 status 2016 20174.2 Fortran 2008 status 2018======================= 2019 2020The latest version of the Fortran standard is ISO/IEC 1539-1:2010, 2021informally known as Fortran 2008. The official version is available 2022from International Organization for Standardization (ISO) or its 2023national member organizations. The the final draft (FDIS) can be 2024downloaded free of charge from 2025`http://www.nag.co.uk/sc22wg5/links.html'. Fortran is developed by the 2026Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1 2027of the International Organization for Standardization and the 2028International Electrotechnical Commission (IEC). This group is known as 2029WG5 (http://www.nag.co.uk/sc22wg5/). 2030 2031 The GNU Fortran compiler supports several of the new features of 2032Fortran 2008; the wiki (http://gcc.gnu.org/wiki/Fortran2008Status) has 2033some information about the current Fortran 2008 implementation status. 2034In particular, the following is implemented. 2035 2036 * The `-std=f2008' option and support for the file extensions `.f08' 2037 and `.F08'. 2038 2039 * The `OPEN' statement now supports the `NEWUNIT=' option, which 2040 returns a unique file unit, thus preventing inadvertent use of the 2041 same unit in different parts of the program. 2042 2043 * The `g0' format descriptor and unlimited format items. 2044 2045 * The mathematical intrinsics `ASINH', `ACOSH', `ATANH', `ERF', 2046 `ERFC', `GAMMA', `LOG_GAMMA', `BESSEL_J0', `BESSEL_J1', 2047 `BESSEL_JN', `BESSEL_Y0', `BESSEL_Y1', `BESSEL_YN', `HYPOT', 2048 `NORM2', and `ERFC_SCALED'. 2049 2050 * Using complex arguments with `TAN', `SINH', `COSH', `TANH', 2051 `ASIN', `ACOS', and `ATAN' is now possible; `ATAN'(Y,X) is now an 2052 alias for `ATAN2'(Y,X). 2053 2054 * Support of the `PARITY' intrinsic functions. 2055 2056 * The following bit intrinsics: `LEADZ' and `TRAILZ' for counting 2057 the number of leading and trailing zero bits, `POPCNT' and 2058 `POPPAR' for counting the number of one bits and returning the 2059 parity; `BGE', `BGT', `BLE', and `BLT' for bitwise comparisons; 2060 `DSHIFTL' and `DSHIFTR' for combined left and right shifts, 2061 `MASKL' and `MASKR' for simple left and right justified masks, 2062 `MERGE_BITS' for a bitwise merge using a mask, `SHIFTA', `SHIFTL' 2063 and `SHIFTR' for shift operations, and the transformational bit 2064 intrinsics `IALL', `IANY' and `IPARITY'. 2065 2066 * Support of the `EXECUTE_COMMAND_LINE' intrinsic subroutine. 2067 2068 * Support for the `STORAGE_SIZE' intrinsic inquiry function. 2069 2070 * The `INT{8,16,32}' and `REAL{32,64,128}' kind type parameters and 2071 the array-valued named constants `INTEGER_KINDS', `LOGICAL_KINDS', 2072 `REAL_KINDS' and `CHARACTER_KINDS' of the intrinsic module 2073 `ISO_FORTRAN_ENV'. 2074 2075 * The module procedures `C_SIZEOF' of the intrinsic module 2076 `ISO_C_BINDINGS' and `COMPILER_VERSION' and `COMPILER_OPTIONS' of 2077 `ISO_FORTRAN_ENV'. 2078 2079 * Coarray support for serial programs with `-fcoarray=single' flag 2080 and experimental support for multiple images with the 2081 `-fcoarray=lib' flag. 2082 2083 * The `DO CONCURRENT' construct is supported. 2084 2085 * The `BLOCK' construct is supported. 2086 2087 * The `STOP' and the new `ERROR STOP' statements now support all 2088 constant expressions. 2089 2090 * Support for the `CONTIGUOUS' attribute. 2091 2092 * Support for `ALLOCATE' with `MOLD'. 2093 2094 * Support for the `IMPURE' attribute for procedures, which allows 2095 for `ELEMENTAL' procedures without the restrictions of `PURE'. 2096 2097 * Null pointers (including `NULL()') and not-allocated variables can 2098 be used as actual argument to optional non-pointer, non-allocatable 2099 dummy arguments, denoting an absent argument. 2100 2101 * Non-pointer variables with `TARGET' attribute can be used as 2102 actual argument to `POINTER' dummies with `INTENT(IN)'. 2103 2104 * Pointers including procedure pointers and those in a derived type 2105 (pointer components) can now be initialized by a target instead of 2106 only by `NULL'. 2107 2108 * The `EXIT' statement (with construct-name) can be now be used to 2109 leave not only the `DO' but also the `ASSOCIATE', `BLOCK', `IF', 2110 `SELECT CASE' and `SELECT TYPE' constructs. 2111 2112 * Internal procedures can now be used as actual argument. 2113 2114 * Minor features: obsolesce diagnostics for `ENTRY' with 2115 `-std=f2008'; a line may start with a semicolon; for internal and 2116 module procedures `END' can be used instead of `END SUBROUTINE' 2117 and `END FUNCTION'; `SELECTED_REAL_KIND' now also takes a `RADIX' 2118 argument; intrinsic types are supported for 2119 `TYPE'(INTRINSIC-TYPE-SPEC); multiple type-bound procedures can be 2120 declared in a single `PROCEDURE' statement; implied-shape arrays 2121 are supported for named constants (`PARAMETER'). 2122 2123 2124File: gfortran.info, Node: TS 29113 status, Prev: Fortran 2008 status, Up: Fortran 2003 and 2008 status 2125 21264.3 Technical Specification 29113 Status 2127======================================== 2128 2129GNU Fortran supports some of the new features of the Technical 2130Specification (TS) 29113 on Further Interoperability of Fortran with C. 2131The wiki (http://gcc.gnu.org/wiki/TS29113Status) has some information 2132about the current TS 29113 implementation status. In particular, the 2133following is implemented. 2134 2135 See also *note Further Interoperability of Fortran with C::. 2136 2137 * The `-std=f2008ts' option. 2138 2139 * The `OPTIONAL' attribute is allowed for dummy arguments of 2140 `BIND(C) procedures.' 2141 2142 * The `RANK' intrinsic is supported. 2143 2144 * GNU Fortran's implementation for variables with `ASYNCHRONOUS' 2145 attribute is compatible with TS 29113. 2146 2147 * Assumed types (`TYPE(*)'. 2148 2149 * Assumed-rank (`DIMENSION(..)'). However, the array descriptor of 2150 the TS is not yet supported. 2151 2152 2153File: gfortran.info, Node: Compiler Characteristics, Next: Extensions, Prev: Fortran 2003 and 2008 status, Up: Top 2154 21555 Compiler Characteristics 2156************************** 2157 2158This chapter describes certain characteristics of the GNU Fortran 2159compiler, that are not specified by the Fortran standard, but which 2160might in some way or another become visible to the programmer. 2161 2162* Menu: 2163 2164* KIND Type Parameters:: 2165* Internal representation of LOGICAL variables:: 2166* Thread-safety of the runtime library:: 2167* Data consistency and durability:: 2168 2169 2170File: gfortran.info, Node: KIND Type Parameters, Next: Internal representation of LOGICAL variables, Up: Compiler Characteristics 2171 21725.1 KIND Type Parameters 2173======================== 2174 2175The `KIND' type parameters supported by GNU Fortran for the primitive 2176data types are: 2177 2178`INTEGER' 2179 1, 2, 4, 8*, 16*, default: 4 (1) 2180 2181`LOGICAL' 2182 1, 2, 4, 8*, 16*, default: 4 (1) 2183 2184`REAL' 2185 4, 8, 10*, 16*, default: 4 (2) 2186 2187`COMPLEX' 2188 4, 8, 10*, 16*, default: 4 (2) 2189 2190`CHARACTER' 2191 1, 4, default: 1 2192 2193 2194* = not available on all systems 2195(1) Unless -fdefault-integer-8 is used 2196(2) Unless -fdefault-real-8 is used 2197 2198The `KIND' value matches the storage size in bytes, except for 2199`COMPLEX' where the storage size is twice as much (or both real and 2200imaginary part are a real value of the given size). It is recommended 2201to use the `SELECTED_CHAR_KIND', `SELECTED_INT_KIND' and 2202`SELECTED_REAL_KIND' intrinsics or the `INT8', `INT16', `INT32', 2203`INT64', `REAL32', `REAL64', and `REAL128' parameters of the 2204`ISO_FORTRAN_ENV' module instead of the concrete values. The available 2205kind parameters can be found in the constant arrays `CHARACTER_KINDS', 2206`INTEGER_KINDS', `LOGICAL_KINDS' and `REAL_KINDS' in the 2207`ISO_FORTRAN_ENV' module (see *note ISO_FORTRAN_ENV::). 2208 2209 2210File: gfortran.info, Node: Internal representation of LOGICAL variables, Next: Thread-safety of the runtime library, Prev: KIND Type Parameters, Up: Compiler Characteristics 2211 22125.2 Internal representation of LOGICAL variables 2213================================================ 2214 2215The Fortran standard does not specify how variables of `LOGICAL' type 2216are represented, beyond requiring that `LOGICAL' variables of default 2217kind have the same storage size as default `INTEGER' and `REAL' 2218variables. The GNU Fortran internal representation is as follows. 2219 2220 A `LOGICAL(KIND=N)' variable is represented as an `INTEGER(KIND=N)' 2221variable, however, with only two permissible values: `1' for `.TRUE.' 2222and `0' for `.FALSE.'. Any other integer value results in undefined 2223behavior. 2224 2225 Note that for mixed-language programming using the `ISO_C_BINDING' 2226feature, there is a `C_BOOL' kind that can be used to create 2227`LOGICAL(KIND=C_BOOL)' variables which are interoperable with the C99 2228_Bool type. The C99 _Bool type has an internal representation 2229described in the C99 standard, which is identical to the above 2230description, i.e. with 1 for true and 0 for false being the only 2231permissible values. Thus the internal representation of `LOGICAL' 2232variables in GNU Fortran is identical to C99 _Bool, except for a 2233possible difference in storage size depending on the kind. 2234 2235 2236File: gfortran.info, Node: Thread-safety of the runtime library, Next: Data consistency and durability, Prev: Internal representation of LOGICAL variables, Up: Compiler Characteristics 2237 22385.3 Thread-safety of the runtime library 2239======================================== 2240 2241GNU Fortran can be used in programs with multiple threads, e.g. by 2242using OpenMP, by calling OS thread handling functions via the 2243`ISO_C_BINDING' facility, or by GNU Fortran compiled library code being 2244called from a multi-threaded program. 2245 2246 The GNU Fortran runtime library, (`libgfortran'), supports being 2247called concurrently from multiple threads with the following exceptions. 2248 2249 During library initialization, the C `getenv' function is used, 2250which need not be thread-safe. Similarly, the `getenv' function is 2251used to implement the `GET_ENVIRONMENT_VARIABLE' and `GETENV' 2252intrinsics. It is the responsibility of the user to ensure that the 2253environment is not being updated concurrently when any of these actions 2254are taking place. 2255 2256 The `EXECUTE_COMMAND_LINE' and `SYSTEM' intrinsics are implemented 2257with the `system' function, which need not be thread-safe. It is the 2258responsibility of the user to ensure that `system' is not called 2259concurrently. 2260 2261 Finally, for platforms not supporting thread-safe POSIX functions, 2262further functionality might not be thread-safe. For details, please 2263consult the documentation for your operating system. 2264 2265 2266File: gfortran.info, Node: Data consistency and durability, Prev: Thread-safety of the runtime library, Up: Compiler Characteristics 2267 22685.4 Data consistency and durability 2269=================================== 2270 2271This section contains a brief overview of data and metadata consistency 2272and durability issues when doing I/O. 2273 2274 With respect to durability, GNU Fortran makes no effort to ensure 2275that data is committed to stable storage. If this is required, the GNU 2276Fortran programmer can use the intrinsic `FNUM' to retrieve the low 2277level file descriptor corresponding to an open Fortran unit. Then, 2278using e.g. the `ISO_C_BINDING' feature, one can call the underlying 2279system call to flush dirty data to stable storage, such as `fsync' on 2280POSIX, `_commit' on MingW, or `fcntl(fd, F_FULLSYNC, 0)' on Mac OS X. 2281The following example shows how to call fsync: 2282 2283 ! Declare the interface for POSIX fsync function 2284 interface 2285 function fsync (fd) bind(c,name="fsync") 2286 use iso_c_binding, only: c_int 2287 integer(c_int), value :: fd 2288 integer(c_int) :: fsync 2289 end function fsync 2290 end interface 2291 2292 ! Variable declaration 2293 integer :: ret 2294 2295 ! Opening unit 10 2296 open (10,file="foo") 2297 2298 ! ... 2299 ! Perform I/O on unit 10 2300 ! ... 2301 2302 ! Flush and sync 2303 flush(10) 2304 ret = fsync(fnum(10)) 2305 2306 ! Handle possible error 2307 if (ret /= 0) stop "Error calling FSYNC" 2308 2309 With respect to consistency, for regular files GNU Fortran uses 2310buffered I/O in order to improve performance. This buffer is flushed 2311automatically when full and in some other situations, e.g. when closing 2312a unit. It can also be explicitly flushed with the `FLUSH' statement. 2313Also, the buffering can be turned off with the 2314`GFORTRAN_UNBUFFERED_ALL' and `GFORTRAN_UNBUFFERED_PRECONNECTED' 2315environment variables. Special files, such as terminals and pipes, are 2316always unbuffered. Sometimes, however, further things may need to be 2317done in order to allow other processes to see data that GNU Fortran has 2318written, as follows. 2319 2320 The Windows platform supports a relaxed metadata consistency model, 2321where file metadata is written to the directory lazily. This means 2322that, for instance, the `dir' command can show a stale size for a file. 2323One can force a directory metadata update by closing the unit, or by 2324calling `_commit' on the file descriptor. Note, though, that `_commit' 2325will force all dirty data to stable storage, which is often a very slow 2326operation. 2327 2328 The Network File System (NFS) implements a relaxed consistency model 2329called open-to-close consistency. Closing a file forces dirty data and 2330metadata to be flushed to the server, and opening a file forces the 2331client to contact the server in order to revalidate cached data. 2332`fsync' will also force a flush of dirty data and metadata to the 2333server. Similar to `open' and `close', acquiring and releasing `fcntl' 2334file locks, if the server supports them, will also force cache 2335validation and flushing dirty data and metadata. 2336 2337 2338File: gfortran.info, Node: Extensions, Next: Mixed-Language Programming, Prev: Compiler Characteristics, Up: Top 2339 23406 Extensions 2341************ 2342 2343The two sections below detail the extensions to standard Fortran that 2344are implemented in GNU Fortran, as well as some of the popular or 2345historically important extensions that are not (or not yet) implemented. 2346For the latter case, we explain the alternatives available to GNU 2347Fortran users, including replacement by standard-conforming code or GNU 2348extensions. 2349 2350* Menu: 2351 2352* Extensions implemented in GNU Fortran:: 2353* Extensions not implemented in GNU Fortran:: 2354 2355 2356File: gfortran.info, Node: Extensions implemented in GNU Fortran, Next: Extensions not implemented in GNU Fortran, Up: Extensions 2357 23586.1 Extensions implemented in GNU Fortran 2359========================================= 2360 2361GNU Fortran implements a number of extensions over standard Fortran. 2362This chapter contains information on their syntax and meaning. There 2363are currently two categories of GNU Fortran extensions, those that 2364provide functionality beyond that provided by any standard, and those 2365that are supported by GNU Fortran purely for backward compatibility 2366with legacy compilers. By default, `-std=gnu' allows the compiler to 2367accept both types of extensions, but to warn about the use of the 2368latter. Specifying either `-std=f95', `-std=f2003' or `-std=f2008' 2369disables both types of extensions, and `-std=legacy' allows both 2370without warning. 2371 2372* Menu: 2373 2374* Old-style kind specifications:: 2375* Old-style variable initialization:: 2376* Extensions to namelist:: 2377* X format descriptor without count field:: 2378* Commas in FORMAT specifications:: 2379* Missing period in FORMAT specifications:: 2380* I/O item lists:: 2381* `Q' exponent-letter:: 2382* BOZ literal constants:: 2383* Real array indices:: 2384* Unary operators:: 2385* Implicitly convert LOGICAL and INTEGER values:: 2386* Hollerith constants support:: 2387* Cray pointers:: 2388* CONVERT specifier:: 2389* OpenMP:: 2390* Argument list functions:: 2391 2392 2393File: gfortran.info, Node: Old-style kind specifications, Next: Old-style variable initialization, Up: Extensions implemented in GNU Fortran 2394 23956.1.1 Old-style kind specifications 2396----------------------------------- 2397 2398GNU Fortran allows old-style kind specifications in declarations. These 2399look like: 2400 TYPESPEC*size x,y,z 2401 where `TYPESPEC' is a basic type (`INTEGER', `REAL', etc.), and 2402where `size' is a byte count corresponding to the storage size of a 2403valid kind for that type. (For `COMPLEX' variables, `size' is the 2404total size of the real and imaginary parts.) The statement then 2405declares `x', `y' and `z' to be of type `TYPESPEC' with the appropriate 2406kind. This is equivalent to the standard-conforming declaration 2407 TYPESPEC(k) x,y,z 2408 where `k' is the kind parameter suitable for the intended precision. 2409As kind parameters are implementation-dependent, use the `KIND', 2410`SELECTED_INT_KIND' and `SELECTED_REAL_KIND' intrinsics to retrieve the 2411correct value, for instance `REAL*8 x' can be replaced by: 2412 INTEGER, PARAMETER :: dbl = KIND(1.0d0) 2413 REAL(KIND=dbl) :: x 2414 2415 2416File: gfortran.info, Node: Old-style variable initialization, Next: Extensions to namelist, Prev: Old-style kind specifications, Up: Extensions implemented in GNU Fortran 2417 24186.1.2 Old-style variable initialization 2419--------------------------------------- 2420 2421GNU Fortran allows old-style initialization of variables of the form: 2422 INTEGER i/1/,j/2/ 2423 REAL x(2,2) /3*0.,1./ 2424 The syntax for the initializers is as for the `DATA' statement, but 2425unlike in a `DATA' statement, an initializer only applies to the 2426variable immediately preceding the initialization. In other words, 2427something like `INTEGER I,J/2,3/' is not valid. This style of 2428initialization is only allowed in declarations without double colons 2429(`::'); the double colons were introduced in Fortran 90, which also 2430introduced a standard syntax for initializing variables in type 2431declarations. 2432 2433 Examples of standard-conforming code equivalent to the above example 2434are: 2435 ! Fortran 90 2436 INTEGER :: i = 1, j = 2 2437 REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x)) 2438 ! Fortran 77 2439 INTEGER i, j 2440 REAL x(2,2) 2441 DATA i/1/, j/2/, x/3*0.,1./ 2442 2443 Note that variables which are explicitly initialized in declarations 2444or in `DATA' statements automatically acquire the `SAVE' attribute. 2445 2446 2447File: gfortran.info, Node: Extensions to namelist, Next: X format descriptor without count field, Prev: Old-style variable initialization, Up: Extensions implemented in GNU Fortran 2448 24496.1.3 Extensions to namelist 2450---------------------------- 2451 2452GNU Fortran fully supports the Fortran 95 standard for namelist I/O 2453including array qualifiers, substrings and fully qualified derived 2454types. The output from a namelist write is compatible with namelist 2455read. The output has all names in upper case and indentation to column 24561 after the namelist name. Two extensions are permitted: 2457 2458 Old-style use of `$' instead of `&' 2459 $MYNML 2460 X(:)%Y(2) = 1.0 2.0 3.0 2461 CH(1:4) = "abcd" 2462 $END 2463 2464 It should be noted that the default terminator is `/' rather than 2465`&END'. 2466 2467 Querying of the namelist when inputting from stdin. After at least 2468one space, entering `?' sends to stdout the namelist name and the names 2469of the variables in the namelist: 2470 ? 2471 2472 &mynml 2473 x 2474 x%y 2475 ch 2476 &end 2477 2478 Entering `=?' outputs the namelist to stdout, as if `WRITE(*,NML = 2479mynml)' had been called: 2480 =? 2481 2482 &MYNML 2483 X(1)%Y= 0.000000 , 1.000000 , 0.000000 , 2484 X(2)%Y= 0.000000 , 2.000000 , 0.000000 , 2485 X(3)%Y= 0.000000 , 3.000000 , 0.000000 , 2486 CH=abcd, / 2487 2488 To aid this dialog, when input is from stdin, errors send their 2489messages to stderr and execution continues, even if `IOSTAT' is set. 2490 2491 `PRINT' namelist is permitted. This causes an error if `-std=f95' 2492is used. 2493 PROGRAM test_print 2494 REAL, dimension (4) :: x = (/1.0, 2.0, 3.0, 4.0/) 2495 NAMELIST /mynml/ x 2496 PRINT mynml 2497 END PROGRAM test_print 2498 2499 Expanded namelist reads are permitted. This causes an error if 2500`-std=f95' is used. In the following example, the first element of the 2501array will be given the value 0.00 and the two succeeding elements will 2502be given the values 1.00 and 2.00. 2503 &MYNML 2504 X(1,1) = 0.00 , 1.00 , 2.00 2505 / 2506 2507 2508File: gfortran.info, Node: X format descriptor without count field, Next: Commas in FORMAT specifications, Prev: Extensions to namelist, Up: Extensions implemented in GNU Fortran 2509 25106.1.4 `X' format descriptor without count field 2511----------------------------------------------- 2512 2513To support legacy codes, GNU Fortran permits the count field of the `X' 2514edit descriptor in `FORMAT' statements to be omitted. When omitted, 2515the count is implicitly assumed to be one. 2516 2517 PRINT 10, 2, 3 2518 10 FORMAT (I1, X, I1) 2519 2520 2521File: 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 2522 25236.1.5 Commas in `FORMAT' specifications 2524--------------------------------------- 2525 2526To support legacy codes, GNU Fortran allows the comma separator to be 2527omitted immediately before and after character string edit descriptors 2528in `FORMAT' statements. 2529 2530 PRINT 10, 2, 3 2531 10 FORMAT ('FOO='I1' BAR='I2) 2532 2533 2534File: gfortran.info, Node: Missing period in FORMAT specifications, Next: I/O item lists, Prev: Commas in FORMAT specifications, Up: Extensions implemented in GNU Fortran 2535 25366.1.6 Missing period in `FORMAT' specifications 2537----------------------------------------------- 2538 2539To support legacy codes, GNU Fortran allows missing periods in format 2540specifications if and only if `-std=legacy' is given on the command 2541line. This is considered non-conforming code and is discouraged. 2542 2543 REAL :: value 2544 READ(*,10) value 2545 10 FORMAT ('F4') 2546 2547 2548File: gfortran.info, Node: I/O item lists, Next: `Q' exponent-letter, Prev: Missing period in FORMAT specifications, Up: Extensions implemented in GNU Fortran 2549 25506.1.7 I/O item lists 2551-------------------- 2552 2553To support legacy codes, GNU Fortran allows the input item list of the 2554`READ' statement, and the output item lists of the `WRITE' and `PRINT' 2555statements, to start with a comma. 2556 2557 2558File: gfortran.info, Node: `Q' exponent-letter, Next: BOZ literal constants, Prev: I/O item lists, Up: Extensions implemented in GNU Fortran 2559 25606.1.8 `Q' exponent-letter 2561------------------------- 2562 2563GNU Fortran accepts real literal constants with an exponent-letter of 2564`Q', for example, `1.23Q45'. The constant is interpreted as a 2565`REAL(16)' entity on targets that support this type. If the target 2566does not support `REAL(16)' but has a `REAL(10)' type, then the 2567real-literal-constant will be interpreted as a `REAL(10)' entity. In 2568the absence of `REAL(16)' and `REAL(10)', an error will occur. 2569 2570 2571File: gfortran.info, Node: BOZ literal constants, Next: Real array indices, Prev: `Q' exponent-letter, Up: Extensions implemented in GNU Fortran 2572 25736.1.9 BOZ literal constants 2574--------------------------- 2575 2576Besides decimal constants, Fortran also supports binary (`b'), octal 2577(`o') and hexadecimal (`z') integer constants. The syntax is: `prefix 2578quote digits quote', were the prefix is either `b', `o' or `z', quote 2579is either `'' or `"' and the digits are for binary `0' or `1', for 2580octal between `0' and `7', and for hexadecimal between `0' and `F'. 2581(Example: `b'01011101''.) 2582 2583 Up to Fortran 95, BOZ literals were only allowed to initialize 2584integer variables in DATA statements. Since Fortran 2003 BOZ literals 2585are also allowed as argument of `REAL', `DBLE', `INT' and `CMPLX'; the 2586result is the same as if the integer BOZ literal had been converted by 2587`TRANSFER' to, respectively, `real', `double precision', `integer' or 2588`complex'. As GNU Fortran extension the intrinsic procedures `FLOAT', 2589`DFLOAT', `COMPLEX' and `DCMPLX' are treated alike. 2590 2591 As an extension, GNU Fortran allows hexadecimal BOZ literal 2592constants to be specified using the `X' prefix, in addition to the 2593standard `Z' prefix. The BOZ literal can also be specified by adding a 2594suffix to the string, for example, `Z'ABC'' and `'ABC'Z' are equivalent. 2595 2596 Furthermore, GNU Fortran allows using BOZ literal constants outside 2597DATA statements and the four intrinsic functions allowed by Fortran 25982003. In DATA statements, in direct assignments, where the right-hand 2599side only contains a BOZ literal constant, and for old-style 2600initializers of the form `integer i /o'0173'/', the constant is 2601transferred as if `TRANSFER' had been used; for `COMPLEX' numbers, only 2602the real part is initialized unless `CMPLX' is used. In all other 2603cases, the BOZ literal constant is converted to an `INTEGER' value with 2604the largest decimal representation. This value is then converted 2605numerically to the type and kind of the variable in question. (For 2606instance, `real :: r = b'0000001' + 1' initializes `r' with `2.0'.) As 2607different compilers implement the extension differently, one should be 2608careful when doing bitwise initialization of non-integer variables. 2609 2610 Note that initializing an `INTEGER' variable with a statement such 2611as `DATA i/Z'FFFFFFFF'/' will give an integer overflow error rather 2612than the desired result of -1 when `i' is a 32-bit integer on a system 2613that supports 64-bit integers. The `-fno-range-check' option can be 2614used as a workaround for legacy code that initializes integers in this 2615manner. 2616 2617 2618File: gfortran.info, Node: Real array indices, Next: Unary operators, Prev: BOZ literal constants, Up: Extensions implemented in GNU Fortran 2619 26206.1.10 Real array indices 2621------------------------- 2622 2623As an extension, GNU Fortran allows the use of `REAL' expressions or 2624variables as array indices. 2625 2626 2627File: gfortran.info, Node: Unary operators, Next: Implicitly convert LOGICAL and INTEGER values, Prev: Real array indices, Up: Extensions implemented in GNU Fortran 2628 26296.1.11 Unary operators 2630---------------------- 2631 2632As an extension, GNU Fortran allows unary plus and unary minus operators 2633to appear as the second operand of binary arithmetic operators without 2634the need for parenthesis. 2635 2636 X = Y * -Z 2637 2638 2639File: gfortran.info, Node: Implicitly convert LOGICAL and INTEGER values, Next: Hollerith constants support, Prev: Unary operators, Up: Extensions implemented in GNU Fortran 2640 26416.1.12 Implicitly convert `LOGICAL' and `INTEGER' values 2642-------------------------------------------------------- 2643 2644As an extension for backwards compatibility with other compilers, GNU 2645Fortran allows the implicit conversion of `LOGICAL' values to `INTEGER' 2646values and vice versa. When converting from a `LOGICAL' to an 2647`INTEGER', `.FALSE.' is interpreted as zero, and `.TRUE.' is 2648interpreted as one. When converting from `INTEGER' to `LOGICAL', the 2649value zero is interpreted as `.FALSE.' and any nonzero value is 2650interpreted as `.TRUE.'. 2651 2652 LOGICAL :: l 2653 l = 1 2654 2655 INTEGER :: i 2656 i = .TRUE. 2657 2658 However, there is no implicit conversion of `INTEGER' values in 2659`if'-statements, nor of `LOGICAL' or `INTEGER' values in I/O operations. 2660 2661 2662File: gfortran.info, Node: Hollerith constants support, Next: Cray pointers, Prev: Implicitly convert LOGICAL and INTEGER values, Up: Extensions implemented in GNU Fortran 2663 26646.1.13 Hollerith constants support 2665---------------------------------- 2666 2667GNU Fortran supports Hollerith constants in assignments, function 2668arguments, and `DATA' and `ASSIGN' statements. A Hollerith constant is 2669written as a string of characters preceded by an integer constant 2670indicating the character count, and the letter `H' or `h', and stored 2671in bytewise fashion in a numeric (`INTEGER', `REAL', or `complex') or 2672`LOGICAL' variable. The constant will be padded or truncated to fit 2673the size of the variable in which it is stored. 2674 2675 Examples of valid uses of Hollerith constants: 2676 complex*16 x(2) 2677 data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/ 2678 x(1) = 16HABCDEFGHIJKLMNOP 2679 call foo (4h abc) 2680 2681 Invalid Hollerith constants examples: 2682 integer*4 a 2683 a = 8H12345678 ! Valid, but the Hollerith constant will be truncated. 2684 a = 0H ! At least one character is needed. 2685 2686 In general, Hollerith constants were used to provide a rudimentary 2687facility for handling character strings in early Fortran compilers, 2688prior to the introduction of `CHARACTER' variables in Fortran 77; in 2689those cases, the standard-compliant equivalent is to convert the 2690program to use proper character strings. On occasion, there may be a 2691case where the intent is specifically to initialize a numeric variable 2692with a given byte sequence. In these cases, the same result can be 2693obtained by using the `TRANSFER' statement, as in this example. 2694 INTEGER(KIND=4) :: a 2695 a = TRANSFER ("abcd", a) ! equivalent to: a = 4Habcd 2696 2697 2698File: gfortran.info, Node: Cray pointers, Next: CONVERT specifier, Prev: Hollerith constants support, Up: Extensions implemented in GNU Fortran 2699 27006.1.14 Cray pointers 2701-------------------- 2702 2703Cray pointers are part of a non-standard extension that provides a 2704C-like pointer in Fortran. This is accomplished through a pair of 2705variables: an integer "pointer" that holds a memory address, and a 2706"pointee" that is used to dereference the pointer. 2707 2708 Pointer/pointee pairs are declared in statements of the form: 2709 pointer ( <pointer> , <pointee> ) 2710 or, 2711 pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ... 2712 The pointer is an integer that is intended to hold a memory address. 2713The pointee may be an array or scalar. A pointee can be an assumed 2714size array--that is, the last dimension may be left unspecified by 2715using a `*' in place of a value--but a pointee cannot be an assumed 2716shape array. No space is allocated for the pointee. 2717 2718 The pointee may have its type declared before or after the pointer 2719statement, and its array specification (if any) may be declared before, 2720during, or after the pointer statement. The pointer may be declared as 2721an integer prior to the pointer statement. However, some machines have 2722default integer sizes that are different than the size of a pointer, 2723and so the following code is not portable: 2724 integer ipt 2725 pointer (ipt, iarr) 2726 If a pointer is declared with a kind that is too small, the compiler 2727will issue a warning; the resulting binary will probably not work 2728correctly, because the memory addresses stored in the pointers may be 2729truncated. It is safer to omit the first line of the above example; if 2730explicit declaration of ipt's type is omitted, then the compiler will 2731ensure that ipt is an integer variable large enough to hold a pointer. 2732 2733 Pointer arithmetic is valid with Cray pointers, but it is not the 2734same as C pointer arithmetic. Cray pointers are just ordinary 2735integers, so the user is responsible for determining how many bytes to 2736add to a pointer in order to increment it. Consider the following 2737example: 2738 real target(10) 2739 real pointee(10) 2740 pointer (ipt, pointee) 2741 ipt = loc (target) 2742 ipt = ipt + 1 2743 The last statement does not set `ipt' to the address of `target(1)', 2744as it would in C pointer arithmetic. Adding `1' to `ipt' just adds one 2745byte to the address stored in `ipt'. 2746 2747 Any expression involving the pointee will be translated to use the 2748value stored in the pointer as the base address. 2749 2750 To get the address of elements, this extension provides an intrinsic 2751function `LOC()'. The `LOC()' function is equivalent to the `&' 2752operator in C, except the address is cast to an integer type: 2753 real ar(10) 2754 pointer(ipt, arpte(10)) 2755 real arpte 2756 ipt = loc(ar) ! Makes arpte is an alias for ar 2757 arpte(1) = 1.0 ! Sets ar(1) to 1.0 2758 The pointer can also be set by a call to the `MALLOC' intrinsic (see 2759*note MALLOC::). 2760 2761 Cray pointees often are used to alias an existing variable. For 2762example: 2763 integer target(10) 2764 integer iarr(10) 2765 pointer (ipt, iarr) 2766 ipt = loc(target) 2767 As long as `ipt' remains unchanged, `iarr' is now an alias for 2768`target'. The optimizer, however, will not detect this aliasing, so it 2769is unsafe to use `iarr' and `target' simultaneously. Using a pointee 2770in any way that violates the Fortran aliasing rules or assumptions is 2771illegal. It is the user's responsibility to avoid doing this; the 2772compiler works under the assumption that no such aliasing occurs. 2773 2774 Cray pointers will work correctly when there is no aliasing (i.e., 2775when they are used to access a dynamically allocated block of memory), 2776and also in any routine where a pointee is used, but any variable with 2777which it shares storage is not used. Code that violates these rules 2778may not run as the user intends. This is not a bug in the optimizer; 2779any code that violates the aliasing rules is illegal. (Note that this 2780is not unique to GNU Fortran; any Fortran compiler that supports Cray 2781pointers will "incorrectly" optimize code with illegal aliasing.) 2782 2783 There are a number of restrictions on the attributes that can be 2784applied to Cray pointers and pointees. Pointees may not have the 2785`ALLOCATABLE', `INTENT', `OPTIONAL', `DUMMY', `TARGET', `INTRINSIC', or 2786`POINTER' attributes. Pointers may not have the `DIMENSION', 2787`POINTER', `TARGET', `ALLOCATABLE', `EXTERNAL', or `INTRINSIC' 2788attributes, nor may they be function results. Pointees may not occur 2789in more than one pointer statement. A pointee cannot be a pointer. 2790Pointees cannot occur in equivalence, common, or data statements. 2791 2792 A Cray pointer may also point to a function or a subroutine. For 2793example, the following excerpt is valid: 2794 implicit none 2795 external sub 2796 pointer (subptr,subpte) 2797 external subpte 2798 subptr = loc(sub) 2799 call subpte() 2800 [...] 2801 subroutine sub 2802 [...] 2803 end subroutine sub 2804 2805 A pointer may be modified during the course of a program, and this 2806will change the location to which the pointee refers. However, when 2807pointees are passed as arguments, they are treated as ordinary 2808variables in the invoked function. Subsequent changes to the pointer 2809will not change the base address of the array that was passed. 2810 2811 2812File: gfortran.info, Node: CONVERT specifier, Next: OpenMP, Prev: Cray pointers, Up: Extensions implemented in GNU Fortran 2813 28146.1.15 `CONVERT' specifier 2815-------------------------- 2816 2817GNU Fortran allows the conversion of unformatted data between little- 2818and big-endian representation to facilitate moving of data between 2819different systems. The conversion can be indicated with the `CONVERT' 2820specifier on the `OPEN' statement. *Note GFORTRAN_CONVERT_UNIT::, for 2821an alternative way of specifying the data format via an environment 2822variable. 2823 2824 Valid values for `CONVERT' are: 2825 `CONVERT='NATIVE'' Use the native format. This is the default. 2826 2827 `CONVERT='SWAP'' Swap between little- and big-endian. 2828 2829 `CONVERT='LITTLE_ENDIAN'' Use the little-endian representation for 2830 unformatted files. 2831 2832 `CONVERT='BIG_ENDIAN'' Use the big-endian representation for 2833 unformatted files. 2834 2835 Using the option could look like this: 2836 open(file='big.dat',form='unformatted',access='sequential', & 2837 convert='big_endian') 2838 2839 The value of the conversion can be queried by using 2840`INQUIRE(CONVERT=ch)'. The values returned are `'BIG_ENDIAN'' and 2841`'LITTLE_ENDIAN''. 2842 2843 `CONVERT' works between big- and little-endian for `INTEGER' values 2844of all supported kinds and for `REAL' on IEEE systems of kinds 4 and 8. 2845Conversion between different "extended double" types on different 2846architectures such as m68k and x86_64, which GNU Fortran supports as 2847`REAL(KIND=10)' and `REAL(KIND=16)', will probably not work. 2848 2849 _Note that the values specified via the GFORTRAN_CONVERT_UNIT 2850environment variable will override the CONVERT specifier in the open 2851statement_. This is to give control over data formats to users who do 2852not have the source code of their program available. 2853 2854 Using anything but the native representation for unformatted data 2855carries a significant speed overhead. If speed in this area matters to 2856you, it is best if you use this only for data that needs to be portable. 2857 2858 2859File: gfortran.info, Node: OpenMP, Next: Argument list functions, Prev: CONVERT specifier, Up: Extensions implemented in GNU Fortran 2860 28616.1.16 OpenMP 2862------------- 2863 2864OpenMP (Open Multi-Processing) is an application programming interface 2865(API) that supports multi-platform shared memory multiprocessing 2866programming in C/C++ and Fortran on many architectures, including Unix 2867and Microsoft Windows platforms. It consists of a set of compiler 2868directives, library routines, and environment variables that influence 2869run-time behavior. 2870 2871 GNU Fortran strives to be compatible to the OpenMP Application 2872Program Interface v3.1 (http://www.openmp.org/mp-documents/spec31.pdf). 2873 2874 To enable the processing of the OpenMP directive `!$omp' in 2875free-form source code; the `c$omp', `*$omp' and `!$omp' directives in 2876fixed form; the `!$' conditional compilation sentinels in free form; 2877and the `c$', `*$' and `!$' sentinels in fixed form, `gfortran' needs 2878to be invoked with the `-fopenmp'. This also arranges for automatic 2879linking of the GNU OpenMP runtime library *note libgomp: (libgomp)Top. 2880 2881 The OpenMP Fortran runtime library routines are provided both in a 2882form of a Fortran 90 module named `omp_lib' and in a form of a Fortran 2883`include' file named `omp_lib.h'. 2884 2885 An example of a parallelized loop taken from Appendix A.1 of the 2886OpenMP Application Program Interface v2.5: 2887 SUBROUTINE A1(N, A, B) 2888 INTEGER I, N 2889 REAL B(N), A(N) 2890 !$OMP PARALLEL DO !I is private by default 2891 DO I=2,N 2892 B(I) = (A(I) + A(I-1)) / 2.0 2893 ENDDO 2894 !$OMP END PARALLEL DO 2895 END SUBROUTINE A1 2896 2897 Please note: 2898 * `-fopenmp' implies `-frecursive', i.e., all local arrays will be 2899 allocated on the stack. When porting existing code to OpenMP, 2900 this may lead to surprising results, especially to segmentation 2901 faults if the stacksize is limited. 2902 2903 * On glibc-based systems, OpenMP enabled applications cannot be 2904 statically linked due to limitations of the underlying 2905 pthreads-implementation. It might be possible to get a working 2906 solution if `-Wl,--whole-archive -lpthread -Wl,--no-whole-archive' 2907 is added to the command line. However, this is not supported by 2908 `gcc' and thus not recommended. 2909 2910 2911File: gfortran.info, Node: Argument list functions, Prev: OpenMP, Up: Extensions implemented in GNU Fortran 2912 29136.1.17 Argument list functions `%VAL', `%REF' and `%LOC' 2914-------------------------------------------------------- 2915 2916GNU Fortran supports argument list functions `%VAL', `%REF' and `%LOC' 2917statements, for backward compatibility with g77. It is recommended 2918that these should be used only for code that is accessing facilities 2919outside of GNU Fortran, such as operating system or windowing 2920facilities. It is best to constrain such uses to isolated portions of 2921a program-portions that deal specifically and exclusively with 2922low-level, system-dependent facilities. Such portions might well 2923provide a portable interface for use by the program as a whole, but are 2924themselves not portable, and should be thoroughly tested each time they 2925are rebuilt using a new compiler or version of a compiler. 2926 2927 `%VAL' passes a scalar argument by value, `%REF' passes it by 2928reference and `%LOC' passes its memory location. Since gfortran 2929already passes scalar arguments by reference, `%REF' is in effect a 2930do-nothing. `%LOC' has the same effect as a Fortran pointer. 2931 2932 An example of passing an argument by value to a C subroutine foo.: 2933 C 2934 C prototype void foo_ (float x); 2935 C 2936 external foo 2937 real*4 x 2938 x = 3.14159 2939 call foo (%VAL (x)) 2940 end 2941 2942 For details refer to the g77 manual 2943`http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top'. 2944 2945 Also, `c_by_val.f' and its partner `c_by_val.c' of the GNU Fortran 2946testsuite are worth a look. 2947 2948 2949File: gfortran.info, Node: Extensions not implemented in GNU Fortran, Prev: Extensions implemented in GNU Fortran, Up: Extensions 2950 29516.2 Extensions not implemented in GNU Fortran 2952============================================= 2953 2954The long history of the Fortran language, its wide use and broad 2955userbase, the large number of different compiler vendors and the lack of 2956some features crucial to users in the first standards have lead to the 2957existence of a number of important extensions to the language. While 2958some of the most useful or popular extensions are supported by the GNU 2959Fortran compiler, not all existing extensions are supported. This 2960section aims at listing these extensions and offering advice on how 2961best make code that uses them running with the GNU Fortran compiler. 2962 2963* Menu: 2964 2965* STRUCTURE and RECORD:: 2966* ENCODE and DECODE statements:: 2967* Variable FORMAT expressions:: 2968* Alternate complex function syntax:: 2969 2970 2971File: gfortran.info, Node: STRUCTURE and RECORD, Next: ENCODE and DECODE statements, Up: Extensions not implemented in GNU Fortran 2972 29736.2.1 `STRUCTURE' and `RECORD' 2974------------------------------ 2975 2976Record structures are a pre-Fortran-90 vendor extension to create 2977user-defined aggregate data types. GNU Fortran does not support record 2978structures, only Fortran 90's "derived types", which have a different 2979syntax. 2980 2981 In many cases, record structures can easily be converted to derived 2982types. To convert, replace `STRUCTURE /'STRUCTURE-NAME`/' by `TYPE' 2983TYPE-NAME. Additionally, replace `RECORD /'STRUCTURE-NAME`/' by 2984`TYPE('TYPE-NAME`)'. Finally, in the component access, replace the 2985period (`.') by the percent sign (`%'). 2986 2987 Here is an example of code using the non portable record structure 2988syntax: 2989 2990 ! Declaring a structure named ``item'' and containing three fields: 2991 ! an integer ID, an description string and a floating-point price. 2992 STRUCTURE /item/ 2993 INTEGER id 2994 CHARACTER(LEN=200) description 2995 REAL price 2996 END STRUCTURE 2997 2998 ! Define two variables, an single record of type ``item'' 2999 ! named ``pear'', and an array of items named ``store_catalog'' 3000 RECORD /item/ pear, store_catalog(100) 3001 3002 ! We can directly access the fields of both variables 3003 pear.id = 92316 3004 pear.description = "juicy D'Anjou pear" 3005 pear.price = 0.15 3006 store_catalog(7).id = 7831 3007 store_catalog(7).description = "milk bottle" 3008 store_catalog(7).price = 1.2 3009 3010 ! We can also manipulate the whole structure 3011 store_catalog(12) = pear 3012 print *, store_catalog(12) 3013 3014This code can easily be rewritten in the Fortran 90 syntax as following: 3015 3016 ! ``STRUCTURE /name/ ... END STRUCTURE'' becomes 3017 ! ``TYPE name ... END TYPE'' 3018 TYPE item 3019 INTEGER id 3020 CHARACTER(LEN=200) description 3021 REAL price 3022 END TYPE 3023 3024 ! ``RECORD /name/ variable'' becomes ``TYPE(name) variable'' 3025 TYPE(item) pear, store_catalog(100) 3026 3027 ! Instead of using a dot (.) to access fields of a record, the 3028 ! standard syntax uses a percent sign (%) 3029 pear%id = 92316 3030 pear%description = "juicy D'Anjou pear" 3031 pear%price = 0.15 3032 store_catalog(7)%id = 7831 3033 store_catalog(7)%description = "milk bottle" 3034 store_catalog(7)%price = 1.2 3035 3036 ! Assignments of a whole variable do not change 3037 store_catalog(12) = pear 3038 print *, store_catalog(12) 3039 3040 3041File: gfortran.info, Node: ENCODE and DECODE statements, Next: Variable FORMAT expressions, Prev: STRUCTURE and RECORD, Up: Extensions not implemented in GNU Fortran 3042 30436.2.2 `ENCODE' and `DECODE' statements 3044-------------------------------------- 3045 3046GNU Fortran does not support the `ENCODE' and `DECODE' statements. 3047These statements are best replaced by `READ' and `WRITE' statements 3048involving internal files (`CHARACTER' variables and arrays), which have 3049been part of the Fortran standard since Fortran 77. For example, 3050replace a code fragment like 3051 3052 INTEGER*1 LINE(80) 3053 REAL A, B, C 3054 c ... Code that sets LINE 3055 DECODE (80, 9000, LINE) A, B, C 3056 9000 FORMAT (1X, 3(F10.5)) 3057 3058with the following: 3059 3060 CHARACTER(LEN=80) LINE 3061 REAL A, B, C 3062 c ... Code that sets LINE 3063 READ (UNIT=LINE, FMT=9000) A, B, C 3064 9000 FORMAT (1X, 3(F10.5)) 3065 3066 Similarly, replace a code fragment like 3067 3068 INTEGER*1 LINE(80) 3069 REAL A, B, C 3070 c ... Code that sets A, B and C 3071 ENCODE (80, 9000, LINE) A, B, C 3072 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5)) 3073 3074with the following: 3075 3076 CHARACTER(LEN=80) LINE 3077 REAL A, B, C 3078 c ... Code that sets A, B and C 3079 WRITE (UNIT=LINE, FMT=9000) A, B, C 3080 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5)) 3081 3082 3083File: gfortran.info, Node: Variable FORMAT expressions, Next: Alternate complex function syntax, Prev: ENCODE and DECODE statements, Up: Extensions not implemented in GNU Fortran 3084 30856.2.3 Variable `FORMAT' expressions 3086----------------------------------- 3087 3088A variable `FORMAT' expression is format statement which includes angle 3089brackets enclosing a Fortran expression: `FORMAT(I<N>)'. GNU Fortran 3090does not support this legacy extension. The effect of variable format 3091expressions can be reproduced by using the more powerful (and standard) 3092combination of internal output and string formats. For example, 3093replace a code fragment like this: 3094 3095 WRITE(6,20) INT1 3096 20 FORMAT(I<N+1>) 3097 3098with the following: 3099 3100 c Variable declaration 3101 CHARACTER(LEN=20) FMT 3102 c 3103 c Other code here... 3104 c 3105 WRITE(FMT,'("(I", I0, ")")') N+1 3106 WRITE(6,FMT) INT1 3107 3108or with: 3109 3110 c Variable declaration 3111 CHARACTER(LEN=20) FMT 3112 c 3113 c Other code here... 3114 c 3115 WRITE(FMT,*) N+1 3116 WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1 3117 3118 3119File: gfortran.info, Node: Alternate complex function syntax, Prev: Variable FORMAT expressions, Up: Extensions not implemented in GNU Fortran 3120 31216.2.4 Alternate complex function syntax 3122--------------------------------------- 3123 3124Some Fortran compilers, including `g77', let the user declare complex 3125functions with the syntax `COMPLEX FUNCTION name*16()', as well as 3126`COMPLEX*16 FUNCTION name()'. Both are non-standard, legacy 3127extensions. `gfortran' accepts the latter form, which is more common, 3128but not the former. 3129 3130 3131File: gfortran.info, Node: Mixed-Language Programming, Next: Intrinsic Procedures, Prev: Extensions, Up: Top 3132 31337 Mixed-Language Programming 3134**************************** 3135 3136* Menu: 3137 3138* Interoperability with C:: 3139* GNU Fortran Compiler Directives:: 3140* Non-Fortran Main Program:: 3141 3142 This chapter is about mixed-language interoperability, but also 3143applies if one links Fortran code compiled by different compilers. In 3144most cases, use of the C Binding features of the Fortran 2003 standard 3145is sufficient, and their use is highly recommended. 3146 3147 3148File: gfortran.info, Node: Interoperability with C, Next: GNU Fortran Compiler Directives, Up: Mixed-Language Programming 3149 31507.1 Interoperability with C 3151=========================== 3152 3153* Menu: 3154 3155* Intrinsic Types:: 3156* Derived Types and struct:: 3157* Interoperable Global Variables:: 3158* Interoperable Subroutines and Functions:: 3159* Working with Pointers:: 3160* Further Interoperability of Fortran with C:: 3161 3162 Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a standardized 3163way to generate procedure and derived-type declarations and global 3164variables which are interoperable with C (ISO/IEC 9899:1999). The 3165`bind(C)' attribute has been added to inform the compiler that a symbol 3166shall be interoperable with C; also, some constraints are added. Note, 3167however, that not all C features have a Fortran equivalent or vice 3168versa. For instance, neither C's unsigned integers nor C's functions 3169with variable number of arguments have an equivalent in Fortran. 3170 3171 Note that array dimensions are reversely ordered in C and that 3172arrays in C always start with index 0 while in Fortran they start by 3173default with 1. Thus, an array declaration `A(n,m)' in Fortran matches 3174`A[m][n]' in C and accessing the element `A(i,j)' matches 3175`A[j-1][i-1]'. The element following `A(i,j)' (C: `A[j-1][i-1]'; 3176assuming i < n) in memory is `A(i+1,j)' (C: `A[j-1][i]'). 3177 3178 3179File: gfortran.info, Node: Intrinsic Types, Next: Derived Types and struct, Up: Interoperability with C 3180 31817.1.1 Intrinsic Types 3182--------------------- 3183 3184In order to ensure that exactly the same variable type and kind is used 3185in C and Fortran, the named constants shall be used which are defined 3186in the `ISO_C_BINDING' intrinsic module. That module contains named 3187constants for kind parameters and character named constants for the 3188escape sequences in C. For a list of the constants, see *note 3189ISO_C_BINDING::. 3190 3191 3192File: gfortran.info, Node: Derived Types and struct, Next: Interoperable Global Variables, Prev: Intrinsic Types, Up: Interoperability with C 3193 31947.1.2 Derived Types and struct 3195------------------------------ 3196 3197For compatibility of derived types with `struct', one needs to use the 3198`BIND(C)' attribute in the type declaration. For instance, the 3199following type declaration 3200 3201 USE ISO_C_BINDING 3202 TYPE, BIND(C) :: myType 3203 INTEGER(C_INT) :: i1, i2 3204 INTEGER(C_SIGNED_CHAR) :: i3 3205 REAL(C_DOUBLE) :: d1 3206 COMPLEX(C_FLOAT_COMPLEX) :: c1 3207 CHARACTER(KIND=C_CHAR) :: str(5) 3208 END TYPE 3209 3210 matches the following `struct' declaration in C 3211 3212 struct { 3213 int i1, i2; 3214 /* Note: "char" might be signed or unsigned. */ 3215 signed char i3; 3216 double d1; 3217 float _Complex c1; 3218 char str[5]; 3219 } myType; 3220 3221 Derived types with the C binding attribute shall not have the 3222`sequence' attribute, type parameters, the `extends' attribute, nor 3223type-bound procedures. Every component must be of interoperable type 3224and kind and may not have the `pointer' or `allocatable' attribute. 3225The names of the components are irrelevant for interoperability. 3226 3227 As there exist no direct Fortran equivalents, neither unions nor 3228structs with bit field or variable-length array members are 3229interoperable. 3230 3231 3232File: gfortran.info, Node: Interoperable Global Variables, Next: Interoperable Subroutines and Functions, Prev: Derived Types and struct, Up: Interoperability with C 3233 32347.1.3 Interoperable Global Variables 3235------------------------------------ 3236 3237Variables can be made accessible from C using the C binding attribute, 3238optionally together with specifying a binding name. Those variables 3239have to be declared in the declaration part of a `MODULE', be of 3240interoperable type, and have neither the `pointer' nor the 3241`allocatable' attribute. 3242 3243 MODULE m 3244 USE myType_module 3245 USE ISO_C_BINDING 3246 integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag 3247 type(myType), bind(C) :: tp 3248 END MODULE 3249 3250 Here, `_MyProject_flags' is the case-sensitive name of the variable 3251as seen from C programs while `global_flag' is the case-insensitive 3252name as seen from Fortran. If no binding name is specified, as for TP, 3253the C binding name is the (lowercase) Fortran binding name. If a 3254binding name is specified, only a single variable may be after the 3255double colon. Note of warning: You cannot use a global variable to 3256access ERRNO of the C library as the C standard allows it to be a 3257macro. Use the `IERRNO' intrinsic (GNU extension) instead. 3258 3259 3260File: gfortran.info, Node: Interoperable Subroutines and Functions, Next: Working with Pointers, Prev: Interoperable Global Variables, Up: Interoperability with C 3261 32627.1.4 Interoperable Subroutines and Functions 3263--------------------------------------------- 3264 3265Subroutines and functions have to have the `BIND(C)' attribute to be 3266compatible with C. The dummy argument declaration is relatively 3267straightforward. However, one needs to be careful because C uses 3268call-by-value by default while Fortran behaves usually similar to 3269call-by-reference. Furthermore, strings and pointers are handled 3270differently. Note that in Fortran 2003 and 2008 only explicit size and 3271assumed-size arrays are supported but not assumed-shape or 3272deferred-shape (i.e. allocatable or pointer) arrays. However, those 3273are allowed since the Technical Specification 29113, see *note Further 3274Interoperability of Fortran with C:: 3275 3276 To pass a variable by value, use the `VALUE' attribute. Thus, the 3277following C prototype 3278 3279 `int func(int i, int *j)' 3280 3281 matches the Fortran declaration 3282 3283 integer(c_int) function func(i,j) 3284 use iso_c_binding, only: c_int 3285 integer(c_int), VALUE :: i 3286 integer(c_int) :: j 3287 3288 Note that pointer arguments also frequently need the `VALUE' 3289attribute, see *note Working with Pointers::. 3290 3291 Strings are handled quite differently in C and Fortran. In C a 3292string is a `NUL'-terminated array of characters while in Fortran each 3293string has a length associated with it and is thus not terminated (by 3294e.g. `NUL'). For example, if one wants to use the following C 3295function, 3296 3297 #include <stdio.h> 3298 void print_C(char *string) /* equivalent: char string[] */ 3299 { 3300 printf("%s\n", string); 3301 } 3302 3303 to print "Hello World" from Fortran, one can call it using 3304 3305 use iso_c_binding, only: C_CHAR, C_NULL_CHAR 3306 interface 3307 subroutine print_c(string) bind(C, name="print_C") 3308 use iso_c_binding, only: c_char 3309 character(kind=c_char) :: string(*) 3310 end subroutine print_c 3311 end interface 3312 call print_c(C_CHAR_"Hello World"//C_NULL_CHAR) 3313 3314 As the example shows, one needs to ensure that the string is `NUL' 3315terminated. Additionally, the dummy argument STRING of `print_C' is a 3316length-one assumed-size array; using `character(len=*)' is not allowed. 3317The example above uses `c_char_"Hello World"' to ensure the string 3318literal has the right type; typically the default character kind and 3319`c_char' are the same and thus `"Hello World"' is equivalent. However, 3320the standard does not guarantee this. 3321 3322 The use of strings is now further illustrated using the C library 3323function `strncpy', whose prototype is 3324 3325 char *strncpy(char *restrict s1, const char *restrict s2, size_t n); 3326 3327 The function `strncpy' copies at most N characters from string S2 to 3328S1 and returns S1. In the following example, we ignore the return 3329value: 3330 3331 use iso_c_binding 3332 implicit none 3333 character(len=30) :: str,str2 3334 interface 3335 ! Ignore the return value of strncpy -> subroutine 3336 ! "restrict" is always assumed if we do not pass a pointer 3337 subroutine strncpy(dest, src, n) bind(C) 3338 import 3339 character(kind=c_char), intent(out) :: dest(*) 3340 character(kind=c_char), intent(in) :: src(*) 3341 integer(c_size_t), value, intent(in) :: n 3342 end subroutine strncpy 3343 end interface 3344 str = repeat('X',30) ! Initialize whole string with 'X' 3345 call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, & 3346 len(c_char_"Hello World",kind=c_size_t)) 3347 print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX" 3348 end 3349 3350 The intrinsic procedures are described in *note Intrinsic 3351Procedures::. 3352 3353 3354File: gfortran.info, Node: Working with Pointers, Next: Further Interoperability of Fortran with C, Prev: Interoperable Subroutines and Functions, Up: Interoperability with C 3355 33567.1.5 Working with Pointers 3357--------------------------- 3358 3359C pointers are represented in Fortran via the special opaque derived 3360type `type(c_ptr)' (with private components). Thus one needs to use 3361intrinsic conversion procedures to convert from or to C pointers. 3362 3363 For some applications, using an assumed type (`TYPE(*)') can be an 3364alternative to a C pointer; see *note Further Interoperability of 3365Fortran with C::. 3366 3367 For example, 3368 3369 use iso_c_binding 3370 type(c_ptr) :: cptr1, cptr2 3371 integer, target :: array(7), scalar 3372 integer, pointer :: pa(:), ps 3373 cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the 3374 ! array is contiguous if required by the C 3375 ! procedure 3376 cptr2 = c_loc(scalar) 3377 call c_f_pointer(cptr2, ps) 3378 call c_f_pointer(cptr2, pa, shape=[7]) 3379 3380 When converting C to Fortran arrays, the one-dimensional `SHAPE' 3381argument has to be passed. 3382 3383 If a pointer is a dummy-argument of an interoperable procedure, it 3384usually has to be declared using the `VALUE' attribute. `void*' 3385matches `TYPE(C_PTR), VALUE', while `TYPE(C_PTR)' alone matches 3386`void**'. 3387 3388 Procedure pointers are handled analogously to pointers; the C type is 3389`TYPE(C_FUNPTR)' and the intrinsic conversion procedures are 3390`C_F_PROCPOINTER' and `C_FUNLOC'. 3391 3392 Let us consider two examples of actually passing a procedure pointer 3393from C to Fortran and vice versa. Note that these examples are also 3394very similar to passing ordinary pointers between both languages. First, 3395consider this code in C: 3396 3397 /* Procedure implemented in Fortran. */ 3398 void get_values (void (*)(double)); 3399 3400 /* Call-back routine we want called from Fortran. */ 3401 void 3402 print_it (double x) 3403 { 3404 printf ("Number is %f.\n", x); 3405 } 3406 3407 /* Call Fortran routine and pass call-back to it. */ 3408 void 3409 foobar () 3410 { 3411 get_values (&print_it); 3412 } 3413 3414 A matching implementation for `get_values' in Fortran, that correctly 3415receives the procedure pointer from C and is able to call it, is given 3416in the following `MODULE': 3417 3418 MODULE m 3419 IMPLICIT NONE 3420 3421 ! Define interface of call-back routine. 3422 ABSTRACT INTERFACE 3423 SUBROUTINE callback (x) 3424 USE, INTRINSIC :: ISO_C_BINDING 3425 REAL(KIND=C_DOUBLE), INTENT(IN), VALUE :: x 3426 END SUBROUTINE callback 3427 END INTERFACE 3428 3429 CONTAINS 3430 3431 ! Define C-bound procedure. 3432 SUBROUTINE get_values (cproc) BIND(C) 3433 USE, INTRINSIC :: ISO_C_BINDING 3434 TYPE(C_FUNPTR), INTENT(IN), VALUE :: cproc 3435 3436 PROCEDURE(callback), POINTER :: proc 3437 3438 ! Convert C to Fortran procedure pointer. 3439 CALL C_F_PROCPOINTER (cproc, proc) 3440 3441 ! Call it. 3442 CALL proc (1.0_C_DOUBLE) 3443 CALL proc (-42.0_C_DOUBLE) 3444 CALL proc (18.12_C_DOUBLE) 3445 END SUBROUTINE get_values 3446 3447 END MODULE m 3448 3449 Next, we want to call a C routine that expects a procedure pointer 3450argument and pass it a Fortran procedure (which clearly must be 3451interoperable!). Again, the C function may be: 3452 3453 int 3454 call_it (int (*func)(int), int arg) 3455 { 3456 return func (arg); 3457 } 3458 3459 It can be used as in the following Fortran code: 3460 3461 MODULE m 3462 USE, INTRINSIC :: ISO_C_BINDING 3463 IMPLICIT NONE 3464 3465 ! Define interface of C function. 3466 INTERFACE 3467 INTEGER(KIND=C_INT) FUNCTION call_it (func, arg) BIND(C) 3468 USE, INTRINSIC :: ISO_C_BINDING 3469 TYPE(C_FUNPTR), INTENT(IN), VALUE :: func 3470 INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg 3471 END FUNCTION call_it 3472 END INTERFACE 3473 3474 CONTAINS 3475 3476 ! Define procedure passed to C function. 3477 ! It must be interoperable! 3478 INTEGER(KIND=C_INT) FUNCTION double_it (arg) BIND(C) 3479 INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg 3480 double_it = arg + arg 3481 END FUNCTION double_it 3482 3483 ! Call C function. 3484 SUBROUTINE foobar () 3485 TYPE(C_FUNPTR) :: cproc 3486 INTEGER(KIND=C_INT) :: i 3487 3488 ! Get C procedure pointer. 3489 cproc = C_FUNLOC (double_it) 3490 3491 ! Use it. 3492 DO i = 1_C_INT, 10_C_INT 3493 PRINT *, call_it (cproc, i) 3494 END DO 3495 END SUBROUTINE foobar 3496 3497 END MODULE m 3498 3499 3500File: gfortran.info, Node: Further Interoperability of Fortran with C, Prev: Working with Pointers, Up: Interoperability with C 3501 35027.1.6 Further Interoperability of Fortran with C 3503------------------------------------------------ 3504 3505The Technical Specification ISO/IEC TS 29113:2012 on further 3506interoperability of Fortran with C extends the interoperability support 3507of Fortran 2003 and Fortran 2008. Besides removing some restrictions 3508and constraints, it adds assumed-type (`TYPE(*)') and assumed-rank 3509(`dimension') variables and allows for interoperability of 3510assumed-shape, assumed-rank and deferred-shape arrays, including 3511allocatables and pointers. 3512 3513 Note: Currently, GNU Fortran does not support the array descriptor 3514(dope vector) as specified in the Technical Specification, but uses an 3515array descriptor with different fields. The Chasm Language 3516Interoperability Tools, `http://chasm-interop.sourceforge.net/', 3517provide an interface to GNU Fortran's array descriptor. 3518 3519 The Technical Specification adds the following new features, which 3520are supported by GNU Fortran: 3521 3522 * The `ASYNCHRONOUS' attribute has been clarified and extended to 3523 allow its use with asynchronous communication in user-provided 3524 libraries such as in implementations of the Message Passing 3525 Interface specification. 3526 3527 * Many constraints have been relaxed, in particular for the `C_LOC' 3528 and `C_F_POINTER' intrinsics. 3529 3530 * The `OPTIONAL' attribute is now allowed for dummy arguments; an 3531 absent argument matches a `NULL' pointer. 3532 3533 * Assumed types (`TYPE(*)') have been added, which may only be used 3534 for dummy arguments. They are unlimited polymorphic but contrary 3535 to `CLASS(*)' they do not contain any type information, similar to 3536 C's `void *' pointers. Expressions of any type and kind can be 3537 passed; thus, it can be used as replacement for `TYPE(C_PTR)', 3538 avoiding the use of `C_LOC' in the caller. 3539 3540 Note, however, that `TYPE(*)' only accepts scalar arguments, 3541 unless the `DIMENSION' is explicitly specified. As `DIMENSION(*)' 3542 only supports array (including array elements) but no scalars, it 3543 is not a full replacement for `C_LOC'. On the other hand, 3544 assumed-type assumed-rank dummy arguments (`TYPE(*), 3545 DIMENSION(..)') allow for both scalars and arrays, but require 3546 special code on the callee side to handle the array descriptor. 3547 3548 * Assumed-shape arrays (`DIMENSION(..)') as dummy argument allow 3549 that scalars and arrays of any rank can be passed as actual 3550 argument. As the Technical Specification does not provide for 3551 direct means to operate with them, they have to be used either 3552 from the C side or be converted using `C_LOC' and `C_F_POINTER' to 3553 scalars or arrays of a specific rank. The rank can be determined 3554 using the `RANK' intrinisic. 3555 3556 Currently unimplemented: 3557 3558 * GNU Fortran always uses an array descriptor, which does not match 3559 the one of the Technical Specification. The 3560 `ISO_Fortran_binding.h' header file and the C functions it 3561 specifies are not available. 3562 3563 * Using assumed-shape, assumed-rank and deferred-shape arrays in 3564 `BIND(C)' procedures is not fully supported. In particular, C 3565 interoperable strings of other length than one are not supported 3566 as this requires the new array descriptor. 3567 3568 3569File: gfortran.info, Node: GNU Fortran Compiler Directives, Next: Non-Fortran Main Program, Prev: Interoperability with C, Up: Mixed-Language Programming 3570 35717.2 GNU Fortran Compiler Directives 3572=================================== 3573 3574The Fortran standard describes how a conforming program shall behave; 3575however, the exact implementation is not standardized. In order to 3576allow the user to choose specific implementation details, compiler 3577directives can be used to set attributes of variables and procedures 3578which are not part of the standard. Whether a given attribute is 3579supported and its exact effects depend on both the operating system and 3580on the processor; see *note C Extensions: (gcc)Top. for details. 3581 3582 For procedures and procedure pointers, the following attributes can 3583be used to change the calling convention: 3584 3585 * `CDECL' - standard C calling convention 3586 3587 * `STDCALL' - convention where the called procedure pops the stack 3588 3589 * `FASTCALL' - part of the arguments are passed via registers 3590 instead using the stack 3591 3592 Besides changing the calling convention, the attributes also 3593influence the decoration of the symbol name, e.g., by a leading 3594underscore or by a trailing at-sign followed by the number of bytes on 3595the stack. When assigning a procedure to a procedure pointer, both 3596should use the same calling convention. 3597 3598 On some systems, procedures and global variables (module variables 3599and `COMMON' blocks) need special handling to be accessible when they 3600are in a shared library. The following attributes are available: 3601 3602 * `DLLEXPORT' - provide a global pointer to a pointer in the DLL 3603 3604 * `DLLIMPORT' - reference the function or variable using a global 3605 pointer 3606 3607 The attributes are specified using the syntax 3608 3609 `!GCC$ ATTRIBUTES' ATTRIBUTE-LIST `::' VARIABLE-LIST 3610 3611 where in free-form source code only whitespace is allowed before 3612`!GCC$' and in fixed-form source code `!GCC$', `cGCC$' or `*GCC$' shall 3613start in the first column. 3614 3615 For procedures, the compiler directives shall be placed into the body 3616of the procedure; for variables and procedure pointers, they shall be in 3617the same declaration part as the variable or procedure pointer. 3618 3619 3620File: gfortran.info, Node: Non-Fortran Main Program, Prev: GNU Fortran Compiler Directives, Up: Mixed-Language Programming 3621 36227.3 Non-Fortran Main Program 3623============================ 3624 3625* Menu: 3626 3627* _gfortran_set_args:: Save command-line arguments 3628* _gfortran_set_options:: Set library option flags 3629* _gfortran_set_convert:: Set endian conversion 3630* _gfortran_set_record_marker:: Set length of record markers 3631* _gfortran_set_fpe:: Set when a Floating Point Exception should be raised 3632* _gfortran_set_max_subrecord_length:: Set subrecord length 3633 3634 Even if you are doing mixed-language programming, it is very likely 3635that you do not need to know or use the information in this section. 3636Since it is about the internal structure of GNU Fortran, it may also 3637change in GCC minor releases. 3638 3639 When you compile a `PROGRAM' with GNU Fortran, a function with the 3640name `main' (in the symbol table of the object file) is generated, 3641which initializes the libgfortran library and then calls the actual 3642program which uses the name `MAIN__', for historic reasons. If you 3643link GNU Fortran compiled procedures to, e.g., a C or C++ program or to 3644a Fortran program compiled by a different compiler, the libgfortran 3645library is not initialized and thus a few intrinsic procedures do not 3646work properly, e.g. those for obtaining the command-line arguments. 3647 3648 Therefore, if your `PROGRAM' is not compiled with GNU Fortran and 3649the GNU Fortran compiled procedures require intrinsics relying on the 3650library initialization, you need to initialize the library yourself. 3651Using the default options, gfortran calls `_gfortran_set_args' and 3652`_gfortran_set_options'. The initialization of the former is needed if 3653the called procedures access the command line (and for backtracing); 3654the latter sets some flags based on the standard chosen or to enable 3655backtracing. In typical programs, it is not necessary to call any 3656initialization function. 3657 3658 If your `PROGRAM' is compiled with GNU Fortran, you shall not call 3659any of the following functions. The libgfortran initialization 3660functions are shown in C syntax but using C bindings they are also 3661accessible from Fortran. 3662 3663 3664File: gfortran.info, Node: _gfortran_set_args, Next: _gfortran_set_options, Up: Non-Fortran Main Program 3665 36667.3.1 `_gfortran_set_args' -- Save command-line arguments 3667--------------------------------------------------------- 3668 3669_Description_: 3670 `_gfortran_set_args' saves the command-line arguments; this 3671 initialization is required if any of the command-line intrinsics 3672 is called. Additionally, it shall be called if backtracing is 3673 enabled (see `_gfortran_set_options'). 3674 3675_Syntax_: 3676 `void _gfortran_set_args (int argc, char *argv[])' 3677 3678_Arguments_: 3679 ARGC number of command line argument strings 3680 ARGV the command-line argument strings; argv[0] is 3681 the pathname of the executable itself. 3682 3683_Example_: 3684 int main (int argc, char *argv[]) 3685 { 3686 /* Initialize libgfortran. */ 3687 _gfortran_set_args (argc, argv); 3688 return 0; 3689 } 3690 3691 3692File: gfortran.info, Node: _gfortran_set_options, Next: _gfortran_set_convert, Prev: _gfortran_set_args, Up: Non-Fortran Main Program 3693 36947.3.2 `_gfortran_set_options' -- Set library option flags 3695--------------------------------------------------------- 3696 3697_Description_: 3698 `_gfortran_set_options' sets several flags related to the Fortran 3699 standard to be used, whether backtracing should be enabled and 3700 whether range checks should be performed. The syntax allows for 3701 upward compatibility since the number of passed flags is 3702 specified; for non-passed flags, the default value is used. See 3703 also *note Code Gen Options::. Please note that not all flags are 3704 actually used. 3705 3706_Syntax_: 3707 `void _gfortran_set_options (int num, int options[])' 3708 3709_Arguments_: 3710 NUM number of options passed 3711 ARGV The list of flag values 3712 3713_option flag list_: 3714 OPTION[0] Allowed standard; can give run-time errors if 3715 e.g. an input-output edit descriptor is 3716 invalid in a given standard. Possible values 3717 are (bitwise or-ed) `GFC_STD_F77' (1), 3718 `GFC_STD_F95_OBS' (2), `GFC_STD_F95_DEL' (4), 3719 `GFC_STD_F95' (8), `GFC_STD_F2003' (16), 3720 `GFC_STD_GNU' (32), `GFC_STD_LEGACY' (64), 3721 `GFC_STD_F2008' (128), `GFC_STD_F2008_OBS' 3722 (256) and GFC_STD_F2008_TS (512). Default: 3723 `GFC_STD_F95_OBS | GFC_STD_F95_DEL | 3724 GFC_STD_F95 | GFC_STD_F2003 | GFC_STD_F2008 | 3725 GFC_STD_F2008_TS | GFC_STD_F2008_OBS | 3726 GFC_STD_F77 | GFC_STD_GNU | GFC_STD_LEGACY'. 3727 OPTION[1] Standard-warning flag; prints a warning to 3728 standard error. Default: `GFC_STD_F95_DEL | 3729 GFC_STD_LEGACY'. 3730 OPTION[2] If non zero, enable pedantic checking. 3731 Default: off. 3732 OPTION[3] Unused. 3733 OPTION[4] If non zero, enable backtracing on run-time 3734 errors. Default: off. Note: Installs a 3735 signal handler and requires command-line 3736 initialization using `_gfortran_set_args'. 3737 OPTION[5] If non zero, supports signed zeros. Default: 3738 enabled. 3739 OPTION[6] Enables run-time checking. Possible values 3740 are (bitwise or-ed): GFC_RTCHECK_BOUNDS (1), 3741 GFC_RTCHECK_ARRAY_TEMPS (2), 3742 GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO 3743 (16), GFC_RTCHECK_POINTER (32). Default: 3744 disabled. 3745 3746_Example_: 3747 /* Use gfortran 4.8 default options. */ 3748 static int options[] = {68, 511, 0, 0, 1, 1, 0}; 3749 _gfortran_set_options (7, &options); 3750 3751 3752File: gfortran.info, Node: _gfortran_set_convert, Next: _gfortran_set_record_marker, Prev: _gfortran_set_options, Up: Non-Fortran Main Program 3753 37547.3.3 `_gfortran_set_convert' -- Set endian conversion 3755------------------------------------------------------ 3756 3757_Description_: 3758 `_gfortran_set_convert' set the representation of data for 3759 unformatted files. 3760 3761_Syntax_: 3762 `void _gfortran_set_convert (int conv)' 3763 3764_Arguments_: 3765 CONV Endian conversion, possible values: 3766 GFC_CONVERT_NATIVE (0, default), 3767 GFC_CONVERT_SWAP (1), GFC_CONVERT_BIG (2), 3768 GFC_CONVERT_LITTLE (3). 3769 3770_Example_: 3771 int main (int argc, char *argv[]) 3772 { 3773 /* Initialize libgfortran. */ 3774 _gfortran_set_args (argc, argv); 3775 _gfortran_set_convert (1); 3776 return 0; 3777 } 3778 3779 3780File: gfortran.info, Node: _gfortran_set_record_marker, Next: _gfortran_set_fpe, Prev: _gfortran_set_convert, Up: Non-Fortran Main Program 3781 37827.3.4 `_gfortran_set_record_marker' -- Set length of record markers 3783------------------------------------------------------------------- 3784 3785_Description_: 3786 `_gfortran_set_record_marker' sets the length of record markers 3787 for unformatted files. 3788 3789_Syntax_: 3790 `void _gfortran_set_record_marker (int val)' 3791 3792_Arguments_: 3793 VAL Length of the record marker; valid values are 3794 4 and 8. Default is 4. 3795 3796_Example_: 3797 int main (int argc, char *argv[]) 3798 { 3799 /* Initialize libgfortran. */ 3800 _gfortran_set_args (argc, argv); 3801 _gfortran_set_record_marker (8); 3802 return 0; 3803 } 3804 3805 3806File: gfortran.info, Node: _gfortran_set_fpe, Next: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_record_marker, Up: Non-Fortran Main Program 3807 38087.3.5 `_gfortran_set_fpe' -- Enable floating point exception traps 3809------------------------------------------------------------------ 3810 3811_Description_: 3812 `_gfortran_set_fpe' enables floating point exception traps for the 3813 specified exceptions. On most systems, this will result in a 3814 SIGFPE signal being sent and the program being aborted. 3815 3816_Syntax_: 3817 `void _gfortran_set_fpe (int val)' 3818 3819_Arguments_: 3820 OPTION[0] IEEE exceptions. Possible values are (bitwise 3821 or-ed) zero (0, default) no trapping, 3822 `GFC_FPE_INVALID' (1), `GFC_FPE_DENORMAL' (2), 3823 `GFC_FPE_ZERO' (4), `GFC_FPE_OVERFLOW' (8), 3824 `GFC_FPE_UNDERFLOW' (16), and 3825 `GFC_FPE_INEXACT' (32). 3826 3827_Example_: 3828 int main (int argc, char *argv[]) 3829 { 3830 /* Initialize libgfortran. */ 3831 _gfortran_set_args (argc, argv); 3832 /* FPE for invalid operations such as SQRT(-1.0). */ 3833 _gfortran_set_fpe (1); 3834 return 0; 3835 } 3836 3837 3838File: gfortran.info, Node: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_fpe, Up: Non-Fortran Main Program 3839 38407.3.6 `_gfortran_set_max_subrecord_length' -- Set subrecord length 3841------------------------------------------------------------------ 3842 3843_Description_: 3844 `_gfortran_set_max_subrecord_length' set the maximum length for a 3845 subrecord. This option only makes sense for testing and debugging 3846 of unformatted I/O. 3847 3848_Syntax_: 3849 `void _gfortran_set_max_subrecord_length (int val)' 3850 3851_Arguments_: 3852 VAL the maximum length for a subrecord; the 3853 maximum permitted value is 2147483639, which 3854 is also the default. 3855 3856_Example_: 3857 int main (int argc, char *argv[]) 3858 { 3859 /* Initialize libgfortran. */ 3860 _gfortran_set_args (argc, argv); 3861 _gfortran_set_max_subrecord_length (8); 3862 return 0; 3863 } 3864 3865 3866File: gfortran.info, Node: Intrinsic Procedures, Next: Intrinsic Modules, Prev: Mixed-Language Programming, Up: Top 3867 38688 Intrinsic Procedures 3869********************** 3870 3871* Menu: 3872 3873* Introduction: Introduction to Intrinsics 3874* `ABORT': ABORT, Abort the program 3875* `ABS': ABS, Absolute value 3876* `ACCESS': ACCESS, Checks file access modes 3877* `ACHAR': ACHAR, Character in ASCII collating sequence 3878* `ACOS': ACOS, Arccosine function 3879* `ACOSH': ACOSH, Inverse hyperbolic cosine function 3880* `ADJUSTL': ADJUSTL, Left adjust a string 3881* `ADJUSTR': ADJUSTR, Right adjust a string 3882* `AIMAG': AIMAG, Imaginary part of complex number 3883* `AINT': AINT, Truncate to a whole number 3884* `ALARM': ALARM, Set an alarm clock 3885* `ALL': ALL, Determine if all values are true 3886* `ALLOCATED': ALLOCATED, Status of allocatable entity 3887* `AND': AND, Bitwise logical AND 3888* `ANINT': ANINT, Nearest whole number 3889* `ANY': ANY, Determine if any values are true 3890* `ASIN': ASIN, Arcsine function 3891* `ASINH': ASINH, Inverse hyperbolic sine function 3892* `ASSOCIATED': ASSOCIATED, Status of a pointer or pointer/target pair 3893* `ATAN': ATAN, Arctangent function 3894* `ATAN2': ATAN2, Arctangent function 3895* `ATANH': ATANH, Inverse hyperbolic tangent function 3896* `ATOMIC_DEFINE': ATOMIC_DEFINE, Setting a variable atomically 3897* `ATOMIC_REF': ATOMIC_REF, Obtaining the value of a variable atomically 3898* `BACKTRACE': BACKTRACE, Show a backtrace 3899* `BESSEL_J0': BESSEL_J0, Bessel function of the first kind of order 0 3900* `BESSEL_J1': BESSEL_J1, Bessel function of the first kind of order 1 3901* `BESSEL_JN': BESSEL_JN, Bessel function of the first kind 3902* `BESSEL_Y0': BESSEL_Y0, Bessel function of the second kind of order 0 3903* `BESSEL_Y1': BESSEL_Y1, Bessel function of the second kind of order 1 3904* `BESSEL_YN': BESSEL_YN, Bessel function of the second kind 3905* `BGE': BGE, Bitwise greater than or equal to 3906* `BGT': BGT, Bitwise greater than 3907* `BIT_SIZE': BIT_SIZE, Bit size inquiry function 3908* `BLE': BLE, Bitwise less than or equal to 3909* `BLT': BLT, Bitwise less than 3910* `BTEST': BTEST, Bit test function 3911* `C_ASSOCIATED': C_ASSOCIATED, Status of a C pointer 3912* `C_F_POINTER': C_F_POINTER, Convert C into Fortran pointer 3913* `C_F_PROCPOINTER': C_F_PROCPOINTER, Convert C into Fortran procedure pointer 3914* `C_FUNLOC': C_FUNLOC, Obtain the C address of a procedure 3915* `C_LOC': C_LOC, Obtain the C address of an object 3916* `C_SIZEOF': C_SIZEOF, Size in bytes of an expression 3917* `CEILING': CEILING, Integer ceiling function 3918* `CHAR': CHAR, Integer-to-character conversion function 3919* `CHDIR': CHDIR, Change working directory 3920* `CHMOD': CHMOD, Change access permissions of files 3921* `CMPLX': CMPLX, Complex conversion function 3922* `COMMAND_ARGUMENT_COUNT': COMMAND_ARGUMENT_COUNT, Get number of command line arguments 3923* `COMPILER_OPTIONS': COMPILER_OPTIONS, Options passed to the compiler 3924* `COMPILER_VERSION': COMPILER_VERSION, Compiler version string 3925* `COMPLEX': COMPLEX, Complex conversion function 3926* `CONJG': CONJG, Complex conjugate function 3927* `COS': COS, Cosine function 3928* `COSH': COSH, Hyperbolic cosine function 3929* `COUNT': COUNT, Count occurrences of TRUE in an array 3930* `CPU_TIME': CPU_TIME, CPU time subroutine 3931* `CSHIFT': CSHIFT, Circular shift elements of an array 3932* `CTIME': CTIME, Subroutine (or function) to convert a time into a string 3933* `DATE_AND_TIME': DATE_AND_TIME, Date and time subroutine 3934* `DBLE': DBLE, Double precision conversion function 3935* `DCMPLX': DCMPLX, Double complex conversion function 3936* `DIGITS': DIGITS, Significant digits function 3937* `DIM': DIM, Positive difference 3938* `DOT_PRODUCT': DOT_PRODUCT, Dot product function 3939* `DPROD': DPROD, Double product function 3940* `DREAL': DREAL, Double real part function 3941* `DSHIFTL': DSHIFTL, Combined left shift 3942* `DSHIFTR': DSHIFTR, Combined right shift 3943* `DTIME': DTIME, Execution time subroutine (or function) 3944* `EOSHIFT': EOSHIFT, End-off shift elements of an array 3945* `EPSILON': EPSILON, Epsilon function 3946* `ERF': ERF, Error function 3947* `ERFC': ERFC, Complementary error function 3948* `ERFC_SCALED': ERFC_SCALED, Exponentially-scaled complementary error function 3949* `ETIME': ETIME, Execution time subroutine (or function) 3950* `EXECUTE_COMMAND_LINE': EXECUTE_COMMAND_LINE, Execute a shell command 3951* `EXIT': EXIT, Exit the program with status. 3952* `EXP': EXP, Exponential function 3953* `EXPONENT': EXPONENT, Exponent function 3954* `EXTENDS_TYPE_OF': EXTENDS_TYPE_OF, Query dynamic type for extension 3955* `FDATE': FDATE, Subroutine (or function) to get the current time as a string 3956* `FGET': FGET, Read a single character in stream mode from stdin 3957* `FGETC': FGETC, Read a single character in stream mode 3958* `FLOOR': FLOOR, Integer floor function 3959* `FLUSH': FLUSH, Flush I/O unit(s) 3960* `FNUM': FNUM, File number function 3961* `FPUT': FPUT, Write a single character in stream mode to stdout 3962* `FPUTC': FPUTC, Write a single character in stream mode 3963* `FRACTION': FRACTION, Fractional part of the model representation 3964* `FREE': FREE, Memory de-allocation subroutine 3965* `FSEEK': FSEEK, Low level file positioning subroutine 3966* `FSTAT': FSTAT, Get file status 3967* `FTELL': FTELL, Current stream position 3968* `GAMMA': GAMMA, Gamma function 3969* `GERROR': GERROR, Get last system error message 3970* `GETARG': GETARG, Get command line arguments 3971* `GET_COMMAND': GET_COMMAND, Get the entire command line 3972* `GET_COMMAND_ARGUMENT': GET_COMMAND_ARGUMENT, Get command line arguments 3973* `GETCWD': GETCWD, Get current working directory 3974* `GETENV': GETENV, Get an environmental variable 3975* `GET_ENVIRONMENT_VARIABLE': GET_ENVIRONMENT_VARIABLE, Get an environmental variable 3976* `GETGID': GETGID, Group ID function 3977* `GETLOG': GETLOG, Get login name 3978* `GETPID': GETPID, Process ID function 3979* `GETUID': GETUID, User ID function 3980* `GMTIME': GMTIME, Convert time to GMT info 3981* `HOSTNM': HOSTNM, Get system host name 3982* `HUGE': HUGE, Largest number of a kind 3983* `HYPOT': HYPOT, Euclidean distance function 3984* `IACHAR': IACHAR, Code in ASCII collating sequence 3985* `IALL': IALL, Bitwise AND of array elements 3986* `IAND': IAND, Bitwise logical and 3987* `IANY': IANY, Bitwise OR of array elements 3988* `IARGC': IARGC, Get the number of command line arguments 3989* `IBCLR': IBCLR, Clear bit 3990* `IBITS': IBITS, Bit extraction 3991* `IBSET': IBSET, Set bit 3992* `ICHAR': ICHAR, Character-to-integer conversion function 3993* `IDATE': IDATE, Current local time (day/month/year) 3994* `IEOR': IEOR, Bitwise logical exclusive or 3995* `IERRNO': IERRNO, Function to get the last system error number 3996* `IMAGE_INDEX': IMAGE_INDEX, Cosubscript to image index conversion 3997* `INDEX': INDEX intrinsic, Position of a substring within a string 3998* `INT': INT, Convert to integer type 3999* `INT2': INT2, Convert to 16-bit integer type 4000* `INT8': INT8, Convert to 64-bit integer type 4001* `IOR': IOR, Bitwise logical or 4002* `IPARITY': IPARITY, Bitwise XOR of array elements 4003* `IRAND': IRAND, Integer pseudo-random number 4004* `IS_IOSTAT_END': IS_IOSTAT_END, Test for end-of-file value 4005* `IS_IOSTAT_EOR': IS_IOSTAT_EOR, Test for end-of-record value 4006* `ISATTY': ISATTY, Whether a unit is a terminal device 4007* `ISHFT': ISHFT, Shift bits 4008* `ISHFTC': ISHFTC, Shift bits circularly 4009* `ISNAN': ISNAN, Tests for a NaN 4010* `ITIME': ITIME, Current local time (hour/minutes/seconds) 4011* `KILL': KILL, Send a signal to a process 4012* `KIND': KIND, Kind of an entity 4013* `LBOUND': LBOUND, Lower dimension bounds of an array 4014* `LCOBOUND': LCOBOUND, Lower codimension bounds of an array 4015* `LEADZ': LEADZ, Number of leading zero bits of an integer 4016* `LEN': LEN, Length of a character entity 4017* `LEN_TRIM': LEN_TRIM, Length of a character entity without trailing blank characters 4018* `LGE': LGE, Lexical greater than or equal 4019* `LGT': LGT, Lexical greater than 4020* `LINK': LINK, Create a hard link 4021* `LLE': LLE, Lexical less than or equal 4022* `LLT': LLT, Lexical less than 4023* `LNBLNK': LNBLNK, Index of the last non-blank character in a string 4024* `LOC': LOC, Returns the address of a variable 4025* `LOG': LOG, Logarithm function 4026* `LOG10': LOG10, Base 10 logarithm function 4027* `LOG_GAMMA': LOG_GAMMA, Logarithm of the Gamma function 4028* `LOGICAL': LOGICAL, Convert to logical type 4029* `LONG': LONG, Convert to integer type 4030* `LSHIFT': LSHIFT, Left shift bits 4031* `LSTAT': LSTAT, Get file status 4032* `LTIME': LTIME, Convert time to local time info 4033* `MALLOC': MALLOC, Dynamic memory allocation function 4034* `MASKL': MASKL, Left justified mask 4035* `MASKR': MASKR, Right justified mask 4036* `MATMUL': MATMUL, matrix multiplication 4037* `MAX': MAX, Maximum value of an argument list 4038* `MAXEXPONENT': MAXEXPONENT, Maximum exponent of a real kind 4039* `MAXLOC': MAXLOC, Location of the maximum value within an array 4040* `MAXVAL': MAXVAL, Maximum value of an array 4041* `MCLOCK': MCLOCK, Time function 4042* `MCLOCK8': MCLOCK8, Time function (64-bit) 4043* `MERGE': MERGE, Merge arrays 4044* `MERGE_BITS': MERGE_BITS, Merge of bits under mask 4045* `MIN': MIN, Minimum value of an argument list 4046* `MINEXPONENT': MINEXPONENT, Minimum exponent of a real kind 4047* `MINLOC': MINLOC, Location of the minimum value within an array 4048* `MINVAL': MINVAL, Minimum value of an array 4049* `MOD': MOD, Remainder function 4050* `MODULO': MODULO, Modulo function 4051* `MOVE_ALLOC': MOVE_ALLOC, Move allocation from one object to another 4052* `MVBITS': MVBITS, Move bits from one integer to another 4053* `NEAREST': NEAREST, Nearest representable number 4054* `NEW_LINE': NEW_LINE, New line character 4055* `NINT': NINT, Nearest whole number 4056* `NORM2': NORM2, Euclidean vector norm 4057* `NOT': NOT, Logical negation 4058* `NULL': NULL, Function that returns an disassociated pointer 4059* `NUM_IMAGES': NUM_IMAGES, Number of images 4060* `OR': OR, Bitwise logical OR 4061* `PACK': PACK, Pack an array into an array of rank one 4062* `PARITY': PARITY, Reduction with exclusive OR 4063* `PERROR': PERROR, Print system error message 4064* `POPCNT': POPCNT, Number of bits set 4065* `POPPAR': POPPAR, Parity of the number of bits set 4066* `PRECISION': PRECISION, Decimal precision of a real kind 4067* `PRESENT': PRESENT, Determine whether an optional dummy argument is specified 4068* `PRODUCT': PRODUCT, Product of array elements 4069* `RADIX': RADIX, Base of a data model 4070* `RAN': RAN, Real pseudo-random number 4071* `RAND': RAND, Real pseudo-random number 4072* `RANDOM_NUMBER': RANDOM_NUMBER, Pseudo-random number 4073* `RANDOM_SEED': RANDOM_SEED, Initialize a pseudo-random number sequence 4074* `RANGE': RANGE, Decimal exponent range 4075* `RANK' : RANK, Rank of a data object 4076* `REAL': REAL, Convert to real type 4077* `RENAME': RENAME, Rename a file 4078* `REPEAT': REPEAT, Repeated string concatenation 4079* `RESHAPE': RESHAPE, Function to reshape an array 4080* `RRSPACING': RRSPACING, Reciprocal of the relative spacing 4081* `RSHIFT': RSHIFT, Right shift bits 4082* `SAME_TYPE_AS': SAME_TYPE_AS, Query dynamic types for equality 4083* `SCALE': SCALE, Scale a real value 4084* `SCAN': SCAN, Scan a string for the presence of a set of characters 4085* `SECNDS': SECNDS, Time function 4086* `SECOND': SECOND, CPU time function 4087* `SELECTED_CHAR_KIND': SELECTED_CHAR_KIND, Choose character kind 4088* `SELECTED_INT_KIND': SELECTED_INT_KIND, Choose integer kind 4089* `SELECTED_REAL_KIND': SELECTED_REAL_KIND, Choose real kind 4090* `SET_EXPONENT': SET_EXPONENT, Set the exponent of the model 4091* `SHAPE': SHAPE, Determine the shape of an array 4092* `SHIFTA': SHIFTA, Right shift with fill 4093* `SHIFTL': SHIFTL, Left shift 4094* `SHIFTR': SHIFTR, Right shift 4095* `SIGN': SIGN, Sign copying function 4096* `SIGNAL': SIGNAL, Signal handling subroutine (or function) 4097* `SIN': SIN, Sine function 4098* `SINH': SINH, Hyperbolic sine function 4099* `SIZE': SIZE, Function to determine the size of an array 4100* `SIZEOF': SIZEOF, Determine the size in bytes of an expression 4101* `SLEEP': SLEEP, Sleep for the specified number of seconds 4102* `SPACING': SPACING, Smallest distance between two numbers of a given type 4103* `SPREAD': SPREAD, Add a dimension to an array 4104* `SQRT': SQRT, Square-root function 4105* `SRAND': SRAND, Reinitialize the random number generator 4106* `STAT': STAT, Get file status 4107* `STORAGE_SIZE': STORAGE_SIZE, Storage size in bits 4108* `SUM': SUM, Sum of array elements 4109* `SYMLNK': SYMLNK, Create a symbolic link 4110* `SYSTEM': SYSTEM, Execute a shell command 4111* `SYSTEM_CLOCK': SYSTEM_CLOCK, Time function 4112* `TAN': TAN, Tangent function 4113* `TANH': TANH, Hyperbolic tangent function 4114* `THIS_IMAGE': THIS_IMAGE, Cosubscript index of this image 4115* `TIME': TIME, Time function 4116* `TIME8': TIME8, Time function (64-bit) 4117* `TINY': TINY, Smallest positive number of a real kind 4118* `TRAILZ': TRAILZ, Number of trailing zero bits of an integer 4119* `TRANSFER': TRANSFER, Transfer bit patterns 4120* `TRANSPOSE': TRANSPOSE, Transpose an array of rank two 4121* `TRIM': TRIM, Remove trailing blank characters of a string 4122* `TTYNAM': TTYNAM, Get the name of a terminal device. 4123* `UBOUND': UBOUND, Upper dimension bounds of an array 4124* `UCOBOUND': UCOBOUND, Upper codimension bounds of an array 4125* `UMASK': UMASK, Set the file creation mask 4126* `UNLINK': UNLINK, Remove a file from the file system 4127* `UNPACK': UNPACK, Unpack an array of rank one into an array 4128* `VERIFY': VERIFY, Scan a string for the absence of a set of characters 4129* `XOR': XOR, Bitwise logical exclusive or 4130 4131 4132File: gfortran.info, Node: Introduction to Intrinsics, Next: ABORT, Up: Intrinsic Procedures 4133 41348.1 Introduction to intrinsic procedures 4135======================================== 4136 4137The intrinsic procedures provided by GNU Fortran include all of the 4138intrinsic procedures required by the Fortran 95 standard, a set of 4139intrinsic procedures for backwards compatibility with G77, and a 4140selection of intrinsic procedures from the Fortran 2003 and Fortran 2008 4141standards. Any conflict between a description here and a description in 4142either the Fortran 95 standard, the Fortran 2003 standard or the Fortran 41432008 standard is unintentional, and the standard(s) should be considered 4144authoritative. 4145 4146 The enumeration of the `KIND' type parameter is processor defined in 4147the Fortran 95 standard. GNU Fortran defines the default integer type 4148and default real type by `INTEGER(KIND=4)' and `REAL(KIND=4)', 4149respectively. The standard mandates that both data types shall have 4150another kind, which have more precision. On typical target 4151architectures supported by `gfortran', this kind type parameter is 4152`KIND=8'. Hence, `REAL(KIND=8)' and `DOUBLE PRECISION' are equivalent. 4153In the description of generic intrinsic procedures, the kind type 4154parameter will be specified by `KIND=*', and in the description of 4155specific names for an intrinsic procedure the kind type parameter will 4156be explicitly given (e.g., `REAL(KIND=4)' or `REAL(KIND=8)'). Finally, 4157for brevity the optional `KIND=' syntax will be omitted. 4158 4159 Many of the intrinsic procedures take one or more optional arguments. 4160This document follows the convention used in the Fortran 95 standard, 4161and denotes such arguments by square brackets. 4162 4163 GNU Fortran offers the `-std=f95' and `-std=gnu' options, which can 4164be used to restrict the set of intrinsic procedures to a given 4165standard. By default, `gfortran' sets the `-std=gnu' option, and so 4166all intrinsic procedures described here are accepted. There is one 4167caveat. For a select group of intrinsic procedures, `g77' implemented 4168both a function and a subroutine. Both classes have been implemented 4169in `gfortran' for backwards compatibility with `g77'. It is noted here 4170that these functions and subroutines cannot be intermixed in a given 4171subprogram. In the descriptions that follow, the applicable standard 4172for each intrinsic procedure is noted. 4173 4174 4175File: gfortran.info, Node: ABORT, Next: ABS, Prev: Introduction to Intrinsics, Up: Intrinsic Procedures 4176 41778.2 `ABORT' -- Abort the program 4178================================ 4179 4180_Description_: 4181 `ABORT' causes immediate termination of the program. On operating 4182 systems that support a core dump, `ABORT' will produce a core dump. 4183 It will also print a backtrace, unless `-fno-backtrace' is given. 4184 4185_Standard_: 4186 GNU extension 4187 4188_Class_: 4189 Subroutine 4190 4191_Syntax_: 4192 `CALL ABORT' 4193 4194_Return value_: 4195 Does not return. 4196 4197_Example_: 4198 program test_abort 4199 integer :: i = 1, j = 2 4200 if (i /= j) call abort 4201 end program test_abort 4202 4203_See also_: 4204 *note EXIT::, *note KILL::, *note BACKTRACE:: 4205 4206 4207 4208File: gfortran.info, Node: ABS, Next: ACCESS, Prev: ABORT, Up: Intrinsic Procedures 4209 42108.3 `ABS' -- Absolute value 4211=========================== 4212 4213_Description_: 4214 `ABS(A)' computes the absolute value of `A'. 4215 4216_Standard_: 4217 Fortran 77 and later, has overloads that are GNU extensions 4218 4219_Class_: 4220 Elemental function 4221 4222_Syntax_: 4223 `RESULT = ABS(A)' 4224 4225_Arguments_: 4226 A The type of the argument shall be an `INTEGER', 4227 `REAL', or `COMPLEX'. 4228 4229_Return value_: 4230 The return value is of the same type and kind as the argument 4231 except the return value is `REAL' for a `COMPLEX' argument. 4232 4233_Example_: 4234 program test_abs 4235 integer :: i = -1 4236 real :: x = -1.e0 4237 complex :: z = (-1.e0,0.e0) 4238 i = abs(i) 4239 x = abs(x) 4240 x = abs(z) 4241 end program test_abs 4242 4243_Specific names_: 4244 Name Argument Return type Standard 4245 `ABS(A)' `REAL(4) A' `REAL(4)' Fortran 77 and 4246 later 4247 `CABS(A)' `COMPLEX(4) `REAL(4)' Fortran 77 and 4248 A' later 4249 `DABS(A)' `REAL(8) A' `REAL(8)' Fortran 77 and 4250 later 4251 `IABS(A)' `INTEGER(4) `INTEGER(4)' Fortran 77 and 4252 A' later 4253 `ZABS(A)' `COMPLEX(8) `COMPLEX(8)' GNU extension 4254 A' 4255 `CDABS(A)' `COMPLEX(8) `COMPLEX(8)' GNU extension 4256 A' 4257 4258 4259File: gfortran.info, Node: ACCESS, Next: ACHAR, Prev: ABS, Up: Intrinsic Procedures 4260 42618.4 `ACCESS' -- Checks file access modes 4262======================================== 4263 4264_Description_: 4265 `ACCESS(NAME, MODE)' checks whether the file NAME exists, is 4266 readable, writable or executable. Except for the executable check, 4267 `ACCESS' can be replaced by Fortran 95's `INQUIRE'. 4268 4269_Standard_: 4270 GNU extension 4271 4272_Class_: 4273 Inquiry function 4274 4275_Syntax_: 4276 `RESULT = ACCESS(NAME, MODE)' 4277 4278_Arguments_: 4279 NAME Scalar `CHARACTER' of default kind with the 4280 file name. Tailing blank are ignored unless 4281 the character `achar(0)' is present, then all 4282 characters up to and excluding `achar(0)' are 4283 used as file name. 4284 MODE Scalar `CHARACTER' of default kind with the 4285 file access mode, may be any concatenation of 4286 `"r"' (readable), `"w"' (writable) and `"x"' 4287 (executable), or `" "' to check for existence. 4288 4289_Return value_: 4290 Returns a scalar `INTEGER', which is `0' if the file is accessible 4291 in the given mode; otherwise or if an invalid argument has been 4292 given for `MODE' the value `1' is returned. 4293 4294_Example_: 4295 program access_test 4296 implicit none 4297 character(len=*), parameter :: file = 'test.dat' 4298 character(len=*), parameter :: file2 = 'test.dat '//achar(0) 4299 if(access(file,' ') == 0) print *, trim(file),' is exists' 4300 if(access(file,'r') == 0) print *, trim(file),' is readable' 4301 if(access(file,'w') == 0) print *, trim(file),' is writable' 4302 if(access(file,'x') == 0) print *, trim(file),' is executable' 4303 if(access(file2,'rwx') == 0) & 4304 print *, trim(file2),' is readable, writable and executable' 4305 end program access_test 4306 4307_Specific names_: 4308 4309_See also_: 4310 4311 4312File: gfortran.info, Node: ACHAR, Next: ACOS, Prev: ACCESS, Up: Intrinsic Procedures 4313 43148.5 `ACHAR' -- Character in ASCII collating sequence 4315==================================================== 4316 4317_Description_: 4318 `ACHAR(I)' returns the character located at position `I' in the 4319 ASCII collating sequence. 4320 4321_Standard_: 4322 Fortran 77 and later, with KIND argument Fortran 2003 and later 4323 4324_Class_: 4325 Elemental function 4326 4327_Syntax_: 4328 `RESULT = ACHAR(I [, KIND])' 4329 4330_Arguments_: 4331 I The type shall be `INTEGER'. 4332 KIND (Optional) An `INTEGER' initialization 4333 expression indicating the kind parameter of 4334 the result. 4335 4336_Return value_: 4337 The return value is of type `CHARACTER' with a length of one. If 4338 the KIND argument is present, the return value is of the specified 4339 kind and of the default kind otherwise. 4340 4341_Example_: 4342 program test_achar 4343 character c 4344 c = achar(32) 4345 end program test_achar 4346 4347_Note_: 4348 See *note ICHAR:: for a discussion of converting between numerical 4349 values and formatted string representations. 4350 4351_See also_: 4352 *note CHAR::, *note IACHAR::, *note ICHAR:: 4353 4354 4355 4356File: gfortran.info, Node: ACOS, Next: ACOSH, Prev: ACHAR, Up: Intrinsic Procedures 4357 43588.6 `ACOS' -- Arccosine function 4359================================ 4360 4361_Description_: 4362 `ACOS(X)' computes the arccosine of X (inverse of `COS(X)'). 4363 4364_Standard_: 4365 Fortran 77 and later, for a complex argument Fortran 2008 or later 4366 4367_Class_: 4368 Elemental function 4369 4370_Syntax_: 4371 `RESULT = ACOS(X)' 4372 4373_Arguments_: 4374 X The type shall either be `REAL' with a 4375 magnitude that is less than or equal to one - 4376 or the type shall be `COMPLEX'. 4377 4378_Return value_: 4379 The return value is of the same type and kind as X. The real part 4380 of the result is in radians and lies in the range 0 \leq \Re 4381 \acos(x) \leq \pi. 4382 4383_Example_: 4384 program test_acos 4385 real(8) :: x = 0.866_8 4386 x = acos(x) 4387 end program test_acos 4388 4389_Specific names_: 4390 Name Argument Return type Standard 4391 `ACOS(X)' `REAL(4) X' `REAL(4)' Fortran 77 and 4392 later 4393 `DACOS(X)' `REAL(8) X' `REAL(8)' Fortran 77 and 4394 later 4395 4396_See also_: 4397 Inverse function: *note COS:: 4398 4399 4400 4401File: gfortran.info, Node: ACOSH, Next: ADJUSTL, Prev: ACOS, Up: Intrinsic Procedures 4402 44038.7 `ACOSH' -- Inverse hyperbolic cosine function 4404================================================= 4405 4406_Description_: 4407 `ACOSH(X)' computes the inverse hyperbolic cosine of X. 4408 4409_Standard_: 4410 Fortran 2008 and later 4411 4412_Class_: 4413 Elemental function 4414 4415_Syntax_: 4416 `RESULT = ACOSH(X)' 4417 4418_Arguments_: 4419 X The type shall be `REAL' or `COMPLEX'. 4420 4421_Return value_: 4422 The return value has the same type and kind as X. If X is complex, 4423 the imaginary part of the result is in radians and lies between 0 4424 \leq \Im \acosh(x) \leq \pi. 4425 4426_Example_: 4427 PROGRAM test_acosh 4428 REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /) 4429 WRITE (*,*) ACOSH(x) 4430 END PROGRAM 4431 4432_Specific names_: 4433 Name Argument Return type Standard 4434 `DACOSH(X)' `REAL(8) X' `REAL(8)' GNU extension 4435 4436_See also_: 4437 Inverse function: *note COSH:: 4438 4439 4440File: gfortran.info, Node: ADJUSTL, Next: ADJUSTR, Prev: ACOSH, Up: Intrinsic Procedures 4441 44428.8 `ADJUSTL' -- Left adjust a string 4443===================================== 4444 4445_Description_: 4446 `ADJUSTL(STRING)' will left adjust a string by removing leading 4447 spaces. Spaces are inserted at the end of the string as needed. 4448 4449_Standard_: 4450 Fortran 90 and later 4451 4452_Class_: 4453 Elemental function 4454 4455_Syntax_: 4456 `RESULT = ADJUSTL(STRING)' 4457 4458_Arguments_: 4459 STRING The type shall be `CHARACTER'. 4460 4461_Return value_: 4462 The return value is of type `CHARACTER' and of the same kind as 4463 STRING where leading spaces are removed and the same number of 4464 spaces are inserted on the end of STRING. 4465 4466_Example_: 4467 program test_adjustl 4468 character(len=20) :: str = ' gfortran' 4469 str = adjustl(str) 4470 print *, str 4471 end program test_adjustl 4472 4473_See also_: 4474 *note ADJUSTR::, *note TRIM:: 4475 4476 4477File: gfortran.info, Node: ADJUSTR, Next: AIMAG, Prev: ADJUSTL, Up: Intrinsic Procedures 4478 44798.9 `ADJUSTR' -- Right adjust a string 4480====================================== 4481 4482_Description_: 4483 `ADJUSTR(STRING)' will right adjust a string by removing trailing 4484 spaces. Spaces are inserted at the start of the string as needed. 4485 4486_Standard_: 4487 Fortran 95 and later 4488 4489_Class_: 4490 Elemental function 4491 4492_Syntax_: 4493 `RESULT = ADJUSTR(STRING)' 4494 4495_Arguments_: 4496 STR The type shall be `CHARACTER'. 4497 4498_Return value_: 4499 The return value is of type `CHARACTER' and of the same kind as 4500 STRING where trailing spaces are removed and the same number of 4501 spaces are inserted at the start of STRING. 4502 4503_Example_: 4504 program test_adjustr 4505 character(len=20) :: str = 'gfortran' 4506 str = adjustr(str) 4507 print *, str 4508 end program test_adjustr 4509 4510_See also_: 4511 *note ADJUSTL::, *note TRIM:: 4512 4513 4514File: gfortran.info, Node: AIMAG, Next: AINT, Prev: ADJUSTR, Up: Intrinsic Procedures 4515 45168.10 `AIMAG' -- Imaginary part of complex number 4517================================================ 4518 4519_Description_: 4520 `AIMAG(Z)' yields the imaginary part of complex argument `Z'. The 4521 `IMAG(Z)' and `IMAGPART(Z)' intrinsic functions are provided for 4522 compatibility with `g77', and their use in new code is strongly 4523 discouraged. 4524 4525_Standard_: 4526 Fortran 77 and later, has overloads that are GNU extensions 4527 4528_Class_: 4529 Elemental function 4530 4531_Syntax_: 4532 `RESULT = AIMAG(Z)' 4533 4534_Arguments_: 4535 Z The type of the argument shall be `COMPLEX'. 4536 4537_Return value_: 4538 The return value is of type `REAL' with the kind type parameter of 4539 the argument. 4540 4541_Example_: 4542 program test_aimag 4543 complex(4) z4 4544 complex(8) z8 4545 z4 = cmplx(1.e0_4, 0.e0_4) 4546 z8 = cmplx(0.e0_8, 1.e0_8) 4547 print *, aimag(z4), dimag(z8) 4548 end program test_aimag 4549 4550_Specific names_: 4551 Name Argument Return type Standard 4552 `AIMAG(Z)' `COMPLEX Z' `REAL' GNU extension 4553 `DIMAG(Z)' `COMPLEX(8) `REAL(8)' GNU extension 4554 Z' 4555 `IMAG(Z)' `COMPLEX Z' `REAL' GNU extension 4556 `IMAGPART(Z)' `COMPLEX Z' `REAL' GNU extension 4557 4558 4559File: gfortran.info, Node: AINT, Next: ALARM, Prev: AIMAG, Up: Intrinsic Procedures 4560 45618.11 `AINT' -- Truncate to a whole number 4562========================================= 4563 4564_Description_: 4565 `AINT(A [, KIND])' truncates its argument to a whole number. 4566 4567_Standard_: 4568 Fortran 77 and later 4569 4570_Class_: 4571 Elemental function 4572 4573_Syntax_: 4574 `RESULT = AINT(A [, KIND])' 4575 4576_Arguments_: 4577 A The type of the argument shall be `REAL'. 4578 KIND (Optional) An `INTEGER' initialization 4579 expression indicating the kind parameter of 4580 the result. 4581 4582_Return value_: 4583 The return value is of type `REAL' with the kind type parameter of 4584 the argument if the optional KIND is absent; otherwise, the kind 4585 type parameter will be given by KIND. If the magnitude of X is 4586 less than one, `AINT(X)' returns zero. If the magnitude is equal 4587 to or greater than one then it returns the largest whole number 4588 that does not exceed its magnitude. The sign is the same as the 4589 sign of X. 4590 4591_Example_: 4592 program test_aint 4593 real(4) x4 4594 real(8) x8 4595 x4 = 1.234E0_4 4596 x8 = 4.321_8 4597 print *, aint(x4), dint(x8) 4598 x8 = aint(x4,8) 4599 end program test_aint 4600 4601_Specific names_: 4602 Name Argument Return type Standard 4603 `AINT(A)' `REAL(4) A' `REAL(4)' Fortran 77 and 4604 later 4605 `DINT(A)' `REAL(8) A' `REAL(8)' Fortran 77 and 4606 later 4607 4608 4609File: gfortran.info, Node: ALARM, Next: ALL, Prev: AINT, Up: Intrinsic Procedures 4610 46118.12 `ALARM' -- Execute a routine after a given delay 4612===================================================== 4613 4614_Description_: 4615 `ALARM(SECONDS, HANDLER [, STATUS])' causes external subroutine 4616 HANDLER to be executed after a delay of SECONDS by using 4617 `alarm(2)' to set up a signal and `signal(2)' to catch it. If 4618 STATUS is supplied, it will be returned with the number of seconds 4619 remaining until any previously scheduled alarm was due to be 4620 delivered, or zero if there was no previously scheduled alarm. 4621 4622_Standard_: 4623 GNU extension 4624 4625_Class_: 4626 Subroutine 4627 4628_Syntax_: 4629 `CALL ALARM(SECONDS, HANDLER [, STATUS])' 4630 4631_Arguments_: 4632 SECONDS The type of the argument shall be a scalar 4633 `INTEGER'. It is `INTENT(IN)'. 4634 HANDLER Signal handler (`INTEGER FUNCTION' or 4635 `SUBROUTINE') or dummy/global `INTEGER' 4636 scalar. The scalar values may be either 4637 `SIG_IGN=1' to ignore the alarm generated or 4638 `SIG_DFL=0' to set the default action. It is 4639 `INTENT(IN)'. 4640 STATUS (Optional) STATUS shall be a scalar variable 4641 of the default `INTEGER' kind. It is 4642 `INTENT(OUT)'. 4643 4644_Example_: 4645 program test_alarm 4646 external handler_print 4647 integer i 4648 call alarm (3, handler_print, i) 4649 print *, i 4650 call sleep(10) 4651 end program test_alarm 4652 This will cause the external routine HANDLER_PRINT to be called 4653 after 3 seconds. 4654 4655 4656File: gfortran.info, Node: ALL, Next: ALLOCATED, Prev: ALARM, Up: Intrinsic Procedures 4657 46588.13 `ALL' -- All values in MASK along DIM are true 4659=================================================== 4660 4661_Description_: 4662 `ALL(MASK [, DIM])' determines if all the values are true in MASK 4663 in the array along dimension DIM. 4664 4665_Standard_: 4666 Fortran 95 and later 4667 4668_Class_: 4669 Transformational function 4670 4671_Syntax_: 4672 `RESULT = ALL(MASK [, DIM])' 4673 4674_Arguments_: 4675 MASK The type of the argument shall be `LOGICAL' and 4676 it shall not be scalar. 4677 DIM (Optional) DIM shall be a scalar integer with 4678 a value that lies between one and the rank of 4679 MASK. 4680 4681_Return value_: 4682 `ALL(MASK)' returns a scalar value of type `LOGICAL' where the 4683 kind type parameter is the same as the kind type parameter of 4684 MASK. If DIM is present, then `ALL(MASK, DIM)' returns an array 4685 with the rank of MASK minus 1. The shape is determined from the 4686 shape of MASK where the DIM dimension is elided. 4687 4688 (A) 4689 `ALL(MASK)' is true if all elements of MASK are true. It 4690 also is true if MASK has zero size; otherwise, it is false. 4691 4692 (B) 4693 If the rank of MASK is one, then `ALL(MASK,DIM)' is equivalent 4694 to `ALL(MASK)'. If the rank is greater than one, then 4695 `ALL(MASK,DIM)' is determined by applying `ALL' to the array 4696 sections. 4697 4698_Example_: 4699 program test_all 4700 logical l 4701 l = all((/.true., .true., .true./)) 4702 print *, l 4703 call section 4704 contains 4705 subroutine section 4706 integer a(2,3), b(2,3) 4707 a = 1 4708 b = 1 4709 b(2,2) = 2 4710 print *, all(a .eq. b, 1) 4711 print *, all(a .eq. b, 2) 4712 end subroutine section 4713 end program test_all 4714 4715 4716File: gfortran.info, Node: ALLOCATED, Next: AND, Prev: ALL, Up: Intrinsic Procedures 4717 47188.14 `ALLOCATED' -- Status of an allocatable entity 4719=================================================== 4720 4721_Description_: 4722 `ALLOCATED(ARRAY)' and `ALLOCATED(SCALAR)' check the allocation 4723 status of ARRAY and SCALAR, respectively. 4724 4725_Standard_: 4726 Fortran 95 and later. Note, the `SCALAR=' keyword and allocatable 4727 scalar entities are available in Fortran 2003 and later. 4728 4729_Class_: 4730 Inquiry function 4731 4732_Syntax_: 4733 `RESULT = ALLOCATED(ARRAY)' 4734 `RESULT = ALLOCATED(SCALAR)' 4735 4736_Arguments_: 4737 ARRAY The argument shall be an `ALLOCATABLE' array. 4738 SCALAR The argument shall be an `ALLOCATABLE' scalar. 4739 4740_Return value_: 4741 The return value is a scalar `LOGICAL' with the default logical 4742 kind type parameter. If the argument is allocated, then the 4743 result is `.TRUE.'; otherwise, it returns `.FALSE.' 4744 4745_Example_: 4746 program test_allocated 4747 integer :: i = 4 4748 real(4), allocatable :: x(:) 4749 if (.not. allocated(x)) allocate(x(i)) 4750 end program test_allocated 4751 4752 4753File: gfortran.info, Node: AND, Next: ANINT, Prev: ALLOCATED, Up: Intrinsic Procedures 4754 47558.15 `AND' -- Bitwise logical AND 4756================================= 4757 4758_Description_: 4759 Bitwise logical `AND'. 4760 4761 This intrinsic routine is provided for backwards compatibility with 4762 GNU Fortran 77. For integer arguments, programmers should consider 4763 the use of the *note IAND:: intrinsic defined by the Fortran 4764 standard. 4765 4766_Standard_: 4767 GNU extension 4768 4769_Class_: 4770 Function 4771 4772_Syntax_: 4773 `RESULT = AND(I, J)' 4774 4775_Arguments_: 4776 I The type shall be either a scalar `INTEGER' 4777 type or a scalar `LOGICAL' type. 4778 J The type shall be the same as the type of I. 4779 4780_Return value_: 4781 The return type is either a scalar `INTEGER' or a scalar 4782 `LOGICAL'. If the kind type parameters differ, then the smaller 4783 kind type is implicitly converted to larger kind, and the return 4784 has the larger kind. 4785 4786_Example_: 4787 PROGRAM test_and 4788 LOGICAL :: T = .TRUE., F = .FALSE. 4789 INTEGER :: a, b 4790 DATA a / Z'F' /, b / Z'3' / 4791 4792 WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F) 4793 WRITE (*,*) AND(a, b) 4794 END PROGRAM 4795 4796_See also_: 4797 Fortran 95 elemental function: *note IAND:: 4798 4799 4800File: gfortran.info, Node: ANINT, Next: ANY, Prev: AND, Up: Intrinsic Procedures 4801 48028.16 `ANINT' -- Nearest whole number 4803==================================== 4804 4805_Description_: 4806 `ANINT(A [, KIND])' rounds its argument to the nearest whole 4807 number. 4808 4809_Standard_: 4810 Fortran 77 and later 4811 4812_Class_: 4813 Elemental function 4814 4815_Syntax_: 4816 `RESULT = ANINT(A [, KIND])' 4817 4818_Arguments_: 4819 A The type of the argument shall be `REAL'. 4820 KIND (Optional) An `INTEGER' initialization 4821 expression indicating the kind parameter of 4822 the result. 4823 4824_Return value_: 4825 The return value is of type real with the kind type parameter of 4826 the argument if the optional KIND is absent; otherwise, the kind 4827 type parameter will be given by KIND. If A is greater than zero, 4828 `ANINT(A)' returns `AINT(X+0.5)'. If A is less than or equal to 4829 zero then it returns `AINT(X-0.5)'. 4830 4831_Example_: 4832 program test_anint 4833 real(4) x4 4834 real(8) x8 4835 x4 = 1.234E0_4 4836 x8 = 4.321_8 4837 print *, anint(x4), dnint(x8) 4838 x8 = anint(x4,8) 4839 end program test_anint 4840 4841_Specific names_: 4842 Name Argument Return type Standard 4843 `AINT(A)' `REAL(4) A' `REAL(4)' Fortran 77 and 4844 later 4845 `DNINT(A)' `REAL(8) A' `REAL(8)' Fortran 77 and 4846 later 4847 4848 4849File: gfortran.info, Node: ANY, Next: ASIN, Prev: ANINT, Up: Intrinsic Procedures 4850 48518.17 `ANY' -- Any value in MASK along DIM is true 4852================================================= 4853 4854_Description_: 4855 `ANY(MASK [, DIM])' determines if any of the values in the logical 4856 array MASK along dimension DIM are `.TRUE.'. 4857 4858_Standard_: 4859 Fortran 95 and later 4860 4861_Class_: 4862 Transformational function 4863 4864_Syntax_: 4865 `RESULT = ANY(MASK [, DIM])' 4866 4867_Arguments_: 4868 MASK The type of the argument shall be `LOGICAL' and 4869 it shall not be scalar. 4870 DIM (Optional) DIM shall be a scalar integer with 4871 a value that lies between one and the rank of 4872 MASK. 4873 4874_Return value_: 4875 `ANY(MASK)' returns a scalar value of type `LOGICAL' where the 4876 kind type parameter is the same as the kind type parameter of 4877 MASK. If DIM is present, then `ANY(MASK, DIM)' returns an array 4878 with the rank of MASK minus 1. The shape is determined from the 4879 shape of MASK where the DIM dimension is elided. 4880 4881 (A) 4882 `ANY(MASK)' is true if any element of MASK is true; 4883 otherwise, it is false. It also is false if MASK has zero 4884 size. 4885 4886 (B) 4887 If the rank of MASK is one, then `ANY(MASK,DIM)' is equivalent 4888 to `ANY(MASK)'. If the rank is greater than one, then 4889 `ANY(MASK,DIM)' is determined by applying `ANY' to the array 4890 sections. 4891 4892_Example_: 4893 program test_any 4894 logical l 4895 l = any((/.true., .true., .true./)) 4896 print *, l 4897 call section 4898 contains 4899 subroutine section 4900 integer a(2,3), b(2,3) 4901 a = 1 4902 b = 1 4903 b(2,2) = 2 4904 print *, any(a .eq. b, 1) 4905 print *, any(a .eq. b, 2) 4906 end subroutine section 4907 end program test_any 4908 4909 4910File: gfortran.info, Node: ASIN, Next: ASINH, Prev: ANY, Up: Intrinsic Procedures 4911 49128.18 `ASIN' -- Arcsine function 4913=============================== 4914 4915_Description_: 4916 `ASIN(X)' computes the arcsine of its X (inverse of `SIN(X)'). 4917 4918_Standard_: 4919 Fortran 77 and later, for a complex argument Fortran 2008 or later 4920 4921_Class_: 4922 Elemental function 4923 4924_Syntax_: 4925 `RESULT = ASIN(X)' 4926 4927_Arguments_: 4928 X The type shall be either `REAL' and a 4929 magnitude that is less than or equal to one - 4930 or be `COMPLEX'. 4931 4932_Return value_: 4933 The return value is of the same type and kind as X. The real part 4934 of the result is in radians and lies in the range -\pi/2 \leq \Re 4935 \asin(x) \leq \pi/2. 4936 4937_Example_: 4938 program test_asin 4939 real(8) :: x = 0.866_8 4940 x = asin(x) 4941 end program test_asin 4942 4943_Specific names_: 4944 Name Argument Return type Standard 4945 `ASIN(X)' `REAL(4) X' `REAL(4)' Fortran 77 and 4946 later 4947 `DASIN(X)' `REAL(8) X' `REAL(8)' Fortran 77 and 4948 later 4949 4950_See also_: 4951 Inverse function: *note SIN:: 4952 4953 4954 4955File: gfortran.info, Node: ASINH, Next: ASSOCIATED, Prev: ASIN, Up: Intrinsic Procedures 4956 49578.19 `ASINH' -- Inverse hyperbolic sine function 4958================================================ 4959 4960_Description_: 4961 `ASINH(X)' computes the inverse hyperbolic sine of X. 4962 4963_Standard_: 4964 Fortran 2008 and later 4965 4966_Class_: 4967 Elemental function 4968 4969_Syntax_: 4970 `RESULT = ASINH(X)' 4971 4972_Arguments_: 4973 X The type shall be `REAL' or `COMPLEX'. 4974 4975_Return value_: 4976 The return value is of the same type and kind as X. If X is 4977 complex, the imaginary part of the result is in radians and lies 4978 between -\pi/2 \leq \Im \asinh(x) \leq \pi/2. 4979 4980_Example_: 4981 PROGRAM test_asinh 4982 REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /) 4983 WRITE (*,*) ASINH(x) 4984 END PROGRAM 4985 4986_Specific names_: 4987 Name Argument Return type Standard 4988 `DASINH(X)' `REAL(8) X' `REAL(8)' GNU extension. 4989 4990_See also_: 4991 Inverse function: *note SINH:: 4992 4993 4994File: gfortran.info, Node: ASSOCIATED, Next: ATAN, Prev: ASINH, Up: Intrinsic Procedures 4995 49968.20 `ASSOCIATED' -- Status of a pointer or pointer/target pair 4997=============================================================== 4998 4999_Description_: 5000 `ASSOCIATED(POINTER [, TARGET])' determines the status of the 5001 pointer POINTER or if POINTER is associated with the target TARGET. 5002 5003_Standard_: 5004 Fortran 95 and later 5005 5006_Class_: 5007 Inquiry function 5008 5009_Syntax_: 5010 `RESULT = ASSOCIATED(POINTER [, TARGET])' 5011 5012_Arguments_: 5013 POINTER POINTER shall have the `POINTER' attribute and 5014 it can be of any type. 5015 TARGET (Optional) TARGET shall be a pointer or a 5016 target. It must have the same type, kind type 5017 parameter, and array rank as POINTER. 5018 The association status of neither POINTER nor TARGET shall be 5019 undefined. 5020 5021_Return value_: 5022 `ASSOCIATED(POINTER)' returns a scalar value of type `LOGICAL(4)'. 5023 There are several cases: 5024 (A) When the optional TARGET is not present then 5025 `ASSOCIATED(POINTER)' is true if POINTER is associated with a 5026 target; otherwise, it returns false. 5027 5028 (B) If TARGET is present and a scalar target, the result is true if 5029 TARGET is not a zero-sized storage sequence and the target 5030 associated with POINTER occupies the same storage units. If 5031 POINTER is disassociated, the result is false. 5032 5033 (C) If TARGET is present and an array target, the result is true if 5034 TARGET and POINTER have the same shape, are not zero-sized 5035 arrays, are arrays whose elements are not zero-sized storage 5036 sequences, and TARGET and POINTER occupy the same storage 5037 units in array element order. As in case(B), the result is 5038 false, if POINTER is disassociated. 5039 5040 (D) If TARGET is present and an scalar pointer, the result is true 5041 if TARGET is associated with POINTER, the target associated 5042 with TARGET are not zero-sized storage sequences and occupy 5043 the same storage units. The result is false, if either 5044 TARGET or POINTER is disassociated. 5045 5046 (E) If TARGET is present and an array pointer, the result is true if 5047 target associated with POINTER and the target associated with 5048 TARGET have the same shape, are not zero-sized arrays, are 5049 arrays whose elements are not zero-sized storage sequences, 5050 and TARGET and POINTER occupy the same storage units in array 5051 element order. The result is false, if either TARGET or 5052 POINTER is disassociated. 5053 5054_Example_: 5055 program test_associated 5056 implicit none 5057 real, target :: tgt(2) = (/1., 2./) 5058 real, pointer :: ptr(:) 5059 ptr => tgt 5060 if (associated(ptr) .eqv. .false.) call abort 5061 if (associated(ptr,tgt) .eqv. .false.) call abort 5062 end program test_associated 5063 5064_See also_: 5065 *note NULL:: 5066 5067 5068File: gfortran.info, Node: ATAN, Next: ATAN2, Prev: ASSOCIATED, Up: Intrinsic Procedures 5069 50708.21 `ATAN' -- Arctangent function 5071================================== 5072 5073_Description_: 5074 `ATAN(X)' computes the arctangent of X. 5075 5076_Standard_: 5077 Fortran 77 and later, for a complex argument and for two arguments 5078 Fortran 2008 or later 5079 5080_Class_: 5081 Elemental function 5082 5083_Syntax_: 5084 `RESULT = ATAN(X)' 5085 `RESULT = ATAN(Y, X)' 5086 5087_Arguments_: 5088 X The type shall be `REAL' or `COMPLEX'; if Y is 5089 present, X shall be REAL. 5090 Y shall 5091 be of the 5092 same type 5093 and kind 5094 as X. 5095 5096_Return value_: 5097 The return value is of the same type and kind as X. If Y is 5098 present, the result is identical to `ATAN2(Y,X)'. Otherwise, it 5099 the arcus tangent of X, where the real part of the result is in 5100 radians and lies in the range -\pi/2 \leq \Re \atan(x) \leq \pi/2. 5101 5102_Example_: 5103 program test_atan 5104 real(8) :: x = 2.866_8 5105 x = atan(x) 5106 end program test_atan 5107 5108_Specific names_: 5109 Name Argument Return type Standard 5110 `ATAN(X)' `REAL(4) X' `REAL(4)' Fortran 77 and 5111 later 5112 `DATAN(X)' `REAL(8) X' `REAL(8)' Fortran 77 and 5113 later 5114 5115_See also_: 5116 Inverse function: *note TAN:: 5117 5118 5119 5120File: gfortran.info, Node: ATAN2, Next: ATANH, Prev: ATAN, Up: Intrinsic Procedures 5121 51228.22 `ATAN2' -- Arctangent function 5123=================================== 5124 5125_Description_: 5126 `ATAN2(Y, X)' computes the principal value of the argument 5127 function of the complex number X + i Y. This function can be used 5128 to transform from Cartesian into polar coordinates and allows to 5129 determine the angle in the correct quadrant. 5130 5131_Standard_: 5132 Fortran 77 and later 5133 5134_Class_: 5135 Elemental function 5136 5137_Syntax_: 5138 `RESULT = ATAN2(Y, X)' 5139 5140_Arguments_: 5141 Y The type shall be `REAL'. 5142 X The type and kind type parameter shall be the 5143 same as Y. If Y is zero, then X must be 5144 nonzero. 5145 5146_Return value_: 5147 The return value has the same type and kind type parameter as Y. It 5148 is the principal value of the complex number X + i Y. If X is 5149 nonzero, then it lies in the range -\pi \le \atan (x) \leq \pi. 5150 The sign is positive if Y is positive. If Y is zero, then the 5151 return value is zero if X is strictly positive, \pi if X is 5152 negative and Y is positive zero (or the processor does not handle 5153 signed zeros), and -\pi if X is negative and Y is negative zero. 5154 Finally, if X is zero, then the magnitude of the result is \pi/2. 5155 5156_Example_: 5157 program test_atan2 5158 real(4) :: x = 1.e0_4, y = 0.5e0_4 5159 x = atan2(y,x) 5160 end program test_atan2 5161 5162_Specific names_: 5163 Name Argument Return type Standard 5164 `ATAN2(X, `REAL(4) X, `REAL(4)' Fortran 77 and 5165 Y)' Y' later 5166 `DATAN2(X, `REAL(8) X, `REAL(8)' Fortran 77 and 5167 Y)' Y' later 5168 5169 5170File: gfortran.info, Node: ATANH, Next: ATOMIC_DEFINE, Prev: ATAN2, Up: Intrinsic Procedures 5171 51728.23 `ATANH' -- Inverse hyperbolic tangent function 5173=================================================== 5174 5175_Description_: 5176 `ATANH(X)' computes the inverse hyperbolic tangent of X. 5177 5178_Standard_: 5179 Fortran 2008 and later 5180 5181_Class_: 5182 Elemental function 5183 5184_Syntax_: 5185 `RESULT = ATANH(X)' 5186 5187_Arguments_: 5188 X The type shall be `REAL' or `COMPLEX'. 5189 5190_Return value_: 5191 The return value has same type and kind as X. If X is complex, the 5192 imaginary part of the result is in radians and lies between -\pi/2 5193 \leq \Im \atanh(x) \leq \pi/2. 5194 5195_Example_: 5196 PROGRAM test_atanh 5197 REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /) 5198 WRITE (*,*) ATANH(x) 5199 END PROGRAM 5200 5201_Specific names_: 5202 Name Argument Return type Standard 5203 `DATANH(X)' `REAL(8) X' `REAL(8)' GNU extension 5204 5205_See also_: 5206 Inverse function: *note TANH:: 5207 5208 5209File: gfortran.info, Node: ATOMIC_DEFINE, Next: ATOMIC_REF, Prev: ATANH, Up: Intrinsic Procedures 5210 52118.24 `ATOMIC_DEFINE' -- Setting a variable atomically 5212===================================================== 5213 5214_Description_: 5215 `ATOMIC_DEFINE(ATOM, VALUE)' defines the variable ATOM with the 5216 value VALUE atomically. 5217 5218_Standard_: 5219 Fortran 2008 and later 5220 5221_Class_: 5222 Atomic subroutine 5223 5224_Syntax_: 5225 `CALL ATOMIC_DEFINE(ATOM, VALUE)' 5226 5227_Arguments_: 5228 ATOM Scalar coarray or coindexed variable of either 5229 integer type with 5230 `ATOMIC_INT_KIND' kind or logical type 5231 with `ATOMIC_LOGICAL_KIND' kind. 5232 VALURE Scalar and of the same type as ATOM. If the 5233 kind is different, the 5234 value is converted to the kind of 5235 ATOM. 5236 5237_Example_: 5238 program atomic 5239 use iso_fortran_env 5240 integer(atomic_int_kind) :: atom[*] 5241 call atomic_define (atom[1], this_image()) 5242 end program atomic 5243 5244_See also_: 5245 *note ATOMIC_REF::, *note ISO_FORTRAN_ENV:: 5246 5247 5248File: gfortran.info, Node: ATOMIC_REF, Next: BACKTRACE, Prev: ATOMIC_DEFINE, Up: Intrinsic Procedures 5249 52508.25 `ATOMIC_REF' -- Obtaining the value of a variable atomically 5251================================================================= 5252 5253_Description_: 5254 `ATOMIC_DEFINE(ATOM, VALUE)' atomically assigns the value of the 5255 variable ATOM to VALUE. 5256 5257_Standard_: 5258 Fortran 2008 and later 5259 5260_Class_: 5261 Atomic subroutine 5262 5263_Syntax_: 5264 `CALL ATOMIC_REF(VALUE, ATOM)' 5265 5266_Arguments_: 5267 VALURE Scalar and of the same type as ATOM. If the 5268 kind is different, the 5269 value is converted to the kind of 5270 ATOM. 5271 ATOM Scalar coarray or coindexed variable of either 5272 integer type with 5273 `ATOMIC_INT_KIND' kind or logical type 5274 with `ATOMIC_LOGICAL_KIND' kind. 5275 5276_Example_: 5277 program atomic 5278 use iso_fortran_env 5279 logical(atomic_logical_kind) :: atom[*] 5280 logical :: val 5281 call atomic_ref (atom, .false.) 5282 ! ... 5283 call atomic_ref (atom, val) 5284 if (val) then 5285 print *, "Obtained" 5286 end if 5287 end program atomic 5288 5289_See also_: 5290 *note ATOMIC_DEFINE::, *note ISO_FORTRAN_ENV:: 5291 5292 5293File: gfortran.info, Node: BACKTRACE, Next: BESSEL_J0, Prev: ATOMIC_REF, Up: Intrinsic Procedures 5294 52958.26 `BACKTRACE' -- Show a backtrace 5296==================================== 5297 5298_Description_: 5299 `BACKTRACE' shows a backtrace at an arbitrary place in user code. 5300 Program execution continues normally afterwards. The backtrace 5301 information is printed to the unit corresponding to `ERROR_UNIT' 5302 in `ISO_FORTRAN_ENV'. 5303 5304_Standard_: 5305 GNU Extension 5306 5307_Class_: 5308 Subroutine 5309 5310_Syntax_: 5311 `CALL BACKTRACE' 5312 5313_Arguments_: 5314 None 5315 5316_See also_: 5317 *note ABORT:: 5318 5319 5320File: gfortran.info, Node: BESSEL_J0, Next: BESSEL_J1, Prev: BACKTRACE, Up: Intrinsic Procedures 5321 53228.27 `BESSEL_J0' -- Bessel function of the first kind of order 0 5323================================================================ 5324 5325_Description_: 5326 `BESSEL_J0(X)' computes the Bessel function of the first kind of 5327 order 0 of X. This function is available under the name `BESJ0' as 5328 a GNU extension. 5329 5330_Standard_: 5331 Fortran 2008 and later 5332 5333_Class_: 5334 Elemental function 5335 5336_Syntax_: 5337 `RESULT = BESSEL_J0(X)' 5338 5339_Arguments_: 5340 X The type shall be `REAL', and it shall be 5341 scalar. 5342 5343_Return value_: 5344 The return value is of type `REAL' and lies in the range - 5345 0.4027... \leq Bessel (0,x) \leq 1. It has the same kind as X. 5346 5347_Example_: 5348 program test_besj0 5349 real(8) :: x = 0.0_8 5350 x = bessel_j0(x) 5351 end program test_besj0 5352 5353_Specific names_: 5354 Name Argument Return type Standard 5355 `DBESJ0(X)' `REAL(8) X' `REAL(8)' GNU extension 5356 5357 5358File: gfortran.info, Node: BESSEL_J1, Next: BESSEL_JN, Prev: BESSEL_J0, Up: Intrinsic Procedures 5359 53608.28 `BESSEL_J1' -- Bessel function of the first kind of order 1 5361================================================================ 5362 5363_Description_: 5364 `BESSEL_J1(X)' computes the Bessel function of the first kind of 5365 order 1 of X. This function is available under the name `BESJ1' as 5366 a GNU extension. 5367 5368_Standard_: 5369 Fortran 2008 5370 5371_Class_: 5372 Elemental function 5373 5374_Syntax_: 5375 `RESULT = BESSEL_J1(X)' 5376 5377_Arguments_: 5378 X The type shall be `REAL', and it shall be 5379 scalar. 5380 5381_Return value_: 5382 The return value is of type `REAL' and it lies in the range - 5383 0.5818... \leq Bessel (0,x) \leq 0.5818 . It has the same kind as 5384 X. 5385 5386_Example_: 5387 program test_besj1 5388 real(8) :: x = 1.0_8 5389 x = bessel_j1(x) 5390 end program test_besj1 5391 5392_Specific names_: 5393 Name Argument Return type Standard 5394 `DBESJ1(X)' `REAL(8) X' `REAL(8)' GNU extension 5395 5396 5397File: gfortran.info, Node: BESSEL_JN, Next: BESSEL_Y0, Prev: BESSEL_J1, Up: Intrinsic Procedures 5398 53998.29 `BESSEL_JN' -- Bessel function of the first kind 5400===================================================== 5401 5402_Description_: 5403 `BESSEL_JN(N, X)' computes the Bessel function of the first kind of 5404 order N of X. This function is available under the name `BESJN' as 5405 a GNU extension. If N and X are arrays, their ranks and shapes 5406 shall conform. 5407 5408 `BESSEL_JN(N1, N2, X)' returns an array with the Bessel functions 5409 of the first kind of the orders N1 to N2. 5410 5411_Standard_: 5412 Fortran 2008 and later, negative N is allowed as GNU extension 5413 5414_Class_: 5415 Elemental function, except for the transformational function 5416 `BESSEL_JN(N1, N2, X)' 5417 5418_Syntax_: 5419 `RESULT = BESSEL_JN(N, X)' 5420 `RESULT = BESSEL_JN(N1, N2, X)' 5421 5422_Arguments_: 5423 N Shall be a scalar or an array of type 5424 `INTEGER'. 5425 N1 Shall be a non-negative scalar of type 5426 `INTEGER'. 5427 N2 Shall be a non-negative scalar of type 5428 `INTEGER'. 5429 X Shall be a scalar or an array of type `REAL'; 5430 for `BESSEL_JN(N1, N2, X)' it shall be scalar. 5431 5432_Return value_: 5433 The return value is a scalar of type `REAL'. It has the same kind 5434 as X. 5435 5436_Note_: 5437 The transformational function uses a recurrence algorithm which 5438 might, for some values of X, lead to different results than calls 5439 to the elemental function. 5440 5441_Example_: 5442 program test_besjn 5443 real(8) :: x = 1.0_8 5444 x = bessel_jn(5,x) 5445 end program test_besjn 5446 5447_Specific names_: 5448 Name Argument Return type Standard 5449 `DBESJN(N, `INTEGER N' `REAL(8)' GNU extension 5450 X)' 5451 `REAL(8) X' 5452 5453 5454File: gfortran.info, Node: BESSEL_Y0, Next: BESSEL_Y1, Prev: BESSEL_JN, Up: Intrinsic Procedures 5455 54568.30 `BESSEL_Y0' -- Bessel function of the second kind of order 0 5457================================================================= 5458 5459_Description_: 5460 `BESSEL_Y0(X)' computes the Bessel function of the second kind of 5461 order 0 of X. This function is available under the name `BESY0' as 5462 a GNU extension. 5463 5464_Standard_: 5465 Fortran 2008 and later 5466 5467_Class_: 5468 Elemental function 5469 5470_Syntax_: 5471 `RESULT = BESSEL_Y0(X)' 5472 5473_Arguments_: 5474 X The type shall be `REAL', and it shall be 5475 scalar. 5476 5477_Return value_: 5478 The return value is a scalar of type `REAL'. It has the same kind 5479 as X. 5480 5481_Example_: 5482 program test_besy0 5483 real(8) :: x = 0.0_8 5484 x = bessel_y0(x) 5485 end program test_besy0 5486 5487_Specific names_: 5488 Name Argument Return type Standard 5489 `DBESY0(X)' `REAL(8) X' `REAL(8)' GNU extension 5490 5491 5492File: gfortran.info, Node: BESSEL_Y1, Next: BESSEL_YN, Prev: BESSEL_Y0, Up: Intrinsic Procedures 5493 54948.31 `BESSEL_Y1' -- Bessel function of the second kind of order 1 5495================================================================= 5496 5497_Description_: 5498 `BESSEL_Y1(X)' computes the Bessel function of the second kind of 5499 order 1 of X. This function is available under the name `BESY1' as 5500 a GNU extension. 5501 5502_Standard_: 5503 Fortran 2008 and later 5504 5505_Class_: 5506 Elemental function 5507 5508_Syntax_: 5509 `RESULT = BESSEL_Y1(X)' 5510 5511_Arguments_: 5512 X The type shall be `REAL', and it shall be 5513 scalar. 5514 5515_Return value_: 5516 The return value is a scalar of type `REAL'. It has the same kind 5517 as X. 5518 5519_Example_: 5520 program test_besy1 5521 real(8) :: x = 1.0_8 5522 x = bessel_y1(x) 5523 end program test_besy1 5524 5525_Specific names_: 5526 Name Argument Return type Standard 5527 `DBESY1(X)' `REAL(8) X' `REAL(8)' GNU extension 5528 5529 5530File: gfortran.info, Node: BESSEL_YN, Next: BGE, Prev: BESSEL_Y1, Up: Intrinsic Procedures 5531 55328.32 `BESSEL_YN' -- Bessel function of the second kind 5533====================================================== 5534 5535_Description_: 5536 `BESSEL_YN(N, X)' computes the Bessel function of the second kind 5537 of order N of X. This function is available under the name `BESYN' 5538 as a GNU extension. If N and X are arrays, their ranks and shapes 5539 shall conform. 5540 5541 `BESSEL_YN(N1, N2, X)' returns an array with the Bessel functions 5542 of the first kind of the orders N1 to N2. 5543 5544_Standard_: 5545 Fortran 2008 and later, negative N is allowed as GNU extension 5546 5547_Class_: 5548 Elemental function, except for the transformational function 5549 `BESSEL_YN(N1, N2, X)' 5550 5551_Syntax_: 5552 `RESULT = BESSEL_YN(N, X)' 5553 `RESULT = BESSEL_YN(N1, N2, X)' 5554 5555_Arguments_: 5556 N Shall be a scalar or an array of type 5557 `INTEGER' . 5558 N1 Shall be a non-negative scalar of type 5559 `INTEGER'. 5560 N2 Shall be a non-negative scalar of type 5561 `INTEGER'. 5562 X Shall be a scalar or an array of type `REAL'; 5563 for `BESSEL_YN(N1, N2, X)' it shall be scalar. 5564 5565_Return value_: 5566 The return value is a scalar of type `REAL'. It has the same kind 5567 as X. 5568 5569_Note_: 5570 The transformational function uses a recurrence algorithm which 5571 might, for some values of X, lead to different results than calls 5572 to the elemental function. 5573 5574_Example_: 5575 program test_besyn 5576 real(8) :: x = 1.0_8 5577 x = bessel_yn(5,x) 5578 end program test_besyn 5579 5580_Specific names_: 5581 Name Argument Return type Standard 5582 `DBESYN(N,X)' `INTEGER N' `REAL(8)' GNU extension 5583 `REAL(8) X' 5584 5585 5586File: gfortran.info, Node: BGE, Next: BGT, Prev: BESSEL_YN, Up: Intrinsic Procedures 5587 55888.33 `BGE' -- Bitwise greater than or equal to 5589============================================== 5590 5591_Description_: 5592 Determines whether an integral is a bitwise greater than or equal 5593 to another. 5594 5595_Standard_: 5596 Fortran 2008 and later 5597 5598_Class_: 5599 Elemental function 5600 5601_Syntax_: 5602 `RESULT = BGE(I, J)' 5603 5604_Arguments_: 5605 I Shall be of `INTEGER' type. 5606 J Shall be of `INTEGER' type, and of the same 5607 kind as I. 5608 5609_Return value_: 5610 The return value is of type `LOGICAL' and of the default kind. 5611 5612_See also_: 5613 *note BGT::, *note BLE::, *note BLT:: 5614 5615 5616File: gfortran.info, Node: BGT, Next: BIT_SIZE, Prev: BGE, Up: Intrinsic Procedures 5617 56188.34 `BGT' -- Bitwise greater than 5619================================== 5620 5621_Description_: 5622 Determines whether an integral is a bitwise greater than another. 5623 5624_Standard_: 5625 Fortran 2008 and later 5626 5627_Class_: 5628 Elemental function 5629 5630_Syntax_: 5631 `RESULT = BGT(I, J)' 5632 5633_Arguments_: 5634 I Shall be of `INTEGER' type. 5635 J Shall be of `INTEGER' type, and of the same 5636 kind as I. 5637 5638_Return value_: 5639 The return value is of type `LOGICAL' and of the default kind. 5640 5641_See also_: 5642 *note BGE::, *note BLE::, *note BLT:: 5643 5644 5645File: gfortran.info, Node: BIT_SIZE, Next: BLE, Prev: BGT, Up: Intrinsic Procedures 5646 56478.35 `BIT_SIZE' -- Bit size inquiry function 5648============================================ 5649 5650_Description_: 5651 `BIT_SIZE(I)' returns the number of bits (integer precision plus 5652 sign bit) represented by the type of I. The result of 5653 `BIT_SIZE(I)' is independent of the actual value of I. 5654 5655_Standard_: 5656 Fortran 95 and later 5657 5658_Class_: 5659 Inquiry function 5660 5661_Syntax_: 5662 `RESULT = BIT_SIZE(I)' 5663 5664_Arguments_: 5665 I The type shall be `INTEGER'. 5666 5667_Return value_: 5668 The return value is of type `INTEGER' 5669 5670_Example_: 5671 program test_bit_size 5672 integer :: i = 123 5673 integer :: size 5674 size = bit_size(i) 5675 print *, size 5676 end program test_bit_size 5677 5678 5679File: gfortran.info, Node: BLE, Next: BLT, Prev: BIT_SIZE, Up: Intrinsic Procedures 5680 56818.36 `BLE' -- Bitwise less than or equal to 5682=========================================== 5683 5684_Description_: 5685 Determines whether an integral is a bitwise less than or equal to 5686 another. 5687 5688_Standard_: 5689 Fortran 2008 and later 5690 5691_Class_: 5692 Elemental function 5693 5694_Syntax_: 5695 `RESULT = BLE(I, J)' 5696 5697_Arguments_: 5698 I Shall be of `INTEGER' type. 5699 J Shall be of `INTEGER' type, and of the same 5700 kind as I. 5701 5702_Return value_: 5703 The return value is of type `LOGICAL' and of the default kind. 5704 5705_See also_: 5706 *note BGT::, *note BGE::, *note BLT:: 5707 5708 5709File: gfortran.info, Node: BLT, Next: BTEST, Prev: BLE, Up: Intrinsic Procedures 5710 57118.37 `BLT' -- Bitwise less than 5712=============================== 5713 5714_Description_: 5715 Determines whether an integral is a bitwise less than another. 5716 5717_Standard_: 5718 Fortran 2008 and later 5719 5720_Class_: 5721 Elemental function 5722 5723_Syntax_: 5724 `RESULT = BLT(I, J)' 5725 5726_Arguments_: 5727 I Shall be of `INTEGER' type. 5728 J Shall be of `INTEGER' type, and of the same 5729 kind as I. 5730 5731_Return value_: 5732 The return value is of type `LOGICAL' and of the default kind. 5733 5734_See also_: 5735 *note BGE::, *note BGT::, *note BLE:: 5736 5737 5738File: gfortran.info, Node: BTEST, Next: C_ASSOCIATED, Prev: BLT, Up: Intrinsic Procedures 5739 57408.38 `BTEST' -- Bit test function 5741================================= 5742 5743_Description_: 5744 `BTEST(I,POS)' returns logical `.TRUE.' if the bit at POS in I is 5745 set. The counting of the bits starts at 0. 5746 5747_Standard_: 5748 Fortran 95 and later 5749 5750_Class_: 5751 Elemental function 5752 5753_Syntax_: 5754 `RESULT = BTEST(I, POS)' 5755 5756_Arguments_: 5757 I The type shall be `INTEGER'. 5758 POS The type shall be `INTEGER'. 5759 5760_Return value_: 5761 The return value is of type `LOGICAL' 5762 5763_Example_: 5764 program test_btest 5765 integer :: i = 32768 + 1024 + 64 5766 integer :: pos 5767 logical :: bool 5768 do pos=0,16 5769 bool = btest(i, pos) 5770 print *, pos, bool 5771 end do 5772 end program test_btest 5773 5774 5775File: gfortran.info, Node: C_ASSOCIATED, Next: C_F_POINTER, Prev: BTEST, Up: Intrinsic Procedures 5776 57778.39 `C_ASSOCIATED' -- Status of a C pointer 5778============================================ 5779 5780_Description_: 5781 `C_ASSOCIATED(c_prt_1[, c_ptr_2])' determines the status of the C 5782 pointer C_PTR_1 or if C_PTR_1 is associated with the target 5783 C_PTR_2. 5784 5785_Standard_: 5786 Fortran 2003 and later 5787 5788_Class_: 5789 Inquiry function 5790 5791_Syntax_: 5792 `RESULT = C_ASSOCIATED(c_prt_1[, c_ptr_2])' 5793 5794_Arguments_: 5795 C_PTR_1 Scalar of the type `C_PTR' or `C_FUNPTR'. 5796 C_PTR_2 (Optional) Scalar of the same type as C_PTR_1. 5797 5798_Return value_: 5799 The return value is of type `LOGICAL'; it is `.false.' if either 5800 C_PTR_1 is a C NULL pointer or if C_PTR1 and C_PTR_2 point to 5801 different addresses. 5802 5803_Example_: 5804 subroutine association_test(a,b) 5805 use iso_c_binding, only: c_associated, c_loc, c_ptr 5806 implicit none 5807 real, pointer :: a 5808 type(c_ptr) :: b 5809 if(c_associated(b, c_loc(a))) & 5810 stop 'b and a do not point to same target' 5811 end subroutine association_test 5812 5813_See also_: 5814 *note C_LOC::, *note C_FUNLOC:: 5815 5816 5817File: gfortran.info, Node: C_F_POINTER, Next: C_F_PROCPOINTER, Prev: C_ASSOCIATED, Up: Intrinsic Procedures 5818 58198.40 `C_F_POINTER' -- Convert C into Fortran pointer 5820==================================================== 5821 5822_Description_: 5823 `C_F_POINTER(CPTR, FPTR[, SHAPE])' assigns the target of the C 5824 pointer CPTR to the Fortran pointer FPTR and specifies its shape. 5825 5826_Standard_: 5827 Fortran 2003 and later 5828 5829_Class_: 5830 Subroutine 5831 5832_Syntax_: 5833 `CALL C_F_POINTER(CPTR, FPTR[, SHAPE])' 5834 5835_Arguments_: 5836 CPTR scalar of the type `C_PTR'. It is `INTENT(IN)'. 5837 FPTR pointer interoperable with CPTR. It is 5838 `INTENT(OUT)'. 5839 SHAPE (Optional) Rank-one array of type `INTEGER' 5840 with `INTENT(IN)'. It shall be present if and 5841 only if FPTR is an array. The size must be 5842 equal to the rank of FPTR. 5843 5844_Example_: 5845 program main 5846 use iso_c_binding 5847 implicit none 5848 interface 5849 subroutine my_routine(p) bind(c,name='myC_func') 5850 import :: c_ptr 5851 type(c_ptr), intent(out) :: p 5852 end subroutine 5853 end interface 5854 type(c_ptr) :: cptr 5855 real,pointer :: a(:) 5856 call my_routine(cptr) 5857 call c_f_pointer(cptr, a, [12]) 5858 end program main 5859 5860_See also_: 5861 *note C_LOC::, *note C_F_PROCPOINTER:: 5862 5863 5864File: gfortran.info, Node: C_F_PROCPOINTER, Next: C_FUNLOC, Prev: C_F_POINTER, Up: Intrinsic Procedures 5865 58668.41 `C_F_PROCPOINTER' -- Convert C into Fortran procedure pointer 5867================================================================== 5868 5869_Description_: 5870 `C_F_PROCPOINTER(CPTR, FPTR)' Assign the target of the C function 5871 pointer CPTR to the Fortran procedure pointer FPTR. 5872 5873_Standard_: 5874 Fortran 2003 and later 5875 5876_Class_: 5877 Subroutine 5878 5879_Syntax_: 5880 `CALL C_F_PROCPOINTER(cptr, fptr)' 5881 5882_Arguments_: 5883 CPTR scalar of the type `C_FUNPTR'. It is 5884 `INTENT(IN)'. 5885 FPTR procedure pointer interoperable with CPTR. It 5886 is `INTENT(OUT)'. 5887 5888_Example_: 5889 program main 5890 use iso_c_binding 5891 implicit none 5892 abstract interface 5893 function func(a) 5894 import :: c_float 5895 real(c_float), intent(in) :: a 5896 real(c_float) :: func 5897 end function 5898 end interface 5899 interface 5900 function getIterFunc() bind(c,name="getIterFunc") 5901 import :: c_funptr 5902 type(c_funptr) :: getIterFunc 5903 end function 5904 end interface 5905 type(c_funptr) :: cfunptr 5906 procedure(func), pointer :: myFunc 5907 cfunptr = getIterFunc() 5908 call c_f_procpointer(cfunptr, myFunc) 5909 end program main 5910 5911_See also_: 5912 *note C_LOC::, *note C_F_POINTER:: 5913 5914 5915File: gfortran.info, Node: C_FUNLOC, Next: C_LOC, Prev: C_F_PROCPOINTER, Up: Intrinsic Procedures 5916 59178.42 `C_FUNLOC' -- Obtain the C address of a procedure 5918====================================================== 5919 5920_Description_: 5921 `C_FUNLOC(x)' determines the C address of the argument. 5922 5923_Standard_: 5924 Fortran 2003 and later 5925 5926_Class_: 5927 Inquiry function 5928 5929_Syntax_: 5930 `RESULT = C_FUNLOC(x)' 5931 5932_Arguments_: 5933 X Interoperable function or pointer to such 5934 function. 5935 5936_Return value_: 5937 The return value is of type `C_FUNPTR' and contains the C address 5938 of the argument. 5939 5940_Example_: 5941 module x 5942 use iso_c_binding 5943 implicit none 5944 contains 5945 subroutine sub(a) bind(c) 5946 real(c_float) :: a 5947 a = sqrt(a)+5.0 5948 end subroutine sub 5949 end module x 5950 program main 5951 use iso_c_binding 5952 use x 5953 implicit none 5954 interface 5955 subroutine my_routine(p) bind(c,name='myC_func') 5956 import :: c_funptr 5957 type(c_funptr), intent(in) :: p 5958 end subroutine 5959 end interface 5960 call my_routine(c_funloc(sub)) 5961 end program main 5962 5963_See also_: 5964 *note C_ASSOCIATED::, *note C_LOC::, *note C_F_POINTER::, *note 5965 C_F_PROCPOINTER:: 5966 5967 5968File: gfortran.info, Node: C_LOC, Next: C_SIZEOF, Prev: C_FUNLOC, Up: Intrinsic Procedures 5969 59708.43 `C_LOC' -- Obtain the C address of an object 5971================================================= 5972 5973_Description_: 5974 `C_LOC(X)' determines the C address of the argument. 5975 5976_Standard_: 5977 Fortran 2003 and later 5978 5979_Class_: 5980 Inquiry function 5981 5982_Syntax_: 5983 `RESULT = C_LOC(X)' 5984 5985_Arguments_: 5986 X Shall have either the POINTER or TARGET 5987 attribute. It shall not be a coindexed object. It 5988 shall either be a variable with interoperable 5989 type and kind type parameters, or be a scalar, 5990 nonpolymorphic variable with no length type 5991 parameters. 5992 5993_Return value_: 5994 The return value is of type `C_PTR' and contains the C address of 5995 the argument. 5996 5997_Example_: 5998 subroutine association_test(a,b) 5999 use iso_c_binding, only: c_associated, c_loc, c_ptr 6000 implicit none 6001 real, pointer :: a 6002 type(c_ptr) :: b 6003 if(c_associated(b, c_loc(a))) & 6004 stop 'b and a do not point to same target' 6005 end subroutine association_test 6006 6007_See also_: 6008 *note C_ASSOCIATED::, *note C_FUNLOC::, *note C_F_POINTER::, *note 6009 C_F_PROCPOINTER:: 6010 6011 6012File: gfortran.info, Node: C_SIZEOF, Next: CEILING, Prev: C_LOC, Up: Intrinsic Procedures 6013 60148.44 `C_SIZEOF' -- Size in bytes of an expression 6015================================================= 6016 6017_Description_: 6018 `C_SIZEOF(X)' calculates the number of bytes of storage the 6019 expression `X' occupies. 6020 6021_Standard_: 6022 Fortran 2008 6023 6024_Class_: 6025 Inquiry function of the module `ISO_C_BINDING' 6026 6027_Syntax_: 6028 `N = C_SIZEOF(X)' 6029 6030_Arguments_: 6031 X The argument shall be an interoperable data 6032 entity. 6033 6034_Return value_: 6035 The return value is of type integer and of the system-dependent 6036 kind `C_SIZE_T' (from the `ISO_C_BINDING' module). Its value is the 6037 number of bytes occupied by the argument. If the argument has the 6038 `POINTER' attribute, the number of bytes of the storage area 6039 pointed to is returned. If the argument is of a derived type with 6040 `POINTER' or `ALLOCATABLE' components, the return value does not 6041 account for the sizes of the data pointed to by these components. 6042 6043_Example_: 6044 use iso_c_binding 6045 integer(c_int) :: i 6046 real(c_float) :: r, s(5) 6047 print *, (c_sizeof(s)/c_sizeof(r) == 5) 6048 end 6049 The example will print `.TRUE.' unless you are using a platform 6050 where default `REAL' variables are unusually padded. 6051 6052_See also_: 6053 *note SIZEOF::, *note STORAGE_SIZE:: 6054 6055 6056File: gfortran.info, Node: CEILING, Next: CHAR, Prev: C_SIZEOF, Up: Intrinsic Procedures 6057 60588.45 `CEILING' -- Integer ceiling function 6059========================================== 6060 6061_Description_: 6062 `CEILING(A)' returns the least integer greater than or equal to A. 6063 6064_Standard_: 6065 Fortran 95 and later 6066 6067_Class_: 6068 Elemental function 6069 6070_Syntax_: 6071 `RESULT = CEILING(A [, KIND])' 6072 6073_Arguments_: 6074 A The type shall be `REAL'. 6075 KIND (Optional) An `INTEGER' initialization 6076 expression indicating the kind parameter of 6077 the result. 6078 6079_Return value_: 6080 The return value is of type `INTEGER(KIND)' if KIND is present and 6081 a default-kind `INTEGER' otherwise. 6082 6083_Example_: 6084 program test_ceiling 6085 real :: x = 63.29 6086 real :: y = -63.59 6087 print *, ceiling(x) ! returns 64 6088 print *, ceiling(y) ! returns -63 6089 end program test_ceiling 6090 6091_See also_: 6092 *note FLOOR::, *note NINT:: 6093 6094 6095 6096File: gfortran.info, Node: CHAR, Next: CHDIR, Prev: CEILING, Up: Intrinsic Procedures 6097 60988.46 `CHAR' -- Character conversion function 6099============================================ 6100 6101_Description_: 6102 `CHAR(I [, KIND])' returns the character represented by the 6103 integer I. 6104 6105_Standard_: 6106 Fortran 77 and later 6107 6108_Class_: 6109 Elemental function 6110 6111_Syntax_: 6112 `RESULT = CHAR(I [, KIND])' 6113 6114_Arguments_: 6115 I The type shall be `INTEGER'. 6116 KIND (Optional) An `INTEGER' initialization 6117 expression indicating the kind parameter of 6118 the result. 6119 6120_Return value_: 6121 The return value is of type `CHARACTER(1)' 6122 6123_Example_: 6124 program test_char 6125 integer :: i = 74 6126 character(1) :: c 6127 c = char(i) 6128 print *, i, c ! returns 'J' 6129 end program test_char 6130 6131_Specific names_: 6132 Name Argument Return type Standard 6133 `CHAR(I)' `INTEGER I' `CHARACTER(LEN=1)'F77 and later 6134 6135_Note_: 6136 See *note ICHAR:: for a discussion of converting between numerical 6137 values and formatted string representations. 6138 6139_See also_: 6140 *note ACHAR::, *note IACHAR::, *note ICHAR:: 6141 6142 6143 6144File: gfortran.info, Node: CHDIR, Next: CHMOD, Prev: CHAR, Up: Intrinsic Procedures 6145 61468.47 `CHDIR' -- Change working directory 6147======================================== 6148 6149_Description_: 6150 Change current working directory to a specified path. 6151 6152 This intrinsic is provided in both subroutine and function forms; 6153 however, only one form can be used in any given program unit. 6154 6155_Standard_: 6156 GNU extension 6157 6158_Class_: 6159 Subroutine, function 6160 6161_Syntax_: 6162 `CALL CHDIR(NAME [, STATUS])' 6163 `STATUS = CHDIR(NAME)' 6164 6165_Arguments_: 6166 NAME The type shall be `CHARACTER' of default kind 6167 and shall specify a valid path within the file 6168 system. 6169 STATUS (Optional) `INTEGER' status flag of the default 6170 kind. Returns 0 on success, and a system 6171 specific and nonzero error code otherwise. 6172 6173_Example_: 6174 PROGRAM test_chdir 6175 CHARACTER(len=255) :: path 6176 CALL getcwd(path) 6177 WRITE(*,*) TRIM(path) 6178 CALL chdir("/tmp") 6179 CALL getcwd(path) 6180 WRITE(*,*) TRIM(path) 6181 END PROGRAM 6182 6183_See also_: 6184 *note GETCWD:: 6185 6186 6187File: gfortran.info, Node: CHMOD, Next: CMPLX, Prev: CHDIR, Up: Intrinsic Procedures 6188 61898.48 `CHMOD' -- Change access permissions of files 6190================================================== 6191 6192_Description_: 6193 `CHMOD' changes the permissions of a file. 6194 6195 This intrinsic is provided in both subroutine and function forms; 6196 however, only one form can be used in any given program unit. 6197 6198_Standard_: 6199 GNU extension 6200 6201_Class_: 6202 Subroutine, function 6203 6204_Syntax_: 6205 `CALL CHMOD(NAME, MODE[, STATUS])' 6206 `STATUS = CHMOD(NAME, MODE)' 6207 6208_Arguments_: 6209 NAME Scalar `CHARACTER' of default kind with the 6210 file name. Trailing blanks are ignored unless 6211 the character `achar(0)' is present, then all 6212 characters up to and excluding `achar(0)' are 6213 used as the file name. 6214 MODE Scalar `CHARACTER' of default kind giving the 6215 file permission. MODE uses the same syntax as 6216 the `chmod' utility as defined by the POSIX 6217 standard. The argument shall either be a 6218 string of a nonnegative octal number or a 6219 symbolic mode. 6220 STATUS (optional) scalar `INTEGER', which is `0' on 6221 success and nonzero otherwise. 6222 6223_Return value_: 6224 In either syntax, STATUS is set to `0' on success and nonzero 6225 otherwise. 6226 6227_Example_: 6228 `CHMOD' as subroutine 6229 program chmod_test 6230 implicit none 6231 integer :: status 6232 call chmod('test.dat','u+x',status) 6233 print *, 'Status: ', status 6234 end program chmod_test 6235 `CHMOD' as function: 6236 program chmod_test 6237 implicit none 6238 integer :: status 6239 status = chmod('test.dat','u+x') 6240 print *, 'Status: ', status 6241 end program chmod_test 6242 6243 6244 6245File: gfortran.info, Node: CMPLX, Next: COMMAND_ARGUMENT_COUNT, Prev: CHMOD, Up: Intrinsic Procedures 6246 62478.49 `CMPLX' -- Complex conversion function 6248=========================================== 6249 6250_Description_: 6251 `CMPLX(X [, Y [, KIND]])' returns a complex number where X is 6252 converted to the real component. If Y is present it is converted 6253 to the imaginary component. If Y is not present then the 6254 imaginary component is set to 0.0. If X is complex then Y must 6255 not be present. 6256 6257_Standard_: 6258 Fortran 77 and later 6259 6260_Class_: 6261 Elemental function 6262 6263_Syntax_: 6264 `RESULT = CMPLX(X [, Y [, KIND]])' 6265 6266_Arguments_: 6267 X The type may be `INTEGER', `REAL', or 6268 `COMPLEX'. 6269 Y (Optional; only allowed if X is not 6270 `COMPLEX'.) May be `INTEGER' or `REAL'. 6271 KIND (Optional) An `INTEGER' initialization 6272 expression indicating the kind parameter of 6273 the result. 6274 6275_Return value_: 6276 The return value is of `COMPLEX' type, with a kind equal to KIND 6277 if it is specified. If KIND is not specified, the result is of 6278 the default `COMPLEX' kind, regardless of the kinds of X and Y. 6279 6280_Example_: 6281 program test_cmplx 6282 integer :: i = 42 6283 real :: x = 3.14 6284 complex :: z 6285 z = cmplx(i, x) 6286 print *, z, cmplx(x) 6287 end program test_cmplx 6288 6289_See also_: 6290 *note COMPLEX:: 6291 6292 6293File: gfortran.info, Node: COMMAND_ARGUMENT_COUNT, Next: COMPILER_OPTIONS, Prev: CMPLX, Up: Intrinsic Procedures 6294 62958.50 `COMMAND_ARGUMENT_COUNT' -- Get number of command line arguments 6296===================================================================== 6297 6298_Description_: 6299 `COMMAND_ARGUMENT_COUNT' returns the number of arguments passed on 6300 the command line when the containing program was invoked. 6301 6302_Standard_: 6303 Fortran 2003 and later 6304 6305_Class_: 6306 Inquiry function 6307 6308_Syntax_: 6309 `RESULT = COMMAND_ARGUMENT_COUNT()' 6310 6311_Arguments_: 6312 None 6313 6314_Return value_: 6315 The return value is an `INTEGER' of default kind. 6316 6317_Example_: 6318 program test_command_argument_count 6319 integer :: count 6320 count = command_argument_count() 6321 print *, count 6322 end program test_command_argument_count 6323 6324_See also_: 6325 *note GET_COMMAND::, *note GET_COMMAND_ARGUMENT:: 6326 6327 6328File: gfortran.info, Node: COMPILER_OPTIONS, Next: COMPILER_VERSION, Prev: COMMAND_ARGUMENT_COUNT, Up: Intrinsic Procedures 6329 63308.51 `COMPILER_OPTIONS' -- Options passed to the compiler 6331========================================================= 6332 6333_Description_: 6334 `COMPILER_OPTIONS' returns a string with the options used for 6335 compiling. 6336 6337_Standard_: 6338 Fortran 2008 6339 6340_Class_: 6341 Inquiry function of the module `ISO_FORTRAN_ENV' 6342 6343_Syntax_: 6344 `STR = COMPILER_OPTIONS()' 6345 6346_Arguments_: 6347 None. 6348 6349_Return value_: 6350 The return value is a default-kind string with system-dependent 6351 length. It contains the compiler flags used to compile the file, 6352 which called the `COMPILER_OPTIONS' intrinsic. 6353 6354_Example_: 6355 use iso_fortran_env 6356 print '(4a)', 'This file was compiled by ', & 6357 compiler_version(), ' using the options ', & 6358 compiler_options() 6359 end 6360 6361_See also_: 6362 *note COMPILER_VERSION::, *note ISO_FORTRAN_ENV:: 6363 6364 6365File: gfortran.info, Node: COMPILER_VERSION, Next: COMPLEX, Prev: COMPILER_OPTIONS, Up: Intrinsic Procedures 6366 63678.52 `COMPILER_VERSION' -- Compiler version string 6368================================================== 6369 6370_Description_: 6371 `COMPILER_VERSION' returns a string with the name and the version 6372 of the compiler. 6373 6374_Standard_: 6375 Fortran 2008 6376 6377_Class_: 6378 Inquiry function of the module `ISO_FORTRAN_ENV' 6379 6380_Syntax_: 6381 `STR = COMPILER_VERSION()' 6382 6383_Arguments_: 6384 None. 6385 6386_Return value_: 6387 The return value is a default-kind string with system-dependent 6388 length. It contains the name of the compiler and its version 6389 number. 6390 6391_Example_: 6392 use iso_fortran_env 6393 print '(4a)', 'This file was compiled by ', & 6394 compiler_version(), ' using the options ', & 6395 compiler_options() 6396 end 6397 6398_See also_: 6399 *note COMPILER_OPTIONS::, *note ISO_FORTRAN_ENV:: 6400 6401 6402File: gfortran.info, Node: COMPLEX, Next: CONJG, Prev: COMPILER_VERSION, Up: Intrinsic Procedures 6403 64048.53 `COMPLEX' -- Complex conversion function 6405============================================= 6406 6407_Description_: 6408 `COMPLEX(X, Y)' returns a complex number where X is converted to 6409 the real component and Y is converted to the imaginary component. 6410 6411_Standard_: 6412 GNU extension 6413 6414_Class_: 6415 Elemental function 6416 6417_Syntax_: 6418 `RESULT = COMPLEX(X, Y)' 6419 6420_Arguments_: 6421 X The type may be `INTEGER' or `REAL'. 6422 Y The type may be `INTEGER' or `REAL'. 6423 6424_Return value_: 6425 If X and Y are both of `INTEGER' type, then the return value is of 6426 default `COMPLEX' type. 6427 6428 If X and Y are of `REAL' type, or one is of `REAL' type and one is 6429 of `INTEGER' type, then the return value is of `COMPLEX' type with 6430 a kind equal to that of the `REAL' argument with the highest 6431 precision. 6432 6433_Example_: 6434 program test_complex 6435 integer :: i = 42 6436 real :: x = 3.14 6437 print *, complex(i, x) 6438 end program test_complex 6439 6440_See also_: 6441 *note CMPLX:: 6442 6443 6444File: gfortran.info, Node: CONJG, Next: COS, Prev: COMPLEX, Up: Intrinsic Procedures 6445 64468.54 `CONJG' -- Complex conjugate function 6447========================================== 6448 6449_Description_: 6450 `CONJG(Z)' returns the conjugate of Z. If Z is `(x, y)' then the 6451 result is `(x, -y)' 6452 6453_Standard_: 6454 Fortran 77 and later, has overloads that are GNU extensions 6455 6456_Class_: 6457 Elemental function 6458 6459_Syntax_: 6460 `Z = CONJG(Z)' 6461 6462_Arguments_: 6463 Z The type shall be `COMPLEX'. 6464 6465_Return value_: 6466 The return value is of type `COMPLEX'. 6467 6468_Example_: 6469 program test_conjg 6470 complex :: z = (2.0, 3.0) 6471 complex(8) :: dz = (2.71_8, -3.14_8) 6472 z= conjg(z) 6473 print *, z 6474 dz = dconjg(dz) 6475 print *, dz 6476 end program test_conjg 6477 6478_Specific names_: 6479 Name Argument Return type Standard 6480 `CONJG(Z)' `COMPLEX Z' `COMPLEX' GNU extension 6481 `DCONJG(Z)' `COMPLEX(8) `COMPLEX(8)' GNU extension 6482 Z' 6483 6484 6485File: gfortran.info, Node: COS, Next: COSH, Prev: CONJG, Up: Intrinsic Procedures 6486 64878.55 `COS' -- Cosine function 6488============================= 6489 6490_Description_: 6491 `COS(X)' computes the cosine of X. 6492 6493_Standard_: 6494 Fortran 77 and later, has overloads that are GNU extensions 6495 6496_Class_: 6497 Elemental function 6498 6499_Syntax_: 6500 `RESULT = COS(X)' 6501 6502_Arguments_: 6503 X The type shall be `REAL' or `COMPLEX'. 6504 6505_Return value_: 6506 The return value is of the same type and kind as X. The real part 6507 of the result is in radians. If X is of the type `REAL', the 6508 return value lies in the range -1 \leq \cos (x) \leq 1. 6509 6510_Example_: 6511 program test_cos 6512 real :: x = 0.0 6513 x = cos(x) 6514 end program test_cos 6515 6516_Specific names_: 6517 Name Argument Return type Standard 6518 `COS(X)' `REAL(4) X' `REAL(4)' Fortran 77 and 6519 later 6520 `DCOS(X)' `REAL(8) X' `REAL(8)' Fortran 77 and 6521 later 6522 `CCOS(X)' `COMPLEX(4) `COMPLEX(4)' Fortran 77 and 6523 X' later 6524 `ZCOS(X)' `COMPLEX(8) `COMPLEX(8)' GNU extension 6525 X' 6526 `CDCOS(X)' `COMPLEX(8) `COMPLEX(8)' GNU extension 6527 X' 6528 6529_See also_: 6530 Inverse function: *note ACOS:: 6531 6532 6533 6534File: gfortran.info, Node: COSH, Next: COUNT, Prev: COS, Up: Intrinsic Procedures 6535 65368.56 `COSH' -- Hyperbolic cosine function 6537========================================= 6538 6539_Description_: 6540 `COSH(X)' computes the hyperbolic cosine of X. 6541 6542_Standard_: 6543 Fortran 77 and later, for a complex argument Fortran 2008 or later 6544 6545_Class_: 6546 Elemental function 6547 6548_Syntax_: 6549 `X = COSH(X)' 6550 6551_Arguments_: 6552 X The type shall be `REAL' or `COMPLEX'. 6553 6554_Return value_: 6555 The return value has same type and kind as X. If X is complex, the 6556 imaginary part of the result is in radians. If X is `REAL', the 6557 return value has a lower bound of one, \cosh (x) \geq 1. 6558 6559_Example_: 6560 program test_cosh 6561 real(8) :: x = 1.0_8 6562 x = cosh(x) 6563 end program test_cosh 6564 6565_Specific names_: 6566 Name Argument Return type Standard 6567 `COSH(X)' `REAL(4) X' `REAL(4)' Fortran 77 and 6568 later 6569 `DCOSH(X)' `REAL(8) X' `REAL(8)' Fortran 77 and 6570 later 6571 6572_See also_: 6573 Inverse function: *note ACOSH:: 6574 6575 6576 6577File: gfortran.info, Node: COUNT, Next: CPU_TIME, Prev: COSH, Up: Intrinsic Procedures 6578 65798.57 `COUNT' -- Count function 6580============================== 6581 6582_Description_: 6583 Counts the number of `.TRUE.' elements in a logical MASK, or, if 6584 the DIM argument is supplied, counts the number of elements along 6585 each row of the array in the DIM direction. If the array has zero 6586 size, or all of the elements of MASK are `.FALSE.', then the 6587 result is `0'. 6588 6589_Standard_: 6590 Fortran 95 and later, with KIND argument Fortran 2003 and later 6591 6592_Class_: 6593 Transformational function 6594 6595_Syntax_: 6596 `RESULT = COUNT(MASK [, DIM, KIND])' 6597 6598_Arguments_: 6599 MASK The type shall be `LOGICAL'. 6600 DIM (Optional) The type shall be `INTEGER'. 6601 KIND (Optional) An `INTEGER' initialization 6602 expression indicating the kind parameter of 6603 the result. 6604 6605_Return value_: 6606 The return value is of type `INTEGER' and of kind KIND. If KIND is 6607 absent, the return value is of default integer kind. If DIM is 6608 present, the result is an array with a rank one less than the rank 6609 of ARRAY, and a size corresponding to the shape of ARRAY with the 6610 DIM dimension removed. 6611 6612_Example_: 6613 program test_count 6614 integer, dimension(2,3) :: a, b 6615 logical, dimension(2,3) :: mask 6616 a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /)) 6617 b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /)) 6618 print '(3i3)', a(1,:) 6619 print '(3i3)', a(2,:) 6620 print * 6621 print '(3i3)', b(1,:) 6622 print '(3i3)', b(2,:) 6623 print * 6624 mask = a.ne.b 6625 print '(3l3)', mask(1,:) 6626 print '(3l3)', mask(2,:) 6627 print * 6628 print '(3i3)', count(mask) 6629 print * 6630 print '(3i3)', count(mask, 1) 6631 print * 6632 print '(3i3)', count(mask, 2) 6633 end program test_count 6634 6635 6636File: gfortran.info, Node: CPU_TIME, Next: CSHIFT, Prev: COUNT, Up: Intrinsic Procedures 6637 66388.58 `CPU_TIME' -- CPU elapsed time in seconds 6639============================================== 6640 6641_Description_: 6642 Returns a `REAL' value representing the elapsed CPU time in 6643 seconds. This is useful for testing segments of code to determine 6644 execution time. 6645 6646 If a time source is available, time will be reported with 6647 microsecond resolution. If no time source is available, TIME is 6648 set to `-1.0'. 6649 6650 Note that TIME may contain a, system dependent, arbitrary offset 6651 and may not start with `0.0'. For `CPU_TIME', the absolute value 6652 is meaningless, only differences between subsequent calls to this 6653 subroutine, as shown in the example below, should be used. 6654 6655_Standard_: 6656 Fortran 95 and later 6657 6658_Class_: 6659 Subroutine 6660 6661_Syntax_: 6662 `CALL CPU_TIME(TIME)' 6663 6664_Arguments_: 6665 TIME The type shall be `REAL' with `INTENT(OUT)'. 6666 6667_Return value_: 6668 None 6669 6670_Example_: 6671 program test_cpu_time 6672 real :: start, finish 6673 call cpu_time(start) 6674 ! put code to test here 6675 call cpu_time(finish) 6676 print '("Time = ",f6.3," seconds.")',finish-start 6677 end program test_cpu_time 6678 6679_See also_: 6680 *note SYSTEM_CLOCK::, *note DATE_AND_TIME:: 6681 6682 6683File: gfortran.info, Node: CSHIFT, Next: CTIME, Prev: CPU_TIME, Up: Intrinsic Procedures 6684 66858.59 `CSHIFT' -- Circular shift elements of an array 6686==================================================== 6687 6688_Description_: 6689 `CSHIFT(ARRAY, SHIFT [, DIM])' performs a circular shift on 6690 elements of ARRAY along the dimension of DIM. If DIM is omitted 6691 it is taken to be `1'. DIM is a scalar of type `INTEGER' in the 6692 range of 1 \leq DIM \leq n) where n is the rank of ARRAY. If the 6693 rank of ARRAY is one, then all elements of ARRAY are shifted by 6694 SHIFT places. If rank is greater than one, then all complete rank 6695 one sections of ARRAY along the given dimension are shifted. 6696 Elements shifted out one end of each rank one section are shifted 6697 back in the other end. 6698 6699_Standard_: 6700 Fortran 95 and later 6701 6702_Class_: 6703 Transformational function 6704 6705_Syntax_: 6706 `RESULT = CSHIFT(ARRAY, SHIFT [, DIM])' 6707 6708_Arguments_: 6709 ARRAY Shall be an array of any type. 6710 SHIFT The type shall be `INTEGER'. 6711 DIM The type shall be `INTEGER'. 6712 6713_Return value_: 6714 Returns an array of same type and rank as the ARRAY argument. 6715 6716_Example_: 6717 program test_cshift 6718 integer, dimension(3,3) :: a 6719 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /)) 6720 print '(3i3)', a(1,:) 6721 print '(3i3)', a(2,:) 6722 print '(3i3)', a(3,:) 6723 a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2) 6724 print * 6725 print '(3i3)', a(1,:) 6726 print '(3i3)', a(2,:) 6727 print '(3i3)', a(3,:) 6728 end program test_cshift 6729 6730 6731File: gfortran.info, Node: CTIME, Next: DATE_AND_TIME, Prev: CSHIFT, Up: Intrinsic Procedures 6732 67338.60 `CTIME' -- Convert a time into a string 6734============================================ 6735 6736_Description_: 6737 `CTIME' converts a system time value, such as returned by `TIME8', 6738 to a string. Unless the application has called `setlocale', the 6739 output will be in the default locale, of length 24 and of the form 6740 `Sat Aug 19 18:13:14 1995'. In other locales, a longer string may 6741 result. 6742 6743 This intrinsic is provided in both subroutine and function forms; 6744 however, only one form can be used in any given program unit. 6745 6746_Standard_: 6747 GNU extension 6748 6749_Class_: 6750 Subroutine, function 6751 6752_Syntax_: 6753 `CALL CTIME(TIME, RESULT)'. 6754 `RESULT = CTIME(TIME)'. 6755 6756_Arguments_: 6757 TIME The type shall be of type `INTEGER'. 6758 RESULT The type shall be of type `CHARACTER' and of 6759 default kind. It is an `INTENT(OUT)' argument. 6760 If the length of this variable is too short 6761 for the time and date string to fit 6762 completely, it will be blank on procedure 6763 return. 6764 6765_Return value_: 6766 The converted date and time as a string. 6767 6768_Example_: 6769 program test_ctime 6770 integer(8) :: i 6771 character(len=30) :: date 6772 i = time8() 6773 6774 ! Do something, main part of the program 6775 6776 call ctime(i,date) 6777 print *, 'Program was started on ', date 6778 end program test_ctime 6779 6780_See Also_: 6781 *note DATE_AND_TIME::, *note GMTIME::, *note LTIME::, *note 6782 TIME::, *note TIME8:: 6783 6784 6785File: gfortran.info, Node: DATE_AND_TIME, Next: DBLE, Prev: CTIME, Up: Intrinsic Procedures 6786 67878.61 `DATE_AND_TIME' -- Date and time subroutine 6788================================================ 6789 6790_Description_: 6791 `DATE_AND_TIME(DATE, TIME, ZONE, VALUES)' gets the corresponding 6792 date and time information from the real-time system clock. DATE is 6793 `INTENT(OUT)' and has form ccyymmdd. TIME is `INTENT(OUT)' and 6794 has form hhmmss.sss. ZONE is `INTENT(OUT)' and has form (+-)hhmm, 6795 representing the difference with respect to Coordinated Universal 6796 Time (UTC). Unavailable time and date parameters return blanks. 6797 6798 VALUES is `INTENT(OUT)' and provides the following: 6799 6800 `VALUE(1)': The year 6801 `VALUE(2)': The month 6802 `VALUE(3)': The day of the month 6803 `VALUE(4)': Time difference with UTC 6804 in minutes 6805 `VALUE(5)': The hour of the day 6806 `VALUE(6)': The minutes of the hour 6807 `VALUE(7)': The seconds of the minute 6808 `VALUE(8)': The milliseconds of the 6809 second 6810 6811_Standard_: 6812 Fortran 95 and later 6813 6814_Class_: 6815 Subroutine 6816 6817_Syntax_: 6818 `CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])' 6819 6820_Arguments_: 6821 DATE (Optional) The type shall be `CHARACTER(LEN=8)' 6822 or larger, and of default kind. 6823 TIME (Optional) The type shall be 6824 `CHARACTER(LEN=10)' or larger, and of default 6825 kind. 6826 ZONE (Optional) The type shall be `CHARACTER(LEN=5)' 6827 or larger, and of default kind. 6828 VALUES (Optional) The type shall be `INTEGER(8)'. 6829 6830_Return value_: 6831 None 6832 6833_Example_: 6834 program test_time_and_date 6835 character(8) :: date 6836 character(10) :: time 6837 character(5) :: zone 6838 integer,dimension(8) :: values 6839 ! using keyword arguments 6840 call date_and_time(date,time,zone,values) 6841 call date_and_time(DATE=date,ZONE=zone) 6842 call date_and_time(TIME=time) 6843 call date_and_time(VALUES=values) 6844 print '(a,2x,a,2x,a)', date, time, zone 6845 print '(8i5))', values 6846 end program test_time_and_date 6847 6848_See also_: 6849 *note CPU_TIME::, *note SYSTEM_CLOCK:: 6850 6851 6852File: gfortran.info, Node: DBLE, Next: DCMPLX, Prev: DATE_AND_TIME, Up: Intrinsic Procedures 6853 68548.62 `DBLE' -- Double conversion function 6855========================================= 6856 6857_Description_: 6858 `DBLE(A)' Converts A to double precision real type. 6859 6860_Standard_: 6861 Fortran 77 and later 6862 6863_Class_: 6864 Elemental function 6865 6866_Syntax_: 6867 `RESULT = DBLE(A)' 6868 6869_Arguments_: 6870 A The type shall be `INTEGER', `REAL', or 6871 `COMPLEX'. 6872 6873_Return value_: 6874 The return value is of type double precision real. 6875 6876_Example_: 6877 program test_dble 6878 real :: x = 2.18 6879 integer :: i = 5 6880 complex :: z = (2.3,1.14) 6881 print *, dble(x), dble(i), dble(z) 6882 end program test_dble 6883 6884_See also_: 6885 *note REAL:: 6886 6887 6888File: gfortran.info, Node: DCMPLX, Next: DIGITS, Prev: DBLE, Up: Intrinsic Procedures 6889 68908.63 `DCMPLX' -- Double complex conversion function 6891=================================================== 6892 6893_Description_: 6894 `DCMPLX(X [,Y])' returns a double complex number where X is 6895 converted to the real component. If Y is present it is converted 6896 to the imaginary component. If Y is not present then the 6897 imaginary component is set to 0.0. If X is complex then Y must 6898 not be present. 6899 6900_Standard_: 6901 GNU extension 6902 6903_Class_: 6904 Elemental function 6905 6906_Syntax_: 6907 `RESULT = DCMPLX(X [, Y])' 6908 6909_Arguments_: 6910 X The type may be `INTEGER', `REAL', or 6911 `COMPLEX'. 6912 Y (Optional if X is not `COMPLEX'.) May be 6913 `INTEGER' or `REAL'. 6914 6915_Return value_: 6916 The return value is of type `COMPLEX(8)' 6917 6918_Example_: 6919 program test_dcmplx 6920 integer :: i = 42 6921 real :: x = 3.14 6922 complex :: z 6923 z = cmplx(i, x) 6924 print *, dcmplx(i) 6925 print *, dcmplx(x) 6926 print *, dcmplx(z) 6927 print *, dcmplx(x,i) 6928 end program test_dcmplx 6929 6930 6931File: gfortran.info, Node: DIGITS, Next: DIM, Prev: DCMPLX, Up: Intrinsic Procedures 6932 69338.64 `DIGITS' -- Significant binary digits function 6934=================================================== 6935 6936_Description_: 6937 `DIGITS(X)' returns the number of significant binary digits of the 6938 internal model representation of X. For example, on a system 6939 using a 32-bit floating point representation, a default real 6940 number would likely return 24. 6941 6942_Standard_: 6943 Fortran 95 and later 6944 6945_Class_: 6946 Inquiry function 6947 6948_Syntax_: 6949 `RESULT = DIGITS(X)' 6950 6951_Arguments_: 6952 X The type may be `INTEGER' or `REAL'. 6953 6954_Return value_: 6955 The return value is of type `INTEGER'. 6956 6957_Example_: 6958 program test_digits 6959 integer :: i = 12345 6960 real :: x = 3.143 6961 real(8) :: y = 2.33 6962 print *, digits(i) 6963 print *, digits(x) 6964 print *, digits(y) 6965 end program test_digits 6966 6967 6968File: gfortran.info, Node: DIM, Next: DOT_PRODUCT, Prev: DIGITS, Up: Intrinsic Procedures 6969 69708.65 `DIM' -- Positive difference 6971================================= 6972 6973_Description_: 6974 `DIM(X,Y)' returns the difference `X-Y' if the result is positive; 6975 otherwise returns zero. 6976 6977_Standard_: 6978 Fortran 77 and later 6979 6980_Class_: 6981 Elemental function 6982 6983_Syntax_: 6984 `RESULT = DIM(X, Y)' 6985 6986_Arguments_: 6987 X The type shall be `INTEGER' or `REAL' 6988 Y The type shall be the same type and kind as X. 6989 6990_Return value_: 6991 The return value is of type `INTEGER' or `REAL'. 6992 6993_Example_: 6994 program test_dim 6995 integer :: i 6996 real(8) :: x 6997 i = dim(4, 15) 6998 x = dim(4.345_8, 2.111_8) 6999 print *, i 7000 print *, x 7001 end program test_dim 7002 7003_Specific names_: 7004 Name Argument Return type Standard 7005 `DIM(X,Y)' `REAL(4) X, `REAL(4)' Fortran 77 and 7006 Y' later 7007 `IDIM(X,Y)' `INTEGER(4) `INTEGER(4)' Fortran 77 and 7008 X, Y' later 7009 `DDIM(X,Y)' `REAL(8) X, `REAL(8)' Fortran 77 and 7010 Y' later 7011 7012 7013File: gfortran.info, Node: DOT_PRODUCT, Next: DPROD, Prev: DIM, Up: Intrinsic Procedures 7014 70158.66 `DOT_PRODUCT' -- Dot product function 7016========================================== 7017 7018_Description_: 7019 `DOT_PRODUCT(VECTOR_A, VECTOR_B)' computes the dot product 7020 multiplication of two vectors VECTOR_A and VECTOR_B. The two 7021 vectors may be either numeric or logical and must be arrays of 7022 rank one and of equal size. If the vectors are `INTEGER' or 7023 `REAL', the result is `SUM(VECTOR_A*VECTOR_B)'. If the vectors are 7024 `COMPLEX', the result is `SUM(CONJG(VECTOR_A)*VECTOR_B)'. If the 7025 vectors are `LOGICAL', the result is `ANY(VECTOR_A .AND. 7026 VECTOR_B)'. 7027 7028_Standard_: 7029 Fortran 95 and later 7030 7031_Class_: 7032 Transformational function 7033 7034_Syntax_: 7035 `RESULT = DOT_PRODUCT(VECTOR_A, VECTOR_B)' 7036 7037_Arguments_: 7038 VECTOR_A The type shall be numeric or `LOGICAL', rank 1. 7039 VECTOR_B The type shall be numeric if VECTOR_A is of 7040 numeric type or `LOGICAL' if VECTOR_A is of 7041 type `LOGICAL'. VECTOR_B shall be a rank-one 7042 array. 7043 7044_Return value_: 7045 If the arguments are numeric, the return value is a scalar of 7046 numeric type, `INTEGER', `REAL', or `COMPLEX'. If the arguments 7047 are `LOGICAL', the return value is `.TRUE.' or `.FALSE.'. 7048 7049_Example_: 7050 program test_dot_prod 7051 integer, dimension(3) :: a, b 7052 a = (/ 1, 2, 3 /) 7053 b = (/ 4, 5, 6 /) 7054 print '(3i3)', a 7055 print * 7056 print '(3i3)', b 7057 print * 7058 print *, dot_product(a,b) 7059 end program test_dot_prod 7060 7061 7062File: gfortran.info, Node: DPROD, Next: DREAL, Prev: DOT_PRODUCT, Up: Intrinsic Procedures 7063 70648.67 `DPROD' -- Double product function 7065======================================= 7066 7067_Description_: 7068 `DPROD(X,Y)' returns the product `X*Y'. 7069 7070_Standard_: 7071 Fortran 77 and later 7072 7073_Class_: 7074 Elemental function 7075 7076_Syntax_: 7077 `RESULT = DPROD(X, Y)' 7078 7079_Arguments_: 7080 X The type shall be `REAL'. 7081 Y The type shall be `REAL'. 7082 7083_Return value_: 7084 The return value is of type `REAL(8)'. 7085 7086_Example_: 7087 program test_dprod 7088 real :: x = 5.2 7089 real :: y = 2.3 7090 real(8) :: d 7091 d = dprod(x,y) 7092 print *, d 7093 end program test_dprod 7094 7095_Specific names_: 7096 Name Argument Return type Standard 7097 `DPROD(X,Y)' `REAL(4) X, `REAL(4)' Fortran 77 and 7098 Y' later 7099 7100 7101 7102File: gfortran.info, Node: DREAL, Next: DSHIFTL, Prev: DPROD, Up: Intrinsic Procedures 7103 71048.68 `DREAL' -- Double real part function 7105========================================= 7106 7107_Description_: 7108 `DREAL(Z)' returns the real part of complex variable Z. 7109 7110_Standard_: 7111 GNU extension 7112 7113_Class_: 7114 Elemental function 7115 7116_Syntax_: 7117 `RESULT = DREAL(A)' 7118 7119_Arguments_: 7120 A The type shall be `COMPLEX(8)'. 7121 7122_Return value_: 7123 The return value is of type `REAL(8)'. 7124 7125_Example_: 7126 program test_dreal 7127 complex(8) :: z = (1.3_8,7.2_8) 7128 print *, dreal(z) 7129 end program test_dreal 7130 7131_See also_: 7132 *note AIMAG:: 7133 7134 7135 7136File: gfortran.info, Node: DSHIFTL, Next: DSHIFTR, Prev: DREAL, Up: Intrinsic Procedures 7137 71388.69 `DSHIFTL' -- Combined left shift 7139===================================== 7140 7141_Description_: 7142 `DSHIFTL(I, J, SHIFT)' combines bits of I and J. The rightmost 7143 SHIFT bits of the result are the leftmost SHIFT bits of J, and the 7144 remaining bits are the rightmost bits of I. 7145 7146_Standard_: 7147 Fortran 2008 and later 7148 7149_Class_: 7150 Elemental function 7151 7152_Syntax_: 7153 `RESULT = DSHIFTL(I, J, SHIFT)' 7154 7155_Arguments_: 7156 I Shall be of type `INTEGER' or a BOZ constant. 7157 J Shall be of type `INTEGER' or a BOZ constant. 7158 If both I and J have integer type, then they 7159 shall have the same kind type parameter. I and 7160 J shall not both be BOZ constants. 7161 SHIFT Shall be of type `INTEGER'. It shall be 7162 nonnegative. If I is not a BOZ constant, then 7163 SHIFT shall be less than or equal to 7164 `BIT_SIZE(I)'; otherwise, SHIFT shall be less 7165 than or equal to `BIT_SIZE(J)'. 7166 7167_Return value_: 7168 If either I or J is a BOZ constant, it is first converted as if by 7169 the intrinsic function `INT' to an integer type with the kind type 7170 parameter of the other. 7171 7172_See also_: 7173 *note DSHIFTR:: 7174 7175 7176File: gfortran.info, Node: DSHIFTR, Next: DTIME, Prev: DSHIFTL, Up: Intrinsic Procedures 7177 71788.70 `DSHIFTR' -- Combined right shift 7179====================================== 7180 7181_Description_: 7182 `DSHIFTR(I, J, SHIFT)' combines bits of I and J. The leftmost 7183 SHIFT bits of the result are the rightmost SHIFT bits of I, and 7184 the remaining bits are the leftmost bits of J. 7185 7186_Standard_: 7187 Fortran 2008 and later 7188 7189_Class_: 7190 Elemental function 7191 7192_Syntax_: 7193 `RESULT = DSHIFTR(I, J, SHIFT)' 7194 7195_Arguments_: 7196 I Shall be of type `INTEGER' or a BOZ constant. 7197 J Shall be of type `INTEGER' or a BOZ constant. 7198 If both I and J have integer type, then they 7199 shall have the same kind type parameter. I and 7200 J shall not both be BOZ constants. 7201 SHIFT Shall be of type `INTEGER'. It shall be 7202 nonnegative. If I is not a BOZ constant, then 7203 SHIFT shall be less than or equal to 7204 `BIT_SIZE(I)'; otherwise, SHIFT shall be less 7205 than or equal to `BIT_SIZE(J)'. 7206 7207_Return value_: 7208 If either I or J is a BOZ constant, it is first converted as if by 7209 the intrinsic function `INT' to an integer type with the kind type 7210 parameter of the other. 7211 7212_See also_: 7213 *note DSHIFTL:: 7214 7215 7216File: gfortran.info, Node: DTIME, Next: EOSHIFT, Prev: DSHIFTR, Up: Intrinsic Procedures 7217 72188.71 `DTIME' -- Execution time subroutine (or function) 7219======================================================= 7220 7221_Description_: 7222 `DTIME(VALUES, TIME)' initially returns the number of seconds of 7223 runtime since the start of the process's execution in TIME. VALUES 7224 returns the user and system components of this time in `VALUES(1)' 7225 and `VALUES(2)' respectively. TIME is equal to `VALUES(1) + 7226 VALUES(2)'. 7227 7228 Subsequent invocations of `DTIME' return values accumulated since 7229 the previous invocation. 7230 7231 On some systems, the underlying timings are represented using 7232 types with sufficiently small limits that overflows (wrap around) 7233 are possible, such as 32-bit types. Therefore, the values returned 7234 by this intrinsic might be, or become, negative, or numerically 7235 less than previous values, during a single run of the compiled 7236 program. 7237 7238 Please note, that this implementation is thread safe if used 7239 within OpenMP directives, i.e., its state will be consistent while 7240 called from multiple threads. However, if `DTIME' is called from 7241 multiple threads, the result is still the time since the last 7242 invocation. This may not give the intended results. If possible, 7243 use `CPU_TIME' instead. 7244 7245 This intrinsic is provided in both subroutine and function forms; 7246 however, only one form can be used in any given program unit. 7247 7248 VALUES and TIME are `INTENT(OUT)' and provide the following: 7249 7250 `VALUES(1)': User time in seconds. 7251 `VALUES(2)': System time in seconds. 7252 `TIME': Run time since start in 7253 seconds. 7254 7255_Standard_: 7256 GNU extension 7257 7258_Class_: 7259 Subroutine, function 7260 7261_Syntax_: 7262 `CALL DTIME(VALUES, TIME)'. 7263 `TIME = DTIME(VALUES)', (not recommended). 7264 7265_Arguments_: 7266 VALUES The type shall be `REAL(4), DIMENSION(2)'. 7267 TIME The type shall be `REAL(4)'. 7268 7269_Return value_: 7270 Elapsed time in seconds since the last invocation or since the 7271 start of program execution if not called before. 7272 7273_Example_: 7274 program test_dtime 7275 integer(8) :: i, j 7276 real, dimension(2) :: tarray 7277 real :: result 7278 call dtime(tarray, result) 7279 print *, result 7280 print *, tarray(1) 7281 print *, tarray(2) 7282 do i=1,100000000 ! Just a delay 7283 j = i * i - i 7284 end do 7285 call dtime(tarray, result) 7286 print *, result 7287 print *, tarray(1) 7288 print *, tarray(2) 7289 end program test_dtime 7290 7291_See also_: 7292 *note CPU_TIME:: 7293 7294 7295 7296File: gfortran.info, Node: EOSHIFT, Next: EPSILON, Prev: DTIME, Up: Intrinsic Procedures 7297 72988.72 `EOSHIFT' -- End-off shift elements of an array 7299==================================================== 7300 7301_Description_: 7302 `EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])' performs an end-off shift 7303 on elements of ARRAY along the dimension of DIM. If DIM is 7304 omitted it is taken to be `1'. DIM is a scalar of type `INTEGER' 7305 in the range of 1 \leq DIM \leq n) where n is the rank of ARRAY. 7306 If the rank of ARRAY is one, then all elements of ARRAY are 7307 shifted by SHIFT places. If rank is greater than one, then all 7308 complete rank one sections of ARRAY along the given dimension are 7309 shifted. Elements shifted out one end of each rank one section 7310 are dropped. If BOUNDARY is present then the corresponding value 7311 of from BOUNDARY is copied back in the other end. If BOUNDARY is 7312 not present then the following are copied in depending on the type 7313 of ARRAY. 7314 7315 _Array _Boundary Value_ 7316 Type_ 7317 Numeric 0 of the type and kind of ARRAY. 7318 Logical `.FALSE.'. 7319 Character(LEN)LEN blanks. 7320 7321_Standard_: 7322 Fortran 95 and later 7323 7324_Class_: 7325 Transformational function 7326 7327_Syntax_: 7328 `RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])' 7329 7330_Arguments_: 7331 ARRAY May be any type, not scalar. 7332 SHIFT The type shall be `INTEGER'. 7333 BOUNDARY Same type as ARRAY. 7334 DIM The type shall be `INTEGER'. 7335 7336_Return value_: 7337 Returns an array of same type and rank as the ARRAY argument. 7338 7339_Example_: 7340 program test_eoshift 7341 integer, dimension(3,3) :: a 7342 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /)) 7343 print '(3i3)', a(1,:) 7344 print '(3i3)', a(2,:) 7345 print '(3i3)', a(3,:) 7346 a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2) 7347 print * 7348 print '(3i3)', a(1,:) 7349 print '(3i3)', a(2,:) 7350 print '(3i3)', a(3,:) 7351 end program test_eoshift 7352 7353 7354File: gfortran.info, Node: EPSILON, Next: ERF, Prev: EOSHIFT, Up: Intrinsic Procedures 7355 73568.73 `EPSILON' -- Epsilon function 7357================================== 7358 7359_Description_: 7360 `EPSILON(X)' returns the smallest number E of the same kind as X 7361 such that 1 + E > 1. 7362 7363_Standard_: 7364 Fortran 95 and later 7365 7366_Class_: 7367 Inquiry function 7368 7369_Syntax_: 7370 `RESULT = EPSILON(X)' 7371 7372_Arguments_: 7373 X The type shall be `REAL'. 7374 7375_Return value_: 7376 The return value is of same type as the argument. 7377 7378_Example_: 7379 program test_epsilon 7380 real :: x = 3.143 7381 real(8) :: y = 2.33 7382 print *, EPSILON(x) 7383 print *, EPSILON(y) 7384 end program test_epsilon 7385 7386 7387File: gfortran.info, Node: ERF, Next: ERFC, Prev: EPSILON, Up: Intrinsic Procedures 7388 73898.74 `ERF' -- Error function 7390============================ 7391 7392_Description_: 7393 `ERF(X)' computes the error function of X. 7394 7395_Standard_: 7396 Fortran 2008 and later 7397 7398_Class_: 7399 Elemental function 7400 7401_Syntax_: 7402 `RESULT = ERF(X)' 7403 7404_Arguments_: 7405 X The type shall be `REAL'. 7406 7407_Return value_: 7408 The return value is of type `REAL', of the same kind as X and lies 7409 in the range -1 \leq erf (x) \leq 1 . 7410 7411_Example_: 7412 program test_erf 7413 real(8) :: x = 0.17_8 7414 x = erf(x) 7415 end program test_erf 7416 7417_Specific names_: 7418 Name Argument Return type Standard 7419 `DERF(X)' `REAL(8) X' `REAL(8)' GNU extension 7420 7421 7422File: gfortran.info, Node: ERFC, Next: ERFC_SCALED, Prev: ERF, Up: Intrinsic Procedures 7423 74248.75 `ERFC' -- Error function 7425============================= 7426 7427_Description_: 7428 `ERFC(X)' computes the complementary error function of X. 7429 7430_Standard_: 7431 Fortran 2008 and later 7432 7433_Class_: 7434 Elemental function 7435 7436_Syntax_: 7437 `RESULT = ERFC(X)' 7438 7439_Arguments_: 7440 X The type shall be `REAL'. 7441 7442_Return value_: 7443 The return value is of type `REAL' and of the same kind as X. It 7444 lies in the range 0 \leq erfc (x) \leq 2 . 7445 7446_Example_: 7447 program test_erfc 7448 real(8) :: x = 0.17_8 7449 x = erfc(x) 7450 end program test_erfc 7451 7452_Specific names_: 7453 Name Argument Return type Standard 7454 `DERFC(X)' `REAL(8) X' `REAL(8)' GNU extension 7455 7456 7457File: gfortran.info, Node: ERFC_SCALED, Next: ETIME, Prev: ERFC, Up: Intrinsic Procedures 7458 74598.76 `ERFC_SCALED' -- Error function 7460==================================== 7461 7462_Description_: 7463 `ERFC_SCALED(X)' computes the exponentially-scaled complementary 7464 error function of X. 7465 7466_Standard_: 7467 Fortran 2008 and later 7468 7469_Class_: 7470 Elemental function 7471 7472_Syntax_: 7473 `RESULT = ERFC_SCALED(X)' 7474 7475_Arguments_: 7476 X The type shall be `REAL'. 7477 7478_Return value_: 7479 The return value is of type `REAL' and of the same kind as X. 7480 7481_Example_: 7482 program test_erfc_scaled 7483 real(8) :: x = 0.17_8 7484 x = erfc_scaled(x) 7485 end program test_erfc_scaled 7486 7487 7488File: gfortran.info, Node: ETIME, Next: EXECUTE_COMMAND_LINE, Prev: ERFC_SCALED, Up: Intrinsic Procedures 7489 74908.77 `ETIME' -- Execution time subroutine (or function) 7491======================================================= 7492 7493_Description_: 7494 `ETIME(VALUES, TIME)' returns the number of seconds of runtime 7495 since the start of the process's execution in TIME. VALUES 7496 returns the user and system components of this time in `VALUES(1)' 7497 and `VALUES(2)' respectively. TIME is equal to `VALUES(1) + 7498 VALUES(2)'. 7499 7500 On some systems, the underlying timings are represented using 7501 types with sufficiently small limits that overflows (wrap around) 7502 are possible, such as 32-bit types. Therefore, the values returned 7503 by this intrinsic might be, or become, negative, or numerically 7504 less than previous values, during a single run of the compiled 7505 program. 7506 7507 This intrinsic is provided in both subroutine and function forms; 7508 however, only one form can be used in any given program unit. 7509 7510 VALUES and TIME are `INTENT(OUT)' and provide the following: 7511 7512 `VALUES(1)': User time in seconds. 7513 `VALUES(2)': System time in seconds. 7514 `TIME': Run time since start in seconds. 7515 7516_Standard_: 7517 GNU extension 7518 7519_Class_: 7520 Subroutine, function 7521 7522_Syntax_: 7523 `CALL ETIME(VALUES, TIME)'. 7524 `TIME = ETIME(VALUES)', (not recommended). 7525 7526_Arguments_: 7527 VALUES The type shall be `REAL(4), DIMENSION(2)'. 7528 TIME The type shall be `REAL(4)'. 7529 7530_Return value_: 7531 Elapsed time in seconds since the start of program execution. 7532 7533_Example_: 7534 program test_etime 7535 integer(8) :: i, j 7536 real, dimension(2) :: tarray 7537 real :: result 7538 call ETIME(tarray, result) 7539 print *, result 7540 print *, tarray(1) 7541 print *, tarray(2) 7542 do i=1,100000000 ! Just a delay 7543 j = i * i - i 7544 end do 7545 call ETIME(tarray, result) 7546 print *, result 7547 print *, tarray(1) 7548 print *, tarray(2) 7549 end program test_etime 7550 7551_See also_: 7552 *note CPU_TIME:: 7553 7554 7555 7556File: gfortran.info, Node: EXECUTE_COMMAND_LINE, Next: EXIT, Prev: ETIME, Up: Intrinsic Procedures 7557 75588.78 `EXECUTE_COMMAND_LINE' -- Execute a shell command 7559====================================================== 7560 7561_Description_: 7562 `EXECUTE_COMMAND_LINE' runs a shell command, synchronously or 7563 asynchronously. 7564 7565 The `COMMAND' argument is passed to the shell and executed, using 7566 the C library's `system' call. (The shell is `sh' on Unix 7567 systems, and `cmd.exe' on Windows.) If `WAIT' is present and has 7568 the value false, the execution of the command is asynchronous if 7569 the system supports it; otherwise, the command is executed 7570 synchronously. 7571 7572 The three last arguments allow the user to get status information. 7573 After synchronous execution, `EXITSTAT' contains the integer exit 7574 code of the command, as returned by `system'. `CMDSTAT' is set to 7575 zero if the command line was executed (whatever its exit status 7576 was). `CMDMSG' is assigned an error message if an error has 7577 occurred. 7578 7579 Note that the `system' function need not be thread-safe. It is the 7580 responsibility of the user to ensure that `system' is not called 7581 concurrently. 7582 7583_Standard_: 7584 Fortran 2008 and later 7585 7586_Class_: 7587 Subroutine 7588 7589_Syntax_: 7590 `CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT, 7591 CMDMSG ])' 7592 7593_Arguments_: 7594 COMMAND Shall be a default `CHARACTER' scalar. 7595 WAIT (Optional) Shall be a default `LOGICAL' scalar. 7596 EXITSTAT (Optional) Shall be an `INTEGER' of the 7597 default kind. 7598 CMDSTAT (Optional) Shall be an `INTEGER' of the 7599 default kind. 7600 CMDMSG (Optional) Shall be an `CHARACTER' scalar of 7601 the default kind. 7602 7603_Example_: 7604 program test_exec 7605 integer :: i 7606 7607 call execute_command_line ("external_prog.exe", exitstat=i) 7608 print *, "Exit status of external_prog.exe was ", i 7609 7610 call execute_command_line ("reindex_files.exe", wait=.false.) 7611 print *, "Now reindexing files in the background" 7612 7613 end program test_exec 7614 7615_Note_: 7616 Because this intrinsic is implemented in terms of the `system' 7617 function call, its behavior with respect to signaling is processor 7618 dependent. In particular, on POSIX-compliant systems, the SIGINT 7619 and SIGQUIT signals will be ignored, and the SIGCHLD will be 7620 blocked. As such, if the parent process is terminated, the child 7621 process might not be terminated alongside. 7622 7623_See also_: 7624 *note SYSTEM:: 7625 7626 7627File: gfortran.info, Node: EXIT, Next: EXP, Prev: EXECUTE_COMMAND_LINE, Up: Intrinsic Procedures 7628 76298.79 `EXIT' -- Exit the program with status. 7630============================================ 7631 7632_Description_: 7633 `EXIT' causes immediate termination of the program with status. 7634 If status is omitted it returns the canonical _success_ for the 7635 system. All Fortran I/O units are closed. 7636 7637_Standard_: 7638 GNU extension 7639 7640_Class_: 7641 Subroutine 7642 7643_Syntax_: 7644 `CALL EXIT([STATUS])' 7645 7646_Arguments_: 7647 STATUS Shall be an `INTEGER' of the default kind. 7648 7649_Return value_: 7650 `STATUS' is passed to the parent process on exit. 7651 7652_Example_: 7653 program test_exit 7654 integer :: STATUS = 0 7655 print *, 'This program is going to exit.' 7656 call EXIT(STATUS) 7657 end program test_exit 7658 7659_See also_: 7660 *note ABORT::, *note KILL:: 7661 7662 7663File: gfortran.info, Node: EXP, Next: EXPONENT, Prev: EXIT, Up: Intrinsic Procedures 7664 76658.80 `EXP' -- Exponential function 7666================================== 7667 7668_Description_: 7669 `EXP(X)' computes the base e exponential of X. 7670 7671_Standard_: 7672 Fortran 77 and later, has overloads that are GNU extensions 7673 7674_Class_: 7675 Elemental function 7676 7677_Syntax_: 7678 `RESULT = EXP(X)' 7679 7680_Arguments_: 7681 X The type shall be `REAL' or `COMPLEX'. 7682 7683_Return value_: 7684 The return value has same type and kind as X. 7685 7686_Example_: 7687 program test_exp 7688 real :: x = 1.0 7689 x = exp(x) 7690 end program test_exp 7691 7692_Specific names_: 7693 Name Argument Return type Standard 7694 `EXP(X)' `REAL(4) X' `REAL(4)' Fortran 77 and 7695 later 7696 `DEXP(X)' `REAL(8) X' `REAL(8)' Fortran 77 and 7697 later 7698 `CEXP(X)' `COMPLEX(4) `COMPLEX(4)' Fortran 77 and 7699 X' later 7700 `ZEXP(X)' `COMPLEX(8) `COMPLEX(8)' GNU extension 7701 X' 7702 `CDEXP(X)' `COMPLEX(8) `COMPLEX(8)' GNU extension 7703 X' 7704 7705 7706File: gfortran.info, Node: EXPONENT, Next: EXTENDS_TYPE_OF, Prev: EXP, Up: Intrinsic Procedures 7707 77088.81 `EXPONENT' -- Exponent function 7709==================================== 7710 7711_Description_: 7712 `EXPONENT(X)' returns the value of the exponent part of X. If X is 7713 zero the value returned is zero. 7714 7715_Standard_: 7716 Fortran 95 and later 7717 7718_Class_: 7719 Elemental function 7720 7721_Syntax_: 7722 `RESULT = EXPONENT(X)' 7723 7724_Arguments_: 7725 X The type shall be `REAL'. 7726 7727_Return value_: 7728 The return value is of type default `INTEGER'. 7729 7730_Example_: 7731 program test_exponent 7732 real :: x = 1.0 7733 integer :: i 7734 i = exponent(x) 7735 print *, i 7736 print *, exponent(0.0) 7737 end program test_exponent 7738 7739 7740File: gfortran.info, Node: EXTENDS_TYPE_OF, Next: FDATE, Prev: EXPONENT, Up: Intrinsic Procedures 7741 77428.82 `EXTENDS_TYPE_OF' -- Query dynamic type for extension 7743=========================================================== 7744 7745_Description_: 7746 Query dynamic type for extension. 7747 7748_Standard_: 7749 Fortran 2003 and later 7750 7751_Class_: 7752 Inquiry function 7753 7754_Syntax_: 7755 `RESULT = EXTENDS_TYPE_OF(A, MOLD)' 7756 7757_Arguments_: 7758 A Shall be an object of extensible declared type 7759 or unlimited polymorphic. 7760 MOLD Shall be an object of extensible declared type 7761 or unlimited polymorphic. 7762 7763_Return value_: 7764 The return value is a scalar of type default logical. It is true 7765 if and only if the dynamic type of A is an extension type of the 7766 dynamic type of MOLD. 7767 7768_See also_: 7769 *note SAME_TYPE_AS:: 7770 7771 7772File: gfortran.info, Node: FDATE, Next: FGET, Prev: EXTENDS_TYPE_OF, Up: Intrinsic Procedures 7773 77748.83 `FDATE' -- Get the current time as a string 7775================================================ 7776 7777_Description_: 7778 `FDATE(DATE)' returns the current date (using the same format as 7779 `CTIME') in DATE. It is equivalent to `CALL CTIME(DATE, TIME())'. 7780 7781 This intrinsic is provided in both subroutine and function forms; 7782 however, only one form can be used in any given program unit. 7783 7784_Standard_: 7785 GNU extension 7786 7787_Class_: 7788 Subroutine, function 7789 7790_Syntax_: 7791 `CALL FDATE(DATE)'. 7792 `DATE = FDATE()'. 7793 7794_Arguments_: 7795 DATE The type shall be of type `CHARACTER' of the 7796 default kind. It is an `INTENT(OUT)' argument. 7797 If the length of this variable is too short 7798 for the date and time string to fit 7799 completely, it will be blank on procedure 7800 return. 7801 7802_Return value_: 7803 The current date and time as a string. 7804 7805_Example_: 7806 program test_fdate 7807 integer(8) :: i, j 7808 character(len=30) :: date 7809 call fdate(date) 7810 print *, 'Program started on ', date 7811 do i = 1, 100000000 ! Just a delay 7812 j = i * i - i 7813 end do 7814 call fdate(date) 7815 print *, 'Program ended on ', date 7816 end program test_fdate 7817 7818_See also_: 7819 *note DATE_AND_TIME::, *note CTIME:: 7820 7821 7822File: gfortran.info, Node: FGET, Next: FGETC, Prev: FDATE, Up: Intrinsic Procedures 7823 78248.84 `FGET' -- Read a single character in stream mode from stdin 7825================================================================ 7826 7827_Description_: 7828 Read a single character in stream mode from stdin by bypassing 7829 normal formatted output. Stream I/O should not be mixed with 7830 normal record-oriented (formatted or unformatted) I/O on the same 7831 unit; the results are unpredictable. 7832 7833 This intrinsic is provided in both subroutine and function forms; 7834 however, only one form can be used in any given program unit. 7835 7836 Note that the `FGET' intrinsic is provided for backwards 7837 compatibility with `g77'. GNU Fortran provides the Fortran 2003 7838 Stream facility. Programmers should consider the use of new 7839 stream IO feature in new code for future portability. See also 7840 *note Fortran 2003 status::. 7841 7842_Standard_: 7843 GNU extension 7844 7845_Class_: 7846 Subroutine, function 7847 7848_Syntax_: 7849 `CALL FGET(C [, STATUS])' 7850 `STATUS = FGET(C)' 7851 7852_Arguments_: 7853 C The type shall be `CHARACTER' and of default 7854 kind. 7855 STATUS (Optional) status flag of type `INTEGER'. 7856 Returns 0 on success, -1 on end-of-file, and a 7857 system specific positive error code otherwise. 7858 7859_Example_: 7860 PROGRAM test_fget 7861 INTEGER, PARAMETER :: strlen = 100 7862 INTEGER :: status, i = 1 7863 CHARACTER(len=strlen) :: str = "" 7864 7865 WRITE (*,*) 'Enter text:' 7866 DO 7867 CALL fget(str(i:i), status) 7868 if (status /= 0 .OR. i > strlen) exit 7869 i = i + 1 7870 END DO 7871 WRITE (*,*) TRIM(str) 7872 END PROGRAM 7873 7874_See also_: 7875 *note FGETC::, *note FPUT::, *note FPUTC:: 7876 7877 7878File: gfortran.info, Node: FGETC, Next: FLOOR, Prev: FGET, Up: Intrinsic Procedures 7879 78808.85 `FGETC' -- Read a single character in stream mode 7881====================================================== 7882 7883_Description_: 7884 Read a single character in stream mode by bypassing normal 7885 formatted output. Stream I/O should not be mixed with normal 7886 record-oriented (formatted or unformatted) I/O on the same unit; 7887 the results are unpredictable. 7888 7889 This intrinsic is provided in both subroutine and function forms; 7890 however, only one form can be used in any given program unit. 7891 7892 Note that the `FGET' intrinsic is provided for backwards 7893 compatibility with `g77'. GNU Fortran provides the Fortran 2003 7894 Stream facility. Programmers should consider the use of new 7895 stream IO feature in new code for future portability. See also 7896 *note Fortran 2003 status::. 7897 7898_Standard_: 7899 GNU extension 7900 7901_Class_: 7902 Subroutine, function 7903 7904_Syntax_: 7905 `CALL FGETC(UNIT, C [, STATUS])' 7906 `STATUS = FGETC(UNIT, C)' 7907 7908_Arguments_: 7909 UNIT The type shall be `INTEGER'. 7910 C The type shall be `CHARACTER' and of default 7911 kind. 7912 STATUS (Optional) status flag of type `INTEGER'. 7913 Returns 0 on success, -1 on end-of-file and a 7914 system specific positive error code otherwise. 7915 7916_Example_: 7917 PROGRAM test_fgetc 7918 INTEGER :: fd = 42, status 7919 CHARACTER :: c 7920 7921 OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD") 7922 DO 7923 CALL fgetc(fd, c, status) 7924 IF (status /= 0) EXIT 7925 call fput(c) 7926 END DO 7927 CLOSE(UNIT=fd) 7928 END PROGRAM 7929 7930_See also_: 7931 *note FGET::, *note FPUT::, *note FPUTC:: 7932 7933 7934File: gfortran.info, Node: FLOOR, Next: FLUSH, Prev: FGETC, Up: Intrinsic Procedures 7935 79368.86 `FLOOR' -- Integer floor function 7937====================================== 7938 7939_Description_: 7940 `FLOOR(A)' returns the greatest integer less than or equal to X. 7941 7942_Standard_: 7943 Fortran 95 and later 7944 7945_Class_: 7946 Elemental function 7947 7948_Syntax_: 7949 `RESULT = FLOOR(A [, KIND])' 7950 7951_Arguments_: 7952 A The type shall be `REAL'. 7953 KIND (Optional) An `INTEGER' initialization 7954 expression indicating the kind parameter of 7955 the result. 7956 7957_Return value_: 7958 The return value is of type `INTEGER(KIND)' if KIND is present and 7959 of default-kind `INTEGER' otherwise. 7960 7961_Example_: 7962 program test_floor 7963 real :: x = 63.29 7964 real :: y = -63.59 7965 print *, floor(x) ! returns 63 7966 print *, floor(y) ! returns -64 7967 end program test_floor 7968 7969_See also_: 7970 *note CEILING::, *note NINT:: 7971 7972 7973 7974File: gfortran.info, Node: FLUSH, Next: FNUM, Prev: FLOOR, Up: Intrinsic Procedures 7975 79768.87 `FLUSH' -- Flush I/O unit(s) 7977================================= 7978 7979_Description_: 7980 Flushes Fortran unit(s) currently open for output. Without the 7981 optional argument, all units are flushed, otherwise just the unit 7982 specified. 7983 7984_Standard_: 7985 GNU extension 7986 7987_Class_: 7988 Subroutine 7989 7990_Syntax_: 7991 `CALL FLUSH(UNIT)' 7992 7993_Arguments_: 7994 UNIT (Optional) The type shall be `INTEGER'. 7995 7996_Note_: 7997 Beginning with the Fortran 2003 standard, there is a `FLUSH' 7998 statement that should be preferred over the `FLUSH' intrinsic. 7999 8000 The `FLUSH' intrinsic and the Fortran 2003 `FLUSH' statement have 8001 identical effect: they flush the runtime library's I/O buffer so 8002 that the data becomes visible to other processes. This does not 8003 guarantee that the data is committed to disk. 8004 8005 On POSIX systems, you can request that all data is transferred to 8006 the storage device by calling the `fsync' function, with the POSIX 8007 file descriptor of the I/O unit as argument (retrieved with GNU 8008 intrinsic `FNUM'). The following example shows how: 8009 8010 ! Declare the interface for POSIX fsync function 8011 interface 8012 function fsync (fd) bind(c,name="fsync") 8013 use iso_c_binding, only: c_int 8014 integer(c_int), value :: fd 8015 integer(c_int) :: fsync 8016 end function fsync 8017 end interface 8018 8019 ! Variable declaration 8020 integer :: ret 8021 8022 ! Opening unit 10 8023 open (10,file="foo") 8024 8025 ! ... 8026 ! Perform I/O on unit 10 8027 ! ... 8028 8029 ! Flush and sync 8030 flush(10) 8031 ret = fsync(fnum(10)) 8032 8033 ! Handle possible error 8034 if (ret /= 0) stop "Error calling FSYNC" 8035 8036 8037 8038File: gfortran.info, Node: FNUM, Next: FPUT, Prev: FLUSH, Up: Intrinsic Procedures 8039 80408.88 `FNUM' -- File number function 8041=================================== 8042 8043_Description_: 8044 `FNUM(UNIT)' returns the POSIX file descriptor number 8045 corresponding to the open Fortran I/O unit `UNIT'. 8046 8047_Standard_: 8048 GNU extension 8049 8050_Class_: 8051 Function 8052 8053_Syntax_: 8054 `RESULT = FNUM(UNIT)' 8055 8056_Arguments_: 8057 UNIT The type shall be `INTEGER'. 8058 8059_Return value_: 8060 The return value is of type `INTEGER' 8061 8062_Example_: 8063 program test_fnum 8064 integer :: i 8065 open (unit=10, status = "scratch") 8066 i = fnum(10) 8067 print *, i 8068 close (10) 8069 end program test_fnum 8070 8071 8072File: gfortran.info, Node: FPUT, Next: FPUTC, Prev: FNUM, Up: Intrinsic Procedures 8073 80748.89 `FPUT' -- Write a single character in stream mode to stdout 8075================================================================ 8076 8077_Description_: 8078 Write a single character in stream mode to stdout by bypassing 8079 normal formatted output. Stream I/O should not be mixed with 8080 normal record-oriented (formatted or unformatted) I/O on the same 8081 unit; the results are unpredictable. 8082 8083 This intrinsic is provided in both subroutine and function forms; 8084 however, only one form can be used in any given program unit. 8085 8086 Note that the `FGET' intrinsic is provided for backwards 8087 compatibility with `g77'. GNU Fortran provides the Fortran 2003 8088 Stream facility. Programmers should consider the use of new 8089 stream IO feature in new code for future portability. See also 8090 *note Fortran 2003 status::. 8091 8092_Standard_: 8093 GNU extension 8094 8095_Class_: 8096 Subroutine, function 8097 8098_Syntax_: 8099 `CALL FPUT(C [, STATUS])' 8100 `STATUS = FPUT(C)' 8101 8102_Arguments_: 8103 C The type shall be `CHARACTER' and of default 8104 kind. 8105 STATUS (Optional) status flag of type `INTEGER'. 8106 Returns 0 on success, -1 on end-of-file and a 8107 system specific positive error code otherwise. 8108 8109_Example_: 8110 PROGRAM test_fput 8111 CHARACTER(len=10) :: str = "gfortran" 8112 INTEGER :: i 8113 DO i = 1, len_trim(str) 8114 CALL fput(str(i:i)) 8115 END DO 8116 END PROGRAM 8117 8118_See also_: 8119 *note FPUTC::, *note FGET::, *note FGETC:: 8120 8121 8122File: gfortran.info, Node: FPUTC, Next: FRACTION, Prev: FPUT, Up: Intrinsic Procedures 8123 81248.90 `FPUTC' -- Write a single character in stream mode 8125======================================================= 8126 8127_Description_: 8128 Write a single character in stream mode by bypassing normal 8129 formatted output. Stream I/O should not be mixed with normal 8130 record-oriented (formatted or unformatted) I/O on the same unit; 8131 the results are unpredictable. 8132 8133 This intrinsic is provided in both subroutine and function forms; 8134 however, only one form can be used in any given program unit. 8135 8136 Note that the `FGET' intrinsic is provided for backwards 8137 compatibility with `g77'. GNU Fortran provides the Fortran 2003 8138 Stream facility. Programmers should consider the use of new 8139 stream IO feature in new code for future portability. See also 8140 *note Fortran 2003 status::. 8141 8142_Standard_: 8143 GNU extension 8144 8145_Class_: 8146 Subroutine, function 8147 8148_Syntax_: 8149 `CALL FPUTC(UNIT, C [, STATUS])' 8150 `STATUS = FPUTC(UNIT, C)' 8151 8152_Arguments_: 8153 UNIT The type shall be `INTEGER'. 8154 C The type shall be `CHARACTER' and of default 8155 kind. 8156 STATUS (Optional) status flag of type `INTEGER'. 8157 Returns 0 on success, -1 on end-of-file and a 8158 system specific positive error code otherwise. 8159 8160_Example_: 8161 PROGRAM test_fputc 8162 CHARACTER(len=10) :: str = "gfortran" 8163 INTEGER :: fd = 42, i 8164 8165 OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW") 8166 DO i = 1, len_trim(str) 8167 CALL fputc(fd, str(i:i)) 8168 END DO 8169 CLOSE(fd) 8170 END PROGRAM 8171 8172_See also_: 8173 *note FPUT::, *note FGET::, *note FGETC:: 8174 8175 8176File: gfortran.info, Node: FRACTION, Next: FREE, Prev: FPUTC, Up: Intrinsic Procedures 8177 81788.91 `FRACTION' -- Fractional part of the model representation 8179============================================================== 8180 8181_Description_: 8182 `FRACTION(X)' returns the fractional part of the model 8183 representation of `X'. 8184 8185_Standard_: 8186 Fortran 95 and later 8187 8188_Class_: 8189 Elemental function 8190 8191_Syntax_: 8192 `Y = FRACTION(X)' 8193 8194_Arguments_: 8195 X The type of the argument shall be a `REAL'. 8196 8197_Return value_: 8198 The return value is of the same type and kind as the argument. 8199 The fractional part of the model representation of `X' is returned; 8200 it is `X * RADIX(X)**(-EXPONENT(X))'. 8201 8202_Example_: 8203 program test_fraction 8204 real :: x 8205 x = 178.1387e-4 8206 print *, fraction(x), x * radix(x)**(-exponent(x)) 8207 end program test_fraction 8208 8209 8210 8211File: gfortran.info, Node: FREE, Next: FSEEK, Prev: FRACTION, Up: Intrinsic Procedures 8212 82138.92 `FREE' -- Frees memory 8214=========================== 8215 8216_Description_: 8217 Frees memory previously allocated by `MALLOC'. The `FREE' 8218 intrinsic is an extension intended to be used with Cray pointers, 8219 and is provided in GNU Fortran to allow user to compile legacy 8220 code. For new code using Fortran 95 pointers, the memory 8221 de-allocation intrinsic is `DEALLOCATE'. 8222 8223_Standard_: 8224 GNU extension 8225 8226_Class_: 8227 Subroutine 8228 8229_Syntax_: 8230 `CALL FREE(PTR)' 8231 8232_Arguments_: 8233 PTR The type shall be `INTEGER'. It represents the 8234 location of the memory that should be 8235 de-allocated. 8236 8237_Return value_: 8238 None 8239 8240_Example_: 8241 See `MALLOC' for an example. 8242 8243_See also_: 8244 *note MALLOC:: 8245 8246 8247File: gfortran.info, Node: FSEEK, Next: FSTAT, Prev: FREE, Up: Intrinsic Procedures 8248 82498.93 `FSEEK' -- Low level file positioning subroutine 8250===================================================== 8251 8252_Description_: 8253 Moves UNIT to the specified OFFSET. If WHENCE is set to 0, the 8254 OFFSET is taken as an absolute value `SEEK_SET', if set to 1, 8255 OFFSET is taken to be relative to the current position `SEEK_CUR', 8256 and if set to 2 relative to the end of the file `SEEK_END'. On 8257 error, STATUS is set to a nonzero value. If STATUS the seek fails 8258 silently. 8259 8260 This intrinsic routine is not fully backwards compatible with 8261 `g77'. In `g77', the `FSEEK' takes a statement label instead of a 8262 STATUS variable. If FSEEK is used in old code, change 8263 CALL FSEEK(UNIT, OFFSET, WHENCE, *label) 8264 to 8265 INTEGER :: status 8266 CALL FSEEK(UNIT, OFFSET, WHENCE, status) 8267 IF (status /= 0) GOTO label 8268 8269 Please note that GNU Fortran provides the Fortran 2003 Stream 8270 facility. Programmers should consider the use of new stream IO 8271 feature in new code for future portability. See also *note Fortran 8272 2003 status::. 8273 8274_Standard_: 8275 GNU extension 8276 8277_Class_: 8278 Subroutine 8279 8280_Syntax_: 8281 `CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])' 8282 8283_Arguments_: 8284 UNIT Shall be a scalar of type `INTEGER'. 8285 OFFSET Shall be a scalar of type `INTEGER'. 8286 WHENCE Shall be a scalar of type `INTEGER'. Its 8287 value shall be either 0, 1 or 2. 8288 STATUS (Optional) shall be a scalar of type 8289 `INTEGER(4)'. 8290 8291_Example_: 8292 PROGRAM test_fseek 8293 INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2 8294 INTEGER :: fd, offset, ierr 8295 8296 ierr = 0 8297 offset = 5 8298 fd = 10 8299 8300 OPEN(UNIT=fd, FILE="fseek.test") 8301 CALL FSEEK(fd, offset, SEEK_SET, ierr) ! move to OFFSET 8302 print *, FTELL(fd), ierr 8303 8304 CALL FSEEK(fd, 0, SEEK_END, ierr) ! move to end 8305 print *, FTELL(fd), ierr 8306 8307 CALL FSEEK(fd, 0, SEEK_SET, ierr) ! move to beginning 8308 print *, FTELL(fd), ierr 8309 8310 CLOSE(UNIT=fd) 8311 END PROGRAM 8312 8313_See also_: 8314 *note FTELL:: 8315 8316 8317File: gfortran.info, Node: FSTAT, Next: FTELL, Prev: FSEEK, Up: Intrinsic Procedures 8318 83198.94 `FSTAT' -- Get file status 8320=============================== 8321 8322_Description_: 8323 `FSTAT' is identical to *note STAT::, except that information 8324 about an already opened file is obtained. 8325 8326 The elements in `VALUES' are the same as described by *note STAT::. 8327 8328 This intrinsic is provided in both subroutine and function forms; 8329 however, only one form can be used in any given program unit. 8330 8331_Standard_: 8332 GNU extension 8333 8334_Class_: 8335 Subroutine, function 8336 8337_Syntax_: 8338 `CALL FSTAT(UNIT, VALUES [, STATUS])' 8339 `STATUS = FSTAT(UNIT, VALUES)' 8340 8341_Arguments_: 8342 UNIT An open I/O unit number of type `INTEGER'. 8343 VALUES The type shall be `INTEGER(4), DIMENSION(13)'. 8344 STATUS (Optional) status flag of type `INTEGER(4)'. 8345 Returns 0 on success and a system specific 8346 error code otherwise. 8347 8348_Example_: 8349 See *note STAT:: for an example. 8350 8351_See also_: 8352 To stat a link: *note LSTAT::, to stat a file: *note STAT:: 8353 8354 8355File: gfortran.info, Node: FTELL, Next: GAMMA, Prev: FSTAT, Up: Intrinsic Procedures 8356 83578.95 `FTELL' -- Current stream position 8358======================================= 8359 8360_Description_: 8361 Retrieves the current position within an open file. 8362 8363 This intrinsic is provided in both subroutine and function forms; 8364 however, only one form can be used in any given program unit. 8365 8366_Standard_: 8367 GNU extension 8368 8369_Class_: 8370 Subroutine, function 8371 8372_Syntax_: 8373 `CALL FTELL(UNIT, OFFSET)' 8374 `OFFSET = FTELL(UNIT)' 8375 8376_Arguments_: 8377 OFFSET Shall of type `INTEGER'. 8378 UNIT Shall of type `INTEGER'. 8379 8380_Return value_: 8381 In either syntax, OFFSET is set to the current offset of unit 8382 number UNIT, or to -1 if the unit is not currently open. 8383 8384_Example_: 8385 PROGRAM test_ftell 8386 INTEGER :: i 8387 OPEN(10, FILE="temp.dat") 8388 CALL ftell(10,i) 8389 WRITE(*,*) i 8390 END PROGRAM 8391 8392_See also_: 8393 *note FSEEK:: 8394 8395 8396File: gfortran.info, Node: GAMMA, Next: GERROR, Prev: FTELL, Up: Intrinsic Procedures 8397 83988.96 `GAMMA' -- Gamma function 8399============================== 8400 8401_Description_: 8402 `GAMMA(X)' computes Gamma (\Gamma) of X. For positive, integer 8403 values of X the Gamma function simplifies to the factorial 8404 function \Gamma(x)=(x-1)!. 8405 8406_Standard_: 8407 Fortran 2008 and later 8408 8409_Class_: 8410 Elemental function 8411 8412_Syntax_: 8413 `X = GAMMA(X)' 8414 8415_Arguments_: 8416 X Shall be of type `REAL' and neither zero nor a 8417 negative integer. 8418 8419_Return value_: 8420 The return value is of type `REAL' of the same kind as X. 8421 8422_Example_: 8423 program test_gamma 8424 real :: x = 1.0 8425 x = gamma(x) ! returns 1.0 8426 end program test_gamma 8427 8428_Specific names_: 8429 Name Argument Return type Standard 8430 `GAMMA(X)' `REAL(4) X' `REAL(4)' GNU Extension 8431 `DGAMMA(X)' `REAL(8) X' `REAL(8)' GNU Extension 8432 8433_See also_: 8434 Logarithm of the Gamma function: *note LOG_GAMMA:: 8435 8436 8437 8438File: gfortran.info, Node: GERROR, Next: GETARG, Prev: GAMMA, Up: Intrinsic Procedures 8439 84408.97 `GERROR' -- Get last system error message 8441============================================== 8442 8443_Description_: 8444 Returns the system error message corresponding to the last system 8445 error. This resembles the functionality of `strerror(3)' in C. 8446 8447_Standard_: 8448 GNU extension 8449 8450_Class_: 8451 Subroutine 8452 8453_Syntax_: 8454 `CALL GERROR(RESULT)' 8455 8456_Arguments_: 8457 RESULT Shall of type `CHARACTER' and of default 8458 8459_Example_: 8460 PROGRAM test_gerror 8461 CHARACTER(len=100) :: msg 8462 CALL gerror(msg) 8463 WRITE(*,*) msg 8464 END PROGRAM 8465 8466_See also_: 8467 *note IERRNO::, *note PERROR:: 8468 8469 8470File: gfortran.info, Node: GETARG, Next: GET_COMMAND, Prev: GERROR, Up: Intrinsic Procedures 8471 84728.98 `GETARG' -- Get command line arguments 8473=========================================== 8474 8475_Description_: 8476 Retrieve the POS-th argument that was passed on the command line 8477 when the containing program was invoked. 8478 8479 This intrinsic routine is provided for backwards compatibility with 8480 GNU Fortran 77. In new code, programmers should consider the use 8481 of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the 8482 Fortran 2003 standard. 8483 8484_Standard_: 8485 GNU extension 8486 8487_Class_: 8488 Subroutine 8489 8490_Syntax_: 8491 `CALL GETARG(POS, VALUE)' 8492 8493_Arguments_: 8494 POS Shall be of type `INTEGER' and not wider than 8495 the default integer kind; POS \geq 0 8496 VALUE Shall be of type `CHARACTER' and of default 8497 kind. 8498 VALUE Shall be of type `CHARACTER'. 8499 8500_Return value_: 8501 After `GETARG' returns, the VALUE argument holds the POSth command 8502 line argument. If VALUE can not hold the argument, it is truncated 8503 to fit the length of VALUE. If there are less than POS arguments 8504 specified at the command line, VALUE will be filled with blanks. 8505 If POS = 0, VALUE is set to the name of the program (on systems 8506 that support this feature). 8507 8508_Example_: 8509 PROGRAM test_getarg 8510 INTEGER :: i 8511 CHARACTER(len=32) :: arg 8512 8513 DO i = 1, iargc() 8514 CALL getarg(i, arg) 8515 WRITE (*,*) arg 8516 END DO 8517 END PROGRAM 8518 8519_See also_: 8520 GNU Fortran 77 compatibility function: *note IARGC:: 8521 8522 Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note 8523 GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT:: 8524 8525 8526File: gfortran.info, Node: GET_COMMAND, Next: GET_COMMAND_ARGUMENT, Prev: GETARG, Up: Intrinsic Procedures 8527 85288.99 `GET_COMMAND' -- Get the entire command line 8529================================================= 8530 8531_Description_: 8532 Retrieve the entire command line that was used to invoke the 8533 program. 8534 8535_Standard_: 8536 Fortran 2003 and later 8537 8538_Class_: 8539 Subroutine 8540 8541_Syntax_: 8542 `CALL GET_COMMAND([COMMAND, LENGTH, STATUS])' 8543 8544_Arguments_: 8545 COMMAND (Optional) shall be of type `CHARACTER' and of 8546 default kind. 8547 LENGTH (Optional) Shall be of type `INTEGER' and of 8548 default kind. 8549 STATUS (Optional) Shall be of type `INTEGER' and of 8550 default kind. 8551 8552_Return value_: 8553 If COMMAND is present, stores the entire command line that was used 8554 to invoke the program in COMMAND. If LENGTH is present, it is 8555 assigned the length of the command line. If STATUS is present, it 8556 is assigned 0 upon success of the command, -1 if COMMAND is too 8557 short to store the command line, or a positive value in case of an 8558 error. 8559 8560_Example_: 8561 PROGRAM test_get_command 8562 CHARACTER(len=255) :: cmd 8563 CALL get_command(cmd) 8564 WRITE (*,*) TRIM(cmd) 8565 END PROGRAM 8566 8567_See also_: 8568 *note GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT:: 8569 8570 8571File: gfortran.info, Node: GET_COMMAND_ARGUMENT, Next: GETCWD, Prev: GET_COMMAND, Up: Intrinsic Procedures 8572 85738.100 `GET_COMMAND_ARGUMENT' -- Get command line arguments 8574========================================================== 8575 8576_Description_: 8577 Retrieve the NUMBER-th argument that was passed on the command 8578 line when the containing program was invoked. 8579 8580_Standard_: 8581 Fortran 2003 and later 8582 8583_Class_: 8584 Subroutine 8585 8586_Syntax_: 8587 `CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])' 8588 8589_Arguments_: 8590 NUMBER Shall be a scalar of type `INTEGER' and of 8591 default kind, NUMBER \geq 0 8592 VALUE (Optional) Shall be a scalar of type 8593 `CHARACTER' and of default kind. 8594 LENGTH (Optional) Shall be a scalar of type `INTEGER' 8595 and of default kind. 8596 STATUS (Optional) Shall be a scalar of type `INTEGER' 8597 and of default kind. 8598 8599_Return value_: 8600 After `GET_COMMAND_ARGUMENT' returns, the VALUE argument holds the 8601 NUMBER-th command line argument. If VALUE can not hold the 8602 argument, it is truncated to fit the length of VALUE. If there are 8603 less than NUMBER arguments specified at the command line, VALUE 8604 will be filled with blanks. If NUMBER = 0, VALUE is set to the 8605 name of the program (on systems that support this feature). The 8606 LENGTH argument contains the length of the NUMBER-th command line 8607 argument. If the argument retrieval fails, STATUS is a positive 8608 number; if VALUE contains a truncated command line argument, 8609 STATUS is -1; and otherwise the STATUS is zero. 8610 8611_Example_: 8612 PROGRAM test_get_command_argument 8613 INTEGER :: i 8614 CHARACTER(len=32) :: arg 8615 8616 i = 0 8617 DO 8618 CALL get_command_argument(i, arg) 8619 IF (LEN_TRIM(arg) == 0) EXIT 8620 8621 WRITE (*,*) TRIM(arg) 8622 i = i+1 8623 END DO 8624 END PROGRAM 8625 8626_See also_: 8627 *note GET_COMMAND::, *note COMMAND_ARGUMENT_COUNT:: 8628 8629 8630File: gfortran.info, Node: GETCWD, Next: GETENV, Prev: GET_COMMAND_ARGUMENT, Up: Intrinsic Procedures 8631 86328.101 `GETCWD' -- Get current working directory 8633=============================================== 8634 8635_Description_: 8636 Get current working directory. 8637 8638 This intrinsic is provided in both subroutine and function forms; 8639 however, only one form can be used in any given program unit. 8640 8641_Standard_: 8642 GNU extension 8643 8644_Class_: 8645 Subroutine, function 8646 8647_Syntax_: 8648 `CALL GETCWD(C [, STATUS])' 8649 `STATUS = GETCWD(C)' 8650 8651_Arguments_: 8652 C The type shall be `CHARACTER' and of default 8653 kind. 8654 STATUS (Optional) status flag. Returns 0 on success, 8655 a system specific and nonzero error code 8656 otherwise. 8657 8658_Example_: 8659 PROGRAM test_getcwd 8660 CHARACTER(len=255) :: cwd 8661 CALL getcwd(cwd) 8662 WRITE(*,*) TRIM(cwd) 8663 END PROGRAM 8664 8665_See also_: 8666 *note CHDIR:: 8667 8668 8669File: gfortran.info, Node: GETENV, Next: GET_ENVIRONMENT_VARIABLE, Prev: GETCWD, Up: Intrinsic Procedures 8670 86718.102 `GETENV' -- Get an environmental variable 8672=============================================== 8673 8674_Description_: 8675 Get the VALUE of the environmental variable NAME. 8676 8677 This intrinsic routine is provided for backwards compatibility with 8678 GNU Fortran 77. In new code, programmers should consider the use 8679 of the *note GET_ENVIRONMENT_VARIABLE:: intrinsic defined by the 8680 Fortran 2003 standard. 8681 8682 Note that `GETENV' need not be thread-safe. It is the 8683 responsibility of the user to ensure that the environment is not 8684 being updated concurrently with a call to the `GETENV' intrinsic. 8685 8686_Standard_: 8687 GNU extension 8688 8689_Class_: 8690 Subroutine 8691 8692_Syntax_: 8693 `CALL GETENV(NAME, VALUE)' 8694 8695_Arguments_: 8696 NAME Shall be of type `CHARACTER' and of default 8697 kind. 8698 VALUE Shall be of type `CHARACTER' and of default 8699 kind. 8700 8701_Return value_: 8702 Stores the value of NAME in VALUE. If VALUE is not large enough to 8703 hold the data, it is truncated. If NAME is not set, VALUE will be 8704 filled with blanks. 8705 8706_Example_: 8707 PROGRAM test_getenv 8708 CHARACTER(len=255) :: homedir 8709 CALL getenv("HOME", homedir) 8710 WRITE (*,*) TRIM(homedir) 8711 END PROGRAM 8712 8713_See also_: 8714 *note GET_ENVIRONMENT_VARIABLE:: 8715 8716 8717File: gfortran.info, Node: GET_ENVIRONMENT_VARIABLE, Next: GETGID, Prev: GETENV, Up: Intrinsic Procedures 8718 87198.103 `GET_ENVIRONMENT_VARIABLE' -- Get an environmental variable 8720================================================================= 8721 8722_Description_: 8723 Get the VALUE of the environmental variable NAME. 8724 8725 Note that `GET_ENVIRONMENT_VARIABLE' need not be thread-safe. It 8726 is the responsibility of the user to ensure that the environment is 8727 not being updated concurrently with a call to the 8728 `GET_ENVIRONMENT_VARIABLE' intrinsic. 8729 8730_Standard_: 8731 Fortran 2003 and later 8732 8733_Class_: 8734 Subroutine 8735 8736_Syntax_: 8737 `CALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS, 8738 TRIM_NAME)' 8739 8740_Arguments_: 8741 NAME Shall be a scalar of type `CHARACTER' and of 8742 default kind. 8743 VALUE (Optional) Shall be a scalar of type 8744 `CHARACTER' and of default kind. 8745 LENGTH (Optional) Shall be a scalar of type `INTEGER' 8746 and of default kind. 8747 STATUS (Optional) Shall be a scalar of type `INTEGER' 8748 and of default kind. 8749 TRIM_NAME (Optional) Shall be a scalar of type `LOGICAL' 8750 and of default kind. 8751 8752_Return value_: 8753 Stores the value of NAME in VALUE. If VALUE is not large enough to 8754 hold the data, it is truncated. If NAME is not set, VALUE will be 8755 filled with blanks. Argument LENGTH contains the length needed for 8756 storing the environment variable NAME or zero if it is not 8757 present. STATUS is -1 if VALUE is present but too short for the 8758 environment variable; it is 1 if the environment variable does not 8759 exist and 2 if the processor does not support environment 8760 variables; in all other cases STATUS is zero. If TRIM_NAME is 8761 present with the value `.FALSE.', the trailing blanks in NAME are 8762 significant; otherwise they are not part of the environment 8763 variable name. 8764 8765_Example_: 8766 PROGRAM test_getenv 8767 CHARACTER(len=255) :: homedir 8768 CALL get_environment_variable("HOME", homedir) 8769 WRITE (*,*) TRIM(homedir) 8770 END PROGRAM 8771 8772 8773File: gfortran.info, Node: GETGID, Next: GETLOG, Prev: GET_ENVIRONMENT_VARIABLE, Up: Intrinsic Procedures 8774 87758.104 `GETGID' -- Group ID function 8776=================================== 8777 8778_Description_: 8779 Returns the numerical group ID of the current process. 8780 8781_Standard_: 8782 GNU extension 8783 8784_Class_: 8785 Function 8786 8787_Syntax_: 8788 `RESULT = GETGID()' 8789 8790_Return value_: 8791 The return value of `GETGID' is an `INTEGER' of the default kind. 8792 8793_Example_: 8794 See `GETPID' for an example. 8795 8796_See also_: 8797 *note GETPID::, *note GETUID:: 8798 8799 8800File: gfortran.info, Node: GETLOG, Next: GETPID, Prev: GETGID, Up: Intrinsic Procedures 8801 88028.105 `GETLOG' -- Get login name 8803================================ 8804 8805_Description_: 8806 Gets the username under which the program is running. 8807 8808_Standard_: 8809 GNU extension 8810 8811_Class_: 8812 Subroutine 8813 8814_Syntax_: 8815 `CALL GETLOG(C)' 8816 8817_Arguments_: 8818 C Shall be of type `CHARACTER' and of default 8819 kind. 8820 8821_Return value_: 8822 Stores the current user name in LOGIN. (On systems where POSIX 8823 functions `geteuid' and `getpwuid' are not available, and the 8824 `getlogin' function is not implemented either, this will return a 8825 blank string.) 8826 8827_Example_: 8828 PROGRAM TEST_GETLOG 8829 CHARACTER(32) :: login 8830 CALL GETLOG(login) 8831 WRITE(*,*) login 8832 END PROGRAM 8833 8834_See also_: 8835 *note GETUID:: 8836 8837 8838File: gfortran.info, Node: GETPID, Next: GETUID, Prev: GETLOG, Up: Intrinsic Procedures 8839 88408.106 `GETPID' -- Process ID function 8841===================================== 8842 8843_Description_: 8844 Returns the numerical process identifier of the current process. 8845 8846_Standard_: 8847 GNU extension 8848 8849_Class_: 8850 Function 8851 8852_Syntax_: 8853 `RESULT = GETPID()' 8854 8855_Return value_: 8856 The return value of `GETPID' is an `INTEGER' of the default kind. 8857 8858_Example_: 8859 program info 8860 print *, "The current process ID is ", getpid() 8861 print *, "Your numerical user ID is ", getuid() 8862 print *, "Your numerical group ID is ", getgid() 8863 end program info 8864 8865_See also_: 8866 *note GETGID::, *note GETUID:: 8867 8868 8869File: gfortran.info, Node: GETUID, Next: GMTIME, Prev: GETPID, Up: Intrinsic Procedures 8870 88718.107 `GETUID' -- User ID function 8872================================== 8873 8874_Description_: 8875 Returns the numerical user ID of the current process. 8876 8877_Standard_: 8878 GNU extension 8879 8880_Class_: 8881 Function 8882 8883_Syntax_: 8884 `RESULT = GETUID()' 8885 8886_Return value_: 8887 The return value of `GETUID' is an `INTEGER' of the default kind. 8888 8889_Example_: 8890 See `GETPID' for an example. 8891 8892_See also_: 8893 *note GETPID::, *note GETLOG:: 8894 8895 8896File: gfortran.info, Node: GMTIME, Next: HOSTNM, Prev: GETUID, Up: Intrinsic Procedures 8897 88988.108 `GMTIME' -- Convert time to GMT info 8899========================================== 8900 8901_Description_: 8902 Given a system time value TIME (as provided by the `TIME8' 8903 intrinsic), fills VALUES with values extracted from it appropriate 8904 to the UTC time zone (Universal Coordinated Time, also known in 8905 some countries as GMT, Greenwich Mean Time), using `gmtime(3)'. 8906 8907_Standard_: 8908 GNU extension 8909 8910_Class_: 8911 Subroutine 8912 8913_Syntax_: 8914 `CALL GMTIME(TIME, VALUES)' 8915 8916_Arguments_: 8917 TIME An `INTEGER' scalar expression corresponding 8918 to a system time, with `INTENT(IN)'. 8919 VALUES A default `INTEGER' array with 9 elements, 8920 with `INTENT(OUT)'. 8921 8922_Return value_: 8923 The elements of VALUES are assigned as follows: 8924 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap 8925 seconds 8926 8927 2. Minutes after the hour, range 0-59 8928 8929 3. Hours past midnight, range 0-23 8930 8931 4. Day of month, range 0-31 8932 8933 5. Number of months since January, range 0-12 8934 8935 6. Years since 1900 8936 8937 7. Number of days since Sunday, range 0-6 8938 8939 8. Days since January 1 8940 8941 9. Daylight savings indicator: positive if daylight savings is in 8942 effect, zero if not, and negative if the information is not 8943 available. 8944 8945_See also_: 8946 *note CTIME::, *note LTIME::, *note TIME::, *note TIME8:: 8947 8948 8949 8950File: gfortran.info, Node: HOSTNM, Next: HUGE, Prev: GMTIME, Up: Intrinsic Procedures 8951 89528.109 `HOSTNM' -- Get system host name 8953====================================== 8954 8955_Description_: 8956 Retrieves the host name of the system on which the program is 8957 running. 8958 8959 This intrinsic is provided in both subroutine and function forms; 8960 however, only one form can be used in any given program unit. 8961 8962_Standard_: 8963 GNU extension 8964 8965_Class_: 8966 Subroutine, function 8967 8968_Syntax_: 8969 `CALL HOSTNM(C [, STATUS])' 8970 `STATUS = HOSTNM(NAME)' 8971 8972_Arguments_: 8973 C Shall of type `CHARACTER' and of default kind. 8974 STATUS (Optional) status flag of type `INTEGER'. 8975 Returns 0 on success, or a system specific 8976 error code otherwise. 8977 8978_Return value_: 8979 In either syntax, NAME is set to the current hostname if it can be 8980 obtained, or to a blank string otherwise. 8981 8982 8983 8984File: gfortran.info, Node: HUGE, Next: HYPOT, Prev: HOSTNM, Up: Intrinsic Procedures 8985 89868.110 `HUGE' -- Largest number of a kind 8987======================================== 8988 8989_Description_: 8990 `HUGE(X)' returns the largest number that is not an infinity in 8991 the model of the type of `X'. 8992 8993_Standard_: 8994 Fortran 95 and later 8995 8996_Class_: 8997 Inquiry function 8998 8999_Syntax_: 9000 `RESULT = HUGE(X)' 9001 9002_Arguments_: 9003 X Shall be of type `REAL' or `INTEGER'. 9004 9005_Return value_: 9006 The return value is of the same type and kind as X 9007 9008_Example_: 9009 program test_huge_tiny 9010 print *, huge(0), huge(0.0), huge(0.0d0) 9011 print *, tiny(0.0), tiny(0.0d0) 9012 end program test_huge_tiny 9013 9014 9015File: gfortran.info, Node: HYPOT, Next: IACHAR, Prev: HUGE, Up: Intrinsic Procedures 9016 90178.111 `HYPOT' -- Euclidean distance function 9018============================================ 9019 9020_Description_: 9021 `HYPOT(X,Y)' is the Euclidean distance function. It is equal to 9022 \sqrtX^2 + Y^2, without undue underflow or overflow. 9023 9024_Standard_: 9025 Fortran 2008 and later 9026 9027_Class_: 9028 Elemental function 9029 9030_Syntax_: 9031 `RESULT = HYPOT(X, Y)' 9032 9033_Arguments_: 9034 X The type shall be `REAL'. 9035 Y The type and kind type parameter shall be the 9036 same as X. 9037 9038_Return value_: 9039 The return value has the same type and kind type parameter as X. 9040 9041_Example_: 9042 program test_hypot 9043 real(4) :: x = 1.e0_4, y = 0.5e0_4 9044 x = hypot(x,y) 9045 end program test_hypot 9046 9047 9048File: gfortran.info, Node: IACHAR, Next: IALL, Prev: HYPOT, Up: Intrinsic Procedures 9049 90508.112 `IACHAR' -- Code in ASCII collating sequence 9051================================================== 9052 9053_Description_: 9054 `IACHAR(C)' returns the code for the ASCII character in the first 9055 character position of `C'. 9056 9057_Standard_: 9058 Fortran 95 and later, with KIND argument Fortran 2003 and later 9059 9060_Class_: 9061 Elemental function 9062 9063_Syntax_: 9064 `RESULT = IACHAR(C [, KIND])' 9065 9066_Arguments_: 9067 C Shall be a scalar `CHARACTER', with 9068 `INTENT(IN)' 9069 KIND (Optional) An `INTEGER' initialization 9070 expression indicating the kind parameter of 9071 the result. 9072 9073_Return value_: 9074 The return value is of type `INTEGER' and of kind KIND. If KIND is 9075 absent, the return value is of default integer kind. 9076 9077_Example_: 9078 program test_iachar 9079 integer i 9080 i = iachar(' ') 9081 end program test_iachar 9082 9083_Note_: 9084 See *note ICHAR:: for a discussion of converting between numerical 9085 values and formatted string representations. 9086 9087_See also_: 9088 *note ACHAR::, *note CHAR::, *note ICHAR:: 9089 9090 9091 9092File: gfortran.info, Node: IALL, Next: IAND, Prev: IACHAR, Up: Intrinsic Procedures 9093 90948.113 `IALL' -- Bitwise AND of array elements 9095============================================= 9096 9097_Description_: 9098 Reduces with bitwise AND the elements of ARRAY along dimension DIM 9099 if the corresponding element in MASK is `TRUE'. 9100 9101_Standard_: 9102 Fortran 2008 and later 9103 9104_Class_: 9105 Transformational function 9106 9107_Syntax_: 9108 `RESULT = IALL(ARRAY[, MASK])' 9109 `RESULT = IALL(ARRAY, DIM[, MASK])' 9110 9111_Arguments_: 9112 ARRAY Shall be an array of type `INTEGER' 9113 DIM (Optional) shall be a scalar of type `INTEGER' 9114 with a value in the range from 1 to n, where n 9115 equals the rank of ARRAY. 9116 MASK (Optional) shall be of type `LOGICAL' and 9117 either be a scalar or an array of the same 9118 shape as ARRAY. 9119 9120_Return value_: 9121 The result is of the same type as ARRAY. 9122 9123 If DIM is absent, a scalar with the bitwise ALL of all elements in 9124 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 9125 the rank of ARRAY, and a shape similar to that of ARRAY with 9126 dimension DIM dropped is returned. 9127 9128_Example_: 9129 PROGRAM test_iall 9130 INTEGER(1) :: a(2) 9131 9132 a(1) = b'00100100' 9133 a(2) = b'01101010' 9134 9135 ! prints 00100000 9136 PRINT '(b8.8)', IALL(a) 9137 END PROGRAM 9138 9139_See also_: 9140 *note IANY::, *note IPARITY::, *note IAND:: 9141 9142 9143File: gfortran.info, Node: IAND, Next: IANY, Prev: IALL, Up: Intrinsic Procedures 9144 91458.114 `IAND' -- Bitwise logical and 9146=================================== 9147 9148_Description_: 9149 Bitwise logical `AND'. 9150 9151_Standard_: 9152 Fortran 95 and later 9153 9154_Class_: 9155 Elemental function 9156 9157_Syntax_: 9158 `RESULT = IAND(I, J)' 9159 9160_Arguments_: 9161 I The type shall be `INTEGER'. 9162 J The type shall be `INTEGER', of the same kind 9163 as I. (As a GNU extension, different kinds 9164 are also permitted.) 9165 9166_Return value_: 9167 The return type is `INTEGER', of the same kind as the arguments. 9168 (If the argument kinds differ, it is of the same kind as the 9169 larger argument.) 9170 9171_Example_: 9172 PROGRAM test_iand 9173 INTEGER :: a, b 9174 DATA a / Z'F' /, b / Z'3' / 9175 WRITE (*,*) IAND(a, b) 9176 END PROGRAM 9177 9178_See also_: 9179 *note IOR::, *note IEOR::, *note IBITS::, *note IBSET::, *note 9180 IBCLR::, *note NOT:: 9181 9182 9183 9184File: gfortran.info, Node: IANY, Next: IARGC, Prev: IAND, Up: Intrinsic Procedures 9185 91868.115 `IANY' -- Bitwise OR of array elements 9187============================================ 9188 9189_Description_: 9190 Reduces with bitwise OR (inclusive or) the elements of ARRAY along 9191 dimension DIM if the corresponding element in MASK is `TRUE'. 9192 9193_Standard_: 9194 Fortran 2008 and later 9195 9196_Class_: 9197 Transformational function 9198 9199_Syntax_: 9200 `RESULT = IANY(ARRAY[, MASK])' 9201 `RESULT = IANY(ARRAY, DIM[, MASK])' 9202 9203_Arguments_: 9204 ARRAY Shall be an array of type `INTEGER' 9205 DIM (Optional) shall be a scalar of type `INTEGER' 9206 with a value in the range from 1 to n, where n 9207 equals the rank of ARRAY. 9208 MASK (Optional) shall be of type `LOGICAL' and 9209 either be a scalar or an array of the same 9210 shape as ARRAY. 9211 9212_Return value_: 9213 The result is of the same type as ARRAY. 9214 9215 If DIM is absent, a scalar with the bitwise OR of all elements in 9216 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 9217 the rank of ARRAY, and a shape similar to that of ARRAY with 9218 dimension DIM dropped is returned. 9219 9220_Example_: 9221 PROGRAM test_iany 9222 INTEGER(1) :: a(2) 9223 9224 a(1) = b'00100100' 9225 a(2) = b'01101010' 9226 9227 ! prints 01101110 9228 PRINT '(b8.8)', IANY(a) 9229 END PROGRAM 9230 9231_See also_: 9232 *note IPARITY::, *note IALL::, *note IOR:: 9233 9234 9235File: gfortran.info, Node: IARGC, Next: IBCLR, Prev: IANY, Up: Intrinsic Procedures 9236 92378.116 `IARGC' -- Get the number of command line arguments 9238========================================================= 9239 9240_Description_: 9241 `IARGC' returns the number of arguments passed on the command line 9242 when the containing program was invoked. 9243 9244 This intrinsic routine is provided for backwards compatibility with 9245 GNU Fortran 77. In new code, programmers should consider the use 9246 of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the 9247 Fortran 2003 standard. 9248 9249_Standard_: 9250 GNU extension 9251 9252_Class_: 9253 Function 9254 9255_Syntax_: 9256 `RESULT = IARGC()' 9257 9258_Arguments_: 9259 None. 9260 9261_Return value_: 9262 The number of command line arguments, type `INTEGER(4)'. 9263 9264_Example_: 9265 See *note GETARG:: 9266 9267_See also_: 9268 GNU Fortran 77 compatibility subroutine: *note GETARG:: 9269 9270 Fortran 2003 functions and subroutines: *note GET_COMMAND::, *note 9271 GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT:: 9272 9273 9274File: gfortran.info, Node: IBCLR, Next: IBITS, Prev: IARGC, Up: Intrinsic Procedures 9275 92768.117 `IBCLR' -- Clear bit 9277========================== 9278 9279_Description_: 9280 `IBCLR' returns the value of I with the bit at position POS set to 9281 zero. 9282 9283_Standard_: 9284 Fortran 95 and later 9285 9286_Class_: 9287 Elemental function 9288 9289_Syntax_: 9290 `RESULT = IBCLR(I, POS)' 9291 9292_Arguments_: 9293 I The type shall be `INTEGER'. 9294 POS The type shall be `INTEGER'. 9295 9296_Return value_: 9297 The return value is of type `INTEGER' and of the same kind as I. 9298 9299_See also_: 9300 *note IBITS::, *note IBSET::, *note IAND::, *note IOR::, *note 9301 IEOR::, *note MVBITS:: 9302 9303 9304 9305File: gfortran.info, Node: IBITS, Next: IBSET, Prev: IBCLR, Up: Intrinsic Procedures 9306 93078.118 `IBITS' -- Bit extraction 9308=============================== 9309 9310_Description_: 9311 `IBITS' extracts a field of length LEN from I, starting from bit 9312 position POS and extending left for LEN bits. The result is 9313 right-justified and the remaining bits are zeroed. The value of 9314 `POS+LEN' must be less than or equal to the value `BIT_SIZE(I)'. 9315 9316_Standard_: 9317 Fortran 95 and later 9318 9319_Class_: 9320 Elemental function 9321 9322_Syntax_: 9323 `RESULT = IBITS(I, POS, LEN)' 9324 9325_Arguments_: 9326 I The type shall be `INTEGER'. 9327 POS The type shall be `INTEGER'. 9328 LEN The type shall be `INTEGER'. 9329 9330_Return value_: 9331 The return value is of type `INTEGER' and of the same kind as I. 9332 9333_See also_: 9334 *note BIT_SIZE::, *note IBCLR::, *note IBSET::, *note IAND::, 9335 *note IOR::, *note IEOR:: 9336 9337 9338File: gfortran.info, Node: IBSET, Next: ICHAR, Prev: IBITS, Up: Intrinsic Procedures 9339 93408.119 `IBSET' -- Set bit 9341======================== 9342 9343_Description_: 9344 `IBSET' returns the value of I with the bit at position POS set to 9345 one. 9346 9347_Standard_: 9348 Fortran 95 and later 9349 9350_Class_: 9351 Elemental function 9352 9353_Syntax_: 9354 `RESULT = IBSET(I, POS)' 9355 9356_Arguments_: 9357 I The type shall be `INTEGER'. 9358 POS The type shall be `INTEGER'. 9359 9360_Return value_: 9361 The return value is of type `INTEGER' and of the same kind as I. 9362 9363_See also_: 9364 *note IBCLR::, *note IBITS::, *note IAND::, *note IOR::, *note 9365 IEOR::, *note MVBITS:: 9366 9367 9368 9369File: gfortran.info, Node: ICHAR, Next: IDATE, Prev: IBSET, Up: Intrinsic Procedures 9370 93718.120 `ICHAR' -- Character-to-integer conversion function 9372========================================================= 9373 9374_Description_: 9375 `ICHAR(C)' returns the code for the character in the first 9376 character position of `C' in the system's native character set. 9377 The correspondence between characters and their codes is not 9378 necessarily the same across different GNU Fortran implementations. 9379 9380_Standard_: 9381 Fortran 95 and later, with KIND argument Fortran 2003 and later 9382 9383_Class_: 9384 Elemental function 9385 9386_Syntax_: 9387 `RESULT = ICHAR(C [, KIND])' 9388 9389_Arguments_: 9390 C Shall be a scalar `CHARACTER', with 9391 `INTENT(IN)' 9392 KIND (Optional) An `INTEGER' initialization 9393 expression indicating the kind parameter of 9394 the result. 9395 9396_Return value_: 9397 The return value is of type `INTEGER' and of kind KIND. If KIND is 9398 absent, the return value is of default integer kind. 9399 9400_Example_: 9401 program test_ichar 9402 integer i 9403 i = ichar(' ') 9404 end program test_ichar 9405 9406_Specific names_: 9407 Name Argument Return type Standard 9408 `ICHAR(C)' `CHARACTER `INTEGER(4)' Fortran 77 and 9409 C' later 9410 9411_Note_: 9412 No intrinsic exists to convert between a numeric value and a 9413 formatted character string representation - for instance, given the 9414 `CHARACTER' value `'154'', obtaining an `INTEGER' or `REAL' value 9415 with the value 154, or vice versa. Instead, this functionality is 9416 provided by internal-file I/O, as in the following example: 9417 program read_val 9418 integer value 9419 character(len=10) string, string2 9420 string = '154' 9421 9422 ! Convert a string to a numeric value 9423 read (string,'(I10)') value 9424 print *, value 9425 9426 ! Convert a value to a formatted string 9427 write (string2,'(I10)') value 9428 print *, string2 9429 end program read_val 9430 9431_See also_: 9432 *note ACHAR::, *note CHAR::, *note IACHAR:: 9433 9434 9435 9436File: gfortran.info, Node: IDATE, Next: IEOR, Prev: ICHAR, Up: Intrinsic Procedures 9437 94388.121 `IDATE' -- Get current local time subroutine (day/month/year) 9439=================================================================== 9440 9441_Description_: 9442 `IDATE(VALUES)' Fills VALUES with the numerical values at the 9443 current local time. The day (in the range 1-31), month (in the 9444 range 1-12), and year appear in elements 1, 2, and 3 of VALUES, 9445 respectively. The year has four significant digits. 9446 9447_Standard_: 9448 GNU extension 9449 9450_Class_: 9451 Subroutine 9452 9453_Syntax_: 9454 `CALL IDATE(VALUES)' 9455 9456_Arguments_: 9457 VALUES The type shall be `INTEGER, DIMENSION(3)' and 9458 the kind shall be the default integer kind. 9459 9460_Return value_: 9461 Does not return anything. 9462 9463_Example_: 9464 program test_idate 9465 integer, dimension(3) :: tarray 9466 call idate(tarray) 9467 print *, tarray(1) 9468 print *, tarray(2) 9469 print *, tarray(3) 9470 end program test_idate 9471 9472 9473File: gfortran.info, Node: IEOR, Next: IERRNO, Prev: IDATE, Up: Intrinsic Procedures 9474 94758.122 `IEOR' -- Bitwise logical exclusive or 9476============================================ 9477 9478_Description_: 9479 `IEOR' returns the bitwise Boolean exclusive-OR of I and J. 9480 9481_Standard_: 9482 Fortran 95 and later 9483 9484_Class_: 9485 Elemental function 9486 9487_Syntax_: 9488 `RESULT = IEOR(I, J)' 9489 9490_Arguments_: 9491 I The type shall be `INTEGER'. 9492 J The type shall be `INTEGER', of the same kind 9493 as I. (As a GNU extension, different kinds 9494 are also permitted.) 9495 9496_Return value_: 9497 The return type is `INTEGER', of the same kind as the arguments. 9498 (If the argument kinds differ, it is of the same kind as the 9499 larger argument.) 9500 9501_See also_: 9502 *note IOR::, *note IAND::, *note IBITS::, *note IBSET::, *note 9503 IBCLR::, *note NOT:: 9504 9505 9506File: gfortran.info, Node: IERRNO, Next: IMAGE_INDEX, Prev: IEOR, Up: Intrinsic Procedures 9507 95088.123 `IERRNO' -- Get the last system error number 9509================================================== 9510 9511_Description_: 9512 Returns the last system error number, as given by the C `errno' 9513 variable. 9514 9515_Standard_: 9516 GNU extension 9517 9518_Class_: 9519 Function 9520 9521_Syntax_: 9522 `RESULT = IERRNO()' 9523 9524_Arguments_: 9525 None. 9526 9527_Return value_: 9528 The return value is of type `INTEGER' and of the default integer 9529 kind. 9530 9531_See also_: 9532 *note PERROR:: 9533 9534 9535File: gfortran.info, Node: IMAGE_INDEX, Next: INDEX intrinsic, Prev: IERRNO, Up: Intrinsic Procedures 9536 95378.124 `IMAGE_INDEX' -- Function that converts a cosubscript to an image index 9538============================================================================= 9539 9540_Description_: 9541 Returns the image index belonging to a cosubscript. 9542 9543_Standard_: 9544 Fortran 2008 and later 9545 9546_Class_: 9547 Inquiry function. 9548 9549_Syntax_: 9550 `RESULT = IMAGE_INDEX(COARRAY, SUB)' 9551 9552_Arguments_: None. 9553 COARRAY Coarray of any type. 9554 SUB default integer rank-1 array of a size equal to 9555 the corank of COARRAY. 9556 9557_Return value_: 9558 Scalar default integer with the value of the image index which 9559 corresponds to the cosubscripts. For invalid cosubscripts the 9560 result is zero. 9561 9562_Example_: 9563 INTEGER :: array[2,-1:4,8,*] 9564 ! Writes 28 (or 0 if there are fewer than 28 images) 9565 WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1]) 9566 9567_See also_: 9568 *note THIS_IMAGE::, *note NUM_IMAGES:: 9569 9570 9571File: gfortran.info, Node: INDEX intrinsic, Next: INT, Prev: IMAGE_INDEX, Up: Intrinsic Procedures 9572 95738.125 `INDEX' -- Position of a substring within a string 9574======================================================== 9575 9576_Description_: 9577 Returns the position of the start of the first occurrence of string 9578 SUBSTRING as a substring in STRING, counting from one. If 9579 SUBSTRING is not present in STRING, zero is returned. If the BACK 9580 argument is present and true, the return value is the start of the 9581 last occurrence rather than the first. 9582 9583_Standard_: 9584 Fortran 77 and later, with KIND argument Fortran 2003 and later 9585 9586_Class_: 9587 Elemental function 9588 9589_Syntax_: 9590 `RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])' 9591 9592_Arguments_: 9593 STRING Shall be a scalar `CHARACTER', with 9594 `INTENT(IN)' 9595 SUBSTRING Shall be a scalar `CHARACTER', with 9596 `INTENT(IN)' 9597 BACK (Optional) Shall be a scalar `LOGICAL', with 9598 `INTENT(IN)' 9599 KIND (Optional) An `INTEGER' initialization 9600 expression indicating the kind parameter of 9601 the result. 9602 9603_Return value_: 9604 The return value is of type `INTEGER' and of kind KIND. If KIND is 9605 absent, the return value is of default integer kind. 9606 9607_Specific names_: 9608 Name Argument Return type Standard 9609 `INDEX(STRING,`CHARACTER' `INTEGER(4)' Fortran 77 and 9610 SUBSTRING)' later 9611 9612_See also_: 9613 *note SCAN::, *note VERIFY:: 9614 9615 9616File: gfortran.info, Node: INT, Next: INT2, Prev: INDEX intrinsic, Up: Intrinsic Procedures 9617 96188.126 `INT' -- Convert to integer type 9619====================================== 9620 9621_Description_: 9622 Convert to integer type 9623 9624_Standard_: 9625 Fortran 77 and later 9626 9627_Class_: 9628 Elemental function 9629 9630_Syntax_: 9631 `RESULT = INT(A [, KIND))' 9632 9633_Arguments_: 9634 A Shall be of type `INTEGER', `REAL', or 9635 `COMPLEX'. 9636 KIND (Optional) An `INTEGER' initialization 9637 expression indicating the kind parameter of 9638 the result. 9639 9640_Return value_: 9641 These functions return a `INTEGER' variable or array under the 9642 following rules: 9643 9644 (A) 9645 If A is of type `INTEGER', `INT(A) = A' 9646 9647 (B) 9648 If A is of type `REAL' and |A| < 1, `INT(A)' equals `0'. If 9649 |A| \geq 1, then `INT(A)' equals the largest integer that 9650 does not exceed the range of A and whose sign is the same as 9651 the sign of A. 9652 9653 (C) 9654 If A is of type `COMPLEX', rule B is applied to the real part 9655 of A. 9656 9657_Example_: 9658 program test_int 9659 integer :: i = 42 9660 complex :: z = (-3.7, 1.0) 9661 print *, int(i) 9662 print *, int(z), int(z,8) 9663 end program 9664 9665_Specific names_: 9666 Name Argument Return type Standard 9667 `INT(A)' `REAL(4) A' `INTEGER' Fortran 77 and 9668 later 9669 `IFIX(A)' `REAL(4) A' `INTEGER' Fortran 77 and 9670 later 9671 `IDINT(A)' `REAL(8) A' `INTEGER' Fortran 77 and 9672 later 9673 9674 9675 9676File: gfortran.info, Node: INT2, Next: INT8, Prev: INT, Up: Intrinsic Procedures 9677 96788.127 `INT2' -- Convert to 16-bit integer type 9679============================================== 9680 9681_Description_: 9682 Convert to a `KIND=2' integer type. This is equivalent to the 9683 standard `INT' intrinsic with an optional argument of `KIND=2', 9684 and is only included for backwards compatibility. 9685 9686 The `SHORT' intrinsic is equivalent to `INT2'. 9687 9688_Standard_: 9689 GNU extension 9690 9691_Class_: 9692 Elemental function 9693 9694_Syntax_: 9695 `RESULT = INT2(A)' 9696 9697_Arguments_: 9698 A Shall be of type `INTEGER', `REAL', or 9699 `COMPLEX'. 9700 9701_Return value_: 9702 The return value is a `INTEGER(2)' variable. 9703 9704_See also_: 9705 *note INT::, *note INT8::, *note LONG:: 9706 9707 9708File: gfortran.info, Node: INT8, Next: IOR, Prev: INT2, Up: Intrinsic Procedures 9709 97108.128 `INT8' -- Convert to 64-bit integer type 9711============================================== 9712 9713_Description_: 9714 Convert to a `KIND=8' integer type. This is equivalent to the 9715 standard `INT' intrinsic with an optional argument of `KIND=8', 9716 and is only included for backwards compatibility. 9717 9718_Standard_: 9719 GNU extension 9720 9721_Class_: 9722 Elemental function 9723 9724_Syntax_: 9725 `RESULT = INT8(A)' 9726 9727_Arguments_: 9728 A Shall be of type `INTEGER', `REAL', or 9729 `COMPLEX'. 9730 9731_Return value_: 9732 The return value is a `INTEGER(8)' variable. 9733 9734_See also_: 9735 *note INT::, *note INT2::, *note LONG:: 9736 9737 9738File: gfortran.info, Node: IOR, Next: IPARITY, Prev: INT8, Up: Intrinsic Procedures 9739 97408.129 `IOR' -- Bitwise logical or 9741================================= 9742 9743_Description_: 9744 `IOR' returns the bitwise Boolean inclusive-OR of I and J. 9745 9746_Standard_: 9747 Fortran 95 and later 9748 9749_Class_: 9750 Elemental function 9751 9752_Syntax_: 9753 `RESULT = IOR(I, J)' 9754 9755_Arguments_: 9756 I The type shall be `INTEGER'. 9757 J The type shall be `INTEGER', of the same kind 9758 as I. (As a GNU extension, different kinds 9759 are also permitted.) 9760 9761_Return value_: 9762 The return type is `INTEGER', of the same kind as the arguments. 9763 (If the argument kinds differ, it is of the same kind as the 9764 larger argument.) 9765 9766_See also_: 9767 *note IEOR::, *note IAND::, *note IBITS::, *note IBSET::, *note 9768 IBCLR::, *note NOT:: 9769 9770 9771File: gfortran.info, Node: IPARITY, Next: IRAND, Prev: IOR, Up: Intrinsic Procedures 9772 97738.130 `IPARITY' -- Bitwise XOR of array elements 9774================================================ 9775 9776_Description_: 9777 Reduces with bitwise XOR (exclusive or) the elements of ARRAY along 9778 dimension DIM if the corresponding element in MASK is `TRUE'. 9779 9780_Standard_: 9781 Fortran 2008 and later 9782 9783_Class_: 9784 Transformational function 9785 9786_Syntax_: 9787 `RESULT = IPARITY(ARRAY[, MASK])' 9788 `RESULT = IPARITY(ARRAY, DIM[, MASK])' 9789 9790_Arguments_: 9791 ARRAY Shall be an array of type `INTEGER' 9792 DIM (Optional) shall be a scalar of type `INTEGER' 9793 with a value in the range from 1 to n, where n 9794 equals the rank of ARRAY. 9795 MASK (Optional) shall be of type `LOGICAL' and 9796 either be a scalar or an array of the same 9797 shape as ARRAY. 9798 9799_Return value_: 9800 The result is of the same type as ARRAY. 9801 9802 If DIM is absent, a scalar with the bitwise XOR of all elements in 9803 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 9804 the rank of ARRAY, and a shape similar to that of ARRAY with 9805 dimension DIM dropped is returned. 9806 9807_Example_: 9808 PROGRAM test_iparity 9809 INTEGER(1) :: a(2) 9810 9811 a(1) = b'00100100' 9812 a(2) = b'01101010' 9813 9814 ! prints 01001110 9815 PRINT '(b8.8)', IPARITY(a) 9816 END PROGRAM 9817 9818_See also_: 9819 *note IANY::, *note IALL::, *note IEOR::, *note PARITY:: 9820 9821 9822File: gfortran.info, Node: IRAND, Next: IS_IOSTAT_END, Prev: IPARITY, Up: Intrinsic Procedures 9823 98248.131 `IRAND' -- Integer pseudo-random number 9825============================================= 9826 9827_Description_: 9828 `IRAND(FLAG)' returns a pseudo-random number from a uniform 9829 distribution between 0 and a system-dependent limit (which is in 9830 most cases 2147483647). If FLAG is 0, the next number in the 9831 current sequence is returned; if FLAG is 1, the generator is 9832 restarted by `CALL SRAND(0)'; if FLAG has any other value, it is 9833 used as a new seed with `SRAND'. 9834 9835 This intrinsic routine is provided for backwards compatibility with 9836 GNU Fortran 77. It implements a simple modulo generator as provided 9837 by `g77'. For new code, one should consider the use of *note 9838 RANDOM_NUMBER:: as it implements a superior algorithm. 9839 9840_Standard_: 9841 GNU extension 9842 9843_Class_: 9844 Function 9845 9846_Syntax_: 9847 `RESULT = IRAND(I)' 9848 9849_Arguments_: 9850 I Shall be a scalar `INTEGER' of kind 4. 9851 9852_Return value_: 9853 The return value is of `INTEGER(kind=4)' type. 9854 9855_Example_: 9856 program test_irand 9857 integer,parameter :: seed = 86456 9858 9859 call srand(seed) 9860 print *, irand(), irand(), irand(), irand() 9861 print *, irand(seed), irand(), irand(), irand() 9862 end program test_irand 9863 9864 9865 9866File: gfortran.info, Node: IS_IOSTAT_END, Next: IS_IOSTAT_EOR, Prev: IRAND, Up: Intrinsic Procedures 9867 98688.132 `IS_IOSTAT_END' -- Test for end-of-file value 9869=================================================== 9870 9871_Description_: 9872 `IS_IOSTAT_END' tests whether an variable has the value of the I/O 9873 status "end of file". The function is equivalent to comparing the 9874 variable with the `IOSTAT_END' parameter of the intrinsic module 9875 `ISO_FORTRAN_ENV'. 9876 9877_Standard_: 9878 Fortran 2003 and later 9879 9880_Class_: 9881 Elemental function 9882 9883_Syntax_: 9884 `RESULT = IS_IOSTAT_END(I)' 9885 9886_Arguments_: 9887 I Shall be of the type `INTEGER'. 9888 9889_Return value_: 9890 Returns a `LOGICAL' of the default kind, which `.TRUE.' if I has 9891 the value which indicates an end of file condition for `IOSTAT=' 9892 specifiers, and is `.FALSE.' otherwise. 9893 9894_Example_: 9895 PROGRAM iostat 9896 IMPLICIT NONE 9897 INTEGER :: stat, i 9898 OPEN(88, FILE='test.dat') 9899 READ(88, *, IOSTAT=stat) i 9900 IF(IS_IOSTAT_END(stat)) STOP 'END OF FILE' 9901 END PROGRAM 9902 9903 9904File: gfortran.info, Node: IS_IOSTAT_EOR, Next: ISATTY, Prev: IS_IOSTAT_END, Up: Intrinsic Procedures 9905 99068.133 `IS_IOSTAT_EOR' -- Test for end-of-record value 9907===================================================== 9908 9909_Description_: 9910 `IS_IOSTAT_EOR' tests whether an variable has the value of the I/O 9911 status "end of record". The function is equivalent to comparing the 9912 variable with the `IOSTAT_EOR' parameter of the intrinsic module 9913 `ISO_FORTRAN_ENV'. 9914 9915_Standard_: 9916 Fortran 2003 and later 9917 9918_Class_: 9919 Elemental function 9920 9921_Syntax_: 9922 `RESULT = IS_IOSTAT_EOR(I)' 9923 9924_Arguments_: 9925 I Shall be of the type `INTEGER'. 9926 9927_Return value_: 9928 Returns a `LOGICAL' of the default kind, which `.TRUE.' if I has 9929 the value which indicates an end of file condition for `IOSTAT=' 9930 specifiers, and is `.FALSE.' otherwise. 9931 9932_Example_: 9933 PROGRAM iostat 9934 IMPLICIT NONE 9935 INTEGER :: stat, i(50) 9936 OPEN(88, FILE='test.dat', FORM='UNFORMATTED') 9937 READ(88, IOSTAT=stat) i 9938 IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD' 9939 END PROGRAM 9940 9941 9942File: gfortran.info, Node: ISATTY, Next: ISHFT, Prev: IS_IOSTAT_EOR, Up: Intrinsic Procedures 9943 99448.134 `ISATTY' -- Whether a unit is a terminal device. 9945====================================================== 9946 9947_Description_: 9948 Determine whether a unit is connected to a terminal device. 9949 9950_Standard_: 9951 GNU extension 9952 9953_Class_: 9954 Function 9955 9956_Syntax_: 9957 `RESULT = ISATTY(UNIT)' 9958 9959_Arguments_: 9960 UNIT Shall be a scalar `INTEGER'. 9961 9962_Return value_: 9963 Returns `.TRUE.' if the UNIT is connected to a terminal device, 9964 `.FALSE.' otherwise. 9965 9966_Example_: 9967 PROGRAM test_isatty 9968 INTEGER(kind=1) :: unit 9969 DO unit = 1, 10 9970 write(*,*) isatty(unit=unit) 9971 END DO 9972 END PROGRAM 9973 9974_See also_: 9975 *note TTYNAM:: 9976 9977 9978File: gfortran.info, Node: ISHFT, Next: ISHFTC, Prev: ISATTY, Up: Intrinsic Procedures 9979 99808.135 `ISHFT' -- Shift bits 9981=========================== 9982 9983_Description_: 9984 `ISHFT' returns a value corresponding to I with all of the bits 9985 shifted SHIFT places. A value of SHIFT greater than zero 9986 corresponds to a left shift, a value of zero corresponds to no 9987 shift, and a value less than zero corresponds to a right shift. 9988 If the absolute value of SHIFT is greater than `BIT_SIZE(I)', the 9989 value is undefined. Bits shifted out from the left end or right 9990 end are lost; zeros are shifted in from the opposite end. 9991 9992_Standard_: 9993 Fortran 95 and later 9994 9995_Class_: 9996 Elemental function 9997 9998_Syntax_: 9999 `RESULT = ISHFT(I, SHIFT)' 10000 10001_Arguments_: 10002 I The type shall be `INTEGER'. 10003 SHIFT The type shall be `INTEGER'. 10004 10005_Return value_: 10006 The return value is of type `INTEGER' and of the same kind as I. 10007 10008_See also_: 10009 *note ISHFTC:: 10010 10011 10012File: gfortran.info, Node: ISHFTC, Next: ISNAN, Prev: ISHFT, Up: Intrinsic Procedures 10013 100148.136 `ISHFTC' -- Shift bits circularly 10015======================================= 10016 10017_Description_: 10018 `ISHFTC' returns a value corresponding to I with the rightmost 10019 SIZE bits shifted circularly SHIFT places; that is, bits shifted 10020 out one end are shifted into the opposite end. A value of SHIFT 10021 greater than zero corresponds to a left shift, a value of zero 10022 corresponds to no shift, and a value less than zero corresponds to 10023 a right shift. The absolute value of SHIFT must be less than 10024 SIZE. If the SIZE argument is omitted, it is taken to be 10025 equivalent to `BIT_SIZE(I)'. 10026 10027_Standard_: 10028 Fortran 95 and later 10029 10030_Class_: 10031 Elemental function 10032 10033_Syntax_: 10034 `RESULT = ISHFTC(I, SHIFT [, SIZE])' 10035 10036_Arguments_: 10037 I The type shall be `INTEGER'. 10038 SHIFT The type shall be `INTEGER'. 10039 SIZE (Optional) The type shall be `INTEGER'; the 10040 value must be greater than zero and less than 10041 or equal to `BIT_SIZE(I)'. 10042 10043_Return value_: 10044 The return value is of type `INTEGER' and of the same kind as I. 10045 10046_See also_: 10047 *note ISHFT:: 10048 10049 10050File: gfortran.info, Node: ISNAN, Next: ITIME, Prev: ISHFTC, Up: Intrinsic Procedures 10051 100528.137 `ISNAN' -- Test for a NaN 10053=============================== 10054 10055_Description_: 10056 `ISNAN' tests whether a floating-point value is an IEEE 10057 Not-a-Number (NaN). 10058 10059_Standard_: 10060 GNU extension 10061 10062_Class_: 10063 Elemental function 10064 10065_Syntax_: 10066 `ISNAN(X)' 10067 10068_Arguments_: 10069 X Variable of the type `REAL'. 10070 10071_Return value_: 10072 Returns a default-kind `LOGICAL'. The returned value is `TRUE' if 10073 X is a NaN and `FALSE' otherwise. 10074 10075_Example_: 10076 program test_nan 10077 implicit none 10078 real :: x 10079 x = -1.0 10080 x = sqrt(x) 10081 if (isnan(x)) stop '"x" is a NaN' 10082 end program test_nan 10083 10084 10085File: gfortran.info, Node: ITIME, Next: KILL, Prev: ISNAN, Up: Intrinsic Procedures 10086 100878.138 `ITIME' -- Get current local time subroutine (hour/minutes/seconds) 10088========================================================================= 10089 10090_Description_: 10091 `IDATE(VALUES)' Fills VALUES with the numerical values at the 10092 current local time. The hour (in the range 1-24), minute (in the 10093 range 1-60), and seconds (in the range 1-60) appear in elements 1, 10094 2, and 3 of VALUES, respectively. 10095 10096_Standard_: 10097 GNU extension 10098 10099_Class_: 10100 Subroutine 10101 10102_Syntax_: 10103 `CALL ITIME(VALUES)' 10104 10105_Arguments_: 10106 VALUES The type shall be `INTEGER, DIMENSION(3)' and 10107 the kind shall be the default integer kind. 10108 10109_Return value_: 10110 Does not return anything. 10111 10112_Example_: 10113 program test_itime 10114 integer, dimension(3) :: tarray 10115 call itime(tarray) 10116 print *, tarray(1) 10117 print *, tarray(2) 10118 print *, tarray(3) 10119 end program test_itime 10120 10121 10122File: gfortran.info, Node: KILL, Next: KIND, Prev: ITIME, Up: Intrinsic Procedures 10123 101248.139 `KILL' -- Send a signal to a process 10125========================================== 10126 10127_Description_: 10128 10129_Standard_: 10130 Sends the signal specified by SIGNAL to the process PID. See 10131 `kill(2)'. 10132 10133 This intrinsic is provided in both subroutine and function forms; 10134 however, only one form can be used in any given program unit. 10135 10136_Class_: 10137 Subroutine, function 10138 10139_Syntax_: 10140 `CALL KILL(C, VALUE [, STATUS])' 10141 `STATUS = KILL(C, VALUE)' 10142 10143_Arguments_: 10144 C Shall be a scalar `INTEGER', with `INTENT(IN)' 10145 VALUE Shall be a scalar `INTEGER', with `INTENT(IN)' 10146 STATUS (Optional) status flag of type `INTEGER(4)' or 10147 `INTEGER(8)'. Returns 0 on success, or a 10148 system-specific error code otherwise. 10149 10150_See also_: 10151 *note ABORT::, *note EXIT:: 10152 10153 10154File: gfortran.info, Node: KIND, Next: LBOUND, Prev: KILL, Up: Intrinsic Procedures 10155 101568.140 `KIND' -- Kind of an entity 10157================================= 10158 10159_Description_: 10160 `KIND(X)' returns the kind value of the entity X. 10161 10162_Standard_: 10163 Fortran 95 and later 10164 10165_Class_: 10166 Inquiry function 10167 10168_Syntax_: 10169 `K = KIND(X)' 10170 10171_Arguments_: 10172 X Shall be of type `LOGICAL', `INTEGER', `REAL', 10173 `COMPLEX' or `CHARACTER'. 10174 10175_Return value_: 10176 The return value is a scalar of type `INTEGER' and of the default 10177 integer kind. 10178 10179_Example_: 10180 program test_kind 10181 integer,parameter :: kc = kind(' ') 10182 integer,parameter :: kl = kind(.true.) 10183 10184 print *, "The default character kind is ", kc 10185 print *, "The default logical kind is ", kl 10186 end program test_kind 10187 10188 10189 10190File: gfortran.info, Node: LBOUND, Next: LCOBOUND, Prev: KIND, Up: Intrinsic Procedures 10191 101928.141 `LBOUND' -- Lower dimension bounds of an array 10193==================================================== 10194 10195_Description_: 10196 Returns the lower bounds of an array, or a single lower bound 10197 along the DIM dimension. 10198 10199_Standard_: 10200 Fortran 95 and later, with KIND argument Fortran 2003 and later 10201 10202_Class_: 10203 Inquiry function 10204 10205_Syntax_: 10206 `RESULT = LBOUND(ARRAY [, DIM [, KIND]])' 10207 10208_Arguments_: 10209 ARRAY Shall be an array, of any type. 10210 DIM (Optional) Shall be a scalar `INTEGER'. 10211 KIND (Optional) An `INTEGER' initialization 10212 expression indicating the kind parameter of 10213 the result. 10214 10215_Return value_: 10216 The return value is of type `INTEGER' and of kind KIND. If KIND is 10217 absent, the return value is of default integer kind. If DIM is 10218 absent, the result is an array of the lower bounds of ARRAY. If 10219 DIM is present, the result is a scalar corresponding to the lower 10220 bound of the array along that dimension. If ARRAY is an 10221 expression rather than a whole array or array structure component, 10222 or if it has a zero extent along the relevant dimension, the lower 10223 bound is taken to be 1. 10224 10225_See also_: 10226 *note UBOUND::, *note LCOBOUND:: 10227 10228 10229File: gfortran.info, Node: LCOBOUND, Next: LEADZ, Prev: LBOUND, Up: Intrinsic Procedures 10230 102318.142 `LCOBOUND' -- Lower codimension bounds of an array 10232======================================================== 10233 10234_Description_: 10235 Returns the lower bounds of a coarray, or a single lower cobound 10236 along the DIM codimension. 10237 10238_Standard_: 10239 Fortran 2008 and later 10240 10241_Class_: 10242 Inquiry function 10243 10244_Syntax_: 10245 `RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])' 10246 10247_Arguments_: 10248 ARRAY Shall be an coarray, of any type. 10249 DIM (Optional) Shall be a scalar `INTEGER'. 10250 KIND (Optional) An `INTEGER' initialization 10251 expression indicating the kind parameter of 10252 the result. 10253 10254_Return value_: 10255 The return value is of type `INTEGER' and of kind KIND. If KIND is 10256 absent, the return value is of default integer kind. If DIM is 10257 absent, the result is an array of the lower cobounds of COARRAY. 10258 If DIM is present, the result is a scalar corresponding to the 10259 lower cobound of the array along that codimension. 10260 10261_See also_: 10262 *note UCOBOUND::, *note LBOUND:: 10263 10264 10265File: gfortran.info, Node: LEADZ, Next: LEN, Prev: LCOBOUND, Up: Intrinsic Procedures 10266 102678.143 `LEADZ' -- Number of leading zero bits of an integer 10268========================================================== 10269 10270_Description_: 10271 `LEADZ' returns the number of leading zero bits of an integer. 10272 10273_Standard_: 10274 Fortran 2008 and later 10275 10276_Class_: 10277 Elemental function 10278 10279_Syntax_: 10280 `RESULT = LEADZ(I)' 10281 10282_Arguments_: 10283 I Shall be of type `INTEGER'. 10284 10285_Return value_: 10286 The type of the return value is the default `INTEGER'. If all the 10287 bits of `I' are zero, the result value is `BIT_SIZE(I)'. 10288 10289_Example_: 10290 PROGRAM test_leadz 10291 WRITE (*,*) BIT_SIZE(1) ! prints 32 10292 WRITE (*,*) LEADZ(1) ! prints 31 10293 END PROGRAM 10294 10295_See also_: 10296 *note BIT_SIZE::, *note TRAILZ::, *note POPCNT::, *note POPPAR:: 10297 10298 10299File: gfortran.info, Node: LEN, Next: LEN_TRIM, Prev: LEADZ, Up: Intrinsic Procedures 10300 103018.144 `LEN' -- Length of a character entity 10302=========================================== 10303 10304_Description_: 10305 Returns the length of a character string. If STRING is an array, 10306 the length of an element of STRING is returned. Note that STRING 10307 need not be defined when this intrinsic is invoked, since only the 10308 length, not the content, of STRING is needed. 10309 10310_Standard_: 10311 Fortran 77 and later, with KIND argument Fortran 2003 and later 10312 10313_Class_: 10314 Inquiry function 10315 10316_Syntax_: 10317 `L = LEN(STRING [, KIND])' 10318 10319_Arguments_: 10320 STRING Shall be a scalar or array of type 10321 `CHARACTER', with `INTENT(IN)' 10322 KIND (Optional) An `INTEGER' initialization 10323 expression indicating the kind parameter of 10324 the result. 10325 10326_Return value_: 10327 The return value is of type `INTEGER' and of kind KIND. If KIND is 10328 absent, the return value is of default integer kind. 10329 10330_Specific names_: 10331 Name Argument Return type Standard 10332 `LEN(STRING)' `CHARACTER' `INTEGER' Fortran 77 and 10333 later 10334 10335_See also_: 10336 *note LEN_TRIM::, *note ADJUSTL::, *note ADJUSTR:: 10337 10338 10339File: gfortran.info, Node: LEN_TRIM, Next: LGE, Prev: LEN, Up: Intrinsic Procedures 10340 103418.145 `LEN_TRIM' -- Length of a character entity without trailing blank characters 10342================================================================================== 10343 10344_Description_: 10345 Returns the length of a character string, ignoring any trailing 10346 blanks. 10347 10348_Standard_: 10349 Fortran 95 and later, with KIND argument Fortran 2003 and later 10350 10351_Class_: 10352 Elemental function 10353 10354_Syntax_: 10355 `RESULT = LEN_TRIM(STRING [, KIND])' 10356 10357_Arguments_: 10358 STRING Shall be a scalar of type `CHARACTER', with 10359 `INTENT(IN)' 10360 KIND (Optional) An `INTEGER' initialization 10361 expression indicating the kind parameter of 10362 the result. 10363 10364_Return value_: 10365 The return value is of type `INTEGER' and of kind KIND. If KIND is 10366 absent, the return value is of default integer kind. 10367 10368_See also_: 10369 *note LEN::, *note ADJUSTL::, *note ADJUSTR:: 10370 10371 10372File: gfortran.info, Node: LGE, Next: LGT, Prev: LEN_TRIM, Up: Intrinsic Procedures 10373 103748.146 `LGE' -- Lexical greater than or equal 10375============================================ 10376 10377_Description_: 10378 Determines whether one string is lexically greater than or equal to 10379 another string, where the two strings are interpreted as containing 10380 ASCII character codes. If the String A and String B are not the 10381 same length, the shorter is compared as if spaces were appended to 10382 it to form a value that has the same length as the longer. 10383 10384 In general, the lexical comparison intrinsics `LGE', `LGT', `LLE', 10385 and `LLT' differ from the corresponding intrinsic operators 10386 `.GE.', `.GT.', `.LE.', and `.LT.', in that the latter use the 10387 processor's character ordering (which is not ASCII on some 10388 targets), whereas the former always use the ASCII ordering. 10389 10390_Standard_: 10391 Fortran 77 and later 10392 10393_Class_: 10394 Elemental function 10395 10396_Syntax_: 10397 `RESULT = LGE(STRING_A, STRING_B)' 10398 10399_Arguments_: 10400 STRING_A Shall be of default `CHARACTER' type. 10401 STRING_B Shall be of default `CHARACTER' type. 10402 10403_Return value_: 10404 Returns `.TRUE.' if `STRING_A >= STRING_B', and `.FALSE.' 10405 otherwise, based on the ASCII ordering. 10406 10407_Specific names_: 10408 Name Argument Return type Standard 10409 `LGE(STRING_A,`CHARACTER' `LOGICAL' Fortran 77 and 10410 STRING_B)' later 10411 10412_See also_: 10413 *note LGT::, *note LLE::, *note LLT:: 10414 10415 10416File: gfortran.info, Node: LGT, Next: LINK, Prev: LGE, Up: Intrinsic Procedures 10417 104188.147 `LGT' -- Lexical greater than 10419=================================== 10420 10421_Description_: 10422 Determines whether one string is lexically greater than another 10423 string, where the two strings are interpreted as containing ASCII 10424 character codes. If the String A and String B are not the same 10425 length, the shorter is compared as if spaces were appended to it 10426 to form a value that has the same length as the longer. 10427 10428 In general, the lexical comparison intrinsics `LGE', `LGT', `LLE', 10429 and `LLT' differ from the corresponding intrinsic operators 10430 `.GE.', `.GT.', `.LE.', and `.LT.', in that the latter use the 10431 processor's character ordering (which is not ASCII on some 10432 targets), whereas the former always use the ASCII ordering. 10433 10434_Standard_: 10435 Fortran 77 and later 10436 10437_Class_: 10438 Elemental function 10439 10440_Syntax_: 10441 `RESULT = LGT(STRING_A, STRING_B)' 10442 10443_Arguments_: 10444 STRING_A Shall be of default `CHARACTER' type. 10445 STRING_B Shall be of default `CHARACTER' type. 10446 10447_Return value_: 10448 Returns `.TRUE.' if `STRING_A > STRING_B', and `.FALSE.' 10449 otherwise, based on the ASCII ordering. 10450 10451_Specific names_: 10452 Name Argument Return type Standard 10453 `LGT(STRING_A,`CHARACTER' `LOGICAL' Fortran 77 and 10454 STRING_B)' later 10455 10456_See also_: 10457 *note LGE::, *note LLE::, *note LLT:: 10458 10459 10460File: gfortran.info, Node: LINK, Next: LLE, Prev: LGT, Up: Intrinsic Procedures 10461 104628.148 `LINK' -- Create a hard link 10463================================== 10464 10465_Description_: 10466 Makes a (hard) link from file PATH1 to PATH2. A null character 10467 (`CHAR(0)') can be used to mark the end of the names in PATH1 and 10468 PATH2; otherwise, trailing blanks in the file names are ignored. 10469 If the STATUS argument is supplied, it contains 0 on success or a 10470 nonzero error code upon return; see `link(2)'. 10471 10472 This intrinsic is provided in both subroutine and function forms; 10473 however, only one form can be used in any given program unit. 10474 10475_Standard_: 10476 GNU extension 10477 10478_Class_: 10479 Subroutine, function 10480 10481_Syntax_: 10482 `CALL LINK(PATH1, PATH2 [, STATUS])' 10483 `STATUS = LINK(PATH1, PATH2)' 10484 10485_Arguments_: 10486 PATH1 Shall be of default `CHARACTER' type. 10487 PATH2 Shall be of default `CHARACTER' type. 10488 STATUS (Optional) Shall be of default `INTEGER' type. 10489 10490_See also_: 10491 *note SYMLNK::, *note UNLINK:: 10492 10493 10494File: gfortran.info, Node: LLE, Next: LLT, Prev: LINK, Up: Intrinsic Procedures 10495 104968.149 `LLE' -- Lexical less than or equal 10497========================================= 10498 10499_Description_: 10500 Determines whether one string is lexically less than or equal to 10501 another string, where the two strings are interpreted as 10502 containing ASCII character codes. If the String A and String B 10503 are not the same length, the shorter is compared as if spaces were 10504 appended to it to form a value that has the same length as the 10505 longer. 10506 10507 In general, the lexical comparison intrinsics `LGE', `LGT', `LLE', 10508 and `LLT' differ from the corresponding intrinsic operators 10509 `.GE.', `.GT.', `.LE.', and `.LT.', in that the latter use the 10510 processor's character ordering (which is not ASCII on some 10511 targets), whereas the former always use the ASCII ordering. 10512 10513_Standard_: 10514 Fortran 77 and later 10515 10516_Class_: 10517 Elemental function 10518 10519_Syntax_: 10520 `RESULT = LLE(STRING_A, STRING_B)' 10521 10522_Arguments_: 10523 STRING_A Shall be of default `CHARACTER' type. 10524 STRING_B Shall be of default `CHARACTER' type. 10525 10526_Return value_: 10527 Returns `.TRUE.' if `STRING_A <= STRING_B', and `.FALSE.' 10528 otherwise, based on the ASCII ordering. 10529 10530_Specific names_: 10531 Name Argument Return type Standard 10532 `LLE(STRING_A,`CHARACTER' `LOGICAL' Fortran 77 and 10533 STRING_B)' later 10534 10535_See also_: 10536 *note LGE::, *note LGT::, *note LLT:: 10537 10538 10539File: gfortran.info, Node: LLT, Next: LNBLNK, Prev: LLE, Up: Intrinsic Procedures 10540 105418.150 `LLT' -- Lexical less than 10542================================ 10543 10544_Description_: 10545 Determines whether one string is lexically less than another 10546 string, where the two strings are interpreted as containing ASCII 10547 character codes. If the String A and String B are not the same 10548 length, the shorter is compared as if spaces were appended to it 10549 to form a value that has the same length as the longer. 10550 10551 In general, the lexical comparison intrinsics `LGE', `LGT', `LLE', 10552 and `LLT' differ from the corresponding intrinsic operators 10553 `.GE.', `.GT.', `.LE.', and `.LT.', in that the latter use the 10554 processor's character ordering (which is not ASCII on some 10555 targets), whereas the former always use the ASCII ordering. 10556 10557_Standard_: 10558 Fortran 77 and later 10559 10560_Class_: 10561 Elemental function 10562 10563_Syntax_: 10564 `RESULT = LLT(STRING_A, STRING_B)' 10565 10566_Arguments_: 10567 STRING_A Shall be of default `CHARACTER' type. 10568 STRING_B Shall be of default `CHARACTER' type. 10569 10570_Return value_: 10571 Returns `.TRUE.' if `STRING_A < STRING_B', and `.FALSE.' 10572 otherwise, based on the ASCII ordering. 10573 10574_Specific names_: 10575 Name Argument Return type Standard 10576 `LLT(STRING_A,`CHARACTER' `LOGICAL' Fortran 77 and 10577 STRING_B)' later 10578 10579_See also_: 10580 *note LGE::, *note LGT::, *note LLE:: 10581 10582 10583File: gfortran.info, Node: LNBLNK, Next: LOC, Prev: LLT, Up: Intrinsic Procedures 10584 105858.151 `LNBLNK' -- Index of the last non-blank character in a string 10586=================================================================== 10587 10588_Description_: 10589 Returns the length of a character string, ignoring any trailing 10590 blanks. This is identical to the standard `LEN_TRIM' intrinsic, 10591 and is only included for backwards compatibility. 10592 10593_Standard_: 10594 GNU extension 10595 10596_Class_: 10597 Elemental function 10598 10599_Syntax_: 10600 `RESULT = LNBLNK(STRING)' 10601 10602_Arguments_: 10603 STRING Shall be a scalar of type `CHARACTER', with 10604 `INTENT(IN)' 10605 10606_Return value_: 10607 The return value is of `INTEGER(kind=4)' type. 10608 10609_See also_: 10610 *note INDEX intrinsic::, *note LEN_TRIM:: 10611 10612 10613File: gfortran.info, Node: LOC, Next: LOG, Prev: LNBLNK, Up: Intrinsic Procedures 10614 106158.152 `LOC' -- Returns the address of a variable 10616================================================ 10617 10618_Description_: 10619 `LOC(X)' returns the address of X as an integer. 10620 10621_Standard_: 10622 GNU extension 10623 10624_Class_: 10625 Inquiry function 10626 10627_Syntax_: 10628 `RESULT = LOC(X)' 10629 10630_Arguments_: 10631 X Variable of any type. 10632 10633_Return value_: 10634 The return value is of type `INTEGER', with a `KIND' corresponding 10635 to the size (in bytes) of a memory address on the target machine. 10636 10637_Example_: 10638 program test_loc 10639 integer :: i 10640 real :: r 10641 i = loc(r) 10642 print *, i 10643 end program test_loc 10644 10645 10646File: gfortran.info, Node: LOG, Next: LOG10, Prev: LOC, Up: Intrinsic Procedures 10647 106488.153 `LOG' -- Natural logarithm function 10649========================================= 10650 10651_Description_: 10652 `LOG(X)' computes the natural logarithm of X, i.e. the logarithm 10653 to the base e. 10654 10655_Standard_: 10656 Fortran 77 and later 10657 10658_Class_: 10659 Elemental function 10660 10661_Syntax_: 10662 `RESULT = LOG(X)' 10663 10664_Arguments_: 10665 X The type shall be `REAL' or `COMPLEX'. 10666 10667_Return value_: 10668 The return value is of type `REAL' or `COMPLEX'. The kind type 10669 parameter is the same as X. If X is `COMPLEX', the imaginary part 10670 \omega is in the range -\pi \leq \omega \leq \pi. 10671 10672_Example_: 10673 program test_log 10674 real(8) :: x = 2.7182818284590451_8 10675 complex :: z = (1.0, 2.0) 10676 x = log(x) ! will yield (approximately) 1 10677 z = log(z) 10678 end program test_log 10679 10680_Specific names_: 10681 Name Argument Return type Standard 10682 `ALOG(X)' `REAL(4) X' `REAL(4)' f95, gnu 10683 `DLOG(X)' `REAL(8) X' `REAL(8)' f95, gnu 10684 `CLOG(X)' `COMPLEX(4) `COMPLEX(4)' f95, gnu 10685 X' 10686 `ZLOG(X)' `COMPLEX(8) `COMPLEX(8)' f95, gnu 10687 X' 10688 `CDLOG(X)' `COMPLEX(8) `COMPLEX(8)' f95, gnu 10689 X' 10690 10691 10692File: gfortran.info, Node: LOG10, Next: LOG_GAMMA, Prev: LOG, Up: Intrinsic Procedures 10693 106948.154 `LOG10' -- Base 10 logarithm function 10695=========================================== 10696 10697_Description_: 10698 `LOG10(X)' computes the base 10 logarithm of X. 10699 10700_Standard_: 10701 Fortran 77 and later 10702 10703_Class_: 10704 Elemental function 10705 10706_Syntax_: 10707 `RESULT = LOG10(X)' 10708 10709_Arguments_: 10710 X The type shall be `REAL'. 10711 10712_Return value_: 10713 The return value is of type `REAL' or `COMPLEX'. The kind type 10714 parameter is the same as X. 10715 10716_Example_: 10717 program test_log10 10718 real(8) :: x = 10.0_8 10719 x = log10(x) 10720 end program test_log10 10721 10722_Specific names_: 10723 Name Argument Return type Standard 10724 `ALOG10(X)' `REAL(4) X' `REAL(4)' Fortran 95 and 10725 later 10726 `DLOG10(X)' `REAL(8) X' `REAL(8)' Fortran 95 and 10727 later 10728 10729 10730File: gfortran.info, Node: LOG_GAMMA, Next: LOGICAL, Prev: LOG10, Up: Intrinsic Procedures 10731 107328.155 `LOG_GAMMA' -- Logarithm of the Gamma function 10733==================================================== 10734 10735_Description_: 10736 `LOG_GAMMA(X)' computes the natural logarithm of the absolute value 10737 of the Gamma (\Gamma) function. 10738 10739_Standard_: 10740 Fortran 2008 and later 10741 10742_Class_: 10743 Elemental function 10744 10745_Syntax_: 10746 `X = LOG_GAMMA(X)' 10747 10748_Arguments_: 10749 X Shall be of type `REAL' and neither zero nor a 10750 negative integer. 10751 10752_Return value_: 10753 The return value is of type `REAL' of the same kind as X. 10754 10755_Example_: 10756 program test_log_gamma 10757 real :: x = 1.0 10758 x = lgamma(x) ! returns 0.0 10759 end program test_log_gamma 10760 10761_Specific names_: 10762 Name Argument Return type Standard 10763 `LGAMMA(X)' `REAL(4) X' `REAL(4)' GNU Extension 10764 `ALGAMA(X)' `REAL(4) X' `REAL(4)' GNU Extension 10765 `DLGAMA(X)' `REAL(8) X' `REAL(8)' GNU Extension 10766 10767_See also_: 10768 Gamma function: *note GAMMA:: 10769 10770 10771 10772File: gfortran.info, Node: LOGICAL, Next: LONG, Prev: LOG_GAMMA, Up: Intrinsic Procedures 10773 107748.156 `LOGICAL' -- Convert to logical type 10775========================================== 10776 10777_Description_: 10778 Converts one kind of `LOGICAL' variable to another. 10779 10780_Standard_: 10781 Fortran 95 and later 10782 10783_Class_: 10784 Elemental function 10785 10786_Syntax_: 10787 `RESULT = LOGICAL(L [, KIND])' 10788 10789_Arguments_: 10790 L The type shall be `LOGICAL'. 10791 KIND (Optional) An `INTEGER' initialization 10792 expression indicating the kind parameter of 10793 the result. 10794 10795_Return value_: 10796 The return value is a `LOGICAL' value equal to L, with a kind 10797 corresponding to KIND, or of the default logical kind if KIND is 10798 not given. 10799 10800_See also_: 10801 *note INT::, *note REAL::, *note CMPLX:: 10802 10803 10804File: gfortran.info, Node: LONG, Next: LSHIFT, Prev: LOGICAL, Up: Intrinsic Procedures 10805 108068.157 `LONG' -- Convert to integer type 10807======================================= 10808 10809_Description_: 10810 Convert to a `KIND=4' integer type, which is the same size as a C 10811 `long' integer. This is equivalent to the standard `INT' 10812 intrinsic with an optional argument of `KIND=4', and is only 10813 included for backwards compatibility. 10814 10815_Standard_: 10816 GNU extension 10817 10818_Class_: 10819 Elemental function 10820 10821_Syntax_: 10822 `RESULT = LONG(A)' 10823 10824_Arguments_: 10825 A Shall be of type `INTEGER', `REAL', or 10826 `COMPLEX'. 10827 10828_Return value_: 10829 The return value is a `INTEGER(4)' variable. 10830 10831_See also_: 10832 *note INT::, *note INT2::, *note INT8:: 10833 10834 10835File: gfortran.info, Node: LSHIFT, Next: LSTAT, Prev: LONG, Up: Intrinsic Procedures 10836 108378.158 `LSHIFT' -- Left shift bits 10838================================= 10839 10840_Description_: 10841 `LSHIFT' returns a value corresponding to I with all of the bits 10842 shifted left by SHIFT places. If the absolute value of SHIFT is 10843 greater than `BIT_SIZE(I)', the value is undefined. Bits shifted 10844 out from the left end are lost; zeros are shifted in from the 10845 opposite end. 10846 10847 This function has been superseded by the `ISHFT' intrinsic, which 10848 is standard in Fortran 95 and later, and the `SHIFTL' intrinsic, 10849 which is standard in Fortran 2008 and later. 10850 10851_Standard_: 10852 GNU extension 10853 10854_Class_: 10855 Elemental function 10856 10857_Syntax_: 10858 `RESULT = LSHIFT(I, SHIFT)' 10859 10860_Arguments_: 10861 I The type shall be `INTEGER'. 10862 SHIFT The type shall be `INTEGER'. 10863 10864_Return value_: 10865 The return value is of type `INTEGER' and of the same kind as I. 10866 10867_See also_: 10868 *note ISHFT::, *note ISHFTC::, *note RSHIFT::, *note SHIFTA::, 10869 *note SHIFTL::, *note SHIFTR:: 10870 10871 10872 10873File: gfortran.info, Node: LSTAT, Next: LTIME, Prev: LSHIFT, Up: Intrinsic Procedures 10874 108758.159 `LSTAT' -- Get file status 10876================================ 10877 10878_Description_: 10879 `LSTAT' is identical to *note STAT::, except that if path is a 10880 symbolic link, then the link itself is statted, not the file that 10881 it refers to. 10882 10883 The elements in `VALUES' are the same as described by *note STAT::. 10884 10885 This intrinsic is provided in both subroutine and function forms; 10886 however, only one form can be used in any given program unit. 10887 10888_Standard_: 10889 GNU extension 10890 10891_Class_: 10892 Subroutine, function 10893 10894_Syntax_: 10895 `CALL LSTAT(NAME, VALUES [, STATUS])' 10896 `STATUS = LSTAT(NAME, VALUES)' 10897 10898_Arguments_: 10899 NAME The type shall be `CHARACTER' of the default 10900 kind, a valid path within the file system. 10901 VALUES The type shall be `INTEGER(4), DIMENSION(13)'. 10902 STATUS (Optional) status flag of type `INTEGER(4)'. 10903 Returns 0 on success and a system specific 10904 error code otherwise. 10905 10906_Example_: 10907 See *note STAT:: for an example. 10908 10909_See also_: 10910 To stat an open file: *note FSTAT::, to stat a file: *note STAT:: 10911 10912 10913File: gfortran.info, Node: LTIME, Next: MALLOC, Prev: LSTAT, Up: Intrinsic Procedures 10914 109158.160 `LTIME' -- Convert time to local time info 10916================================================ 10917 10918_Description_: 10919 Given a system time value TIME (as provided by the `TIME8' 10920 intrinsic), fills VALUES with values extracted from it appropriate 10921 to the local time zone using `localtime(3)'. 10922 10923_Standard_: 10924 GNU extension 10925 10926_Class_: 10927 Subroutine 10928 10929_Syntax_: 10930 `CALL LTIME(TIME, VALUES)' 10931 10932_Arguments_: 10933 TIME An `INTEGER' scalar expression corresponding 10934 to a system time, with `INTENT(IN)'. 10935 VALUES A default `INTEGER' array with 9 elements, 10936 with `INTENT(OUT)'. 10937 10938_Return value_: 10939 The elements of VALUES are assigned as follows: 10940 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap 10941 seconds 10942 10943 2. Minutes after the hour, range 0-59 10944 10945 3. Hours past midnight, range 0-23 10946 10947 4. Day of month, range 0-31 10948 10949 5. Number of months since January, range 0-12 10950 10951 6. Years since 1900 10952 10953 7. Number of days since Sunday, range 0-6 10954 10955 8. Days since January 1 10956 10957 9. Daylight savings indicator: positive if daylight savings is in 10958 effect, zero if not, and negative if the information is not 10959 available. 10960 10961_See also_: 10962 *note CTIME::, *note GMTIME::, *note TIME::, *note TIME8:: 10963 10964 10965 10966File: gfortran.info, Node: MALLOC, Next: MASKL, Prev: LTIME, Up: Intrinsic Procedures 10967 109688.161 `MALLOC' -- Allocate dynamic memory 10969========================================= 10970 10971_Description_: 10972 `MALLOC(SIZE)' allocates SIZE bytes of dynamic memory and returns 10973 the address of the allocated memory. The `MALLOC' intrinsic is an 10974 extension intended to be used with Cray pointers, and is provided 10975 in GNU Fortran to allow the user to compile legacy code. For new 10976 code using Fortran 95 pointers, the memory allocation intrinsic is 10977 `ALLOCATE'. 10978 10979_Standard_: 10980 GNU extension 10981 10982_Class_: 10983 Function 10984 10985_Syntax_: 10986 `PTR = MALLOC(SIZE)' 10987 10988_Arguments_: 10989 SIZE The type shall be `INTEGER'. 10990 10991_Return value_: 10992 The return value is of type `INTEGER(K)', with K such that 10993 variables of type `INTEGER(K)' have the same size as C pointers 10994 (`sizeof(void *)'). 10995 10996_Example_: 10997 The following example demonstrates the use of `MALLOC' and `FREE' 10998 with Cray pointers. 10999 11000 program test_malloc 11001 implicit none 11002 integer i 11003 real*8 x(*), z 11004 pointer(ptr_x,x) 11005 11006 ptr_x = malloc(20*8) 11007 do i = 1, 20 11008 x(i) = sqrt(1.0d0 / i) 11009 end do 11010 z = 0 11011 do i = 1, 20 11012 z = z + x(i) 11013 print *, z 11014 end do 11015 call free(ptr_x) 11016 end program test_malloc 11017 11018_See also_: 11019 *note FREE:: 11020 11021 11022File: gfortran.info, Node: MASKL, Next: MASKR, Prev: MALLOC, Up: Intrinsic Procedures 11023 110248.162 `MASKL' -- Left justified mask 11025==================================== 11026 11027_Description_: 11028 `MASKL(I[, KIND])' has its leftmost I bits set to 1, and the 11029 remaining bits set to 0. 11030 11031_Standard_: 11032 Fortran 2008 and later 11033 11034_Class_: 11035 Elemental function 11036 11037_Syntax_: 11038 `RESULT = MASKL(I[, KIND])' 11039 11040_Arguments_: 11041 I Shall be of type `INTEGER'. 11042 KIND Shall be a scalar constant expression of type 11043 `INTEGER'. 11044 11045_Return value_: 11046 The return value is of type `INTEGER'. If KIND is present, it 11047 specifies the kind value of the return type; otherwise, it is of 11048 the default integer kind. 11049 11050_See also_: 11051 *note MASKR:: 11052 11053 11054File: gfortran.info, Node: MASKR, Next: MATMUL, Prev: MASKL, Up: Intrinsic Procedures 11055 110568.163 `MASKR' -- Right justified mask 11057===================================== 11058 11059_Description_: 11060 `MASKL(I[, KIND])' has its rightmost I bits set to 1, and the 11061 remaining bits set to 0. 11062 11063_Standard_: 11064 Fortran 2008 and later 11065 11066_Class_: 11067 Elemental function 11068 11069_Syntax_: 11070 `RESULT = MASKR(I[, KIND])' 11071 11072_Arguments_: 11073 I Shall be of type `INTEGER'. 11074 KIND Shall be a scalar constant expression of type 11075 `INTEGER'. 11076 11077_Return value_: 11078 The return value is of type `INTEGER'. If KIND is present, it 11079 specifies the kind value of the return type; otherwise, it is of 11080 the default integer kind. 11081 11082_See also_: 11083 *note MASKL:: 11084 11085 11086File: gfortran.info, Node: MATMUL, Next: MAX, Prev: MASKR, Up: Intrinsic Procedures 11087 110888.164 `MATMUL' -- matrix multiplication 11089======================================= 11090 11091_Description_: 11092 Performs a matrix multiplication on numeric or logical arguments. 11093 11094_Standard_: 11095 Fortran 95 and later 11096 11097_Class_: 11098 Transformational function 11099 11100_Syntax_: 11101 `RESULT = MATMUL(MATRIX_A, MATRIX_B)' 11102 11103_Arguments_: 11104 MATRIX_A An array of `INTEGER', `REAL', `COMPLEX', or 11105 `LOGICAL' type, with a rank of one or two. 11106 MATRIX_B An array of `INTEGER', `REAL', or `COMPLEX' 11107 type if MATRIX_A is of a numeric type; 11108 otherwise, an array of `LOGICAL' type. The 11109 rank shall be one or two, and the first (or 11110 only) dimension of MATRIX_B shall be equal to 11111 the last (or only) dimension of MATRIX_A. 11112 11113_Return value_: 11114 The matrix product of MATRIX_A and MATRIX_B. The type and kind of 11115 the result follow the usual type and kind promotion rules, as for 11116 the `*' or `.AND.' operators. 11117 11118_See also_: 11119 11120 11121File: gfortran.info, Node: MAX, Next: MAXEXPONENT, Prev: MATMUL, Up: Intrinsic Procedures 11122 111238.165 `MAX' -- Maximum value of an argument list 11124================================================ 11125 11126_Description_: 11127 Returns the argument with the largest (most positive) value. 11128 11129_Standard_: 11130 Fortran 77 and later 11131 11132_Class_: 11133 Elemental function 11134 11135_Syntax_: 11136 `RESULT = MAX(A1, A2 [, A3 [, ...]])' 11137 11138_Arguments_: 11139 A1 The type shall be `INTEGER' or `REAL'. 11140 A2, A3, An expression of the same type and kind as A1. 11141 ... (As a GNU extension, arguments of different 11142 kinds are permitted.) 11143 11144_Return value_: 11145 The return value corresponds to the maximum value among the 11146 arguments, and has the same type and kind as the first argument. 11147 11148_Specific names_: 11149 Name Argument Return type Standard 11150 `MAX0(A1)' `INTEGER(4) `INTEGER(4)' Fortran 77 and 11151 A1' later 11152 `AMAX0(A1)' `INTEGER(4) `REAL(MAX(X))'Fortran 77 and 11153 A1' later 11154 `MAX1(A1)' `REAL A1' `INT(MAX(X))' Fortran 77 and 11155 later 11156 `AMAX1(A1)' `REAL(4) A1' `REAL(4)' Fortran 77 and 11157 later 11158 `DMAX1(A1)' `REAL(8) A1' `REAL(8)' Fortran 77 and 11159 later 11160 11161_See also_: 11162 *note MAXLOC:: *note MAXVAL::, *note MIN:: 11163 11164 11165 11166File: gfortran.info, Node: MAXEXPONENT, Next: MAXLOC, Prev: MAX, Up: Intrinsic Procedures 11167 111688.166 `MAXEXPONENT' -- Maximum exponent of a real kind 11169====================================================== 11170 11171_Description_: 11172 `MAXEXPONENT(X)' returns the maximum exponent in the model of the 11173 type of `X'. 11174 11175_Standard_: 11176 Fortran 95 and later 11177 11178_Class_: 11179 Inquiry function 11180 11181_Syntax_: 11182 `RESULT = MAXEXPONENT(X)' 11183 11184_Arguments_: 11185 X Shall be of type `REAL'. 11186 11187_Return value_: 11188 The return value is of type `INTEGER' and of the default integer 11189 kind. 11190 11191_Example_: 11192 program exponents 11193 real(kind=4) :: x 11194 real(kind=8) :: y 11195 11196 print *, minexponent(x), maxexponent(x) 11197 print *, minexponent(y), maxexponent(y) 11198 end program exponents 11199 11200 11201File: gfortran.info, Node: MAXLOC, Next: MAXVAL, Prev: MAXEXPONENT, Up: Intrinsic Procedures 11202 112038.167 `MAXLOC' -- Location of the maximum value within an array 11204=============================================================== 11205 11206_Description_: 11207 Determines the location of the element in the array with the 11208 maximum value, or, if the DIM argument is supplied, determines the 11209 locations of the maximum element along each row of the array in the 11210 DIM direction. If MASK is present, only the elements for which 11211 MASK is `.TRUE.' are considered. If more than one element in the 11212 array has the maximum value, the location returned is that of the 11213 first such element in array element order. If the array has zero 11214 size, or all of the elements of MASK are `.FALSE.', then the 11215 result is an array of zeroes. Similarly, if DIM is supplied and 11216 all of the elements of MASK along a given row are zero, the result 11217 value for that row is zero. 11218 11219_Standard_: 11220 Fortran 95 and later 11221 11222_Class_: 11223 Transformational function 11224 11225_Syntax_: 11226 `RESULT = MAXLOC(ARRAY, DIM [, MASK])' 11227 `RESULT = MAXLOC(ARRAY [, MASK])' 11228 11229_Arguments_: 11230 ARRAY Shall be an array of type `INTEGER' or `REAL'. 11231 DIM (Optional) Shall be a scalar of type 11232 `INTEGER', with a value between one and the 11233 rank of ARRAY, inclusive. It may not be an 11234 optional dummy argument. 11235 MASK Shall be an array of type `LOGICAL', and 11236 conformable with ARRAY. 11237 11238_Return value_: 11239 If DIM is absent, the result is a rank-one array with a length 11240 equal to the rank of ARRAY. If DIM is present, the result is an 11241 array with a rank one less than the rank of ARRAY, and a size 11242 corresponding to the size of ARRAY with the DIM dimension removed. 11243 If DIM is present and ARRAY has a rank of one, the result is a 11244 scalar. In all cases, the result is of default `INTEGER' type. 11245 11246_See also_: 11247 *note MAX::, *note MAXVAL:: 11248 11249 11250 11251File: gfortran.info, Node: MAXVAL, Next: MCLOCK, Prev: MAXLOC, Up: Intrinsic Procedures 11252 112538.168 `MAXVAL' -- Maximum value of an array 11254=========================================== 11255 11256_Description_: 11257 Determines the maximum value of the elements in an array value, 11258 or, if the DIM argument is supplied, determines the maximum value 11259 along each row of the array in the DIM direction. If MASK is 11260 present, only the elements for which MASK is `.TRUE.' are 11261 considered. If the array has zero size, or all of the elements of 11262 MASK are `.FALSE.', then the result is `-HUGE(ARRAY)' if ARRAY is 11263 numeric, or a string of nulls if ARRAY is of character type. 11264 11265_Standard_: 11266 Fortran 95 and later 11267 11268_Class_: 11269 Transformational function 11270 11271_Syntax_: 11272 `RESULT = MAXVAL(ARRAY, DIM [, MASK])' 11273 `RESULT = MAXVAL(ARRAY [, MASK])' 11274 11275_Arguments_: 11276 ARRAY Shall be an array of type `INTEGER' or `REAL'. 11277 DIM (Optional) Shall be a scalar of type 11278 `INTEGER', with a value between one and the 11279 rank of ARRAY, inclusive. It may not be an 11280 optional dummy argument. 11281 MASK Shall be an array of type `LOGICAL', and 11282 conformable with ARRAY. 11283 11284_Return value_: 11285 If DIM is absent, or if ARRAY has a rank of one, the result is a 11286 scalar. If DIM is present, the result is an array with a rank one 11287 less than the rank of ARRAY, and a size corresponding to the size 11288 of ARRAY with the DIM dimension removed. In all cases, the result 11289 is of the same type and kind as ARRAY. 11290 11291_See also_: 11292 *note MAX::, *note MAXLOC:: 11293 11294 11295File: gfortran.info, Node: MCLOCK, Next: MCLOCK8, Prev: MAXVAL, Up: Intrinsic Procedures 11296 112978.169 `MCLOCK' -- Time function 11298=============================== 11299 11300_Description_: 11301 Returns the number of clock ticks since the start of the process, 11302 based on the function `clock(3)' in the C standard library. 11303 11304 This intrinsic is not fully portable, such as to systems with 11305 32-bit `INTEGER' types but supporting times wider than 32 bits. 11306 Therefore, the values returned by this intrinsic might be, or 11307 become, negative, or numerically less than previous values, during 11308 a single run of the compiled program. 11309 11310_Standard_: 11311 GNU extension 11312 11313_Class_: 11314 Function 11315 11316_Syntax_: 11317 `RESULT = MCLOCK()' 11318 11319_Return value_: 11320 The return value is a scalar of type `INTEGER(4)', equal to the 11321 number of clock ticks since the start of the process, or `-1' if 11322 the system does not support `clock(3)'. 11323 11324_See also_: 11325 *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, 11326 *note TIME:: 11327 11328 11329 11330File: gfortran.info, Node: MCLOCK8, Next: MERGE, Prev: MCLOCK, Up: Intrinsic Procedures 11331 113328.170 `MCLOCK8' -- Time function (64-bit) 11333========================================= 11334 11335_Description_: 11336 Returns the number of clock ticks since the start of the process, 11337 based on the function `clock(3)' in the C standard library. 11338 11339 _Warning:_ this intrinsic does not increase the range of the timing 11340 values over that returned by `clock(3)'. On a system with a 32-bit 11341 `clock(3)', `MCLOCK8' will return a 32-bit value, even though it 11342 is converted to a 64-bit `INTEGER(8)' value. That means overflows 11343 of the 32-bit value can still occur. Therefore, the values 11344 returned by this intrinsic might be or become negative or 11345 numerically less than previous values during a single run of the 11346 compiled program. 11347 11348_Standard_: 11349 GNU extension 11350 11351_Class_: 11352 Function 11353 11354_Syntax_: 11355 `RESULT = MCLOCK8()' 11356 11357_Return value_: 11358 The return value is a scalar of type `INTEGER(8)', equal to the 11359 number of clock ticks since the start of the process, or `-1' if 11360 the system does not support `clock(3)'. 11361 11362_See also_: 11363 *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, 11364 *note TIME8:: 11365 11366 11367 11368File: gfortran.info, Node: MERGE, Next: MERGE_BITS, Prev: MCLOCK8, Up: Intrinsic Procedures 11369 113708.171 `MERGE' -- Merge variables 11371================================ 11372 11373_Description_: 11374 Select values from two arrays according to a logical mask. The 11375 result is equal to TSOURCE if MASK is `.TRUE.', or equal to 11376 FSOURCE if it is `.FALSE.'. 11377 11378_Standard_: 11379 Fortran 95 and later 11380 11381_Class_: 11382 Elemental function 11383 11384_Syntax_: 11385 `RESULT = MERGE(TSOURCE, FSOURCE, MASK)' 11386 11387_Arguments_: 11388 TSOURCE May be of any type. 11389 FSOURCE Shall be of the same type and type parameters 11390 as TSOURCE. 11391 MASK Shall be of type `LOGICAL'. 11392 11393_Return value_: 11394 The result is of the same type and type parameters as TSOURCE. 11395 11396 11397 11398File: gfortran.info, Node: MERGE_BITS, Next: MIN, Prev: MERGE, Up: Intrinsic Procedures 11399 114008.172 `MERGE_BITS' -- Merge of bits under mask 11401============================================== 11402 11403_Description_: 11404 `MERGE_BITS(I, J, MASK)' merges the bits of I and J as determined 11405 by the mask. The i-th bit of the result is equal to the i-th bit 11406 of I if the i-th bit of MASK is 1; it is equal to the i-th bit of 11407 J otherwise. 11408 11409_Standard_: 11410 Fortran 2008 and later 11411 11412_Class_: 11413 Elemental function 11414 11415_Syntax_: 11416 `RESULT = MERGE_BITS(I, J, MASK)' 11417 11418_Arguments_: 11419 I Shall be of type `INTEGER'. 11420 J Shall be of type `INTEGER' and of the same 11421 kind as I. 11422 MASK Shall be of type `INTEGER' and of the same 11423 kind as I. 11424 11425_Return value_: 11426 The result is of the same type and kind as I. 11427 11428 11429 11430File: gfortran.info, Node: MIN, Next: MINEXPONENT, Prev: MERGE_BITS, Up: Intrinsic Procedures 11431 114328.173 `MIN' -- Minimum value of an argument list 11433================================================ 11434 11435_Description_: 11436 Returns the argument with the smallest (most negative) value. 11437 11438_Standard_: 11439 Fortran 77 and later 11440 11441_Class_: 11442 Elemental function 11443 11444_Syntax_: 11445 `RESULT = MIN(A1, A2 [, A3, ...])' 11446 11447_Arguments_: 11448 A1 The type shall be `INTEGER' or `REAL'. 11449 A2, A3, An expression of the same type and kind as A1. 11450 ... (As a GNU extension, arguments of different 11451 kinds are permitted.) 11452 11453_Return value_: 11454 The return value corresponds to the maximum value among the 11455 arguments, and has the same type and kind as the first argument. 11456 11457_Specific names_: 11458 Name Argument Return type Standard 11459 `MIN0(A1)' `INTEGER(4) `INTEGER(4)' Fortran 77 and 11460 A1' later 11461 `AMIN0(A1)' `INTEGER(4) `REAL(4)' Fortran 77 and 11462 A1' later 11463 `MIN1(A1)' `REAL A1' `INTEGER(4)' Fortran 77 and 11464 later 11465 `AMIN1(A1)' `REAL(4) A1' `REAL(4)' Fortran 77 and 11466 later 11467 `DMIN1(A1)' `REAL(8) A1' `REAL(8)' Fortran 77 and 11468 later 11469 11470_See also_: 11471 *note MAX::, *note MINLOC::, *note MINVAL:: 11472 11473 11474File: gfortran.info, Node: MINEXPONENT, Next: MINLOC, Prev: MIN, Up: Intrinsic Procedures 11475 114768.174 `MINEXPONENT' -- Minimum exponent of a real kind 11477====================================================== 11478 11479_Description_: 11480 `MINEXPONENT(X)' returns the minimum exponent in the model of the 11481 type of `X'. 11482 11483_Standard_: 11484 Fortran 95 and later 11485 11486_Class_: 11487 Inquiry function 11488 11489_Syntax_: 11490 `RESULT = MINEXPONENT(X)' 11491 11492_Arguments_: 11493 X Shall be of type `REAL'. 11494 11495_Return value_: 11496 The return value is of type `INTEGER' and of the default integer 11497 kind. 11498 11499_Example_: 11500 See `MAXEXPONENT' for an example. 11501 11502 11503File: gfortran.info, Node: MINLOC, Next: MINVAL, Prev: MINEXPONENT, Up: Intrinsic Procedures 11504 115058.175 `MINLOC' -- Location of the minimum value within an array 11506=============================================================== 11507 11508_Description_: 11509 Determines the location of the element in the array with the 11510 minimum value, or, if the DIM argument is supplied, determines the 11511 locations of the minimum element along each row of the array in the 11512 DIM direction. If MASK is present, only the elements for which 11513 MASK is `.TRUE.' are considered. If more than one element in the 11514 array has the minimum value, the location returned is that of the 11515 first such element in array element order. If the array has zero 11516 size, or all of the elements of MASK are `.FALSE.', then the 11517 result is an array of zeroes. Similarly, if DIM is supplied and 11518 all of the elements of MASK along a given row are zero, the result 11519 value for that row is zero. 11520 11521_Standard_: 11522 Fortran 95 and later 11523 11524_Class_: 11525 Transformational function 11526 11527_Syntax_: 11528 `RESULT = MINLOC(ARRAY, DIM [, MASK])' 11529 `RESULT = MINLOC(ARRAY [, MASK])' 11530 11531_Arguments_: 11532 ARRAY Shall be an array of type `INTEGER' or `REAL'. 11533 DIM (Optional) Shall be a scalar of type 11534 `INTEGER', with a value between one and the 11535 rank of ARRAY, inclusive. It may not be an 11536 optional dummy argument. 11537 MASK Shall be an array of type `LOGICAL', and 11538 conformable with ARRAY. 11539 11540_Return value_: 11541 If DIM is absent, the result is a rank-one array with a length 11542 equal to the rank of ARRAY. If DIM is present, the result is an 11543 array with a rank one less than the rank of ARRAY, and a size 11544 corresponding to the size of ARRAY with the DIM dimension removed. 11545 If DIM is present and ARRAY has a rank of one, the result is a 11546 scalar. In all cases, the result is of default `INTEGER' type. 11547 11548_See also_: 11549 *note MIN::, *note MINVAL:: 11550 11551 11552 11553File: gfortran.info, Node: MINVAL, Next: MOD, Prev: MINLOC, Up: Intrinsic Procedures 11554 115558.176 `MINVAL' -- Minimum value of an array 11556=========================================== 11557 11558_Description_: 11559 Determines the minimum value of the elements in an array value, 11560 or, if the DIM argument is supplied, determines the minimum value 11561 along each row of the array in the DIM direction. If MASK is 11562 present, only the elements for which MASK is `.TRUE.' are 11563 considered. If the array has zero size, or all of the elements of 11564 MASK are `.FALSE.', then the result is `HUGE(ARRAY)' if ARRAY is 11565 numeric, or a string of `CHAR(255)' characters if ARRAY is of 11566 character type. 11567 11568_Standard_: 11569 Fortran 95 and later 11570 11571_Class_: 11572 Transformational function 11573 11574_Syntax_: 11575 `RESULT = MINVAL(ARRAY, DIM [, MASK])' 11576 `RESULT = MINVAL(ARRAY [, MASK])' 11577 11578_Arguments_: 11579 ARRAY Shall be an array of type `INTEGER' or `REAL'. 11580 DIM (Optional) Shall be a scalar of type 11581 `INTEGER', with a value between one and the 11582 rank of ARRAY, inclusive. It may not be an 11583 optional dummy argument. 11584 MASK Shall be an array of type `LOGICAL', and 11585 conformable with ARRAY. 11586 11587_Return value_: 11588 If DIM is absent, or if ARRAY has a rank of one, the result is a 11589 scalar. If DIM is present, the result is an array with a rank one 11590 less than the rank of ARRAY, and a size corresponding to the size 11591 of ARRAY with the DIM dimension removed. In all cases, the result 11592 is of the same type and kind as ARRAY. 11593 11594_See also_: 11595 *note MIN::, *note MINLOC:: 11596 11597 11598 11599File: gfortran.info, Node: MOD, Next: MODULO, Prev: MINVAL, Up: Intrinsic Procedures 11600 116018.177 `MOD' -- Remainder function 11602================================= 11603 11604_Description_: 11605 `MOD(A,P)' computes the remainder of the division of A by P. 11606 11607_Standard_: 11608 Fortran 77 and later 11609 11610_Class_: 11611 Elemental function 11612 11613_Syntax_: 11614 `RESULT = MOD(A, P)' 11615 11616_Arguments_: 11617 A Shall be a scalar of type `INTEGER' or `REAL'. 11618 P Shall be a scalar of the same type and kind as 11619 A and not equal to zero. 11620 11621_Return value_: 11622 The return value is the result of `A - (INT(A/P) * P)'. The type 11623 and kind of the return value is the same as that of the arguments. 11624 The returned value has the same sign as A and a magnitude less 11625 than the magnitude of P. 11626 11627_Example_: 11628 program test_mod 11629 print *, mod(17,3) 11630 print *, mod(17.5,5.5) 11631 print *, mod(17.5d0,5.5) 11632 print *, mod(17.5,5.5d0) 11633 11634 print *, mod(-17,3) 11635 print *, mod(-17.5,5.5) 11636 print *, mod(-17.5d0,5.5) 11637 print *, mod(-17.5,5.5d0) 11638 11639 print *, mod(17,-3) 11640 print *, mod(17.5,-5.5) 11641 print *, mod(17.5d0,-5.5) 11642 print *, mod(17.5,-5.5d0) 11643 end program test_mod 11644 11645_Specific names_: 11646 Name Arguments Return type Standard 11647 `MOD(A,P)' `INTEGER `INTEGER' Fortran 95 and 11648 A,P' later 11649 `AMOD(A,P)' `REAL(4) `REAL(4)' Fortran 95 and 11650 A,P' later 11651 `DMOD(A,P)' `REAL(8) `REAL(8)' Fortran 95 and 11652 A,P' later 11653 11654_See also_: 11655 *note MODULO:: 11656 11657 11658 11659File: gfortran.info, Node: MODULO, Next: MOVE_ALLOC, Prev: MOD, Up: Intrinsic Procedures 11660 116618.178 `MODULO' -- Modulo function 11662================================= 11663 11664_Description_: 11665 `MODULO(A,P)' computes the A modulo P. 11666 11667_Standard_: 11668 Fortran 95 and later 11669 11670_Class_: 11671 Elemental function 11672 11673_Syntax_: 11674 `RESULT = MODULO(A, P)' 11675 11676_Arguments_: 11677 A Shall be a scalar of type `INTEGER' or `REAL'. 11678 P Shall be a scalar of the same type and kind as 11679 A. It shall not be zero. 11680 11681_Return value_: 11682 The type and kind of the result are those of the arguments. 11683 If A and P are of type `INTEGER': 11684 `MODULO(A,P)' has the value R such that `A=Q*P+R', where Q is 11685 an integer and R is between 0 (inclusive) and P (exclusive). 11686 11687 If A and P are of type `REAL': 11688 `MODULO(A,P)' has the value of `A - FLOOR (A / P) * P'. 11689 The returned value has the same sign as P and a magnitude less than 11690 the magnitude of P. 11691 11692_Example_: 11693 program test_modulo 11694 print *, modulo(17,3) 11695 print *, modulo(17.5,5.5) 11696 11697 print *, modulo(-17,3) 11698 print *, modulo(-17.5,5.5) 11699 11700 print *, modulo(17,-3) 11701 print *, modulo(17.5,-5.5) 11702 end program 11703 11704_See also_: 11705 *note MOD:: 11706 11707 11708 11709File: gfortran.info, Node: MOVE_ALLOC, Next: MVBITS, Prev: MODULO, Up: Intrinsic Procedures 11710 117118.179 `MOVE_ALLOC' -- Move allocation from one object to another 11712================================================================ 11713 11714_Description_: 11715 `MOVE_ALLOC(FROM, TO)' moves the allocation from FROM to TO. FROM 11716 will become deallocated in the process. 11717 11718_Standard_: 11719 Fortran 2003 and later 11720 11721_Class_: 11722 Pure subroutine 11723 11724_Syntax_: 11725 `CALL MOVE_ALLOC(FROM, TO)' 11726 11727_Arguments_: 11728 FROM `ALLOCATABLE', `INTENT(INOUT)', may be of any 11729 type and kind. 11730 TO `ALLOCATABLE', `INTENT(OUT)', shall be of the 11731 same type, kind and rank as FROM. 11732 11733_Return value_: 11734 None 11735 11736_Example_: 11737 program test_move_alloc 11738 integer, allocatable :: a(:), b(:) 11739 11740 allocate(a(3)) 11741 a = [ 1, 2, 3 ] 11742 call move_alloc(a, b) 11743 print *, allocated(a), allocated(b) 11744 print *, b 11745 end program test_move_alloc 11746 11747 11748File: gfortran.info, Node: MVBITS, Next: NEAREST, Prev: MOVE_ALLOC, Up: Intrinsic Procedures 11749 117508.180 `MVBITS' -- Move bits from one integer to another 11751======================================================= 11752 11753_Description_: 11754 Moves LEN bits from positions FROMPOS through `FROMPOS+LEN-1' of 11755 FROM to positions TOPOS through `TOPOS+LEN-1' of TO. The portion 11756 of argument TO not affected by the movement of bits is unchanged. 11757 The values of `FROMPOS+LEN-1' and `TOPOS+LEN-1' must be less than 11758 `BIT_SIZE(FROM)'. 11759 11760_Standard_: 11761 Fortran 95 and later 11762 11763_Class_: 11764 Elemental subroutine 11765 11766_Syntax_: 11767 `CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)' 11768 11769_Arguments_: 11770 FROM The type shall be `INTEGER'. 11771 FROMPOS The type shall be `INTEGER'. 11772 LEN The type shall be `INTEGER'. 11773 TO The type shall be `INTEGER', of the same kind 11774 as FROM. 11775 TOPOS The type shall be `INTEGER'. 11776 11777_See also_: 11778 *note IBCLR::, *note IBSET::, *note IBITS::, *note IAND::, *note 11779 IOR::, *note IEOR:: 11780 11781 11782File: gfortran.info, Node: NEAREST, Next: NEW_LINE, Prev: MVBITS, Up: Intrinsic Procedures 11783 117848.181 `NEAREST' -- Nearest representable number 11785=============================================== 11786 11787_Description_: 11788 `NEAREST(X, S)' returns the processor-representable number nearest 11789 to `X' in the direction indicated by the sign of `S'. 11790 11791_Standard_: 11792 Fortran 95 and later 11793 11794_Class_: 11795 Elemental function 11796 11797_Syntax_: 11798 `RESULT = NEAREST(X, S)' 11799 11800_Arguments_: 11801 X Shall be of type `REAL'. 11802 S Shall be of type `REAL' and not equal to zero. 11803 11804_Return value_: 11805 The return value is of the same type as `X'. If `S' is positive, 11806 `NEAREST' returns the processor-representable number greater than 11807 `X' and nearest to it. If `S' is negative, `NEAREST' returns the 11808 processor-representable number smaller than `X' and nearest to it. 11809 11810_Example_: 11811 program test_nearest 11812 real :: x, y 11813 x = nearest(42.0, 1.0) 11814 y = nearest(42.0, -1.0) 11815 write (*,"(3(G20.15))") x, y, x - y 11816 end program test_nearest 11817 11818 11819File: gfortran.info, Node: NEW_LINE, Next: NINT, Prev: NEAREST, Up: Intrinsic Procedures 11820 118218.182 `NEW_LINE' -- New line character 11822====================================== 11823 11824_Description_: 11825 `NEW_LINE(C)' returns the new-line character. 11826 11827_Standard_: 11828 Fortran 2003 and later 11829 11830_Class_: 11831 Inquiry function 11832 11833_Syntax_: 11834 `RESULT = NEW_LINE(C)' 11835 11836_Arguments_: 11837 C The argument shall be a scalar or array of the 11838 type `CHARACTER'. 11839 11840_Return value_: 11841 Returns a CHARACTER scalar of length one with the new-line 11842 character of the same kind as parameter C. 11843 11844_Example_: 11845 program newline 11846 implicit none 11847 write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.' 11848 end program newline 11849 11850 11851File: gfortran.info, Node: NINT, Next: NORM2, Prev: NEW_LINE, Up: Intrinsic Procedures 11852 118538.183 `NINT' -- Nearest whole number 11854==================================== 11855 11856_Description_: 11857 `NINT(A)' rounds its argument to the nearest whole number. 11858 11859_Standard_: 11860 Fortran 77 and later, with KIND argument Fortran 90 and later 11861 11862_Class_: 11863 Elemental function 11864 11865_Syntax_: 11866 `RESULT = NINT(A [, KIND])' 11867 11868_Arguments_: 11869 A The type of the argument shall be `REAL'. 11870 KIND (Optional) An `INTEGER' initialization 11871 expression indicating the kind parameter of 11872 the result. 11873 11874_Return value_: 11875 Returns A with the fractional portion of its magnitude eliminated 11876 by rounding to the nearest whole number and with its sign 11877 preserved, converted to an `INTEGER' of the default kind. 11878 11879_Example_: 11880 program test_nint 11881 real(4) x4 11882 real(8) x8 11883 x4 = 1.234E0_4 11884 x8 = 4.321_8 11885 print *, nint(x4), idnint(x8) 11886 end program test_nint 11887 11888_Specific names_: 11889 Name Argument Return Type Standard 11890 `NINT(A)' `REAL(4) A' `INTEGER' Fortran 95 and 11891 later 11892 `IDNINT(A)' `REAL(8) A' `INTEGER' Fortran 95 and 11893 later 11894 11895_See also_: 11896 *note CEILING::, *note FLOOR:: 11897 11898 11899 11900File: gfortran.info, Node: NORM2, Next: NOT, Prev: NINT, Up: Intrinsic Procedures 11901 119028.184 `NORM2' -- Euclidean vector norms 11903======================================= 11904 11905_Description_: 11906 Calculates the Euclidean vector norm (L_2 norm) of of ARRAY along 11907 dimension DIM. 11908 11909_Standard_: 11910 Fortran 2008 and later 11911 11912_Class_: 11913 Transformational function 11914 11915_Syntax_: 11916 `RESULT = NORM2(ARRAY[, DIM])' 11917 11918_Arguments_: 11919 ARRAY Shall be an array of type `REAL' 11920 DIM (Optional) shall be a scalar of type `INTEGER' 11921 with a value in the range from 1 to n, where n 11922 equals the rank of ARRAY. 11923 11924_Return value_: 11925 The result is of the same type as ARRAY. 11926 11927 If DIM is absent, a scalar with the square root of the sum of all 11928 elements in ARRAY squared is returned. Otherwise, an array of 11929 rank n-1, where n equals the rank of ARRAY, and a shape similar to 11930 that of ARRAY with dimension DIM dropped is returned. 11931 11932_Example_: 11933 PROGRAM test_sum 11934 REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ] 11935 print *, NORM2(x) ! = sqrt(55.) ~ 7.416 11936 END PROGRAM 11937 11938 11939File: gfortran.info, Node: NOT, Next: NULL, Prev: NORM2, Up: Intrinsic Procedures 11940 119418.185 `NOT' -- Logical negation 11942=============================== 11943 11944_Description_: 11945 `NOT' returns the bitwise Boolean inverse of I. 11946 11947_Standard_: 11948 Fortran 95 and later 11949 11950_Class_: 11951 Elemental function 11952 11953_Syntax_: 11954 `RESULT = NOT(I)' 11955 11956_Arguments_: 11957 I The type shall be `INTEGER'. 11958 11959_Return value_: 11960 The return type is `INTEGER', of the same kind as the argument. 11961 11962_See also_: 11963 *note IAND::, *note IEOR::, *note IOR::, *note IBITS::, *note 11964 IBSET::, *note IBCLR:: 11965 11966 11967 11968File: gfortran.info, Node: NULL, Next: NUM_IMAGES, Prev: NOT, Up: Intrinsic Procedures 11969 119708.186 `NULL' -- Function that returns an disassociated pointer 11971============================================================== 11972 11973_Description_: 11974 Returns a disassociated pointer. 11975 11976 If MOLD is present, a disassociated pointer of the same type is 11977 returned, otherwise the type is determined by context. 11978 11979 In Fortran 95, MOLD is optional. Please note that Fortran 2003 11980 includes cases where it is required. 11981 11982_Standard_: 11983 Fortran 95 and later 11984 11985_Class_: 11986 Transformational function 11987 11988_Syntax_: 11989 `PTR => NULL([MOLD])' 11990 11991_Arguments_: 11992 MOLD (Optional) shall be a pointer of any 11993 association status and of any type. 11994 11995_Return value_: 11996 A disassociated pointer. 11997 11998_Example_: 11999 REAL, POINTER, DIMENSION(:) :: VEC => NULL () 12000 12001_See also_: 12002 *note ASSOCIATED:: 12003 12004 12005File: gfortran.info, Node: NUM_IMAGES, Next: OR, Prev: NULL, Up: Intrinsic Procedures 12006 120078.187 `NUM_IMAGES' -- Function that returns the number of images 12008================================================================ 12009 12010_Description_: 12011 Returns the number of images. 12012 12013_Standard_: 12014 Fortran 2008 and later 12015 12016_Class_: 12017 Transformational function 12018 12019_Syntax_: 12020 `RESULT = NUM_IMAGES()' 12021 12022_Arguments_: None. 12023 12024_Return value_: 12025 Scalar default-kind integer. 12026 12027_Example_: 12028 INTEGER :: value[*] 12029 INTEGER :: i 12030 value = THIS_IMAGE() 12031 SYNC ALL 12032 IF (THIS_IMAGE() == 1) THEN 12033 DO i = 1, NUM_IMAGES() 12034 WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i] 12035 END DO 12036 END IF 12037 12038_See also_: 12039 *note THIS_IMAGE::, *note IMAGE_INDEX:: 12040 12041 12042File: gfortran.info, Node: OR, Next: PACK, Prev: NUM_IMAGES, Up: Intrinsic Procedures 12043 120448.188 `OR' -- Bitwise logical OR 12045================================ 12046 12047_Description_: 12048 Bitwise logical `OR'. 12049 12050 This intrinsic routine is provided for backwards compatibility with 12051 GNU Fortran 77. For integer arguments, programmers should consider 12052 the use of the *note IOR:: intrinsic defined by the Fortran 12053 standard. 12054 12055_Standard_: 12056 GNU extension 12057 12058_Class_: 12059 Function 12060 12061_Syntax_: 12062 `RESULT = OR(I, J)' 12063 12064_Arguments_: 12065 I The type shall be either a scalar `INTEGER' 12066 type or a scalar `LOGICAL' type. 12067 J The type shall be the same as the type of J. 12068 12069_Return value_: 12070 The return type is either a scalar `INTEGER' or a scalar 12071 `LOGICAL'. If the kind type parameters differ, then the smaller 12072 kind type is implicitly converted to larger kind, and the return 12073 has the larger kind. 12074 12075_Example_: 12076 PROGRAM test_or 12077 LOGICAL :: T = .TRUE., F = .FALSE. 12078 INTEGER :: a, b 12079 DATA a / Z'F' /, b / Z'3' / 12080 12081 WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F) 12082 WRITE (*,*) OR(a, b) 12083 END PROGRAM 12084 12085_See also_: 12086 Fortran 95 elemental function: *note IOR:: 12087 12088 12089File: gfortran.info, Node: PACK, Next: PARITY, Prev: OR, Up: Intrinsic Procedures 12090 120918.189 `PACK' -- Pack an array into an array of rank one 12092======================================================= 12093 12094_Description_: 12095 Stores the elements of ARRAY in an array of rank one. 12096 12097 The beginning of the resulting array is made up of elements whose 12098 MASK equals `TRUE'. Afterwards, positions are filled with elements 12099 taken from VECTOR. 12100 12101_Standard_: 12102 Fortran 95 and later 12103 12104_Class_: 12105 Transformational function 12106 12107_Syntax_: 12108 `RESULT = PACK(ARRAY, MASK[,VECTOR]' 12109 12110_Arguments_: 12111 ARRAY Shall be an array of any type. 12112 MASK Shall be an array of type `LOGICAL' and of the 12113 same size as ARRAY. Alternatively, it may be a 12114 `LOGICAL' scalar. 12115 VECTOR (Optional) shall be an array of the same type 12116 as ARRAY and of rank one. If present, the 12117 number of elements in VECTOR shall be equal to 12118 or greater than the number of true elements in 12119 MASK. If MASK is scalar, the number of 12120 elements in VECTOR shall be equal to or 12121 greater than the number of elements in ARRAY. 12122 12123_Return value_: 12124 The result is an array of rank one and the same type as that of 12125 ARRAY. If VECTOR is present, the result size is that of VECTOR, 12126 the number of `TRUE' values in MASK otherwise. 12127 12128_Example_: 12129 Gathering nonzero elements from an array: 12130 PROGRAM test_pack_1 12131 INTEGER :: m(6) 12132 m = (/ 1, 0, 0, 0, 5, 0 /) 12133 WRITE(*, FMT="(6(I0, ' '))") pack(m, m /= 0) ! "1 5" 12134 END PROGRAM 12135 12136 Gathering nonzero elements from an array and appending elements 12137 from VECTOR: 12138 PROGRAM test_pack_2 12139 INTEGER :: m(4) 12140 m = (/ 1, 0, 0, 2 /) 12141 WRITE(*, FMT="(4(I0, ' '))") pack(m, m /= 0, (/ 0, 0, 3, 4 /)) ! "1 2 3 4" 12142 END PROGRAM 12143 12144_See also_: 12145 *note UNPACK:: 12146 12147 12148File: gfortran.info, Node: PARITY, Next: PERROR, Prev: PACK, Up: Intrinsic Procedures 12149 121508.190 `PARITY' -- Reduction with exclusive OR 12151============================================= 12152 12153_Description_: 12154 Calculates the parity, i.e. the reduction using `.XOR.', of MASK 12155 along dimension DIM. 12156 12157_Standard_: 12158 Fortran 2008 and later 12159 12160_Class_: 12161 Transformational function 12162 12163_Syntax_: 12164 `RESULT = PARITY(MASK[, DIM])' 12165 12166_Arguments_: 12167 LOGICAL Shall be an array of type `LOGICAL' 12168 DIM (Optional) shall be a scalar of type `INTEGER' 12169 with a value in the range from 1 to n, where n 12170 equals the rank of MASK. 12171 12172_Return value_: 12173 The result is of the same type as MASK. 12174 12175 If DIM is absent, a scalar with the parity of all elements in MASK 12176 is returned, i.e. true if an odd number of elements is `.true.' 12177 and false otherwise. If DIM is present, an array of rank n-1, 12178 where n equals the rank of ARRAY, and a shape similar to that of 12179 MASK with dimension DIM dropped is returned. 12180 12181_Example_: 12182 PROGRAM test_sum 12183 LOGICAL :: x(2) = [ .true., .false. ] 12184 print *, PARITY(x) ! prints "T" (true). 12185 END PROGRAM 12186 12187 12188File: gfortran.info, Node: PERROR, Next: POPCNT, Prev: PARITY, Up: Intrinsic Procedures 12189 121908.191 `PERROR' -- Print system error message 12191============================================ 12192 12193_Description_: 12194 Prints (on the C `stderr' stream) a newline-terminated error 12195 message corresponding to the last system error. This is prefixed by 12196 STRING, a colon and a space. See `perror(3)'. 12197 12198_Standard_: 12199 GNU extension 12200 12201_Class_: 12202 Subroutine 12203 12204_Syntax_: 12205 `CALL PERROR(STRING)' 12206 12207_Arguments_: 12208 STRING A scalar of type `CHARACTER' and of the 12209 default kind. 12210 12211_See also_: 12212 *note IERRNO:: 12213 12214 12215File: gfortran.info, Node: POPCNT, Next: POPPAR, Prev: PERROR, Up: Intrinsic Procedures 12216 122178.192 `POPCNT' -- Number of bits set 12218==================================== 12219 12220_Description_: 12221 `POPCNT(I)' returns the number of bits set ('1' bits) in the binary 12222 representation of `I'. 12223 12224_Standard_: 12225 Fortran 2008 and later 12226 12227_Class_: 12228 Elemental function 12229 12230_Syntax_: 12231 `RESULT = POPCNT(I)' 12232 12233_Arguments_: 12234 I Shall be of type `INTEGER'. 12235 12236_Return value_: 12237 The return value is of type `INTEGER' and of the default integer 12238 kind. 12239 12240_See also_: 12241 *note POPPAR::, *note LEADZ::, *note TRAILZ:: 12242 12243_Example_: 12244 program test_population 12245 print *, popcnt(127), poppar(127) 12246 print *, popcnt(huge(0_4)), poppar(huge(0_4)) 12247 print *, popcnt(huge(0_8)), poppar(huge(0_8)) 12248 end program test_population 12249 12250 12251File: gfortran.info, Node: POPPAR, Next: PRECISION, Prev: POPCNT, Up: Intrinsic Procedures 12252 122538.193 `POPPAR' -- Parity of the number of bits set 12254================================================== 12255 12256_Description_: 12257 `POPPAR(I)' returns parity of the integer `I', i.e. the parity of 12258 the number of bits set ('1' bits) in the binary representation of 12259 `I'. It is equal to 0 if `I' has an even number of bits set, and 1 12260 for an odd number of '1' bits. 12261 12262_Standard_: 12263 Fortran 2008 and later 12264 12265_Class_: 12266 Elemental function 12267 12268_Syntax_: 12269 `RESULT = POPPAR(I)' 12270 12271_Arguments_: 12272 I Shall be of type `INTEGER'. 12273 12274_Return value_: 12275 The return value is of type `INTEGER' and of the default integer 12276 kind. 12277 12278_See also_: 12279 *note POPCNT::, *note LEADZ::, *note TRAILZ:: 12280 12281_Example_: 12282 program test_population 12283 print *, popcnt(127), poppar(127) 12284 print *, popcnt(huge(0_4)), poppar(huge(0_4)) 12285 print *, popcnt(huge(0_8)), poppar(huge(0_8)) 12286 end program test_population 12287 12288 12289File: gfortran.info, Node: PRECISION, Next: PRESENT, Prev: POPPAR, Up: Intrinsic Procedures 12290 122918.194 `PRECISION' -- Decimal precision of a real kind 12292===================================================== 12293 12294_Description_: 12295 `PRECISION(X)' returns the decimal precision in the model of the 12296 type of `X'. 12297 12298_Standard_: 12299 Fortran 95 and later 12300 12301_Class_: 12302 Inquiry function 12303 12304_Syntax_: 12305 `RESULT = PRECISION(X)' 12306 12307_Arguments_: 12308 X Shall be of type `REAL' or `COMPLEX'. 12309 12310_Return value_: 12311 The return value is of type `INTEGER' and of the default integer 12312 kind. 12313 12314_See also_: 12315 *note SELECTED_REAL_KIND::, *note RANGE:: 12316 12317_Example_: 12318 program prec_and_range 12319 real(kind=4) :: x(2) 12320 complex(kind=8) :: y 12321 12322 print *, precision(x), range(x) 12323 print *, precision(y), range(y) 12324 end program prec_and_range 12325 12326 12327File: gfortran.info, Node: PRESENT, Next: PRODUCT, Prev: PRECISION, Up: Intrinsic Procedures 12328 123298.195 `PRESENT' -- Determine whether an optional dummy argument is specified 12330============================================================================ 12331 12332_Description_: 12333 Determines whether an optional dummy argument is present. 12334 12335_Standard_: 12336 Fortran 95 and later 12337 12338_Class_: 12339 Inquiry function 12340 12341_Syntax_: 12342 `RESULT = PRESENT(A)' 12343 12344_Arguments_: 12345 A May be of any type and may be a pointer, 12346 scalar or array value, or a dummy procedure. 12347 It shall be the name of an optional dummy 12348 argument accessible within the current 12349 subroutine or function. 12350 12351_Return value_: 12352 Returns either `TRUE' if the optional argument A is present, or 12353 `FALSE' otherwise. 12354 12355_Example_: 12356 PROGRAM test_present 12357 WRITE(*,*) f(), f(42) ! "F T" 12358 CONTAINS 12359 LOGICAL FUNCTION f(x) 12360 INTEGER, INTENT(IN), OPTIONAL :: x 12361 f = PRESENT(x) 12362 END FUNCTION 12363 END PROGRAM 12364 12365 12366File: gfortran.info, Node: PRODUCT, Next: RADIX, Prev: PRESENT, Up: Intrinsic Procedures 12367 123688.196 `PRODUCT' -- Product of array elements 12369============================================ 12370 12371_Description_: 12372 Multiplies the elements of ARRAY along dimension DIM if the 12373 corresponding element in MASK is `TRUE'. 12374 12375_Standard_: 12376 Fortran 95 and later 12377 12378_Class_: 12379 Transformational function 12380 12381_Syntax_: 12382 `RESULT = PRODUCT(ARRAY[, MASK])' 12383 `RESULT = PRODUCT(ARRAY, DIM[, MASK])' 12384 12385_Arguments_: 12386 ARRAY Shall be an array of type `INTEGER', `REAL' or 12387 `COMPLEX'. 12388 DIM (Optional) shall be a scalar of type `INTEGER' 12389 with a value in the range from 1 to n, where n 12390 equals the rank of ARRAY. 12391 MASK (Optional) shall be of type `LOGICAL' and 12392 either be a scalar or an array of the same 12393 shape as ARRAY. 12394 12395_Return value_: 12396 The result is of the same type as ARRAY. 12397 12398 If DIM is absent, a scalar with the product of all elements in 12399 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 12400 the rank of ARRAY, and a shape similar to that of ARRAY with 12401 dimension DIM dropped is returned. 12402 12403_Example_: 12404 PROGRAM test_product 12405 INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /) 12406 print *, PRODUCT(x) ! all elements, product = 120 12407 print *, PRODUCT(x, MASK=MOD(x, 2)==1) ! odd elements, product = 15 12408 END PROGRAM 12409 12410_See also_: 12411 *note SUM:: 12412 12413 12414File: gfortran.info, Node: RADIX, Next: RAN, Prev: PRODUCT, Up: Intrinsic Procedures 12415 124168.197 `RADIX' -- Base of a model number 12417======================================= 12418 12419_Description_: 12420 `RADIX(X)' returns the base of the model representing the entity X. 12421 12422_Standard_: 12423 Fortran 95 and later 12424 12425_Class_: 12426 Inquiry function 12427 12428_Syntax_: 12429 `RESULT = RADIX(X)' 12430 12431_Arguments_: 12432 X Shall be of type `INTEGER' or `REAL' 12433 12434_Return value_: 12435 The return value is a scalar of type `INTEGER' and of the default 12436 integer kind. 12437 12438_See also_: 12439 *note SELECTED_REAL_KIND:: 12440 12441_Example_: 12442 program test_radix 12443 print *, "The radix for the default integer kind is", radix(0) 12444 print *, "The radix for the default real kind is", radix(0.0) 12445 end program test_radix 12446 12447 12448 12449File: gfortran.info, Node: RAN, Next: RAND, Prev: RADIX, Up: Intrinsic Procedures 12450 124518.198 `RAN' -- Real pseudo-random number 12452======================================== 12453 12454_Description_: 12455 For compatibility with HP FORTRAN 77/iX, the `RAN' intrinsic is 12456 provided as an alias for `RAND'. See *note RAND:: for complete 12457 documentation. 12458 12459_Standard_: 12460 GNU extension 12461 12462_Class_: 12463 Function 12464 12465_See also_: 12466 *note RAND::, *note RANDOM_NUMBER:: 12467 12468 12469File: gfortran.info, Node: RAND, Next: RANDOM_NUMBER, Prev: RAN, Up: Intrinsic Procedures 12470 124718.199 `RAND' -- Real pseudo-random number 12472========================================= 12473 12474_Description_: 12475 `RAND(FLAG)' returns a pseudo-random number from a uniform 12476 distribution between 0 and 1. If FLAG is 0, the next number in the 12477 current sequence is returned; if FLAG is 1, the generator is 12478 restarted by `CALL SRAND(0)'; if FLAG has any other value, it is 12479 used as a new seed with `SRAND'. 12480 12481 This intrinsic routine is provided for backwards compatibility with 12482 GNU Fortran 77. It implements a simple modulo generator as provided 12483 by `g77'. For new code, one should consider the use of *note 12484 RANDOM_NUMBER:: as it implements a superior algorithm. 12485 12486_Standard_: 12487 GNU extension 12488 12489_Class_: 12490 Function 12491 12492_Syntax_: 12493 `RESULT = RAND(I)' 12494 12495_Arguments_: 12496 I Shall be a scalar `INTEGER' of kind 4. 12497 12498_Return value_: 12499 The return value is of `REAL' type and the default kind. 12500 12501_Example_: 12502 program test_rand 12503 integer,parameter :: seed = 86456 12504 12505 call srand(seed) 12506 print *, rand(), rand(), rand(), rand() 12507 print *, rand(seed), rand(), rand(), rand() 12508 end program test_rand 12509 12510_See also_: 12511 *note SRAND::, *note RANDOM_NUMBER:: 12512 12513 12514 12515File: gfortran.info, Node: RANDOM_NUMBER, Next: RANDOM_SEED, Prev: RAND, Up: Intrinsic Procedures 12516 125178.200 `RANDOM_NUMBER' -- Pseudo-random number 12518============================================= 12519 12520_Description_: 12521 Returns a single pseudorandom number or an array of pseudorandom 12522 numbers from the uniform distribution over the range 0 \leq x < 1. 12523 12524 The runtime-library implements George Marsaglia's KISS (Keep It 12525 Simple Stupid) random number generator (RNG). This RNG combines: 12526 1. The congruential generator x(n) = 69069 \cdot x(n-1) + 12527 1327217885 with a period of 2^32, 12528 12529 2. A 3-shift shift-register generator with a period of 2^32 - 1, 12530 12531 3. Two 16-bit multiply-with-carry generators with a period of 12532 597273182964842497 > 2^59. 12533 The overall period exceeds 2^123. 12534 12535 Please note, this RNG is thread safe if used within OpenMP 12536 directives, i.e., its state will be consistent while called from 12537 multiple threads. However, the KISS generator does not create 12538 random numbers in parallel from multiple sources, but in sequence 12539 from a single source. If an OpenMP-enabled application heavily 12540 relies on random numbers, one should consider employing a 12541 dedicated parallel random number generator instead. 12542 12543_Standard_: 12544 Fortran 95 and later 12545 12546_Class_: 12547 Subroutine 12548 12549_Syntax_: 12550 `RANDOM_NUMBER(HARVEST)' 12551 12552_Arguments_: 12553 HARVEST Shall be a scalar or an array of type `REAL'. 12554 12555_Example_: 12556 program test_random_number 12557 REAL :: r(5,5) 12558 CALL init_random_seed() ! see example of RANDOM_SEED 12559 CALL RANDOM_NUMBER(r) 12560 end program 12561 12562_See also_: 12563 *note RANDOM_SEED:: 12564 12565 12566File: gfortran.info, Node: RANDOM_SEED, Next: RANGE, Prev: RANDOM_NUMBER, Up: Intrinsic Procedures 12567 125688.201 `RANDOM_SEED' -- Initialize a pseudo-random number sequence 12569================================================================= 12570 12571_Description_: 12572 Restarts or queries the state of the pseudorandom number generator 12573 used by `RANDOM_NUMBER'. 12574 12575 If `RANDOM_SEED' is called without arguments, it is initialized to 12576 a default state. The example below shows how to initialize the 12577 random seed with a varying seed in order to ensure a different 12578 random number sequence for each invocation of the program. Note 12579 that setting any of the seed values to zero should be avoided as 12580 it can result in poor quality random numbers being generated. 12581 12582_Standard_: 12583 Fortran 95 and later 12584 12585_Class_: 12586 Subroutine 12587 12588_Syntax_: 12589 `CALL RANDOM_SEED([SIZE, PUT, GET])' 12590 12591_Arguments_: 12592 SIZE (Optional) Shall be a scalar and of type 12593 default `INTEGER', with `INTENT(OUT)'. It 12594 specifies the minimum size of the arrays used 12595 with the PUT and GET arguments. 12596 PUT (Optional) Shall be an array of type default 12597 `INTEGER' and rank one. It is `INTENT(IN)' and 12598 the size of the array must be larger than or 12599 equal to the number returned by the SIZE 12600 argument. 12601 GET (Optional) Shall be an array of type default 12602 `INTEGER' and rank one. It is `INTENT(OUT)' 12603 and the size of the array must be larger than 12604 or equal to the number returned by the SIZE 12605 argument. 12606 12607_Example_: 12608 subroutine init_random_seed() 12609 implicit none 12610 integer, allocatable :: seed(:) 12611 integer :: i, n, un, istat, dt(8), pid, t(2), s 12612 integer(8) :: count, tms 12613 12614 call random_seed(size = n) 12615 allocate(seed(n)) 12616 ! First try if the OS provides a random number generator 12617 open(newunit=un, file="/dev/urandom", access="stream", & 12618 form="unformatted", action="read", status="old", iostat=istat) 12619 if (istat == 0) then 12620 read(un) seed 12621 close(un) 12622 else 12623 ! Fallback to XOR:ing the current time and pid. The PID is 12624 ! useful in case one launches multiple instances of the same 12625 ! program in parallel. 12626 call system_clock(count) 12627 if (count /= 0) then 12628 t = transfer(count, t) 12629 else 12630 call date_and_time(values=dt) 12631 tms = (dt(1) - 1970) * 365_8 * 24 * 60 * 60 * 1000 & 12632 + dt(2) * 31_8 * 24 * 60 * 60 * 1000 & 12633 + dt(3) * 24 * 60 * 60 * 60 * 1000 & 12634 + dt(5) * 60 * 60 * 1000 & 12635 + dt(6) * 60 * 1000 + dt(7) * 1000 & 12636 + dt(8) 12637 t = transfer(tms, t) 12638 end if 12639 s = ieor(t(1), t(2)) 12640 pid = getpid() + 1099279 ! Add a prime 12641 s = ieor(s, pid) 12642 if (n >= 3) then 12643 seed(1) = t(1) + 36269 12644 seed(2) = t(2) + 72551 12645 seed(3) = pid 12646 if (n > 3) then 12647 seed(4:) = s + 37 * (/ (i, i = 0, n - 4) /) 12648 end if 12649 else 12650 seed = s + 37 * (/ (i, i = 0, n - 1 ) /) 12651 end if 12652 end if 12653 call random_seed(put=seed) 12654 end subroutine init_random_seed 12655 12656_See also_: 12657 *note RANDOM_NUMBER:: 12658 12659 12660File: gfortran.info, Node: RANGE, Next: RANK, Prev: RANDOM_SEED, Up: Intrinsic Procedures 12661 126628.202 `RANGE' -- Decimal exponent range 12663======================================= 12664 12665_Description_: 12666 `RANGE(X)' returns the decimal exponent range in the model of the 12667 type of `X'. 12668 12669_Standard_: 12670 Fortran 95 and later 12671 12672_Class_: 12673 Inquiry function 12674 12675_Syntax_: 12676 `RESULT = RANGE(X)' 12677 12678_Arguments_: 12679 X Shall be of type `INTEGER', `REAL' or 12680 `COMPLEX'. 12681 12682_Return value_: 12683 The return value is of type `INTEGER' and of the default integer 12684 kind. 12685 12686_See also_: 12687 *note SELECTED_REAL_KIND::, *note PRECISION:: 12688 12689_Example_: 12690 See `PRECISION' for an example. 12691 12692 12693File: gfortran.info, Node: RANK, Next: REAL, Prev: RANGE, Up: Intrinsic Procedures 12694 126958.203 `RANK' -- Rank of a data object 12696===================================== 12697 12698_Description_: 12699 `RANK(A)' returns the rank of a scalar or array data object. 12700 12701_Standard_: 12702 Technical Specification (TS) 29113 12703 12704_Class_: 12705 Inquiry function 12706 12707_Syntax_: 12708 `RESULT = RANGE(A)' 12709 12710_Arguments_: 12711 A can be of any type 12712 12713_Return value_: 12714 The return value is of type `INTEGER' and of the default integer 12715 kind. For arrays, their rank is returned; for scalars zero is 12716 returned. 12717 12718_Example_: 12719 program test_rank 12720 integer :: a 12721 real, allocatable :: b(:,:) 12722 12723 print *, rank(a), rank(b) ! Prints: 0 3 12724 end program test_rank 12725 12726 12727 12728File: gfortran.info, Node: REAL, Next: RENAME, Prev: RANK, Up: Intrinsic Procedures 12729 127308.204 `REAL' -- Convert to real type 12731==================================== 12732 12733_Description_: 12734 `REAL(A [, KIND])' converts its argument A to a real type. The 12735 `REALPART' function is provided for compatibility with `g77', and 12736 its use is strongly discouraged. 12737 12738_Standard_: 12739 Fortran 77 and later 12740 12741_Class_: 12742 Elemental function 12743 12744_Syntax_: 12745 `RESULT = REAL(A [, KIND])' 12746 `RESULT = REALPART(Z)' 12747 12748_Arguments_: 12749 A Shall be `INTEGER', `REAL', or `COMPLEX'. 12750 KIND (Optional) An `INTEGER' initialization 12751 expression indicating the kind parameter of 12752 the result. 12753 12754_Return value_: 12755 These functions return a `REAL' variable or array under the 12756 following rules: 12757 12758 (A) 12759 `REAL(A)' is converted to a default real type if A is an 12760 integer or real variable. 12761 12762 (B) 12763 `REAL(A)' is converted to a real type with the kind type 12764 parameter of A if A is a complex variable. 12765 12766 (C) 12767 `REAL(A, KIND)' is converted to a real type with kind type 12768 parameter KIND if A is a complex, integer, or real variable. 12769 12770_Example_: 12771 program test_real 12772 complex :: x = (1.0, 2.0) 12773 print *, real(x), real(x,8), realpart(x) 12774 end program test_real 12775 12776_Specific names_: 12777 Name Argument Return type Standard 12778 `FLOAT(A)' `INTEGER(4)' `REAL(4)' Fortran 77 and 12779 later 12780 `DFLOAT(A)' `INTEGER(4)' `REAL(8)' GNU extension 12781 `SNGL(A)' `INTEGER(8)' `REAL(4)' Fortran 77 and 12782 later 12783 12784_See also_: 12785 *note DBLE:: 12786 12787 12788 12789File: gfortran.info, Node: RENAME, Next: REPEAT, Prev: REAL, Up: Intrinsic Procedures 12790 127918.205 `RENAME' -- Rename a file 12792=============================== 12793 12794_Description_: 12795 Renames a file from file PATH1 to PATH2. A null character 12796 (`CHAR(0)') can be used to mark the end of the names in PATH1 and 12797 PATH2; otherwise, trailing blanks in the file names are ignored. 12798 If the STATUS argument is supplied, it contains 0 on success or a 12799 nonzero error code upon return; see `rename(2)'. 12800 12801 This intrinsic is provided in both subroutine and function forms; 12802 however, only one form can be used in any given program unit. 12803 12804_Standard_: 12805 GNU extension 12806 12807_Class_: 12808 Subroutine, function 12809 12810_Syntax_: 12811 `CALL RENAME(PATH1, PATH2 [, STATUS])' 12812 `STATUS = RENAME(PATH1, PATH2)' 12813 12814_Arguments_: 12815 PATH1 Shall be of default `CHARACTER' type. 12816 PATH2 Shall be of default `CHARACTER' type. 12817 STATUS (Optional) Shall be of default `INTEGER' type. 12818 12819_See also_: 12820 *note LINK:: 12821 12822 12823 12824File: gfortran.info, Node: REPEAT, Next: RESHAPE, Prev: RENAME, Up: Intrinsic Procedures 12825 128268.206 `REPEAT' -- Repeated string concatenation 12827=============================================== 12828 12829_Description_: 12830 Concatenates NCOPIES copies of a string. 12831 12832_Standard_: 12833 Fortran 95 and later 12834 12835_Class_: 12836 Transformational function 12837 12838_Syntax_: 12839 `RESULT = REPEAT(STRING, NCOPIES)' 12840 12841_Arguments_: 12842 STRING Shall be scalar and of type `CHARACTER'. 12843 NCOPIES Shall be scalar and of type `INTEGER'. 12844 12845_Return value_: 12846 A new scalar of type `CHARACTER' built up from NCOPIES copies of 12847 STRING. 12848 12849_Example_: 12850 program test_repeat 12851 write(*,*) repeat("x", 5) ! "xxxxx" 12852 end program 12853 12854 12855File: gfortran.info, Node: RESHAPE, Next: RRSPACING, Prev: REPEAT, Up: Intrinsic Procedures 12856 128578.207 `RESHAPE' -- Function to reshape an array 12858=============================================== 12859 12860_Description_: 12861 Reshapes SOURCE to correspond to SHAPE. If necessary, the new 12862 array may be padded with elements from PAD or permuted as defined 12863 by ORDER. 12864 12865_Standard_: 12866 Fortran 95 and later 12867 12868_Class_: 12869 Transformational function 12870 12871_Syntax_: 12872 `RESULT = RESHAPE(SOURCE, SHAPE[, PAD, ORDER])' 12873 12874_Arguments_: 12875 SOURCE Shall be an array of any type. 12876 SHAPE Shall be of type `INTEGER' and an array of 12877 rank one. Its values must be positive or zero. 12878 PAD (Optional) shall be an array of the same type 12879 as SOURCE. 12880 ORDER (Optional) shall be of type `INTEGER' and an 12881 array of the same shape as SHAPE. Its values 12882 shall be a permutation of the numbers from 1 12883 to n, where n is the size of SHAPE. If ORDER 12884 is absent, the natural ordering shall be 12885 assumed. 12886 12887_Return value_: 12888 The result is an array of shape SHAPE with the same type as SOURCE. 12889 12890_Example_: 12891 PROGRAM test_reshape 12892 INTEGER, DIMENSION(4) :: x 12893 WRITE(*,*) SHAPE(x) ! prints "4" 12894 WRITE(*,*) SHAPE(RESHAPE(x, (/2, 2/))) ! prints "2 2" 12895 END PROGRAM 12896 12897_See also_: 12898 *note SHAPE:: 12899 12900 12901File: gfortran.info, Node: RRSPACING, Next: RSHIFT, Prev: RESHAPE, Up: Intrinsic Procedures 12902 129038.208 `RRSPACING' -- Reciprocal of the relative spacing 12904======================================================= 12905 12906_Description_: 12907 `RRSPACING(X)' returns the reciprocal of the relative spacing of 12908 model numbers near X. 12909 12910_Standard_: 12911 Fortran 95 and later 12912 12913_Class_: 12914 Elemental function 12915 12916_Syntax_: 12917 `RESULT = RRSPACING(X)' 12918 12919_Arguments_: 12920 X Shall be of type `REAL'. 12921 12922_Return value_: 12923 The return value is of the same type and kind as X. The value 12924 returned is equal to `ABS(FRACTION(X)) * 12925 FLOAT(RADIX(X))**DIGITS(X)'. 12926 12927_See also_: 12928 *note SPACING:: 12929 12930 12931File: gfortran.info, Node: RSHIFT, Next: SAME_TYPE_AS, Prev: RRSPACING, Up: Intrinsic Procedures 12932 129338.209 `RSHIFT' -- Right shift bits 12934================================== 12935 12936_Description_: 12937 `RSHIFT' returns a value corresponding to I with all of the bits 12938 shifted right by SHIFT places. If the absolute value of SHIFT is 12939 greater than `BIT_SIZE(I)', the value is undefined. Bits shifted 12940 out from the right end are lost. The fill is arithmetic: the bits 12941 shifted in from the left end are equal to the leftmost bit, which 12942 in two's complement representation is the sign bit. 12943 12944 This function has been superseded by the `SHIFTA' intrinsic, which 12945 is standard in Fortran 2008 and later. 12946 12947_Standard_: 12948 GNU extension 12949 12950_Class_: 12951 Elemental function 12952 12953_Syntax_: 12954 `RESULT = RSHIFT(I, SHIFT)' 12955 12956_Arguments_: 12957 I The type shall be `INTEGER'. 12958 SHIFT The type shall be `INTEGER'. 12959 12960_Return value_: 12961 The return value is of type `INTEGER' and of the same kind as I. 12962 12963_See also_: 12964 *note ISHFT::, *note ISHFTC::, *note LSHIFT::, *note SHIFTA::, 12965 *note SHIFTR::, *note SHIFTL:: 12966 12967 12968 12969File: gfortran.info, Node: SAME_TYPE_AS, Next: SCALE, Prev: RSHIFT, Up: Intrinsic Procedures 12970 129718.210 `SAME_TYPE_AS' -- Query dynamic types for equality 12972========================================================= 12973 12974_Description_: 12975 Query dynamic types for equality. 12976 12977_Standard_: 12978 Fortran 2003 and later 12979 12980_Class_: 12981 Inquiry function 12982 12983_Syntax_: 12984 `RESULT = SAME_TYPE_AS(A, B)' 12985 12986_Arguments_: 12987 A Shall be an object of extensible declared type 12988 or unlimited polymorphic. 12989 B Shall be an object of extensible declared type 12990 or unlimited polymorphic. 12991 12992_Return value_: 12993 The return value is a scalar of type default logical. It is true 12994 if and only if the dynamic type of A is the same as the dynamic 12995 type of B. 12996 12997_See also_: 12998 *note EXTENDS_TYPE_OF:: 12999 13000 13001 13002File: gfortran.info, Node: SCALE, Next: SCAN, Prev: SAME_TYPE_AS, Up: Intrinsic Procedures 13003 130048.211 `SCALE' -- Scale a real value 13005=================================== 13006 13007_Description_: 13008 `SCALE(X,I)' returns `X * RADIX(X)**I'. 13009 13010_Standard_: 13011 Fortran 95 and later 13012 13013_Class_: 13014 Elemental function 13015 13016_Syntax_: 13017 `RESULT = SCALE(X, I)' 13018 13019_Arguments_: 13020 X The type of the argument shall be a `REAL'. 13021 I The type of the argument shall be a `INTEGER'. 13022 13023_Return value_: 13024 The return value is of the same type and kind as X. Its value is 13025 `X * RADIX(X)**I'. 13026 13027_Example_: 13028 program test_scale 13029 real :: x = 178.1387e-4 13030 integer :: i = 5 13031 print *, scale(x,i), x*radix(x)**i 13032 end program test_scale 13033 13034 13035 13036File: gfortran.info, Node: SCAN, Next: SECNDS, Prev: SCALE, Up: Intrinsic Procedures 13037 130388.212 `SCAN' -- Scan a string for the presence of a set of characters 13039===================================================================== 13040 13041_Description_: 13042 Scans a STRING for any of the characters in a SET of characters. 13043 13044 If BACK is either absent or equals `FALSE', this function returns 13045 the position of the leftmost character of STRING that is in SET. 13046 If BACK equals `TRUE', the rightmost position is returned. If no 13047 character of SET is found in STRING, the result is zero. 13048 13049_Standard_: 13050 Fortran 95 and later, with KIND argument Fortran 2003 and later 13051 13052_Class_: 13053 Elemental function 13054 13055_Syntax_: 13056 `RESULT = SCAN(STRING, SET[, BACK [, KIND]])' 13057 13058_Arguments_: 13059 STRING Shall be of type `CHARACTER'. 13060 SET Shall be of type `CHARACTER'. 13061 BACK (Optional) shall be of type `LOGICAL'. 13062 KIND (Optional) An `INTEGER' initialization 13063 expression indicating the kind parameter of 13064 the result. 13065 13066_Return value_: 13067 The return value is of type `INTEGER' and of kind KIND. If KIND is 13068 absent, the return value is of default integer kind. 13069 13070_Example_: 13071 PROGRAM test_scan 13072 WRITE(*,*) SCAN("FORTRAN", "AO") ! 2, found 'O' 13073 WRITE(*,*) SCAN("FORTRAN", "AO", .TRUE.) ! 6, found 'A' 13074 WRITE(*,*) SCAN("FORTRAN", "C++") ! 0, found none 13075 END PROGRAM 13076 13077_See also_: 13078 *note INDEX intrinsic::, *note VERIFY:: 13079 13080 13081File: gfortran.info, Node: SECNDS, Next: SECOND, Prev: SCAN, Up: Intrinsic Procedures 13082 130838.213 `SECNDS' -- Time function 13084=============================== 13085 13086_Description_: 13087 `SECNDS(X)' gets the time in seconds from the real-time system 13088 clock. X is a reference time, also in seconds. If this is zero, 13089 the time in seconds from midnight is returned. This function is 13090 non-standard and its use is discouraged. 13091 13092_Standard_: 13093 GNU extension 13094 13095_Class_: 13096 Function 13097 13098_Syntax_: 13099 `RESULT = SECNDS (X)' 13100 13101_Arguments_: 13102 T Shall be of type `REAL(4)'. 13103 X Shall be of type `REAL(4)'. 13104 13105_Return value_: 13106 None 13107 13108_Example_: 13109 program test_secnds 13110 integer :: i 13111 real(4) :: t1, t2 13112 print *, secnds (0.0) ! seconds since midnight 13113 t1 = secnds (0.0) ! reference time 13114 do i = 1, 10000000 ! do something 13115 end do 13116 t2 = secnds (t1) ! elapsed time 13117 print *, "Something took ", t2, " seconds." 13118 end program test_secnds 13119 13120 13121File: gfortran.info, Node: SECOND, Next: SELECTED_CHAR_KIND, Prev: SECNDS, Up: Intrinsic Procedures 13122 131238.214 `SECOND' -- CPU time function 13124=================================== 13125 13126_Description_: 13127 Returns a `REAL(4)' value representing the elapsed CPU time in 13128 seconds. This provides the same functionality as the standard 13129 `CPU_TIME' intrinsic, and is only included for backwards 13130 compatibility. 13131 13132 This intrinsic is provided in both subroutine and function forms; 13133 however, only one form can be used in any given program unit. 13134 13135_Standard_: 13136 GNU extension 13137 13138_Class_: 13139 Subroutine, function 13140 13141_Syntax_: 13142 `CALL SECOND(TIME)' 13143 `TIME = SECOND()' 13144 13145_Arguments_: 13146 TIME Shall be of type `REAL(4)'. 13147 13148_Return value_: 13149 In either syntax, TIME is set to the process's current runtime in 13150 seconds. 13151 13152_See also_: 13153 *note CPU_TIME:: 13154 13155 13156 13157File: gfortran.info, Node: SELECTED_CHAR_KIND, Next: SELECTED_INT_KIND, Prev: SECOND, Up: Intrinsic Procedures 13158 131598.215 `SELECTED_CHAR_KIND' -- Choose character kind 13160=================================================== 13161 13162_Description_: 13163 `SELECTED_CHAR_KIND(NAME)' returns the kind value for the character 13164 set named NAME, if a character set with such a name is supported, 13165 or -1 otherwise. Currently, supported character sets include 13166 "ASCII" and "DEFAULT", which are equivalent, and "ISO_10646" 13167 (Universal Character Set, UCS-4) which is commonly known as 13168 Unicode. 13169 13170_Standard_: 13171 Fortran 2003 and later 13172 13173_Class_: 13174 Transformational function 13175 13176_Syntax_: 13177 `RESULT = SELECTED_CHAR_KIND(NAME)' 13178 13179_Arguments_: 13180 NAME Shall be a scalar and of the default character 13181 type. 13182 13183_Example_: 13184 program character_kind 13185 use iso_fortran_env 13186 implicit none 13187 integer, parameter :: ascii = selected_char_kind ("ascii") 13188 integer, parameter :: ucs4 = selected_char_kind ('ISO_10646') 13189 13190 character(kind=ascii, len=26) :: alphabet 13191 character(kind=ucs4, len=30) :: hello_world 13192 13193 alphabet = ascii_"abcdefghijklmnopqrstuvwxyz" 13194 hello_world = ucs4_'Hello World and Ni Hao -- ' & 13195 // char (int (z'4F60'), ucs4) & 13196 // char (int (z'597D'), ucs4) 13197 13198 write (*,*) alphabet 13199 13200 open (output_unit, encoding='UTF-8') 13201 write (*,*) trim (hello_world) 13202 end program character_kind 13203 13204 13205File: gfortran.info, Node: SELECTED_INT_KIND, Next: SELECTED_REAL_KIND, Prev: SELECTED_CHAR_KIND, Up: Intrinsic Procedures 13206 132078.216 `SELECTED_INT_KIND' -- Choose integer kind 13208================================================ 13209 13210_Description_: 13211 `SELECTED_INT_KIND(R)' return the kind value of the smallest 13212 integer type that can represent all values ranging from -10^R 13213 (exclusive) to 10^R (exclusive). If there is no integer kind that 13214 accommodates this range, `SELECTED_INT_KIND' returns -1. 13215 13216_Standard_: 13217 Fortran 95 and later 13218 13219_Class_: 13220 Transformational function 13221 13222_Syntax_: 13223 `RESULT = SELECTED_INT_KIND(R)' 13224 13225_Arguments_: 13226 R Shall be a scalar and of type `INTEGER'. 13227 13228_Example_: 13229 program large_integers 13230 integer,parameter :: k5 = selected_int_kind(5) 13231 integer,parameter :: k15 = selected_int_kind(15) 13232 integer(kind=k5) :: i5 13233 integer(kind=k15) :: i15 13234 13235 print *, huge(i5), huge(i15) 13236 13237 ! The following inequalities are always true 13238 print *, huge(i5) >= 10_k5**5-1 13239 print *, huge(i15) >= 10_k15**15-1 13240 end program large_integers 13241 13242 13243File: gfortran.info, Node: SELECTED_REAL_KIND, Next: SET_EXPONENT, Prev: SELECTED_INT_KIND, Up: Intrinsic Procedures 13244 132458.217 `SELECTED_REAL_KIND' -- Choose real kind 13246============================================== 13247 13248_Description_: 13249 `SELECTED_REAL_KIND(P,R)' returns the kind value of a real data 13250 type with decimal precision of at least `P' digits, exponent range 13251 of at least `R', and with a radix of `RADIX'. 13252 13253_Standard_: 13254 Fortran 95 and later, with `RADIX' Fortran 2008 or later 13255 13256_Class_: 13257 Transformational function 13258 13259_Syntax_: 13260 `RESULT = SELECTED_REAL_KIND([P, R, RADIX])' 13261 13262_Arguments_: 13263 P (Optional) shall be a scalar and of type 13264 `INTEGER'. 13265 R (Optional) shall be a scalar and of type 13266 `INTEGER'. 13267 RADIX (Optional) shall be a scalar and of type 13268 `INTEGER'. 13269 Before Fortran 2008, at least one of the arguments R or P shall be 13270 present; since Fortran 2008, they are assumed to be zero if absent. 13271 13272_Return value_: 13273 `SELECTED_REAL_KIND' returns the value of the kind type parameter 13274 of a real data type with decimal precision of at least `P' digits, 13275 a decimal exponent range of at least `R', and with the requested 13276 `RADIX'. If the `RADIX' parameter is absent, real kinds with any 13277 radix can be returned. If more than one real data type meet the 13278 criteria, the kind of the data type with the smallest decimal 13279 precision is returned. If no real data type matches the criteria, 13280 the result is 13281 -1 if the processor does not support a real data type with a 13282 precision greater than or equal to `P', but the `R' and 13283 `RADIX' requirements can be fulfilled 13284 13285 -2 if the processor does not support a real type with an exponent 13286 range greater than or equal to `R', but `P' and `RADIX' are 13287 fulfillable 13288 13289 -3 if `RADIX' but not `P' and `R' requirements 13290 are fulfillable 13291 13292 -4 if `RADIX' and either `P' or `R' requirements 13293 are fulfillable 13294 13295 -5 if there is no real type with the given `RADIX' 13296 13297_See also_: 13298 *note PRECISION::, *note RANGE::, *note RADIX:: 13299 13300_Example_: 13301 program real_kinds 13302 integer,parameter :: p6 = selected_real_kind(6) 13303 integer,parameter :: p10r100 = selected_real_kind(10,100) 13304 integer,parameter :: r400 = selected_real_kind(r=400) 13305 real(kind=p6) :: x 13306 real(kind=p10r100) :: y 13307 real(kind=r400) :: z 13308 13309 print *, precision(x), range(x) 13310 print *, precision(y), range(y) 13311 print *, precision(z), range(z) 13312 end program real_kinds 13313 13314 13315File: gfortran.info, Node: SET_EXPONENT, Next: SHAPE, Prev: SELECTED_REAL_KIND, Up: Intrinsic Procedures 13316 133178.218 `SET_EXPONENT' -- Set the exponent of the model 13318===================================================== 13319 13320_Description_: 13321 `SET_EXPONENT(X, I)' returns the real number whose fractional part 13322 is that that of X and whose exponent part is I. 13323 13324_Standard_: 13325 Fortran 95 and later 13326 13327_Class_: 13328 Elemental function 13329 13330_Syntax_: 13331 `RESULT = SET_EXPONENT(X, I)' 13332 13333_Arguments_: 13334 X Shall be of type `REAL'. 13335 I Shall be of type `INTEGER'. 13336 13337_Return value_: 13338 The return value is of the same type and kind as X. The real 13339 number whose fractional part is that that of X and whose exponent 13340 part if I is returned; it is `FRACTION(X) * RADIX(X)**I'. 13341 13342_Example_: 13343 PROGRAM test_setexp 13344 REAL :: x = 178.1387e-4 13345 INTEGER :: i = 17 13346 PRINT *, SET_EXPONENT(x, i), FRACTION(x) * RADIX(x)**i 13347 END PROGRAM 13348 13349 13350 13351File: gfortran.info, Node: SHAPE, Next: SHIFTA, Prev: SET_EXPONENT, Up: Intrinsic Procedures 13352 133538.219 `SHAPE' -- Determine the shape of an array 13354================================================ 13355 13356_Description_: 13357 Determines the shape of an array. 13358 13359_Standard_: 13360 Fortran 95 and later, with KIND argument Fortran 2003 and later 13361 13362_Class_: 13363 Inquiry function 13364 13365_Syntax_: 13366 `RESULT = SHAPE(SOURCE [, KIND])' 13367 13368_Arguments_: 13369 SOURCE Shall be an array or scalar of any type. If 13370 SOURCE is a pointer it must be associated and 13371 allocatable arrays must be allocated. 13372 KIND (Optional) An `INTEGER' initialization 13373 expression indicating the kind parameter of 13374 the result. 13375 13376_Return value_: 13377 An `INTEGER' array of rank one with as many elements as SOURCE has 13378 dimensions. The elements of the resulting array correspond to the 13379 extend of SOURCE along the respective dimensions. If SOURCE is a 13380 scalar, the result is the rank one array of size zero. If KIND is 13381 absent, the return value has the default integer kind otherwise 13382 the specified kind. 13383 13384_Example_: 13385 PROGRAM test_shape 13386 INTEGER, DIMENSION(-1:1, -1:2) :: A 13387 WRITE(*,*) SHAPE(A) ! (/ 3, 4 /) 13388 WRITE(*,*) SIZE(SHAPE(42)) ! (/ /) 13389 END PROGRAM 13390 13391_See also_: 13392 *note RESHAPE::, *note SIZE:: 13393 13394 13395File: gfortran.info, Node: SHIFTA, Next: SHIFTL, Prev: SHAPE, Up: Intrinsic Procedures 13396 133978.220 `SHIFTA' -- Right shift with fill 13398======================================= 13399 13400_Description_: 13401 `SHIFTA' returns a value corresponding to I with all of the bits 13402 shifted right by SHIFT places. If the absolute value of SHIFT is 13403 greater than `BIT_SIZE(I)', the value is undefined. Bits shifted 13404 out from the right end are lost. The fill is arithmetic: the bits 13405 shifted in from the left end are equal to the leftmost bit, which 13406 in two's complement representation is the sign bit. 13407 13408_Standard_: 13409 Fortran 2008 and later 13410 13411_Class_: 13412 Elemental function 13413 13414_Syntax_: 13415 `RESULT = SHIFTA(I, SHIFT)' 13416 13417_Arguments_: 13418 I The type shall be `INTEGER'. 13419 SHIFT The type shall be `INTEGER'. 13420 13421_Return value_: 13422 The return value is of type `INTEGER' and of the same kind as I. 13423 13424_See also_: 13425 *note SHIFTL::, *note SHIFTR:: 13426 13427 13428File: gfortran.info, Node: SHIFTL, Next: SHIFTR, Prev: SHIFTA, Up: Intrinsic Procedures 13429 134308.221 `SHIFTL' -- Left shift 13431============================ 13432 13433_Description_: 13434 `SHIFTL' returns a value corresponding to I with all of the bits 13435 shifted left by SHIFT places. If the absolute value of SHIFT is 13436 greater than `BIT_SIZE(I)', the value is undefined. Bits shifted 13437 out from the left end are lost, and bits shifted in from the right 13438 end are set to 0. 13439 13440_Standard_: 13441 Fortran 2008 and later 13442 13443_Class_: 13444 Elemental function 13445 13446_Syntax_: 13447 `RESULT = SHIFTL(I, SHIFT)' 13448 13449_Arguments_: 13450 I The type shall be `INTEGER'. 13451 SHIFT The type shall be `INTEGER'. 13452 13453_Return value_: 13454 The return value is of type `INTEGER' and of the same kind as I. 13455 13456_See also_: 13457 *note SHIFTA::, *note SHIFTR:: 13458 13459 13460File: gfortran.info, Node: SHIFTR, Next: SIGN, Prev: SHIFTL, Up: Intrinsic Procedures 13461 134628.222 `SHIFTR' -- Right shift 13463============================= 13464 13465_Description_: 13466 `SHIFTR' returns a value corresponding to I with all of the bits 13467 shifted right by SHIFT places. If the absolute value of SHIFT is 13468 greater than `BIT_SIZE(I)', the value is undefined. Bits shifted 13469 out from the right end are lost, and bits shifted in from the left 13470 end are set to 0. 13471 13472_Standard_: 13473 Fortran 2008 and later 13474 13475_Class_: 13476 Elemental function 13477 13478_Syntax_: 13479 `RESULT = SHIFTR(I, SHIFT)' 13480 13481_Arguments_: 13482 I The type shall be `INTEGER'. 13483 SHIFT The type shall be `INTEGER'. 13484 13485_Return value_: 13486 The return value is of type `INTEGER' and of the same kind as I. 13487 13488_See also_: 13489 *note SHIFTA::, *note SHIFTL:: 13490 13491 13492File: gfortran.info, Node: SIGN, Next: SIGNAL, Prev: SHIFTR, Up: Intrinsic Procedures 13493 134948.223 `SIGN' -- Sign copying function 13495===================================== 13496 13497_Description_: 13498 `SIGN(A,B)' returns the value of A with the sign of B. 13499 13500_Standard_: 13501 Fortran 77 and later 13502 13503_Class_: 13504 Elemental function 13505 13506_Syntax_: 13507 `RESULT = SIGN(A, B)' 13508 13509_Arguments_: 13510 A Shall be of type `INTEGER' or `REAL' 13511 B Shall be of the same type and kind as A 13512 13513_Return value_: 13514 The kind of the return value is that of A and B. If B\ge 0 then 13515 the result is `ABS(A)', else it is `-ABS(A)'. 13516 13517_Example_: 13518 program test_sign 13519 print *, sign(-12,1) 13520 print *, sign(-12,0) 13521 print *, sign(-12,-1) 13522 13523 print *, sign(-12.,1.) 13524 print *, sign(-12.,0.) 13525 print *, sign(-12.,-1.) 13526 end program test_sign 13527 13528_Specific names_: 13529 Name Arguments Return type Standard 13530 `SIGN(A,B)' `REAL(4) A, `REAL(4)' f77, gnu 13531 B' 13532 `ISIGN(A,B)' `INTEGER(4) `INTEGER(4)' f77, gnu 13533 A, B' 13534 `DSIGN(A,B)' `REAL(8) A, `REAL(8)' f77, gnu 13535 B' 13536 13537 13538File: gfortran.info, Node: SIGNAL, Next: SIN, Prev: SIGN, Up: Intrinsic Procedures 13539 135408.224 `SIGNAL' -- Signal handling subroutine (or function) 13541========================================================== 13542 13543_Description_: 13544 `SIGNAL(NUMBER, HANDLER [, STATUS])' causes external subroutine 13545 HANDLER to be executed with a single integer argument when signal 13546 NUMBER occurs. If HANDLER is an integer, it can be used to turn 13547 off handling of signal NUMBER or revert to its default action. 13548 See `signal(2)'. 13549 13550 If `SIGNAL' is called as a subroutine and the STATUS argument is 13551 supplied, it is set to the value returned by `signal(2)'. 13552 13553_Standard_: 13554 GNU extension 13555 13556_Class_: 13557 Subroutine, function 13558 13559_Syntax_: 13560 `CALL SIGNAL(NUMBER, HANDLER [, STATUS])' 13561 `STATUS = SIGNAL(NUMBER, HANDLER)' 13562 13563_Arguments_: 13564 NUMBER Shall be a scalar integer, with `INTENT(IN)' 13565 HANDLER Signal handler (`INTEGER FUNCTION' or 13566 `SUBROUTINE') or dummy/global `INTEGER' scalar. 13567 `INTEGER'. It is `INTENT(IN)'. 13568 STATUS (Optional) STATUS shall be a scalar integer. 13569 It has `INTENT(OUT)'. 13570 13571_Return value_: 13572 The `SIGNAL' function returns the value returned by `signal(2)'. 13573 13574_Example_: 13575 program test_signal 13576 intrinsic signal 13577 external handler_print 13578 13579 call signal (12, handler_print) 13580 call signal (10, 1) 13581 13582 call sleep (30) 13583 end program test_signal 13584 13585 13586File: gfortran.info, Node: SIN, Next: SINH, Prev: SIGNAL, Up: Intrinsic Procedures 13587 135888.225 `SIN' -- Sine function 13589============================ 13590 13591_Description_: 13592 `SIN(X)' computes the sine of X. 13593 13594_Standard_: 13595 Fortran 77 and later 13596 13597_Class_: 13598 Elemental function 13599 13600_Syntax_: 13601 `RESULT = SIN(X)' 13602 13603_Arguments_: 13604 X The type shall be `REAL' or `COMPLEX'. 13605 13606_Return value_: 13607 The return value has same type and kind as X. 13608 13609_Example_: 13610 program test_sin 13611 real :: x = 0.0 13612 x = sin(x) 13613 end program test_sin 13614 13615_Specific names_: 13616 Name Argument Return type Standard 13617 `SIN(X)' `REAL(4) X' `REAL(4)' f77, gnu 13618 `DSIN(X)' `REAL(8) X' `REAL(8)' f95, gnu 13619 `CSIN(X)' `COMPLEX(4) `COMPLEX(4)' f95, gnu 13620 X' 13621 `ZSIN(X)' `COMPLEX(8) `COMPLEX(8)' f95, gnu 13622 X' 13623 `CDSIN(X)' `COMPLEX(8) `COMPLEX(8)' f95, gnu 13624 X' 13625 13626_See also_: 13627 *note ASIN:: 13628 13629 13630File: gfortran.info, Node: SINH, Next: SIZE, Prev: SIN, Up: Intrinsic Procedures 13631 136328.226 `SINH' -- Hyperbolic sine function 13633======================================== 13634 13635_Description_: 13636 `SINH(X)' computes the hyperbolic sine of X. 13637 13638_Standard_: 13639 Fortran 95 and later, for a complex argument Fortran 2008 or later 13640 13641_Class_: 13642 Elemental function 13643 13644_Syntax_: 13645 `RESULT = SINH(X)' 13646 13647_Arguments_: 13648 X The type shall be `REAL' or `COMPLEX'. 13649 13650_Return value_: 13651 The return value has same type and kind as X. 13652 13653_Example_: 13654 program test_sinh 13655 real(8) :: x = - 1.0_8 13656 x = sinh(x) 13657 end program test_sinh 13658 13659_Specific names_: 13660 Name Argument Return type Standard 13661 `SINH(X)' `REAL(4) X' `REAL(4)' Fortran 95 and 13662 later 13663 `DSINH(X)' `REAL(8) X' `REAL(8)' Fortran 95 and 13664 later 13665 13666_See also_: 13667 *note ASINH:: 13668 13669 13670File: gfortran.info, Node: SIZE, Next: SIZEOF, Prev: SINH, Up: Intrinsic Procedures 13671 136728.227 `SIZE' -- Determine the size of an array 13673============================================== 13674 13675_Description_: 13676 Determine the extent of ARRAY along a specified dimension DIM, or 13677 the total number of elements in ARRAY if DIM is absent. 13678 13679_Standard_: 13680 Fortran 95 and later, with KIND argument Fortran 2003 and later 13681 13682_Class_: 13683 Inquiry function 13684 13685_Syntax_: 13686 `RESULT = SIZE(ARRAY[, DIM [, KIND]])' 13687 13688_Arguments_: 13689 ARRAY Shall be an array of any type. If ARRAY is a 13690 pointer it must be associated and allocatable 13691 arrays must be allocated. 13692 DIM (Optional) shall be a scalar of type `INTEGER' 13693 and its value shall be in the range from 1 to 13694 n, where n equals the rank of ARRAY. 13695 KIND (Optional) An `INTEGER' initialization 13696 expression indicating the kind parameter of 13697 the result. 13698 13699_Return value_: 13700 The return value is of type `INTEGER' and of kind KIND. If KIND is 13701 absent, the return value is of default integer kind. 13702 13703_Example_: 13704 PROGRAM test_size 13705 WRITE(*,*) SIZE((/ 1, 2 /)) ! 2 13706 END PROGRAM 13707 13708_See also_: 13709 *note SHAPE::, *note RESHAPE:: 13710 13711 13712File: gfortran.info, Node: SIZEOF, Next: SLEEP, Prev: SIZE, Up: Intrinsic Procedures 13713 137148.228 `SIZEOF' -- Size in bytes of an expression 13715================================================ 13716 13717_Description_: 13718 `SIZEOF(X)' calculates the number of bytes of storage the 13719 expression `X' occupies. 13720 13721_Standard_: 13722 GNU extension 13723 13724_Class_: 13725 Intrinsic function 13726 13727_Syntax_: 13728 `N = SIZEOF(X)' 13729 13730_Arguments_: 13731 X The argument shall be of any type, rank or 13732 shape. 13733 13734_Return value_: 13735 The return value is of type integer and of the system-dependent 13736 kind C_SIZE_T (from the ISO_C_BINDING module). Its value is the 13737 number of bytes occupied by the argument. If the argument has the 13738 `POINTER' attribute, the number of bytes of the storage area 13739 pointed to is returned. If the argument is of a derived type with 13740 `POINTER' or `ALLOCATABLE' components, the return value does not 13741 account for the sizes of the data pointed to by these components. 13742 If the argument is polymorphic, the size according to the declared 13743 type is returned. The argument may not be a procedure or procedure 13744 pointer. 13745 13746_Example_: 13747 integer :: i 13748 real :: r, s(5) 13749 print *, (sizeof(s)/sizeof(r) == 5) 13750 end 13751 The example will print `.TRUE.' unless you are using a platform 13752 where default `REAL' variables are unusually padded. 13753 13754_See also_: 13755 *note C_SIZEOF::, *note STORAGE_SIZE:: 13756 13757 13758File: gfortran.info, Node: SLEEP, Next: SPACING, Prev: SIZEOF, Up: Intrinsic Procedures 13759 137608.229 `SLEEP' -- Sleep for the specified number of seconds 13761========================================================== 13762 13763_Description_: 13764 Calling this subroutine causes the process to pause for SECONDS 13765 seconds. 13766 13767_Standard_: 13768 GNU extension 13769 13770_Class_: 13771 Subroutine 13772 13773_Syntax_: 13774 `CALL SLEEP(SECONDS)' 13775 13776_Arguments_: 13777 SECONDS The type shall be of default `INTEGER'. 13778 13779_Example_: 13780 program test_sleep 13781 call sleep(5) 13782 end 13783 13784 13785File: gfortran.info, Node: SPACING, Next: SPREAD, Prev: SLEEP, Up: Intrinsic Procedures 13786 137878.230 `SPACING' -- Smallest distance between two numbers of a given type 13788======================================================================== 13789 13790_Description_: 13791 Determines the distance between the argument X and the nearest 13792 adjacent number of the same type. 13793 13794_Standard_: 13795 Fortran 95 and later 13796 13797_Class_: 13798 Elemental function 13799 13800_Syntax_: 13801 `RESULT = SPACING(X)' 13802 13803_Arguments_: 13804 X Shall be of type `REAL'. 13805 13806_Return value_: 13807 The result is of the same type as the input argument X. 13808 13809_Example_: 13810 PROGRAM test_spacing 13811 INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37) 13812 INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200) 13813 13814 WRITE(*,*) spacing(1.0_SGL) ! "1.1920929E-07" on i686 13815 WRITE(*,*) spacing(1.0_DBL) ! "2.220446049250313E-016" on i686 13816 END PROGRAM 13817 13818_See also_: 13819 *note RRSPACING:: 13820 13821 13822File: gfortran.info, Node: SPREAD, Next: SQRT, Prev: SPACING, Up: Intrinsic Procedures 13823 138248.231 `SPREAD' -- Add a dimension to an array 13825============================================= 13826 13827_Description_: 13828 Replicates a SOURCE array NCOPIES times along a specified 13829 dimension DIM. 13830 13831_Standard_: 13832 Fortran 95 and later 13833 13834_Class_: 13835 Transformational function 13836 13837_Syntax_: 13838 `RESULT = SPREAD(SOURCE, DIM, NCOPIES)' 13839 13840_Arguments_: 13841 SOURCE Shall be a scalar or an array of any type and 13842 a rank less than seven. 13843 DIM Shall be a scalar of type `INTEGER' with a 13844 value in the range from 1 to n+1, where n 13845 equals the rank of SOURCE. 13846 NCOPIES Shall be a scalar of type `INTEGER'. 13847 13848_Return value_: 13849 The result is an array of the same type as SOURCE and has rank n+1 13850 where n equals the rank of SOURCE. 13851 13852_Example_: 13853 PROGRAM test_spread 13854 INTEGER :: a = 1, b(2) = (/ 1, 2 /) 13855 WRITE(*,*) SPREAD(A, 1, 2) ! "1 1" 13856 WRITE(*,*) SPREAD(B, 1, 2) ! "1 1 2 2" 13857 END PROGRAM 13858 13859_See also_: 13860 *note UNPACK:: 13861 13862 13863File: gfortran.info, Node: SQRT, Next: SRAND, Prev: SPREAD, Up: Intrinsic Procedures 13864 138658.232 `SQRT' -- Square-root function 13866==================================== 13867 13868_Description_: 13869 `SQRT(X)' computes the square root of X. 13870 13871_Standard_: 13872 Fortran 77 and later 13873 13874_Class_: 13875 Elemental function 13876 13877_Syntax_: 13878 `RESULT = SQRT(X)' 13879 13880_Arguments_: 13881 X The type shall be `REAL' or `COMPLEX'. 13882 13883_Return value_: 13884 The return value is of type `REAL' or `COMPLEX'. The kind type 13885 parameter is the same as X. 13886 13887_Example_: 13888 program test_sqrt 13889 real(8) :: x = 2.0_8 13890 complex :: z = (1.0, 2.0) 13891 x = sqrt(x) 13892 z = sqrt(z) 13893 end program test_sqrt 13894 13895_Specific names_: 13896 Name Argument Return type Standard 13897 `SQRT(X)' `REAL(4) X' `REAL(4)' Fortran 95 and 13898 later 13899 `DSQRT(X)' `REAL(8) X' `REAL(8)' Fortran 95 and 13900 later 13901 `CSQRT(X)' `COMPLEX(4) `COMPLEX(4)' Fortran 95 and 13902 X' later 13903 `ZSQRT(X)' `COMPLEX(8) `COMPLEX(8)' GNU extension 13904 X' 13905 `CDSQRT(X)' `COMPLEX(8) `COMPLEX(8)' GNU extension 13906 X' 13907 13908 13909File: gfortran.info, Node: SRAND, Next: STAT, Prev: SQRT, Up: Intrinsic Procedures 13910 139118.233 `SRAND' -- Reinitialize the random number generator 13912========================================================= 13913 13914_Description_: 13915 `SRAND' reinitializes the pseudo-random number generator called by 13916 `RAND' and `IRAND'. The new seed used by the generator is 13917 specified by the required argument SEED. 13918 13919_Standard_: 13920 GNU extension 13921 13922_Class_: 13923 Subroutine 13924 13925_Syntax_: 13926 `CALL SRAND(SEED)' 13927 13928_Arguments_: 13929 SEED Shall be a scalar `INTEGER(kind=4)'. 13930 13931_Return value_: 13932 Does not return anything. 13933 13934_Example_: 13935 See `RAND' and `IRAND' for examples. 13936 13937_Notes_: 13938 The Fortran 2003 standard specifies the intrinsic `RANDOM_SEED' to 13939 initialize the pseudo-random numbers generator and `RANDOM_NUMBER' 13940 to generate pseudo-random numbers. Please note that in GNU 13941 Fortran, these two sets of intrinsics (`RAND', `IRAND' and `SRAND' 13942 on the one hand, `RANDOM_NUMBER' and `RANDOM_SEED' on the other 13943 hand) access two independent pseudo-random number generators. 13944 13945_See also_: 13946 *note RAND::, *note RANDOM_SEED::, *note RANDOM_NUMBER:: 13947 13948 13949 13950File: gfortran.info, Node: STAT, Next: STORAGE_SIZE, Prev: SRAND, Up: Intrinsic Procedures 13951 139528.234 `STAT' -- Get file status 13953=============================== 13954 13955_Description_: 13956 This function returns information about a file. No permissions are 13957 required on the file itself, but execute (search) permission is 13958 required on all of the directories in path that lead to the file. 13959 13960 The elements that are obtained and stored in the array `VALUES': 13961 `VALUES(1)'Device ID 13962 `VALUES(2)'Inode number 13963 `VALUES(3)'File mode 13964 `VALUES(4)'Number of links 13965 `VALUES(5)'Owner's uid 13966 `VALUES(6)'Owner's gid 13967 `VALUES(7)'ID of device containing directory entry for 13968 file (0 if not available) 13969 `VALUES(8)'File size (bytes) 13970 `VALUES(9)'Last access time 13971 `VALUES(10)'Last modification time 13972 `VALUES(11)'Last file status change time 13973 `VALUES(12)'Preferred I/O block size (-1 if not available) 13974 `VALUES(13)'Number of blocks allocated (-1 if not 13975 available) 13976 13977 Not all these elements are relevant on all systems. If an element 13978 is not relevant, it is returned as 0. 13979 13980 This intrinsic is provided in both subroutine and function forms; 13981 however, only one form can be used in any given program unit. 13982 13983_Standard_: 13984 GNU extension 13985 13986_Class_: 13987 Subroutine, function 13988 13989_Syntax_: 13990 `CALL STAT(NAME, VALUES [, STATUS])' 13991 `STATUS = STAT(NAME, VALUES)' 13992 13993_Arguments_: 13994 NAME The type shall be `CHARACTER', of the default 13995 kind and a valid path within the file system. 13996 VALUES The type shall be `INTEGER(4), DIMENSION(13)'. 13997 STATUS (Optional) status flag of type `INTEGER(4)'. 13998 Returns 0 on success and a system specific 13999 error code otherwise. 14000 14001_Example_: 14002 PROGRAM test_stat 14003 INTEGER, DIMENSION(13) :: buff 14004 INTEGER :: status 14005 14006 CALL STAT("/etc/passwd", buff, status) 14007 14008 IF (status == 0) THEN 14009 WRITE (*, FMT="('Device ID:', T30, I19)") buff(1) 14010 WRITE (*, FMT="('Inode number:', T30, I19)") buff(2) 14011 WRITE (*, FMT="('File mode (octal):', T30, O19)") buff(3) 14012 WRITE (*, FMT="('Number of links:', T30, I19)") buff(4) 14013 WRITE (*, FMT="('Owner''s uid:', T30, I19)") buff(5) 14014 WRITE (*, FMT="('Owner''s gid:', T30, I19)") buff(6) 14015 WRITE (*, FMT="('Device where located:', T30, I19)") buff(7) 14016 WRITE (*, FMT="('File size:', T30, I19)") buff(8) 14017 WRITE (*, FMT="('Last access time:', T30, A19)") CTIME(buff(9)) 14018 WRITE (*, FMT="('Last modification time', T30, A19)") CTIME(buff(10)) 14019 WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11)) 14020 WRITE (*, FMT="('Preferred block size:', T30, I19)") buff(12) 14021 WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13) 14022 END IF 14023 END PROGRAM 14024 14025_See also_: 14026 To stat an open file: *note FSTAT::, to stat a link: *note LSTAT:: 14027 14028 14029File: gfortran.info, Node: STORAGE_SIZE, Next: SUM, Prev: STAT, Up: Intrinsic Procedures 14030 140318.235 `STORAGE_SIZE' -- Storage size in bits 14032============================================ 14033 14034_Description_: 14035 Returns the storage size of argument A in bits. 14036 14037_Standard_: 14038 Fortran 2008 and later 14039 14040_Class_: 14041 Inquiry function 14042 14043_Syntax_: 14044 `RESULT = STORAGE_SIZE(A [, KIND])' 14045 14046_Arguments_: 14047 A Shall be a scalar or array of any type. 14048 KIND (Optional) shall be a scalar integer constant 14049 expression. 14050 14051_Return Value_: 14052 The result is a scalar integer with the kind type parameter 14053 specified by KIND (or default integer type if KIND is missing). 14054 The result value is the size expressed in bits for an element of 14055 an array that has the dynamic type and type parameters of A. 14056 14057_See also_: 14058 *note C_SIZEOF::, *note SIZEOF:: 14059 14060 14061File: gfortran.info, Node: SUM, Next: SYMLNK, Prev: STORAGE_SIZE, Up: Intrinsic Procedures 14062 140638.236 `SUM' -- Sum of array elements 14064==================================== 14065 14066_Description_: 14067 Adds the elements of ARRAY along dimension DIM if the 14068 corresponding element in MASK is `TRUE'. 14069 14070_Standard_: 14071 Fortran 95 and later 14072 14073_Class_: 14074 Transformational function 14075 14076_Syntax_: 14077 `RESULT = SUM(ARRAY[, MASK])' 14078 `RESULT = SUM(ARRAY, DIM[, MASK])' 14079 14080_Arguments_: 14081 ARRAY Shall be an array of type `INTEGER', `REAL' or 14082 `COMPLEX'. 14083 DIM (Optional) shall be a scalar of type `INTEGER' 14084 with a value in the range from 1 to n, where n 14085 equals the rank of ARRAY. 14086 MASK (Optional) shall be of type `LOGICAL' and 14087 either be a scalar or an array of the same 14088 shape as ARRAY. 14089 14090_Return value_: 14091 The result is of the same type as ARRAY. 14092 14093 If DIM is absent, a scalar with the sum of all elements in ARRAY 14094 is returned. Otherwise, an array of rank n-1, where n equals the 14095 rank of ARRAY, and a shape similar to that of ARRAY with dimension 14096 DIM dropped is returned. 14097 14098_Example_: 14099 PROGRAM test_sum 14100 INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /) 14101 print *, SUM(x) ! all elements, sum = 15 14102 print *, SUM(x, MASK=MOD(x, 2)==1) ! odd elements, sum = 9 14103 END PROGRAM 14104 14105_See also_: 14106 *note PRODUCT:: 14107 14108 14109File: gfortran.info, Node: SYMLNK, Next: SYSTEM, Prev: SUM, Up: Intrinsic Procedures 14110 141118.237 `SYMLNK' -- Create a symbolic link 14112======================================== 14113 14114_Description_: 14115 Makes a symbolic link from file PATH1 to PATH2. A null character 14116 (`CHAR(0)') can be used to mark the end of the names in PATH1 and 14117 PATH2; otherwise, trailing blanks in the file names are ignored. 14118 If the STATUS argument is supplied, it contains 0 on success or a 14119 nonzero error code upon return; see `symlink(2)'. If the system 14120 does not supply `symlink(2)', `ENOSYS' is returned. 14121 14122 This intrinsic is provided in both subroutine and function forms; 14123 however, only one form can be used in any given program unit. 14124 14125_Standard_: 14126 GNU extension 14127 14128_Class_: 14129 Subroutine, function 14130 14131_Syntax_: 14132 `CALL SYMLNK(PATH1, PATH2 [, STATUS])' 14133 `STATUS = SYMLNK(PATH1, PATH2)' 14134 14135_Arguments_: 14136 PATH1 Shall be of default `CHARACTER' type. 14137 PATH2 Shall be of default `CHARACTER' type. 14138 STATUS (Optional) Shall be of default `INTEGER' type. 14139 14140_See also_: 14141 *note LINK::, *note UNLINK:: 14142 14143 14144 14145File: gfortran.info, Node: SYSTEM, Next: SYSTEM_CLOCK, Prev: SYMLNK, Up: Intrinsic Procedures 14146 141478.238 `SYSTEM' -- Execute a shell command 14148========================================= 14149 14150_Description_: 14151 Passes the command COMMAND to a shell (see `system(3)'). If 14152 argument STATUS is present, it contains the value returned by 14153 `system(3)', which is presumably 0 if the shell command succeeded. 14154 Note that which shell is used to invoke the command is 14155 system-dependent and environment-dependent. 14156 14157 This intrinsic is provided in both subroutine and function forms; 14158 however, only one form can be used in any given program unit. 14159 14160 Note that the `system' function need not be thread-safe. It is the 14161 responsibility of the user to ensure that `system' is not called 14162 concurrently. 14163 14164_Standard_: 14165 GNU extension 14166 14167_Class_: 14168 Subroutine, function 14169 14170_Syntax_: 14171 `CALL SYSTEM(COMMAND [, STATUS])' 14172 `STATUS = SYSTEM(COMMAND)' 14173 14174_Arguments_: 14175 COMMAND Shall be of default `CHARACTER' type. 14176 STATUS (Optional) Shall be of default `INTEGER' type. 14177 14178_See also_: 14179 *note EXECUTE_COMMAND_LINE::, which is part of the Fortran 2008 14180 standard and should considered in new code for future portability. 14181 14182 14183File: gfortran.info, Node: SYSTEM_CLOCK, Next: TAN, Prev: SYSTEM, Up: Intrinsic Procedures 14184 141858.239 `SYSTEM_CLOCK' -- Time function 14186===================================== 14187 14188_Description_: 14189 Determines the COUNT of a processor clock since an unspecified 14190 time in the past modulo COUNT_MAX, COUNT_RATE determines the 14191 number of clock ticks per second. If the platform supports a high 14192 resolution monotonic clock, that clock is used and can provide up 14193 to nanosecond resolution. If a high resolution monotonic clock is 14194 not available, the implementation falls back to a potentially lower 14195 resolution realtime clock. 14196 14197 COUNT_RATE is system dependent and can vary depending on the kind 14198 of the arguments. For KIND=4 arguments, COUNT usually represents 14199 milliseconds, while for KIND=8 arguments, COUNT typically 14200 represents micro- or nanoseconds. COUNT_MAX usually equals 14201 `HUGE(COUNT_MAX)'. 14202 14203 If there is no clock, COUNT is set to `-HUGE(COUNT)', and 14204 COUNT_RATE and COUNT_MAX are set to zero. 14205 14206 When running on a platform using the GNU C library (glibc), or a 14207 derivative thereof, the high resolution monotonic clock is 14208 available only when linking with the RT library. This can be done 14209 explicitly by adding the `-lrt' flag when linking the application, 14210 but is also done implicitly when using OpenMP. 14211 14212_Standard_: 14213 Fortran 95 and later 14214 14215_Class_: 14216 Subroutine 14217 14218_Syntax_: 14219 `CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])' 14220 14221_Arguments_: 14222 COUNT (Optional) shall be a scalar of type `INTEGER' 14223 with `INTENT(OUT)'. 14224 COUNT_RATE (Optional) shall be a scalar of type `INTEGER' 14225 with `INTENT(OUT)'. 14226 COUNT_MAX (Optional) shall be a scalar of type `INTEGER' 14227 with `INTENT(OUT)'. 14228 14229_Example_: 14230 PROGRAM test_system_clock 14231 INTEGER :: count, count_rate, count_max 14232 CALL SYSTEM_CLOCK(count, count_rate, count_max) 14233 WRITE(*,*) count, count_rate, count_max 14234 END PROGRAM 14235 14236_See also_: 14237 *note DATE_AND_TIME::, *note CPU_TIME:: 14238 14239 14240File: gfortran.info, Node: TAN, Next: TANH, Prev: SYSTEM_CLOCK, Up: Intrinsic Procedures 14241 142428.240 `TAN' -- Tangent function 14243=============================== 14244 14245_Description_: 14246 `TAN(X)' computes the tangent of X. 14247 14248_Standard_: 14249 Fortran 77 and later, for a complex argument Fortran 2008 or later 14250 14251_Class_: 14252 Elemental function 14253 14254_Syntax_: 14255 `RESULT = TAN(X)' 14256 14257_Arguments_: 14258 X The type shall be `REAL' or `COMPLEX'. 14259 14260_Return value_: 14261 The return value has same type and kind as X. 14262 14263_Example_: 14264 program test_tan 14265 real(8) :: x = 0.165_8 14266 x = tan(x) 14267 end program test_tan 14268 14269_Specific names_: 14270 Name Argument Return type Standard 14271 `TAN(X)' `REAL(4) X' `REAL(4)' Fortran 95 and 14272 later 14273 `DTAN(X)' `REAL(8) X' `REAL(8)' Fortran 95 and 14274 later 14275 14276_See also_: 14277 *note ATAN:: 14278 14279 14280File: gfortran.info, Node: TANH, Next: THIS_IMAGE, Prev: TAN, Up: Intrinsic Procedures 14281 142828.241 `TANH' -- Hyperbolic tangent function 14283=========================================== 14284 14285_Description_: 14286 `TANH(X)' computes the hyperbolic tangent of X. 14287 14288_Standard_: 14289 Fortran 77 and later, for a complex argument Fortran 2008 or later 14290 14291_Class_: 14292 Elemental function 14293 14294_Syntax_: 14295 `X = TANH(X)' 14296 14297_Arguments_: 14298 X The type shall be `REAL' or `COMPLEX'. 14299 14300_Return value_: 14301 The return value has same type and kind as X. If X is complex, the 14302 imaginary part of the result is in radians. If X is `REAL', the 14303 return value lies in the range - 1 \leq tanh(x) \leq 1 . 14304 14305_Example_: 14306 program test_tanh 14307 real(8) :: x = 2.1_8 14308 x = tanh(x) 14309 end program test_tanh 14310 14311_Specific names_: 14312 Name Argument Return type Standard 14313 `TANH(X)' `REAL(4) X' `REAL(4)' Fortran 95 and 14314 later 14315 `DTANH(X)' `REAL(8) X' `REAL(8)' Fortran 95 and 14316 later 14317 14318_See also_: 14319 *note ATANH:: 14320 14321 14322File: gfortran.info, Node: THIS_IMAGE, Next: TIME, Prev: TANH, Up: Intrinsic Procedures 14323 143248.242 `THIS_IMAGE' -- Function that returns the cosubscript index of this image 14325=============================================================================== 14326 14327_Description_: 14328 Returns the cosubscript for this image. 14329 14330_Standard_: 14331 Fortran 2008 and later 14332 14333_Class_: 14334 Transformational function 14335 14336_Syntax_: 14337 `RESULT = THIS_IMAGE()' 14338 `RESULT = THIS_IMAGE(COARRAY [, DIM])' 14339 14340_Arguments_: 14341 COARRAY Coarray of any type (optional; if DIM 14342 present, required). 14343 DIM default integer scalar (optional). If present, 14344 DIM shall be between one and the corank of 14345 COARRAY. 14346 14347_Return value_: 14348 Default integer. If COARRAY is not present, it is scalar and its 14349 value is the index of the invoking image. Otherwise, if DIM is not 14350 present, a rank-1 array with corank elements is returned, 14351 containing the cosubscripts for COARRAY specifying the invoking 14352 image. If DIM is present, a scalar is returned, with the value of 14353 the DIM element of `THIS_IMAGE(COARRAY)'. 14354 14355_Example_: 14356 INTEGER :: value[*] 14357 INTEGER :: i 14358 value = THIS_IMAGE() 14359 SYNC ALL 14360 IF (THIS_IMAGE() == 1) THEN 14361 DO i = 1, NUM_IMAGES() 14362 WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i] 14363 END DO 14364 END IF 14365 14366_See also_: 14367 *note NUM_IMAGES::, *note IMAGE_INDEX:: 14368 14369 14370File: gfortran.info, Node: TIME, Next: TIME8, Prev: THIS_IMAGE, Up: Intrinsic Procedures 14371 143728.243 `TIME' -- Time function 14373============================= 14374 14375_Description_: 14376 Returns the current time encoded as an integer (in the manner of 14377 the function `time(3)' in the C standard library). This value is 14378 suitable for passing to `CTIME', `GMTIME', and `LTIME'. 14379 14380 This intrinsic is not fully portable, such as to systems with 14381 32-bit `INTEGER' types but supporting times wider than 32 bits. 14382 Therefore, the values returned by this intrinsic might be, or 14383 become, negative, or numerically less than previous values, during 14384 a single run of the compiled program. 14385 14386 See *note TIME8::, for information on a similar intrinsic that 14387 might be portable to more GNU Fortran implementations, though to 14388 fewer Fortran compilers. 14389 14390_Standard_: 14391 GNU extension 14392 14393_Class_: 14394 Function 14395 14396_Syntax_: 14397 `RESULT = TIME()' 14398 14399_Return value_: 14400 The return value is a scalar of type `INTEGER(4)'. 14401 14402_See also_: 14403 *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, 14404 *note TIME8:: 14405 14406 14407 14408File: gfortran.info, Node: TIME8, Next: TINY, Prev: TIME, Up: Intrinsic Procedures 14409 144108.244 `TIME8' -- Time function (64-bit) 14411======================================= 14412 14413_Description_: 14414 Returns the current time encoded as an integer (in the manner of 14415 the function `time(3)' in the C standard library). This value is 14416 suitable for passing to `CTIME', `GMTIME', and `LTIME'. 14417 14418 _Warning:_ this intrinsic does not increase the range of the timing 14419 values over that returned by `time(3)'. On a system with a 32-bit 14420 `time(3)', `TIME8' will return a 32-bit value, even though it is 14421 converted to a 64-bit `INTEGER(8)' value. That means overflows of 14422 the 32-bit value can still occur. Therefore, the values returned 14423 by this intrinsic might be or become negative or numerically less 14424 than previous values during a single run of the compiled program. 14425 14426_Standard_: 14427 GNU extension 14428 14429_Class_: 14430 Function 14431 14432_Syntax_: 14433 `RESULT = TIME8()' 14434 14435_Return value_: 14436 The return value is a scalar of type `INTEGER(8)'. 14437 14438_See also_: 14439 *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK8::, 14440 *note TIME:: 14441 14442 14443 14444File: gfortran.info, Node: TINY, Next: TRAILZ, Prev: TIME8, Up: Intrinsic Procedures 14445 144468.245 `TINY' -- Smallest positive number of a real kind 14447======================================================= 14448 14449_Description_: 14450 `TINY(X)' returns the smallest positive (non zero) number in the 14451 model of the type of `X'. 14452 14453_Standard_: 14454 Fortran 95 and later 14455 14456_Class_: 14457 Inquiry function 14458 14459_Syntax_: 14460 `RESULT = TINY(X)' 14461 14462_Arguments_: 14463 X Shall be of type `REAL'. 14464 14465_Return value_: 14466 The return value is of the same type and kind as X 14467 14468_Example_: 14469 See `HUGE' for an example. 14470 14471 14472File: gfortran.info, Node: TRAILZ, Next: TRANSFER, Prev: TINY, Up: Intrinsic Procedures 14473 144748.246 `TRAILZ' -- Number of trailing zero bits of an integer 14475============================================================ 14476 14477_Description_: 14478 `TRAILZ' returns the number of trailing zero bits of an integer. 14479 14480_Standard_: 14481 Fortran 2008 and later 14482 14483_Class_: 14484 Elemental function 14485 14486_Syntax_: 14487 `RESULT = TRAILZ(I)' 14488 14489_Arguments_: 14490 I Shall be of type `INTEGER'. 14491 14492_Return value_: 14493 The type of the return value is the default `INTEGER'. If all the 14494 bits of `I' are zero, the result value is `BIT_SIZE(I)'. 14495 14496_Example_: 14497 PROGRAM test_trailz 14498 WRITE (*,*) TRAILZ(8) ! prints 3 14499 END PROGRAM 14500 14501_See also_: 14502 *note BIT_SIZE::, *note LEADZ::, *note POPPAR::, *note POPCNT:: 14503 14504 14505File: gfortran.info, Node: TRANSFER, Next: TRANSPOSE, Prev: TRAILZ, Up: Intrinsic Procedures 14506 145078.247 `TRANSFER' -- Transfer bit patterns 14508========================================= 14509 14510_Description_: 14511 Interprets the bitwise representation of SOURCE in memory as if it 14512 is the representation of a variable or array of the same type and 14513 type parameters as MOLD. 14514 14515 This is approximately equivalent to the C concept of _casting_ one 14516 type to another. 14517 14518_Standard_: 14519 Fortran 95 and later 14520 14521_Class_: 14522 Transformational function 14523 14524_Syntax_: 14525 `RESULT = TRANSFER(SOURCE, MOLD[, SIZE])' 14526 14527_Arguments_: 14528 SOURCE Shall be a scalar or an array of any type. 14529 MOLD Shall be a scalar or an array of any type. 14530 SIZE (Optional) shall be a scalar of type `INTEGER'. 14531 14532_Return value_: 14533 The result has the same type as MOLD, with the bit level 14534 representation of SOURCE. If SIZE is present, the result is a 14535 one-dimensional array of length SIZE. If SIZE is absent but MOLD 14536 is an array (of any size or shape), the result is a one- 14537 dimensional array of the minimum length needed to contain the 14538 entirety of the bitwise representation of SOURCE. If SIZE is 14539 absent and MOLD is a scalar, the result is a scalar. 14540 14541 If the bitwise representation of the result is longer than that of 14542 SOURCE, then the leading bits of the result correspond to those of 14543 SOURCE and any trailing bits are filled arbitrarily. 14544 14545 When the resulting bit representation does not correspond to a 14546 valid representation of a variable of the same type as MOLD, the 14547 results are undefined, and subsequent operations on the result 14548 cannot be guaranteed to produce sensible behavior. For example, 14549 it is possible to create `LOGICAL' variables for which `VAR' and 14550 `.NOT.VAR' both appear to be true. 14551 14552_Example_: 14553 PROGRAM test_transfer 14554 integer :: x = 2143289344 14555 print *, transfer(x, 1.0) ! prints "NaN" on i686 14556 END PROGRAM 14557 14558 14559File: gfortran.info, Node: TRANSPOSE, Next: TRIM, Prev: TRANSFER, Up: Intrinsic Procedures 14560 145618.248 `TRANSPOSE' -- Transpose an array of rank two 14562=================================================== 14563 14564_Description_: 14565 Transpose an array of rank two. Element (i, j) of the result has 14566 the value `MATRIX(j, i)', for all i, j. 14567 14568_Standard_: 14569 Fortran 95 and later 14570 14571_Class_: 14572 Transformational function 14573 14574_Syntax_: 14575 `RESULT = TRANSPOSE(MATRIX)' 14576 14577_Arguments_: 14578 MATRIX Shall be an array of any type and have a rank 14579 of two. 14580 14581_Return value_: 14582 The result has the same type as MATRIX, and has shape `(/ m, n /)' 14583 if MATRIX has shape `(/ n, m /)'. 14584 14585 14586File: gfortran.info, Node: TRIM, Next: TTYNAM, Prev: TRANSPOSE, Up: Intrinsic Procedures 14587 145888.249 `TRIM' -- Remove trailing blank characters of a string 14589============================================================ 14590 14591_Description_: 14592 Removes trailing blank characters of a string. 14593 14594_Standard_: 14595 Fortran 95 and later 14596 14597_Class_: 14598 Transformational function 14599 14600_Syntax_: 14601 `RESULT = TRIM(STRING)' 14602 14603_Arguments_: 14604 STRING Shall be a scalar of type `CHARACTER'. 14605 14606_Return value_: 14607 A scalar of type `CHARACTER' which length is that of STRING less 14608 the number of trailing blanks. 14609 14610_Example_: 14611 PROGRAM test_trim 14612 CHARACTER(len=10), PARAMETER :: s = "GFORTRAN " 14613 WRITE(*,*) LEN(s), LEN(TRIM(s)) ! "10 8", with/without trailing blanks 14614 END PROGRAM 14615 14616_See also_: 14617 *note ADJUSTL::, *note ADJUSTR:: 14618 14619 14620File: gfortran.info, Node: TTYNAM, Next: UBOUND, Prev: TRIM, Up: Intrinsic Procedures 14621 146228.250 `TTYNAM' -- Get the name of a terminal device. 14623==================================================== 14624 14625_Description_: 14626 Get the name of a terminal device. For more information, see 14627 `ttyname(3)'. 14628 14629 This intrinsic is provided in both subroutine and function forms; 14630 however, only one form can be used in any given program unit. 14631 14632_Standard_: 14633 GNU extension 14634 14635_Class_: 14636 Subroutine, function 14637 14638_Syntax_: 14639 `CALL TTYNAM(UNIT, NAME)' 14640 `NAME = TTYNAM(UNIT)' 14641 14642_Arguments_: 14643 UNIT Shall be a scalar `INTEGER'. 14644 NAME Shall be of type `CHARACTER'. 14645 14646_Example_: 14647 PROGRAM test_ttynam 14648 INTEGER :: unit 14649 DO unit = 1, 10 14650 IF (isatty(unit=unit)) write(*,*) ttynam(unit) 14651 END DO 14652 END PROGRAM 14653 14654_See also_: 14655 *note ISATTY:: 14656 14657 14658File: gfortran.info, Node: UBOUND, Next: UCOBOUND, Prev: TTYNAM, Up: Intrinsic Procedures 14659 146608.251 `UBOUND' -- Upper dimension bounds of an array 14661==================================================== 14662 14663_Description_: 14664 Returns the upper bounds of an array, or a single upper bound 14665 along the DIM dimension. 14666 14667_Standard_: 14668 Fortran 95 and later, with KIND argument Fortran 2003 and later 14669 14670_Class_: 14671 Inquiry function 14672 14673_Syntax_: 14674 `RESULT = UBOUND(ARRAY [, DIM [, KIND]])' 14675 14676_Arguments_: 14677 ARRAY Shall be an array, of any type. 14678 DIM (Optional) Shall be a scalar `INTEGER'. 14679 KIND (Optional) An `INTEGER' initialization 14680 expression indicating the kind parameter of 14681 the result. 14682 14683_Return value_: 14684 The return value is of type `INTEGER' and of kind KIND. If KIND is 14685 absent, the return value is of default integer kind. If DIM is 14686 absent, the result is an array of the upper bounds of ARRAY. If 14687 DIM is present, the result is a scalar corresponding to the upper 14688 bound of the array along that dimension. If ARRAY is an 14689 expression rather than a whole array or array structure component, 14690 or if it has a zero extent along the relevant dimension, the upper 14691 bound is taken to be the number of elements along the relevant 14692 dimension. 14693 14694_See also_: 14695 *note LBOUND::, *note LCOBOUND:: 14696 14697 14698File: gfortran.info, Node: UCOBOUND, Next: UMASK, Prev: UBOUND, Up: Intrinsic Procedures 14699 147008.252 `UCOBOUND' -- Upper codimension bounds of an array 14701======================================================== 14702 14703_Description_: 14704 Returns the upper cobounds of a coarray, or a single upper cobound 14705 along the DIM codimension. 14706 14707_Standard_: 14708 Fortran 2008 and later 14709 14710_Class_: 14711 Inquiry function 14712 14713_Syntax_: 14714 `RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])' 14715 14716_Arguments_: 14717 ARRAY Shall be an coarray, of any type. 14718 DIM (Optional) Shall be a scalar `INTEGER'. 14719 KIND (Optional) An `INTEGER' initialization 14720 expression indicating the kind parameter of 14721 the result. 14722 14723_Return value_: 14724 The return value is of type `INTEGER' and of kind KIND. If KIND is 14725 absent, the return value is of default integer kind. If DIM is 14726 absent, the result is an array of the lower cobounds of COARRAY. 14727 If DIM is present, the result is a scalar corresponding to the 14728 lower cobound of the array along that codimension. 14729 14730_See also_: 14731 *note LCOBOUND::, *note LBOUND:: 14732 14733 14734File: gfortran.info, Node: UMASK, Next: UNLINK, Prev: UCOBOUND, Up: Intrinsic Procedures 14735 147368.253 `UMASK' -- Set the file creation mask 14737=========================================== 14738 14739_Description_: 14740 Sets the file creation mask to MASK. If called as a function, it 14741 returns the old value. If called as a subroutine and argument OLD 14742 if it is supplied, it is set to the old value. See `umask(2)'. 14743 14744_Standard_: 14745 GNU extension 14746 14747_Class_: 14748 Subroutine, function 14749 14750_Syntax_: 14751 `CALL UMASK(MASK [, OLD])' 14752 `OLD = UMASK(MASK)' 14753 14754_Arguments_: 14755 MASK Shall be a scalar of type `INTEGER'. 14756 OLD (Optional) Shall be a scalar of type `INTEGER'. 14757 14758 14759 14760File: gfortran.info, Node: UNLINK, Next: UNPACK, Prev: UMASK, Up: Intrinsic Procedures 14761 147628.254 `UNLINK' -- Remove a file from the file system 14763==================================================== 14764 14765_Description_: 14766 Unlinks the file PATH. A null character (`CHAR(0)') can be used to 14767 mark the end of the name in PATH; otherwise, trailing blanks in 14768 the file name are ignored. If the STATUS argument is supplied, it 14769 contains 0 on success or a nonzero error code upon return; see 14770 `unlink(2)'. 14771 14772 This intrinsic is provided in both subroutine and function forms; 14773 however, only one form can be used in any given program unit. 14774 14775_Standard_: 14776 GNU extension 14777 14778_Class_: 14779 Subroutine, function 14780 14781_Syntax_: 14782 `CALL UNLINK(PATH [, STATUS])' 14783 `STATUS = UNLINK(PATH)' 14784 14785_Arguments_: 14786 PATH Shall be of default `CHARACTER' type. 14787 STATUS (Optional) Shall be of default `INTEGER' type. 14788 14789_See also_: 14790 *note LINK::, *note SYMLNK:: 14791 14792 14793File: gfortran.info, Node: UNPACK, Next: VERIFY, Prev: UNLINK, Up: Intrinsic Procedures 14794 147958.255 `UNPACK' -- Unpack an array of rank one into an array 14796=========================================================== 14797 14798_Description_: 14799 Store the elements of VECTOR in an array of higher rank. 14800 14801_Standard_: 14802 Fortran 95 and later 14803 14804_Class_: 14805 Transformational function 14806 14807_Syntax_: 14808 `RESULT = UNPACK(VECTOR, MASK, FIELD)' 14809 14810_Arguments_: 14811 VECTOR Shall be an array of any type and rank one. It 14812 shall have at least as many elements as MASK 14813 has `TRUE' values. 14814 MASK Shall be an array of type `LOGICAL'. 14815 FIELD Shall be of the same type as VECTOR and have 14816 the same shape as MASK. 14817 14818_Return value_: 14819 The resulting array corresponds to FIELD with `TRUE' elements of 14820 MASK replaced by values from VECTOR in array element order. 14821 14822_Example_: 14823 PROGRAM test_unpack 14824 integer :: vector(2) = (/1,1/) 14825 logical :: mask(4) = (/ .TRUE., .FALSE., .FALSE., .TRUE. /) 14826 integer :: field(2,2) = 0, unity(2,2) 14827 14828 ! result: unity matrix 14829 unity = unpack(vector, reshape(mask, (/2,2/)), field) 14830 END PROGRAM 14831 14832_See also_: 14833 *note PACK::, *note SPREAD:: 14834 14835 14836File: gfortran.info, Node: VERIFY, Next: XOR, Prev: UNPACK, Up: Intrinsic Procedures 14837 148388.256 `VERIFY' -- Scan a string for characters not a given set 14839============================================================== 14840 14841_Description_: 14842 Verifies that all the characters in STRING belong to the set of 14843 characters in SET. 14844 14845 If BACK is either absent or equals `FALSE', this function returns 14846 the position of the leftmost character of STRING that is not in 14847 SET. If BACK equals `TRUE', the rightmost position is returned. If 14848 all characters of STRING are found in SET, the result is zero. 14849 14850_Standard_: 14851 Fortran 95 and later, with KIND argument Fortran 2003 and later 14852 14853_Class_: 14854 Elemental function 14855 14856_Syntax_: 14857 `RESULT = VERIFY(STRING, SET[, BACK [, KIND]])' 14858 14859_Arguments_: 14860 STRING Shall be of type `CHARACTER'. 14861 SET Shall be of type `CHARACTER'. 14862 BACK (Optional) shall be of type `LOGICAL'. 14863 KIND (Optional) An `INTEGER' initialization 14864 expression indicating the kind parameter of 14865 the result. 14866 14867_Return value_: 14868 The return value is of type `INTEGER' and of kind KIND. If KIND is 14869 absent, the return value is of default integer kind. 14870 14871_Example_: 14872 PROGRAM test_verify 14873 WRITE(*,*) VERIFY("FORTRAN", "AO") ! 1, found 'F' 14874 WRITE(*,*) VERIFY("FORTRAN", "FOO") ! 3, found 'R' 14875 WRITE(*,*) VERIFY("FORTRAN", "C++") ! 1, found 'F' 14876 WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.) ! 7, found 'N' 14877 WRITE(*,*) VERIFY("FORTRAN", "FORTRAN") ! 0' found none 14878 END PROGRAM 14879 14880_See also_: 14881 *note SCAN::, *note INDEX intrinsic:: 14882 14883 14884File: gfortran.info, Node: XOR, Prev: VERIFY, Up: Intrinsic Procedures 14885 148868.257 `XOR' -- Bitwise logical exclusive OR 14887=========================================== 14888 14889_Description_: 14890 Bitwise logical exclusive or. 14891 14892 This intrinsic routine is provided for backwards compatibility with 14893 GNU Fortran 77. For integer arguments, programmers should consider 14894 the use of the *note IEOR:: intrinsic and for logical arguments the 14895 `.NEQV.' operator, which are both defined by the Fortran standard. 14896 14897_Standard_: 14898 GNU extension 14899 14900_Class_: 14901 Function 14902 14903_Syntax_: 14904 `RESULT = XOR(I, J)' 14905 14906_Arguments_: 14907 I The type shall be either a scalar `INTEGER' 14908 type or a scalar `LOGICAL' type. 14909 J The type shall be the same as the type of I. 14910 14911_Return value_: 14912 The return type is either a scalar `INTEGER' or a scalar 14913 `LOGICAL'. If the kind type parameters differ, then the smaller 14914 kind type is implicitly converted to larger kind, and the return 14915 has the larger kind. 14916 14917_Example_: 14918 PROGRAM test_xor 14919 LOGICAL :: T = .TRUE., F = .FALSE. 14920 INTEGER :: a, b 14921 DATA a / Z'F' /, b / Z'3' / 14922 14923 WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F) 14924 WRITE (*,*) XOR(a, b) 14925 END PROGRAM 14926 14927_See also_: 14928 Fortran 95 elemental function: *note IEOR:: 14929 14930 14931File: gfortran.info, Node: Intrinsic Modules, Next: Contributing, Prev: Intrinsic Procedures, Up: Top 14932 149339 Intrinsic Modules 14934******************* 14935 14936* Menu: 14937 14938* ISO_FORTRAN_ENV:: 14939* ISO_C_BINDING:: 14940* OpenMP Modules OMP_LIB and OMP_LIB_KINDS:: 14941 14942 14943File: gfortran.info, Node: ISO_FORTRAN_ENV, Next: ISO_C_BINDING, Up: Intrinsic Modules 14944 149459.1 `ISO_FORTRAN_ENV' 14946===================== 14947 14948_Standard_: 14949 Fortran 2003 and later, except when otherwise noted 14950 14951 The `ISO_FORTRAN_ENV' module provides the following scalar 14952default-integer named constants: 14953 14954`ATOMIC_INT_KIND': 14955 Default-kind integer constant to be used as kind parameter when 14956 defining integer variables used in atomic operations. (Fortran 14957 2008 or later.) 14958 14959`ATOMIC_LOGICAL_KIND': 14960 Default-kind integer constant to be used as kind parameter when 14961 defining logical variables used in atomic operations. (Fortran 14962 2008 or later.) 14963 14964`CHARACTER_KINDS': 14965 Default-kind integer constant array of rank one containing the 14966 supported kind parameters of the `CHARACTER' type. (Fortran 2008 14967 or later.) 14968 14969`CHARACTER_STORAGE_SIZE': 14970 Size in bits of the character storage unit. 14971 14972`ERROR_UNIT': 14973 Identifies the preconnected unit used for error reporting. 14974 14975`FILE_STORAGE_SIZE': 14976 Size in bits of the file-storage unit. 14977 14978`INPUT_UNIT': 14979 Identifies the preconnected unit identified by the asterisk (`*') 14980 in `READ' statement. 14981 14982`INT8', `INT16', `INT32', `INT64': 14983 Kind type parameters to specify an INTEGER type with a storage 14984 size of 16, 32, and 64 bits. It is negative if a target platform 14985 does not support the particular kind. (Fortran 2008 or later.) 14986 14987`INTEGER_KINDS': 14988 Default-kind integer constant array of rank one containing the 14989 supported kind parameters of the `INTEGER' type. (Fortran 2008 or 14990 later.) 14991 14992`IOSTAT_END': 14993 The value assigned to the variable passed to the `IOSTAT=' 14994 specifier of an input/output statement if an end-of-file condition 14995 occurred. 14996 14997`IOSTAT_EOR': 14998 The value assigned to the variable passed to the `IOSTAT=' 14999 specifier of an input/output statement if an end-of-record 15000 condition occurred. 15001 15002`IOSTAT_INQUIRE_INTERNAL_UNIT': 15003 Scalar default-integer constant, used by `INQUIRE' for the 15004 `IOSTAT=' specifier to denote an that a unit number identifies an 15005 internal unit. (Fortran 2008 or later.) 15006 15007`NUMERIC_STORAGE_SIZE': 15008 The size in bits of the numeric storage unit. 15009 15010`LOGICAL_KINDS': 15011 Default-kind integer constant array of rank one containing the 15012 supported kind parameters of the `LOGICAL' type. (Fortran 2008 or 15013 later.) 15014 15015`OUTPUT_UNIT': 15016 Identifies the preconnected unit identified by the asterisk (`*') 15017 in `WRITE' statement. 15018 15019`REAL32', `REAL64', `REAL128': 15020 Kind type parameters to specify a REAL type with a storage size of 15021 32, 64, and 128 bits. It is negative if a target platform does not 15022 support the particular kind. (Fortran 2008 or later.) 15023 15024`REAL_KINDS': 15025 Default-kind integer constant array of rank one containing the 15026 supported kind parameters of the `REAL' type. (Fortran 2008 or 15027 later.) 15028 15029`STAT_LOCKED': 15030 Scalar default-integer constant used as STAT= return value by 15031 `LOCK' to denote that the lock variable is locked by the executing 15032 image. (Fortran 2008 or later.) 15033 15034`STAT_LOCKED_OTHER_IMAGE': 15035 Scalar default-integer constant used as STAT= return value by 15036 `UNLOCK' to denote that the lock variable is locked by another 15037 image. (Fortran 2008 or later.) 15038 15039`STAT_STOPPED_IMAGE': 15040 Positive, scalar default-integer constant used as STAT= return 15041 value if the argument in the statement requires synchronisation 15042 with an image, which has initiated the termination of the 15043 execution. (Fortran 2008 or later.) 15044 15045`STAT_UNLOCKED': 15046 Scalar default-integer constant used as STAT= return value by 15047 `UNLOCK' to denote that the lock variable is unlocked. (Fortran 15048 2008 or later.) 15049 15050 The module provides the following derived type: 15051 15052`LOCK_TYPE': 15053 Derived type with private components to be use with the `LOCK' and 15054 `UNLOCK' statement. A variable of its type has to be always 15055 declared as coarray and may not appear in a variable-definition 15056 context. (Fortran 2008 or later.) 15057 15058 The module also provides the following intrinsic procedures: *note 15059COMPILER_OPTIONS:: and *note COMPILER_VERSION::. 15060 15061 15062File: gfortran.info, Node: ISO_C_BINDING, Next: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Prev: ISO_FORTRAN_ENV, Up: Intrinsic Modules 15063 150649.2 `ISO_C_BINDING' 15065=================== 15066 15067_Standard_: 15068 Fortran 2003 and later, GNU extensions 15069 15070 The following intrinsic procedures are provided by the module; their 15071definition can be found in the section Intrinsic Procedures of this 15072manual. 15073 15074`C_ASSOCIATED' 15075 15076`C_F_POINTER' 15077 15078`C_F_PROCPOINTER' 15079 15080`C_FUNLOC' 15081 15082`C_LOC' 15083 15084`C_SIZEOF' 15085 15086 The `ISO_C_BINDING' module provides the following named constants of 15087type default integer, which can be used as KIND type parameters. 15088 15089 In addition to the integer named constants required by the Fortran 150902003 standard and `C_PTRDIFF_T' of TS 29113, GNU Fortran provides as an 15091extension named constants for the 128-bit integer types supported by the 15092C compiler: `C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T'. 15093Furthermore, if `__float128' is supported in C, the named constants 15094`C_FLOAT128, C_FLOAT128_COMPLEX' are defined. 15095 15096Fortran Named constant C type Extension 15097Type 15098`INTEGER' `C_INT' `int' 15099`INTEGER' `C_SHORT' `short int' 15100`INTEGER' `C_LONG' `long int' 15101`INTEGER' `C_LONG_LONG' `long long int' 15102`INTEGER' `C_SIGNED_CHAR' `signed char'/`unsigned 15103 char' 15104`INTEGER' `C_SIZE_T' `size_t' 15105`INTEGER' `C_INT8_T' `int8_t' 15106`INTEGER' `C_INT16_T' `int16_t' 15107`INTEGER' `C_INT32_T' `int32_t' 15108`INTEGER' `C_INT64_T' `int64_t' 15109`INTEGER' `C_INT128_T' `int128_t' Ext. 15110`INTEGER' `C_INT_LEAST8_T' `int_least8_t' 15111`INTEGER' `C_INT_LEAST16_T' `int_least16_t' 15112`INTEGER' `C_INT_LEAST32_T' `int_least32_t' 15113`INTEGER' `C_INT_LEAST64_T' `int_least64_t' 15114`INTEGER' `C_INT_LEAST128_T' `int_least128_t' Ext. 15115`INTEGER' `C_INT_FAST8_T' `int_fast8_t' 15116`INTEGER' `C_INT_FAST16_T' `int_fast16_t' 15117`INTEGER' `C_INT_FAST32_T' `int_fast32_t' 15118`INTEGER' `C_INT_FAST64_T' `int_fast64_t' 15119`INTEGER' `C_INT_FAST128_T' `int_fast128_t' Ext. 15120`INTEGER' `C_INTMAX_T' `intmax_t' 15121`INTEGER' `C_INTPTR_T' `intptr_t' 15122`INTEGER' `C_PTRDIFF_T' `intptr_t' TS 29113 15123`REAL' `C_FLOAT' `float' 15124`REAL' `C_DOUBLE' `double' 15125`REAL' `C_LONG_DOUBLE' `long double' 15126`REAL' `C_FLOAT128' `__float128' Ext. 15127`COMPLEX' `C_FLOAT_COMPLEX' `float _Complex' 15128`COMPLEX' `C_DOUBLE_COMPLEX' `double _Complex' 15129`COMPLEX' `C_LONG_DOUBLE_COMPLEX' `long double _Complex' 15130`REAL' `C_FLOAT128_COMPLEX' `__float128 _Complex' Ext. 15131`LOGICAL' `C_BOOL' `_Bool' 15132`CHARACTER' `C_CHAR' `char' 15133 15134 Additionally, the following parameters of type 15135`CHARACTER(KIND=C_CHAR)' are defined. 15136 15137Name C definition Value 15138`C_NULL_CHAR' null character `'\0'' 15139`C_ALERT' alert `'\a'' 15140`C_BACKSPACE' backspace `'\b'' 15141`C_FORM_FEED' form feed `'\f'' 15142`C_NEW_LINE' new line `'\n'' 15143`C_CARRIAGE_RETURN'carriage return `'\r'' 15144`C_HORIZONTAL_TAB'horizontal tab `'\t'' 15145`C_VERTICAL_TAB'vertical tab `'\v'' 15146 15147 Moreover, the following two named constants are defined: 15148 15149Name Type 15150`C_NULL_PTR' `C_PTR' 15151`C_NULL_FUNPTR'`C_FUNPTR' 15152 15153 Both are equivalent to the value `NULL' in C. 15154 15155 15156File: gfortran.info, Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Prev: ISO_C_BINDING, Up: Intrinsic Modules 15157 151589.3 OpenMP Modules `OMP_LIB' and `OMP_LIB_KINDS' 15159================================================ 15160 15161_Standard_: 15162 OpenMP Application Program Interface v3.1 15163 15164 The OpenMP Fortran runtime library routines are provided both in a 15165form of two Fortran 90 modules, named `OMP_LIB' and `OMP_LIB_KINDS', 15166and in a form of a Fortran `include' file named `omp_lib.h'. The 15167procedures provided by `OMP_LIB' can be found in the *note 15168Introduction: (libgomp)Top. manual, the named constants defined in the 15169modules are listed below. 15170 15171 For details refer to the actual OpenMP Application Program Interface 15172v3.1 (http://www.openmp.org/mp-documents/spec31.pdf). 15173 15174 `OMP_LIB_KINDS' provides the following scalar default-integer named 15175constants: 15176 15177`omp_lock_kind' 15178 15179`omp_nest_lock_kind' 15180 15181`omp_sched_kind' 15182 15183 `OMP_LIB' provides the scalar default-integer named constant 15184`openmp_version' with a value of the form YYYYMM, where `yyyy' is the 15185year and MM the month of the OpenMP version; for OpenMP v3.1 the value 15186is `201107'. 15187 15188 And the following scalar integer named constants of the kind 15189`omp_sched_kind': 15190 15191`omp_sched_static' 15192 15193`omp_sched_dynamic' 15194 15195`omp_sched_guided' 15196 15197`omp_sched_auto' 15198 15199 15200File: gfortran.info, Node: Contributing, Next: Copying, Prev: Intrinsic Modules, Up: Top 15201 15202Contributing 15203************ 15204 15205Free software is only possible if people contribute to efforts to 15206create it. We're always in need of more people helping out with ideas 15207and comments, writing documentation and contributing code. 15208 15209 If you want to contribute to GNU Fortran, have a look at the long 15210lists of projects you can take on. Some of these projects are small, 15211some of them are large; some are completely orthogonal to the rest of 15212what is happening on GNU Fortran, but others are "mainstream" projects 15213in need of enthusiastic hackers. All of these projects are important! 15214We will eventually get around to the things here, but they are also 15215things doable by someone who is willing and able. 15216 15217* Menu: 15218 15219* Contributors:: 15220* Projects:: 15221* Proposed Extensions:: 15222 15223 15224File: gfortran.info, Node: Contributors, Next: Projects, Up: Contributing 15225 15226Contributors to GNU Fortran 15227=========================== 15228 15229Most of the parser was hand-crafted by _Andy Vaught_, who is also the 15230initiator of the whole project. Thanks Andy! Most of the interface 15231with GCC was written by _Paul Brook_. 15232 15233 The following individuals have contributed code and/or ideas and 15234significant help to the GNU Fortran project (in alphabetical order): 15235 15236 - Janne Blomqvist 15237 15238 - Steven Bosscher 15239 15240 - Paul Brook 15241 15242 - Tobias Burnus 15243 15244 - Franc,ois-Xavier Coudert 15245 15246 - Bud Davis 15247 15248 - Jerry DeLisle 15249 15250 - Erik Edelmann 15251 15252 - Bernhard Fischer 15253 15254 - Daniel Franke 15255 15256 - Richard Guenther 15257 15258 - Richard Henderson 15259 15260 - Katherine Holcomb 15261 15262 - Jakub Jelinek 15263 15264 - Niels Kristian Bech Jensen 15265 15266 - Steven Johnson 15267 15268 - Steven G. Kargl 15269 15270 - Thomas Koenig 15271 15272 - Asher Langton 15273 15274 - H. J. Lu 15275 15276 - Toon Moene 15277 15278 - Brooks Moses 15279 15280 - Andrew Pinski 15281 15282 - Tim Prince 15283 15284 - Christopher D. Rickett 15285 15286 - Richard Sandiford 15287 15288 - Tobias Schlu"ter 15289 15290 - Roger Sayle 15291 15292 - Paul Thomas 15293 15294 - Andy Vaught 15295 15296 - Feng Wang 15297 15298 - Janus Weil 15299 15300 - Daniel Kraft 15301 15302 The following people have contributed bug reports, smaller or larger 15303patches, and much needed feedback and encouragement for the GNU Fortran 15304project: 15305 15306 - Bill Clodius 15307 15308 - Dominique d'Humie`res 15309 15310 - Kate Hedstrom 15311 15312 - Erik Schnetter 15313 15314 - Joost VandeVondele 15315 15316 Many other individuals have helped debug, test and improve the GNU 15317Fortran compiler over the past few years, and we welcome you to do the 15318same! If you already have done so, and you would like to see your name 15319listed in the list above, please contact us. 15320 15321 15322File: gfortran.info, Node: Projects, Next: Proposed Extensions, Prev: Contributors, Up: Contributing 15323 15324Projects 15325======== 15326 15327_Help build the test suite_ 15328 Solicit more code for donation to the test suite: the more 15329 extensive the testsuite, the smaller the risk of breaking things 15330 in the future! We can keep code private on request. 15331 15332_Bug hunting/squishing_ 15333 Find bugs and write more test cases! Test cases are especially very 15334 welcome, because it allows us to concentrate on fixing bugs 15335 instead of isolating them. Going through the bugzilla database at 15336 `http://gcc.gnu.org/bugzilla/' to reduce testcases posted there and 15337 add more information (for example, for which version does the 15338 testcase work, for which versions does it fail?) is also very 15339 helpful. 15340 15341 15342 15343File: gfortran.info, Node: Proposed Extensions, Prev: Projects, Up: Contributing 15344 15345Proposed Extensions 15346=================== 15347 15348Here's a list of proposed extensions for the GNU Fortran compiler, in 15349no particular order. Most of these are necessary to be fully 15350compatible with existing Fortran compilers, but they are not part of 15351the official J3 Fortran 95 standard. 15352 15353Compiler extensions: 15354-------------------- 15355 15356 * User-specified alignment rules for structures. 15357 15358 * Automatically extend single precision constants to double. 15359 15360 * Compile code that conserves memory by dynamically allocating 15361 common and module storage either on stack or heap. 15362 15363 * Compile flag to generate code for array conformance checking 15364 (suggest -CC). 15365 15366 * User control of symbol names (underscores, etc). 15367 15368 * Compile setting for maximum size of stack frame size before 15369 spilling parts to static or heap. 15370 15371 * Flag to force local variables into static space. 15372 15373 * Flag to force local variables onto stack. 15374 15375Environment Options 15376------------------- 15377 15378 * Pluggable library modules for random numbers, linear algebra. LA 15379 should use BLAS calling conventions. 15380 15381 * Environment variables controlling actions on arithmetic exceptions 15382 like overflow, underflow, precision loss--Generate NaN, abort, 15383 default. action. 15384 15385 * Set precision for fp units that support it (i387). 15386 15387 * Variable for setting fp rounding mode. 15388 15389 * Variable to fill uninitialized variables with a user-defined bit 15390 pattern. 15391 15392 * Environment variable controlling filename that is opened for that 15393 unit number. 15394 15395 * Environment variable to clear/trash memory being freed. 15396 15397 * Environment variable to control tracing of allocations and frees. 15398 15399 * Environment variable to display allocated memory at normal program 15400 end. 15401 15402 * Environment variable for filename for * IO-unit. 15403 15404 * Environment variable for temporary file directory. 15405 15406 * Environment variable forcing standard output to be line buffered 15407 (Unix). 15408 15409 15410 15411File: gfortran.info, Node: Copying, Next: GNU Free Documentation License, Prev: Contributing, Up: Top 15412 15413GNU General Public License 15414************************** 15415 15416 Version 3, 29 June 2007 15417 15418 Copyright (C) 2007 Free Software Foundation, Inc. `http://fsf.org/' 15419 15420 Everyone is permitted to copy and distribute verbatim copies of this 15421 license document, but changing it is not allowed. 15422 15423Preamble 15424======== 15425 15426The GNU General Public License is a free, copyleft license for software 15427and other kinds of works. 15428 15429 The licenses for most software and other practical works are designed 15430to take away your freedom to share and change the works. By contrast, 15431the GNU General Public License is intended to guarantee your freedom to 15432share and change all versions of a program-to make sure it remains free 15433software for all its users. We, the Free Software Foundation, use the 15434GNU General Public License for most of our software; it applies also to 15435any other work released this way by its authors. You can apply it to 15436your programs, too. 15437 15438 When we speak of free software, we are referring to freedom, not 15439price. Our General Public Licenses are designed to make sure that you 15440have the freedom to distribute copies of free software (and charge for 15441them if you wish), that you receive source code or can get it if you 15442want it, that you can change the software or use pieces of it in new 15443free programs, and that you know you can do these things. 15444 15445 To protect your rights, we need to prevent others from denying you 15446these rights or asking you to surrender the rights. Therefore, you 15447have certain responsibilities if you distribute copies of the software, 15448or if you modify it: responsibilities to respect the freedom of others. 15449 15450 For example, if you distribute copies of such a program, whether 15451gratis or for a fee, you must pass on to the recipients the same 15452freedoms that you received. You must make sure that they, too, receive 15453or can get the source code. And you must show them these terms so they 15454know their rights. 15455 15456 Developers that use the GNU GPL protect your rights with two steps: 15457(1) assert copyright on the software, and (2) offer you this License 15458giving you legal permission to copy, distribute and/or modify it. 15459 15460 For the developers' and authors' protection, the GPL clearly explains 15461that there is no warranty for this free software. For both users' and 15462authors' sake, the GPL requires that modified versions be marked as 15463changed, so that their problems will not be attributed erroneously to 15464authors of previous versions. 15465 15466 Some devices are designed to deny users access to install or run 15467modified versions of the software inside them, although the 15468manufacturer can do so. This is fundamentally incompatible with the 15469aim of protecting users' freedom to change the software. The 15470systematic pattern of such abuse occurs in the area of products for 15471individuals to use, which is precisely where it is most unacceptable. 15472Therefore, we have designed this version of the GPL to prohibit the 15473practice for those products. If such problems arise substantially in 15474other domains, we stand ready to extend this provision to those domains 15475in future versions of the GPL, as needed to protect the freedom of 15476users. 15477 15478 Finally, every program is threatened constantly by software patents. 15479States should not allow patents to restrict development and use of 15480software on general-purpose computers, but in those that do, we wish to 15481avoid the special danger that patents applied to a free program could 15482make it effectively proprietary. To prevent this, the GPL assures that 15483patents cannot be used to render the program non-free. 15484 15485 The precise terms and conditions for copying, distribution and 15486modification follow. 15487 15488TERMS AND CONDITIONS 15489==================== 15490 15491 0. Definitions. 15492 15493 "This License" refers to version 3 of the GNU General Public 15494 License. 15495 15496 "Copyright" also means copyright-like laws that apply to other 15497 kinds of works, such as semiconductor masks. 15498 15499 "The Program" refers to any copyrightable work licensed under this 15500 License. Each licensee is addressed as "you". "Licensees" and 15501 "recipients" may be individuals or organizations. 15502 15503 To "modify" a work means to copy from or adapt all or part of the 15504 work in a fashion requiring copyright permission, other than the 15505 making of an exact copy. The resulting work is called a "modified 15506 version" of the earlier work or a work "based on" the earlier work. 15507 15508 A "covered work" means either the unmodified Program or a work 15509 based on the Program. 15510 15511 To "propagate" a work means to do anything with it that, without 15512 permission, would make you directly or secondarily liable for 15513 infringement under applicable copyright law, except executing it 15514 on a computer or modifying a private copy. Propagation includes 15515 copying, distribution (with or without modification), making 15516 available to the public, and in some countries other activities as 15517 well. 15518 15519 To "convey" a work means any kind of propagation that enables other 15520 parties to make or receive copies. Mere interaction with a user 15521 through a computer network, with no transfer of a copy, is not 15522 conveying. 15523 15524 An interactive user interface displays "Appropriate Legal Notices" 15525 to the extent that it includes a convenient and prominently visible 15526 feature that (1) displays an appropriate copyright notice, and (2) 15527 tells the user that there is no warranty for the work (except to 15528 the extent that warranties are provided), that licensees may 15529 convey the work under this License, and how to view a copy of this 15530 License. If the interface presents a list of user commands or 15531 options, such as a menu, a prominent item in the list meets this 15532 criterion. 15533 15534 1. Source Code. 15535 15536 The "source code" for a work means the preferred form of the work 15537 for making modifications to it. "Object code" means any 15538 non-source form of a work. 15539 15540 A "Standard Interface" means an interface that either is an 15541 official standard defined by a recognized standards body, or, in 15542 the case of interfaces specified for a particular programming 15543 language, one that is widely used among developers working in that 15544 language. 15545 15546 The "System Libraries" of an executable work include anything, 15547 other than the work as a whole, that (a) is included in the normal 15548 form of packaging a Major Component, but which is not part of that 15549 Major Component, and (b) serves only to enable use of the work 15550 with that Major Component, or to implement a Standard Interface 15551 for which an implementation is available to the public in source 15552 code form. A "Major Component", in this context, means a major 15553 essential component (kernel, window system, and so on) of the 15554 specific operating system (if any) on which the executable work 15555 runs, or a compiler used to produce the work, or an object code 15556 interpreter used to run it. 15557 15558 The "Corresponding Source" for a work in object code form means all 15559 the source code needed to generate, install, and (for an executable 15560 work) run the object code and to modify the work, including 15561 scripts to control those activities. However, it does not include 15562 the work's System Libraries, or general-purpose tools or generally 15563 available free programs which are used unmodified in performing 15564 those activities but which are not part of the work. For example, 15565 Corresponding Source includes interface definition files 15566 associated with source files for the work, and the source code for 15567 shared libraries and dynamically linked subprograms that the work 15568 is specifically designed to require, such as by intimate data 15569 communication or control flow between those subprograms and other 15570 parts of the work. 15571 15572 The Corresponding Source need not include anything that users can 15573 regenerate automatically from other parts of the Corresponding 15574 Source. 15575 15576 The Corresponding Source for a work in source code form is that 15577 same work. 15578 15579 2. Basic Permissions. 15580 15581 All rights granted under this License are granted for the term of 15582 copyright on the Program, and are irrevocable provided the stated 15583 conditions are met. This License explicitly affirms your unlimited 15584 permission to run the unmodified Program. The output from running 15585 a covered work is covered by this License only if the output, 15586 given its content, constitutes a covered work. This License 15587 acknowledges your rights of fair use or other equivalent, as 15588 provided by copyright law. 15589 15590 You may make, run and propagate covered works that you do not 15591 convey, without conditions so long as your license otherwise 15592 remains in force. You may convey covered works to others for the 15593 sole purpose of having them make modifications exclusively for 15594 you, or provide you with facilities for running those works, 15595 provided that you comply with the terms of this License in 15596 conveying all material for which you do not control copyright. 15597 Those thus making or running the covered works for you must do so 15598 exclusively on your behalf, under your direction and control, on 15599 terms that prohibit them from making any copies of your 15600 copyrighted material outside their relationship with you. 15601 15602 Conveying under any other circumstances is permitted solely under 15603 the conditions stated below. Sublicensing is not allowed; section 15604 10 makes it unnecessary. 15605 15606 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 15607 15608 No covered work shall be deemed part of an effective technological 15609 measure under any applicable law fulfilling obligations under 15610 article 11 of the WIPO copyright treaty adopted on 20 December 15611 1996, or similar laws prohibiting or restricting circumvention of 15612 such measures. 15613 15614 When you convey a covered work, you waive any legal power to forbid 15615 circumvention of technological measures to the extent such 15616 circumvention is effected by exercising rights under this License 15617 with respect to the covered work, and you disclaim any intention 15618 to limit operation or modification of the work as a means of 15619 enforcing, against the work's users, your or third parties' legal 15620 rights to forbid circumvention of technological measures. 15621 15622 4. Conveying Verbatim Copies. 15623 15624 You may convey verbatim copies of the Program's source code as you 15625 receive it, in any medium, provided that you conspicuously and 15626 appropriately publish on each copy an appropriate copyright notice; 15627 keep intact all notices stating that this License and any 15628 non-permissive terms added in accord with section 7 apply to the 15629 code; keep intact all notices of the absence of any warranty; and 15630 give all recipients a copy of this License along with the Program. 15631 15632 You may charge any price or no price for each copy that you convey, 15633 and you may offer support or warranty protection for a fee. 15634 15635 5. Conveying Modified Source Versions. 15636 15637 You may convey a work based on the Program, or the modifications to 15638 produce it from the Program, in the form of source code under the 15639 terms of section 4, provided that you also meet all of these 15640 conditions: 15641 15642 a. The work must carry prominent notices stating that you 15643 modified it, and giving a relevant date. 15644 15645 b. The work must carry prominent notices stating that it is 15646 released under this License and any conditions added under 15647 section 7. This requirement modifies the requirement in 15648 section 4 to "keep intact all notices". 15649 15650 c. You must license the entire work, as a whole, under this 15651 License to anyone who comes into possession of a copy. This 15652 License will therefore apply, along with any applicable 15653 section 7 additional terms, to the whole of the work, and all 15654 its parts, regardless of how they are packaged. This License 15655 gives no permission to license the work in any other way, but 15656 it does not invalidate such permission if you have separately 15657 received it. 15658 15659 d. If the work has interactive user interfaces, each must display 15660 Appropriate Legal Notices; however, if the Program has 15661 interactive interfaces that do not display Appropriate Legal 15662 Notices, your work need not make them do so. 15663 15664 A compilation of a covered work with other separate and independent 15665 works, which are not by their nature extensions of the covered 15666 work, and which are not combined with it such as to form a larger 15667 program, in or on a volume of a storage or distribution medium, is 15668 called an "aggregate" if the compilation and its resulting 15669 copyright are not used to limit the access or legal rights of the 15670 compilation's users beyond what the individual works permit. 15671 Inclusion of a covered work in an aggregate does not cause this 15672 License to apply to the other parts of the aggregate. 15673 15674 6. Conveying Non-Source Forms. 15675 15676 You may convey a covered work in object code form under the terms 15677 of sections 4 and 5, provided that you also convey the 15678 machine-readable Corresponding Source under the terms of this 15679 License, in one of these ways: 15680 15681 a. Convey the object code in, or embodied in, a physical product 15682 (including a physical distribution medium), accompanied by the 15683 Corresponding Source fixed on a durable physical medium 15684 customarily used for software interchange. 15685 15686 b. Convey the object code in, or embodied in, a physical product 15687 (including a physical distribution medium), accompanied by a 15688 written offer, valid for at least three years and valid for 15689 as long as you offer spare parts or customer support for that 15690 product model, to give anyone who possesses the object code 15691 either (1) a copy of the Corresponding Source for all the 15692 software in the product that is covered by this License, on a 15693 durable physical medium customarily used for software 15694 interchange, for a price no more than your reasonable cost of 15695 physically performing this conveying of source, or (2) access 15696 to copy the Corresponding Source from a network server at no 15697 charge. 15698 15699 c. Convey individual copies of the object code with a copy of 15700 the written offer to provide the Corresponding Source. This 15701 alternative is allowed only occasionally and noncommercially, 15702 and only if you received the object code with such an offer, 15703 in accord with subsection 6b. 15704 15705 d. Convey the object code by offering access from a designated 15706 place (gratis or for a charge), and offer equivalent access 15707 to the Corresponding Source in the same way through the same 15708 place at no further charge. You need not require recipients 15709 to copy the Corresponding Source along with the object code. 15710 If the place to copy the object code is a network server, the 15711 Corresponding Source may be on a different server (operated 15712 by you or a third party) that supports equivalent copying 15713 facilities, provided you maintain clear directions next to 15714 the object code saying where to find the Corresponding Source. 15715 Regardless of what server hosts the Corresponding Source, you 15716 remain obligated to ensure that it is available for as long 15717 as needed to satisfy these requirements. 15718 15719 e. Convey the object code using peer-to-peer transmission, 15720 provided you inform other peers where the object code and 15721 Corresponding Source of the work are being offered to the 15722 general public at no charge under subsection 6d. 15723 15724 15725 A separable portion of the object code, whose source code is 15726 excluded from the Corresponding Source as a System Library, need 15727 not be included in conveying the object code work. 15728 15729 A "User Product" is either (1) a "consumer product", which means 15730 any tangible personal property which is normally used for personal, 15731 family, or household purposes, or (2) anything designed or sold for 15732 incorporation into a dwelling. In determining whether a product 15733 is a consumer product, doubtful cases shall be resolved in favor of 15734 coverage. For a particular product received by a particular user, 15735 "normally used" refers to a typical or common use of that class of 15736 product, regardless of the status of the particular user or of the 15737 way in which the particular user actually uses, or expects or is 15738 expected to use, the product. A product is a consumer product 15739 regardless of whether the product has substantial commercial, 15740 industrial or non-consumer uses, unless such uses represent the 15741 only significant mode of use of the product. 15742 15743 "Installation Information" for a User Product means any methods, 15744 procedures, authorization keys, or other information required to 15745 install and execute modified versions of a covered work in that 15746 User Product from a modified version of its Corresponding Source. 15747 The information must suffice to ensure that the continued 15748 functioning of the modified object code is in no case prevented or 15749 interfered with solely because modification has been made. 15750 15751 If you convey an object code work under this section in, or with, 15752 or specifically for use in, a User Product, and the conveying 15753 occurs as part of a transaction in which the right of possession 15754 and use of the User Product is transferred to the recipient in 15755 perpetuity or for a fixed term (regardless of how the transaction 15756 is characterized), the Corresponding Source conveyed under this 15757 section must be accompanied by the Installation Information. But 15758 this requirement does not apply if neither you nor any third party 15759 retains the ability to install modified object code on the User 15760 Product (for example, the work has been installed in ROM). 15761 15762 The requirement to provide Installation Information does not 15763 include a requirement to continue to provide support service, 15764 warranty, or updates for a work that has been modified or 15765 installed by the recipient, or for the User Product in which it 15766 has been modified or installed. Access to a network may be denied 15767 when the modification itself materially and adversely affects the 15768 operation of the network or violates the rules and protocols for 15769 communication across the network. 15770 15771 Corresponding Source conveyed, and Installation Information 15772 provided, in accord with this section must be in a format that is 15773 publicly documented (and with an implementation available to the 15774 public in source code form), and must require no special password 15775 or key for unpacking, reading or copying. 15776 15777 7. Additional Terms. 15778 15779 "Additional permissions" are terms that supplement the terms of 15780 this License by making exceptions from one or more of its 15781 conditions. Additional permissions that are applicable to the 15782 entire Program shall be treated as though they were included in 15783 this License, to the extent that they are valid under applicable 15784 law. If additional permissions apply only to part of the Program, 15785 that part may be used separately under those permissions, but the 15786 entire Program remains governed by this License without regard to 15787 the additional permissions. 15788 15789 When you convey a copy of a covered work, you may at your option 15790 remove any additional permissions from that copy, or from any part 15791 of it. (Additional permissions may be written to require their own 15792 removal in certain cases when you modify the work.) You may place 15793 additional permissions on material, added by you to a covered work, 15794 for which you have or can give appropriate copyright permission. 15795 15796 Notwithstanding any other provision of this License, for material 15797 you add to a covered work, you may (if authorized by the copyright 15798 holders of that material) supplement the terms of this License 15799 with terms: 15800 15801 a. Disclaiming warranty or limiting liability differently from 15802 the terms of sections 15 and 16 of this License; or 15803 15804 b. Requiring preservation of specified reasonable legal notices 15805 or author attributions in that material or in the Appropriate 15806 Legal Notices displayed by works containing it; or 15807 15808 c. Prohibiting misrepresentation of the origin of that material, 15809 or requiring that modified versions of such material be 15810 marked in reasonable ways as different from the original 15811 version; or 15812 15813 d. Limiting the use for publicity purposes of names of licensors 15814 or authors of the material; or 15815 15816 e. Declining to grant rights under trademark law for use of some 15817 trade names, trademarks, or service marks; or 15818 15819 f. Requiring indemnification of licensors and authors of that 15820 material by anyone who conveys the material (or modified 15821 versions of it) with contractual assumptions of liability to 15822 the recipient, for any liability that these contractual 15823 assumptions directly impose on those licensors and authors. 15824 15825 All other non-permissive additional terms are considered "further 15826 restrictions" within the meaning of section 10. If the Program as 15827 you received it, or any part of it, contains a notice stating that 15828 it is governed by this License along with a term that is a further 15829 restriction, you may remove that term. If a license document 15830 contains a further restriction but permits relicensing or 15831 conveying under this License, you may add to a covered work 15832 material governed by the terms of that license document, provided 15833 that the further restriction does not survive such relicensing or 15834 conveying. 15835 15836 If you add terms to a covered work in accord with this section, you 15837 must place, in the relevant source files, a statement of the 15838 additional terms that apply to those files, or a notice indicating 15839 where to find the applicable terms. 15840 15841 Additional terms, permissive or non-permissive, may be stated in 15842 the form of a separately written license, or stated as exceptions; 15843 the above requirements apply either way. 15844 15845 8. Termination. 15846 15847 You may not propagate or modify a covered work except as expressly 15848 provided under this License. Any attempt otherwise to propagate or 15849 modify it is void, and will automatically terminate your rights 15850 under this License (including any patent licenses granted under 15851 the third paragraph of section 11). 15852 15853 However, if you cease all violation of this License, then your 15854 license from a particular copyright holder is reinstated (a) 15855 provisionally, unless and until the copyright holder explicitly 15856 and finally terminates your license, and (b) permanently, if the 15857 copyright holder fails to notify you of the violation by some 15858 reasonable means prior to 60 days after the cessation. 15859 15860 Moreover, your license from a particular copyright holder is 15861 reinstated permanently if the copyright holder notifies you of the 15862 violation by some reasonable means, this is the first time you have 15863 received notice of violation of this License (for any work) from 15864 that copyright holder, and you cure the violation prior to 30 days 15865 after your receipt of the notice. 15866 15867 Termination of your rights under this section does not terminate 15868 the licenses of parties who have received copies or rights from 15869 you under this License. If your rights have been terminated and 15870 not permanently reinstated, you do not qualify to receive new 15871 licenses for the same material under section 10. 15872 15873 9. Acceptance Not Required for Having Copies. 15874 15875 You are not required to accept this License in order to receive or 15876 run a copy of the Program. Ancillary propagation of a covered work 15877 occurring solely as a consequence of using peer-to-peer 15878 transmission to receive a copy likewise does not require 15879 acceptance. However, nothing other than this License grants you 15880 permission to propagate or modify any covered work. These actions 15881 infringe copyright if you do not accept this License. Therefore, 15882 by modifying or propagating a covered work, you indicate your 15883 acceptance of this License to do so. 15884 15885 10. Automatic Licensing of Downstream Recipients. 15886 15887 Each time you convey a covered work, the recipient automatically 15888 receives a license from the original licensors, to run, modify and 15889 propagate that work, subject to this License. You are not 15890 responsible for enforcing compliance by third parties with this 15891 License. 15892 15893 An "entity transaction" is a transaction transferring control of an 15894 organization, or substantially all assets of one, or subdividing an 15895 organization, or merging organizations. If propagation of a 15896 covered work results from an entity transaction, each party to that 15897 transaction who receives a copy of the work also receives whatever 15898 licenses to the work the party's predecessor in interest had or 15899 could give under the previous paragraph, plus a right to 15900 possession of the Corresponding Source of the work from the 15901 predecessor in interest, if the predecessor has it or can get it 15902 with reasonable efforts. 15903 15904 You may not impose any further restrictions on the exercise of the 15905 rights granted or affirmed under this License. For example, you 15906 may not impose a license fee, royalty, or other charge for 15907 exercise of rights granted under this License, and you may not 15908 initiate litigation (including a cross-claim or counterclaim in a 15909 lawsuit) alleging that any patent claim is infringed by making, 15910 using, selling, offering for sale, or importing the Program or any 15911 portion of it. 15912 15913 11. Patents. 15914 15915 A "contributor" is a copyright holder who authorizes use under this 15916 License of the Program or a work on which the Program is based. 15917 The work thus licensed is called the contributor's "contributor 15918 version". 15919 15920 A contributor's "essential patent claims" are all patent claims 15921 owned or controlled by the contributor, whether already acquired or 15922 hereafter acquired, that would be infringed by some manner, 15923 permitted by this License, of making, using, or selling its 15924 contributor version, but do not include claims that would be 15925 infringed only as a consequence of further modification of the 15926 contributor version. For purposes of this definition, "control" 15927 includes the right to grant patent sublicenses in a manner 15928 consistent with the requirements of this License. 15929 15930 Each contributor grants you a non-exclusive, worldwide, 15931 royalty-free patent license under the contributor's essential 15932 patent claims, to make, use, sell, offer for sale, import and 15933 otherwise run, modify and propagate the contents of its 15934 contributor version. 15935 15936 In the following three paragraphs, a "patent license" is any 15937 express agreement or commitment, however denominated, not to 15938 enforce a patent (such as an express permission to practice a 15939 patent or covenant not to sue for patent infringement). To 15940 "grant" such a patent license to a party means to make such an 15941 agreement or commitment not to enforce a patent against the party. 15942 15943 If you convey a covered work, knowingly relying on a patent 15944 license, and the Corresponding Source of the work is not available 15945 for anyone to copy, free of charge and under the terms of this 15946 License, through a publicly available network server or other 15947 readily accessible means, then you must either (1) cause the 15948 Corresponding Source to be so available, or (2) arrange to deprive 15949 yourself of the benefit of the patent license for this particular 15950 work, or (3) arrange, in a manner consistent with the requirements 15951 of this License, to extend the patent license to downstream 15952 recipients. "Knowingly relying" means you have actual knowledge 15953 that, but for the patent license, your conveying the covered work 15954 in a country, or your recipient's use of the covered work in a 15955 country, would infringe one or more identifiable patents in that 15956 country that you have reason to believe are valid. 15957 15958 If, pursuant to or in connection with a single transaction or 15959 arrangement, you convey, or propagate by procuring conveyance of, a 15960 covered work, and grant a patent license to some of the parties 15961 receiving the covered work authorizing them to use, propagate, 15962 modify or convey a specific copy of the covered work, then the 15963 patent license you grant is automatically extended to all 15964 recipients of the covered work and works based on it. 15965 15966 A patent license is "discriminatory" if it does not include within 15967 the scope of its coverage, prohibits the exercise of, or is 15968 conditioned on the non-exercise of one or more of the rights that 15969 are specifically granted under this License. You may not convey a 15970 covered work if you are a party to an arrangement with a third 15971 party that is in the business of distributing software, under 15972 which you make payment to the third party based on the extent of 15973 your activity of conveying the work, and under which the third 15974 party grants, to any of the parties who would receive the covered 15975 work from you, a discriminatory patent license (a) in connection 15976 with copies of the covered work conveyed by you (or copies made 15977 from those copies), or (b) primarily for and in connection with 15978 specific products or compilations that contain the covered work, 15979 unless you entered into that arrangement, or that patent license 15980 was granted, prior to 28 March 2007. 15981 15982 Nothing in this License shall be construed as excluding or limiting 15983 any implied license or other defenses to infringement that may 15984 otherwise be available to you under applicable patent law. 15985 15986 12. No Surrender of Others' Freedom. 15987 15988 If conditions are imposed on you (whether by court order, 15989 agreement or otherwise) that contradict the conditions of this 15990 License, they do not excuse you from the conditions of this 15991 License. If you cannot convey a covered work so as to satisfy 15992 simultaneously your obligations under this License and any other 15993 pertinent obligations, then as a consequence you may not convey it 15994 at all. For example, if you agree to terms that obligate you to 15995 collect a royalty for further conveying from those to whom you 15996 convey the Program, the only way you could satisfy both those 15997 terms and this License would be to refrain entirely from conveying 15998 the Program. 15999 16000 13. Use with the GNU Affero General Public License. 16001 16002 Notwithstanding any other provision of this License, you have 16003 permission to link or combine any covered work with a work licensed 16004 under version 3 of the GNU Affero General Public License into a 16005 single combined work, and to convey the resulting work. The terms 16006 of this License will continue to apply to the part which is the 16007 covered work, but the special requirements of the GNU Affero 16008 General Public License, section 13, concerning interaction through 16009 a network will apply to the combination as such. 16010 16011 14. Revised Versions of this License. 16012 16013 The Free Software Foundation may publish revised and/or new 16014 versions of the GNU General Public License from time to time. 16015 Such new versions will be similar in spirit to the present 16016 version, but may differ in detail to address new problems or 16017 concerns. 16018 16019 Each version is given a distinguishing version number. If the 16020 Program specifies that a certain numbered version of the GNU 16021 General Public License "or any later version" applies to it, you 16022 have the option of following the terms and conditions either of 16023 that numbered version or of any later version published by the 16024 Free Software Foundation. If the Program does not specify a 16025 version number of the GNU General Public License, you may choose 16026 any version ever published by the Free Software Foundation. 16027 16028 If the Program specifies that a proxy can decide which future 16029 versions of the GNU General Public License can be used, that 16030 proxy's public statement of acceptance of a version permanently 16031 authorizes you to choose that version for the Program. 16032 16033 Later license versions may give you additional or different 16034 permissions. However, no additional obligations are imposed on any 16035 author or copyright holder as a result of your choosing to follow a 16036 later version. 16037 16038 15. Disclaimer of Warranty. 16039 16040 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 16041 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE 16042 COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" 16043 WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 16044 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 16045 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE 16046 RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. 16047 SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL 16048 NECESSARY SERVICING, REPAIR OR CORRECTION. 16049 16050 16. Limitation of Liability. 16051 16052 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 16053 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES 16054 AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU 16055 FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 16056 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE 16057 THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA 16058 BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 16059 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 16060 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF 16061 THE POSSIBILITY OF SUCH DAMAGES. 16062 16063 17. Interpretation of Sections 15 and 16. 16064 16065 If the disclaimer of warranty and limitation of liability provided 16066 above cannot be given local legal effect according to their terms, 16067 reviewing courts shall apply local law that most closely 16068 approximates an absolute waiver of all civil liability in 16069 connection with the Program, unless a warranty or assumption of 16070 liability accompanies a copy of the Program in return for a fee. 16071 16072 16073END OF TERMS AND CONDITIONS 16074=========================== 16075 16076How to Apply These Terms to Your New Programs 16077============================================= 16078 16079If you develop a new program, and you want it to be of the greatest 16080possible use to the public, the best way to achieve this is to make it 16081free software which everyone can redistribute and change under these 16082terms. 16083 16084 To do so, attach the following notices to the program. It is safest 16085to attach them to the start of each source file to most effectively 16086state the exclusion of warranty; and each file should have at least the 16087"copyright" line and a pointer to where the full notice is found. 16088 16089 ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. 16090 Copyright (C) YEAR NAME OF AUTHOR 16091 16092 This program is free software: you can redistribute it and/or modify 16093 it under the terms of the GNU General Public License as published by 16094 the Free Software Foundation, either version 3 of the License, or (at 16095 your option) any later version. 16096 16097 This program is distributed in the hope that it will be useful, but 16098 WITHOUT ANY WARRANTY; without even the implied warranty of 16099 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16100 General Public License for more details. 16101 16102 You should have received a copy of the GNU General Public License 16103 along with this program. If not, see `http://www.gnu.org/licenses/'. 16104 16105 Also add information on how to contact you by electronic and paper 16106mail. 16107 16108 If the program does terminal interaction, make it output a short 16109notice like this when it starts in an interactive mode: 16110 16111 PROGRAM Copyright (C) YEAR NAME OF AUTHOR 16112 This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 16113 This is free software, and you are welcome to redistribute it 16114 under certain conditions; type `show c' for details. 16115 16116 The hypothetical commands `show w' and `show c' should show the 16117appropriate parts of the General Public License. Of course, your 16118program's commands might be different; for a GUI interface, you would 16119use an "about box". 16120 16121 You should also get your employer (if you work as a programmer) or 16122school, if any, to sign a "copyright disclaimer" for the program, if 16123necessary. For more information on this, and how to apply and follow 16124the GNU GPL, see `http://www.gnu.org/licenses/'. 16125 16126 The GNU General Public License does not permit incorporating your 16127program into proprietary programs. If your program is a subroutine 16128library, you may consider it more useful to permit linking proprietary 16129applications with the library. If this is what you want to do, use the 16130GNU Lesser General Public License instead of this License. But first, 16131please read `http://www.gnu.org/philosophy/why-not-lgpl.html'. 16132 16133 16134File: gfortran.info, Node: GNU Free Documentation License, Next: Funding, Prev: Copying, Up: Top 16135 16136GNU Free Documentation License 16137****************************** 16138 16139 Version 1.3, 3 November 2008 16140 16141 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 16142 `http://fsf.org/' 16143 16144 Everyone is permitted to copy and distribute verbatim copies 16145 of this license document, but changing it is not allowed. 16146 16147 0. PREAMBLE 16148 16149 The purpose of this License is to make a manual, textbook, or other 16150 functional and useful document "free" in the sense of freedom: to 16151 assure everyone the effective freedom to copy and redistribute it, 16152 with or without modifying it, either commercially or 16153 noncommercially. Secondarily, this License preserves for the 16154 author and publisher a way to get credit for their work, while not 16155 being considered responsible for modifications made by others. 16156 16157 This License is a kind of "copyleft", which means that derivative 16158 works of the document must themselves be free in the same sense. 16159 It complements the GNU General Public License, which is a copyleft 16160 license designed for free software. 16161 16162 We have designed this License in order to use it for manuals for 16163 free software, because free software needs free documentation: a 16164 free program should come with manuals providing the same freedoms 16165 that the software does. But this License is not limited to 16166 software manuals; it can be used for any textual work, regardless 16167 of subject matter or whether it is published as a printed book. 16168 We recommend this License principally for works whose purpose is 16169 instruction or reference. 16170 16171 1. APPLICABILITY AND DEFINITIONS 16172 16173 This License applies to any manual or other work, in any medium, 16174 that contains a notice placed by the copyright holder saying it 16175 can be distributed under the terms of this License. Such a notice 16176 grants a world-wide, royalty-free license, unlimited in duration, 16177 to use that work under the conditions stated herein. The 16178 "Document", below, refers to any such manual or work. Any member 16179 of the public is a licensee, and is addressed as "you". You 16180 accept the license if you copy, modify or distribute the work in a 16181 way requiring permission under copyright law. 16182 16183 A "Modified Version" of the Document means any work containing the 16184 Document or a portion of it, either copied verbatim, or with 16185 modifications and/or translated into another language. 16186 16187 A "Secondary Section" is a named appendix or a front-matter section 16188 of the Document that deals exclusively with the relationship of the 16189 publishers or authors of the Document to the Document's overall 16190 subject (or to related matters) and contains nothing that could 16191 fall directly within that overall subject. (Thus, if the Document 16192 is in part a textbook of mathematics, a Secondary Section may not 16193 explain any mathematics.) The relationship could be a matter of 16194 historical connection with the subject or with related matters, or 16195 of legal, commercial, philosophical, ethical or political position 16196 regarding them. 16197 16198 The "Invariant Sections" are certain Secondary Sections whose 16199 titles are designated, as being those of Invariant Sections, in 16200 the notice that says that the Document is released under this 16201 License. If a section does not fit the above definition of 16202 Secondary then it is not allowed to be designated as Invariant. 16203 The Document may contain zero Invariant Sections. If the Document 16204 does not identify any Invariant Sections then there are none. 16205 16206 The "Cover Texts" are certain short passages of text that are 16207 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 16208 that says that the Document is released under this License. A 16209 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 16210 be at most 25 words. 16211 16212 A "Transparent" copy of the Document means a machine-readable copy, 16213 represented in a format whose specification is available to the 16214 general public, that is suitable for revising the document 16215 straightforwardly with generic text editors or (for images 16216 composed of pixels) generic paint programs or (for drawings) some 16217 widely available drawing editor, and that is suitable for input to 16218 text formatters or for automatic translation to a variety of 16219 formats suitable for input to text formatters. A copy made in an 16220 otherwise Transparent file format whose markup, or absence of 16221 markup, has been arranged to thwart or discourage subsequent 16222 modification by readers is not Transparent. An image format is 16223 not Transparent if used for any substantial amount of text. A 16224 copy that is not "Transparent" is called "Opaque". 16225 16226 Examples of suitable formats for Transparent copies include plain 16227 ASCII without markup, Texinfo input format, LaTeX input format, 16228 SGML or XML using a publicly available DTD, and 16229 standard-conforming simple HTML, PostScript or PDF designed for 16230 human modification. Examples of transparent image formats include 16231 PNG, XCF and JPG. Opaque formats include proprietary formats that 16232 can be read and edited only by proprietary word processors, SGML or 16233 XML for which the DTD and/or processing tools are not generally 16234 available, and the machine-generated HTML, PostScript or PDF 16235 produced by some word processors for output purposes only. 16236 16237 The "Title Page" means, for a printed book, the title page itself, 16238 plus such following pages as are needed to hold, legibly, the 16239 material this License requires to appear in the title page. For 16240 works in formats which do not have any title page as such, "Title 16241 Page" means the text near the most prominent appearance of the 16242 work's title, preceding the beginning of the body of the text. 16243 16244 The "publisher" means any person or entity that distributes copies 16245 of the Document to the public. 16246 16247 A section "Entitled XYZ" means a named subunit of the Document 16248 whose title either is precisely XYZ or contains XYZ in parentheses 16249 following text that translates XYZ in another language. (Here XYZ 16250 stands for a specific section name mentioned below, such as 16251 "Acknowledgements", "Dedications", "Endorsements", or "History".) 16252 To "Preserve the Title" of such a section when you modify the 16253 Document means that it remains a section "Entitled XYZ" according 16254 to this definition. 16255 16256 The Document may include Warranty Disclaimers next to the notice 16257 which states that this License applies to the Document. These 16258 Warranty Disclaimers are considered to be included by reference in 16259 this License, but only as regards disclaiming warranties: any other 16260 implication that these Warranty Disclaimers may have is void and 16261 has no effect on the meaning of this License. 16262 16263 2. VERBATIM COPYING 16264 16265 You may copy and distribute the Document in any medium, either 16266 commercially or noncommercially, provided that this License, the 16267 copyright notices, and the license notice saying this License 16268 applies to the Document are reproduced in all copies, and that you 16269 add no other conditions whatsoever to those of this License. You 16270 may not use technical measures to obstruct or control the reading 16271 or further copying of the copies you make or distribute. However, 16272 you may accept compensation in exchange for copies. If you 16273 distribute a large enough number of copies you must also follow 16274 the conditions in section 3. 16275 16276 You may also lend copies, under the same conditions stated above, 16277 and you may publicly display copies. 16278 16279 3. COPYING IN QUANTITY 16280 16281 If you publish printed copies (or copies in media that commonly 16282 have printed covers) of the Document, numbering more than 100, and 16283 the Document's license notice requires Cover Texts, you must 16284 enclose the copies in covers that carry, clearly and legibly, all 16285 these Cover Texts: Front-Cover Texts on the front cover, and 16286 Back-Cover Texts on the back cover. Both covers must also clearly 16287 and legibly identify you as the publisher of these copies. The 16288 front cover must present the full title with all words of the 16289 title equally prominent and visible. You may add other material 16290 on the covers in addition. Copying with changes limited to the 16291 covers, as long as they preserve the title of the Document and 16292 satisfy these conditions, can be treated as verbatim copying in 16293 other respects. 16294 16295 If the required texts for either cover are too voluminous to fit 16296 legibly, you should put the first ones listed (as many as fit 16297 reasonably) on the actual cover, and continue the rest onto 16298 adjacent pages. 16299 16300 If you publish or distribute Opaque copies of the Document 16301 numbering more than 100, you must either include a 16302 machine-readable Transparent copy along with each Opaque copy, or 16303 state in or with each Opaque copy a computer-network location from 16304 which the general network-using public has access to download 16305 using public-standard network protocols a complete Transparent 16306 copy of the Document, free of added material. If you use the 16307 latter option, you must take reasonably prudent steps, when you 16308 begin distribution of Opaque copies in quantity, to ensure that 16309 this Transparent copy will remain thus accessible at the stated 16310 location until at least one year after the last time you 16311 distribute an Opaque copy (directly or through your agents or 16312 retailers) of that edition to the public. 16313 16314 It is requested, but not required, that you contact the authors of 16315 the Document well before redistributing any large number of 16316 copies, to give them a chance to provide you with an updated 16317 version of the Document. 16318 16319 4. MODIFICATIONS 16320 16321 You may copy and distribute a Modified Version of the Document 16322 under the conditions of sections 2 and 3 above, provided that you 16323 release the Modified Version under precisely this License, with 16324 the Modified Version filling the role of the Document, thus 16325 licensing distribution and modification of the Modified Version to 16326 whoever possesses a copy of it. In addition, you must do these 16327 things in the Modified Version: 16328 16329 A. Use in the Title Page (and on the covers, if any) a title 16330 distinct from that of the Document, and from those of 16331 previous versions (which should, if there were any, be listed 16332 in the History section of the Document). You may use the 16333 same title as a previous version if the original publisher of 16334 that version gives permission. 16335 16336 B. List on the Title Page, as authors, one or more persons or 16337 entities responsible for authorship of the modifications in 16338 the Modified Version, together with at least five of the 16339 principal authors of the Document (all of its principal 16340 authors, if it has fewer than five), unless they release you 16341 from this requirement. 16342 16343 C. State on the Title page the name of the publisher of the 16344 Modified Version, as the publisher. 16345 16346 D. Preserve all the copyright notices of the Document. 16347 16348 E. Add an appropriate copyright notice for your modifications 16349 adjacent to the other copyright notices. 16350 16351 F. Include, immediately after the copyright notices, a license 16352 notice giving the public permission to use the Modified 16353 Version under the terms of this License, in the form shown in 16354 the Addendum below. 16355 16356 G. Preserve in that license notice the full lists of Invariant 16357 Sections and required Cover Texts given in the Document's 16358 license notice. 16359 16360 H. Include an unaltered copy of this License. 16361 16362 I. Preserve the section Entitled "History", Preserve its Title, 16363 and add to it an item stating at least the title, year, new 16364 authors, and publisher of the Modified Version as given on 16365 the Title Page. If there is no section Entitled "History" in 16366 the Document, create one stating the title, year, authors, 16367 and publisher of the Document as given on its Title Page, 16368 then add an item describing the Modified Version as stated in 16369 the previous sentence. 16370 16371 J. Preserve the network location, if any, given in the Document 16372 for public access to a Transparent copy of the Document, and 16373 likewise the network locations given in the Document for 16374 previous versions it was based on. These may be placed in 16375 the "History" section. You may omit a network location for a 16376 work that was published at least four years before the 16377 Document itself, or if the original publisher of the version 16378 it refers to gives permission. 16379 16380 K. For any section Entitled "Acknowledgements" or "Dedications", 16381 Preserve the Title of the section, and preserve in the 16382 section all the substance and tone of each of the contributor 16383 acknowledgements and/or dedications given therein. 16384 16385 L. Preserve all the Invariant Sections of the Document, 16386 unaltered in their text and in their titles. Section numbers 16387 or the equivalent are not considered part of the section 16388 titles. 16389 16390 M. Delete any section Entitled "Endorsements". Such a section 16391 may not be included in the Modified Version. 16392 16393 N. Do not retitle any existing section to be Entitled 16394 "Endorsements" or to conflict in title with any Invariant 16395 Section. 16396 16397 O. Preserve any Warranty Disclaimers. 16398 16399 If the Modified Version includes new front-matter sections or 16400 appendices that qualify as Secondary Sections and contain no 16401 material copied from the Document, you may at your option 16402 designate some or all of these sections as invariant. To do this, 16403 add their titles to the list of Invariant Sections in the Modified 16404 Version's license notice. These titles must be distinct from any 16405 other section titles. 16406 16407 You may add a section Entitled "Endorsements", provided it contains 16408 nothing but endorsements of your Modified Version by various 16409 parties--for example, statements of peer review or that the text 16410 has been approved by an organization as the authoritative 16411 definition of a standard. 16412 16413 You may add a passage of up to five words as a Front-Cover Text, 16414 and a passage of up to 25 words as a Back-Cover Text, to the end 16415 of the list of Cover Texts in the Modified Version. Only one 16416 passage of Front-Cover Text and one of Back-Cover Text may be 16417 added by (or through arrangements made by) any one entity. If the 16418 Document already includes a cover text for the same cover, 16419 previously added by you or by arrangement made by the same entity 16420 you are acting on behalf of, you may not add another; but you may 16421 replace the old one, on explicit permission from the previous 16422 publisher that added the old one. 16423 16424 The author(s) and publisher(s) of the Document do not by this 16425 License give permission to use their names for publicity for or to 16426 assert or imply endorsement of any Modified Version. 16427 16428 5. COMBINING DOCUMENTS 16429 16430 You may combine the Document with other documents released under 16431 this License, under the terms defined in section 4 above for 16432 modified versions, provided that you include in the combination 16433 all of the Invariant Sections of all of the original documents, 16434 unmodified, and list them all as Invariant Sections of your 16435 combined work in its license notice, and that you preserve all 16436 their Warranty Disclaimers. 16437 16438 The combined work need only contain one copy of this License, and 16439 multiple identical Invariant Sections may be replaced with a single 16440 copy. If there are multiple Invariant Sections with the same name 16441 but different contents, make the title of each such section unique 16442 by adding at the end of it, in parentheses, the name of the 16443 original author or publisher of that section if known, or else a 16444 unique number. Make the same adjustment to the section titles in 16445 the list of Invariant Sections in the license notice of the 16446 combined work. 16447 16448 In the combination, you must combine any sections Entitled 16449 "History" in the various original documents, forming one section 16450 Entitled "History"; likewise combine any sections Entitled 16451 "Acknowledgements", and any sections Entitled "Dedications". You 16452 must delete all sections Entitled "Endorsements." 16453 16454 6. COLLECTIONS OF DOCUMENTS 16455 16456 You may make a collection consisting of the Document and other 16457 documents released under this License, and replace the individual 16458 copies of this License in the various documents with a single copy 16459 that is included in the collection, provided that you follow the 16460 rules of this License for verbatim copying of each of the 16461 documents in all other respects. 16462 16463 You may extract a single document from such a collection, and 16464 distribute it individually under this License, provided you insert 16465 a copy of this License into the extracted document, and follow 16466 this License in all other respects regarding verbatim copying of 16467 that document. 16468 16469 7. AGGREGATION WITH INDEPENDENT WORKS 16470 16471 A compilation of the Document or its derivatives with other 16472 separate and independent documents or works, in or on a volume of 16473 a storage or distribution medium, is called an "aggregate" if the 16474 copyright resulting from the compilation is not used to limit the 16475 legal rights of the compilation's users beyond what the individual 16476 works permit. When the Document is included in an aggregate, this 16477 License does not apply to the other works in the aggregate which 16478 are not themselves derivative works of the Document. 16479 16480 If the Cover Text requirement of section 3 is applicable to these 16481 copies of the Document, then if the Document is less than one half 16482 of the entire aggregate, the Document's Cover Texts may be placed 16483 on covers that bracket the Document within the aggregate, or the 16484 electronic equivalent of covers if the Document is in electronic 16485 form. Otherwise they must appear on printed covers that bracket 16486 the whole aggregate. 16487 16488 8. TRANSLATION 16489 16490 Translation is considered a kind of modification, so you may 16491 distribute translations of the Document under the terms of section 16492 4. Replacing Invariant Sections with translations requires special 16493 permission from their copyright holders, but you may include 16494 translations of some or all Invariant Sections in addition to the 16495 original versions of these Invariant Sections. You may include a 16496 translation of this License, and all the license notices in the 16497 Document, and any Warranty Disclaimers, provided that you also 16498 include the original English version of this License and the 16499 original versions of those notices and disclaimers. In case of a 16500 disagreement between the translation and the original version of 16501 this License or a notice or disclaimer, the original version will 16502 prevail. 16503 16504 If a section in the Document is Entitled "Acknowledgements", 16505 "Dedications", or "History", the requirement (section 4) to 16506 Preserve its Title (section 1) will typically require changing the 16507 actual title. 16508 16509 9. TERMINATION 16510 16511 You may not copy, modify, sublicense, or distribute the Document 16512 except as expressly provided under this License. Any attempt 16513 otherwise to copy, modify, sublicense, or distribute it is void, 16514 and will automatically terminate your rights under this License. 16515 16516 However, if you cease all violation of this License, then your 16517 license from a particular copyright holder is reinstated (a) 16518 provisionally, unless and until the copyright holder explicitly 16519 and finally terminates your license, and (b) permanently, if the 16520 copyright holder fails to notify you of the violation by some 16521 reasonable means prior to 60 days after the cessation. 16522 16523 Moreover, your license from a particular copyright holder is 16524 reinstated permanently if the copyright holder notifies you of the 16525 violation by some reasonable means, this is the first time you have 16526 received notice of violation of this License (for any work) from 16527 that copyright holder, and you cure the violation prior to 30 days 16528 after your receipt of the notice. 16529 16530 Termination of your rights under this section does not terminate 16531 the licenses of parties who have received copies or rights from 16532 you under this License. If your rights have been terminated and 16533 not permanently reinstated, receipt of a copy of some or all of 16534 the same material does not give you any rights to use it. 16535 16536 10. FUTURE REVISIONS OF THIS LICENSE 16537 16538 The Free Software Foundation may publish new, revised versions of 16539 the GNU Free Documentation License from time to time. Such new 16540 versions will be similar in spirit to the present version, but may 16541 differ in detail to address new problems or concerns. See 16542 `http://www.gnu.org/copyleft/'. 16543 16544 Each version of the License is given a distinguishing version 16545 number. If the Document specifies that a particular numbered 16546 version of this License "or any later version" applies to it, you 16547 have the option of following the terms and conditions either of 16548 that specified version or of any later version that has been 16549 published (not as a draft) by the Free Software Foundation. If 16550 the Document does not specify a version number of this License, 16551 you may choose any version ever published (not as a draft) by the 16552 Free Software Foundation. If the Document specifies that a proxy 16553 can decide which future versions of this License can be used, that 16554 proxy's public statement of acceptance of a version permanently 16555 authorizes you to choose that version for the Document. 16556 16557 11. RELICENSING 16558 16559 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any 16560 World Wide Web server that publishes copyrightable works and also 16561 provides prominent facilities for anybody to edit those works. A 16562 public wiki that anybody can edit is an example of such a server. 16563 A "Massive Multiauthor Collaboration" (or "MMC") contained in the 16564 site means any set of copyrightable works thus published on the MMC 16565 site. 16566 16567 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 16568 license published by Creative Commons Corporation, a not-for-profit 16569 corporation with a principal place of business in San Francisco, 16570 California, as well as future copyleft versions of that license 16571 published by that same organization. 16572 16573 "Incorporate" means to publish or republish a Document, in whole or 16574 in part, as part of another Document. 16575 16576 An MMC is "eligible for relicensing" if it is licensed under this 16577 License, and if all works that were first published under this 16578 License somewhere other than this MMC, and subsequently 16579 incorporated in whole or in part into the MMC, (1) had no cover 16580 texts or invariant sections, and (2) were thus incorporated prior 16581 to November 1, 2008. 16582 16583 The operator of an MMC Site may republish an MMC contained in the 16584 site under CC-BY-SA on the same site at any time before August 1, 16585 2009, provided the MMC is eligible for relicensing. 16586 16587 16588ADDENDUM: How to use this License for your documents 16589==================================================== 16590 16591To use this License in a document you have written, include a copy of 16592the License in the document and put the following copyright and license 16593notices just after the title page: 16594 16595 Copyright (C) YEAR YOUR NAME. 16596 Permission is granted to copy, distribute and/or modify this document 16597 under the terms of the GNU Free Documentation License, Version 1.3 16598 or any later version published by the Free Software Foundation; 16599 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 16600 Texts. A copy of the license is included in the section entitled ``GNU 16601 Free Documentation License''. 16602 16603 If you have Invariant Sections, Front-Cover Texts and Back-Cover 16604Texts, replace the "with...Texts." line with this: 16605 16606 with the Invariant Sections being LIST THEIR TITLES, with 16607 the Front-Cover Texts being LIST, and with the Back-Cover Texts 16608 being LIST. 16609 16610 If you have Invariant Sections without Cover Texts, or some other 16611combination of the three, merge those two alternatives to suit the 16612situation. 16613 16614 If your document contains nontrivial examples of program code, we 16615recommend releasing these examples in parallel under your choice of 16616free software license, such as the GNU General Public License, to 16617permit their use in free software. 16618 16619 16620File: gfortran.info, Node: Funding, Next: Option Index, Prev: GNU Free Documentation License, Up: Top 16621 16622Funding Free Software 16623********************* 16624 16625If you want to have more free software a few years from now, it makes 16626sense for you to help encourage people to contribute funds for its 16627development. The most effective approach known is to encourage 16628commercial redistributors to donate. 16629 16630 Users of free software systems can boost the pace of development by 16631encouraging for-a-fee distributors to donate part of their selling price 16632to free software developers--the Free Software Foundation, and others. 16633 16634 The way to convince distributors to do this is to demand it and 16635expect it from them. So when you compare distributors, judge them 16636partly by how much they give to free software development. Show 16637distributors they must compete to be the one who gives the most. 16638 16639 To make this approach work, you must insist on numbers that you can 16640compare, such as, "We will donate ten dollars to the Frobnitz project 16641for each disk sold." Don't be satisfied with a vague promise, such as 16642"A portion of the profits are donated," since it doesn't give a basis 16643for comparison. 16644 16645 Even a precise fraction "of the profits from this disk" is not very 16646meaningful, since creative accounting and unrelated business decisions 16647can greatly alter what fraction of the sales price counts as profit. 16648If the price you pay is $50, ten percent of the profit is probably less 16649than a dollar; it might be a few cents, or nothing at all. 16650 16651 Some redistributors do development work themselves. This is useful 16652too; but to keep everyone honest, you need to inquire how much they do, 16653and what kind. Some kinds of development make much more long-term 16654difference than others. For example, maintaining a separate version of 16655a program contributes very little; maintaining the standard version of a 16656program for the whole community contributes much. Easy new ports 16657contribute little, since someone else would surely do them; difficult 16658ports such as adding a new CPU to the GNU Compiler Collection 16659contribute more; major new features or packages contribute the most. 16660 16661 By establishing the idea that supporting further development is "the 16662proper thing to do" when distributing free software for a fee, we can 16663assure a steady flow of resources into making more free software. 16664 16665 Copyright (C) 1994 Free Software Foundation, Inc. 16666 Verbatim copying and redistribution of this section is permitted 16667 without royalty; alteration is not permitted. 16668 16669 16670File: gfortran.info, Node: Option Index, Next: Keyword Index, Prev: Funding, Up: Top 16671 16672Option Index 16673************ 16674 16675`gfortran''s command line options are indexed here without any initial 16676`-' or `--'. Where an option has both positive and negative forms 16677(such as -foption and -fno-option), relevant entries in the manual are 16678indexed under the most appropriate form; it may sometimes be useful to 16679look up both forms. 16680 16681[index] 16682* Menu: 16683 16684* A-PREDICATE=ANSWER: Preprocessing Options. 16685 (line 120) 16686* APREDICATE=ANSWER: Preprocessing Options. 16687 (line 114) 16688* backslash: Fortran Dialect Options. 16689 (line 60) 16690* C: Preprocessing Options. 16691 (line 123) 16692* CC: Preprocessing Options. 16693 (line 138) 16694* cpp: Preprocessing Options. 16695 (line 12) 16696* dD: Preprocessing Options. 16697 (line 35) 16698* dI: Preprocessing Options. 16699 (line 51) 16700* dM: Preprocessing Options. 16701 (line 26) 16702* dN: Preprocessing Options. 16703 (line 41) 16704* DNAME: Preprocessing Options. 16705 (line 153) 16706* DNAME=DEFINITION: Preprocessing Options. 16707 (line 156) 16708* dU: Preprocessing Options. 16709 (line 44) 16710* faggressive-function-elimination: Code Gen Options. (line 361) 16711* falign-commons: Code Gen Options. (line 334) 16712* fall-intrinsics: Fortran Dialect Options. 16713 (line 17) 16714* fblas-matmul-limit: Code Gen Options. (line 286) 16715* fbounds-check: Code Gen Options. (line 210) 16716* fcheck: Code Gen Options. (line 161) 16717* fcheck-array-temporaries: Code Gen Options. (line 213) 16718* fcoarray: Code Gen Options. (line 147) 16719* fconvert=CONVERSION: Runtime Options. (line 10) 16720* fcray-pointer: Fortran Dialect Options. 16721 (line 117) 16722* fd-lines-as-code: Fortran Dialect Options. 16723 (line 27) 16724* fd-lines-as-comments: Fortran Dialect Options. 16725 (line 27) 16726* fdefault-double-8: Fortran Dialect Options. 16727 (line 34) 16728* fdefault-integer-8: Fortran Dialect Options. 16729 (line 42) 16730* fdefault-real-8: Fortran Dialect Options. 16731 (line 47) 16732* fdollar-ok: Fortran Dialect Options. 16733 (line 54) 16734* fdump-fortran-optimized: Debugging Options. (line 15) 16735* fdump-fortran-original: Debugging Options. (line 10) 16736* fdump-parse-tree: Debugging Options. (line 18) 16737* fexternal-blas: Code Gen Options. (line 278) 16738* ff2c: Code Gen Options. (line 25) 16739* ffixed-line-length-N: Fortran Dialect Options. 16740 (line 77) 16741* ffpe-trap=LIST: Debugging Options. (line 24) 16742* ffree-form: Fortran Dialect Options. 16743 (line 11) 16744* ffree-line-length-N: Fortran Dialect Options. 16745 (line 90) 16746* fimplicit-none: Fortran Dialect Options. 16747 (line 101) 16748* finit-character: Code Gen Options. (line 306) 16749* finit-integer: Code Gen Options. (line 306) 16750* finit-local-zero: Code Gen Options. (line 306) 16751* finit-logical: Code Gen Options. (line 306) 16752* finit-real: Code Gen Options. (line 306) 16753* finteger-4-integer-8: Fortran Dialect Options. 16754 (line 106) 16755* fintrinsic-modules-path DIR: Directory Options. (line 36) 16756* fmax-array-constructor: Code Gen Options. (line 216) 16757* fmax-errors=N: Error and Warning Options. 16758 (line 27) 16759* fmax-identifier-length=N: Fortran Dialect Options. 16760 (line 97) 16761* fmax-stack-var-size: Code Gen Options. (line 234) 16762* fmax-subrecord-length=LENGTH: Runtime Options. (line 29) 16763* fmodule-private: Fortran Dialect Options. 16764 (line 72) 16765* fno-automatic: Code Gen Options. (line 15) 16766* fno-backtrace: Debugging Options. (line 51) 16767* fno-fixed-form: Fortran Dialect Options. 16768 (line 11) 16769* fno-protect-parens: Code Gen Options. (line 346) 16770* fno-underscoring: Code Gen Options. (line 54) 16771* fno-whole-file: Code Gen Options. (line 113) 16772* fopenmp: Fortran Dialect Options. 16773 (line 121) 16774* fpack-derived: Code Gen Options. (line 256) 16775* fpp: Preprocessing Options. 16776 (line 12) 16777* frange-check: Fortran Dialect Options. 16778 (line 129) 16779* freal-4-real-10: Fortran Dialect Options. 16780 (line 145) 16781* freal-4-real-16: Fortran Dialect Options. 16782 (line 145) 16783* freal-4-real-8: Fortran Dialect Options. 16784 (line 145) 16785* freal-8-real-10: Fortran Dialect Options. 16786 (line 145) 16787* freal-8-real-16: Fortran Dialect Options. 16788 (line 145) 16789* freal-8-real-4: Fortran Dialect Options. 16790 (line 145) 16791* frealloc-lhs: Code Gen Options. (line 355) 16792* frecord-marker=LENGTH: Runtime Options. (line 21) 16793* frecursive: Code Gen Options. (line 297) 16794* frepack-arrays: Code Gen Options. (line 262) 16795* frontend-optimize: Code Gen Options. (line 369) 16796* fsecond-underscore: Code Gen Options. (line 130) 16797* fshort-enums <1>: Fortran 2003 status. (line 88) 16798* fshort-enums: Code Gen Options. (line 272) 16799* fsign-zero: Runtime Options. (line 34) 16800* fstack-arrays: Code Gen Options. (line 248) 16801* fsyntax-only: Error and Warning Options. 16802 (line 33) 16803* fworking-directory: Preprocessing Options. 16804 (line 55) 16805* H: Preprocessing Options. 16806 (line 176) 16807* IDIR: Directory Options. (line 14) 16808* idirafter DIR: Preprocessing Options. 16809 (line 70) 16810* imultilib DIR: Preprocessing Options. 16811 (line 77) 16812* iprefix PREFIX: Preprocessing Options. 16813 (line 81) 16814* iquote DIR: Preprocessing Options. 16815 (line 90) 16816* isysroot DIR: Preprocessing Options. 16817 (line 86) 16818* isystem DIR: Preprocessing Options. 16819 (line 97) 16820* JDIR: Directory Options. (line 29) 16821* MDIR: Directory Options. (line 29) 16822* nostdinc: Preprocessing Options. 16823 (line 105) 16824* P: Preprocessing Options. 16825 (line 181) 16826* pedantic: Error and Warning Options. 16827 (line 38) 16828* pedantic-errors: Error and Warning Options. 16829 (line 57) 16830* static-libgfortran: Link Options. (line 11) 16831* std=STD option: Fortran Dialect Options. 16832 (line 156) 16833* UNAME: Preprocessing Options. 16834 (line 187) 16835* undef: Preprocessing Options. 16836 (line 110) 16837* Waliasing: Error and Warning Options. 16838 (line 69) 16839* Walign-commons: Error and Warning Options. 16840 (line 198) 16841* Wall: Error and Warning Options. 16842 (line 61) 16843* Wampersand: Error and Warning Options. 16844 (line 86) 16845* Warray-temporaries: Error and Warning Options. 16846 (line 94) 16847* Wc-binding-type: Error and Warning Options. 16848 (line 99) 16849* Wcharacter-truncation: Error and Warning Options. 16850 (line 106) 16851* Wcompare-reals: Error and Warning Options. 16852 (line 226) 16853* Wconversion: Error and Warning Options. 16854 (line 113) 16855* Wconversion-extra: Error and Warning Options. 16856 (line 117) 16857* Werror: Error and Warning Options. 16858 (line 234) 16859* Wextra: Error and Warning Options. 16860 (line 120) 16861* Wfunction-elimination: Error and Warning Options. 16862 (line 204) 16863* Wimplicit-interface: Error and Warning Options. 16864 (line 125) 16865* Wimplicit-procedure: Error and Warning Options. 16866 (line 131) 16867* Wintrinsic-shadow: Error and Warning Options. 16868 (line 180) 16869* Wintrinsics-std: Error and Warning Options. 16870 (line 135) 16871* Wline-truncation: Error and Warning Options. 16872 (line 109) 16873* Wreal-q-constant: Error and Warning Options. 16874 (line 142) 16875* Wrealloc-lhs: Error and Warning Options. 16876 (line 208) 16877* Wrealloc-lhs-all: Error and Warning Options. 16878 (line 221) 16879* Wsurprising: Error and Warning Options. 16880 (line 146) 16881* Wtabs: Error and Warning Options. 16882 (line 168) 16883* Wtargt-lifetime: Error and Warning Options. 16884 (line 230) 16885* Wunderflow: Error and Warning Options. 16886 (line 176) 16887* Wunused-dummy-argument: Error and Warning Options. 16888 (line 187) 16889* Wunused-parameter: Error and Warning Options. 16890 (line 191) 16891 16892 16893File: gfortran.info, Node: Keyword Index, Prev: Option Index, Up: Top 16894 16895Keyword Index 16896************* 16897 16898[index] 16899* Menu: 16900 16901* $: Fortran Dialect Options. 16902 (line 54) 16903* %LOC: Argument list functions. 16904 (line 6) 16905* %REF: Argument list functions. 16906 (line 6) 16907* %VAL: Argument list functions. 16908 (line 6) 16909* &: Error and Warning Options. 16910 (line 86) 16911* [...]: Fortran 2003 status. (line 73) 16912* _gfortran_set_args: _gfortran_set_args. (line 6) 16913* _gfortran_set_convert: _gfortran_set_convert. 16914 (line 6) 16915* _gfortran_set_fpe: _gfortran_set_fpe. (line 6) 16916* _gfortran_set_max_subrecord_length: _gfortran_set_max_subrecord_length. 16917 (line 6) 16918* _gfortran_set_options: _gfortran_set_options. 16919 (line 6) 16920* _gfortran_set_record_marker: _gfortran_set_record_marker. 16921 (line 6) 16922* ABORT: ABORT. (line 6) 16923* ABS: ABS. (line 6) 16924* absolute value: ABS. (line 6) 16925* ACCESS: ACCESS. (line 6) 16926* ACCESS='STREAM' I/O: Fortran 2003 status. (line 100) 16927* ACHAR: ACHAR. (line 6) 16928* ACOS: ACOS. (line 6) 16929* ACOSH: ACOSH. (line 6) 16930* adjust string <1>: ADJUSTR. (line 6) 16931* adjust string: ADJUSTL. (line 6) 16932* ADJUSTL: ADJUSTL. (line 6) 16933* ADJUSTR: ADJUSTR. (line 6) 16934* AIMAG: AIMAG. (line 6) 16935* AINT: AINT. (line 6) 16936* ALARM: ALARM. (line 6) 16937* ALGAMA: LOG_GAMMA. (line 6) 16938* aliasing: Error and Warning Options. 16939 (line 69) 16940* alignment of COMMON blocks <1>: Code Gen Options. (line 334) 16941* alignment of COMMON blocks: Error and Warning Options. 16942 (line 198) 16943* ALL: ALL. (line 6) 16944* all warnings: Error and Warning Options. 16945 (line 61) 16946* ALLOCATABLE components of derived types: Fortran 2003 status. 16947 (line 98) 16948* ALLOCATABLE dummy arguments: Fortran 2003 status. (line 94) 16949* ALLOCATABLE function results: Fortran 2003 status. (line 96) 16950* ALLOCATED: ALLOCATED. (line 6) 16951* allocation, moving: MOVE_ALLOC. (line 6) 16952* allocation, status: ALLOCATED. (line 6) 16953* ALOG: LOG. (line 6) 16954* ALOG10: LOG10. (line 6) 16955* AMAX0: MAX. (line 6) 16956* AMAX1: MAX. (line 6) 16957* AMIN0: MIN. (line 6) 16958* AMIN1: MIN. (line 6) 16959* AMOD: MOD. (line 6) 16960* AND: AND. (line 6) 16961* ANINT: ANINT. (line 6) 16962* ANY: ANY. (line 6) 16963* area hyperbolic cosine: ACOSH. (line 6) 16964* area hyperbolic sine: ASINH. (line 6) 16965* area hyperbolic tangent: ATANH. (line 6) 16966* argument list functions: Argument list functions. 16967 (line 6) 16968* arguments, to program <1>: IARGC. (line 6) 16969* arguments, to program <2>: GET_COMMAND_ARGUMENT. 16970 (line 6) 16971* arguments, to program <3>: GET_COMMAND. (line 6) 16972* arguments, to program <4>: GETARG. (line 6) 16973* arguments, to program: COMMAND_ARGUMENT_COUNT. 16974 (line 6) 16975* array, add elements: SUM. (line 6) 16976* array, AND: IALL. (line 6) 16977* array, apply condition <1>: ANY. (line 6) 16978* array, apply condition: ALL. (line 6) 16979* array, bounds checking: Code Gen Options. (line 161) 16980* array, change dimensions: RESHAPE. (line 6) 16981* array, combine arrays: MERGE. (line 6) 16982* array, condition testing <1>: ANY. (line 6) 16983* array, condition testing: ALL. (line 6) 16984* array, conditionally add elements: SUM. (line 6) 16985* array, conditionally count elements: COUNT. (line 6) 16986* array, conditionally multiply elements: PRODUCT. (line 6) 16987* array, constructors: Fortran 2003 status. (line 73) 16988* array, count elements: SIZE. (line 6) 16989* array, duplicate dimensions: SPREAD. (line 6) 16990* array, duplicate elements: SPREAD. (line 6) 16991* array, element counting: COUNT. (line 6) 16992* array, gather elements: PACK. (line 6) 16993* array, increase dimension <1>: UNPACK. (line 6) 16994* array, increase dimension: SPREAD. (line 6) 16995* array, indices of type real: Real array indices. (line 6) 16996* array, location of maximum element: MAXLOC. (line 6) 16997* array, location of minimum element: MINLOC. (line 6) 16998* array, lower bound: LBOUND. (line 6) 16999* array, maximum value: MAXVAL. (line 6) 17000* array, merge arrays: MERGE. (line 6) 17001* array, minimum value: MINVAL. (line 6) 17002* array, multiply elements: PRODUCT. (line 6) 17003* array, number of elements <1>: SIZE. (line 6) 17004* array, number of elements: COUNT. (line 6) 17005* array, OR: IANY. (line 6) 17006* array, packing: PACK. (line 6) 17007* array, parity: IPARITY. (line 6) 17008* array, permutation: CSHIFT. (line 6) 17009* array, product: PRODUCT. (line 6) 17010* array, reduce dimension: PACK. (line 6) 17011* array, rotate: CSHIFT. (line 6) 17012* array, scatter elements: UNPACK. (line 6) 17013* array, shape: SHAPE. (line 6) 17014* array, shift: EOSHIFT. (line 6) 17015* array, shift circularly: CSHIFT. (line 6) 17016* array, size: SIZE. (line 6) 17017* array, sum: SUM. (line 6) 17018* array, transmogrify: RESHAPE. (line 6) 17019* array, transpose: TRANSPOSE. (line 6) 17020* array, unpacking: UNPACK. (line 6) 17021* array, upper bound: UBOUND. (line 6) 17022* array, XOR: IPARITY. (line 6) 17023* ASCII collating sequence <1>: IACHAR. (line 6) 17024* ASCII collating sequence: ACHAR. (line 6) 17025* ASIN: ASIN. (line 6) 17026* ASINH: ASINH. (line 6) 17027* ASSOCIATED: ASSOCIATED. (line 6) 17028* association status: ASSOCIATED. (line 6) 17029* association status, C pointer: C_ASSOCIATED. (line 6) 17030* ATAN: ATAN. (line 6) 17031* ATAN2: ATAN2. (line 6) 17032* ATANH: ATANH. (line 6) 17033* Atomic subroutine, define: ATOMIC_DEFINE. (line 6) 17034* Atomic subroutine, reference: ATOMIC_REF. (line 6) 17035* ATOMIC_DEFINE: ATOMIC_DEFINE. (line 6) 17036* ATOMIC_REF: ATOMIC_REF. (line 6) 17037* Authors: Contributors. (line 6) 17038* backslash: Fortran Dialect Options. 17039 (line 60) 17040* backtrace: BACKTRACE. (line 6) 17041* BACKTRACE: BACKTRACE. (line 6) 17042* backtrace: Debugging Options. (line 51) 17043* base 10 logarithm function: LOG10. (line 6) 17044* BESJ0: BESSEL_J0. (line 6) 17045* BESJ1: BESSEL_J1. (line 6) 17046* BESJN: BESSEL_JN. (line 6) 17047* Bessel function, first kind <1>: BESSEL_JN. (line 6) 17048* Bessel function, first kind <2>: BESSEL_J1. (line 6) 17049* Bessel function, first kind: BESSEL_J0. (line 6) 17050* Bessel function, second kind <1>: BESSEL_YN. (line 6) 17051* Bessel function, second kind <2>: BESSEL_Y1. (line 6) 17052* Bessel function, second kind: BESSEL_Y0. (line 6) 17053* BESSEL_J0: BESSEL_J0. (line 6) 17054* BESSEL_J1: BESSEL_J1. (line 6) 17055* BESSEL_JN: BESSEL_JN. (line 6) 17056* BESSEL_Y0: BESSEL_Y0. (line 6) 17057* BESSEL_Y1: BESSEL_Y1. (line 6) 17058* BESSEL_YN: BESSEL_YN. (line 6) 17059* BESY0: BESSEL_Y0. (line 6) 17060* BESY1: BESSEL_Y1. (line 6) 17061* BESYN: BESSEL_YN. (line 6) 17062* BGE: BGE. (line 6) 17063* BGT: BGT. (line 6) 17064* binary representation <1>: POPPAR. (line 6) 17065* binary representation: POPCNT. (line 6) 17066* BIT_SIZE: BIT_SIZE. (line 6) 17067* bits set: POPCNT. (line 6) 17068* bits, AND of array elements: IALL. (line 6) 17069* bits, clear: IBCLR. (line 6) 17070* bits, extract: IBITS. (line 6) 17071* bits, get: IBITS. (line 6) 17072* bits, merge: MERGE_BITS. (line 6) 17073* bits, move <1>: TRANSFER. (line 6) 17074* bits, move: MVBITS. (line 6) 17075* bits, negate: NOT. (line 6) 17076* bits, number of: BIT_SIZE. (line 6) 17077* bits, OR of array elements: IANY. (line 6) 17078* bits, set: IBSET. (line 6) 17079* bits, shift: ISHFT. (line 6) 17080* bits, shift circular: ISHFTC. (line 6) 17081* bits, shift left <1>: SHIFTL. (line 6) 17082* bits, shift left: LSHIFT. (line 6) 17083* bits, shift right <1>: SHIFTR. (line 6) 17084* bits, shift right <2>: SHIFTA. (line 6) 17085* bits, shift right: RSHIFT. (line 6) 17086* bits, testing: BTEST. (line 6) 17087* bits, unset: IBCLR. (line 6) 17088* bits, XOR of array elements: IPARITY. (line 6) 17089* bitwise comparison <1>: BLT. (line 6) 17090* bitwise comparison <2>: BLE. (line 6) 17091* bitwise comparison <3>: BGT. (line 6) 17092* bitwise comparison: BGE. (line 6) 17093* bitwise logical and <1>: IAND. (line 6) 17094* bitwise logical and: AND. (line 6) 17095* bitwise logical exclusive or <1>: XOR. (line 6) 17096* bitwise logical exclusive or: IEOR. (line 6) 17097* bitwise logical not: NOT. (line 6) 17098* bitwise logical or <1>: OR. (line 6) 17099* bitwise logical or: IOR. (line 6) 17100* BLE: BLE. (line 6) 17101* BLT: BLT. (line 6) 17102* bounds checking: Code Gen Options. (line 161) 17103* BOZ literal constants: BOZ literal constants. 17104 (line 6) 17105* BTEST: BTEST. (line 6) 17106* C_ASSOCIATED: C_ASSOCIATED. (line 6) 17107* C_F_POINTER: C_F_POINTER. (line 6) 17108* C_F_PROCPOINTER: C_F_PROCPOINTER. (line 6) 17109* C_FUNLOC: C_FUNLOC. (line 6) 17110* C_LOC: C_LOC. (line 6) 17111* C_SIZEOF: C_SIZEOF. (line 6) 17112* CABS: ABS. (line 6) 17113* calling convention: Code Gen Options. (line 25) 17114* CCOS: COS. (line 6) 17115* CDABS: ABS. (line 6) 17116* CDCOS: COS. (line 6) 17117* CDEXP: EXP. (line 6) 17118* CDLOG: LOG. (line 6) 17119* CDSIN: SIN. (line 6) 17120* CDSQRT: SQRT. (line 6) 17121* ceiling: CEILING. (line 6) 17122* CEILING: CEILING. (line 6) 17123* ceiling: ANINT. (line 6) 17124* CEXP: EXP. (line 6) 17125* CHAR: CHAR. (line 6) 17126* character kind: SELECTED_CHAR_KIND. (line 6) 17127* character set: Fortran Dialect Options. 17128 (line 54) 17129* CHDIR: CHDIR. (line 6) 17130* checking array temporaries: Code Gen Options. (line 161) 17131* checking subscripts: Code Gen Options. (line 161) 17132* CHMOD: CHMOD. (line 6) 17133* clock ticks <1>: SYSTEM_CLOCK. (line 6) 17134* clock ticks <2>: MCLOCK8. (line 6) 17135* clock ticks: MCLOCK. (line 6) 17136* CLOG: LOG. (line 6) 17137* CMPLX: CMPLX. (line 6) 17138* coarray, IMAGE_INDEX: IMAGE_INDEX. (line 6) 17139* coarray, lower bound: LCOBOUND. (line 6) 17140* coarray, NUM_IMAGES: NUM_IMAGES. (line 6) 17141* coarray, THIS_IMAGE: THIS_IMAGE. (line 6) 17142* coarray, upper bound: UCOBOUND. (line 6) 17143* coarrays: Code Gen Options. (line 147) 17144* code generation, conventions: Code Gen Options. (line 6) 17145* collating sequence, ASCII <1>: IACHAR. (line 6) 17146* collating sequence, ASCII: ACHAR. (line 6) 17147* command line: EXECUTE_COMMAND_LINE. 17148 (line 6) 17149* command options: Invoking GNU Fortran. 17150 (line 6) 17151* command-line arguments <1>: IARGC. (line 6) 17152* command-line arguments <2>: GET_COMMAND_ARGUMENT. 17153 (line 6) 17154* command-line arguments <3>: GET_COMMAND. (line 6) 17155* command-line arguments <4>: GETARG. (line 6) 17156* command-line arguments: COMMAND_ARGUMENT_COUNT. 17157 (line 6) 17158* command-line arguments, number of <1>: IARGC. (line 6) 17159* command-line arguments, number of: COMMAND_ARGUMENT_COUNT. 17160 (line 6) 17161* COMMAND_ARGUMENT_COUNT: COMMAND_ARGUMENT_COUNT. 17162 (line 6) 17163* compiler flags inquiry function: COMPILER_OPTIONS. (line 6) 17164* compiler, name and version: COMPILER_VERSION. (line 6) 17165* COMPILER_OPTIONS: COMPILER_OPTIONS. (line 6) 17166* COMPILER_VERSION: COMPILER_VERSION. (line 6) 17167* COMPLEX: COMPLEX. (line 6) 17168* complex conjugate: CONJG. (line 6) 17169* Complex function: Alternate complex function syntax. 17170 (line 6) 17171* complex numbers, conversion to <1>: DCMPLX. (line 6) 17172* complex numbers, conversion to <2>: COMPLEX. (line 6) 17173* complex numbers, conversion to: CMPLX. (line 6) 17174* complex numbers, imaginary part: AIMAG. (line 6) 17175* complex numbers, real part <1>: REAL. (line 6) 17176* complex numbers, real part: DREAL. (line 6) 17177* Conditional compilation: Preprocessing and conditional compilation. 17178 (line 6) 17179* CONJG: CONJG. (line 6) 17180* consistency, durability: Data consistency and durability. 17181 (line 6) 17182* Contributing: Contributing. (line 6) 17183* Contributors: Contributors. (line 6) 17184* conversion: Error and Warning Options. 17185 (line 113) 17186* conversion, to character: CHAR. (line 6) 17187* conversion, to complex <1>: DCMPLX. (line 6) 17188* conversion, to complex <2>: COMPLEX. (line 6) 17189* conversion, to complex: CMPLX. (line 6) 17190* conversion, to integer <1>: LONG. (line 6) 17191* conversion, to integer <2>: INT8. (line 6) 17192* conversion, to integer <3>: INT2. (line 6) 17193* conversion, to integer <4>: INT. (line 6) 17194* conversion, to integer <5>: ICHAR. (line 6) 17195* conversion, to integer <6>: IACHAR. (line 6) 17196* conversion, to integer: Implicitly convert LOGICAL and INTEGER values. 17197 (line 6) 17198* conversion, to logical <1>: LOGICAL. (line 6) 17199* conversion, to logical: Implicitly convert LOGICAL and INTEGER values. 17200 (line 6) 17201* conversion, to real <1>: REAL. (line 6) 17202* conversion, to real: DBLE. (line 6) 17203* conversion, to string: CTIME. (line 6) 17204* CONVERT specifier: CONVERT specifier. (line 6) 17205* core, dump: ABORT. (line 6) 17206* COS: COS. (line 6) 17207* COSH: COSH. (line 6) 17208* cosine: COS. (line 6) 17209* cosine, hyperbolic: COSH. (line 6) 17210* cosine, hyperbolic, inverse: ACOSH. (line 6) 17211* cosine, inverse: ACOS. (line 6) 17212* COUNT: COUNT. (line 6) 17213* CPP <1>: Preprocessing Options. 17214 (line 6) 17215* CPP: Preprocessing and conditional compilation. 17216 (line 6) 17217* CPU_TIME: CPU_TIME. (line 6) 17218* Credits: Contributors. (line 6) 17219* CSHIFT: CSHIFT. (line 6) 17220* CSIN: SIN. (line 6) 17221* CSQRT: SQRT. (line 6) 17222* CTIME: CTIME. (line 6) 17223* current date <1>: IDATE. (line 6) 17224* current date <2>: FDATE. (line 6) 17225* current date: DATE_AND_TIME. (line 6) 17226* current time <1>: TIME8. (line 6) 17227* current time <2>: TIME. (line 6) 17228* current time <3>: ITIME. (line 6) 17229* current time <4>: FDATE. (line 6) 17230* current time: DATE_AND_TIME. (line 6) 17231* DABS: ABS. (line 6) 17232* DACOS: ACOS. (line 6) 17233* DACOSH: ACOSH. (line 6) 17234* DASIN: ASIN. (line 6) 17235* DASINH: ASINH. (line 6) 17236* DATAN: ATAN. (line 6) 17237* DATAN2: ATAN2. (line 6) 17238* DATANH: ATANH. (line 6) 17239* date, current <1>: IDATE. (line 6) 17240* date, current <2>: FDATE. (line 6) 17241* date, current: DATE_AND_TIME. (line 6) 17242* DATE_AND_TIME: DATE_AND_TIME. (line 6) 17243* DBESJ0: BESSEL_J0. (line 6) 17244* DBESJ1: BESSEL_J1. (line 6) 17245* DBESJN: BESSEL_JN. (line 6) 17246* DBESY0: BESSEL_Y0. (line 6) 17247* DBESY1: BESSEL_Y1. (line 6) 17248* DBESYN: BESSEL_YN. (line 6) 17249* DBLE: DBLE. (line 6) 17250* DCMPLX: DCMPLX. (line 6) 17251* DCONJG: CONJG. (line 6) 17252* DCOS: COS. (line 6) 17253* DCOSH: COSH. (line 6) 17254* DDIM: DIM. (line 6) 17255* debugging information options: Debugging Options. (line 6) 17256* debugging, preprocessor: Preprocessing Options. 17257 (line 26) 17258* DECODE: ENCODE and DECODE statements. 17259 (line 6) 17260* delayed execution <1>: SLEEP. (line 6) 17261* delayed execution: ALARM. (line 6) 17262* DEXP: EXP. (line 6) 17263* DFLOAT: REAL. (line 6) 17264* DGAMMA: GAMMA. (line 6) 17265* dialect options: Fortran Dialect Options. 17266 (line 6) 17267* DIGITS: DIGITS. (line 6) 17268* DIM: DIM. (line 6) 17269* DIMAG: AIMAG. (line 6) 17270* DINT: AINT. (line 6) 17271* directive, INCLUDE: Directory Options. (line 6) 17272* directory, options: Directory Options. (line 6) 17273* directory, search paths for inclusion: Directory Options. (line 14) 17274* division, modulo: MODULO. (line 6) 17275* division, remainder: MOD. (line 6) 17276* DLGAMA: LOG_GAMMA. (line 6) 17277* DLOG: LOG. (line 6) 17278* DLOG10: LOG10. (line 6) 17279* DMAX1: MAX. (line 6) 17280* DMIN1: MIN. (line 6) 17281* DMOD: MOD. (line 6) 17282* DNINT: ANINT. (line 6) 17283* dot product: DOT_PRODUCT. (line 6) 17284* DOT_PRODUCT: DOT_PRODUCT. (line 6) 17285* DPROD: DPROD. (line 6) 17286* DREAL: DREAL. (line 6) 17287* DSHIFTL: DSHIFTL. (line 6) 17288* DSHIFTR: DSHIFTR. (line 6) 17289* DSIGN: SIGN. (line 6) 17290* DSIN: SIN. (line 6) 17291* DSINH: SINH. (line 6) 17292* DSQRT: SQRT. (line 6) 17293* DTAN: TAN. (line 6) 17294* DTANH: TANH. (line 6) 17295* DTIME: DTIME. (line 6) 17296* dummy argument, unused: Error and Warning Options. 17297 (line 187) 17298* elapsed time <1>: SECOND. (line 6) 17299* elapsed time <2>: SECNDS. (line 6) 17300* elapsed time: DTIME. (line 6) 17301* Elimination of functions with identical argument lists: Code Gen Options. 17302 (line 361) 17303* ENCODE: ENCODE and DECODE statements. 17304 (line 6) 17305* ENUM statement: Fortran 2003 status. (line 88) 17306* ENUMERATOR statement: Fortran 2003 status. (line 88) 17307* environment variable <1>: GET_ENVIRONMENT_VARIABLE. 17308 (line 6) 17309* environment variable <2>: GETENV. (line 6) 17310* environment variable <3>: Runtime. (line 6) 17311* environment variable: Environment Variables. 17312 (line 6) 17313* EOSHIFT: EOSHIFT. (line 6) 17314* EPSILON: EPSILON. (line 6) 17315* ERF: ERF. (line 6) 17316* ERFC: ERFC. (line 6) 17317* ERFC_SCALED: ERFC_SCALED. (line 6) 17318* error function: ERF. (line 6) 17319* error function, complementary: ERFC. (line 6) 17320* error function, complementary, exponentially-scaled: ERFC_SCALED. 17321 (line 6) 17322* errors, limiting: Error and Warning Options. 17323 (line 27) 17324* escape characters: Fortran Dialect Options. 17325 (line 60) 17326* ETIME: ETIME. (line 6) 17327* Euclidean distance: HYPOT. (line 6) 17328* Euclidean vector norm: NORM2. (line 6) 17329* EXECUTE_COMMAND_LINE: EXECUTE_COMMAND_LINE. 17330 (line 6) 17331* EXIT: EXIT. (line 6) 17332* EXP: EXP. (line 6) 17333* EXPONENT: EXPONENT. (line 6) 17334* exponential function: EXP. (line 6) 17335* exponential function, inverse <1>: LOG10. (line 6) 17336* exponential function, inverse: LOG. (line 6) 17337* expression size <1>: SIZEOF. (line 6) 17338* expression size: C_SIZEOF. (line 6) 17339* EXTENDS_TYPE_OF: EXTENDS_TYPE_OF. (line 6) 17340* extensions: Extensions. (line 6) 17341* extensions, implemented: Extensions implemented in GNU Fortran. 17342 (line 6) 17343* extensions, not implemented: Extensions not implemented in GNU Fortran. 17344 (line 6) 17345* extra warnings: Error and Warning Options. 17346 (line 120) 17347* f2c calling convention: Code Gen Options. (line 25) 17348* Factorial function: GAMMA. (line 6) 17349* FDATE: FDATE. (line 6) 17350* FDL, GNU Free Documentation License: GNU Free Documentation License. 17351 (line 6) 17352* FGET: FGET. (line 6) 17353* FGETC: FGETC. (line 6) 17354* file format, fixed: Fortran Dialect Options. 17355 (line 11) 17356* file format, free: Fortran Dialect Options. 17357 (line 11) 17358* file operation, file number: FNUM. (line 6) 17359* file operation, flush: FLUSH. (line 6) 17360* file operation, position <1>: FTELL. (line 6) 17361* file operation, position: FSEEK. (line 6) 17362* file operation, read character <1>: FGETC. (line 6) 17363* file operation, read character: FGET. (line 6) 17364* file operation, seek: FSEEK. (line 6) 17365* file operation, write character <1>: FPUTC. (line 6) 17366* file operation, write character: FPUT. (line 6) 17367* file system, access mode: ACCESS. (line 6) 17368* file system, change access mode: CHMOD. (line 6) 17369* file system, create link <1>: SYMLNK. (line 6) 17370* file system, create link: LINK. (line 6) 17371* file system, file creation mask: UMASK. (line 6) 17372* file system, file status <1>: STAT. (line 6) 17373* file system, file status <2>: LSTAT. (line 6) 17374* file system, file status: FSTAT. (line 6) 17375* file system, hard link: LINK. (line 6) 17376* file system, remove file: UNLINK. (line 6) 17377* file system, rename file: RENAME. (line 6) 17378* file system, soft link: SYMLNK. (line 6) 17379* flags inquiry function: COMPILER_OPTIONS. (line 6) 17380* FLOAT: REAL. (line 6) 17381* floating point, exponent: EXPONENT. (line 6) 17382* floating point, fraction: FRACTION. (line 6) 17383* floating point, nearest different: NEAREST. (line 6) 17384* floating point, relative spacing <1>: SPACING. (line 6) 17385* floating point, relative spacing: RRSPACING. (line 6) 17386* floating point, scale: SCALE. (line 6) 17387* floating point, set exponent: SET_EXPONENT. (line 6) 17388* floor: FLOOR. (line 6) 17389* FLOOR: FLOOR. (line 6) 17390* floor: AINT. (line 6) 17391* FLUSH: FLUSH. (line 6) 17392* FLUSH statement: Fortran 2003 status. (line 84) 17393* FNUM: FNUM. (line 6) 17394* FORMAT: Variable FORMAT expressions. 17395 (line 6) 17396* Fortran 77: GNU Fortran and G77. (line 6) 17397* FPP: Preprocessing and conditional compilation. 17398 (line 6) 17399* FPUT: FPUT. (line 6) 17400* FPUTC: FPUTC. (line 6) 17401* FRACTION: FRACTION. (line 6) 17402* FREE: FREE. (line 6) 17403* Front-end optimization: Code Gen Options. (line 369) 17404* FSEEK: FSEEK. (line 6) 17405* FSTAT: FSTAT. (line 6) 17406* FTELL: FTELL. (line 6) 17407* function elimination: Error and Warning Options. 17408 (line 204) 17409* g77: GNU Fortran and G77. (line 6) 17410* g77 calling convention: Code Gen Options. (line 25) 17411* GAMMA: GAMMA. (line 6) 17412* Gamma function: GAMMA. (line 6) 17413* Gamma function, logarithm of: LOG_GAMMA. (line 6) 17414* GCC: GNU Fortran and GCC. (line 6) 17415* GERROR: GERROR. (line 6) 17416* GET_COMMAND: GET_COMMAND. (line 6) 17417* GET_COMMAND_ARGUMENT: GET_COMMAND_ARGUMENT. 17418 (line 6) 17419* GET_ENVIRONMENT_VARIABLE: GET_ENVIRONMENT_VARIABLE. 17420 (line 6) 17421* GETARG: GETARG. (line 6) 17422* GETCWD: GETCWD. (line 6) 17423* GETENV: GETENV. (line 6) 17424* GETGID: GETGID. (line 6) 17425* GETLOG: GETLOG. (line 6) 17426* GETPID: GETPID. (line 6) 17427* GETUID: GETUID. (line 6) 17428* GMTIME: GMTIME. (line 6) 17429* GNU Compiler Collection: GNU Fortran and GCC. (line 6) 17430* GNU Fortran command options: Invoking GNU Fortran. 17431 (line 6) 17432* Hollerith constants: Hollerith constants support. 17433 (line 6) 17434* HOSTNM: HOSTNM. (line 6) 17435* HUGE: HUGE. (line 6) 17436* hyperbolic cosine: COSH. (line 6) 17437* hyperbolic function, cosine: COSH. (line 6) 17438* hyperbolic function, cosine, inverse: ACOSH. (line 6) 17439* hyperbolic function, sine: SINH. (line 6) 17440* hyperbolic function, sine, inverse: ASINH. (line 6) 17441* hyperbolic function, tangent: TANH. (line 6) 17442* hyperbolic function, tangent, inverse: ATANH. (line 6) 17443* hyperbolic sine: SINH. (line 6) 17444* hyperbolic tangent: TANH. (line 6) 17445* HYPOT: HYPOT. (line 6) 17446* I/O item lists: I/O item lists. (line 6) 17447* IABS: ABS. (line 6) 17448* IACHAR: IACHAR. (line 6) 17449* IALL: IALL. (line 6) 17450* IAND: IAND. (line 6) 17451* IANY: IANY. (line 6) 17452* IARGC: IARGC. (line 6) 17453* IBCLR: IBCLR. (line 6) 17454* IBITS: IBITS. (line 6) 17455* IBSET: IBSET. (line 6) 17456* ICHAR: ICHAR. (line 6) 17457* IDATE: IDATE. (line 6) 17458* IDIM: DIM. (line 6) 17459* IDINT: INT. (line 6) 17460* IDNINT: NINT. (line 6) 17461* IEEE, ISNAN: ISNAN. (line 6) 17462* IEOR: IEOR. (line 6) 17463* IERRNO: IERRNO. (line 6) 17464* IFIX: INT. (line 6) 17465* IMAG: AIMAG. (line 6) 17466* IMAGE_INDEX: IMAGE_INDEX. (line 6) 17467* images, cosubscript to image index conversion: IMAGE_INDEX. (line 6) 17468* images, index of this image: THIS_IMAGE. (line 6) 17469* images, number of: NUM_IMAGES. (line 6) 17470* IMAGPART: AIMAG. (line 6) 17471* IMPORT statement: Fortran 2003 status. (line 115) 17472* INCLUDE directive: Directory Options. (line 6) 17473* inclusion, directory search paths for: Directory Options. (line 14) 17474* INDEX: INDEX intrinsic. (line 6) 17475* INT: INT. (line 6) 17476* INT2: INT2. (line 6) 17477* INT8: INT8. (line 6) 17478* integer kind: SELECTED_INT_KIND. (line 6) 17479* Interoperability: Mixed-Language Programming. 17480 (line 6) 17481* intrinsic: Error and Warning Options. 17482 (line 180) 17483* intrinsic Modules: Intrinsic Modules. (line 6) 17484* intrinsic procedures: Intrinsic Procedures. 17485 (line 6) 17486* Introduction: Top. (line 6) 17487* inverse hyperbolic cosine: ACOSH. (line 6) 17488* inverse hyperbolic sine: ASINH. (line 6) 17489* inverse hyperbolic tangent: ATANH. (line 6) 17490* IOMSG= specifier: Fortran 2003 status. (line 86) 17491* IOR: IOR. (line 6) 17492* IOSTAT, end of file: IS_IOSTAT_END. (line 6) 17493* IOSTAT, end of record: IS_IOSTAT_EOR. (line 6) 17494* IPARITY: IPARITY. (line 6) 17495* IRAND: IRAND. (line 6) 17496* IS_IOSTAT_END: IS_IOSTAT_END. (line 6) 17497* IS_IOSTAT_EOR: IS_IOSTAT_EOR. (line 6) 17498* ISATTY: ISATTY. (line 6) 17499* ISHFT: ISHFT. (line 6) 17500* ISHFTC: ISHFTC. (line 6) 17501* ISIGN: SIGN. (line 6) 17502* ISNAN: ISNAN. (line 6) 17503* ISO_FORTRAN_ENV statement: Fortran 2003 status. (line 123) 17504* ITIME: ITIME. (line 6) 17505* KILL: KILL. (line 6) 17506* kind: KIND. (line 6) 17507* KIND: KIND. (line 6) 17508* kind: KIND Type Parameters. 17509 (line 6) 17510* kind, character: SELECTED_CHAR_KIND. (line 6) 17511* kind, integer: SELECTED_INT_KIND. (line 6) 17512* kind, old-style: Old-style kind specifications. 17513 (line 6) 17514* kind, real: SELECTED_REAL_KIND. (line 6) 17515* L2 vector norm: NORM2. (line 6) 17516* language, dialect options: Fortran Dialect Options. 17517 (line 6) 17518* LBOUND: LBOUND. (line 6) 17519* LCOBOUND: LCOBOUND. (line 6) 17520* LEADZ: LEADZ. (line 6) 17521* left shift, combined: DSHIFTL. (line 6) 17522* LEN: LEN. (line 6) 17523* LEN_TRIM: LEN_TRIM. (line 6) 17524* lexical comparison of strings <1>: LLT. (line 6) 17525* lexical comparison of strings <2>: LLE. (line 6) 17526* lexical comparison of strings <3>: LGT. (line 6) 17527* lexical comparison of strings: LGE. (line 6) 17528* LGAMMA: LOG_GAMMA. (line 6) 17529* LGE: LGE. (line 6) 17530* LGT: LGT. (line 6) 17531* libf2c calling convention: Code Gen Options. (line 25) 17532* libgfortran initialization, set_args: _gfortran_set_args. (line 6) 17533* libgfortran initialization, set_convert: _gfortran_set_convert. 17534 (line 6) 17535* libgfortran initialization, set_fpe: _gfortran_set_fpe. (line 6) 17536* libgfortran initialization, set_max_subrecord_length: _gfortran_set_max_subrecord_length. 17537 (line 6) 17538* libgfortran initialization, set_options: _gfortran_set_options. 17539 (line 6) 17540* libgfortran initialization, set_record_marker: _gfortran_set_record_marker. 17541 (line 6) 17542* limits, largest number: HUGE. (line 6) 17543* limits, smallest number: TINY. (line 6) 17544* LINK: LINK. (line 6) 17545* linking, static: Link Options. (line 6) 17546* LLE: LLE. (line 6) 17547* LLT: LLT. (line 6) 17548* LNBLNK: LNBLNK. (line 6) 17549* LOC: LOC. (line 6) 17550* location of a variable in memory: LOC. (line 6) 17551* LOG: LOG. (line 6) 17552* LOG10: LOG10. (line 6) 17553* LOG_GAMMA: LOG_GAMMA. (line 6) 17554* logarithm function: LOG. (line 6) 17555* logarithm function with base 10: LOG10. (line 6) 17556* logarithm function, inverse: EXP. (line 6) 17557* LOGICAL: LOGICAL. (line 6) 17558* logical and, bitwise <1>: IAND. (line 6) 17559* logical and, bitwise: AND. (line 6) 17560* logical exclusive or, bitwise <1>: XOR. (line 6) 17561* logical exclusive or, bitwise: IEOR. (line 6) 17562* logical not, bitwise: NOT. (line 6) 17563* logical or, bitwise <1>: OR. (line 6) 17564* logical or, bitwise: IOR. (line 6) 17565* logical, variable representation: Internal representation of LOGICAL variables. 17566 (line 6) 17567* login name: GETLOG. (line 6) 17568* LONG: LONG. (line 6) 17569* LSHIFT: LSHIFT. (line 6) 17570* LSTAT: LSTAT. (line 6) 17571* LTIME: LTIME. (line 6) 17572* MALLOC: MALLOC. (line 6) 17573* mask, left justified: MASKL. (line 6) 17574* mask, right justified: MASKR. (line 6) 17575* MASKL: MASKL. (line 6) 17576* MASKR: MASKR. (line 6) 17577* MATMUL: MATMUL. (line 6) 17578* matrix multiplication: MATMUL. (line 6) 17579* matrix, transpose: TRANSPOSE. (line 6) 17580* MAX: MAX. (line 6) 17581* MAX0: MAX. (line 6) 17582* MAX1: MAX. (line 6) 17583* MAXEXPONENT: MAXEXPONENT. (line 6) 17584* maximum value <1>: MAXVAL. (line 6) 17585* maximum value: MAX. (line 6) 17586* MAXLOC: MAXLOC. (line 6) 17587* MAXVAL: MAXVAL. (line 6) 17588* MCLOCK: MCLOCK. (line 6) 17589* MCLOCK8: MCLOCK8. (line 6) 17590* memory checking: Code Gen Options. (line 161) 17591* MERGE: MERGE. (line 6) 17592* MERGE_BITS: MERGE_BITS. (line 6) 17593* messages, error: Error and Warning Options. 17594 (line 6) 17595* messages, warning: Error and Warning Options. 17596 (line 6) 17597* MIN: MIN. (line 6) 17598* MIN0: MIN. (line 6) 17599* MIN1: MIN. (line 6) 17600* MINEXPONENT: MINEXPONENT. (line 6) 17601* minimum value <1>: MINVAL. (line 6) 17602* minimum value: MIN. (line 6) 17603* MINLOC: MINLOC. (line 6) 17604* MINVAL: MINVAL. (line 6) 17605* Mixed-language programming: Mixed-Language Programming. 17606 (line 6) 17607* MOD: MOD. (line 6) 17608* model representation, base: RADIX. (line 6) 17609* model representation, epsilon: EPSILON. (line 6) 17610* model representation, largest number: HUGE. (line 6) 17611* model representation, maximum exponent: MAXEXPONENT. (line 6) 17612* model representation, minimum exponent: MINEXPONENT. (line 6) 17613* model representation, precision: PRECISION. (line 6) 17614* model representation, radix: RADIX. (line 6) 17615* model representation, range: RANGE. (line 6) 17616* model representation, significant digits: DIGITS. (line 6) 17617* model representation, smallest number: TINY. (line 6) 17618* module entities: Fortran Dialect Options. 17619 (line 72) 17620* module search path: Directory Options. (line 14) 17621* modulo: MODULO. (line 6) 17622* MODULO: MODULO. (line 6) 17623* MOVE_ALLOC: MOVE_ALLOC. (line 6) 17624* moving allocation: MOVE_ALLOC. (line 6) 17625* multiply array elements: PRODUCT. (line 6) 17626* MVBITS: MVBITS. (line 6) 17627* Namelist: Extensions to namelist. 17628 (line 6) 17629* natural logarithm function: LOG. (line 6) 17630* NEAREST: NEAREST. (line 6) 17631* NEW_LINE: NEW_LINE. (line 6) 17632* newline: NEW_LINE. (line 6) 17633* NINT: NINT. (line 6) 17634* norm, Euclidean: NORM2. (line 6) 17635* NORM2: NORM2. (line 6) 17636* NOT: NOT. (line 6) 17637* NULL: NULL. (line 6) 17638* NUM_IMAGES: NUM_IMAGES. (line 6) 17639* OpenMP <1>: OpenMP. (line 6) 17640* OpenMP: Fortran Dialect Options. 17641 (line 121) 17642* operators, unary: Unary operators. (line 6) 17643* options inquiry function: COMPILER_OPTIONS. (line 6) 17644* options, code generation: Code Gen Options. (line 6) 17645* options, debugging: Debugging Options. (line 6) 17646* options, dialect: Fortran Dialect Options. 17647 (line 6) 17648* options, directory search: Directory Options. (line 6) 17649* options, errors: Error and Warning Options. 17650 (line 6) 17651* options, Fortran dialect: Fortran Dialect Options. 17652 (line 11) 17653* options, gfortran command: Invoking GNU Fortran. 17654 (line 6) 17655* options, linking: Link Options. (line 6) 17656* options, negative forms: Invoking GNU Fortran. 17657 (line 13) 17658* options, preprocessor: Preprocessing Options. 17659 (line 6) 17660* options, real kind type promotion: Fortran Dialect Options. 17661 (line 145) 17662* options, run-time: Code Gen Options. (line 6) 17663* options, runtime: Runtime Options. (line 6) 17664* options, warnings: Error and Warning Options. 17665 (line 6) 17666* OR: OR. (line 6) 17667* output, newline: NEW_LINE. (line 6) 17668* PACK: PACK. (line 6) 17669* parity: POPPAR. (line 6) 17670* Parity: PARITY. (line 6) 17671* PARITY: PARITY. (line 6) 17672* paths, search: Directory Options. (line 14) 17673* PERROR: PERROR. (line 6) 17674* pointer checking: Code Gen Options. (line 161) 17675* pointer, C address of pointers: C_F_PROCPOINTER. (line 6) 17676* pointer, C address of procedures: C_FUNLOC. (line 6) 17677* pointer, C association status: C_ASSOCIATED. (line 6) 17678* pointer, convert C to Fortran: C_F_POINTER. (line 6) 17679* pointer, cray <1>: MALLOC. (line 6) 17680* pointer, cray: FREE. (line 6) 17681* pointer, Cray: Cray pointers. (line 6) 17682* pointer, disassociated: NULL. (line 6) 17683* pointer, status <1>: NULL. (line 6) 17684* pointer, status: ASSOCIATED. (line 6) 17685* POPCNT: POPCNT. (line 6) 17686* POPPAR: POPPAR. (line 6) 17687* positive difference: DIM. (line 6) 17688* PRECISION: PRECISION. (line 6) 17689* Preprocessing: Preprocessing and conditional compilation. 17690 (line 6) 17691* preprocessing, assertion: Preprocessing Options. 17692 (line 114) 17693* preprocessing, define macros: Preprocessing Options. 17694 (line 153) 17695* preprocessing, include path: Preprocessing Options. 17696 (line 70) 17697* preprocessing, keep comments: Preprocessing Options. 17698 (line 123) 17699* preprocessing, no linemarkers: Preprocessing Options. 17700 (line 181) 17701* preprocessing, undefine macros: Preprocessing Options. 17702 (line 187) 17703* preprocessor: Preprocessing Options. 17704 (line 6) 17705* preprocessor, debugging: Preprocessing Options. 17706 (line 26) 17707* preprocessor, disable: Preprocessing Options. 17708 (line 12) 17709* preprocessor, enable: Preprocessing Options. 17710 (line 12) 17711* preprocessor, include file handling: Preprocessing and conditional compilation. 17712 (line 6) 17713* preprocessor, working directory: Preprocessing Options. 17714 (line 55) 17715* PRESENT: PRESENT. (line 6) 17716* private: Fortran Dialect Options. 17717 (line 72) 17718* procedure pointer, convert C to Fortran: C_LOC. (line 6) 17719* process ID: GETPID. (line 6) 17720* PRODUCT: PRODUCT. (line 6) 17721* product, double-precision: DPROD. (line 6) 17722* product, matrix: MATMUL. (line 6) 17723* product, vector: DOT_PRODUCT. (line 6) 17724* program termination: EXIT. (line 6) 17725* program termination, with core dump: ABORT. (line 6) 17726* PROTECTED statement: Fortran 2003 status. (line 109) 17727* Q exponent-letter: Q exponent-letter. (line 6) 17728* RADIX: RADIX. (line 6) 17729* radix, real: SELECTED_REAL_KIND. (line 6) 17730* RAN: RAN. (line 6) 17731* RAND: RAND. (line 6) 17732* random number generation <1>: RANDOM_NUMBER. (line 6) 17733* random number generation <2>: RAND. (line 6) 17734* random number generation <3>: RAN. (line 6) 17735* random number generation: IRAND. (line 6) 17736* random number generation, seeding <1>: SRAND. (line 6) 17737* random number generation, seeding: RANDOM_SEED. (line 6) 17738* RANDOM_NUMBER: RANDOM_NUMBER. (line 6) 17739* RANDOM_SEED: RANDOM_SEED. (line 6) 17740* RANGE: RANGE. (line 6) 17741* range checking: Code Gen Options. (line 161) 17742* rank: RANK. (line 6) 17743* RANK: RANK. (line 6) 17744* re-association of parenthesized expressions: Code Gen Options. 17745 (line 346) 17746* read character, stream mode <1>: FGETC. (line 6) 17747* read character, stream mode: FGET. (line 6) 17748* REAL: REAL. (line 6) 17749* real kind: SELECTED_REAL_KIND. (line 6) 17750* real number, exponent: EXPONENT. (line 6) 17751* real number, fraction: FRACTION. (line 6) 17752* real number, nearest different: NEAREST. (line 6) 17753* real number, relative spacing <1>: SPACING. (line 6) 17754* real number, relative spacing: RRSPACING. (line 6) 17755* real number, scale: SCALE. (line 6) 17756* real number, set exponent: SET_EXPONENT. (line 6) 17757* Reallocate the LHS in assignments: Code Gen Options. (line 355) 17758* Reallocate the LHS in assignments, notification: Error and Warning Options. 17759 (line 208) 17760* REALPART: REAL. (line 6) 17761* RECORD: STRUCTURE and RECORD. 17762 (line 6) 17763* Reduction, XOR: PARITY. (line 6) 17764* remainder: MOD. (line 6) 17765* RENAME: RENAME. (line 6) 17766* repacking arrays: Code Gen Options. (line 262) 17767* REPEAT: REPEAT. (line 6) 17768* RESHAPE: RESHAPE. (line 6) 17769* right shift, combined: DSHIFTR. (line 6) 17770* root: SQRT. (line 6) 17771* rounding, ceiling <1>: CEILING. (line 6) 17772* rounding, ceiling: ANINT. (line 6) 17773* rounding, floor <1>: FLOOR. (line 6) 17774* rounding, floor: AINT. (line 6) 17775* rounding, nearest whole number: NINT. (line 6) 17776* RRSPACING: RRSPACING. (line 6) 17777* RSHIFT: RSHIFT. (line 6) 17778* run-time checking: Code Gen Options. (line 161) 17779* SAME_TYPE_AS: SAME_TYPE_AS. (line 6) 17780* SAVE statement: Code Gen Options. (line 15) 17781* SCALE: SCALE. (line 6) 17782* SCAN: SCAN. (line 6) 17783* search path: Directory Options. (line 6) 17784* search paths, for included files: Directory Options. (line 14) 17785* SECNDS: SECNDS. (line 6) 17786* SECOND: SECOND. (line 6) 17787* seeding a random number generator <1>: SRAND. (line 6) 17788* seeding a random number generator: RANDOM_SEED. (line 6) 17789* SELECTED_CHAR_KIND: SELECTED_CHAR_KIND. (line 6) 17790* SELECTED_INT_KIND: SELECTED_INT_KIND. (line 6) 17791* SELECTED_REAL_KIND: SELECTED_REAL_KIND. (line 6) 17792* SET_EXPONENT: SET_EXPONENT. (line 6) 17793* SHAPE: SHAPE. (line 6) 17794* shift, left <1>: SHIFTL. (line 6) 17795* shift, left: DSHIFTL. (line 6) 17796* shift, right <1>: SHIFTR. (line 6) 17797* shift, right: DSHIFTR. (line 6) 17798* shift, right with fill: SHIFTA. (line 6) 17799* SHIFTA: SHIFTA. (line 6) 17800* SHIFTL: SHIFTL. (line 6) 17801* SHIFTR: SHIFTR. (line 6) 17802* SHORT: INT2. (line 6) 17803* SIGN: SIGN. (line 6) 17804* sign copying: SIGN. (line 6) 17805* SIGNAL: SIGNAL. (line 6) 17806* SIN: SIN. (line 6) 17807* sine: SIN. (line 6) 17808* sine, hyperbolic: SINH. (line 6) 17809* sine, hyperbolic, inverse: ASINH. (line 6) 17810* sine, inverse: ASIN. (line 6) 17811* SINH: SINH. (line 6) 17812* SIZE: SIZE. (line 6) 17813* size of a variable, in bits: BIT_SIZE. (line 6) 17814* size of an expression <1>: SIZEOF. (line 6) 17815* size of an expression: C_SIZEOF. (line 6) 17816* SIZEOF: SIZEOF. (line 6) 17817* SLEEP: SLEEP. (line 6) 17818* SNGL: REAL. (line 6) 17819* SPACING: SPACING. (line 6) 17820* SPREAD: SPREAD. (line 6) 17821* SQRT: SQRT. (line 6) 17822* square-root: SQRT. (line 6) 17823* SRAND: SRAND. (line 6) 17824* Standards: Standards. (line 6) 17825* STAT: STAT. (line 6) 17826* statement, ENUM: Fortran 2003 status. (line 88) 17827* statement, ENUMERATOR: Fortran 2003 status. (line 88) 17828* statement, FLUSH: Fortran 2003 status. (line 84) 17829* statement, IMPORT: Fortran 2003 status. (line 115) 17830* statement, ISO_FORTRAN_ENV: Fortran 2003 status. (line 123) 17831* statement, PROTECTED: Fortran 2003 status. (line 109) 17832* statement, SAVE: Code Gen Options. (line 15) 17833* statement, USE, INTRINSIC: Fortran 2003 status. (line 123) 17834* statement, VALUE: Fortran 2003 status. (line 111) 17835* statement, VOLATILE: Fortran 2003 status. (line 113) 17836* storage size: STORAGE_SIZE. (line 6) 17837* STORAGE_SIZE: STORAGE_SIZE. (line 6) 17838* STREAM I/O: Fortran 2003 status. (line 100) 17839* stream mode, read character <1>: FGETC. (line 6) 17840* stream mode, read character: FGET. (line 6) 17841* stream mode, write character <1>: FPUTC. (line 6) 17842* stream mode, write character: FPUT. (line 6) 17843* string, adjust left: ADJUSTL. (line 6) 17844* string, adjust right: ADJUSTR. (line 6) 17845* string, comparison <1>: LLT. (line 6) 17846* string, comparison <2>: LLE. (line 6) 17847* string, comparison <3>: LGT. (line 6) 17848* string, comparison: LGE. (line 6) 17849* string, concatenate: REPEAT. (line 6) 17850* string, find missing set: VERIFY. (line 6) 17851* string, find non-blank character: LNBLNK. (line 6) 17852* string, find subset: SCAN. (line 6) 17853* string, find substring: INDEX intrinsic. (line 6) 17854* string, length: LEN. (line 6) 17855* string, length, without trailing whitespace: LEN_TRIM. (line 6) 17856* string, remove trailing whitespace: TRIM. (line 6) 17857* string, repeat: REPEAT. (line 6) 17858* strings, varying length: Varying Length Character Strings. 17859 (line 6) 17860* STRUCTURE: STRUCTURE and RECORD. 17861 (line 6) 17862* structure packing: Code Gen Options. (line 256) 17863* subscript checking: Code Gen Options. (line 161) 17864* substring position: INDEX intrinsic. (line 6) 17865* SUM: SUM. (line 6) 17866* sum array elements: SUM. (line 6) 17867* suppressing warnings: Error and Warning Options. 17868 (line 6) 17869* symbol names: Fortran Dialect Options. 17870 (line 54) 17871* symbol names, transforming: Code Gen Options. (line 54) 17872* symbol names, underscores: Code Gen Options. (line 54) 17873* SYMLNK: SYMLNK. (line 6) 17874* syntax checking: Error and Warning Options. 17875 (line 33) 17876* SYSTEM: SYSTEM. (line 6) 17877* system, error handling <1>: PERROR. (line 6) 17878* system, error handling <2>: IERRNO. (line 6) 17879* system, error handling: GERROR. (line 6) 17880* system, group ID: GETGID. (line 6) 17881* system, host name: HOSTNM. (line 6) 17882* system, login name: GETLOG. (line 6) 17883* system, process ID: GETPID. (line 6) 17884* system, signal handling: SIGNAL. (line 6) 17885* system, system call <1>: SYSTEM. (line 6) 17886* system, system call: EXECUTE_COMMAND_LINE. 17887 (line 6) 17888* system, terminal <1>: TTYNAM. (line 6) 17889* system, terminal: ISATTY. (line 6) 17890* system, user ID: GETUID. (line 6) 17891* system, working directory <1>: GETCWD. (line 6) 17892* system, working directory: CHDIR. (line 6) 17893* SYSTEM_CLOCK: SYSTEM_CLOCK. (line 6) 17894* tabulators: Error and Warning Options. 17895 (line 168) 17896* TAN: TAN. (line 6) 17897* tangent: TAN. (line 6) 17898* tangent, hyperbolic: TANH. (line 6) 17899* tangent, hyperbolic, inverse: ATANH. (line 6) 17900* tangent, inverse <1>: ATAN2. (line 6) 17901* tangent, inverse: ATAN. (line 6) 17902* TANH: TANH. (line 6) 17903* terminate program: EXIT. (line 6) 17904* terminate program, with core dump: ABORT. (line 6) 17905* THIS_IMAGE: THIS_IMAGE. (line 6) 17906* thread-safety, threads: Thread-safety of the runtime library. 17907 (line 6) 17908* TIME: TIME. (line 6) 17909* time, clock ticks <1>: SYSTEM_CLOCK. (line 6) 17910* time, clock ticks <2>: MCLOCK8. (line 6) 17911* time, clock ticks: MCLOCK. (line 6) 17912* time, conversion to GMT info: GMTIME. (line 6) 17913* time, conversion to local time info: LTIME. (line 6) 17914* time, conversion to string: CTIME. (line 6) 17915* time, current <1>: TIME8. (line 6) 17916* time, current <2>: TIME. (line 6) 17917* time, current <3>: ITIME. (line 6) 17918* time, current <4>: FDATE. (line 6) 17919* time, current: DATE_AND_TIME. (line 6) 17920* time, elapsed <1>: SECOND. (line 6) 17921* time, elapsed <2>: SECNDS. (line 6) 17922* time, elapsed <3>: ETIME. (line 6) 17923* time, elapsed <4>: DTIME. (line 6) 17924* time, elapsed: CPU_TIME. (line 6) 17925* TIME8: TIME8. (line 6) 17926* TINY: TINY. (line 6) 17927* TR 15581: Fortran 2003 status. (line 93) 17928* trace: Debugging Options. (line 51) 17929* TRAILZ: TRAILZ. (line 6) 17930* TRANSFER: TRANSFER. (line 6) 17931* transforming symbol names: Code Gen Options. (line 54) 17932* transpose: TRANSPOSE. (line 6) 17933* TRANSPOSE: TRANSPOSE. (line 6) 17934* trigonometric function, cosine: COS. (line 6) 17935* trigonometric function, cosine, inverse: ACOS. (line 6) 17936* trigonometric function, sine: SIN. (line 6) 17937* trigonometric function, sine, inverse: ASIN. (line 6) 17938* trigonometric function, tangent: TAN. (line 6) 17939* trigonometric function, tangent, inverse <1>: ATAN2. (line 6) 17940* trigonometric function, tangent, inverse: ATAN. (line 6) 17941* TRIM: TRIM. (line 6) 17942* TTYNAM: TTYNAM. (line 6) 17943* type cast: TRANSFER. (line 6) 17944* UBOUND: UBOUND. (line 6) 17945* UCOBOUND: UCOBOUND. (line 6) 17946* UMASK: UMASK. (line 6) 17947* underflow: Error and Warning Options. 17948 (line 176) 17949* underscore: Code Gen Options. (line 54) 17950* UNLINK: UNLINK. (line 6) 17951* UNPACK: UNPACK. (line 6) 17952* unused dummy argument: Error and Warning Options. 17953 (line 187) 17954* unused parameter: Error and Warning Options. 17955 (line 191) 17956* USE, INTRINSIC statement: Fortran 2003 status. (line 123) 17957* user id: GETUID. (line 6) 17958* VALUE statement: Fortran 2003 status. (line 111) 17959* Varying length character strings: Varying Length Character Strings. 17960 (line 6) 17961* Varying length strings: Varying Length Character Strings. 17962 (line 6) 17963* vector product: DOT_PRODUCT. (line 6) 17964* VERIFY: VERIFY. (line 6) 17965* version of the compiler: COMPILER_VERSION. (line 6) 17966* VOLATILE statement: Fortran 2003 status. (line 113) 17967* warning, C binding type: Error and Warning Options. 17968 (line 99) 17969* warnings, aliasing: Error and Warning Options. 17970 (line 69) 17971* warnings, alignment of COMMON blocks: Error and Warning Options. 17972 (line 198) 17973* warnings, all: Error and Warning Options. 17974 (line 61) 17975* warnings, ampersand: Error and Warning Options. 17976 (line 86) 17977* warnings, array temporaries: Error and Warning Options. 17978 (line 94) 17979* warnings, character truncation: Error and Warning Options. 17980 (line 106) 17981* warnings, conversion: Error and Warning Options. 17982 (line 113) 17983* warnings, extra: Error and Warning Options. 17984 (line 120) 17985* warnings, function elimination: Error and Warning Options. 17986 (line 204) 17987* warnings, implicit interface: Error and Warning Options. 17988 (line 125) 17989* warnings, implicit procedure: Error and Warning Options. 17990 (line 131) 17991* warnings, intrinsic: Error and Warning Options. 17992 (line 180) 17993* warnings, intrinsics of other standards: Error and Warning Options. 17994 (line 135) 17995* warnings, line truncation: Error and Warning Options. 17996 (line 109) 17997* warnings, non-standard intrinsics: Error and Warning Options. 17998 (line 135) 17999* warnings, q exponent-letter: Error and Warning Options. 18000 (line 142) 18001* warnings, suppressing: Error and Warning Options. 18002 (line 6) 18003* warnings, suspicious code: Error and Warning Options. 18004 (line 146) 18005* warnings, tabs: Error and Warning Options. 18006 (line 168) 18007* warnings, to errors: Error and Warning Options. 18008 (line 234) 18009* warnings, underflow: Error and Warning Options. 18010 (line 176) 18011* warnings, unused dummy argument: Error and Warning Options. 18012 (line 187) 18013* warnings, unused parameter: Error and Warning Options. 18014 (line 191) 18015* write character, stream mode <1>: FPUTC. (line 6) 18016* write character, stream mode: FPUT. (line 6) 18017* XOR: XOR. (line 6) 18018* XOR reduction: PARITY. (line 6) 18019* ZABS: ABS. (line 6) 18020* ZCOS: COS. (line 6) 18021* zero bits <1>: TRAILZ. (line 6) 18022* zero bits: LEADZ. (line 6) 18023* ZEXP: EXP. (line 6) 18024* ZLOG: LOG. (line 6) 18025* ZSIN: SIN. (line 6) 18026* ZSQRT: SQRT. (line 6) 18027 18028 18029 18030Tag Table: 18031Node: Top1990 18032Node: Introduction3377 18033Node: About GNU Fortran4126 18034Node: GNU Fortran and GCC8115 18035Node: Preprocessing and conditional compilation10229 18036Node: GNU Fortran and G7711873 18037Node: Project Status12446 18038Node: Standards14893 18039Node: Varying Length Character Strings15906 18040Node: Invoking GNU Fortran16657 18041Node: Option Summary18380 18042Node: Fortran Dialect Options21783 18043Node: Preprocessing Options30279 18044Node: Error and Warning Options38510 18045Node: Debugging Options48571 18046Node: Directory Options51554 18047Node: Link Options52989 18048Node: Runtime Options53613 18049Node: Code Gen Options55518 18050Node: Environment Variables72500 18051Node: Runtime73105 18052Node: TMPDIR74207 18053Node: GFORTRAN_STDIN_UNIT74876 18054Node: GFORTRAN_STDOUT_UNIT75258 18055Node: GFORTRAN_STDERR_UNIT75659 18056Node: GFORTRAN_UNBUFFERED_ALL76061 18057Node: GFORTRAN_UNBUFFERED_PRECONNECTED76592 18058Node: GFORTRAN_SHOW_LOCUS77236 18059Node: GFORTRAN_OPTIONAL_PLUS77732 18060Node: GFORTRAN_DEFAULT_RECL78208 18061Node: GFORTRAN_LIST_SEPARATOR78697 18062Node: GFORTRAN_CONVERT_UNIT79306 18063Node: GFORTRAN_ERROR_BACKTRACE82169 18064Node: Fortran 2003 and 2008 status82726 18065Node: Fortran 2003 status82986 18066Node: Fortran 2008 status87883 18067Node: TS 29113 status92668 18068Node: Compiler Characteristics93644 18069Node: KIND Type Parameters94180 18070Node: Internal representation of LOGICAL variables95430 18071Node: Thread-safety of the runtime library96787 18072Node: Data consistency and durability98214 18073Node: Extensions101256 18074Node: Extensions implemented in GNU Fortran101861 18075Node: Old-style kind specifications103219 18076Node: Old-style variable initialization104326 18077Node: Extensions to namelist105638 18078Node: X format descriptor without count field107635 18079Node: Commas in FORMAT specifications108162 18080Node: Missing period in FORMAT specifications108679 18081Node: I/O item lists109241 18082Node: `Q' exponent-letter109628 18083Node: BOZ literal constants110228 18084Node: Real array indices112807 18085Node: Unary operators113106 18086Node: Implicitly convert LOGICAL and INTEGER values113520 18087Node: Hollerith constants support114480 18088Node: Cray pointers116252 18089Node: CONVERT specifier121699 18090Node: OpenMP123697 18091Node: Argument list functions125948 18092Node: Extensions not implemented in GNU Fortran127554 18093Node: STRUCTURE and RECORD128476 18094Node: ENCODE and DECODE statements130912 18095Node: Variable FORMAT expressions132272 18096Node: Alternate complex function syntax133377 18097Node: Mixed-Language Programming133897 18098Node: Interoperability with C134437 18099Node: Intrinsic Types135775 18100Node: Derived Types and struct136290 18101Node: Interoperable Global Variables137647 18102Node: Interoperable Subroutines and Functions138923 18103Node: Working with Pointers142719 18104Node: Further Interoperability of Fortran with C147195 18105Node: GNU Fortran Compiler Directives150545 18106Node: Non-Fortran Main Program152737 18107Node: _gfortran_set_args154879 18108Node: _gfortran_set_options155814 18109Node: _gfortran_set_convert158534 18110Node: _gfortran_set_record_marker159398 18111Node: _gfortran_set_fpe160206 18112Node: _gfortran_set_max_subrecord_length161398 18113Node: Intrinsic Procedures162318 18114Node: Introduction to Intrinsics177804 18115Node: ABORT180156 18116Node: ABS180902 18117Node: ACCESS182519 18118Node: ACHAR184440 18119Node: ACOS185641 18120Node: ACOSH186878 18121Node: ADJUSTL187866 18122Node: ADJUSTR188807 18123Node: AIMAG189754 18124Node: AINT191135 18125Node: ALARM192722 18126Node: ALL194356 18127Node: ALLOCATED196274 18128Node: AND197411 18129Node: ANINT198708 18130Node: ANY200186 18131Node: ASIN202116 18132Node: ASINH203342 18133Node: ASSOCIATED204340 18134Node: ATAN207345 18135Node: ATAN2208764 18136Node: ATANH210536 18137Node: ATOMIC_DEFINE211536 18138Node: ATOMIC_REF212710 18139Node: BACKTRACE214070 18140Node: BESSEL_J0214649 18141Node: BESSEL_J1215697 18142Node: BESSEL_JN216749 18143Node: BESSEL_Y0218631 18144Node: BESSEL_Y1219631 18145Node: BESSEL_YN220631 18146Node: BGE222463 18147Node: BGT223152 18148Node: BIT_SIZE223799 18149Node: BLE224620 18150Node: BLT225299 18151Node: BTEST225934 18152Node: C_ASSOCIATED226817 18153Node: C_F_POINTER228026 18154Node: C_F_PROCPOINTER229450 18155Node: C_FUNLOC230951 18156Node: C_LOC232320 18157Node: C_SIZEOF233597 18158Node: CEILING235007 18159Node: CHAR236012 18160Node: CHDIR237216 18161Node: CHMOD238384 18162Node: CMPLX240247 18163Node: COMMAND_ARGUMENT_COUNT241711 18164Node: COMPILER_OPTIONS242634 18165Node: COMPILER_VERSION243660 18166Node: COMPLEX244624 18167Node: CONJG245761 18168Node: COS246832 18169Node: COSH248278 18170Node: COUNT249443 18171Node: CPU_TIME251459 18172Node: CSHIFT252813 18173Node: CTIME254469 18174Node: DATE_AND_TIME256122 18175Node: DBLE258583 18176Node: DCMPLX259376 18177Node: DIGITS260570 18178Node: DIM261536 18179Node: DOT_PRODUCT262794 18180Node: DPROD264450 18181Node: DREAL265367 18182Node: DSHIFTL266033 18183Node: DSHIFTR267353 18184Node: DTIME268674 18185Node: EOSHIFT271477 18186Node: EPSILON273550 18187Node: ERF274276 18188Node: ERFC275050 18189Node: ERFC_SCALED275854 18190Node: ETIME276546 18191Node: EXECUTE_COMMAND_LINE278787 18192Node: EXIT281367 18193Node: EXP282241 18194Node: EXPONENT283514 18195Node: EXTENDS_TYPE_OF284274 18196Node: FDATE285127 18197Node: FGET286609 18198Node: FGETC288427 18199Node: FLOOR290226 18200Node: FLUSH291210 18201Node: FNUM293085 18202Node: FPUT293807 18203Node: FPUTC295432 18204Node: FRACTION297203 18205Node: FREE298104 18206Node: FSEEK298939 18207Node: FSTAT301233 18208Node: FTELL302313 18209Node: GAMMA303291 18210Node: GERROR304332 18211Node: GETARG305051 18212Node: GET_COMMAND306815 18213Node: GET_COMMAND_ARGUMENT308179 18214Node: GETCWD310215 18215Node: GETENV311189 18216Node: GET_ENVIRONMENT_VARIABLE312614 18217Node: GETGID314767 18218Node: GETLOG315304 18219Node: GETPID316164 18220Node: GETUID316894 18221Node: GMTIME317410 18222Node: HOSTNM318899 18223Node: HUGE319817 18224Node: HYPOT320538 18225Node: IACHAR321358 18226Node: IALL322538 18227Node: IAND324015 18228Node: IANY324999 18229Node: IARGC326485 18230Node: IBCLR327506 18231Node: IBITS328167 18232Node: IBSET329082 18233Node: ICHAR329738 18234Node: IDATE331910 18235Node: IEOR332937 18236Node: IERRNO333813 18237Node: IMAGE_INDEX334362 18238Node: INDEX intrinsic335386 18239Node: INT336927 18240Node: INT2338629 18241Node: INT8339394 18242Node: IOR340106 18243Node: IPARITY340958 18244Node: IRAND342482 18245Node: IS_IOSTAT_END343838 18246Node: IS_IOSTAT_EOR344935 18247Node: ISATTY346062 18248Node: ISHFT346845 18249Node: ISHFTC347825 18250Node: ISNAN349041 18251Node: ITIME349789 18252Node: KILL350814 18253Node: KIND351718 18254Node: LBOUND352563 18255Node: LCOBOUND353896 18256Node: LEADZ355026 18257Node: LEN355886 18258Node: LEN_TRIM357167 18259Node: LGE358149 18260Node: LGT359651 18261Node: LINK361118 18262Node: LLE362153 18263Node: LLT363647 18264Node: LNBLNK365107 18265Node: LOC365883 18266Node: LOG366614 18267Node: LOG10368017 18268Node: LOG_GAMMA368991 18269Node: LOGICAL370080 18270Node: LONG370888 18271Node: LSHIFT371644 18272Node: LSTAT372729 18273Node: LTIME373923 18274Node: MALLOC375334 18275Node: MASKL376793 18276Node: MASKR377556 18277Node: MATMUL378322 18278Node: MAX379411 18279Node: MAXEXPONENT380910 18280Node: MAXLOC381726 18281Node: MAXVAL383745 18282Node: MCLOCK385378 18283Node: MCLOCK8386402 18284Node: MERGE387635 18285Node: MERGE_BITS388384 18286Node: MIN389245 18287Node: MINEXPONENT390746 18288Node: MINLOC391376 18289Node: MINVAL393395 18290Node: MOD395047 18291Node: MODULO396792 18292Node: MOVE_ALLOC398092 18293Node: MVBITS399121 18294Node: NEAREST400180 18295Node: NEW_LINE401276 18296Node: NINT402047 18297Node: NORM2403450 18298Node: NOT404588 18299Node: NULL405172 18300Node: NUM_IMAGES406077 18301Node: OR406893 18302Node: PACK408177 18303Node: PARITY410169 18304Node: PERROR411384 18305Node: POPCNT412005 18306Node: POPPAR412876 18307Node: PRECISION413927 18308Node: PRESENT414813 18309Node: PRODUCT415919 18310Node: RADIX417444 18311Node: RAN418256 18312Node: RAND418712 18313Node: RANDOM_NUMBER420044 18314Node: RANDOM_SEED421761 18315Node: RANGE425439 18316Node: RANK426135 18317Node: REAL426916 18318Node: RENAME428691 18319Node: REPEAT429710 18320Node: RESHAPE430436 18321Node: RRSPACING431905 18322Node: RSHIFT432598 18323Node: SAME_TYPE_AS433736 18324Node: SCALE434566 18325Node: SCAN435346 18326Node: SECNDS436896 18327Node: SECOND437984 18328Node: SELECTED_CHAR_KIND438860 18329Node: SELECTED_INT_KIND440451 18330Node: SELECTED_REAL_KIND441626 18331Node: SET_EXPONENT444292 18332Node: SHAPE445288 18333Node: SHIFTA446703 18334Node: SHIFTL447664 18335Node: SHIFTR448499 18336Node: SIGN449335 18337Node: SIGNAL450619 18338Node: SIN452116 18339Node: SINH453214 18340Node: SIZE454210 18341Node: SIZEOF455518 18342Node: SLEEP456993 18343Node: SPACING457553 18344Node: SPREAD458566 18345Node: SQRT459711 18346Node: SRAND461065 18347Node: STAT462233 18348Node: STORAGE_SIZE465400 18349Node: SUM466279 18350Node: SYMLNK467762 18351Node: SYSTEM468894 18352Node: SYSTEM_CLOCK470145 18353Node: TAN472261 18354Node: TANH473233 18355Node: THIS_IMAGE474390 18356Node: TIME475882 18357Node: TIME8477007 18358Node: TINY478157 18359Node: TRAILZ478757 18360Node: TRANSFER479574 18361Node: TRANSPOSE481608 18362Node: TRIM482295 18363Node: TTYNAM483152 18364Node: UBOUND484067 18365Node: UCOBOUND485457 18366Node: UMASK486589 18367Node: UNLINK487267 18368Node: UNPACK488244 18369Node: VERIFY489532 18370Node: XOR491253 18371Node: Intrinsic Modules492625 18372Node: ISO_FORTRAN_ENV492868 18373Node: ISO_C_BINDING497020 18374Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS501237 18375Node: Contributing502523 18376Node: Contributors503377 18377Node: Projects505044 18378Node: Proposed Extensions505848 18379Node: Copying507859 18380Node: GNU Free Documentation License545423 18381Node: Funding570566 18382Node: Option Index573091 18383Node: Keyword Index588082 18384 18385End Tag Table 18386