1This is gfortran.info, produced by makeinfo version 6.5 from 2gfortran.texi. 3 4Copyright (C) 1999-2020 Free Software Foundation, Inc. 5 6 Permission is granted to copy, distribute and/or modify this document 7under the terms of the GNU Free Documentation License, Version 1.3 or 8any later version published by the Free Software Foundation; with the 9Invariant Sections being "Funding Free Software", the Front-Cover Texts 10being (a) (see below), and with the Back-Cover Texts being (b) (see 11below). A copy of the license is included in the section entitled "GNU 12Free Documentation License". 13 14 (a) The FSF's Front-Cover Text is: 15 16 A GNU Manual 17 18 (b) The FSF's Back-Cover Text is: 19 20 You have freedom to copy and modify this GNU Manual, like GNU 21software. Copies published by the Free Software Foundation raise funds 22for GNU development. 23INFO-DIR-SECTION Software development 24START-INFO-DIR-ENTRY 25* gfortran: (gfortran). The GNU Fortran Compiler. 26END-INFO-DIR-ENTRY 27 28 This file documents the use and the internals of the GNU Fortran 29compiler, ('gfortran'). 30 31 Published by the Free Software Foundation 51 Franklin Street, Fifth 32Floor Boston, MA 02110-1301 USA 33 34 Copyright (C) 1999-2020 Free Software Foundation, Inc. 35 36 Permission is granted to copy, distribute and/or modify this document 37under the terms of the GNU Free Documentation License, Version 1.3 or 38any later version published by the Free Software Foundation; with the 39Invariant Sections being "Funding Free Software", the Front-Cover Texts 40being (a) (see below), and with the Back-Cover Texts being (b) (see 41below). A copy of the license is included in the section entitled "GNU 42Free Documentation License". 43 44 (a) The FSF's Front-Cover Text is: 45 46 A GNU Manual 47 48 (b) The FSF's Back-Cover Text is: 49 50 You have freedom to copy and modify this GNU Manual, like GNU 51software. Copies published by the Free Software Foundation raise funds 52for GNU development. 53 54 55File: gfortran.info, Node: Top, Next: Introduction, Up: (dir) 56 57Introduction 58************ 59 60This manual documents the use of 'gfortran', the GNU Fortran compiler. 61You can find in this manual how to invoke 'gfortran', as well as its 62features and incompatibilities. 63 64* Menu: 65 66* Introduction:: 67 68Part I: Invoking GNU Fortran 69* Invoking GNU Fortran:: Command options supported by 'gfortran'. 70* Runtime:: Influencing runtime behavior with environment variables. 71 72Part II: Language Reference 73* Fortran standards status:: Fortran 2003, 2008 and 2018 features supported by GNU Fortran. 74* Compiler Characteristics:: User-visible implementation details. 75* Extensions:: Language extensions implemented by GNU Fortran. 76* Mixed-Language Programming:: Interoperability with C 77* Coarray Programming:: 78* Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran. 79* Intrinsic Modules:: Intrinsic modules supported by GNU Fortran. 80 81* Contributing:: How you can help. 82* Copying:: GNU General Public License says 83 how you can copy and share GNU Fortran. 84* GNU Free Documentation License:: 85 How you can copy and share this manual. 86* Funding:: How to help assure continued work for free software. 87* Option Index:: Index of command line options 88* Keyword Index:: Index of concepts 89 90 91File: gfortran.info, Node: Introduction, Next: Invoking GNU Fortran, Prev: Top, Up: Top 92 931 Introduction 94************** 95 96The GNU Fortran compiler front end was designed initially as a free 97replacement for, or alternative to, the Unix 'f95' command; 'gfortran' 98is the command you will use to invoke the compiler. 99 100* Menu: 101 102* About GNU Fortran:: What you should know about the GNU Fortran compiler. 103* GNU Fortran and GCC:: You can compile Fortran, C, or other programs. 104* Preprocessing and conditional compilation:: The Fortran preprocessor 105* GNU Fortran and G77:: Why we chose to start from scratch. 106* Project Status:: Status of GNU Fortran, roadmap, proposed extensions. 107* Standards:: Standards supported by GNU Fortran. 108 109 110File: gfortran.info, Node: About GNU Fortran, Next: GNU Fortran and GCC, Up: Introduction 111 1121.1 About GNU Fortran 113===================== 114 115The GNU Fortran compiler supports the Fortran 77, 90 and 95 standards 116completely, parts of the Fortran 2003, 2008 and 2018 standards, and 117several vendor extensions. The development goal is to provide the 118following features: 119 120 * Read a user's program, stored in a file and containing instructions 121 written in Fortran 77, Fortran 90, Fortran 95, Fortran 2003, 122 Fortran 2008 or Fortran 2018. This file contains "source code". 123 124 * Translate the user's program into instructions a computer can carry 125 out more quickly than it takes to translate the instructions in the 126 first place. The result after compilation of a program is "machine 127 code", code designed to be efficiently translated and processed by 128 a machine such as your computer. Humans usually are not as good 129 writing machine code as they are at writing Fortran (or C++, Ada, 130 or Java), because it is easy to make tiny mistakes writing machine 131 code. 132 133 * Provide the user with information about the reasons why the 134 compiler is unable to create a binary from the source code. 135 Usually this will be the case if the source code is flawed. The 136 Fortran 90 standard requires that the compiler can point out 137 mistakes to the user. An incorrect usage of the language causes an 138 "error message". 139 140 The compiler will also attempt to diagnose cases where the user's 141 program contains a correct usage of the language, but instructs the 142 computer to do something questionable. This kind of diagnostics 143 message is called a "warning message". 144 145 * Provide optional information about the translation passes from the 146 source code to machine code. This can help a user of the compiler 147 to find the cause of certain bugs which may not be obvious in the 148 source code, but may be more easily found at a lower level compiler 149 output. It also helps developers to find bugs in the compiler 150 itself. 151 152 * Provide information in the generated machine code that can make it 153 easier to find bugs in the program (using a debugging tool, called 154 a "debugger", such as the GNU Debugger 'gdb'). 155 156 * Locate and gather machine code already generated to perform actions 157 requested by statements in the user's program. This machine code 158 is organized into "modules" and is located and "linked" to the user 159 program. 160 161 The GNU Fortran compiler consists of several components: 162 163 * A version of the 'gcc' command (which also might be installed as 164 the system's 'cc' command) that also understands and accepts 165 Fortran source code. The 'gcc' command is the "driver" program for 166 all the languages in the GNU Compiler Collection (GCC); With 'gcc', 167 you can compile the source code of any language for which a front 168 end is available in GCC. 169 170 * The 'gfortran' command itself, which also might be installed as the 171 system's 'f95' command. 'gfortran' is just another driver program, 172 but specifically for the Fortran compiler only. The difference 173 with 'gcc' is that 'gfortran' will automatically link the correct 174 libraries to your program. 175 176 * A collection of run-time libraries. These libraries contain the 177 machine code needed to support capabilities of the Fortran language 178 that are not directly provided by the machine code generated by the 179 'gfortran' compilation phase, such as intrinsic functions and 180 subroutines, and routines for interaction with files and the 181 operating system. 182 183 * The Fortran compiler itself, ('f951'). This is the GNU Fortran 184 parser and code generator, linked to and interfaced with the GCC 185 backend library. 'f951' "translates" the source code to assembler 186 code. You would typically not use this program directly; instead, 187 the 'gcc' or 'gfortran' driver programs will call it for you. 188 189 190File: gfortran.info, Node: GNU Fortran and GCC, Next: Preprocessing and conditional compilation, Prev: About GNU Fortran, Up: Introduction 191 1921.2 GNU Fortran and GCC 193======================= 194 195GNU Fortran is a part of GCC, the "GNU Compiler Collection". GCC 196consists of a collection of front ends for various languages, which 197translate the source code into a language-independent form called 198"GENERIC". This is then processed by a common middle end which provides 199optimization, and then passed to one of a collection of back ends which 200generate code for different computer architectures and operating 201systems. 202 203 Functionally, this is implemented with a driver program ('gcc') which 204provides the command-line interface for the compiler. It calls the 205relevant compiler front-end program (e.g., 'f951' for Fortran) for each 206file in the source code, and then calls the assembler and linker as 207appropriate to produce the compiled output. In a copy of GCC which has 208been compiled with Fortran language support enabled, 'gcc' will 209recognize files with '.f', '.for', '.ftn', '.f90', '.f95', '.f03' and 210'.f08' extensions as Fortran source code, and compile it accordingly. A 211'gfortran' driver program is also provided, which is identical to 'gcc' 212except that it automatically links the Fortran runtime libraries into 213the compiled program. 214 215 Source files with '.f', '.for', '.fpp', '.ftn', '.F', '.FOR', '.FPP', 216and '.FTN' extensions are treated as fixed form. Source files with 217'.f90', '.f95', '.f03', '.f08', '.F90', '.F95', '.F03' and '.F08' 218extensions are treated as free form. The capitalized versions of either 219form are run through preprocessing. Source files with the lower case 220'.fpp' extension are also run through preprocessing. 221 222 This manual specifically documents the Fortran front end, which 223handles the programming language's syntax and semantics. The aspects of 224GCC which relate to the optimization passes and the back-end code 225generation are documented in the GCC manual; see *note Introduction: 226(gcc)Top. The two manuals together provide a complete reference for the 227GNU Fortran compiler. 228 229 230File: gfortran.info, Node: Preprocessing and conditional compilation, Next: GNU Fortran and G77, Prev: GNU Fortran and GCC, Up: Introduction 231 2321.3 Preprocessing and conditional compilation 233============================================= 234 235Many Fortran compilers including GNU Fortran allow passing the source 236code through a C preprocessor (CPP; sometimes also called the Fortran 237preprocessor, FPP) to allow for conditional compilation. In the case of 238GNU Fortran, this is the GNU C Preprocessor in the traditional mode. On 239systems with case-preserving file names, the preprocessor is 240automatically invoked if the filename extension is '.F', '.FOR', '.FTN', 241'.fpp', '.FPP', '.F90', '.F95', '.F03' or '.F08'. To manually invoke 242the preprocessor on any file, use '-cpp', to disable preprocessing on 243files where the preprocessor is run automatically, use '-nocpp'. 244 245 If a preprocessed file includes another file with the Fortran 246'INCLUDE' statement, the included file is not preprocessed. To 247preprocess included files, use the equivalent preprocessor statement 248'#include'. 249 250 If GNU Fortran invokes the preprocessor, '__GFORTRAN__' is defined. 251The macros '__GNUC__', '__GNUC_MINOR__' and '__GNUC_PATCHLEVEL__' can be 252used to determine the version of the compiler. See *note Overview: 253(cpp)Top. for details. 254 255 GNU Fortran supports a number of 'INTEGER' and 'REAL' kind types in 256additional to the kind types required by the Fortran standard. The 257availability of any given kind type is architecture dependent. The 258following pre-defined preprocessor macros can be used to conditionally 259include code for these additional kind types: '__GFC_INT_1__', 260'__GFC_INT_2__', '__GFC_INT_8__', '__GFC_INT_16__', '__GFC_REAL_10__', 261and '__GFC_REAL_16__'. 262 263 While CPP is the de-facto standard for preprocessing Fortran code, 264Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines 265Conditional Compilation, which is not widely used and not directly 266supported by the GNU Fortran compiler. You can use the program coco to 267preprocess such files (<http://www.daniellnagle.com/coco.html>). 268 269 270File: gfortran.info, Node: GNU Fortran and G77, Next: Project Status, Prev: Preprocessing and conditional compilation, Up: Introduction 271 2721.4 GNU Fortran and G77 273======================= 274 275The GNU Fortran compiler is the successor to 'g77', the Fortran 77 front 276end included in GCC prior to version 4. It is an entirely new program 277that has been designed to provide Fortran 95 support and extensibility 278for future Fortran language standards, as well as providing backwards 279compatibility for Fortran 77 and nearly all of the GNU language 280extensions supported by 'g77'. 281 282 283File: gfortran.info, Node: Project Status, Next: Standards, Prev: GNU Fortran and G77, Up: Introduction 284 2851.5 Project Status 286================== 287 288 As soon as 'gfortran' can parse all of the statements correctly, it 289 will be in the "larva" state. When we generate code, the "puppa" 290 state. When 'gfortran' is done, we'll see if it will be a 291 beautiful butterfly, or just a big bug.... 292 293 -Andy Vaught, April 2000 294 295 The start of the GNU Fortran 95 project was announced on the GCC 296homepage in March 18, 2000 (even though Andy had already been working on 297it for a while, of course). 298 299 The GNU Fortran compiler is able to compile nearly all 300standard-compliant Fortran 95, Fortran 90, and Fortran 77 programs, 301including a number of standard and non-standard extensions, and can be 302used on real-world programs. In particular, the supported extensions 303include OpenMP, Cray-style pointers, some old vendor extensions, and 304several Fortran 2003 and Fortran 2008 features, including TR 15581. 305However, it is still under development and has a few remaining rough 306edges. There also is initial support for OpenACC. 307 308 At present, the GNU Fortran compiler passes the NIST Fortran 77 Test 309Suite (http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html), and 310produces acceptable results on the LAPACK Test Suite 311(http://www.netlib.org/lapack/faq.html#1.21). It also provides 312respectable performance on the Polyhedron Fortran compiler benchmarks 313(http://www.polyhedron.com/fortran-compiler-comparisons/polyhedron-benchmark-suite) 314and the Livermore Fortran Kernels test 315(http://www.netlib.org/benchmark/livermore). It has been used to 316compile a number of large real-world programs, including the HARMONIE 317and HIRLAM weather forecasting code (http://hirlam.org/) and the Tonto 318quantum chemistry package 319(http://physical-chemistry.scb.uwa.edu.au/tonto/wiki/index.php/Main_Page); 320see <https://gcc.gnu.org/wiki/GfortranApps> for an extended list. 321 322 Among other things, the GNU Fortran compiler is intended as a 323replacement for G77. At this point, nearly all programs that could be 324compiled with G77 can be compiled with GNU Fortran, although there are a 325few minor known regressions. 326 327 The primary work remaining to be done on GNU Fortran falls into three 328categories: bug fixing (primarily regarding the treatment of invalid 329code and providing useful error messages), improving the compiler 330optimizations and the performance of compiled code, and extending the 331compiler to support future standards--in particular, Fortran 2003, 332Fortran 2008 and Fortran 2018. 333 334 335File: gfortran.info, Node: Standards, Prev: Project Status, Up: Introduction 336 3371.6 Standards 338============= 339 340* Menu: 341 342* Varying Length Character Strings:: 343 344The GNU Fortran compiler implements ISO/IEC 1539:1997 (Fortran 95). As 345such, it can also compile essentially all standard-compliant Fortran 90 346and Fortran 77 programs. It also supports the ISO/IEC TR-15581 347enhancements to allocatable arrays. 348 349 GNU Fortran also have a partial support for ISO/IEC 1539-1:2004 350(Fortran 2003), ISO/IEC 1539-1:2010 (Fortran 2008), the Technical 351Specification 'Further Interoperability of Fortran with C' (ISO/IEC TS 35229113:2012). Full support of those standards and future Fortran 353standards is planned. The current status of the support is can be found 354in the *note Fortran 2003 status::, *note Fortran 2008 status:: and 355*note Fortran 2018 status:: sections of the documentation. 356 357 Additionally, the GNU Fortran compilers supports the OpenMP 358specification (version 4.0 and most of the features of the 4.5 version, 359<http://openmp.org/wp/openmp-specifications/>). There also is support 360for the OpenACC specification (targeting version 2.6, 361<http://www.openacc.org/>). See <https://gcc.gnu.org/wiki/OpenACC> for 362more information. 363 364 365File: gfortran.info, Node: Varying Length Character Strings, Up: Standards 366 3671.6.1 Varying Length Character Strings 368-------------------------------------- 369 370The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000) 371varying length character strings. While GNU Fortran currently does not 372support such strings directly, there exist two Fortran implementations 373for them, which work with GNU Fortran. They can be found at 374<http://www.fortran.com/iso_varying_string.f95> and at 375<ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/>. 376 377 Deferred-length character strings of Fortran 2003 supports part of 378the features of 'ISO_VARYING_STRING' and should be considered as 379replacement. (Namely, allocatable or pointers of the type 380'character(len=:)'.) 381 382 383File: gfortran.info, Node: Invoking GNU Fortran, Next: Runtime, Prev: Introduction, Up: Top 384 3852 GNU Fortran Command Options 386***************************** 387 388The 'gfortran' command supports all the options supported by the 'gcc' 389command. Only options specific to GNU Fortran are documented here. 390 391 *Note GCC Command Options: (gcc)Invoking GCC, for information on the 392non-Fortran-specific aspects of the 'gcc' command (and, therefore, the 393'gfortran' command). 394 395 All GCC and GNU Fortran options are accepted both by 'gfortran' and 396by 'gcc' (as well as any other drivers built at the same time, such as 397'g++'), since adding GNU Fortran to the GCC distribution enables 398acceptance of GNU Fortran options by all of the relevant drivers. 399 400 In some cases, options have positive and negative forms; the negative 401form of '-ffoo' would be '-fno-foo'. This manual documents only one of 402these two forms, whichever one is not the default. 403 404* Menu: 405 406* Option Summary:: Brief list of all 'gfortran' options, 407 without explanations. 408* Fortran Dialect Options:: Controlling the variant of Fortran language 409 compiled. 410* Preprocessing Options:: Enable and customize preprocessing. 411* Error and Warning Options:: How picky should the compiler be? 412* Debugging Options:: Symbol tables, measurements, and debugging dumps. 413* Directory Options:: Where to find module files 414* Link Options :: Influencing the linking step 415* Runtime Options:: Influencing runtime behavior 416* Code Gen Options:: Specifying conventions for function calls, data layout 417 and register usage. 418* Interoperability Options:: Options for interoperability with other 419 languages. 420* Environment Variables:: Environment variables that affect 'gfortran'. 421 422 423File: gfortran.info, Node: Option Summary, Next: Fortran Dialect Options, Up: Invoking GNU Fortran 424 4252.1 Option summary 426================== 427 428Here is a summary of all the options specific to GNU Fortran, grouped by 429type. Explanations are in the following sections. 430 431_Fortran Language Options_ 432 *Note Options controlling Fortran dialect: Fortran Dialect Options. 433 -fall-intrinsics -fallow-argument-mismatch -fallow-invalid-boz 434 -fbackslash -fcray-pointer -fd-lines-as-code -fd-lines-as-comments 435 -fdec -fdec-char-conversions -fdec-structure -fdec-intrinsic-ints 436 -fdec-static -fdec-math -fdec-include -fdec-format-defaults 437 -fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8 438 -fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok 439 -ffixed-line-length-N -ffixed-line-length-none -fpad-source 440 -ffree-form -ffree-line-length-N -ffree-line-length-none 441 -fimplicit-none -finteger-4-integer-8 -fmax-identifier-length 442 -fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp 443 -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10 444 -freal-8-real-16 -freal-8-real-4 -std=STD -ftest-forall-temp 445 446 447_Preprocessing Options_ 448 *Note Enable and customize preprocessing: Preprocessing Options. 449 -A-QUESTION[=ANSWER] 450 -AQUESTION=ANSWER -C -CC -DMACRO[=DEFN] 451 -H -P 452 -UMACRO -cpp -dD -dI -dM -dN -dU -fworking-directory 453 -imultilib DIR 454 -iprefix FILE -iquote -isysroot DIR -isystem DIR -nocpp 455 -nostdinc 456 -undef 457 458 459_Error and Warning Options_ 460 *Note Options to request or suppress errors and warnings: Error and 461 Warning Options. 462 -Waliasing -Wall -Wampersand -Warray-bounds 463 -Wc-binding-type -Wcharacter-truncation -Wconversion 464 -Wdo-subscript -Wfunction-elimination -Wimplicit-interface 465 -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only 466 -Wintrinsics-std -Wline-truncation -Wno-align-commons 467 -Wno-overwrite-recursive -Wno-tabs -Wreal-q-constant -Wsurprising 468 -Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all 469 -Wfrontend-loop-interchange -Wtarget-lifetime -fmax-errors=N 470 -fsyntax-only -pedantic 471 -pedantic-errors 472 473 474_Debugging Options_ 475 *Note Options for debugging your program or GNU Fortran: Debugging 476 Options. 477 -fbacktrace -fdump-fortran-optimized -fdump-fortran-original 478 -fdump-fortran-global -fdump-parse-tree -ffpe-trap=LIST 479 -ffpe-summary=LIST 480 481 482_Directory Options_ 483 *Note Options for directory search: Directory Options. 484 -IDIR -JDIR -fintrinsic-modules-path DIR 485 486_Link Options_ 487 *Note Options for influencing the linking step: Link Options. 488 -static-libgfortran 489 490_Runtime Options_ 491 *Note Options for influencing runtime behavior: Runtime Options. 492 -fconvert=CONVERSION -fmax-subrecord-length=LENGTH 493 -frecord-marker=LENGTH -fsign-zero 494 495 496_Interoperability Options_ 497 *Note Options for interoperability: Interoperability Options. 498 -fc-prototypes -fc-prototypes-external 499 500_Code Generation Options_ 501 *Note Options for code generation conventions: Code Gen Options. 502 -faggressive-function-elimination -fblas-matmul-limit=N 503 -fbounds-check -ftail-call-workaround -ftail-call-workaround=N 504 -fcheck-array-temporaries 505 -fcheck=<ALL|ARRAY-TEMPS|BITS|BOUNDS|DO|MEM|POINTER|RECURSION> 506 -fcoarray=<NONE|SINGLE|LIB> -fexternal-blas -ff2c 507 -ffrontend-loop-interchange -ffrontend-optimize 508 -finit-character=N -finit-integer=N -finit-local-zero 509 -finit-derived -finit-logical=<TRUE|FALSE> 510 -finit-real=<ZERO|INF|-INF|NAN|SNAN> 511 -finline-matmul-limit=N 512 -finline-arg-packing -fmax-array-constructor=N 513 -fmax-stack-var-size=N -fno-align-commons -fno-automatic 514 -fno-protect-parens -fno-underscoring -fsecond-underscore 515 -fpack-derived -frealloc-lhs -frecursive -frepack-arrays 516 -fshort-enums -fstack-arrays 517 518 519 520File: gfortran.info, Node: Fortran Dialect Options, Next: Preprocessing Options, Prev: Option Summary, Up: Invoking GNU Fortran 521 5222.2 Options controlling Fortran dialect 523======================================= 524 525The following options control the details of the Fortran dialect 526accepted by the compiler: 527 528'-ffree-form' 529'-ffixed-form' 530 Specify the layout used by the source file. The free form layout 531 was introduced in Fortran 90. Fixed form was traditionally used in 532 older Fortran programs. When neither option is specified, the 533 source form is determined by the file extension. 534 535'-fall-intrinsics' 536 This option causes all intrinsic procedures (including the 537 GNU-specific extensions) to be accepted. This can be useful with 538 '-std=f95' to force standard-compliance but get access to the full 539 range of intrinsics available with 'gfortran'. As a consequence, 540 '-Wintrinsics-std' will be ignored and no user-defined procedure 541 with the same name as any intrinsic will be called except when it 542 is explicitly declared 'EXTERNAL'. 543 544'-fallow-argument-mismatch' 545 Some code contains calls to external procedures whith mismatches 546 between the calls and the procedure definition, or with mismatches 547 between different calls. Such code is non-conforming, and will 548 usually be flagged wi1th an error. This options degrades the error 549 to a warning, which can only be disabled by disabling all warnings 550 vial '-w'. Only a single occurrence per argument is flagged by 551 this warning. '-fallow-argument-mismatch' is implied by 552 '-std=legacy'. 553 554 Using this option is _strongly_ discouraged. It is possible to 555 provide standard-conforming code which allows different types of 556 arguments by using an explicit interface and 'TYPE(*)'. 557 558'-fallow-invalid-boz' 559 A BOZ literal constant can occur in a limited number of contexts in 560 standard conforming Fortran. This option degrades an error 561 condition to a warning, and allows a BOZ literal constant to appear 562 where the Fortran standard would otherwise prohibit its use. 563 564'-fd-lines-as-code' 565'-fd-lines-as-comments' 566 Enable special treatment for lines beginning with 'd' or 'D' in 567 fixed form sources. If the '-fd-lines-as-code' option is given 568 they are treated as if the first column contained a blank. If the 569 '-fd-lines-as-comments' option is given, they are treated as 570 comment lines. 571 572'-fdec' 573 DEC compatibility mode. Enables extensions and other features that 574 mimic the default behavior of older compilers (such as DEC). These 575 features are non-standard and should be avoided at all costs. For 576 details on GNU Fortran's implementation of these extensions see the 577 full documentation. 578 579 Other flags enabled by this switch are: '-fdollar-ok' 580 '-fcray-pointer' '-fdec-char-conversions' '-fdec-structure' 581 '-fdec-intrinsic-ints' '-fdec-static' '-fdec-math' '-fdec-include' 582 '-fdec-blank-format-item' '-fdec-format-defaults' 583 584 If '-fd-lines-as-code'/'-fd-lines-as-comments' are unset, then 585 '-fdec' also sets '-fd-lines-as-comments'. 586 587'-fdec-char-conversions' 588 Enable the use of character literals in assignments and 'DATA' 589 statements for non-character variables. 590 591'-fdec-structure' 592 Enable DEC 'STRUCTURE' and 'RECORD' as well as 'UNION', 'MAP', and 593 dot ('.') as a member separator (in addition to '%'). This is 594 provided for compatibility only; Fortran 90 derived types should be 595 used instead where possible. 596 597'-fdec-intrinsic-ints' 598 Enable B/I/J/K kind variants of existing integer functions (e.g. 599 BIAND, IIAND, JIAND, etc...). For a complete list of intrinsics 600 see the full documentation. 601 602'-fdec-math' 603 Enable legacy math intrinsics such as COTAN and degree-valued 604 trigonometric functions (e.g. TAND, ATAND, etc...) for 605 compatability with older code. 606 607'-fdec-static' 608 Enable DEC-style STATIC and AUTOMATIC attributes to explicitly 609 specify the storage of variables and other objects. 610 611'-fdec-include' 612 Enable parsing of INCLUDE as a statement in addition to parsing it 613 as INCLUDE line. When parsed as INCLUDE statement, INCLUDE does 614 not have to be on a single line and can use line continuations. 615 616'-fdec-format-defaults' 617 Enable format specifiers F, G and I to be used without width 618 specifiers, default widths will be used instead. 619 620'-fdec-blank-format-item' 621 Enable a blank format item at the end of a format specification 622 i.e. nothing following the final comma. 623 624'-fdollar-ok' 625 Allow '$' as a valid non-first character in a symbol name. Symbols 626 that start with '$' are rejected since it is unclear which rules to 627 apply to implicit typing as different vendors implement different 628 rules. Using '$' in 'IMPLICIT' statements is also rejected. 629 630'-fbackslash' 631 Change the interpretation of backslashes in string literals from a 632 single backslash character to "C-style" escape characters. The 633 following combinations are expanded '\a', '\b', '\f', '\n', '\r', 634 '\t', '\v', '\\', and '\0' to the ASCII characters alert, 635 backspace, form feed, newline, carriage return, horizontal tab, 636 vertical tab, backslash, and NUL, respectively. Additionally, 637 '\x'NN, '\u'NNNN and '\U'NNNNNNNN (where each N is a hexadecimal 638 digit) are translated into the Unicode characters corresponding to 639 the specified code points. All other combinations of a character 640 preceded by \ are unexpanded. 641 642'-fmodule-private' 643 Set the default accessibility of module entities to 'PRIVATE'. 644 Use-associated entities will not be accessible unless they are 645 explicitly declared as 'PUBLIC'. 646 647'-ffixed-line-length-N' 648 Set column after which characters are ignored in typical fixed-form 649 lines in the source file, and, unless '-fno-pad-source', through 650 which spaces are assumed (as if padded to that length) after the 651 ends of short fixed-form lines. 652 653 Popular values for N include 72 (the standard and the default), 80 654 (card image), and 132 (corresponding to "extended-source" options 655 in some popular compilers). N may also be 'none', meaning that the 656 entire line is meaningful and that continued character constants 657 never have implicit spaces appended to them to fill out the line. 658 '-ffixed-line-length-0' means the same thing as 659 '-ffixed-line-length-none'. 660 661'-fno-pad-source' 662 By default fixed-form lines have spaces assumed (as if padded to 663 that length) after the ends of short fixed-form lines. This is not 664 done either if '-ffixed-line-length-0', '-ffixed-line-length-none' 665 or if '-fno-pad-source' option is used. With any of those options 666 continued character constants never have implicit spaces appended 667 to them to fill out the line. 668 669'-ffree-line-length-N' 670 Set column after which characters are ignored in typical free-form 671 lines in the source file. The default value is 132. N may be 672 'none', meaning that the entire line is meaningful. 673 '-ffree-line-length-0' means the same thing as 674 '-ffree-line-length-none'. 675 676'-fmax-identifier-length=N' 677 Specify the maximum allowed identifier length. Typical values are 678 31 (Fortran 95) and 63 (Fortran 2003 and Fortran 2008). 679 680'-fimplicit-none' 681 Specify that no implicit typing is allowed, unless overridden by 682 explicit 'IMPLICIT' statements. This is the equivalent of adding 683 'implicit none' to the start of every procedure. 684 685'-fcray-pointer' 686 Enable the Cray pointer extension, which provides C-like pointer 687 functionality. 688 689'-fopenacc' 690 Enable the OpenACC extensions. This includes OpenACC '!$acc' 691 directives in free form and 'c$acc', '*$acc' and '!$acc' directives 692 in fixed form, '!$' conditional compilation sentinels in free form 693 and 'c$', '*$' and '!$' sentinels in fixed form, and when linking 694 arranges for the OpenACC runtime library to be linked in. 695 696'-fopenmp' 697 Enable the OpenMP extensions. This includes OpenMP '!$omp' 698 directives in free form and 'c$omp', '*$omp' and '!$omp' directives 699 in fixed form, '!$' conditional compilation sentinels in free form 700 and 'c$', '*$' and '!$' sentinels in fixed form, and when linking 701 arranges for the OpenMP runtime library to be linked in. The 702 option '-fopenmp' implies '-frecursive'. 703 704'-fno-range-check' 705 Disable range checking on results of simplification of constant 706 expressions during compilation. For example, GNU Fortran will give 707 an error at compile time when simplifying 'a = 1. / 0'. With this 708 option, no error will be given and 'a' will be assigned the value 709 '+Infinity'. If an expression evaluates to a value outside of the 710 relevant range of ['-HUGE()':'HUGE()'], then the expression will be 711 replaced by '-Inf' or '+Inf' as appropriate. Similarly, 'DATA 712 i/Z'FFFFFFFF'/' will result in an integer overflow on most systems, 713 but with '-fno-range-check' the value will "wrap around" and 'i' 714 will be initialized to -1 instead. 715 716'-fdefault-integer-8' 717 Set the default integer and logical types to an 8 byte wide type. 718 This option also affects the kind of integer constants like '42'. 719 Unlike '-finteger-4-integer-8', it does not promote variables with 720 explicit kind declaration. 721 722'-fdefault-real-8' 723 Set the default real type to an 8 byte wide type. This option also 724 affects the kind of non-double real constants like '1.0'. This 725 option promotes the default width of 'DOUBLE PRECISION' and double 726 real constants like '1.d0' to 16 bytes if possible. If 727 '-fdefault-double-8' is given along with 'fdefault-real-8', 'DOUBLE 728 PRECISION' and double real constants are not promoted. Unlike 729 '-freal-4-real-8', 'fdefault-real-8' does not promote variables 730 with explicit kind declarations. 731 732'-fdefault-real-10' 733 Set the default real type to an 10 byte wide type. This option 734 also affects the kind of non-double real constants like '1.0'. 735 This option promotes the default width of 'DOUBLE PRECISION' and 736 double real constants like '1.d0' to 16 bytes if possible. If 737 '-fdefault-double-8' is given along with 'fdefault-real-10', 738 'DOUBLE PRECISION' and double real constants are not promoted. 739 Unlike '-freal-4-real-10', 'fdefault-real-10' does not promote 740 variables with explicit kind declarations. 741 742'-fdefault-real-16' 743 Set the default real type to an 16 byte wide type. This option 744 also affects the kind of non-double real constants like '1.0'. 745 This option promotes the default width of 'DOUBLE PRECISION' and 746 double real constants like '1.d0' to 16 bytes if possible. If 747 '-fdefault-double-8' is given along with 'fdefault-real-16', 748 'DOUBLE PRECISION' and double real constants are not promoted. 749 Unlike '-freal-4-real-16', 'fdefault-real-16' does not promote 750 variables with explicit kind declarations. 751 752'-fdefault-double-8' 753 Set the 'DOUBLE PRECISION' type and double real constants like 754 '1.d0' to an 8 byte wide type. Do nothing if this is already the 755 default. This option prevents '-fdefault-real-8', 756 '-fdefault-real-10', and '-fdefault-real-16', from promoting 757 'DOUBLE PRECISION' and double real constants like '1.d0' to 16 758 bytes. 759 760'-finteger-4-integer-8' 761 Promote all 'INTEGER(KIND=4)' entities to an 'INTEGER(KIND=8)' 762 entities. If 'KIND=8' is unavailable, then an error will be 763 issued. This option should be used with care and may not be 764 suitable for your codes. Areas of possible concern include calls 765 to external procedures, alignment in 'EQUIVALENCE' and/or 'COMMON', 766 generic interfaces, BOZ literal constant conversion, and I/O. 767 Inspection of the intermediate representation of the translated 768 Fortran code, produced by '-fdump-tree-original', is suggested. 769 770'-freal-4-real-8' 771'-freal-4-real-10' 772'-freal-4-real-16' 773'-freal-8-real-4' 774'-freal-8-real-10' 775'-freal-8-real-16' 776 Promote all 'REAL(KIND=M)' entities to 'REAL(KIND=N)' entities. If 777 'REAL(KIND=N)' is unavailable, then an error will be issued. All 778 other real kind types are unaffected by this option. These options 779 should be used with care and may not be suitable for your codes. 780 Areas of possible concern include calls to external procedures, 781 alignment in 'EQUIVALENCE' and/or 'COMMON', generic interfaces, BOZ 782 literal constant conversion, and I/O. Inspection of the 783 intermediate representation of the translated Fortran code, 784 produced by '-fdump-tree-original', is suggested. 785 786'-std=STD' 787 Specify the standard to which the program is expected to conform, 788 which may be one of 'f95', 'f2003', 'f2008', 'f2018', 'gnu', or 789 'legacy'. The default value for STD is 'gnu', which specifies a 790 superset of the latest Fortran standard that includes all of the 791 extensions supported by GNU Fortran, although warnings will be 792 given for obsolete extensions not recommended for use in new code. 793 The 'legacy' value is equivalent but without the warnings for 794 obsolete extensions, and may be useful for old non-standard 795 programs. The 'f95', 'f2003', 'f2008', and 'f2018' values specify 796 strict conformance to the Fortran 95, Fortran 2003, Fortran 2008 797 and Fortran 2018 standards, respectively; errors are given for all 798 extensions beyond the relevant language standard, and warnings are 799 given for the Fortran 77 features that are permitted but 800 obsolescent in later standards. The deprecated option 801 '-std=f2008ts' acts as an alias for '-std=f2018'. It is only 802 present for backwards compatibility with earlier gfortran versions 803 and should not be used any more. 804 805'-ftest-forall-temp' 806 Enhance test coverage by forcing most forall assignments to use 807 temporary. 808 809 810File: gfortran.info, Node: Preprocessing Options, Next: Error and Warning Options, Prev: Fortran Dialect Options, Up: Invoking GNU Fortran 811 8122.3 Enable and customize preprocessing 813====================================== 814 815Preprocessor related options. See section *note Preprocessing and 816conditional compilation:: for more detailed information on preprocessing 817in 'gfortran'. 818 819'-cpp' 820'-nocpp' 821 Enable preprocessing. The preprocessor is automatically invoked if 822 the file extension is '.fpp', '.FPP', '.F', '.FOR', '.FTN', '.F90', 823 '.F95', '.F03' or '.F08'. Use this option to manually enable 824 preprocessing of any kind of Fortran file. 825 826 To disable preprocessing of files with any of the above listed 827 extensions, use the negative form: '-nocpp'. 828 829 The preprocessor is run in traditional mode. Any restrictions of 830 the file-format, especially the limits on line length, apply for 831 preprocessed output as well, so it might be advisable to use the 832 '-ffree-line-length-none' or '-ffixed-line-length-none' options. 833 834'-dM' 835 Instead of the normal output, generate a list of ''#define'' 836 directives for all the macros defined during the execution of the 837 preprocessor, including predefined macros. This gives you a way of 838 finding out what is predefined in your version of the preprocessor. 839 Assuming you have no file 'foo.f90', the command 840 touch foo.f90; gfortran -cpp -E -dM foo.f90 841 will show all the predefined macros. 842 843'-dD' 844 Like '-dM' except in two respects: it does not include the 845 predefined macros, and it outputs both the '#define' directives and 846 the result of preprocessing. Both kinds of output go to the 847 standard output file. 848 849'-dN' 850 Like '-dD', but emit only the macro names, not their expansions. 851 852'-dU' 853 Like 'dD' except that only macros that are expanded, or whose 854 definedness is tested in preprocessor directives, are output; the 855 output is delayed until the use or test of the macro; and 856 ''#undef'' directives are also output for macros tested but 857 undefined at the time. 858 859'-dI' 860 Output ''#include'' directives in addition to the result of 861 preprocessing. 862 863'-fworking-directory' 864 Enable generation of linemarkers in the preprocessor output that 865 will let the compiler know the current working directory at the 866 time of preprocessing. When this option is enabled, the 867 preprocessor will emit, after the initial linemarker, a second 868 linemarker with the current working directory followed by two 869 slashes. GCC will use this directory, when it is present in the 870 preprocessed input, as the directory emitted as the current working 871 directory in some debugging information formats. This option is 872 implicitly enabled if debugging information is enabled, but this 873 can be inhibited with the negated form '-fno-working-directory'. 874 If the '-P' flag is present in the command line, this option has no 875 effect, since no '#line' directives are emitted whatsoever. 876 877'-idirafter DIR' 878 Search DIR for include files, but do it after all directories 879 specified with '-I' and the standard system directories have been 880 exhausted. DIR is treated as a system include directory. If dir 881 begins with '=', then the '=' will be replaced by the sysroot 882 prefix; see '--sysroot' and '-isysroot'. 883 884'-imultilib DIR' 885 Use DIR as a subdirectory of the directory containing 886 target-specific C++ headers. 887 888'-iprefix PREFIX' 889 Specify PREFIX as the prefix for subsequent '-iwithprefix' options. 890 If the PREFIX represents a directory, you should include the final 891 ''/''. 892 893'-isysroot DIR' 894 This option is like the '--sysroot' option, but applies only to 895 header files. See the '--sysroot' option for more information. 896 897'-iquote DIR' 898 Search DIR only for header files requested with '#include "file"'; 899 they are not searched for '#include <file>', before all directories 900 specified by '-I' and before the standard system directories. If 901 DIR begins with '=', then the '=' will be replaced by the sysroot 902 prefix; see '--sysroot' and '-isysroot'. 903 904'-isystem DIR' 905 Search DIR for header files, after all directories specified by 906 '-I' but before the standard system directories. Mark it as a 907 system directory, so that it gets the same special treatment as is 908 applied to the standard system directories. If DIR begins with 909 '=', then the '=' will be replaced by the sysroot prefix; see 910 '--sysroot' and '-isysroot'. 911 912'-nostdinc' 913 Do not search the standard system directories for header files. 914 Only the directories you have specified with '-I' options (and the 915 directory of the current file, if appropriate) are searched. 916 917'-undef' 918 Do not predefine any system-specific or GCC-specific macros. The 919 standard predefined macros remain defined. 920 921'-APREDICATE=ANSWER' 922 Make an assertion with the predicate PREDICATE and answer ANSWER. 923 This form is preferred to the older form -A predicate(answer), 924 which is still supported, because it does not use shell special 925 characters. 926 927'-A-PREDICATE=ANSWER' 928 Cancel an assertion with the predicate PREDICATE and answer ANSWER. 929 930'-C' 931 Do not discard comments. All comments are passed through to the 932 output file, except for comments in processed directives, which are 933 deleted along with the directive. 934 935 You should be prepared for side effects when using '-C'; it causes 936 the preprocessor to treat comments as tokens in their own right. 937 For example, comments appearing at the start of what would be a 938 directive line have the effect of turning that line into an 939 ordinary source line, since the first token on the line is no 940 longer a ''#''. 941 942 Warning: this currently handles C-Style comments only. The 943 preprocessor does not yet recognize Fortran-style comments. 944 945'-CC' 946 Do not discard comments, including during macro expansion. This is 947 like '-C', except that comments contained within macros are also 948 passed through to the output file where the macro is expanded. 949 950 In addition to the side-effects of the '-C' option, the '-CC' 951 option causes all C++-style comments inside a macro to be converted 952 to C-style comments. This is to prevent later use of that macro 953 from inadvertently commenting out the remainder of the source line. 954 The '-CC' option is generally used to support lint comments. 955 956 Warning: this currently handles C- and C++-Style comments only. 957 The preprocessor does not yet recognize Fortran-style comments. 958 959'-DNAME' 960 Predefine name as a macro, with definition '1'. 961 962'-DNAME=DEFINITION' 963 The contents of DEFINITION are tokenized and processed as if they 964 appeared during translation phase three in a ''#define'' directive. 965 In particular, the definition will be truncated by embedded newline 966 characters. 967 968 If you are invoking the preprocessor from a shell or shell-like 969 program you may need to use the shell's quoting syntax to protect 970 characters such as spaces that have a meaning in the shell syntax. 971 972 If you wish to define a function-like macro on the command line, 973 write its argument list with surrounding parentheses before the 974 equals sign (if any). Parentheses are meaningful to most shells, 975 so you will need to quote the option. With sh and csh, 976 '-D'name(args...)=definition'' works. 977 978 '-D' and '-U' options are processed in the order they are given on 979 the command line. All -imacros file and -include file options are 980 processed after all -D and -U options. 981 982'-H' 983 Print the name of each header file used, in addition to other 984 normal activities. Each name is indented to show how deep in the 985 ''#include'' stack it is. 986 987'-P' 988 Inhibit generation of linemarkers in the output from the 989 preprocessor. This might be useful when running the preprocessor 990 on something that is not C code, and will be sent to a program 991 which might be confused by the linemarkers. 992 993'-UNAME' 994 Cancel any previous definition of NAME, either built in or provided 995 with a '-D' option. 996 997 998File: gfortran.info, Node: Error and Warning Options, Next: Debugging Options, Prev: Preprocessing Options, Up: Invoking GNU Fortran 999 10002.4 Options to request or suppress errors and warnings 1001====================================================== 1002 1003Errors are diagnostic messages that report that the GNU Fortran compiler 1004cannot compile the relevant piece of source code. The compiler will 1005continue to process the program in an attempt to report further errors 1006to aid in debugging, but will not produce any compiled output. 1007 1008 Warnings are diagnostic messages that report constructions which are 1009not inherently erroneous but which are risky or suggest there is likely 1010to be a bug in the program. Unless '-Werror' is specified, they do not 1011prevent compilation of the program. 1012 1013 You can request many specific warnings with options beginning '-W', 1014for example '-Wimplicit' to request warnings on implicit declarations. 1015Each of these specific warning options also has a negative form 1016beginning '-Wno-' to turn off warnings; for example, '-Wno-implicit'. 1017This manual lists only one of the two forms, whichever is not the 1018default. 1019 1020 These options control the amount and kinds of errors and warnings 1021produced by GNU Fortran: 1022 1023'-fmax-errors=N' 1024 Limits the maximum number of error messages to N, at which point 1025 GNU Fortran bails out rather than attempting to continue processing 1026 the source code. If N is 0, there is no limit on the number of 1027 error messages produced. 1028 1029'-fsyntax-only' 1030 Check the code for syntax errors, but do not actually compile it. 1031 This will generate module files for each module present in the 1032 code, but no other output file. 1033 1034'-Wpedantic' 1035'-pedantic' 1036 Issue warnings for uses of extensions to Fortran. '-pedantic' also 1037 applies to C-language constructs where they occur in GNU Fortran 1038 source files, such as use of '\e' in a character constant within a 1039 directive like '#include'. 1040 1041 Valid Fortran programs should compile properly with or without this 1042 option. However, without this option, certain GNU extensions and 1043 traditional Fortran features are supported as well. With this 1044 option, many of them are rejected. 1045 1046 Some users try to use '-pedantic' to check programs for 1047 conformance. They soon find that it does not do quite what they 1048 want--it finds some nonstandard practices, but not all. However, 1049 improvements to GNU Fortran in this area are welcome. 1050 1051 This should be used in conjunction with '-std=f95', '-std=f2003', 1052 '-std=f2008' or '-std=f2018'. 1053 1054'-pedantic-errors' 1055 Like '-pedantic', except that errors are produced rather than 1056 warnings. 1057 1058'-Wall' 1059 Enables commonly used warning options pertaining to usage that we 1060 recommend avoiding and that we believe are easy to avoid. This 1061 currently includes '-Waliasing', '-Wampersand', '-Wconversion', 1062 '-Wsurprising', '-Wc-binding-type', '-Wintrinsics-std', '-Wtabs', 1063 '-Wintrinsic-shadow', '-Wline-truncation', '-Wtarget-lifetime', 1064 '-Winteger-division', '-Wreal-q-constant', '-Wunused' and 1065 '-Wundefined-do-loop'. 1066 1067'-Waliasing' 1068 Warn about possible aliasing of dummy arguments. Specifically, it 1069 warns if the same actual argument is associated with a dummy 1070 argument with 'INTENT(IN)' and a dummy argument with 'INTENT(OUT)' 1071 in a call with an explicit interface. 1072 1073 The following example will trigger the warning. 1074 interface 1075 subroutine bar(a,b) 1076 integer, intent(in) :: a 1077 integer, intent(out) :: b 1078 end subroutine 1079 end interface 1080 integer :: a 1081 1082 call bar(a,a) 1083 1084'-Wampersand' 1085 Warn about missing ampersand in continued character constants. The 1086 warning is given with '-Wampersand', '-pedantic', '-std=f95', 1087 '-std=f2003', '-std=f2008' and '-std=f2018'. Note: With no 1088 ampersand given in a continued character constant, GNU Fortran 1089 assumes continuation at the first non-comment, non-whitespace 1090 character after the ampersand that initiated the continuation. 1091 1092'-Warray-temporaries' 1093 Warn about array temporaries generated by the compiler. The 1094 information generated by this warning is sometimes useful in 1095 optimization, in order to avoid such temporaries. 1096 1097'-Wc-binding-type' 1098 Warn if the a variable might not be C interoperable. In 1099 particular, warn if the variable has been declared using an 1100 intrinsic type with default kind instead of using a kind parameter 1101 defined for C interoperability in the intrinsic 'ISO_C_Binding' 1102 module. This option is implied by '-Wall'. 1103 1104'-Wcharacter-truncation' 1105 Warn when a character assignment will truncate the assigned string. 1106 1107'-Wline-truncation' 1108 Warn when a source code line will be truncated. This option is 1109 implied by '-Wall'. For free-form source code, the default is 1110 '-Werror=line-truncation' such that truncations are reported as 1111 error. 1112 1113'-Wconversion' 1114 Warn about implicit conversions that are likely to change the value 1115 of the expression after conversion. Implied by '-Wall'. 1116 1117'-Wconversion-extra' 1118 Warn about implicit conversions between different types and kinds. 1119 This option does _not_ imply '-Wconversion'. 1120 1121'-Wextra' 1122 Enables some warning options for usages of language features which 1123 may be problematic. This currently includes '-Wcompare-reals', 1124 '-Wunused-parameter' and '-Wdo-subscript'. 1125 1126'-Wfrontend-loop-interchange' 1127 Warn when using '-ffrontend-loop-interchange' for performing loop 1128 interchanges. 1129 1130'-Wimplicit-interface' 1131 Warn if a procedure is called without an explicit interface. Note 1132 this only checks that an explicit interface is present. It does 1133 not check that the declared interfaces are consistent across 1134 program units. 1135 1136'-Wimplicit-procedure' 1137 Warn if a procedure is called that has neither an explicit 1138 interface nor has been declared as 'EXTERNAL'. 1139 1140'-Winteger-division' 1141 Warn if a constant integer division truncates its result. As an 1142 example, 3/5 evaluates to 0. 1143 1144'-Wintrinsics-std' 1145 Warn if 'gfortran' finds a procedure named like an intrinsic not 1146 available in the currently selected standard (with '-std') and 1147 treats it as 'EXTERNAL' procedure because of this. 1148 '-fall-intrinsics' can be used to never trigger this behavior and 1149 always link to the intrinsic regardless of the selected standard. 1150 1151'-Wno-overwrite-recursive' 1152 Do not warn when '-fno-automatic' is used with '-frecursive'. 1153 Recursion will be broken if the relevant local variables do not 1154 have the attribute 'AUTOMATIC' explicitly declared. This option 1155 can be used to suppress the warning when it is known that recursion 1156 is not broken. Useful for build environments that use '-Werror'. 1157 1158'-Wreal-q-constant' 1159 Produce a warning if a real-literal-constant contains a 'q' 1160 exponent-letter. 1161 1162'-Wsurprising' 1163 Produce a warning when "suspicious" code constructs are 1164 encountered. While technically legal these usually indicate that 1165 an error has been made. 1166 1167 This currently produces a warning under the following 1168 circumstances: 1169 1170 * An INTEGER SELECT construct has a CASE that can never be 1171 matched as its lower value is greater than its upper value. 1172 1173 * A LOGICAL SELECT construct has three CASE statements. 1174 1175 * A TRANSFER specifies a source that is shorter than the 1176 destination. 1177 1178 * The type of a function result is declared more than once with 1179 the same type. If '-pedantic' or standard-conforming mode is 1180 enabled, this is an error. 1181 1182 * A 'CHARACTER' variable is declared with negative length. 1183 1184'-Wtabs' 1185 By default, tabs are accepted as whitespace, but tabs are not 1186 members of the Fortran Character Set. For continuation lines, a 1187 tab followed by a digit between 1 and 9 is supported. '-Wtabs' 1188 will cause a warning to be issued if a tab is encountered. Note, 1189 '-Wtabs' is active for '-pedantic', '-std=f95', '-std=f2003', 1190 '-std=f2008', '-std=f2018' and '-Wall'. 1191 1192'-Wundefined-do-loop' 1193 Warn if a DO loop with step either 1 or -1 yields an underflow or 1194 an overflow during iteration of an induction variable of the loop. 1195 This option is implied by '-Wall'. 1196 1197'-Wunderflow' 1198 Produce a warning when numerical constant expressions are 1199 encountered, which yield an UNDERFLOW during compilation. Enabled 1200 by default. 1201 1202'-Wintrinsic-shadow' 1203 Warn if a user-defined procedure or module procedure has the same 1204 name as an intrinsic; in this case, an explicit interface or 1205 'EXTERNAL' or 'INTRINSIC' declaration might be needed to get calls 1206 later resolved to the desired intrinsic/procedure. This option is 1207 implied by '-Wall'. 1208 1209'-Wuse-without-only' 1210 Warn if a 'USE' statement has no 'ONLY' qualifier and thus 1211 implicitly imports all public entities of the used module. 1212 1213'-Wunused-dummy-argument' 1214 Warn about unused dummy arguments. This option is implied by 1215 '-Wall'. 1216 1217'-Wunused-parameter' 1218 Contrary to 'gcc''s meaning of '-Wunused-parameter', 'gfortran''s 1219 implementation of this option does not warn about unused dummy 1220 arguments (see '-Wunused-dummy-argument'), but about unused 1221 'PARAMETER' values. '-Wunused-parameter' is implied by '-Wextra' 1222 if also '-Wunused' or '-Wall' is used. 1223 1224'-Walign-commons' 1225 By default, 'gfortran' warns about any occasion of variables being 1226 padded for proper alignment inside a 'COMMON' block. This warning 1227 can be turned off via '-Wno-align-commons'. See also 1228 '-falign-commons'. 1229 1230'-Wfunction-elimination' 1231 Warn if any calls to impure functions are eliminated by the 1232 optimizations enabled by the '-ffrontend-optimize' option. This 1233 option is implied by '-Wextra'. 1234 1235'-Wrealloc-lhs' 1236 Warn when the compiler might insert code to for allocation or 1237 reallocation of an allocatable array variable of intrinsic type in 1238 intrinsic assignments. In hot loops, the Fortran 2003 reallocation 1239 feature may reduce the performance. If the array is already 1240 allocated with the correct shape, consider using a whole-array 1241 array-spec (e.g. '(:,:,:)') for the variable on the left-hand side 1242 to prevent the reallocation check. Note that in some cases the 1243 warning is shown, even if the compiler will optimize reallocation 1244 checks away. For instance, when the right-hand side contains the 1245 same variable multiplied by a scalar. See also '-frealloc-lhs'. 1246 1247'-Wrealloc-lhs-all' 1248 Warn when the compiler inserts code to for allocation or 1249 reallocation of an allocatable variable; this includes scalars and 1250 derived types. 1251 1252'-Wcompare-reals' 1253 Warn when comparing real or complex types for equality or 1254 inequality. This option is implied by '-Wextra'. 1255 1256'-Wtarget-lifetime' 1257 Warn if the pointer in a pointer assignment might be longer than 1258 the its target. This option is implied by '-Wall'. 1259 1260'-Wzerotrip' 1261 Warn if a 'DO' loop is known to execute zero times at compile time. 1262 This option is implied by '-Wall'. 1263 1264'-Wdo-subscript' 1265 Warn if an array subscript inside a DO loop could lead to an 1266 out-of-bounds access even if the compiler cannot prove that the 1267 statement is actually executed, in cases like 1268 real a(3) 1269 do i=1,4 1270 if (condition(i)) then 1271 a(i) = 1.2 1272 end if 1273 end do 1274 This option is implied by '-Wextra'. 1275 1276'-Werror' 1277 Turns all warnings into errors. 1278 1279 *Note Options to Request or Suppress Errors and Warnings: 1280(gcc)Warning Options, for information on more options offered by the GBE 1281shared by 'gfortran', 'gcc' and other GNU compilers. 1282 1283 Some of these have no effect when compiling programs written in 1284Fortran. 1285 1286 1287File: gfortran.info, Node: Debugging Options, Next: Directory Options, Prev: Error and Warning Options, Up: Invoking GNU Fortran 1288 12892.5 Options for debugging your program or GNU Fortran 1290===================================================== 1291 1292GNU Fortran has various special options that are used for debugging 1293either your program or the GNU Fortran compiler. 1294 1295'-fdump-fortran-original' 1296 Output the internal parse tree after translating the source program 1297 into internal representation. This option is mostly useful for 1298 debugging the GNU Fortran compiler itself. The output generated by 1299 this option might change between releases. This option may also 1300 generate internal compiler errors for features which have only 1301 recently been added. 1302 1303'-fdump-fortran-optimized' 1304 Output the parse tree after front-end optimization. Mostly useful 1305 for debugging the GNU Fortran compiler itself. The output 1306 generated by this option might change between releases. This 1307 option may also generate internal compiler errors for features 1308 which have only recently been added. 1309 1310'-fdump-parse-tree' 1311 Output the internal parse tree after translating the source program 1312 into internal representation. Mostly useful for debugging the GNU 1313 Fortran compiler itself. The output generated by this option might 1314 change between releases. This option may also generate internal 1315 compiler errors for features which have only recently been added. 1316 This option is deprecated; use '-fdump-fortran-original' instead. 1317 1318'-fdump-fortran-global' 1319 Output a list of the global identifiers after translating into 1320 middle-end representation. Mostly useful for debugging the GNU 1321 Fortran compiler itself. The output generated by this option might 1322 change between releases. This option may also generate internal 1323 compiler errors for features which have only recently been added. 1324 1325'-ffpe-trap=LIST' 1326 Specify a list of floating point exception traps to enable. On 1327 most systems, if a floating point exception occurs and the trap for 1328 that exception is enabled, a SIGFPE signal will be sent and the 1329 program being aborted, producing a core file useful for debugging. 1330 LIST is a (possibly empty) comma-separated list of the following 1331 exceptions: 'invalid' (invalid floating point operation, such as 1332 'SQRT(-1.0)'), 'zero' (division by zero), 'overflow' (overflow in a 1333 floating point operation), 'underflow' (underflow in a floating 1334 point operation), 'inexact' (loss of precision during operation), 1335 and 'denormal' (operation performed on a denormal value). The 1336 first five exceptions correspond to the five IEEE 754 exceptions, 1337 whereas the last one ('denormal') is not part of the IEEE 754 1338 standard but is available on some common architectures such as x86. 1339 1340 The first three exceptions ('invalid', 'zero', and 'overflow') 1341 often indicate serious errors, and unless the program has 1342 provisions for dealing with these exceptions, enabling traps for 1343 these three exceptions is probably a good idea. 1344 1345 If the option is used more than once in the command line, the lists 1346 will be joined: ''ffpe-trap='LIST1 'ffpe-trap='LIST2' is equivalent 1347 to 'ffpe-trap='LIST1,LIST2. 1348 1349 Note that once enabled an exception cannot be disabled (no negative 1350 form). 1351 1352 Many, if not most, floating point operations incur loss of 1353 precision due to rounding, and hence the 'ffpe-trap=inexact' is 1354 likely to be uninteresting in practice. 1355 1356 By default no exception traps are enabled. 1357 1358'-ffpe-summary=LIST' 1359 Specify a list of floating-point exceptions, whose flag status is 1360 printed to 'ERROR_UNIT' when invoking 'STOP' and 'ERROR STOP'. 1361 LIST can be either 'none', 'all' or a comma-separated list of the 1362 following exceptions: 'invalid', 'zero', 'overflow', 'underflow', 1363 'inexact' and 'denormal'. (See '-ffpe-trap' for a description of 1364 the exceptions.) 1365 1366 If the option is used more than once in the command line, only the 1367 last one will be used. 1368 1369 By default, a summary for all exceptions but 'inexact' is shown. 1370 1371'-fno-backtrace' 1372 When a serious runtime error is encountered or a deadly signal is 1373 emitted (segmentation fault, illegal instruction, bus error, 1374 floating-point exception, and the other POSIX signals that have the 1375 action 'core'), the Fortran runtime library tries to output a 1376 backtrace of the error. '-fno-backtrace' disables the backtrace 1377 generation. This option only has influence for compilation of the 1378 Fortran main program. 1379 1380 *Note Options for Debugging Your Program or GCC: (gcc)Debugging 1381Options, for more information on debugging options. 1382 1383 1384File: gfortran.info, Node: Directory Options, Next: Link Options, Prev: Debugging Options, Up: Invoking GNU Fortran 1385 13862.6 Options for directory search 1387================================ 1388 1389These options affect how GNU Fortran searches for files specified by the 1390'INCLUDE' directive and where it searches for previously compiled 1391modules. 1392 1393 It also affects the search paths used by 'cpp' when used to 1394preprocess Fortran source. 1395 1396'-IDIR' 1397 These affect interpretation of the 'INCLUDE' directive (as well as 1398 of the '#include' directive of the 'cpp' preprocessor). 1399 1400 Also note that the general behavior of '-I' and 'INCLUDE' is pretty 1401 much the same as of '-I' with '#include' in the 'cpp' preprocessor, 1402 with regard to looking for 'header.gcc' files and other such 1403 things. 1404 1405 This path is also used to search for '.mod' files when previously 1406 compiled modules are required by a 'USE' statement. 1407 1408 *Note Options for Directory Search: (gcc)Directory Options, for 1409 information on the '-I' option. 1410 1411'-JDIR' 1412 This option specifies where to put '.mod' files for compiled 1413 modules. It is also added to the list of directories to searched 1414 by an 'USE' statement. 1415 1416 The default is the current directory. 1417 1418'-fintrinsic-modules-path DIR' 1419 This option specifies the location of pre-compiled intrinsic 1420 modules, if they are not in the default location expected by the 1421 compiler. 1422 1423 1424File: gfortran.info, Node: Link Options, Next: Runtime Options, Prev: Directory Options, Up: Invoking GNU Fortran 1425 14262.7 Influencing the linking step 1427================================ 1428 1429These options come into play when the compiler links object files into 1430an executable output file. They are meaningless if the compiler is not 1431doing a link step. 1432 1433'-static-libgfortran' 1434 On systems that provide 'libgfortran' as a shared and a static 1435 library, this option forces the use of the static version. If no 1436 shared version of 'libgfortran' was built when the compiler was 1437 configured, this option has no effect. 1438 1439 1440File: gfortran.info, Node: Runtime Options, Next: Code Gen Options, Prev: Link Options, Up: Invoking GNU Fortran 1441 14422.8 Influencing runtime behavior 1443================================ 1444 1445These options affect the runtime behavior of programs compiled with GNU 1446Fortran. 1447 1448'-fconvert=CONVERSION' 1449 Specify the representation of data for unformatted files. Valid 1450 values for conversion are: 'native', the default; 'swap', swap 1451 between big- and little-endian; 'big-endian', use big-endian 1452 representation for unformatted files; 'little-endian', use 1453 little-endian representation for unformatted files. 1454 1455 _This option has an effect only when used in the main program. The 1456 'CONVERT' specifier and the GFORTRAN_CONVERT_UNIT environment 1457 variable override the default specified by '-fconvert'._ 1458 1459'-frecord-marker=LENGTH' 1460 Specify the length of record markers for unformatted files. Valid 1461 values for LENGTH are 4 and 8. Default is 4. _This is different 1462 from previous versions of 'gfortran'_, which specified a default 1463 record marker length of 8 on most systems. If you want to read or 1464 write files compatible with earlier versions of 'gfortran', use 1465 '-frecord-marker=8'. 1466 1467'-fmax-subrecord-length=LENGTH' 1468 Specify the maximum length for a subrecord. The maximum permitted 1469 value for length is 2147483639, which is also the default. Only 1470 really useful for use by the gfortran testsuite. 1471 1472'-fsign-zero' 1473 When enabled, floating point numbers of value zero with the sign 1474 bit set are written as negative number in formatted output and 1475 treated as negative in the 'SIGN' intrinsic. '-fno-sign-zero' does 1476 not print the negative sign of zero values (or values rounded to 1477 zero for I/O) and regards zero as positive number in the 'SIGN' 1478 intrinsic for compatibility with Fortran 77. The default is 1479 '-fsign-zero'. 1480 1481 1482File: gfortran.info, Node: Code Gen Options, Next: Interoperability Options, Prev: Runtime Options, Up: Invoking GNU Fortran 1483 14842.9 Options for code generation conventions 1485=========================================== 1486 1487These machine-independent options control the interface conventions used 1488in code generation. 1489 1490 Most of them have both positive and negative forms; the negative form 1491of '-ffoo' would be '-fno-foo'. In the table below, only one of the 1492forms is listed--the one which is not the default. You can figure out 1493the other form by either removing 'no-' or adding it. 1494 1495'-fno-automatic' 1496 Treat each program unit (except those marked as RECURSIVE) as if 1497 the 'SAVE' statement were specified for every local variable and 1498 array referenced in it. Does not affect common blocks. (Some 1499 Fortran compilers provide this option under the name '-static' or 1500 '-save'.) The default, which is '-fautomatic', uses the stack for 1501 local variables smaller than the value given by 1502 '-fmax-stack-var-size'. Use the option '-frecursive' to use no 1503 static memory. 1504 1505 Local variables or arrays having an explicit 'SAVE' attribute are 1506 silently ignored unless the '-pedantic' option is added. 1507 1508'-ff2c' 1509 Generate code designed to be compatible with code generated by 1510 'g77' and 'f2c'. 1511 1512 The calling conventions used by 'g77' (originally implemented in 1513 'f2c') require functions that return type default 'REAL' to 1514 actually return the C type 'double', and functions that return type 1515 'COMPLEX' to return the values via an extra argument in the calling 1516 sequence that points to where to store the return value. Under the 1517 default GNU calling conventions, such functions simply return their 1518 results as they would in GNU C--default 'REAL' functions return the 1519 C type 'float', and 'COMPLEX' functions return the GNU C type 1520 'complex'. Additionally, this option implies the 1521 '-fsecond-underscore' option, unless '-fno-second-underscore' is 1522 explicitly requested. 1523 1524 This does not affect the generation of code that interfaces with 1525 the 'libgfortran' library. 1526 1527 _Caution:_ It is not a good idea to mix Fortran code compiled with 1528 '-ff2c' with code compiled with the default '-fno-f2c' calling 1529 conventions as, calling 'COMPLEX' or default 'REAL' functions 1530 between program parts which were compiled with different calling 1531 conventions will break at execution time. 1532 1533 _Caution:_ This will break code which passes intrinsic functions of 1534 type default 'REAL' or 'COMPLEX' as actual arguments, as the 1535 library implementations use the '-fno-f2c' calling conventions. 1536 1537'-fno-underscoring' 1538 Do not transform names of entities specified in the Fortran source 1539 file by appending underscores to them. 1540 1541 With '-funderscoring' in effect, GNU Fortran appends one underscore 1542 to external names with no underscores. This is done to ensure 1543 compatibility with code produced by many UNIX Fortran compilers. 1544 1545 _Caution_: The default behavior of GNU Fortran is incompatible with 1546 'f2c' and 'g77', please use the '-ff2c' option if you want object 1547 files compiled with GNU Fortran to be compatible with object code 1548 created with these tools. 1549 1550 Use of '-fno-underscoring' is not recommended unless you are 1551 experimenting with issues such as integration of GNU Fortran into 1552 existing system environments (vis-a`-vis existing libraries, tools, 1553 and so on). 1554 1555 For example, with '-funderscoring', and assuming that 'j()' and 1556 'max_count()' are external functions while 'my_var' and 'lvar' are 1557 local variables, a statement like 1558 I = J() + MAX_COUNT (MY_VAR, LVAR) 1559 is implemented as something akin to: 1560 i = j_() + max_count__(&my_var__, &lvar); 1561 1562 With '-fno-underscoring', the same statement is implemented as: 1563 1564 i = j() + max_count(&my_var, &lvar); 1565 1566 Use of '-fno-underscoring' allows direct specification of 1567 user-defined names while debugging and when interfacing GNU Fortran 1568 code with other languages. 1569 1570 Note that just because the names match does _not_ mean that the 1571 interface implemented by GNU Fortran for an external name matches 1572 the interface implemented by some other language for that same 1573 name. That is, getting code produced by GNU Fortran to link to 1574 code produced by some other compiler using this or any other method 1575 can be only a small part of the overall solution--getting the code 1576 generated by both compilers to agree on issues other than naming 1577 can require significant effort, and, unlike naming disagreements, 1578 linkers normally cannot detect disagreements in these other areas. 1579 1580 Also, note that with '-fno-underscoring', the lack of appended 1581 underscores introduces the very real possibility that a 1582 user-defined external name will conflict with a name in a system 1583 library, which could make finding unresolved-reference bugs quite 1584 difficult in some cases--they might occur at program run time, and 1585 show up only as buggy behavior at run time. 1586 1587 In future versions of GNU Fortran we hope to improve naming and 1588 linking issues so that debugging always involves using the names as 1589 they appear in the source, even if the names as seen by the linker 1590 are mangled to prevent accidental linking between procedures with 1591 incompatible interfaces. 1592 1593'-fsecond-underscore' 1594 By default, GNU Fortran appends an underscore to external names. 1595 If this option is used GNU Fortran appends two underscores to names 1596 with underscores and one underscore to external names with no 1597 underscores. GNU Fortran also appends two underscores to internal 1598 names with underscores to avoid naming collisions with external 1599 names. 1600 1601 This option has no effect if '-fno-underscoring' is in effect. It 1602 is implied by the '-ff2c' option. 1603 1604 Otherwise, with this option, an external name such as 'MAX_COUNT' 1605 is implemented as a reference to the link-time external symbol 1606 'max_count__', instead of 'max_count_'. This is required for 1607 compatibility with 'g77' and 'f2c', and is implied by use of the 1608 '-ff2c' option. 1609 1610'-fcoarray=<KEYWORD>' 1611 1612 'none' 1613 Disable coarray support; using coarray declarations and 1614 image-control statements will produce a compile-time error. 1615 (Default) 1616 1617 'single' 1618 Single-image mode, i.e. 'num_images()' is always one. 1619 1620 'lib' 1621 Library-based coarray parallelization; a suitable GNU Fortran 1622 coarray library needs to be linked. 1623 1624'-fcheck=<KEYWORD>' 1625 1626 Enable the generation of run-time checks; the argument shall be a 1627 comma-delimited list of the following keywords. Prefixing a check 1628 with 'no-' disables it if it was activated by a previous 1629 specification. 1630 1631 'all' 1632 Enable all run-time test of '-fcheck'. 1633 1634 'array-temps' 1635 Warns at run time when for passing an actual argument a 1636 temporary array had to be generated. The information 1637 generated by this warning is sometimes useful in optimization, 1638 in order to avoid such temporaries. 1639 1640 Note: The warning is only printed once per location. 1641 1642 'bits' 1643 Enable generation of run-time checks for invalid arguments to 1644 the bit manipulation intrinsics. 1645 1646 'bounds' 1647 Enable generation of run-time checks for array subscripts and 1648 against the declared minimum and maximum values. It also 1649 checks array indices for assumed and deferred shape arrays 1650 against the actual allocated bounds and ensures that all 1651 string lengths are equal for character array constructors 1652 without an explicit typespec. 1653 1654 Some checks require that '-fcheck=bounds' is set for the 1655 compilation of the main program. 1656 1657 Note: In the future this may also include other forms of 1658 checking, e.g., checking substring references. 1659 1660 'do' 1661 Enable generation of run-time checks for invalid modification 1662 of loop iteration variables. 1663 1664 'mem' 1665 Enable generation of run-time checks for memory allocation. 1666 Note: This option does not affect explicit allocations using 1667 the 'ALLOCATE' statement, which will be always checked. 1668 1669 'pointer' 1670 Enable generation of run-time checks for pointers and 1671 allocatables. 1672 1673 'recursion' 1674 Enable generation of run-time checks for recursively called 1675 subroutines and functions which are not marked as recursive. 1676 See also '-frecursive'. Note: This check does not work for 1677 OpenMP programs and is disabled if used together with 1678 '-frecursive' and '-fopenmp'. 1679 1680 Example: Assuming you have a file 'foo.f90', the command 1681 gfortran -fcheck=all,no-array-temps foo.f90 1682 will compile the file with all checks enabled as specified above 1683 except warnings for generated array temporaries. 1684 1685'-fbounds-check' 1686 Deprecated alias for '-fcheck=bounds'. 1687 1688'-ftail-call-workaround' 1689'-ftail-call-workaround=N' 1690 Some C interfaces to Fortran codes violate the gfortran ABI by 1691 omitting the hidden character length arguments as described in 1692 *Note Argument passing conventions::. This can lead to crashes 1693 because pushing arguments for tail calls can overflow the stack. 1694 1695 To provide a workaround for existing binary packages, this option 1696 disables tail call optimization for gfortran procedures with 1697 character arguments. With '-ftail-call-workaround=2' tail call 1698 optimization is disabled in all gfortran procedures with character 1699 arguments, with '-ftail-call-workaround=1' or equivalent 1700 '-ftail-call-workaround' only in gfortran procedures with character 1701 arguments that call implicitly prototyped procedures. 1702 1703 Using this option can lead to problems including crashes due to 1704 insufficient stack space. 1705 1706 It is _very strongly_ recommended to fix the code in question. The 1707 '-fc-prototypes-external' option can be used to generate prototypes 1708 which conform to gfortran's ABI, for inclusion in the source code. 1709 1710 Support for this option will likely be withdrawn in a future 1711 release of gfortran. 1712 1713 The negative form, '-fno-tail-call-workaround' or equivalent 1714 '-ftail-call-workaround=0', can be used to disable this option. 1715 1716 Default is currently '-ftail-call-workaround', this will change in 1717 future releases. 1718 1719'-fcheck-array-temporaries' 1720 Deprecated alias for '-fcheck=array-temps'. 1721 1722'-fmax-array-constructor=N' 1723 This option can be used to increase the upper limit permitted in 1724 array constructors. The code below requires this option to expand 1725 the array at compile time. 1726 1727 program test 1728 implicit none 1729 integer j 1730 integer, parameter :: n = 100000 1731 integer, parameter :: i(n) = (/ (2*j, j = 1, n) /) 1732 print '(10(I0,1X))', i 1733 end program test 1734 1735 _Caution: This option can lead to long compile times and 1736 excessively large object files._ 1737 1738 The default value for N is 65535. 1739 1740'-fmax-stack-var-size=N' 1741 This option specifies the size in bytes of the largest array that 1742 will be put on the stack; if the size is exceeded static memory is 1743 used (except in procedures marked as RECURSIVE). Use the option 1744 '-frecursive' to allow for recursive procedures which do not have a 1745 RECURSIVE attribute or for parallel programs. Use '-fno-automatic' 1746 to never use the stack. 1747 1748 This option currently only affects local arrays declared with 1749 constant bounds, and may not apply to all character variables. 1750 Future versions of GNU Fortran may improve this behavior. 1751 1752 The default value for N is 65536. 1753 1754'-fstack-arrays' 1755 Adding this option will make the Fortran compiler put all arrays of 1756 unknown size and array temporaries onto stack memory. If your 1757 program uses very large local arrays it is possible that you will 1758 have to extend your runtime limits for stack memory on some 1759 operating systems. This flag is enabled by default at optimization 1760 level '-Ofast' unless '-fmax-stack-var-size' is specified. 1761 1762'-fpack-derived' 1763 This option tells GNU Fortran to pack derived type members as 1764 closely as possible. Code compiled with this option is likely to 1765 be incompatible with code compiled without this option, and may 1766 execute slower. 1767 1768'-frepack-arrays' 1769 In some circumstances GNU Fortran may pass assumed shape array 1770 sections via a descriptor describing a noncontiguous area of 1771 memory. This option adds code to the function prologue to repack 1772 the data into a contiguous block at runtime. 1773 1774 This should result in faster accesses to the array. However it can 1775 introduce significant overhead to the function call, especially 1776 when the passed data is noncontiguous. 1777 1778'-fshort-enums' 1779 This option is provided for interoperability with C code that was 1780 compiled with the '-fshort-enums' option. It will make GNU Fortran 1781 choose the smallest 'INTEGER' kind a given enumerator set will fit 1782 in, and give all its enumerators this kind. 1783 1784'-finline-arg-packing' 1785 When passing an assumed-shape argument of a procedure as actual 1786 argument to an assumed-size or explicit size or as argument to a 1787 procedure that does not have an explicit interface, the argument 1788 may have to be packed, that is put into contiguous memory. An 1789 example is the call to 'foo' in 1790 subroutine foo(a) 1791 real, dimension(*) :: a 1792 end subroutine foo 1793 subroutine bar(b) 1794 real, dimension(:) :: b 1795 call foo(b) 1796 end subroutine bar 1797 1798 When '-finline-arg-packing' is in effect, this packing will be 1799 performed by inline code. This allows for more optimization while 1800 increasing code size. 1801 1802 '-finline-arg-packing' is implied by any of the '-O' options except 1803 when optimizing for size via '-Os'. If the code contains a very 1804 large number of argument that have to be packed, code size and also 1805 compilation time may become excessive. If that is the case, it may 1806 be better to disable this option. Instances of packing can be 1807 found by using by using '-Warray-temporaries'. 1808 1809'-fexternal-blas' 1810 This option will make 'gfortran' generate calls to BLAS functions 1811 for some matrix operations like 'MATMUL', instead of using our own 1812 algorithms, if the size of the matrices involved is larger than a 1813 given limit (see '-fblas-matmul-limit'). This may be profitable if 1814 an optimized vendor BLAS library is available. The BLAS library 1815 will have to be specified at link time. 1816 1817'-fblas-matmul-limit=N' 1818 Only significant when '-fexternal-blas' is in effect. Matrix 1819 multiplication of matrices with size larger than (or equal to) N 1820 will be performed by calls to BLAS functions, while others will be 1821 handled by 'gfortran' internal algorithms. If the matrices 1822 involved are not square, the size comparison is performed using the 1823 geometric mean of the dimensions of the argument and result 1824 matrices. 1825 1826 The default value for N is 30. 1827 1828'-finline-matmul-limit=N' 1829 When front-end optimiztion is active, some calls to the 'MATMUL' 1830 intrinsic function will be inlined. This may result in code size 1831 increase if the size of the matrix cannot be determined at compile 1832 time, as code for both cases is generated. Setting 1833 '-finline-matmul-limit=0' will disable inlining in all cases. 1834 Setting this option with a value of N will produce inline code for 1835 matrices with size up to N. If the matrices involved are not 1836 square, the size comparison is performed using the geometric mean 1837 of the dimensions of the argument and result matrices. 1838 1839 The default value for N is 30. The '-fblas-matmul-limit' can be 1840 used to change this value. 1841 1842'-frecursive' 1843 Allow indirect recursion by forcing all local arrays to be 1844 allocated on the stack. This flag cannot be used together with 1845 '-fmax-stack-var-size=' or '-fno-automatic'. 1846 1847'-finit-local-zero' 1848'-finit-derived' 1849'-finit-integer=N' 1850'-finit-real=<ZERO|INF|-INF|NAN|SNAN>' 1851'-finit-logical=<TRUE|FALSE>' 1852'-finit-character=N' 1853 The '-finit-local-zero' option instructs the compiler to initialize 1854 local 'INTEGER', 'REAL', and 'COMPLEX' variables to zero, 'LOGICAL' 1855 variables to false, and 'CHARACTER' variables to a string of null 1856 bytes. Finer-grained initialization options are provided by the 1857 '-finit-integer=N', '-finit-real=<ZERO|INF|-INF|NAN|SNAN>' (which 1858 also initializes the real and imaginary parts of local 'COMPLEX' 1859 variables), '-finit-logical=<TRUE|FALSE>', and '-finit-character=N' 1860 (where N is an ASCII character value) options. 1861 1862 With '-finit-derived', components of derived type variables will be 1863 initialized according to these flags. Components whose type is not 1864 covered by an explicit '-finit-*' flag will be treated as described 1865 above with '-finit-local-zero'. 1866 1867 These options do not initialize 1868 * objects with the POINTER attribute 1869 * allocatable arrays 1870 * variables that appear in an 'EQUIVALENCE' statement. 1871 (These limitations may be removed in future releases). 1872 1873 Note that the '-finit-real=nan' option initializes 'REAL' and 1874 'COMPLEX' variables with a quiet NaN. For a signalling NaN use 1875 '-finit-real=snan'; note, however, that compile-time optimizations 1876 may convert them into quiet NaN and that trapping needs to be 1877 enabled (e.g. via '-ffpe-trap'). 1878 1879 The '-finit-integer' option will parse the value into an integer of 1880 type 'INTEGER(kind=C_LONG)' on the host. Said value is then 1881 assigned to the integer variables in the Fortran code, which might 1882 result in wraparound if the value is too large for the kind. 1883 1884 Finally, note that enabling any of the '-finit-*' options will 1885 silence warnings that would have been emitted by '-Wuninitialized' 1886 for the affected local variables. 1887 1888'-falign-commons' 1889 By default, 'gfortran' enforces proper alignment of all variables 1890 in a 'COMMON' block by padding them as needed. On certain 1891 platforms this is mandatory, on others it increases performance. 1892 If a 'COMMON' block is not declared with consistent data types 1893 everywhere, this padding can cause trouble, and 1894 '-fno-align-commons' can be used to disable automatic alignment. 1895 The same form of this option should be used for all files that 1896 share a 'COMMON' block. To avoid potential alignment issues in 1897 'COMMON' blocks, it is recommended to order objects from largest to 1898 smallest. 1899 1900'-fno-protect-parens' 1901 By default the parentheses in expression are honored for all 1902 optimization levels such that the compiler does not do any 1903 re-association. Using '-fno-protect-parens' allows the compiler to 1904 reorder 'REAL' and 'COMPLEX' expressions to produce faster code. 1905 Note that for the re-association optimization '-fno-signed-zeros' 1906 and '-fno-trapping-math' need to be in effect. The parentheses 1907 protection is enabled by default, unless '-Ofast' is given. 1908 1909'-frealloc-lhs' 1910 An allocatable left-hand side of an intrinsic assignment is 1911 automatically (re)allocated if it is either unallocated or has a 1912 different shape. The option is enabled by default except when 1913 '-std=f95' is given. See also '-Wrealloc-lhs'. 1914 1915'-faggressive-function-elimination' 1916 Functions with identical argument lists are eliminated within 1917 statements, regardless of whether these functions are marked 'PURE' 1918 or not. For example, in 1919 a = f(b,c) + f(b,c) 1920 there will only be a single call to 'f'. This option only works if 1921 '-ffrontend-optimize' is in effect. 1922 1923'-ffrontend-optimize' 1924 This option performs front-end optimization, based on manipulating 1925 parts the Fortran parse tree. Enabled by default by any '-O' 1926 option except '-O0' and '-Og'. Optimizations enabled by this 1927 option include: 1928 * inlining calls to 'MATMUL', 1929 * elimination of identical function calls within expressions, 1930 * removing unnecessary calls to 'TRIM' in comparisons and 1931 assignments, 1932 * replacing 'TRIM(a)' with 'a(1:LEN_TRIM(a))' and 1933 * short-circuiting of logical operators ('.AND.' and '.OR.'). 1934 It can be deselected by specifying '-fno-frontend-optimize'. 1935 1936'-ffrontend-loop-interchange' 1937 Attempt to interchange loops in the Fortran front end where 1938 profitable. Enabled by default by any '-O' option. At the moment, 1939 this option only affects 'FORALL' and 'DO CONCURRENT' statements 1940 with several forall triplets. 1941 1942 *Note Options for Code Generation Conventions: (gcc)Code Gen Options, 1943for information on more options offered by the GBE shared by 'gfortran', 1944'gcc', and other GNU compilers. 1945 1946 1947File: gfortran.info, Node: Interoperability Options, Next: Environment Variables, Prev: Code Gen Options, Up: Invoking GNU Fortran 1948 19492.10 Options for interoperability with other languages 1950====================================================== 1951 1952-fc-prototypes 1953 This option will generate C prototypes from 'BIND(C)' variable 1954 declarations, types and procedure interfaces and writes them to 1955 standard output. 'ENUM' is not yet supported. 1956 1957 The generated prototypes may need inclusion of an appropriate 1958 header, such as '<stdint.h>' or '<stdlib.h>'. For types which are 1959 not specified using the appropriate kind from the 'iso_c_binding' 1960 module, a warning is added as a comment to the code. 1961 1962 For function pointers, a pointer to a function returning 'int' 1963 without an explicit argument list is generated. 1964 1965 Example of use: 1966 $ gfortran -fc-prototypes -fsyntax-only foo.f90 > foo.h 1967 where the C code intended for interoperating with the Fortran code 1968 then uses '#include "foo.h"'. 1969 1970-fc-prototypes-external 1971 This option will generate C prototypes from external functions and 1972 subroutines and write them to standard output. This may be useful 1973 for making sure that C bindings to Fortran code are correct. This 1974 option does not generate prototypes for 'BIND(C)' procedures, use 1975 '-fc-prototypes' for that. 1976 1977 The generated prototypes may need inclusion of an appropriate 1978 header, such as as '<stdint.h>' or '<stdlib.h>'. 1979 1980 This is primarily meant for legacy code to ensure that existing C 1981 bindings match what 'gfortran' emits. The generated C prototypes 1982 should be correct for the current version of the compiler, but may 1983 not match what other compilers or earlier versions of 'gfortran' 1984 need. For new developments, use of the 'BIND(C)' features is 1985 recommended. 1986 1987 Example of use: 1988 $ gfortran -fc-prototypes-external -fsyntax-only foo.f > foo.h 1989 where the C code intended for interoperating with the Fortran code 1990 then uses '#include "foo.h"'. 1991 1992 1993File: gfortran.info, Node: Environment Variables, Prev: Interoperability Options, Up: Invoking GNU Fortran 1994 19952.11 Environment variables affecting 'gfortran' 1996=============================================== 1997 1998The 'gfortran' compiler currently does not make use of any environment 1999variables to control its operation above and beyond those that affect 2000the operation of 'gcc'. 2001 2002 *Note Environment Variables Affecting GCC: (gcc)Environment 2003Variables, for information on environment variables. 2004 2005 *Note Runtime::, for environment variables that affect the run-time 2006behavior of programs compiled with GNU Fortran. 2007 2008 2009File: gfortran.info, Node: Runtime, Next: Fortran standards status, Prev: Invoking GNU Fortran, Up: Top 2010 20113 Runtime: Influencing runtime behavior with environment variables 2012****************************************************************** 2013 2014The behavior of the 'gfortran' can be influenced by environment 2015variables. 2016 2017 Malformed environment variables are silently ignored. 2018 2019* Menu: 2020 2021* TMPDIR:: Directory for scratch files 2022* GFORTRAN_STDIN_UNIT:: Unit number for standard input 2023* GFORTRAN_STDOUT_UNIT:: Unit number for standard output 2024* GFORTRAN_STDERR_UNIT:: Unit number for standard error 2025* GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units 2026* GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units. 2027* GFORTRAN_SHOW_LOCUS:: Show location for runtime errors 2028* GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted 2029* GFORTRAN_LIST_SEPARATOR:: Separator for list output 2030* GFORTRAN_CONVERT_UNIT:: Set endianness for unformatted I/O 2031* GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors 2032* GFORTRAN_FORMATTED_BUFFER_SIZE:: Buffer size for formatted files 2033* GFORTRAN_UNFORMATTED_BUFFER_SIZE:: Buffer size for unformatted files 2034 2035 2036File: gfortran.info, Node: TMPDIR, Next: GFORTRAN_STDIN_UNIT, Up: Runtime 2037 20383.1 'TMPDIR'--Directory for scratch files 2039========================================= 2040 2041When opening a file with 'STATUS='SCRATCH'', GNU Fortran tries to create 2042the file in one of the potential directories by testing each directory 2043in the order below. 2044 2045 1. The environment variable 'TMPDIR', if it exists. 2046 2047 2. On the MinGW target, the directory returned by the 'GetTempPath' 2048 function. Alternatively, on the Cygwin target, the 'TMP' and 2049 'TEMP' environment variables, if they exist, in that order. 2050 2051 3. The 'P_tmpdir' macro if it is defined, otherwise the directory 2052 '/tmp'. 2053 2054 2055File: gfortran.info, Node: GFORTRAN_STDIN_UNIT, Next: GFORTRAN_STDOUT_UNIT, Prev: TMPDIR, Up: Runtime 2056 20573.2 'GFORTRAN_STDIN_UNIT'--Unit number for standard input 2058========================================================= 2059 2060This environment variable can be used to select the unit number 2061preconnected to standard input. This must be a positive integer. The 2062default value is 5. 2063 2064 2065File: gfortran.info, Node: GFORTRAN_STDOUT_UNIT, Next: GFORTRAN_STDERR_UNIT, Prev: GFORTRAN_STDIN_UNIT, Up: Runtime 2066 20673.3 'GFORTRAN_STDOUT_UNIT'--Unit number for standard output 2068=========================================================== 2069 2070This environment variable can be used to select the unit number 2071preconnected to standard output. This must be a positive integer. The 2072default value is 6. 2073 2074 2075File: gfortran.info, Node: GFORTRAN_STDERR_UNIT, Next: GFORTRAN_UNBUFFERED_ALL, Prev: GFORTRAN_STDOUT_UNIT, Up: Runtime 2076 20773.4 'GFORTRAN_STDERR_UNIT'--Unit number for standard error 2078========================================================== 2079 2080This environment variable can be used to select the unit number 2081preconnected to standard error. This must be a positive integer. The 2082default value is 0. 2083 2084 2085File: gfortran.info, Node: GFORTRAN_UNBUFFERED_ALL, Next: GFORTRAN_UNBUFFERED_PRECONNECTED, Prev: GFORTRAN_STDERR_UNIT, Up: Runtime 2086 20873.5 'GFORTRAN_UNBUFFERED_ALL'--Do not buffer I/O on all units 2088============================================================= 2089 2090This environment variable controls whether all I/O is unbuffered. If 2091the first letter is 'y', 'Y' or '1', all I/O is unbuffered. This will 2092slow down small sequential reads and writes. If the first letter is 2093'n', 'N' or '0', I/O is buffered. This is the default. 2094 2095 2096File: gfortran.info, Node: GFORTRAN_UNBUFFERED_PRECONNECTED, Next: GFORTRAN_SHOW_LOCUS, Prev: GFORTRAN_UNBUFFERED_ALL, Up: Runtime 2097 20983.6 'GFORTRAN_UNBUFFERED_PRECONNECTED'--Do not buffer I/O on preconnected units 2099=============================================================================== 2100 2101The environment variable named 'GFORTRAN_UNBUFFERED_PRECONNECTED' 2102controls whether I/O on a preconnected unit (i.e. STDOUT or STDERR) is 2103unbuffered. If the first letter is 'y', 'Y' or '1', I/O is unbuffered. 2104This will slow down small sequential reads and writes. If the first 2105letter is 'n', 'N' or '0', I/O is buffered. This is the default. 2106 2107 2108File: gfortran.info, Node: GFORTRAN_SHOW_LOCUS, Next: GFORTRAN_OPTIONAL_PLUS, Prev: GFORTRAN_UNBUFFERED_PRECONNECTED, Up: Runtime 2109 21103.7 'GFORTRAN_SHOW_LOCUS'--Show location for runtime errors 2111=========================================================== 2112 2113If the first letter is 'y', 'Y' or '1', filename and line numbers for 2114runtime errors are printed. If the first letter is 'n', 'N' or '0', do 2115not print filename and line numbers for runtime errors. The default is 2116to print the location. 2117 2118 2119File: gfortran.info, Node: GFORTRAN_OPTIONAL_PLUS, Next: GFORTRAN_LIST_SEPARATOR, Prev: GFORTRAN_SHOW_LOCUS, Up: Runtime 2120 21213.8 'GFORTRAN_OPTIONAL_PLUS'--Print leading + where permitted 2122============================================================= 2123 2124If the first letter is 'y', 'Y' or '1', a plus sign is printed where 2125permitted by the Fortran standard. If the first letter is 'n', 'N' or 2126'0', a plus sign is not printed in most cases. Default is not to print 2127plus signs. 2128 2129 2130File: gfortran.info, Node: GFORTRAN_LIST_SEPARATOR, Next: GFORTRAN_CONVERT_UNIT, Prev: GFORTRAN_OPTIONAL_PLUS, Up: Runtime 2131 21323.9 'GFORTRAN_LIST_SEPARATOR'--Separator for list output 2133======================================================== 2134 2135This environment variable specifies the separator when writing 2136list-directed output. It may contain any number of spaces and at most 2137one comma. If you specify this on the command line, be sure to quote 2138spaces, as in 2139 $ GFORTRAN_LIST_SEPARATOR=' , ' ./a.out 2140 when 'a.out' is the compiled Fortran program that you want to run. 2141Default is a single space. 2142 2143 2144File: gfortran.info, Node: GFORTRAN_CONVERT_UNIT, Next: GFORTRAN_ERROR_BACKTRACE, Prev: GFORTRAN_LIST_SEPARATOR, Up: Runtime 2145 21463.10 'GFORTRAN_CONVERT_UNIT'--Set endianness for unformatted I/O 2147================================================================ 2148 2149By setting the 'GFORTRAN_CONVERT_UNIT' variable, it is possible to 2150change the representation of data for unformatted files. The syntax for 2151the 'GFORTRAN_CONVERT_UNIT' variable is: 2152 GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ; 2153 mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ; 2154 exception: mode ':' unit_list | unit_list ; 2155 unit_list: unit_spec | unit_list unit_spec ; 2156 unit_spec: INTEGER | INTEGER '-' INTEGER ; 2157 The variable consists of an optional default mode, followed by a list 2158of optional exceptions, which are separated by semicolons from the 2159preceding default and each other. Each exception consists of a format 2160and a comma-separated list of units. Valid values for the modes are the 2161same as for the 'CONVERT' specifier: 2162 2163 'NATIVE' Use the native format. This is the default. 2164 'SWAP' Swap between little- and big-endian. 2165 'LITTLE_ENDIAN' Use the little-endian format for unformatted files. 2166 'BIG_ENDIAN' Use the big-endian format for unformatted files. 2167 A missing mode for an exception is taken to mean 'BIG_ENDIAN'. 2168Examples of values for 'GFORTRAN_CONVERT_UNIT' are: 2169 ''big_endian'' Do all unformatted I/O in big_endian mode. 2170 ''little_endian;native:10-20,25'' Do all unformatted I/O in 2171 little_endian mode, except for units 10 to 20 and 25, which are in 2172 native format. 2173 ''10-20'' Units 10 to 20 are big-endian, the rest is native. 2174 2175 Setting the environment variables should be done on the command line 2176or via the 'export' command for 'sh'-compatible shells and via 'setenv' 2177for 'csh'-compatible shells. 2178 2179 Example for 'sh': 2180 $ gfortran foo.f90 2181 $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out 2182 2183 Example code for 'csh': 2184 % gfortran foo.f90 2185 % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20' 2186 % ./a.out 2187 2188 Using anything but the native representation for unformatted data 2189carries a significant speed overhead. If speed in this area matters to 2190you, it is best if you use this only for data that needs to be portable. 2191 2192 *Note CONVERT specifier::, for an alternative way to specify the data 2193representation for unformatted files. *Note Runtime Options::, for 2194setting a default data representation for the whole program. The 2195'CONVERT' specifier overrides the '-fconvert' compile options. 2196 2197 _Note that the values specified via the GFORTRAN_CONVERT_UNIT 2198environment variable will override the CONVERT specifier in the open 2199statement_. This is to give control over data formats to users who do 2200not have the source code of their program available. 2201 2202 2203File: gfortran.info, Node: GFORTRAN_ERROR_BACKTRACE, Next: GFORTRAN_FORMATTED_BUFFER_SIZE, Prev: GFORTRAN_CONVERT_UNIT, Up: Runtime 2204 22053.11 'GFORTRAN_ERROR_BACKTRACE'--Show backtrace on run-time errors 2206================================================================== 2207 2208If the 'GFORTRAN_ERROR_BACKTRACE' variable is set to 'y', 'Y' or '1' 2209(only the first letter is relevant) then a backtrace is printed when a 2210serious run-time error occurs. To disable the backtracing, set the 2211variable to 'n', 'N', '0'. Default is to print a backtrace unless the 2212'-fno-backtrace' compile option was used. 2213 2214 2215File: gfortran.info, Node: GFORTRAN_FORMATTED_BUFFER_SIZE, Next: GFORTRAN_UNFORMATTED_BUFFER_SIZE, Prev: GFORTRAN_ERROR_BACKTRACE, Up: Runtime 2216 22173.12 'GFORTRAN_FORMATTED_BUFFER_SIZE'--Set buffer size for formatted I/O 2218======================================================================== 2219 2220The 'GFORTRAN_FORMATTED_BUFFER_SIZE' environment variable specifies 2221buffer size in bytes to be used for formatted output. The default value 2222is 8192. 2223 2224 2225File: gfortran.info, Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE, Prev: GFORTRAN_FORMATTED_BUFFER_SIZE, Up: Runtime 2226 22273.13 'GFORTRAN_UNFORMATTED_BUFFER_SIZE'--Set buffer size for unformatted I/O 2228============================================================================ 2229 2230The 'GFORTRAN_UNFORMATTED_BUFFER_SIZE' environment variable specifies 2231buffer size in bytes to be used for unformatted output. The default 2232value is 131072. 2233 2234 2235File: gfortran.info, Node: Fortran standards status, Next: Compiler Characteristics, Prev: Runtime, Up: Top 2236 22374 Fortran standards status 2238************************** 2239 2240* Menu: 2241 2242* Fortran 2003 status:: 2243* Fortran 2008 status:: 2244* Fortran 2018 status:: 2245 2246 2247File: gfortran.info, Node: Fortran 2003 status, Next: Fortran 2008 status, Up: Fortran standards status 2248 22494.1 Fortran 2003 status 2250======================= 2251 2252GNU Fortran supports several Fortran 2003 features; an incomplete list 2253can be found below. See also the wiki page 2254(https://gcc.gnu.org/wiki/Fortran2003) about Fortran 2003. 2255 2256 * Procedure pointers including procedure-pointer components with 2257 'PASS' attribute. 2258 2259 * Procedures which are bound to a derived type (type-bound 2260 procedures) including 'PASS', 'PROCEDURE' and 'GENERIC', and 2261 operators bound to a type. 2262 2263 * Abstract interfaces and type extension with the possibility to 2264 override type-bound procedures or to have deferred binding. 2265 2266 * Polymorphic entities ("'CLASS'") for derived types and unlimited 2267 polymorphism ("'CLASS(*)'") - including 'SAME_TYPE_AS', 2268 'EXTENDS_TYPE_OF' and 'SELECT TYPE' for scalars and arrays and 2269 finalization. 2270 2271 * Generic interface names, which have the same name as derived types, 2272 are now supported. This allows one to write constructor functions. 2273 Note that Fortran does not support static constructor functions. 2274 For static variables, only default initialization or 2275 structure-constructor initialization are available. 2276 2277 * The 'ASSOCIATE' construct. 2278 2279 * Interoperability with C including enumerations, 2280 2281 * In structure constructors the components with default values may be 2282 omitted. 2283 2284 * Extensions to the 'ALLOCATE' statement, allowing for a 2285 type-specification with type parameter and for allocation and 2286 initialization from a 'SOURCE=' expression; 'ALLOCATE' and 2287 'DEALLOCATE' optionally return an error message string via 2288 'ERRMSG='. 2289 2290 * Reallocation on assignment: If an intrinsic assignment is used, an 2291 allocatable variable on the left-hand side is automatically 2292 allocated (if unallocated) or reallocated (if the shape is 2293 different). Currently, scalar deferred character length left-hand 2294 sides are correctly handled but arrays are not yet fully 2295 implemented. 2296 2297 * Deferred-length character variables and scalar deferred-length 2298 character components of derived types are supported. (Note that 2299 array-valued compoents are not yet implemented.) 2300 2301 * Transferring of allocations via 'MOVE_ALLOC'. 2302 2303 * The 'PRIVATE' and 'PUBLIC' attributes may be given individually to 2304 derived-type components. 2305 2306 * In pointer assignments, the lower bound may be specified and the 2307 remapping of elements is supported. 2308 2309 * For pointers an 'INTENT' may be specified which affect the 2310 association status not the value of the pointer target. 2311 2312 * Intrinsics 'command_argument_count', 'get_command', 2313 'get_command_argument', and 'get_environment_variable'. 2314 2315 * Support for Unicode characters (ISO 10646) and UTF-8, including the 2316 'SELECTED_CHAR_KIND' and 'NEW_LINE' intrinsic functions. 2317 2318 * Support for binary, octal and hexadecimal (BOZ) constants in the 2319 intrinsic functions 'INT', 'REAL', 'CMPLX' and 'DBLE'. 2320 2321 * Support for namelist variables with allocatable and pointer 2322 attribute and nonconstant length type parameter. 2323 2324 * Array constructors using square brackets. That is, '[...]' rather 2325 than '(/.../)'. Type-specification for array constructors like '(/ 2326 some-type :: ... /)'. 2327 2328 * Extensions to the specification and initialization expressions, 2329 including the support for intrinsics with real and complex 2330 arguments. 2331 2332 * Support for the asynchronous input/output. 2333 2334 * 'FLUSH' statement. 2335 2336 * 'IOMSG=' specifier for I/O statements. 2337 2338 * Support for the declaration of enumeration constants via the 'ENUM' 2339 and 'ENUMERATOR' statements. Interoperability with 'gcc' is 2340 guaranteed also for the case where the '-fshort-enums' command line 2341 option is given. 2342 2343 * TR 15581: 2344 * 'ALLOCATABLE' dummy arguments. 2345 * 'ALLOCATABLE' function results 2346 * 'ALLOCATABLE' components of derived types 2347 2348 * The 'OPEN' statement supports the 'ACCESS='STREAM'' specifier, 2349 allowing I/O without any record structure. 2350 2351 * Namelist input/output for internal files. 2352 2353 * Minor I/O features: Rounding during formatted output, using of a 2354 decimal comma instead of a decimal point, setting whether a plus 2355 sign should appear for positive numbers. On systems where 'strtod' 2356 honours the rounding mode, the rounding mode is also supported for 2357 input. 2358 2359 * The 'PROTECTED' statement and attribute. 2360 2361 * The 'VALUE' statement and attribute. 2362 2363 * The 'VOLATILE' statement and attribute. 2364 2365 * The 'IMPORT' statement, allowing to import host-associated derived 2366 types. 2367 2368 * The intrinsic modules 'ISO_FORTRAN_ENVIRONMENT' is supported, which 2369 contains parameters of the I/O units, storage sizes. Additionally, 2370 procedures for C interoperability are available in the 2371 'ISO_C_BINDING' module. 2372 2373 * 'USE' statement with 'INTRINSIC' and 'NON_INTRINSIC' attribute; 2374 supported intrinsic modules: 'ISO_FORTRAN_ENV', 'ISO_C_BINDING', 2375 'OMP_LIB' and 'OMP_LIB_KINDS', and 'OPENACC'. 2376 2377 * Renaming of operators in the 'USE' statement. 2378 2379 2380File: gfortran.info, Node: Fortran 2008 status, Next: Fortran 2018 status, Prev: Fortran 2003 status, Up: Fortran standards status 2381 23824.2 Fortran 2008 status 2383======================= 2384 2385The latest version of the Fortran standard is ISO/IEC 1539-1:2010, 2386informally known as Fortran 2008. The official version is available 2387from International Organization for Standardization (ISO) or its 2388national member organizations. The the final draft (FDIS) can be 2389downloaded free of charge from 2390<http://www.nag.co.uk/sc22wg5/links.html>. Fortran is developed by the 2391Working Group 5 of Sub-Committee 22 of the Joint Technical Committee 1 2392of the International Organization for Standardization and the 2393International Electrotechnical Commission (IEC). This group is known as 2394WG5 (http://www.nag.co.uk/sc22wg5/). 2395 2396 The GNU Fortran compiler supports several of the new features of 2397Fortran 2008; the wiki (https://gcc.gnu.org/wiki/Fortran2008Status) has 2398some information about the current Fortran 2008 implementation status. 2399In particular, the following is implemented. 2400 2401 * The '-std=f2008' option and support for the file extensions '.f08' 2402 and '.F08'. 2403 2404 * The 'OPEN' statement now supports the 'NEWUNIT=' option, which 2405 returns a unique file unit, thus preventing inadvertent use of the 2406 same unit in different parts of the program. 2407 2408 * The 'g0' format descriptor and unlimited format items. 2409 2410 * The mathematical intrinsics 'ASINH', 'ACOSH', 'ATANH', 'ERF', 2411 'ERFC', 'GAMMA', 'LOG_GAMMA', 'BESSEL_J0', 'BESSEL_J1', 2412 'BESSEL_JN', 'BESSEL_Y0', 'BESSEL_Y1', 'BESSEL_YN', 'HYPOT', 2413 'NORM2', and 'ERFC_SCALED'. 2414 2415 * Using complex arguments with 'TAN', 'SINH', 'COSH', 'TANH', 'ASIN', 2416 'ACOS', and 'ATAN' is now possible; 'ATAN'(Y,X) is now an alias for 2417 'ATAN2'(Y,X). 2418 2419 * Support of the 'PARITY' intrinsic functions. 2420 2421 * The following bit intrinsics: 'LEADZ' and 'TRAILZ' for counting the 2422 number of leading and trailing zero bits, 'POPCNT' and 'POPPAR' for 2423 counting the number of one bits and returning the parity; 'BGE', 2424 'BGT', 'BLE', and 'BLT' for bitwise comparisons; 'DSHIFTL' and 2425 'DSHIFTR' for combined left and right shifts, 'MASKL' and 'MASKR' 2426 for simple left and right justified masks, 'MERGE_BITS' for a 2427 bitwise merge using a mask, 'SHIFTA', 'SHIFTL' and 'SHIFTR' for 2428 shift operations, and the transformational bit intrinsics 'IALL', 2429 'IANY' and 'IPARITY'. 2430 2431 * Support of the 'EXECUTE_COMMAND_LINE' intrinsic subroutine. 2432 2433 * Support for the 'STORAGE_SIZE' intrinsic inquiry function. 2434 2435 * The 'INT{8,16,32}' and 'REAL{32,64,128}' kind type parameters and 2436 the array-valued named constants 'INTEGER_KINDS', 'LOGICAL_KINDS', 2437 'REAL_KINDS' and 'CHARACTER_KINDS' of the intrinsic module 2438 'ISO_FORTRAN_ENV'. 2439 2440 * The module procedures 'C_SIZEOF' of the intrinsic module 2441 'ISO_C_BINDINGS' and 'COMPILER_VERSION' and 'COMPILER_OPTIONS' of 2442 'ISO_FORTRAN_ENV'. 2443 2444 * Coarray support for serial programs with '-fcoarray=single' flag 2445 and experimental support for multiple images with the 2446 '-fcoarray=lib' flag. 2447 2448 * Submodules are supported. It should noted that 'MODULEs' do not 2449 produce the smod file needed by the descendent 'SUBMODULEs' unless 2450 they contain at least one 'MODULE PROCEDURE' interface. The reason 2451 for this is that 'SUBMODULEs' are useless without 'MODULE 2452 PROCEDUREs'. See http://j3-fortran.org/doc/meeting/207/15-209.txt 2453 for a discussion and a draft interpretation. Adopting this 2454 interpretation has the advantage that code that does not use 2455 submodules does not generate smod files. 2456 2457 * The 'DO CONCURRENT' construct is supported. 2458 2459 * The 'BLOCK' construct is supported. 2460 2461 * The 'STOP' and the new 'ERROR STOP' statements now support all 2462 constant expressions. Both show the signals which were signaling 2463 at termination. 2464 2465 * Support for the 'CONTIGUOUS' attribute. 2466 2467 * Support for 'ALLOCATE' with 'MOLD'. 2468 2469 * Support for the 'IMPURE' attribute for procedures, which allows for 2470 'ELEMENTAL' procedures without the restrictions of 'PURE'. 2471 2472 * Null pointers (including 'NULL()') and not-allocated variables can 2473 be used as actual argument to optional non-pointer, non-allocatable 2474 dummy arguments, denoting an absent argument. 2475 2476 * Non-pointer variables with 'TARGET' attribute can be used as actual 2477 argument to 'POINTER' dummies with 'INTENT(IN)'. 2478 2479 * Pointers including procedure pointers and those in a derived type 2480 (pointer components) can now be initialized by a target instead of 2481 only by 'NULL'. 2482 2483 * The 'EXIT' statement (with construct-name) can be now be used to 2484 leave not only the 'DO' but also the 'ASSOCIATE', 'BLOCK', 'IF', 2485 'SELECT CASE' and 'SELECT TYPE' constructs. 2486 2487 * Internal procedures can now be used as actual argument. 2488 2489 * Minor features: obsolesce diagnostics for 'ENTRY' with 2490 '-std=f2008'; a line may start with a semicolon; for internal and 2491 module procedures 'END' can be used instead of 'END SUBROUTINE' and 2492 'END FUNCTION'; 'SELECTED_REAL_KIND' now also takes a 'RADIX' 2493 argument; intrinsic types are supported for 2494 'TYPE'(INTRINSIC-TYPE-SPEC); multiple type-bound procedures can be 2495 declared in a single 'PROCEDURE' statement; implied-shape arrays 2496 are supported for named constants ('PARAMETER'). 2497 2498 2499File: gfortran.info, Node: Fortran 2018 status, Prev: Fortran 2008 status, Up: Fortran standards status 2500 25014.3 Status of Fortran 2018 support 2502================================== 2503 2504 * ERROR STOP in a PURE procedure An 'ERROR STOP' statement is 2505 permitted in a 'PURE' procedure. 2506 2507 * IMPLICIT NONE with a spec-list Support the 'IMPLICIT NONE' 2508 statement with an 'implicit-none-spec-list'. 2509 2510 * Behavior of INQUIRE with the RECL= specifier 2511 2512 The behavior of the 'INQUIRE' statement with the 'RECL=' specifier 2513 now conforms to Fortran 2018. 2514 25154.3.1 TS 29113 Status (Further Interoperability with C) 2516------------------------------------------------------- 2517 2518GNU Fortran supports some of the new features of the Technical 2519Specification (TS) 29113 on Further Interoperability of Fortran with C. 2520The wiki (https://gcc.gnu.org/wiki/TS29113Status) has some information 2521about the current TS 29113 implementation status. In particular, the 2522following is implemented. 2523 2524 See also *note Further Interoperability of Fortran with C::. 2525 2526 * The 'OPTIONAL' attribute is allowed for dummy arguments of 'BIND(C) 2527 procedures.' 2528 2529 * The 'RANK' intrinsic is supported. 2530 2531 * GNU Fortran's implementation for variables with 'ASYNCHRONOUS' 2532 attribute is compatible with TS 29113. 2533 2534 * Assumed types ('TYPE(*)'). 2535 2536 * Assumed-rank ('DIMENSION(..)'). 2537 2538 * ISO_Fortran_binding (now in Fortran 2018 18.4) is implemented such 2539 that conversion of the array descriptor for assumed type or assumed 2540 rank arrays is done in the library. The include file 2541 ISO_Fortran_binding.h is can be found in 2542 '~prefix/lib/gcc/$target/$version'. 2543 25444.3.2 TS 18508 Status (Additional Parallel Features) 2545---------------------------------------------------- 2546 2547GNU Fortran supports the following new features of the Technical 2548Specification 18508 on Additional Parallel Features in Fortran: 2549 2550 * The new atomic ADD, CAS, FETCH and ADD/OR/XOR, OR and XOR 2551 intrinsics. 2552 2553 * The 'CO_MIN' and 'CO_MAX' and 'SUM' reduction intrinsics. And the 2554 'CO_BROADCAST' and 'CO_REDUCE' intrinsic, except that those do not 2555 support polymorphic types or types with allocatable, pointer or 2556 polymorphic components. 2557 2558 * Events ('EVENT POST', 'EVENT WAIT', 'EVENT_QUERY') 2559 2560 * Failed images ('FAIL IMAGE', 'IMAGE_STATUS', 'FAILED_IMAGES', 2561 'STOPPED_IMAGES') 2562 2563 2564File: gfortran.info, Node: Compiler Characteristics, Next: Extensions, Prev: Fortran standards status, Up: Top 2565 25665 Compiler Characteristics 2567************************** 2568 2569This chapter describes certain characteristics of the GNU Fortran 2570compiler, that are not specified by the Fortran standard, but which 2571might in some way or another become visible to the programmer. 2572 2573* Menu: 2574 2575* KIND Type Parameters:: 2576* Internal representation of LOGICAL variables:: 2577* Evaluation of logical expressions:: 2578* MAX and MIN intrinsics with REAL NaN arguments:: 2579* Thread-safety of the runtime library:: 2580* Data consistency and durability:: 2581* Files opened without an explicit ACTION= specifier:: 2582* File operations on symbolic links:: 2583* File format of unformatted sequential files:: 2584* Asynchronous I/O:: 2585 2586 2587File: gfortran.info, Node: KIND Type Parameters, Next: Internal representation of LOGICAL variables, Up: Compiler Characteristics 2588 25895.1 KIND Type Parameters 2590======================== 2591 2592The 'KIND' type parameters supported by GNU Fortran for the primitive 2593data types are: 2594 2595'INTEGER' 2596 1, 2, 4, 8*, 16*, default: 4** 2597 2598'LOGICAL' 2599 1, 2, 4, 8*, 16*, default: 4** 2600 2601'REAL' 2602 4, 8, 10*, 16*, default: 4*** 2603 2604'COMPLEX' 2605 4, 8, 10*, 16*, default: 4*** 2606 2607'DOUBLE PRECISION' 2608 4, 8, 10*, 16*, default: 8*** 2609 2610'CHARACTER' 2611 1, 4, default: 1 2612 2613* not available on all systems 2614** unless '-fdefault-integer-8' is used 2615*** unless '-fdefault-real-8' is used (see *note Fortran Dialect 2616Options::) 2617 2618The 'KIND' value matches the storage size in bytes, except for 'COMPLEX' 2619where the storage size is twice as much (or both real and imaginary part 2620are a real value of the given size). It is recommended to use the *note 2621SELECTED_CHAR_KIND::, *note SELECTED_INT_KIND:: and *note 2622SELECTED_REAL_KIND:: intrinsics or the 'INT8', 'INT16', 'INT32', 2623'INT64', 'REAL32', 'REAL64', and 'REAL128' parameters of the 2624'ISO_FORTRAN_ENV' module instead of the concrete values. The available 2625kind parameters can be found in the constant arrays 'CHARACTER_KINDS', 2626'INTEGER_KINDS', 'LOGICAL_KINDS' and 'REAL_KINDS' in the *note 2627ISO_FORTRAN_ENV:: module. For C interoperability, the kind parameters 2628of the *note ISO_C_BINDING:: module should be used. 2629 2630 2631File: gfortran.info, Node: Internal representation of LOGICAL variables, Next: Evaluation of logical expressions, Prev: KIND Type Parameters, Up: Compiler Characteristics 2632 26335.2 Internal representation of LOGICAL variables 2634================================================ 2635 2636The Fortran standard does not specify how variables of 'LOGICAL' type 2637are represented, beyond requiring that 'LOGICAL' variables of default 2638kind have the same storage size as default 'INTEGER' and 'REAL' 2639variables. The GNU Fortran internal representation is as follows. 2640 2641 A 'LOGICAL(KIND=N)' variable is represented as an 'INTEGER(KIND=N)' 2642variable, however, with only two permissible values: '1' for '.TRUE.' 2643and '0' for '.FALSE.'. Any other integer value results in undefined 2644behavior. 2645 2646 See also *note Argument passing conventions:: and *note 2647Interoperability with C::. 2648 2649 2650File: gfortran.info, Node: Evaluation of logical expressions, Next: MAX and MIN intrinsics with REAL NaN arguments, Prev: Internal representation of LOGICAL variables, Up: Compiler Characteristics 2651 26525.3 Evaluation of logical expressions 2653===================================== 2654 2655The Fortran standard does not require the compiler to evaluate all parts 2656of an expression, if they do not contribute to the final result. For 2657logical expressions with '.AND.' or '.OR.' operators, in particular, GNU 2658Fortran will optimize out function calls (even to impure functions) if 2659the result of the expression can be established without them. However, 2660since not all compilers do that, and such an optimization can 2661potentially modify the program flow and subsequent results, GNU Fortran 2662throws warnings for such situations with the '-Wfunction-elimination' 2663flag. 2664 2665 2666File: gfortran.info, Node: MAX and MIN intrinsics with REAL NaN arguments, Next: Thread-safety of the runtime library, Prev: Evaluation of logical expressions, Up: Compiler Characteristics 2667 26685.4 MAX and MIN intrinsics with REAL NaN arguments 2669================================================== 2670 2671The Fortran standard does not specify what the result of the 'MAX' and 2672'MIN' intrinsics are if one of the arguments is a 'NaN'. Accordingly, 2673the GNU Fortran compiler does not specify that either, as this allows 2674for faster and more compact code to be generated. If the programmer 2675wishes to take some specific action in case one of the arguments is a 2676'NaN', it is necessary to explicitly test the arguments before calling 2677'MAX' or 'MIN', e.g. with the 'IEEE_IS_NAN' function from the intrinsic 2678module 'IEEE_ARITHMETIC'. 2679 2680 2681File: gfortran.info, Node: Thread-safety of the runtime library, Next: Data consistency and durability, Prev: MAX and MIN intrinsics with REAL NaN arguments, Up: Compiler Characteristics 2682 26835.5 Thread-safety of the runtime library 2684======================================== 2685 2686GNU Fortran can be used in programs with multiple threads, e.g. by using 2687OpenMP, by calling OS thread handling functions via the 'ISO_C_BINDING' 2688facility, or by GNU Fortran compiled library code being called from a 2689multi-threaded program. 2690 2691 The GNU Fortran runtime library, ('libgfortran'), supports being 2692called concurrently from multiple threads with the following exceptions. 2693 2694 During library initialization, the C 'getenv' function is used, which 2695need not be thread-safe. Similarly, the 'getenv' function is used to 2696implement the 'GET_ENVIRONMENT_VARIABLE' and 'GETENV' intrinsics. It is 2697the responsibility of the user to ensure that the environment is not 2698being updated concurrently when any of these actions are taking place. 2699 2700 The 'EXECUTE_COMMAND_LINE' and 'SYSTEM' intrinsics are implemented 2701with the 'system' function, which need not be thread-safe. It is the 2702responsibility of the user to ensure that 'system' is not called 2703concurrently. 2704 2705 For platforms not supporting thread-safe POSIX functions, further 2706functionality might not be thread-safe. For details, please consult the 2707documentation for your operating system. 2708 2709 The GNU Fortran runtime library uses various C library functions that 2710depend on the locale, such as 'strtod' and 'snprintf'. In order to work 2711correctly in locale-aware programs that set the locale using 2712'setlocale', the locale is reset to the default "C" locale while 2713executing a formatted 'READ' or 'WRITE' statement. On targets 2714supporting the POSIX 2008 per-thread locale functions (e.g. 2715'newlocale', 'uselocale', 'freelocale'), these are used and thus the 2716global locale set using 'setlocale' or the per-thread locales in other 2717threads are not affected. However, on targets lacking this 2718functionality, the global LC_NUMERIC locale is set to "C" during the 2719formatted I/O. Thus, on such targets it's not safe to call 'setlocale' 2720concurrently from another thread while a Fortran formatted I/O operation 2721is in progress. Also, other threads doing something dependent on the 2722LC_NUMERIC locale might not work correctly if a formatted I/O operation 2723is in progress in another thread. 2724 2725 2726File: gfortran.info, Node: Data consistency and durability, Next: Files opened without an explicit ACTION= specifier, Prev: Thread-safety of the runtime library, Up: Compiler Characteristics 2727 27285.6 Data consistency and durability 2729=================================== 2730 2731This section contains a brief overview of data and metadata consistency 2732and durability issues when doing I/O. 2733 2734 With respect to durability, GNU Fortran makes no effort to ensure 2735that data is committed to stable storage. If this is required, the GNU 2736Fortran programmer can use the intrinsic 'FNUM' to retrieve the low 2737level file descriptor corresponding to an open Fortran unit. Then, 2738using e.g. the 'ISO_C_BINDING' feature, one can call the underlying 2739system call to flush dirty data to stable storage, such as 'fsync' on 2740POSIX, '_commit' on MingW, or 'fcntl(fd, F_FULLSYNC, 0)' on Mac OS X. 2741The following example shows how to call fsync: 2742 2743 ! Declare the interface for POSIX fsync function 2744 interface 2745 function fsync (fd) bind(c,name="fsync") 2746 use iso_c_binding, only: c_int 2747 integer(c_int), value :: fd 2748 integer(c_int) :: fsync 2749 end function fsync 2750 end interface 2751 2752 ! Variable declaration 2753 integer :: ret 2754 2755 ! Opening unit 10 2756 open (10,file="foo") 2757 2758 ! ... 2759 ! Perform I/O on unit 10 2760 ! ... 2761 2762 ! Flush and sync 2763 flush(10) 2764 ret = fsync(fnum(10)) 2765 2766 ! Handle possible error 2767 if (ret /= 0) stop "Error calling FSYNC" 2768 2769 With respect to consistency, for regular files GNU Fortran uses 2770buffered I/O in order to improve performance. This buffer is flushed 2771automatically when full and in some other situations, e.g. when closing 2772a unit. It can also be explicitly flushed with the 'FLUSH' statement. 2773Also, the buffering can be turned off with the 'GFORTRAN_UNBUFFERED_ALL' 2774and 'GFORTRAN_UNBUFFERED_PRECONNECTED' environment variables. Special 2775files, such as terminals and pipes, are always unbuffered. Sometimes, 2776however, further things may need to be done in order to allow other 2777processes to see data that GNU Fortran has written, as follows. 2778 2779 The Windows platform supports a relaxed metadata consistency model, 2780where file metadata is written to the directory lazily. This means 2781that, for instance, the 'dir' command can show a stale size for a file. 2782One can force a directory metadata update by closing the unit, or by 2783calling '_commit' on the file descriptor. Note, though, that '_commit' 2784will force all dirty data to stable storage, which is often a very slow 2785operation. 2786 2787 The Network File System (NFS) implements a relaxed consistency model 2788called open-to-close consistency. Closing a file forces dirty data and 2789metadata to be flushed to the server, and opening a file forces the 2790client to contact the server in order to revalidate cached data. 2791'fsync' will also force a flush of dirty data and metadata to the 2792server. Similar to 'open' and 'close', acquiring and releasing 'fcntl' 2793file locks, if the server supports them, will also force cache 2794validation and flushing dirty data and metadata. 2795 2796 2797File: gfortran.info, Node: Files opened without an explicit ACTION= specifier, Next: File operations on symbolic links, Prev: Data consistency and durability, Up: Compiler Characteristics 2798 27995.7 Files opened without an explicit ACTION= specifier 2800====================================================== 2801 2802The Fortran standard says that if an 'OPEN' statement is executed 2803without an explicit 'ACTION=' specifier, the default value is processor 2804dependent. GNU Fortran behaves as follows: 2805 2806 1. Attempt to open the file with 'ACTION='READWRITE'' 2807 2. If that fails, try to open with 'ACTION='READ'' 2808 3. If that fails, try to open with 'ACTION='WRITE'' 2809 4. If that fails, generate an error 2810 2811 2812File: gfortran.info, Node: File operations on symbolic links, Next: File format of unformatted sequential files, Prev: Files opened without an explicit ACTION= specifier, Up: Compiler Characteristics 2813 28145.8 File operations on symbolic links 2815===================================== 2816 2817This section documents the behavior of GNU Fortran for file operations 2818on symbolic links, on systems that support them. 2819 2820 * Results of INQUIRE statements of the "inquire by file" form will 2821 relate to the target of the symbolic link. For example, 2822 'INQUIRE(FILE="foo",EXIST=ex)' will set EX to .TRUE. if FOO is a 2823 symbolic link pointing to an existing file, and .FALSE. if FOO 2824 points to an non-existing file ("dangling" symbolic link). 2825 2826 * Using the 'OPEN' statement with a 'STATUS="NEW"' specifier on a 2827 symbolic link will result in an error condition, whether the 2828 symbolic link points to an existing target or is dangling. 2829 2830 * If a symbolic link was connected, using the 'CLOSE' statement with 2831 a 'STATUS="DELETE"' specifier will cause the symbolic link itself 2832 to be deleted, not its target. 2833 2834 2835File: gfortran.info, Node: File format of unformatted sequential files, Next: Asynchronous I/O, Prev: File operations on symbolic links, Up: Compiler Characteristics 2836 28375.9 File format of unformatted sequential files 2838=============================================== 2839 2840Unformatted sequential files are stored as logical records using record 2841markers. Each logical record consists of one of more subrecords. 2842 2843 Each subrecord consists of a leading record marker, the data written 2844by the user program, and a trailing record marker. The record markers 2845are four-byte integers by default, and eight-byte integers if the 2846'-fmax-subrecord-length=8' option (which exists for backwards 2847compability only) is in effect. 2848 2849 The representation of the record markers is that of unformatted files 2850given with the '-fconvert' option, the *note CONVERT specifier:: in an 2851open statement or the *note GFORTRAN_CONVERT_UNIT:: environment 2852variable. 2853 2854 The maximum number of bytes of user data in a subrecord is 2147483639 2855(2 GiB - 9) for a four-byte record marker. This limit can be lowered 2856with the '-fmax-subrecord-length' option, altough this is rarely useful. 2857If the length of a logical record exceeds this limit, the data is 2858distributed among several subrecords. 2859 2860 The absolute of the number stored in the record markers is the number 2861of bytes of user data in the corresponding subrecord. If the leading 2862record marker of a subrecord contains a negative number, another 2863subrecord follows the current one. If the trailing record marker 2864contains a negative number, then there is a preceding subrecord. 2865 2866 In the most simple case, with only one subrecord per logical record, 2867both record markers contain the number of bytes of user data in the 2868record. 2869 2870 The format for unformatted sequential data can be duplicated using 2871unformatted stream, as shown in the example program for an unformatted 2872record containing a single subrecord: 2873 2874 program main 2875 use iso_fortran_env, only: int32 2876 implicit none 2877 integer(int32) :: i 2878 real, dimension(10) :: a, b 2879 call random_number(a) 2880 open (10,file='test.dat',form='unformatted',access='stream') 2881 inquire (iolength=i) a 2882 write (10) i, a, i 2883 close (10) 2884 open (10,file='test.dat',form='unformatted') 2885 read (10) b 2886 if (all (a == b)) print *,'success!' 2887 end program main 2888 2889 2890File: gfortran.info, Node: Asynchronous I/O, Prev: File format of unformatted sequential files, Up: Compiler Characteristics 2891 28925.10 Asynchronous I/O 2893===================== 2894 2895Asynchronous I/O is supported if the program is linked against the POSIX 2896thread library. If that is not the case, all I/O is performed as 2897synchronous. On systems which do not support pthread condition 2898variables, such as AIX, I/O is also performed as synchronous. 2899 2900 On some systems, such as Darwin or Solaris, the POSIX thread library 2901is always linked in, so asynchronous I/O is always performed. On other 2902sytems, such as Linux, it is necessary to specify '-pthread', 2903'-lpthread' or '-fopenmp' during the linking step. 2904 2905 2906File: gfortran.info, Node: Extensions, Next: Mixed-Language Programming, Prev: Compiler Characteristics, Up: Top 2907 29086 Extensions 2909************ 2910 2911The two sections below detail the extensions to standard Fortran that 2912are implemented in GNU Fortran, as well as some of the popular or 2913historically important extensions that are not (or not yet) implemented. 2914For the latter case, we explain the alternatives available to GNU 2915Fortran users, including replacement by standard-conforming code or GNU 2916extensions. 2917 2918* Menu: 2919 2920* Extensions implemented in GNU Fortran:: 2921* Extensions not implemented in GNU Fortran:: 2922 2923 2924File: gfortran.info, Node: Extensions implemented in GNU Fortran, Next: Extensions not implemented in GNU Fortran, Up: Extensions 2925 29266.1 Extensions implemented in GNU Fortran 2927========================================= 2928 2929GNU Fortran implements a number of extensions over standard Fortran. 2930This chapter contains information on their syntax and meaning. There 2931are currently two categories of GNU Fortran extensions, those that 2932provide functionality beyond that provided by any standard, and those 2933that are supported by GNU Fortran purely for backward compatibility with 2934legacy compilers. By default, '-std=gnu' allows the compiler to accept 2935both types of extensions, but to warn about the use of the latter. 2936Specifying either '-std=f95', '-std=f2003', '-std=f2008', or 2937'-std=f2018' disables both types of extensions, and '-std=legacy' allows 2938both without warning. The special compile flag '-fdec' enables 2939additional compatibility extensions along with those enabled by 2940'-std=legacy'. 2941 2942* Menu: 2943 2944* Old-style kind specifications:: 2945* Old-style variable initialization:: 2946* Extensions to namelist:: 2947* X format descriptor without count field:: 2948* Commas in FORMAT specifications:: 2949* Missing period in FORMAT specifications:: 2950* Default widths for F, G and I format descriptors:: 2951* I/O item lists:: 2952* Q exponent-letter:: 2953* BOZ literal constants:: 2954* Real array indices:: 2955* Unary operators:: 2956* Implicitly convert LOGICAL and INTEGER values:: 2957* Hollerith constants support:: 2958* Character conversion:: 2959* Cray pointers:: 2960* CONVERT specifier:: 2961* OpenMP:: 2962* OpenACC:: 2963* Argument list functions:: 2964* Read/Write after EOF marker:: 2965* STRUCTURE and RECORD:: 2966* UNION and MAP:: 2967* Type variants for integer intrinsics:: 2968* AUTOMATIC and STATIC attributes:: 2969* Extended math intrinsics:: 2970* Form feed as whitespace:: 2971* TYPE as an alias for PRINT:: 2972* %LOC as an rvalue:: 2973* .XOR. operator:: 2974* Bitwise logical operators:: 2975* Extended I/O specifiers:: 2976* Legacy PARAMETER statements:: 2977* Default exponents:: 2978 2979 2980File: gfortran.info, Node: Old-style kind specifications, Next: Old-style variable initialization, Up: Extensions implemented in GNU Fortran 2981 29826.1.1 Old-style kind specifications 2983----------------------------------- 2984 2985GNU Fortran allows old-style kind specifications in declarations. These 2986look like: 2987 TYPESPEC*size x,y,z 2988where 'TYPESPEC' is a basic type ('INTEGER', 'REAL', etc.), and where 2989'size' is a byte count corresponding to the storage size of a valid kind 2990for that type. (For 'COMPLEX' variables, 'size' is the total size of 2991the real and imaginary parts.) The statement then declares 'x', 'y' and 2992'z' to be of type 'TYPESPEC' with the appropriate kind. This is 2993equivalent to the standard-conforming declaration 2994 TYPESPEC(k) x,y,z 2995where 'k' is the kind parameter suitable for the intended precision. As 2996kind parameters are implementation-dependent, use the 'KIND', 2997'SELECTED_INT_KIND' and 'SELECTED_REAL_KIND' intrinsics to retrieve the 2998correct value, for instance 'REAL*8 x' can be replaced by: 2999 INTEGER, PARAMETER :: dbl = KIND(1.0d0) 3000 REAL(KIND=dbl) :: x 3001 3002 3003File: gfortran.info, Node: Old-style variable initialization, Next: Extensions to namelist, Prev: Old-style kind specifications, Up: Extensions implemented in GNU Fortran 3004 30056.1.2 Old-style variable initialization 3006--------------------------------------- 3007 3008GNU Fortran allows old-style initialization of variables of the form: 3009 INTEGER i/1/,j/2/ 3010 REAL x(2,2) /3*0.,1./ 3011 The syntax for the initializers is as for the 'DATA' statement, but 3012unlike in a 'DATA' statement, an initializer only applies to the 3013variable immediately preceding the initialization. In other words, 3014something like 'INTEGER I,J/2,3/' is not valid. This style of 3015initialization is only allowed in declarations without double colons 3016('::'); the double colons were introduced in Fortran 90, which also 3017introduced a standard syntax for initializing variables in type 3018declarations. 3019 3020 Examples of standard-conforming code equivalent to the above example 3021are: 3022 ! Fortran 90 3023 INTEGER :: i = 1, j = 2 3024 REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x)) 3025 ! Fortran 77 3026 INTEGER i, j 3027 REAL x(2,2) 3028 DATA i/1/, j/2/, x/3*0.,1./ 3029 3030 Note that variables which are explicitly initialized in declarations 3031or in 'DATA' statements automatically acquire the 'SAVE' attribute. 3032 3033 3034File: gfortran.info, Node: Extensions to namelist, Next: X format descriptor without count field, Prev: Old-style variable initialization, Up: Extensions implemented in GNU Fortran 3035 30366.1.3 Extensions to namelist 3037---------------------------- 3038 3039GNU Fortran fully supports the Fortran 95 standard for namelist I/O 3040including array qualifiers, substrings and fully qualified derived 3041types. The output from a namelist write is compatible with namelist 3042read. The output has all names in upper case and indentation to column 30431 after the namelist name. Two extensions are permitted: 3044 3045 Old-style use of '$' instead of '&' 3046 $MYNML 3047 X(:)%Y(2) = 1.0 2.0 3.0 3048 CH(1:4) = "abcd" 3049 $END 3050 3051 It should be noted that the default terminator is '/' rather than 3052'&END'. 3053 3054 Querying of the namelist when inputting from stdin. After at least 3055one space, entering '?' sends to stdout the namelist name and the names 3056of the variables in the namelist: 3057 ? 3058 3059 &mynml 3060 x 3061 x%y 3062 ch 3063 &end 3064 3065 Entering '=?' outputs the namelist to stdout, as if 'WRITE(*,NML = 3066mynml)' had been called: 3067 =? 3068 3069 &MYNML 3070 X(1)%Y= 0.000000 , 1.000000 , 0.000000 , 3071 X(2)%Y= 0.000000 , 2.000000 , 0.000000 , 3072 X(3)%Y= 0.000000 , 3.000000 , 0.000000 , 3073 CH=abcd, / 3074 3075 To aid this dialog, when input is from stdin, errors send their 3076messages to stderr and execution continues, even if 'IOSTAT' is set. 3077 3078 'PRINT' namelist is permitted. This causes an error if '-std=f95' is 3079used. 3080 PROGRAM test_print 3081 REAL, dimension (4) :: x = (/1.0, 2.0, 3.0, 4.0/) 3082 NAMELIST /mynml/ x 3083 PRINT mynml 3084 END PROGRAM test_print 3085 3086 Expanded namelist reads are permitted. This causes an error if 3087'-std=f95' is used. In the following example, the first element of the 3088array will be given the value 0.00 and the two succeeding elements will 3089be given the values 1.00 and 2.00. 3090 &MYNML 3091 X(1,1) = 0.00 , 1.00 , 2.00 3092 / 3093 3094 When writing a namelist, if no 'DELIM=' is specified, by default a 3095double quote is used to delimit character strings. If -std=F95, F2003, 3096or F2008, etc, the delim status is set to 'none'. Defaulting to quotes 3097ensures that namelists with character strings can be subsequently read 3098back in accurately. 3099 3100 3101File: gfortran.info, Node: X format descriptor without count field, Next: Commas in FORMAT specifications, Prev: Extensions to namelist, Up: Extensions implemented in GNU Fortran 3102 31036.1.4 'X' format descriptor without count field 3104----------------------------------------------- 3105 3106To support legacy codes, GNU Fortran permits the count field of the 'X' 3107edit descriptor in 'FORMAT' statements to be omitted. When omitted, the 3108count is implicitly assumed to be one. 3109 3110 PRINT 10, 2, 3 3111 10 FORMAT (I1, X, I1) 3112 3113 3114File: 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 3115 31166.1.5 Commas in 'FORMAT' specifications 3117--------------------------------------- 3118 3119To support legacy codes, GNU Fortran allows the comma separator to be 3120omitted immediately before and after character string edit descriptors 3121in 'FORMAT' statements. A comma with no following format decriptor is 3122permited if the '-fdec-blank-format-item' is given on the command line. 3123This is considered non-conforming code and is discouraged. 3124 3125 PRINT 10, 2, 3 3126 10 FORMAT ('FOO='I1' BAR='I2) 3127 print 20, 5, 6 3128 20 FORMAT (I3, I3,) 3129 3130 3131File: gfortran.info, Node: Missing period in FORMAT specifications, Next: Default widths for F, G and I format descriptors, Prev: Commas in FORMAT specifications, Up: Extensions implemented in GNU Fortran 3132 31336.1.6 Missing period in 'FORMAT' specifications 3134----------------------------------------------- 3135 3136To support legacy codes, GNU Fortran allows missing periods in format 3137specifications if and only if '-std=legacy' is given on the command 3138line. This is considered non-conforming code and is discouraged. 3139 3140 REAL :: value 3141 READ(*,10) value 3142 10 FORMAT ('F4') 3143 3144 3145File: gfortran.info, Node: Default widths for F, G and I format descriptors, Next: I/O item lists, Prev: Missing period in FORMAT specifications, Up: Extensions implemented in GNU Fortran 3146 31476.1.7 Default widths for 'F', 'G' and 'I' format descriptors 3148------------------------------------------------------------ 3149 3150To support legacy codes, GNU Fortran allows width to be omitted from 3151format specifications if and only if '-fdec-format-defaults' is given on 3152the command line. Default widths will be used. This is considered 3153non-conforming code and is discouraged. 3154 3155 REAL :: value1 3156 INTEGER :: value2 3157 WRITE(*,10) value1, value1, value2 3158 10 FORMAT ('F, G, I') 3159 3160 3161File: gfortran.info, Node: I/O item lists, Next: Q exponent-letter, Prev: Default widths for F, G and I format descriptors, Up: Extensions implemented in GNU Fortran 3162 31636.1.8 I/O item lists 3164-------------------- 3165 3166To support legacy codes, GNU Fortran allows the input item list of the 3167'READ' statement, and the output item lists of the 'WRITE' and 'PRINT' 3168statements, to start with a comma. 3169 3170 3171File: gfortran.info, Node: Q exponent-letter, Next: BOZ literal constants, Prev: I/O item lists, Up: Extensions implemented in GNU Fortran 3172 31736.1.9 'Q' exponent-letter 3174------------------------- 3175 3176GNU Fortran accepts real literal constants with an exponent-letter of 3177'Q', for example, '1.23Q45'. The constant is interpreted as a 3178'REAL(16)' entity on targets that support this type. If the target does 3179not support 'REAL(16)' but has a 'REAL(10)' type, then the 3180real-literal-constant will be interpreted as a 'REAL(10)' entity. In 3181the absence of 'REAL(16)' and 'REAL(10)', an error will occur. 3182 3183 3184File: gfortran.info, Node: BOZ literal constants, Next: Real array indices, Prev: Q exponent-letter, Up: Extensions implemented in GNU Fortran 3185 31866.1.10 BOZ literal constants 3187---------------------------- 3188 3189Besides decimal constants, Fortran also supports binary ('b'), octal 3190('o') and hexadecimal ('z') integer constants. The syntax is: 'prefix 3191quote digits quote', were the prefix is either 'b', 'o' or 'z', quote is 3192either ''' or '"' and the digits are '0' or '1' for binary, between '0' 3193and '7' for octal, and between '0' and 'F' for hexadecimal. (Example: 3194'b'01011101''.) 3195 3196 Up to Fortran 95, BOZ literal constants were only allowed to 3197initialize integer variables in DATA statements. Since Fortran 2003 BOZ 3198literal constants are also allowed as actual arguments to the 'REAL', 3199'DBLE', 'INT' and 'CMPLX' intrinsic functions. The BOZ literal constant 3200is simply a string of bits, which is padded or truncated as needed, 3201during conversion to a numeric type. The Fortran standard states that 3202the treatment of the sign bit is processor dependent. Gfortran 3203interprets the sign bit as a user would expect. 3204 3205 As a deprecated extension, GNU Fortran allows hexadecimal BOZ literal 3206constants to be specified using the 'X' prefix. That the BOZ literal 3207constant can also be specified by adding a suffix to the string, for 3208example, 'Z'ABC'' and ''ABC'X' are equivalent. Additionally, as 3209extension, BOZ literals are permitted in some contexts outside of 'DATA' 3210and the intrinsic functions listed in the Fortran standard. Use 3211'-fallow-invalid-boz' to enable the extension. 3212 3213 3214File: gfortran.info, Node: Real array indices, Next: Unary operators, Prev: BOZ literal constants, Up: Extensions implemented in GNU Fortran 3215 32166.1.11 Real array indices 3217------------------------- 3218 3219As an extension, GNU Fortran allows the use of 'REAL' expressions or 3220variables as array indices. 3221 3222 3223File: gfortran.info, Node: Unary operators, Next: Implicitly convert LOGICAL and INTEGER values, Prev: Real array indices, Up: Extensions implemented in GNU Fortran 3224 32256.1.12 Unary operators 3226---------------------- 3227 3228As an extension, GNU Fortran allows unary plus and unary minus operators 3229to appear as the second operand of binary arithmetic operators without 3230the need for parenthesis. 3231 3232 X = Y * -Z 3233 3234 3235File: gfortran.info, Node: Implicitly convert LOGICAL and INTEGER values, Next: Hollerith constants support, Prev: Unary operators, Up: Extensions implemented in GNU Fortran 3236 32376.1.13 Implicitly convert 'LOGICAL' and 'INTEGER' values 3238-------------------------------------------------------- 3239 3240As an extension for backwards compatibility with other compilers, GNU 3241Fortran allows the implicit conversion of 'LOGICAL' values to 'INTEGER' 3242values and vice versa. When converting from a 'LOGICAL' to an 3243'INTEGER', '.FALSE.' is interpreted as zero, and '.TRUE.' is interpreted 3244as one. When converting from 'INTEGER' to 'LOGICAL', the value zero is 3245interpreted as '.FALSE.' and any nonzero value is interpreted as 3246'.TRUE.'. 3247 3248 LOGICAL :: l 3249 l = 1 3250 INTEGER :: i 3251 i = .TRUE. 3252 3253 However, there is no implicit conversion of 'INTEGER' values in 3254'if'-statements, nor of 'LOGICAL' or 'INTEGER' values in I/O operations. 3255 3256 3257File: gfortran.info, Node: Hollerith constants support, Next: Character conversion, Prev: Implicitly convert LOGICAL and INTEGER values, Up: Extensions implemented in GNU Fortran 3258 32596.1.14 Hollerith constants support 3260---------------------------------- 3261 3262GNU Fortran supports Hollerith constants in assignments, 'DATA' 3263statements, function and subroutine arguments. A Hollerith constant is 3264written as a string of characters preceded by an integer constant 3265indicating the character count, and the letter 'H' or 'h', and stored in 3266bytewise fashion in a numeric ('INTEGER', 'REAL', or 'COMPLEX'), 3267'LOGICAL' or 'CHARACTER' variable. The constant will be padded with 3268spaces or truncated to fit the size of the variable in which it is 3269stored. 3270 3271 Examples of valid uses of Hollerith constants: 3272 complex*16 x(2) 3273 data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/ 3274 x(1) = 16HABCDEFGHIJKLMNOP 3275 call foo (4h abc) 3276 3277 Examples of Hollerith constants: 3278 integer*4 a 3279 a = 0H ! Invalid, at least one character is needed. 3280 a = 4HAB12 ! Valid 3281 a = 8H12345678 ! Valid, but the Hollerith constant will be truncated. 3282 a = 3Hxyz ! Valid, but the Hollerith constant will be padded. 3283 3284 In general, Hollerith constants were used to provide a rudimentary 3285facility for handling character strings in early Fortran compilers, 3286prior to the introduction of 'CHARACTER' variables in Fortran 77; in 3287those cases, the standard-compliant equivalent is to convert the program 3288to use proper character strings. On occasion, there may be a case where 3289the intent is specifically to initialize a numeric variable with a given 3290byte sequence. In these cases, the same result can be obtained by using 3291the 'TRANSFER' statement, as in this example. 3292 integer(kind=4) :: a 3293 a = transfer ("abcd", a) ! equivalent to: a = 4Habcd 3294 3295 The use of the '-fdec' option extends support of Hollerith constants 3296to comparisons: 3297 integer*4 a 3298 a = 4hABCD 3299 if (a .ne. 4habcd) then 3300 write(*,*) "no match" 3301 end if 3302 3303 Supported types are numeric ('INTEGER', 'REAL', or 'COMPLEX'), and 3304'CHARACTER'. 3305 3306 3307File: gfortran.info, Node: Character conversion, Next: Cray pointers, Prev: Hollerith constants support, Up: Extensions implemented in GNU Fortran 3308 33096.1.15 Character conversion 3310--------------------------- 3311 3312Allowing character literals to be used in a similar way to Hollerith 3313constants is a non-standard extension. This feature is enabled using 3314-fdec-char-conversions and only applies to character literals of 3315'kind=1'. 3316 3317 Character literals can be used in 'DATA' statements and assignments 3318with numeric ('INTEGER', 'REAL', or 'COMPLEX') or 'LOGICAL' variables. 3319Like Hollerith constants they are copied byte-wise fashion. The 3320constant will be padded with spaces or truncated to fit the size of the 3321variable in which it is stored. 3322 3323 Examples: 3324 integer*4 x 3325 data x / 'abcd' / 3326 3327 x = 'A' ! Will be padded. 3328 x = 'ab1234' ! Will be truncated. 3329 3330 3331File: gfortran.info, Node: Cray pointers, Next: CONVERT specifier, Prev: Character conversion, Up: Extensions implemented in GNU Fortran 3332 33336.1.16 Cray pointers 3334-------------------- 3335 3336Cray pointers are part of a non-standard extension that provides a 3337C-like pointer in Fortran. This is accomplished through a pair of 3338variables: an integer "pointer" that holds a memory address, and a 3339"pointee" that is used to dereference the pointer. 3340 3341 Pointer/pointee pairs are declared in statements of the form: 3342 pointer ( <pointer> , <pointee> ) 3343 or, 3344 pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ... 3345 The pointer is an integer that is intended to hold a memory address. 3346The pointee may be an array or scalar. If an assumed-size array is 3347permitted within the scoping unit, a pointee can be an assumed-size 3348array. That is, the last dimension may be left unspecified by using a 3349'*' in place of a value. A pointee cannot be an assumed shape array. 3350No space is allocated for the pointee. 3351 3352 The pointee may have its type declared before or after the pointer 3353statement, and its array specification (if any) may be declared before, 3354during, or after the pointer statement. The pointer may be declared as 3355an integer prior to the pointer statement. However, some machines have 3356default integer sizes that are different than the size of a pointer, and 3357so the following code is not portable: 3358 integer ipt 3359 pointer (ipt, iarr) 3360 If a pointer is declared with a kind that is too small, the compiler 3361will issue a warning; the resulting binary will probably not work 3362correctly, because the memory addresses stored in the pointers may be 3363truncated. It is safer to omit the first line of the above example; if 3364explicit declaration of ipt's type is omitted, then the compiler will 3365ensure that ipt is an integer variable large enough to hold a pointer. 3366 3367 Pointer arithmetic is valid with Cray pointers, but it is not the 3368same as C pointer arithmetic. Cray pointers are just ordinary integers, 3369so the user is responsible for determining how many bytes to add to a 3370pointer in order to increment it. Consider the following example: 3371 real target(10) 3372 real pointee(10) 3373 pointer (ipt, pointee) 3374 ipt = loc (target) 3375 ipt = ipt + 1 3376 The last statement does not set 'ipt' to the address of 'target(1)', 3377as it would in C pointer arithmetic. Adding '1' to 'ipt' just adds one 3378byte to the address stored in 'ipt'. 3379 3380 Any expression involving the pointee will be translated to use the 3381value stored in the pointer as the base address. 3382 3383 To get the address of elements, this extension provides an intrinsic 3384function 'LOC()'. The 'LOC()' function is equivalent to the '&' 3385operator in C, except the address is cast to an integer type: 3386 real ar(10) 3387 pointer(ipt, arpte(10)) 3388 real arpte 3389 ipt = loc(ar) ! Makes arpte is an alias for ar 3390 arpte(1) = 1.0 ! Sets ar(1) to 1.0 3391 The pointer can also be set by a call to the 'MALLOC' intrinsic (see 3392*note MALLOC::). 3393 3394 Cray pointees often are used to alias an existing variable. For 3395example: 3396 integer target(10) 3397 integer iarr(10) 3398 pointer (ipt, iarr) 3399 ipt = loc(target) 3400 As long as 'ipt' remains unchanged, 'iarr' is now an alias for 3401'target'. The optimizer, however, will not detect this aliasing, so it 3402is unsafe to use 'iarr' and 'target' simultaneously. Using a pointee in 3403any way that violates the Fortran aliasing rules or assumptions is 3404illegal. It is the user's responsibility to avoid doing this; the 3405compiler works under the assumption that no such aliasing occurs. 3406 3407 Cray pointers will work correctly when there is no aliasing (i.e., 3408when they are used to access a dynamically allocated block of memory), 3409and also in any routine where a pointee is used, but any variable with 3410which it shares storage is not used. Code that violates these rules may 3411not run as the user intends. This is not a bug in the optimizer; any 3412code that violates the aliasing rules is illegal. (Note that this is 3413not unique to GNU Fortran; any Fortran compiler that supports Cray 3414pointers will "incorrectly" optimize code with illegal aliasing.) 3415 3416 There are a number of restrictions on the attributes that can be 3417applied to Cray pointers and pointees. Pointees may not have the 3418'ALLOCATABLE', 'INTENT', 'OPTIONAL', 'DUMMY', 'TARGET', 'INTRINSIC', or 3419'POINTER' attributes. Pointers may not have the 'DIMENSION', 'POINTER', 3420'TARGET', 'ALLOCATABLE', 'EXTERNAL', or 'INTRINSIC' attributes, nor may 3421they be function results. Pointees may not occur in more than one 3422pointer statement. A pointee cannot be a pointer. Pointees cannot 3423occur in equivalence, common, or data statements. 3424 3425 A Cray pointer may also point to a function or a subroutine. For 3426example, the following excerpt is valid: 3427 implicit none 3428 external sub 3429 pointer (subptr,subpte) 3430 external subpte 3431 subptr = loc(sub) 3432 call subpte() 3433 [...] 3434 subroutine sub 3435 [...] 3436 end subroutine sub 3437 3438 A pointer may be modified during the course of a program, and this 3439will change the location to which the pointee refers. However, when 3440pointees are passed as arguments, they are treated as ordinary variables 3441in the invoked function. Subsequent changes to the pointer will not 3442change the base address of the array that was passed. 3443 3444 3445File: gfortran.info, Node: CONVERT specifier, Next: OpenMP, Prev: Cray pointers, Up: Extensions implemented in GNU Fortran 3446 34476.1.17 'CONVERT' specifier 3448-------------------------- 3449 3450GNU Fortran allows the conversion of unformatted data between little- 3451and big-endian representation to facilitate moving of data between 3452different systems. The conversion can be indicated with the 'CONVERT' 3453specifier on the 'OPEN' statement. *Note GFORTRAN_CONVERT_UNIT::, for 3454an alternative way of specifying the data format via an environment 3455variable. 3456 3457 Valid values for 'CONVERT' are: 3458 'CONVERT='NATIVE'' Use the native format. This is the default. 3459 'CONVERT='SWAP'' Swap between little- and big-endian. 3460 'CONVERT='LITTLE_ENDIAN'' Use the little-endian representation for 3461 unformatted files. 3462 'CONVERT='BIG_ENDIAN'' Use the big-endian representation for 3463 unformatted files. 3464 3465 Using the option could look like this: 3466 open(file='big.dat',form='unformatted',access='sequential', & 3467 convert='big_endian') 3468 3469 The value of the conversion can be queried by using 3470'INQUIRE(CONVERT=ch)'. The values returned are ''BIG_ENDIAN'' and 3471''LITTLE_ENDIAN''. 3472 3473 'CONVERT' works between big- and little-endian for 'INTEGER' values 3474of all supported kinds and for 'REAL' on IEEE systems of kinds 4 and 8. 3475Conversion between different "extended double" types on different 3476architectures such as m68k and x86_64, which GNU Fortran supports as 3477'REAL(KIND=10)' and 'REAL(KIND=16)', will probably not work. 3478 3479 _Note that the values specified via the GFORTRAN_CONVERT_UNIT 3480environment variable will override the CONVERT specifier in the open 3481statement_. This is to give control over data formats to users who do 3482not have the source code of their program available. 3483 3484 Using anything but the native representation for unformatted data 3485carries a significant speed overhead. If speed in this area matters to 3486you, it is best if you use this only for data that needs to be portable. 3487 3488 3489File: gfortran.info, Node: OpenMP, Next: OpenACC, Prev: CONVERT specifier, Up: Extensions implemented in GNU Fortran 3490 34916.1.18 OpenMP 3492------------- 3493 3494OpenMP (Open Multi-Processing) is an application programming interface 3495(API) that supports multi-platform shared memory multiprocessing 3496programming in C/C++ and Fortran on many architectures, including Unix 3497and Microsoft Windows platforms. It consists of a set of compiler 3498directives, library routines, and environment variables that influence 3499run-time behavior. 3500 3501 GNU Fortran strives to be compatible to the OpenMP Application 3502Program Interface v4.5 (http://openmp.org/wp/openmp-specifications/). 3503 3504 To enable the processing of the OpenMP directive '!$omp' in free-form 3505source code; the 'c$omp', '*$omp' and '!$omp' directives in fixed form; 3506the '!$' conditional compilation sentinels in free form; and the 'c$', 3507'*$' and '!$' sentinels in fixed form, 'gfortran' needs to be invoked 3508with the '-fopenmp'. This also arranges for automatic linking of the 3509GNU Offloading and Multi Processing Runtime Library *note libgomp: 3510(libgomp)Top. 3511 3512 The OpenMP Fortran runtime library routines are provided both in a 3513form of a Fortran 90 module named 'omp_lib' and in a form of a Fortran 3514'include' file named 'omp_lib.h'. 3515 3516 An example of a parallelized loop taken from Appendix A.1 of the 3517OpenMP Application Program Interface v2.5: 3518 SUBROUTINE A1(N, A, B) 3519 INTEGER I, N 3520 REAL B(N), A(N) 3521 !$OMP PARALLEL DO !I is private by default 3522 DO I=2,N 3523 B(I) = (A(I) + A(I-1)) / 2.0 3524 ENDDO 3525 !$OMP END PARALLEL DO 3526 END SUBROUTINE A1 3527 3528 Please note: 3529 * '-fopenmp' implies '-frecursive', i.e., all local arrays will be 3530 allocated on the stack. When porting existing code to OpenMP, this 3531 may lead to surprising results, especially to segmentation faults 3532 if the stacksize is limited. 3533 3534 * On glibc-based systems, OpenMP enabled applications cannot be 3535 statically linked due to limitations of the underlying 3536 pthreads-implementation. It might be possible to get a working 3537 solution if '-Wl,--whole-archive -lpthread -Wl,--no-whole-archive' 3538 is added to the command line. However, this is not supported by 3539 'gcc' and thus not recommended. 3540 3541 3542File: gfortran.info, Node: OpenACC, Next: Argument list functions, Prev: OpenMP, Up: Extensions implemented in GNU Fortran 3543 35446.1.19 OpenACC 3545-------------- 3546 3547OpenACC is an application programming interface (API) that supports 3548offloading of code to accelerator devices. It consists of a set of 3549compiler directives, library routines, and environment variables that 3550influence run-time behavior. 3551 3552 GNU Fortran strives to be compatible to the OpenACC Application 3553Programming Interface v2.6 (http://www.openacc.org/). 3554 3555 To enable the processing of the OpenACC directive '!$acc' in 3556free-form source code; the 'c$acc', '*$acc' and '!$acc' directives in 3557fixed form; the '!$' conditional compilation sentinels in free form; and 3558the 'c$', '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be 3559invoked with the '-fopenacc'. This also arranges for automatic linking 3560of the GNU Offloading and Multi Processing Runtime Library *note 3561libgomp: (libgomp)Top. 3562 3563 The OpenACC Fortran runtime library routines are provided both in a 3564form of a Fortran 90 module named 'openacc' and in a form of a Fortran 3565'include' file named 'openacc_lib.h'. 3566 3567 3568File: gfortran.info, Node: Argument list functions, Next: Read/Write after EOF marker, Prev: OpenACC, Up: Extensions implemented in GNU Fortran 3569 35706.1.20 Argument list functions '%VAL', '%REF' and '%LOC' 3571-------------------------------------------------------- 3572 3573GNU Fortran supports argument list functions '%VAL', '%REF' and '%LOC' 3574statements, for backward compatibility with g77. It is recommended that 3575these should be used only for code that is accessing facilities outside 3576of GNU Fortran, such as operating system or windowing facilities. It is 3577best to constrain such uses to isolated portions of a program-portions 3578that deal specifically and exclusively with low-level, system-dependent 3579facilities. Such portions might well provide a portable interface for 3580use by the program as a whole, but are themselves not portable, and 3581should be thoroughly tested each time they are rebuilt using a new 3582compiler or version of a compiler. 3583 3584 '%VAL' passes a scalar argument by value, '%REF' passes it by 3585reference and '%LOC' passes its memory location. Since gfortran already 3586passes scalar arguments by reference, '%REF' is in effect a do-nothing. 3587'%LOC' has the same effect as a Fortran pointer. 3588 3589 An example of passing an argument by value to a C subroutine foo.: 3590 C 3591 C prototype void foo_ (float x); 3592 C 3593 external foo 3594 real*4 x 3595 x = 3.14159 3596 call foo (%VAL (x)) 3597 end 3598 3599 For details refer to the g77 manual 3600<https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top>. 3601 3602 Also, 'c_by_val.f' and its partner 'c_by_val.c' of the GNU Fortran 3603testsuite are worth a look. 3604 3605 3606File: gfortran.info, Node: Read/Write after EOF marker, Next: STRUCTURE and RECORD, Prev: Argument list functions, Up: Extensions implemented in GNU Fortran 3607 36086.1.21 Read/Write after EOF marker 3609---------------------------------- 3610 3611Some legacy codes rely on allowing 'READ' or 'WRITE' after the EOF file 3612marker in order to find the end of a file. GNU Fortran normally rejects 3613these codes with a run-time error message and suggests the user consider 3614'BACKSPACE' or 'REWIND' to properly position the file before the EOF 3615marker. As an extension, the run-time error may be disabled using 3616-std=legacy. 3617 3618 3619File: gfortran.info, Node: STRUCTURE and RECORD, Next: UNION and MAP, Prev: Read/Write after EOF marker, Up: Extensions implemented in GNU Fortran 3620 36216.1.22 'STRUCTURE' and 'RECORD' 3622------------------------------- 3623 3624Record structures are a pre-Fortran-90 vendor extension to create 3625user-defined aggregate data types. Support for record structures in GNU 3626Fortran can be enabled with the '-fdec-structure' compile flag. If you 3627have a choice, you should instead use Fortran 90's "derived types", 3628which have a different syntax. 3629 3630 In many cases, record structures can easily be converted to derived 3631types. To convert, replace 'STRUCTURE /'STRUCTURE-NAME'/' by 'TYPE' 3632TYPE-NAME. Additionally, replace 'RECORD /'STRUCTURE-NAME'/' by 3633'TYPE('TYPE-NAME')'. Finally, in the component access, replace the 3634period ('.') by the percent sign ('%'). 3635 3636 Here is an example of code using the non portable record structure 3637syntax: 3638 3639 ! Declaring a structure named ``item'' and containing three fields: 3640 ! an integer ID, an description string and a floating-point price. 3641 STRUCTURE /item/ 3642 INTEGER id 3643 CHARACTER(LEN=200) description 3644 REAL price 3645 END STRUCTURE 3646 3647 ! Define two variables, an single record of type ``item'' 3648 ! named ``pear'', and an array of items named ``store_catalog'' 3649 RECORD /item/ pear, store_catalog(100) 3650 3651 ! We can directly access the fields of both variables 3652 pear.id = 92316 3653 pear.description = "juicy D'Anjou pear" 3654 pear.price = 0.15 3655 store_catalog(7).id = 7831 3656 store_catalog(7).description = "milk bottle" 3657 store_catalog(7).price = 1.2 3658 3659 ! We can also manipulate the whole structure 3660 store_catalog(12) = pear 3661 print *, store_catalog(12) 3662 3663This code can easily be rewritten in the Fortran 90 syntax as following: 3664 3665 ! ``STRUCTURE /name/ ... END STRUCTURE'' becomes 3666 ! ``TYPE name ... END TYPE'' 3667 TYPE item 3668 INTEGER id 3669 CHARACTER(LEN=200) description 3670 REAL price 3671 END TYPE 3672 3673 ! ``RECORD /name/ variable'' becomes ``TYPE(name) variable'' 3674 TYPE(item) pear, store_catalog(100) 3675 3676 ! Instead of using a dot (.) to access fields of a record, the 3677 ! standard syntax uses a percent sign (%) 3678 pear%id = 92316 3679 pear%description = "juicy D'Anjou pear" 3680 pear%price = 0.15 3681 store_catalog(7)%id = 7831 3682 store_catalog(7)%description = "milk bottle" 3683 store_catalog(7)%price = 1.2 3684 3685 ! Assignments of a whole variable do not change 3686 store_catalog(12) = pear 3687 print *, store_catalog(12) 3688 3689GNU Fortran implements STRUCTURES like derived types with the following 3690rules and exceptions: 3691 3692 * Structures act like derived types with the 'SEQUENCE' attribute. 3693 Otherwise they may contain no specifiers. 3694 3695 * Structures may contain a special field with the name '%FILL'. This 3696 will create an anonymous component which cannot be accessed but 3697 occupies space just as if a component of the same type was declared 3698 in its place, useful for alignment purposes. As an example, the 3699 following structure will consist of at least sixteen bytes: 3700 3701 structure /padded/ 3702 character(4) start 3703 character(8) %FILL 3704 character(4) end 3705 end structure 3706 3707 * Structures may share names with other symbols. For example, the 3708 following is invalid for derived types, but valid for structures: 3709 3710 structure /header/ 3711 ! ... 3712 end structure 3713 record /header/ header 3714 3715 * Structure types may be declared nested within another parent 3716 structure. The syntax is: 3717 structure /type-name/ 3718 ... 3719 structure [/<type-name>/] <field-list> 3720 ... 3721 3722 The type name may be ommitted, in which case the structure type 3723 itself is anonymous, and other structures of the same type cannot 3724 be instantiated. The following shows some examples: 3725 3726 structure /appointment/ 3727 ! nested structure definition: app_time is an array of two 'time' 3728 structure /time/ app_time (2) 3729 integer(1) hour, minute 3730 end structure 3731 character(10) memo 3732 end structure 3733 3734 ! The 'time' structure is still usable 3735 record /time/ now 3736 now = time(5, 30) 3737 3738 ... 3739 3740 structure /appointment/ 3741 ! anonymous nested structure definition 3742 structure start, end 3743 integer(1) hour, minute 3744 end structure 3745 character(10) memo 3746 end structure 3747 3748 * Structures may contain 'UNION' blocks. For more detail see the 3749 section on *note UNION and MAP::. 3750 3751 * Structures support old-style initialization of components, like 3752 those described in *note Old-style variable initialization::. For 3753 array initializers, an initializer may contain a repeat 3754 specification of the form '<literal-integer> * 3755 <constant-initializer>'. The value of the integer indicates the 3756 number of times to repeat the constant initializer when expanding 3757 the initializer list. 3758 3759 3760File: gfortran.info, Node: UNION and MAP, Next: Type variants for integer intrinsics, Prev: STRUCTURE and RECORD, Up: Extensions implemented in GNU Fortran 3761 37626.1.23 'UNION' and 'MAP' 3763------------------------ 3764 3765Unions are an old vendor extension which were commonly used with the 3766non-standard *note STRUCTURE and RECORD:: extensions. Use of 'UNION' 3767and 'MAP' is automatically enabled with '-fdec-structure'. 3768 3769 A 'UNION' declaration occurs within a structure; within the 3770definition of each union is a number of 'MAP' blocks. Each 'MAP' shares 3771storage with its sibling maps (in the same union), and the size of the 3772union is the size of the largest map within it, just as with unions in 3773C. The major difference is that component references do not indicate 3774which union or map the component is in (the compiler gets to figure that 3775out). 3776 3777 Here is a small example: 3778 structure /myunion/ 3779 union 3780 map 3781 character(2) w0, w1, w2 3782 end map 3783 map 3784 character(6) long 3785 end map 3786 end union 3787 end structure 3788 3789 record /myunion/ rec 3790 ! After this assignment... 3791 rec.long = 'hello!' 3792 3793 ! The following is true: 3794 ! rec.w0 === 'he' 3795 ! rec.w1 === 'll' 3796 ! rec.w2 === 'o!' 3797 3798 The two maps share memory, and the size of the union is ultimately 3799six bytes: 3800 3801 0 1 2 3 4 5 6 Byte offset 3802 ------------------------------- 3803 | | | | | | | 3804 ------------------------------- 3805 3806 ^ W0 ^ W1 ^ W2 ^ 3807 \-------/ \-------/ \-------/ 3808 3809 ^ LONG ^ 3810 \---------------------------/ 3811 3812 Following is an example mirroring the layout of an Intel x86_64 3813register: 3814 3815 structure /reg/ 3816 union ! U0 ! rax 3817 map 3818 character(16) rx 3819 end map 3820 map 3821 character(8) rh ! rah 3822 union ! U1 3823 map 3824 character(8) rl ! ral 3825 end map 3826 map 3827 character(8) ex ! eax 3828 end map 3829 map 3830 character(4) eh ! eah 3831 union ! U2 3832 map 3833 character(4) el ! eal 3834 end map 3835 map 3836 character(4) x ! ax 3837 end map 3838 map 3839 character(2) h ! ah 3840 character(2) l ! al 3841 end map 3842 end union 3843 end map 3844 end union 3845 end map 3846 end union 3847 end structure 3848 record /reg/ a 3849 3850 ! After this assignment... 3851 a.rx = 'AAAAAAAA.BBB.C.D' 3852 3853 ! The following is true: 3854 a.rx === 'AAAAAAAA.BBB.C.D' 3855 a.rh === 'AAAAAAAA' 3856 a.rl === '.BBB.C.D' 3857 a.ex === '.BBB.C.D' 3858 a.eh === '.BBB' 3859 a.el === '.C.D' 3860 a.x === '.C.D' 3861 a.h === '.C' 3862 a.l === '.D' 3863 3864 3865File: gfortran.info, Node: Type variants for integer intrinsics, Next: AUTOMATIC and STATIC attributes, Prev: UNION and MAP, Up: Extensions implemented in GNU Fortran 3866 38676.1.24 Type variants for integer intrinsics 3868------------------------------------------- 3869 3870Similar to the D/C prefixes to real functions to specify the 3871input/output types, GNU Fortran offers B/I/J/K prefixes to integer 3872functions for compatibility with DEC programs. The types implied by 3873each are: 3874 3875 B - INTEGER(kind=1) 3876 I - INTEGER(kind=2) 3877 J - INTEGER(kind=4) 3878 K - INTEGER(kind=8) 3879 3880 GNU Fortran supports these with the flag '-fdec-intrinsic-ints'. 3881Intrinsics for which prefixed versions are available and in what form 3882are noted in *note Intrinsic Procedures::. The complete list of 3883supported intrinsics is here: 3884 3885Intrinsic B I J K 3886 3887--------------------------------------------------------------------------- 3888'*note ABS::' 'BABS' 'IIABS' 'JIABS' 'KIABS' 3889'*note BTEST::''BBTEST' 'BITEST' 'BJTEST' 'BKTEST' 3890'*note IAND::' 'BIAND' 'IIAND' 'JIAND' 'KIAND' 3891'*note IBCLR::''BBCLR' 'IIBCLR' 'JIBCLR' 'KIBCLR' 3892'*note IBITS::''BBITS' 'IIBITS' 'JIBITS' 'KIBITS' 3893'*note IBSET::''BBSET' 'IIBSET' 'JIBSET' 'KIBSET' 3894'*note IEOR::' 'BIEOR' 'IIEOR' 'JIEOR' 'KIEOR' 3895'*note IOR::' 'BIOR' 'IIOR' 'JIOR' 'KIOR' 3896'*note ISHFT::''BSHFT' 'IISHFT' 'JISHFT' 'KISHFT' 3897'*note ISHFTC::''BSHFTC' 'IISHFTC' 'JISHFTC' 'KISHFTC' 3898'*note MOD::' 'BMOD' 'IMOD' 'JMOD' 'KMOD' 3899'*note NOT::' 'BNOT' 'INOT' 'JNOT' 'KNOT' 3900'*note REAL::' '--' 'FLOATI' 'FLOATJ' 'FLOATK' 3901 3902 3903File: gfortran.info, Node: AUTOMATIC and STATIC attributes, Next: Extended math intrinsics, Prev: Type variants for integer intrinsics, Up: Extensions implemented in GNU Fortran 3904 39056.1.25 'AUTOMATIC' and 'STATIC' attributes 3906------------------------------------------ 3907 3908With '-fdec-static' GNU Fortran supports the DEC extended attributes 3909'STATIC' and 'AUTOMATIC' to provide explicit specification of entity 3910storage. These follow the syntax of the Fortran standard 'SAVE' 3911attribute. 3912 3913 'STATIC' is exactly equivalent to 'SAVE', and specifies that an 3914entity should be allocated in static memory. As an example, 'STATIC' 3915local variables will retain their values across multiple calls to a 3916function. 3917 3918 Entities marked 'AUTOMATIC' will be stack automatic whenever 3919possible. 'AUTOMATIC' is the default for local variables smaller than 3920'-fmax-stack-var-size', unless '-fno-automatic' is given. This 3921attribute overrides '-fno-automatic', '-fmax-stack-var-size', and 3922blanket 'SAVE' statements. 3923 3924 Examples: 3925 3926 subroutine f 3927 integer, automatic :: i ! automatic variable 3928 integer x, y ! static variables 3929 save 3930 ... 3931 endsubroutine 3932 subroutine f 3933 integer a, b, c, x, y, z 3934 static :: x 3935 save y 3936 automatic z, c 3937 ! a, b, c, and z are automatic 3938 ! x and y are static 3939 endsubroutine 3940 ! Compiled with -fno-automatic 3941 subroutine f 3942 integer a, b, c, d 3943 automatic :: a 3944 ! a is automatic; b, c, and d are static 3945 endsubroutine 3946 3947 3948File: gfortran.info, Node: Extended math intrinsics, Next: Form feed as whitespace, Prev: AUTOMATIC and STATIC attributes, Up: Extensions implemented in GNU Fortran 3949 39506.1.26 Extended math intrinsics 3951------------------------------- 3952 3953GNU Fortran supports an extended list of mathematical intrinsics with 3954the compile flag '-fdec-math' for compatability with legacy code. These 3955intrinsics are described fully in *note Intrinsic Procedures:: where it 3956is noted that they are extensions and should be avoided whenever 3957possible. 3958 3959 Specifically, '-fdec-math' enables the *note COTAN:: intrinsic, and 3960trigonometric intrinsics which accept or produce values in degrees 3961instead of radians. Here is a summary of the new intrinsics: 3962 3963Radians Degrees 3964-------------------------------------------------------------------------- 3965'*note ACOS::' '*note ACOSD::'* 3966'*note ASIN::' '*note ASIND::'* 3967'*note ATAN::' '*note ATAND::'* 3968'*note ATAN2::' '*note ATAN2D::'* 3969'*note COS::' '*note COSD::'* 3970'*note COTAN::'* '*note COTAND::'* 3971'*note SIN::' '*note SIND::'* 3972'*note TAN::' '*note TAND::'* 3973 3974 * Enabled with '-fdec-math'. 3975 3976 For advanced users, it may be important to know the implementation of 3977these functions. They are simply wrappers around the standard radian 3978functions, which have more accurate builtin versions. These functions 3979convert their arguments (or results) to degrees (or radians) by taking 3980the value modulus 360 (or 2*pi) and then multiplying it by a constant 3981radian-to-degree (or degree-to-radian) factor, as appropriate. The 3982factor is computed at compile-time as 180/pi (or pi/180). 3983 3984 3985File: gfortran.info, Node: Form feed as whitespace, Next: TYPE as an alias for PRINT, Prev: Extended math intrinsics, Up: Extensions implemented in GNU Fortran 3986 39876.1.27 Form feed as whitespace 3988------------------------------ 3989 3990Historically, legacy compilers allowed insertion of form feed characters 3991('\f', ASCII 0xC) at the beginning of lines for formatted output to line 3992printers, though the Fortran standard does not mention this. GNU 3993Fortran supports the interpretation of form feed characters in source as 3994whitespace for compatibility. 3995 3996 3997File: gfortran.info, Node: TYPE as an alias for PRINT, Next: %LOC as an rvalue, Prev: Form feed as whitespace, Up: Extensions implemented in GNU Fortran 3998 39996.1.28 TYPE as an alias for PRINT 4000--------------------------------- 4001 4002For compatibility, GNU Fortran will interpret 'TYPE' statements as 4003'PRINT' statements with the flag '-fdec'. With this flag asserted, the 4004following two examples are equivalent: 4005 4006 TYPE *, 'hello world' 4007 4008 PRINT *, 'hello world' 4009 4010 4011File: gfortran.info, Node: %LOC as an rvalue, Next: .XOR. operator, Prev: TYPE as an alias for PRINT, Up: Extensions implemented in GNU Fortran 4012 40136.1.29 %LOC as an rvalue 4014------------------------ 4015 4016Normally '%LOC' is allowed only in parameter lists. However the 4017intrinsic function 'LOC' does the same thing, and is usable as the 4018right-hand-side of assignments. For compatibility, GNU Fortran supports 4019the use of '%LOC' as an alias for the builtin 'LOC' with '-std=legacy'. 4020With this feature enabled the following two examples are equivalent: 4021 4022 integer :: i, l 4023 l = %loc(i) 4024 call sub(l) 4025 4026 integer :: i 4027 call sub(%loc(i)) 4028 4029 4030File: gfortran.info, Node: .XOR. operator, Next: Bitwise logical operators, Prev: %LOC as an rvalue, Up: Extensions implemented in GNU Fortran 4031 40326.1.30 .XOR. operator 4033--------------------- 4034 4035GNU Fortran supports '.XOR.' as a logical operator with '-std=legacy' 4036for compatibility with legacy code. '.XOR.' is equivalent to '.NEQV.'. 4037That is, the output is true if and only if the inputs differ. 4038 4039 4040File: gfortran.info, Node: Bitwise logical operators, Next: Extended I/O specifiers, Prev: .XOR. operator, Up: Extensions implemented in GNU Fortran 4041 40426.1.31 Bitwise logical operators 4043-------------------------------- 4044 4045With '-fdec', GNU Fortran relaxes the type constraints on logical 4046operators to allow integer operands, and performs the corresponding 4047bitwise operation instead. This flag is for compatibility only, and 4048should be avoided in new code. Consider: 4049 4050 INTEGER :: i, j 4051 i = z'33' 4052 j = z'cc' 4053 print *, i .AND. j 4054 4055 In this example, compiled with '-fdec', GNU Fortran will replace the 4056'.AND.' operation with a call to the intrinsic '*note IAND::' function, 4057yielding the bitwise-and of 'i' and 'j'. 4058 4059 Note that this conversion will occur if at least one operand is of 4060integral type. As a result, a logical operand will be converted to an 4061integer when the other operand is an integer in a logical operation. In 4062this case, '.TRUE.' is converted to '1' and '.FALSE.' to '0'. 4063 4064 Here is the mapping of logical operator to bitwise intrinsic used 4065with '-fdec': 4066 4067Operator Intrinsic Bitwise operation 4068--------------------------------------------------------------------------- 4069'.NOT.' '*note NOT::' complement 4070'.AND.' '*note IAND::' intersection 4071'.OR.' '*note IOR::' union 4072'.NEQV.' '*note IEOR::' exclusive or 4073'.EQV.' '*note NOT::(*note IEOR::)'complement of exclusive or 4074 4075 4076File: gfortran.info, Node: Extended I/O specifiers, Next: Legacy PARAMETER statements, Prev: Bitwise logical operators, Up: Extensions implemented in GNU Fortran 4077 40786.1.32 Extended I/O specifiers 4079------------------------------ 4080 4081GNU Fortran supports the additional legacy I/O specifiers 4082'CARRIAGECONTROL', 'READONLY', and 'SHARE' with the compile flag 4083'-fdec', for compatibility. 4084 4085'CARRIAGECONTROL' 4086 The 'CARRIAGECONTROL' specifier allows a user to control line 4087 termination settings between output records for an I/O unit. The 4088 specifier has no meaning for readonly files. When 4089 'CARRAIGECONTROL' is specified upon opening a unit for formatted 4090 writing, the exact 'CARRIAGECONTROL' setting determines what 4091 characters to write between output records. The syntax is: 4092 4093 OPEN(..., CARRIAGECONTROL=cc) 4094 4095 Where _cc_ is a character expression that evaluates to one of the 4096 following values: 4097 4098 ''LIST'' One line feed between records (default) 4099 ''FORTRAN'' Legacy interpretation of the first character (see below) 4100 ''NONE'' No separator between records 4101 4102 With 'CARRIAGECONTROL='FORTRAN'', when a record is written, the 4103 first character of the input record is not written, and instead 4104 determines the output record separator as follows: 4105 4106 Leading character Meaning Output separating 4107 character(s) 4108 ---------------------------------------------------------------------------- 4109 ''+'' Overprinting Carriage return only 4110 ''-'' New line Line feed and carriage 4111 return 4112 ''0'' Skip line Two line feeds and carriage 4113 return 4114 ''1'' New page Form feed and carriage 4115 return 4116 ''$'' Prompting Line feed (no carriage 4117 return) 4118 'CHAR(0)' Overprinting (no None 4119 advance) 4120 4121'READONLY' 4122 The 'READONLY' specifier may be given upon opening a unit, and is 4123 equivalent to specifying 'ACTION='READ'', except that the file may 4124 not be deleted on close (i.e. 'CLOSE' with 'STATUS="DELETE"'). 4125 The syntax is: 4126 4127 OPEN(..., READONLY) 4128 4129'SHARE' 4130 The 'SHARE' specifier allows system-level locking on a unit upon 4131 opening it for controlled access from multiple processes/threads. 4132 The 'SHARE' specifier has several forms: 4133 4134 OPEN(..., SHARE=sh) 4135 OPEN(..., SHARED) 4136 OPEN(..., NOSHARED) 4137 4138 Where _sh_ in the first form is a character expression that 4139 evaluates to a value as seen in the table below. The latter two 4140 forms are aliases for particular values of _sh_: 4141 4142 Explicit form Short form Meaning 4143 ---------------------------------------------------------------------------- 4144 'SHARE='DENYRW'' 'NOSHARED' Exclusive (write) lock 4145 'SHARE='DENYNONE'' 'SHARED' Shared (read) lock 4146 4147 In general only one process may hold an exclusive (write) lock for 4148 a given file at a time, whereas many processes may hold shared 4149 (read) locks for the same file. 4150 4151 The behavior of locking may vary with your operating system. On 4152 POSIX systems, locking is implemented with 'fcntl'. Consult your 4153 corresponding operating system's manual pages for further details. 4154 Locking via 'SHARE=' is not supported on other systems. 4155 4156 4157File: gfortran.info, Node: Legacy PARAMETER statements, Next: Default exponents, Prev: Extended I/O specifiers, Up: Extensions implemented in GNU Fortran 4158 41596.1.33 Legacy PARAMETER statements 4160---------------------------------- 4161 4162For compatibility, GNU Fortran supports legacy PARAMETER statements 4163without parentheses with '-std=legacy'. A warning is emitted if used 4164with '-std=gnu', and an error is acknowledged with a real Fortran 4165standard flag ('-std=f95', etc...). These statements take the following 4166form: 4167 4168 implicit real (E) 4169 parameter e = 2.718282 4170 real c 4171 parameter c = 3.0e8 4172 4173 4174File: gfortran.info, Node: Default exponents, Prev: Legacy PARAMETER statements, Up: Extensions implemented in GNU Fortran 4175 41766.1.34 Default exponents 4177------------------------ 4178 4179For compatibility, GNU Fortran supports a default exponent of zero in 4180real constants with '-fdec'. For example, '9e' would be interpreted as 4181'9e0', rather than an error. 4182 4183 4184File: gfortran.info, Node: Extensions not implemented in GNU Fortran, Prev: Extensions implemented in GNU Fortran, Up: Extensions 4185 41866.2 Extensions not implemented in GNU Fortran 4187============================================= 4188 4189The long history of the Fortran language, its wide use and broad 4190userbase, the large number of different compiler vendors and the lack of 4191some features crucial to users in the first standards have lead to the 4192existence of a number of important extensions to the language. While 4193some of the most useful or popular extensions are supported by the GNU 4194Fortran compiler, not all existing extensions are supported. This 4195section aims at listing these extensions and offering advice on how best 4196make code that uses them running with the GNU Fortran compiler. 4197 4198* Menu: 4199 4200* ENCODE and DECODE statements:: 4201* Variable FORMAT expressions:: 4202* Alternate complex function syntax:: 4203* Volatile COMMON blocks:: 4204* OPEN( ... NAME=):: 4205* Q edit descriptor:: 4206 4207 4208File: gfortran.info, Node: ENCODE and DECODE statements, Next: Variable FORMAT expressions, Up: Extensions not implemented in GNU Fortran 4209 42106.2.1 'ENCODE' and 'DECODE' statements 4211-------------------------------------- 4212 4213GNU Fortran does not support the 'ENCODE' and 'DECODE' statements. 4214These statements are best replaced by 'READ' and 'WRITE' statements 4215involving internal files ('CHARACTER' variables and arrays), which have 4216been part of the Fortran standard since Fortran 77. For example, 4217replace a code fragment like 4218 4219 INTEGER*1 LINE(80) 4220 REAL A, B, C 4221 c ... Code that sets LINE 4222 DECODE (80, 9000, LINE) A, B, C 4223 9000 FORMAT (1X, 3(F10.5)) 4224 4225with the following: 4226 4227 CHARACTER(LEN=80) LINE 4228 REAL A, B, C 4229 c ... Code that sets LINE 4230 READ (UNIT=LINE, FMT=9000) A, B, C 4231 9000 FORMAT (1X, 3(F10.5)) 4232 4233 Similarly, replace a code fragment like 4234 4235 INTEGER*1 LINE(80) 4236 REAL A, B, C 4237 c ... Code that sets A, B and C 4238 ENCODE (80, 9000, LINE) A, B, C 4239 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5)) 4240 4241with the following: 4242 4243 CHARACTER(LEN=80) LINE 4244 REAL A, B, C 4245 c ... Code that sets A, B and C 4246 WRITE (UNIT=LINE, FMT=9000) A, B, C 4247 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5)) 4248 4249 4250File: gfortran.info, Node: Variable FORMAT expressions, Next: Alternate complex function syntax, Prev: ENCODE and DECODE statements, Up: Extensions not implemented in GNU Fortran 4251 42526.2.2 Variable 'FORMAT' expressions 4253----------------------------------- 4254 4255A variable 'FORMAT' expression is format statement which includes angle 4256brackets enclosing a Fortran expression: 'FORMAT(I<N>)'. GNU Fortran 4257does not support this legacy extension. The effect of variable format 4258expressions can be reproduced by using the more powerful (and standard) 4259combination of internal output and string formats. For example, replace 4260a code fragment like this: 4261 4262 WRITE(6,20) INT1 4263 20 FORMAT(I<N+1>) 4264 4265with the following: 4266 4267 c Variable declaration 4268 CHARACTER(LEN=20) FMT 4269 c 4270 c Other code here... 4271 c 4272 WRITE(FMT,'("(I", I0, ")")') N+1 4273 WRITE(6,FMT) INT1 4274 4275or with: 4276 4277 c Variable declaration 4278 CHARACTER(LEN=20) FMT 4279 c 4280 c Other code here... 4281 c 4282 WRITE(FMT,*) N+1 4283 WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1 4284 4285 4286File: gfortran.info, Node: Alternate complex function syntax, Next: Volatile COMMON blocks, Prev: Variable FORMAT expressions, Up: Extensions not implemented in GNU Fortran 4287 42886.2.3 Alternate complex function syntax 4289--------------------------------------- 4290 4291Some Fortran compilers, including 'g77', let the user declare complex 4292functions with the syntax 'COMPLEX FUNCTION name*16()', as well as 4293'COMPLEX*16 FUNCTION name()'. Both are non-standard, legacy extensions. 4294'gfortran' accepts the latter form, which is more common, but not the 4295former. 4296 4297 4298File: gfortran.info, Node: Volatile COMMON blocks, Next: OPEN( ... NAME=), Prev: Alternate complex function syntax, Up: Extensions not implemented in GNU Fortran 4299 43006.2.4 Volatile 'COMMON' blocks 4301------------------------------ 4302 4303Some Fortran compilers, including 'g77', let the user declare 'COMMON' 4304with the 'VOLATILE' attribute. This is invalid standard Fortran syntax 4305and is not supported by 'gfortran'. Note that 'gfortran' accepts 4306'VOLATILE' variables in 'COMMON' blocks since revision 4.3. 4307 4308 4309File: gfortran.info, Node: OPEN( ... NAME=), Next: Q edit descriptor, Prev: Volatile COMMON blocks, Up: Extensions not implemented in GNU Fortran 4310 43116.2.5 'OPEN( ... NAME=)' 4312------------------------ 4313 4314Some Fortran compilers, including 'g77', let the user declare 'OPEN( ... 4315NAME=)'. This is invalid standard Fortran syntax and is not supported 4316by 'gfortran'. 'OPEN( ... NAME=)' should be replaced with 'OPEN( ... 4317FILE=)'. 4318 4319 4320File: gfortran.info, Node: Q edit descriptor, Prev: OPEN( ... NAME=), Up: Extensions not implemented in GNU Fortran 4321 43226.2.6 'Q' edit descriptor 4323------------------------- 4324 4325Some Fortran compilers provide the 'Q' edit descriptor, which transfers 4326the number of characters left within an input record into an integer 4327variable. 4328 4329 A direct replacement of the 'Q' edit descriptor is not available in 4330'gfortran'. How to replicate its functionality using 4331standard-conforming code depends on what the intent of the original code 4332is. 4333 4334 Options to replace 'Q' may be to read the whole line into a character 4335variable and then counting the number of non-blank characters left using 4336'LEN_TRIM'. Another method may be to use formatted stream, read the 4337data up to the position where the 'Q' descriptor occurred, use 'INQUIRE' 4338to get the file position, count the characters up to the next 'NEW_LINE' 4339and then start reading from the position marked previously. 4340 4341 4342File: gfortran.info, Node: Mixed-Language Programming, Next: Coarray Programming, Prev: Extensions, Up: Top 4343 43447 Mixed-Language Programming 4345**************************** 4346 4347* Menu: 4348 4349* Interoperability with C:: 4350* GNU Fortran Compiler Directives:: 4351* Non-Fortran Main Program:: 4352* Naming and argument-passing conventions:: 4353 4354This chapter is about mixed-language interoperability, but also applies 4355if one links Fortran code compiled by different compilers. In most 4356cases, use of the C Binding features of the Fortran 2003 standard is 4357sufficient, and their use is highly recommended. 4358 4359 4360File: gfortran.info, Node: Interoperability with C, Next: GNU Fortran Compiler Directives, Up: Mixed-Language Programming 4361 43627.1 Interoperability with C 4363=========================== 4364 4365* Menu: 4366 4367* Intrinsic Types:: 4368* Derived Types and struct:: 4369* Interoperable Global Variables:: 4370* Interoperable Subroutines and Functions:: 4371* Working with Pointers:: 4372* Further Interoperability of Fortran with C:: 4373 4374Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a standardized way 4375to generate procedure and derived-type declarations and global variables 4376which are interoperable with C (ISO/IEC 9899:1999). The 'bind(C)' 4377attribute has been added to inform the compiler that a symbol shall be 4378interoperable with C; also, some constraints are added. Note, however, 4379that not all C features have a Fortran equivalent or vice versa. For 4380instance, neither C's unsigned integers nor C's functions with variable 4381number of arguments have an equivalent in Fortran. 4382 4383 Note that array dimensions are reversely ordered in C and that arrays 4384in C always start with index 0 while in Fortran they start by default 4385with 1. Thus, an array declaration 'A(n,m)' in Fortran matches 4386'A[m][n]' in C and accessing the element 'A(i,j)' matches 'A[j-1][i-1]'. 4387The element following 'A(i,j)' (C: 'A[j-1][i-1]'; assuming i < n) in 4388memory is 'A(i+1,j)' (C: 'A[j-1][i]'). 4389 4390 4391File: gfortran.info, Node: Intrinsic Types, Next: Derived Types and struct, Up: Interoperability with C 4392 43937.1.1 Intrinsic Types 4394--------------------- 4395 4396In order to ensure that exactly the same variable type and kind is used 4397in C and Fortran, the named constants shall be used which are defined in 4398the 'ISO_C_BINDING' intrinsic module. That module contains named 4399constants for kind parameters and character named constants for the 4400escape sequences in C. For a list of the constants, see *note 4401ISO_C_BINDING::. 4402 4403 For logical types, please note that the Fortran standard only 4404guarantees interoperability between C99's '_Bool' and Fortran's 4405'C_Bool'-kind logicals and C99 defines that 'true' has the value 1 and 4406'false' the value 0. Using any other integer value with GNU Fortran's 4407'LOGICAL' (with any kind parameter) gives an undefined result. (Passing 4408other integer values than 0 and 1 to GCC's '_Bool' is also undefined, 4409unless the integer is explicitly or implicitly casted to '_Bool'.) 4410 4411 4412File: gfortran.info, Node: Derived Types and struct, Next: Interoperable Global Variables, Prev: Intrinsic Types, Up: Interoperability with C 4413 44147.1.2 Derived Types and struct 4415------------------------------ 4416 4417For compatibility of derived types with 'struct', one needs to use the 4418'BIND(C)' attribute in the type declaration. For instance, the 4419following type declaration 4420 4421 USE ISO_C_BINDING 4422 TYPE, BIND(C) :: myType 4423 INTEGER(C_INT) :: i1, i2 4424 INTEGER(C_SIGNED_CHAR) :: i3 4425 REAL(C_DOUBLE) :: d1 4426 COMPLEX(C_FLOAT_COMPLEX) :: c1 4427 CHARACTER(KIND=C_CHAR) :: str(5) 4428 END TYPE 4429 4430 matches the following 'struct' declaration in C 4431 4432 struct { 4433 int i1, i2; 4434 /* Note: "char" might be signed or unsigned. */ 4435 signed char i3; 4436 double d1; 4437 float _Complex c1; 4438 char str[5]; 4439 } myType; 4440 4441 Derived types with the C binding attribute shall not have the 4442'sequence' attribute, type parameters, the 'extends' attribute, nor 4443type-bound procedures. Every component must be of interoperable type 4444and kind and may not have the 'pointer' or 'allocatable' attribute. The 4445names of the components are irrelevant for interoperability. 4446 4447 As there exist no direct Fortran equivalents, neither unions nor 4448structs with bit field or variable-length array members are 4449interoperable. 4450 4451 4452File: gfortran.info, Node: Interoperable Global Variables, Next: Interoperable Subroutines and Functions, Prev: Derived Types and struct, Up: Interoperability with C 4453 44547.1.3 Interoperable Global Variables 4455------------------------------------ 4456 4457Variables can be made accessible from C using the C binding attribute, 4458optionally together with specifying a binding name. Those variables 4459have to be declared in the declaration part of a 'MODULE', be of 4460interoperable type, and have neither the 'pointer' nor the 'allocatable' 4461attribute. 4462 4463 MODULE m 4464 USE myType_module 4465 USE ISO_C_BINDING 4466 integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag 4467 type(myType), bind(C) :: tp 4468 END MODULE 4469 4470 Here, '_MyProject_flags' is the case-sensitive name of the variable 4471as seen from C programs while 'global_flag' is the case-insensitive name 4472as seen from Fortran. If no binding name is specified, as for TP, the C 4473binding name is the (lowercase) Fortran binding name. If a binding name 4474is specified, only a single variable may be after the double colon. 4475Note of warning: You cannot use a global variable to access ERRNO of the 4476C library as the C standard allows it to be a macro. Use the 'IERRNO' 4477intrinsic (GNU extension) instead. 4478 4479 4480File: gfortran.info, Node: Interoperable Subroutines and Functions, Next: Working with Pointers, Prev: Interoperable Global Variables, Up: Interoperability with C 4481 44827.1.4 Interoperable Subroutines and Functions 4483--------------------------------------------- 4484 4485Subroutines and functions have to have the 'BIND(C)' attribute to be 4486compatible with C. The dummy argument declaration is relatively 4487straightforward. However, one needs to be careful because C uses 4488call-by-value by default while Fortran behaves usually similar to 4489call-by-reference. Furthermore, strings and pointers are handled 4490differently. Note that in Fortran 2003 and 2008 only explicit size and 4491assumed-size arrays are supported but not assumed-shape or 4492deferred-shape (i.e. allocatable or pointer) arrays. However, those 4493are allowed since the Technical Specification 29113, see *note Further 4494Interoperability of Fortran with C:: 4495 4496 To pass a variable by value, use the 'VALUE' attribute. Thus, the 4497following C prototype 4498 4499 int func(int i, int *j) 4500 4501 matches the Fortran declaration 4502 4503 integer(c_int) function func(i,j) 4504 use iso_c_binding, only: c_int 4505 integer(c_int), VALUE :: i 4506 integer(c_int) :: j 4507 4508 Note that pointer arguments also frequently need the 'VALUE' 4509attribute, see *note Working with Pointers::. 4510 4511 Strings are handled quite differently in C and Fortran. In C a 4512string is a 'NUL'-terminated array of characters while in Fortran each 4513string has a length associated with it and is thus not terminated (by 4514e.g. 'NUL'). For example, if one wants to use the following C 4515function, 4516 4517 #include <stdio.h> 4518 void print_C(char *string) /* equivalent: char string[] */ 4519 { 4520 printf("%s\n", string); 4521 } 4522 4523 to print "Hello World" from Fortran, one can call it using 4524 4525 use iso_c_binding, only: C_CHAR, C_NULL_CHAR 4526 interface 4527 subroutine print_c(string) bind(C, name="print_C") 4528 use iso_c_binding, only: c_char 4529 character(kind=c_char) :: string(*) 4530 end subroutine print_c 4531 end interface 4532 call print_c(C_CHAR_"Hello World"//C_NULL_CHAR) 4533 4534 As the example shows, one needs to ensure that the string is 'NUL' 4535terminated. Additionally, the dummy argument STRING of 'print_C' is a 4536length-one assumed-size array; using 'character(len=*)' is not allowed. 4537The example above uses 'c_char_"Hello World"' to ensure the string 4538literal has the right type; typically the default character kind and 4539'c_char' are the same and thus '"Hello World"' is equivalent. However, 4540the standard does not guarantee this. 4541 4542 The use of strings is now further illustrated using the C library 4543function 'strncpy', whose prototype is 4544 4545 char *strncpy(char *restrict s1, const char *restrict s2, size_t n); 4546 4547 The function 'strncpy' copies at most N characters from string S2 to 4548S1 and returns S1. In the following example, we ignore the return 4549value: 4550 4551 use iso_c_binding 4552 implicit none 4553 character(len=30) :: str,str2 4554 interface 4555 ! Ignore the return value of strncpy -> subroutine 4556 ! "restrict" is always assumed if we do not pass a pointer 4557 subroutine strncpy(dest, src, n) bind(C) 4558 import 4559 character(kind=c_char), intent(out) :: dest(*) 4560 character(kind=c_char), intent(in) :: src(*) 4561 integer(c_size_t), value, intent(in) :: n 4562 end subroutine strncpy 4563 end interface 4564 str = repeat('X',30) ! Initialize whole string with 'X' 4565 call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, & 4566 len(c_char_"Hello World",kind=c_size_t)) 4567 print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX" 4568 end 4569 4570 The intrinsic procedures are described in *note Intrinsic 4571Procedures::. 4572 4573 4574File: gfortran.info, Node: Working with Pointers, Next: Further Interoperability of Fortran with C, Prev: Interoperable Subroutines and Functions, Up: Interoperability with C 4575 45767.1.5 Working with Pointers 4577--------------------------- 4578 4579C pointers are represented in Fortran via the special opaque derived 4580type 'type(c_ptr)' (with private components). Thus one needs to use 4581intrinsic conversion procedures to convert from or to C pointers. 4582 4583 For some applications, using an assumed type ('TYPE(*)') can be an 4584alternative to a C pointer; see *note Further Interoperability of 4585Fortran with C::. 4586 4587 For example, 4588 4589 use iso_c_binding 4590 type(c_ptr) :: cptr1, cptr2 4591 integer, target :: array(7), scalar 4592 integer, pointer :: pa(:), ps 4593 cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the 4594 ! array is contiguous if required by the C 4595 ! procedure 4596 cptr2 = c_loc(scalar) 4597 call c_f_pointer(cptr2, ps) 4598 call c_f_pointer(cptr2, pa, shape=[7]) 4599 4600 When converting C to Fortran arrays, the one-dimensional 'SHAPE' 4601argument has to be passed. 4602 4603 If a pointer is a dummy-argument of an interoperable procedure, it 4604usually has to be declared using the 'VALUE' attribute. 'void*' matches 4605'TYPE(C_PTR), VALUE', while 'TYPE(C_PTR)' alone matches 'void**'. 4606 4607 Procedure pointers are handled analogously to pointers; the C type is 4608'TYPE(C_FUNPTR)' and the intrinsic conversion procedures are 4609'C_F_PROCPOINTER' and 'C_FUNLOC'. 4610 4611 Let us consider two examples of actually passing a procedure pointer 4612from C to Fortran and vice versa. Note that these examples are also 4613very similar to passing ordinary pointers between both languages. 4614First, consider this code in C: 4615 4616 /* Procedure implemented in Fortran. */ 4617 void get_values (void (*)(double)); 4618 4619 /* Call-back routine we want called from Fortran. */ 4620 void 4621 print_it (double x) 4622 { 4623 printf ("Number is %f.\n", x); 4624 } 4625 4626 /* Call Fortran routine and pass call-back to it. */ 4627 void 4628 foobar () 4629 { 4630 get_values (&print_it); 4631 } 4632 4633 A matching implementation for 'get_values' in Fortran, that correctly 4634receives the procedure pointer from C and is able to call it, is given 4635in the following 'MODULE': 4636 4637 MODULE m 4638 IMPLICIT NONE 4639 4640 ! Define interface of call-back routine. 4641 ABSTRACT INTERFACE 4642 SUBROUTINE callback (x) 4643 USE, INTRINSIC :: ISO_C_BINDING 4644 REAL(KIND=C_DOUBLE), INTENT(IN), VALUE :: x 4645 END SUBROUTINE callback 4646 END INTERFACE 4647 4648 CONTAINS 4649 4650 ! Define C-bound procedure. 4651 SUBROUTINE get_values (cproc) BIND(C) 4652 USE, INTRINSIC :: ISO_C_BINDING 4653 TYPE(C_FUNPTR), INTENT(IN), VALUE :: cproc 4654 4655 PROCEDURE(callback), POINTER :: proc 4656 4657 ! Convert C to Fortran procedure pointer. 4658 CALL C_F_PROCPOINTER (cproc, proc) 4659 4660 ! Call it. 4661 CALL proc (1.0_C_DOUBLE) 4662 CALL proc (-42.0_C_DOUBLE) 4663 CALL proc (18.12_C_DOUBLE) 4664 END SUBROUTINE get_values 4665 4666 END MODULE m 4667 4668 Next, we want to call a C routine that expects a procedure pointer 4669argument and pass it a Fortran procedure (which clearly must be 4670interoperable!). Again, the C function may be: 4671 4672 int 4673 call_it (int (*func)(int), int arg) 4674 { 4675 return func (arg); 4676 } 4677 4678 It can be used as in the following Fortran code: 4679 4680 MODULE m 4681 USE, INTRINSIC :: ISO_C_BINDING 4682 IMPLICIT NONE 4683 4684 ! Define interface of C function. 4685 INTERFACE 4686 INTEGER(KIND=C_INT) FUNCTION call_it (func, arg) BIND(C) 4687 USE, INTRINSIC :: ISO_C_BINDING 4688 TYPE(C_FUNPTR), INTENT(IN), VALUE :: func 4689 INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg 4690 END FUNCTION call_it 4691 END INTERFACE 4692 4693 CONTAINS 4694 4695 ! Define procedure passed to C function. 4696 ! It must be interoperable! 4697 INTEGER(KIND=C_INT) FUNCTION double_it (arg) BIND(C) 4698 INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg 4699 double_it = arg + arg 4700 END FUNCTION double_it 4701 4702 ! Call C function. 4703 SUBROUTINE foobar () 4704 TYPE(C_FUNPTR) :: cproc 4705 INTEGER(KIND=C_INT) :: i 4706 4707 ! Get C procedure pointer. 4708 cproc = C_FUNLOC (double_it) 4709 4710 ! Use it. 4711 DO i = 1_C_INT, 10_C_INT 4712 PRINT *, call_it (cproc, i) 4713 END DO 4714 END SUBROUTINE foobar 4715 4716 END MODULE m 4717 4718 4719File: gfortran.info, Node: Further Interoperability of Fortran with C, Prev: Working with Pointers, Up: Interoperability with C 4720 47217.1.6 Further Interoperability of Fortran with C 4722------------------------------------------------ 4723 4724The Technical Specification ISO/IEC TS 29113:2012 on further 4725interoperability of Fortran with C extends the interoperability support 4726of Fortran 2003 and Fortran 2008. Besides removing some restrictions 4727and constraints, it adds assumed-type ('TYPE(*)') and assumed-rank 4728('dimension') variables and allows for interoperability of 4729assumed-shape, assumed-rank and deferred-shape arrays, including 4730allocatables and pointers. 4731 4732 Note: Currently, GNU Fortran does not use internally the array 4733descriptor (dope vector) as specified in the Technical Specification, 4734but uses an array descriptor with different fields. Assumed type and 4735assumed rank formal arguments are converted in the library to the 4736specified form. The ISO_Fortran_binding API functions (also Fortran 47372018 18.4) are implemented in libgfortran. Alternatively, the Chasm 4738Language Interoperability Tools, 4739<http://chasm-interop.sourceforge.net/>, provide an interface to GNU 4740Fortran's array descriptor. 4741 4742 The Technical Specification adds the following new features, which 4743are supported by GNU Fortran: 4744 4745 * The 'ASYNCHRONOUS' attribute has been clarified and extended to 4746 allow its use with asynchronous communication in user-provided 4747 libraries such as in implementations of the Message Passing 4748 Interface specification. 4749 4750 * Many constraints have been relaxed, in particular for the 'C_LOC' 4751 and 'C_F_POINTER' intrinsics. 4752 4753 * The 'OPTIONAL' attribute is now allowed for dummy arguments; an 4754 absent argument matches a 'NULL' pointer. 4755 4756 * Assumed types ('TYPE(*)') have been added, which may only be used 4757 for dummy arguments. They are unlimited polymorphic but contrary 4758 to 'CLASS(*)' they do not contain any type information, similar to 4759 C's 'void *' pointers. Expressions of any type and kind can be 4760 passed; thus, it can be used as replacement for 'TYPE(C_PTR)', 4761 avoiding the use of 'C_LOC' in the caller. 4762 4763 Note, however, that 'TYPE(*)' only accepts scalar arguments, unless 4764 the 'DIMENSION' is explicitly specified. As 'DIMENSION(*)' only 4765 supports array (including array elements) but no scalars, it is not 4766 a full replacement for 'C_LOC'. On the other hand, assumed-type 4767 assumed-rank dummy arguments ('TYPE(*), DIMENSION(..)') allow for 4768 both scalars and arrays, but require special code on the callee 4769 side to handle the array descriptor. 4770 4771 * Assumed-rank arrays ('DIMENSION(..)') as dummy argument allow that 4772 scalars and arrays of any rank can be passed as actual argument. 4773 As the Technical Specification does not provide for direct means to 4774 operate with them, they have to be used either from the C side or 4775 be converted using 'C_LOC' and 'C_F_POINTER' to scalars or arrays 4776 of a specific rank. The rank can be determined using the 'RANK' 4777 intrinisic. 4778 4779 Currently unimplemented: 4780 4781 * GNU Fortran always uses an array descriptor, which does not match 4782 the one of the Technical Specification. The 4783 'ISO_Fortran_binding.h' header file and the C functions it 4784 specifies are not available. 4785 4786 * Using assumed-shape, assumed-rank and deferred-shape arrays in 4787 'BIND(C)' procedures is not fully supported. In particular, C 4788 interoperable strings of other length than one are not supported as 4789 this requires the new array descriptor. 4790 4791 4792File: gfortran.info, Node: GNU Fortran Compiler Directives, Next: Non-Fortran Main Program, Prev: Interoperability with C, Up: Mixed-Language Programming 4793 47947.2 GNU Fortran Compiler Directives 4795=================================== 4796 4797* Menu: 4798 4799* ATTRIBUTES directive:: 4800* UNROLL directive:: 4801* BUILTIN directive:: 4802* IVDEP directive:: 4803* VECTOR directive:: 4804* NOVECTOR directive:: 4805 4806 4807File: gfortran.info, Node: ATTRIBUTES directive, Next: UNROLL directive, Up: GNU Fortran Compiler Directives 4808 48097.2.1 ATTRIBUTES directive 4810-------------------------- 4811 4812The Fortran standard describes how a conforming program shall behave; 4813however, the exact implementation is not standardized. In order to 4814allow the user to choose specific implementation details, compiler 4815directives can be used to set attributes of variables and procedures 4816which are not part of the standard. Whether a given attribute is 4817supported and its exact effects depend on both the operating system and 4818on the processor; see *note C Extensions: (gcc)Top. for details. 4819 4820 For procedures and procedure pointers, the following attributes can 4821be used to change the calling convention: 4822 4823 * 'CDECL' - standard C calling convention 4824 * 'STDCALL' - convention where the called procedure pops the stack 4825 * 'FASTCALL' - part of the arguments are passed via registers instead 4826 using the stack 4827 4828 Besides changing the calling convention, the attributes also 4829influence the decoration of the symbol name, e.g., by a leading 4830underscore or by a trailing at-sign followed by the number of bytes on 4831the stack. When assigning a procedure to a procedure pointer, both 4832should use the same calling convention. 4833 4834 On some systems, procedures and global variables (module variables 4835and 'COMMON' blocks) need special handling to be accessible when they 4836are in a shared library. The following attributes are available: 4837 4838 * 'DLLEXPORT' - provide a global pointer to a pointer in the DLL 4839 * 'DLLIMPORT' - reference the function or variable using a global 4840 pointer 4841 4842 For dummy arguments, the 'NO_ARG_CHECK' attribute can be used; in 4843other compilers, it is also known as 'IGNORE_TKR'. For dummy arguments 4844with this attribute actual arguments of any type and kind (similar to 4845'TYPE(*)'), scalars and arrays of any rank (no equivalent in Fortran 4846standard) are accepted. As with 'TYPE(*)', the argument is unlimited 4847polymorphic and no type information is available. Additionally, the 4848argument may only be passed to dummy arguments with the 'NO_ARG_CHECK' 4849attribute and as argument to the 'PRESENT' intrinsic function and to 4850'C_LOC' of the 'ISO_C_BINDING' module. 4851 4852 Variables with 'NO_ARG_CHECK' attribute shall be of assumed-type 4853('TYPE(*)'; recommended) or of type 'INTEGER', 'LOGICAL', 'REAL' or 4854'COMPLEX'. They shall not have the 'ALLOCATE', 'CODIMENSION', 4855'INTENT(OUT)', 'POINTER' or 'VALUE' attribute; furthermore, they shall 4856be either scalar or of assumed-size ('dimension(*)'). As 'TYPE(*)', the 4857'NO_ARG_CHECK' attribute requires an explicit interface. 4858 4859 * 'NO_ARG_CHECK' - disable the type, kind and rank checking 4860 4861 The attributes are specified using the syntax 4862 4863 '!GCC$ ATTRIBUTES' ATTRIBUTE-LIST '::' VARIABLE-LIST 4864 4865 where in free-form source code only whitespace is allowed before 4866'!GCC$' and in fixed-form source code '!GCC$', 'cGCC$' or '*GCC$' shall 4867start in the first column. 4868 4869 For procedures, the compiler directives shall be placed into the body 4870of the procedure; for variables and procedure pointers, they shall be in 4871the same declaration part as the variable or procedure pointer. 4872 4873 4874File: gfortran.info, Node: UNROLL directive, Next: BUILTIN directive, Prev: ATTRIBUTES directive, Up: GNU Fortran Compiler Directives 4875 48767.2.2 UNROLL directive 4877---------------------- 4878 4879The syntax of the directive is 4880 4881 '!GCC$ unroll N' 4882 4883 You can use this directive to control how many times a loop should be 4884unrolled. It must be placed immediately before a 'DO' loop and applies 4885only to the loop that follows. N is an integer constant specifying the 4886unrolling factor. The values of 0 and 1 block any unrolling of the 4887loop. 4888 4889 4890File: gfortran.info, Node: BUILTIN directive, Next: IVDEP directive, Prev: UNROLL directive, Up: GNU Fortran Compiler Directives 4891 48927.2.3 BUILTIN directive 4893----------------------- 4894 4895The syntax of the directive is 4896 4897 '!GCC$ BUILTIN (B) attributes simd FLAGS IF('target')' 4898 4899 You can use this directive to define which middle-end built-ins 4900provide vector implementations. 'B' is name of the middle-end built-in. 4901'FLAGS' are optional and must be either "(inbranch)" or "(notinbranch)". 4902'IF' statement is optional and is used to filter multilib ABIs for the 4903built-in that should be vectorized. Example usage: 4904 4905 !GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64') 4906 4907 The purpose of the directive is to provide an API among the GCC 4908compiler and the GNU C Library which would define vector implementations 4909of math routines. 4910 4911 4912File: gfortran.info, Node: IVDEP directive, Next: VECTOR directive, Prev: BUILTIN directive, Up: GNU Fortran Compiler Directives 4913 49147.2.4 IVDEP directive 4915--------------------- 4916 4917The syntax of the directive is 4918 4919 '!GCC$ ivdep' 4920 4921 This directive tells the compiler to ignore vector dependencies in 4922the following loop. It must be placed immediately before a 'DO' loop 4923and applies only to the loop that follows. 4924 4925 Sometimes the compiler may not have sufficient information to decide 4926whether a particular loop is vectorizable due to potential dependencies 4927between iterations. The purpose of the directive is to tell the 4928compiler that vectorization is safe. 4929 4930 This directive is intended for annotation of existing code. For new 4931code it is recommended to consider OpenMP SIMD directives as potential 4932alternative. 4933 4934 4935File: gfortran.info, Node: VECTOR directive, Next: NOVECTOR directive, Prev: IVDEP directive, Up: GNU Fortran Compiler Directives 4936 49377.2.5 VECTOR directive 4938---------------------- 4939 4940The syntax of the directive is 4941 4942 '!GCC$ vector' 4943 4944 This directive tells the compiler to vectorize the following loop. 4945It must be placed immediately before a 'DO' loop and applies only to the 4946loop that follows. 4947 4948 4949File: gfortran.info, Node: NOVECTOR directive, Prev: VECTOR directive, Up: GNU Fortran Compiler Directives 4950 49517.2.6 NOVECTOR directive 4952------------------------ 4953 4954The syntax of the directive is 4955 4956 '!GCC$ novector' 4957 4958 This directive tells the compiler to not vectorize the following 4959loop. It must be placed immediately before a 'DO' loop and applies only 4960to the loop that follows. 4961 4962 4963File: gfortran.info, Node: Non-Fortran Main Program, Next: Naming and argument-passing conventions, Prev: GNU Fortran Compiler Directives, Up: Mixed-Language Programming 4964 49657.3 Non-Fortran Main Program 4966============================ 4967 4968* Menu: 4969 4970* _gfortran_set_args:: Save command-line arguments 4971* _gfortran_set_options:: Set library option flags 4972* _gfortran_set_convert:: Set endian conversion 4973* _gfortran_set_record_marker:: Set length of record markers 4974* _gfortran_set_fpe:: Set when a Floating Point Exception should be raised 4975* _gfortran_set_max_subrecord_length:: Set subrecord length 4976 4977Even if you are doing mixed-language programming, it is very likely that 4978you do not need to know or use the information in this section. Since 4979it is about the internal structure of GNU Fortran, it may also change in 4980GCC minor releases. 4981 4982 When you compile a 'PROGRAM' with GNU Fortran, a function with the 4983name 'main' (in the symbol table of the object file) is generated, which 4984initializes the libgfortran library and then calls the actual program 4985which uses the name 'MAIN__', for historic reasons. If you link GNU 4986Fortran compiled procedures to, e.g., a C or C++ program or to a Fortran 4987program compiled by a different compiler, the libgfortran library is not 4988initialized and thus a few intrinsic procedures do not work properly, 4989e.g. those for obtaining the command-line arguments. 4990 4991 Therefore, if your 'PROGRAM' is not compiled with GNU Fortran and the 4992GNU Fortran compiled procedures require intrinsics relying on the 4993library initialization, you need to initialize the library yourself. 4994Using the default options, gfortran calls '_gfortran_set_args' and 4995'_gfortran_set_options'. The initialization of the former is needed if 4996the called procedures access the command line (and for backtracing); the 4997latter sets some flags based on the standard chosen or to enable 4998backtracing. In typical programs, it is not necessary to call any 4999initialization function. 5000 5001 If your 'PROGRAM' is compiled with GNU Fortran, you shall not call 5002any of the following functions. The libgfortran initialization 5003functions are shown in C syntax but using C bindings they are also 5004accessible from Fortran. 5005 5006 5007File: gfortran.info, Node: _gfortran_set_args, Next: _gfortran_set_options, Up: Non-Fortran Main Program 5008 50097.3.1 '_gfortran_set_args' -- Save command-line arguments 5010--------------------------------------------------------- 5011 5012_Description_: 5013 '_gfortran_set_args' saves the command-line arguments; this 5014 initialization is required if any of the command-line intrinsics is 5015 called. Additionally, it shall be called if backtracing is enabled 5016 (see '_gfortran_set_options'). 5017 5018_Syntax_: 5019 'void _gfortran_set_args (int argc, char *argv[])' 5020 5021_Arguments_: 5022 ARGC number of command line argument strings 5023 ARGV the command-line argument strings; argv[0] is 5024 the pathname of the executable itself. 5025 5026_Example_: 5027 int main (int argc, char *argv[]) 5028 { 5029 /* Initialize libgfortran. */ 5030 _gfortran_set_args (argc, argv); 5031 return 0; 5032 } 5033 5034 5035File: gfortran.info, Node: _gfortran_set_options, Next: _gfortran_set_convert, Prev: _gfortran_set_args, Up: Non-Fortran Main Program 5036 50377.3.2 '_gfortran_set_options' -- Set library option flags 5038--------------------------------------------------------- 5039 5040_Description_: 5041 '_gfortran_set_options' sets several flags related to the Fortran 5042 standard to be used, whether backtracing should be enabled and 5043 whether range checks should be performed. The syntax allows for 5044 upward compatibility since the number of passed flags is specified; 5045 for non-passed flags, the default value is used. See also *note 5046 Code Gen Options::. Please note that not all flags are actually 5047 used. 5048 5049_Syntax_: 5050 'void _gfortran_set_options (int num, int options[])' 5051 5052_Arguments_: 5053 NUM number of options passed 5054 ARGV The list of flag values 5055 5056_option flag list_: 5057 OPTION[0] Allowed standard; can give run-time errors if 5058 e.g. an input-output edit descriptor is invalid 5059 in a given standard. Possible values are 5060 (bitwise or-ed) 'GFC_STD_F77' (1), 5061 'GFC_STD_F95_OBS' (2), 'GFC_STD_F95_DEL' (4), 5062 'GFC_STD_F95' (8), 'GFC_STD_F2003' (16), 5063 'GFC_STD_GNU' (32), 'GFC_STD_LEGACY' (64), 5064 'GFC_STD_F2008' (128), 'GFC_STD_F2008_OBS' 5065 (256), 'GFC_STD_F2008_TS' (512), 'GFC_STD_F2018' 5066 (1024), 'GFC_STD_F2018_OBS' (2048), and 5067 'GFC_STD=F2018_DEL' (4096). Default: 5068 'GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95 5069 | GFC_STD_F2003 | GFC_STD_F2008 | 5070 GFC_STD_F2008_TS | GFC_STD_F2008_OBS | 5071 GFC_STD_F77 | GFC_STD_F2018 | GFC_STD_F2018_OBS 5072 | GFC_STD_F2018_DEL | GFC_STD_GNU | 5073 GFC_STD_LEGACY'. 5074 OPTION[1] Standard-warning flag; prints a warning to 5075 standard error. Default: 'GFC_STD_F95_DEL | 5076 GFC_STD_LEGACY'. 5077 OPTION[2] If non zero, enable pedantic checking. Default: 5078 off. 5079 OPTION[3] Unused. 5080 OPTION[4] If non zero, enable backtracing on run-time 5081 errors. Default: off. (Default in the 5082 compiler: on.) Note: Installs a signal handler 5083 and requires command-line initialization using 5084 '_gfortran_set_args'. 5085 OPTION[5] If non zero, supports signed zeros. Default: 5086 enabled. 5087 OPTION[6] Enables run-time checking. Possible values are 5088 (bitwise or-ed): GFC_RTCHECK_BOUNDS (1), 5089 GFC_RTCHECK_ARRAY_TEMPS (2), 5090 GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO (16), 5091 GFC_RTCHECK_POINTER (32), GFC_RTCHECK_BITS (64). 5092 Default: disabled. 5093 OPTION[7] Unused. 5094 OPTION[8] Show a warning when invoking 'STOP' and 'ERROR 5095 STOP' if a floating-point exception occurred. 5096 Possible values are (bitwise or-ed) 5097 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2), 5098 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8), 5099 'GFC_FPE_UNDERFLOW' (16), 'GFC_FPE_INEXACT' 5100 (32). Default: None (0). (Default in the 5101 compiler: 'GFC_FPE_INVALID | GFC_FPE_DENORMAL | 5102 GFC_FPE_ZERO | GFC_FPE_OVERFLOW | 5103 GFC_FPE_UNDERFLOW'.) 5104 5105_Example_: 5106 /* Use gfortran 4.9 default options. */ 5107 static int options[] = {68, 511, 0, 0, 1, 1, 0, 0, 31}; 5108 _gfortran_set_options (9, &options); 5109 5110 5111File: gfortran.info, Node: _gfortran_set_convert, Next: _gfortran_set_record_marker, Prev: _gfortran_set_options, Up: Non-Fortran Main Program 5112 51137.3.3 '_gfortran_set_convert' -- Set endian conversion 5114------------------------------------------------------ 5115 5116_Description_: 5117 '_gfortran_set_convert' set the representation of data for 5118 unformatted files. 5119 5120_Syntax_: 5121 'void _gfortran_set_convert (int conv)' 5122 5123_Arguments_: 5124 CONV Endian conversion, possible values: 5125 GFC_CONVERT_NATIVE (0, default), 5126 GFC_CONVERT_SWAP (1), GFC_CONVERT_BIG (2), 5127 GFC_CONVERT_LITTLE (3). 5128 5129_Example_: 5130 int main (int argc, char *argv[]) 5131 { 5132 /* Initialize libgfortran. */ 5133 _gfortran_set_args (argc, argv); 5134 _gfortran_set_convert (1); 5135 return 0; 5136 } 5137 5138 5139File: gfortran.info, Node: _gfortran_set_record_marker, Next: _gfortran_set_fpe, Prev: _gfortran_set_convert, Up: Non-Fortran Main Program 5140 51417.3.4 '_gfortran_set_record_marker' -- Set length of record markers 5142------------------------------------------------------------------- 5143 5144_Description_: 5145 '_gfortran_set_record_marker' sets the length of record markers for 5146 unformatted files. 5147 5148_Syntax_: 5149 'void _gfortran_set_record_marker (int val)' 5150 5151_Arguments_: 5152 VAL Length of the record marker; valid values are 4 5153 and 8. Default is 4. 5154 5155_Example_: 5156 int main (int argc, char *argv[]) 5157 { 5158 /* Initialize libgfortran. */ 5159 _gfortran_set_args (argc, argv); 5160 _gfortran_set_record_marker (8); 5161 return 0; 5162 } 5163 5164 5165File: gfortran.info, Node: _gfortran_set_fpe, Next: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_record_marker, Up: Non-Fortran Main Program 5166 51677.3.5 '_gfortran_set_fpe' -- Enable floating point exception traps 5168------------------------------------------------------------------ 5169 5170_Description_: 5171 '_gfortran_set_fpe' enables floating point exception traps for the 5172 specified exceptions. On most systems, this will result in a 5173 SIGFPE signal being sent and the program being aborted. 5174 5175_Syntax_: 5176 'void _gfortran_set_fpe (int val)' 5177 5178_Arguments_: 5179 OPTION[0] IEEE exceptions. Possible values are (bitwise 5180 or-ed) zero (0, default) no trapping, 5181 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2), 5182 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8), 5183 'GFC_FPE_UNDERFLOW' (16), and 'GFC_FPE_INEXACT' 5184 (32). 5185 5186_Example_: 5187 int main (int argc, char *argv[]) 5188 { 5189 /* Initialize libgfortran. */ 5190 _gfortran_set_args (argc, argv); 5191 /* FPE for invalid operations such as SQRT(-1.0). */ 5192 _gfortran_set_fpe (1); 5193 return 0; 5194 } 5195 5196 5197File: gfortran.info, Node: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_fpe, Up: Non-Fortran Main Program 5198 51997.3.6 '_gfortran_set_max_subrecord_length' -- Set subrecord length 5200------------------------------------------------------------------ 5201 5202_Description_: 5203 '_gfortran_set_max_subrecord_length' set the maximum length for a 5204 subrecord. This option only makes sense for testing and debugging 5205 of unformatted I/O. 5206 5207_Syntax_: 5208 'void _gfortran_set_max_subrecord_length (int val)' 5209 5210_Arguments_: 5211 VAL the maximum length for a subrecord; the maximum 5212 permitted value is 2147483639, which is also the 5213 default. 5214 5215_Example_: 5216 int main (int argc, char *argv[]) 5217 { 5218 /* Initialize libgfortran. */ 5219 _gfortran_set_args (argc, argv); 5220 _gfortran_set_max_subrecord_length (8); 5221 return 0; 5222 } 5223 5224 5225File: gfortran.info, Node: Naming and argument-passing conventions, Prev: Non-Fortran Main Program, Up: Mixed-Language Programming 5226 52277.4 Naming and argument-passing conventions 5228=========================================== 5229 5230This section gives an overview about the naming convention of procedures 5231and global variables and about the argument passing conventions used by 5232GNU Fortran. If a C binding has been specified, the naming convention 5233and some of the argument-passing conventions change. If possible, 5234mixed-language and mixed-compiler projects should use the better defined 5235C binding for interoperability. See *note Interoperability with C::. 5236 5237* Menu: 5238 5239* Naming conventions:: 5240* Argument passing conventions:: 5241 5242 5243File: gfortran.info, Node: Naming conventions, Next: Argument passing conventions, Up: Naming and argument-passing conventions 5244 52457.4.1 Naming conventions 5246------------------------ 5247 5248According the Fortran standard, valid Fortran names consist of a letter 5249between 'A' to 'Z', 'a' to 'z', digits '0', '1' to '9' and underscores 5250('_') with the restriction that names may only start with a letter. As 5251vendor extension, the dollar sign ('$') is additionally permitted with 5252the option '-fdollar-ok', but not as first character and only if the 5253target system supports it. 5254 5255 By default, the procedure name is the lower-cased Fortran name with 5256an appended underscore ('_'); using '-fno-underscoring' no underscore is 5257appended while '-fsecond-underscore' appends two underscores. Depending 5258on the target system and the calling convention, the procedure might be 5259additionally dressed; for instance, on 32bit Windows with 'stdcall', an 5260at-sign '@' followed by an integer number is appended. For the changing 5261the calling convention, see *note GNU Fortran Compiler Directives::. 5262 5263 For common blocks, the same convention is used, i.e. by default an 5264underscore is appended to the lower-cased Fortran name. Blank commons 5265have the name '__BLNK__'. 5266 5267 For procedures and variables declared in the specification space of a 5268module, the name is formed by '__', followed by the lower-cased module 5269name, '_MOD_', and the lower-cased Fortran name. Note that no 5270underscore is appended. 5271 5272 5273File: gfortran.info, Node: Argument passing conventions, Prev: Naming conventions, Up: Naming and argument-passing conventions 5274 52757.4.2 Argument passing conventions 5276---------------------------------- 5277 5278Subroutines do not return a value (matching C99's 'void') while 5279functions either return a value as specified in the platform ABI or the 5280result variable is passed as hidden argument to the function and no 5281result is returned. A hidden result variable is used when the result 5282variable is an array or of type 'CHARACTER'. 5283 5284 Arguments are passed according to the platform ABI. In particular, 5285complex arguments might not be compatible to a struct with two real 5286components for the real and imaginary part. The argument passing 5287matches the one of C99's '_Complex'. Functions with scalar complex 5288result variables return their value and do not use a by-reference 5289argument. Note that with the '-ff2c' option, the argument passing is 5290modified and no longer completely matches the platform ABI. Some other 5291Fortran compilers use 'f2c' semantic by default; this might cause 5292problems with interoperablility. 5293 5294 GNU Fortran passes most arguments by reference, i.e. by passing a 5295pointer to the data. Note that the compiler might use a temporary 5296variable into which the actual argument has been copied, if required 5297semantically (copy-in/copy-out). 5298 5299 For arguments with 'ALLOCATABLE' and 'POINTER' attribute (including 5300procedure pointers), a pointer to the pointer is passed such that the 5301pointer address can be modified in the procedure. 5302 5303 For dummy arguments with the 'VALUE' attribute: Scalar arguments of 5304the type 'INTEGER', 'LOGICAL', 'REAL' and 'COMPLEX' are passed by value 5305according to the platform ABI. (As vendor extension and not recommended, 5306using '%VAL()' in the call to a procedure has the same effect.) For 5307'TYPE(C_PTR)' and procedure pointers, the pointer itself is passed such 5308that it can be modified without affecting the caller. 5309 5310 For Boolean ('LOGICAL') arguments, please note that GCC expects only 5311the integer value 0 and 1. If a GNU Fortran 'LOGICAL' variable contains 5312another integer value, the result is undefined. As some other Fortran 5313compilers use -1 for '.TRUE.', extra care has to be taken - such as 5314passing the value as 'INTEGER'. (The same value restriction also 5315applies to other front ends of GCC, e.g. to GCC's C99 compiler for 5316'_Bool' or GCC's Ada compiler for 'Boolean'.) 5317 5318 For arguments of 'CHARACTER' type, the character length is passed as 5319a hidden argument at the end of the argument list. For deferred-length 5320strings, the value is passed by reference, otherwise by value. The 5321character length has the C type 'size_t' (or 'INTEGER(kind=C_SIZE_T)' in 5322Fortran). Note that this is different to older versions of the GNU 5323Fortran compiler, where the type of the hidden character length argument 5324was a C 'int'. In order to retain compatibility with older versions, 5325one can e.g. for the following Fortran procedure 5326 5327 subroutine fstrlen (s, a) 5328 character(len=*) :: s 5329 integer :: a 5330 print*, len(s) 5331 end subroutine fstrlen 5332 5333 define the corresponding C prototype as follows: 5334 5335 #if __GNUC__ > 7 5336 typedef size_t fortran_charlen_t; 5337 #else 5338 typedef int fortran_charlen_t; 5339 #endif 5340 5341 void fstrlen_ (char*, int*, fortran_charlen_t); 5342 5343 In order to avoid such compiler-specific details, for new code it is 5344instead recommended to use the ISO_C_BINDING feature. 5345 5346 Note with C binding, 'CHARACTER(len=1)' result variables are returned 5347according to the platform ABI and no hidden length argument is used for 5348dummy arguments; with 'VALUE', those variables are passed by value. 5349 5350 For 'OPTIONAL' dummy arguments, an absent argument is denoted by a 5351NULL pointer, except for scalar dummy arguments of type 'INTEGER', 5352'LOGICAL', 'REAL' and 'COMPLEX' which have the 'VALUE' attribute. For 5353those, a hidden Boolean argument ('logical(kind=C_bool),value') is used 5354to indicate whether the argument is present. 5355 5356 Arguments which are assumed-shape, assumed-rank or deferred-rank 5357arrays or, with '-fcoarray=lib', allocatable scalar coarrays use an 5358array descriptor. All other arrays pass the address of the first 5359element of the array. With '-fcoarray=lib', the token and the offset 5360belonging to nonallocatable coarrays dummy arguments are passed as 5361hidden argument along the character length hidden arguments. The token 5362is an oparque pointer identifying the coarray and the offset is a 5363passed-by-value integer of kind 'C_PTRDIFF_T', denoting the byte offset 5364between the base address of the coarray and the passed scalar or first 5365element of the passed array. 5366 5367 The arguments are passed in the following order 5368 * Result variable, when the function result is passed by reference 5369 * Character length of the function result, if it is a of type 5370 'CHARACTER' and no C binding is used 5371 * The arguments in the order in which they appear in the Fortran 5372 declaration 5373 * The the present status for optional arguments with value attribute, 5374 which are internally passed by value 5375 * The character length and/or coarray token and offset for the first 5376 argument which is a 'CHARACTER' or a nonallocatable coarray dummy 5377 argument, followed by the hidden arguments of the next dummy 5378 argument of such a type 5379 5380 5381File: gfortran.info, Node: Coarray Programming, Next: Intrinsic Procedures, Prev: Mixed-Language Programming, Up: Top 5382 53838 Coarray Programming 5384********************* 5385 5386* Menu: 5387 5388* Type and enum ABI Documentation:: 5389* Function ABI Documentation:: 5390 5391 5392File: gfortran.info, Node: Type and enum ABI Documentation, Next: Function ABI Documentation, Up: Coarray Programming 5393 53948.1 Type and enum ABI Documentation 5395=================================== 5396 5397* Menu: 5398 5399* caf_token_t:: 5400* caf_register_t:: 5401* caf_deregister_t:: 5402* caf_reference_t:: 5403* caf_team_t:: 5404 5405 5406File: gfortran.info, Node: caf_token_t, Next: caf_register_t, Up: Type and enum ABI Documentation 5407 54088.1.1 'caf_token_t' 5409------------------- 5410 5411Typedef of type 'void *' on the compiler side. Can be any data type on 5412the library side. 5413 5414 5415File: gfortran.info, Node: caf_register_t, Next: caf_deregister_t, Prev: caf_token_t, Up: Type and enum ABI Documentation 5416 54178.1.2 'caf_register_t' 5418---------------------- 5419 5420Indicates which kind of coarray variable should be registered. 5421 5422typedef enum caf_register_t { 5423 CAF_REGTYPE_COARRAY_STATIC, 5424 CAF_REGTYPE_COARRAY_ALLOC, 5425 CAF_REGTYPE_LOCK_STATIC, 5426 CAF_REGTYPE_LOCK_ALLOC, 5427 CAF_REGTYPE_CRITICAL, 5428 CAF_REGTYPE_EVENT_STATIC, 5429 CAF_REGTYPE_EVENT_ALLOC, 5430 CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY, 5431 CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY 5432} 5433caf_register_t; 5434 5435 The values 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and 5436'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' are for allocatable components 5437in derived type coarrays only. The first one sets up the token without 5438allocating memory for allocatable component. The latter one only 5439allocates the memory for an allocatable component in a derived type 5440coarray. The token needs to be setup previously by the REGISTER_ONLY. 5441This allows to have allocatable components un-allocated on some images. 5442The status whether an allocatable component is allocated on a remote 5443image can be queried by '_caf_is_present' which used internally by the 5444'ALLOCATED' intrinsic. 5445 5446 5447File: gfortran.info, Node: caf_deregister_t, Next: caf_reference_t, Prev: caf_register_t, Up: Type and enum ABI Documentation 5448 54498.1.3 'caf_deregister_t' 5450------------------------ 5451 5452typedef enum caf_deregister_t { 5453 CAF_DEREGTYPE_COARRAY_DEREGISTER, 5454 CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY 5455} 5456caf_deregister_t; 5457 5458 Allows to specifiy the type of deregistration of a coarray object. 5459The 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' flag is only allowed for 5460allocatable components in derived type coarrays. 5461 5462 5463File: gfortran.info, Node: caf_reference_t, Next: caf_team_t, Prev: caf_deregister_t, Up: Type and enum ABI Documentation 5464 54658.1.4 'caf_reference_t' 5466----------------------- 5467 5468The structure used for implementing arbitrary reference chains. A 5469'CAF_REFERENCE_T' allows to specify a component reference or any kind of 5470array reference of any rank supported by gfortran. For array references 5471all kinds as known by the compiler/Fortran standard are supported 5472indicated by a 'MODE'. 5473 5474typedef enum caf_ref_type_t { 5475 /* Reference a component of a derived type, either regular one or an 5476 allocatable or pointer type. For regular ones idx in caf_reference_t is 5477 set to -1. */ 5478 CAF_REF_COMPONENT, 5479 /* Reference an allocatable array. */ 5480 CAF_REF_ARRAY, 5481 /* Reference a non-allocatable/non-pointer array. I.e., the coarray object 5482 has no array descriptor associated and the addressing is done 5483 completely using the ref. */ 5484 CAF_REF_STATIC_ARRAY 5485} caf_ref_type_t; 5486 5487typedef enum caf_array_ref_t { 5488 /* No array ref. This terminates the array ref. */ 5489 CAF_ARR_REF_NONE = 0, 5490 /* Reference array elements given by a vector. Only for this mode 5491 caf_reference_t.u.a.dim[i].v is valid. */ 5492 CAF_ARR_REF_VECTOR, 5493 /* A full array ref (:). */ 5494 CAF_ARR_REF_FULL, 5495 /* Reference a range on elements given by start, end and stride. */ 5496 CAF_ARR_REF_RANGE, 5497 /* Only a single item is referenced given in the start member. */ 5498 CAF_ARR_REF_SINGLE, 5499 /* An array ref of the kind (i:), where i is an arbitrary valid index in the 5500 array. The index i is given in the start member. */ 5501 CAF_ARR_REF_OPEN_END, 5502 /* An array ref of the kind (:i), where the lower bound of the array ref 5503 is given by the remote side. The index i is given in the end member. */ 5504 CAF_ARR_REF_OPEN_START 5505} caf_array_ref_t; 5506 5507/* References to remote components of a derived type. */ 5508typedef struct caf_reference_t { 5509 /* A pointer to the next ref or NULL. */ 5510 struct caf_reference_t *next; 5511 /* The type of the reference. */ 5512 /* caf_ref_type_t, replaced by int to allow specification in fortran FE. */ 5513 int type; 5514 /* The size of an item referenced in bytes. I.e. in an array ref this is 5515 the factor to advance the array pointer with to get to the next item. 5516 For component refs this gives just the size of the element referenced. */ 5517 size_t item_size; 5518 union { 5519 struct { 5520 /* The offset (in bytes) of the component in the derived type. 5521 Unused for allocatable or pointer components. */ 5522 ptrdiff_t offset; 5523 /* The offset (in bytes) to the caf_token associated with this 5524 component. NULL, when not allocatable/pointer ref. */ 5525 ptrdiff_t caf_token_offset; 5526 } c; 5527 struct { 5528 /* The mode of the array ref. See CAF_ARR_REF_*. */ 5529 /* caf_array_ref_t, replaced by unsigend char to allow specification in 5530 fortran FE. */ 5531 unsigned char mode[GFC_MAX_DIMENSIONS]; 5532 /* The type of a static array. Unset for array's with descriptors. */ 5533 int static_array_type; 5534 /* Subscript refs (s) or vector refs (v). */ 5535 union { 5536 struct { 5537 /* The start and end boundary of the ref and the stride. */ 5538 index_type start, end, stride; 5539 } s; 5540 struct { 5541 /* nvec entries of kind giving the elements to reference. */ 5542 void *vector; 5543 /* The number of entries in vector. */ 5544 size_t nvec; 5545 /* The integer kind used for the elements in vector. */ 5546 int kind; 5547 } v; 5548 } dim[GFC_MAX_DIMENSIONS]; 5549 } a; 5550 } u; 5551} caf_reference_t; 5552 5553 The references make up a single linked list of reference operations. 5554The 'NEXT' member links to the next reference or NULL to indicate the 5555end of the chain. Component and array refs can be arbitrarly mixed as 5556long as they comply to the Fortran standard. 5557 5558 _NOTES_ The member 'STATIC_ARRAY_TYPE' is used only when the 'TYPE' 5559is 'CAF_REF_STATIC_ARRAY'. The member gives the type of the data 5560referenced. Because no array descriptor is available for a 5561descriptor-less array and type conversion still needs to take place the 5562type is transported here. 5563 5564 At the moment 'CAF_ARR_REF_VECTOR' is not implemented in the front 5565end for descriptor-less arrays. The library caf_single has untested 5566support for it. 5567 5568 5569File: gfortran.info, Node: caf_team_t, Prev: caf_reference_t, Up: Type and enum ABI Documentation 5570 55718.1.5 'caf_team_t' 5572------------------ 5573 5574Opaque pointer to represent a team-handle. This type is a stand-in for 5575the future implementation of teams. It is about to change without 5576further notice. 5577 5578 5579File: gfortran.info, Node: Function ABI Documentation, Prev: Type and enum ABI Documentation, Up: Coarray Programming 5580 55818.2 Function ABI Documentation 5582============================== 5583 5584* Menu: 5585 5586* _gfortran_caf_init:: Initialiation function 5587* _gfortran_caf_finish:: Finalization function 5588* _gfortran_caf_this_image:: Querying the image number 5589* _gfortran_caf_num_images:: Querying the maximal number of images 5590* _gfortran_caf_image_status :: Query the status of an image 5591* _gfortran_caf_failed_images :: Get an array of the indexes of the failed images 5592* _gfortran_caf_stopped_images :: Get an array of the indexes of the stopped images 5593* _gfortran_caf_register:: Registering coarrays 5594* _gfortran_caf_deregister:: Deregistering coarrays 5595* _gfortran_caf_is_present:: Query whether an allocatable or pointer component in a derived type coarray is allocated 5596* _gfortran_caf_send:: Sending data from a local image to a remote image 5597* _gfortran_caf_get:: Getting data from a remote image 5598* _gfortran_caf_sendget:: Sending data between remote images 5599* _gfortran_caf_send_by_ref:: Sending data from a local image to a remote image using enhanced references 5600* _gfortran_caf_get_by_ref:: Getting data from a remote image using enhanced references 5601* _gfortran_caf_sendget_by_ref:: Sending data between remote images using enhanced references 5602* _gfortran_caf_lock:: Locking a lock variable 5603* _gfortran_caf_unlock:: Unlocking a lock variable 5604* _gfortran_caf_event_post:: Post an event 5605* _gfortran_caf_event_wait:: Wait that an event occurred 5606* _gfortran_caf_event_query:: Query event count 5607* _gfortran_caf_sync_all:: All-image barrier 5608* _gfortran_caf_sync_images:: Barrier for selected images 5609* _gfortran_caf_sync_memory:: Wait for completion of segment-memory operations 5610* _gfortran_caf_error_stop:: Error termination with exit code 5611* _gfortran_caf_error_stop_str:: Error termination with string 5612* _gfortran_caf_fail_image :: Mark the image failed and end its execution 5613* _gfortran_caf_atomic_define:: Atomic variable assignment 5614* _gfortran_caf_atomic_ref:: Atomic variable reference 5615* _gfortran_caf_atomic_cas:: Atomic compare and swap 5616* _gfortran_caf_atomic_op:: Atomic operation 5617* _gfortran_caf_co_broadcast:: Sending data to all images 5618* _gfortran_caf_co_max:: Collective maximum reduction 5619* _gfortran_caf_co_min:: Collective minimum reduction 5620* _gfortran_caf_co_sum:: Collective summing reduction 5621* _gfortran_caf_co_reduce:: Generic collective reduction 5622 5623 5624File: gfortran.info, Node: _gfortran_caf_init, Next: _gfortran_caf_finish, Up: Function ABI Documentation 5625 56268.2.1 '_gfortran_caf_init' -- Initialiation function 5627---------------------------------------------------- 5628 5629_Description_: 5630 This function is called at startup of the program before the 5631 Fortran main program, if the latter has been compiled with 5632 '-fcoarray=lib'. It takes as arguments the command-line arguments 5633 of the program. It is permitted to pass two 'NULL' pointers as 5634 argument; if non-'NULL', the library is permitted to modify the 5635 arguments. 5636 5637_Syntax_: 5638 'void _gfortran_caf_init (int *argc, char ***argv)' 5639 5640_Arguments_: 5641 ARGC intent(inout) An integer pointer with the number 5642 of arguments passed to the program or 'NULL'. 5643 ARGV intent(inout) A pointer to an array of strings 5644 with the command-line arguments or 'NULL'. 5645 5646_NOTES_ 5647 The function is modelled after the initialization function of the 5648 Message Passing Interface (MPI) specification. Due to the way 5649 coarray registration works, it might not be the first call to the 5650 library. If the main program is not written in Fortran and only a 5651 library uses coarrays, it can happen that this function is never 5652 called. Therefore, it is recommended that the library does not 5653 rely on the passed arguments and whether the call has been done. 5654 5655 5656File: gfortran.info, Node: _gfortran_caf_finish, Next: _gfortran_caf_this_image, Prev: _gfortran_caf_init, Up: Function ABI Documentation 5657 56588.2.2 '_gfortran_caf_finish' -- Finalization function 5659----------------------------------------------------- 5660 5661_Description_: 5662 This function is called at the end of the Fortran main program, if 5663 it has been compiled with the '-fcoarray=lib' option. 5664 5665_Syntax_: 5666 'void _gfortran_caf_finish (void)' 5667 5668_NOTES_ 5669 For non-Fortran programs, it is recommended to call the function at 5670 the end of the main program. To ensure that the shutdown is also 5671 performed for programs where this function is not explicitly 5672 invoked, for instance non-Fortran programs or calls to the system's 5673 exit() function, the library can use a destructor function. Note 5674 that programs can also be terminated using the STOP and ERROR STOP 5675 statements; those use different library calls. 5676 5677 5678File: gfortran.info, Node: _gfortran_caf_this_image, Next: _gfortran_caf_num_images, Prev: _gfortran_caf_finish, Up: Function ABI Documentation 5679 56808.2.3 '_gfortran_caf_this_image' -- Querying the image number 5681------------------------------------------------------------- 5682 5683_Description_: 5684 This function returns the current image number, which is a positive 5685 number. 5686 5687_Syntax_: 5688 'int _gfortran_caf_this_image (int distance)' 5689 5690_Arguments_: 5691 DISTANCE As specified for the 'this_image' intrinsic in 5692 TS18508. Shall be a non-negative number. 5693 5694_NOTES_ 5695 If the Fortran intrinsic 'this_image' is invoked without an 5696 argument, which is the only permitted form in Fortran 2008, GCC 5697 passes '0' as first argument. 5698 5699 5700File: gfortran.info, Node: _gfortran_caf_num_images, Next: _gfortran_caf_image_status, Prev: _gfortran_caf_this_image, Up: Function ABI Documentation 5701 57028.2.4 '_gfortran_caf_num_images' -- Querying the maximal number of images 5703------------------------------------------------------------------------- 5704 5705_Description_: 5706 This function returns the number of images in the current team, if 5707 DISTANCE is 0 or the number of images in the parent team at the 5708 specified distance. If failed is -1, the function returns the 5709 number of all images at the specified distance; if it is 0, the 5710 function returns the number of nonfailed images, and if it is 1, it 5711 returns the number of failed images. 5712 5713_Syntax_: 5714 'int _gfortran_caf_num_images(int distance, int failed)' 5715 5716_Arguments_: 5717 DISTANCE the distance from this image to the ancestor. 5718 Shall be positive. 5719 FAILED shall be -1, 0, or 1 5720 5721_NOTES_ 5722 This function follows TS18508. If the num_image intrinsic has no 5723 arguments, then the compiler passes 'distance=0' and 'failed=-1' to 5724 the function. 5725 5726 5727File: gfortran.info, Node: _gfortran_caf_image_status, Next: _gfortran_caf_failed_images, Prev: _gfortran_caf_num_images, Up: Function ABI Documentation 5728 57298.2.5 '_gfortran_caf_image_status' -- Query the status of an image 5730------------------------------------------------------------------ 5731 5732_Description_: 5733 Get the status of the image given by the id IMAGE of the team given 5734 by TEAM. Valid results are zero, for image is ok, 5735 'STAT_STOPPED_IMAGE' from the ISO_FORTRAN_ENV module to indicate 5736 that the image has been stopped and 'STAT_FAILED_IMAGE' also from 5737 ISO_FORTRAN_ENV to indicate that the image has executed a 'FAIL 5738 IMAGE' statement. 5739 5740_Syntax_: 5741 'int _gfortran_caf_image_status (int image, caf_team_t * team)' 5742 5743_Arguments_: 5744 IMAGE the positive scalar id of the image in the 5745 current TEAM. 5746 TEAM optional; team on the which the inquiry is to be 5747 performed. 5748 5749_NOTES_ 5750 This function follows TS18508. Because team-functionality is not 5751 yet implemented a null-pointer is passed for the TEAM argument at 5752 the moment. 5753 5754 5755File: gfortran.info, Node: _gfortran_caf_failed_images, Next: _gfortran_caf_stopped_images, Prev: _gfortran_caf_image_status, Up: Function ABI Documentation 5756 57578.2.6 '_gfortran_caf_failed_images' -- Get an array of the indexes of the failed images 5758--------------------------------------------------------------------------------------- 5759 5760_Description_: 5761 Get an array of image indexes in the current TEAM that have failed. 5762 The array is sorted ascendingly. When TEAM is not provided the 5763 current team is to be used. When KIND is provided then the 5764 resulting array is of that integer kind else it is of default 5765 integer kind. The returns an unallocated size zero array when no 5766 images have failed. 5767 5768_Syntax_: 5769 'int _gfortran_caf_failed_images (caf_team_t * team, int * kind)' 5770 5771_Arguments_: 5772 TEAM optional; team on the which the inquiry is to be 5773 performed. 5774 IMAGE optional; the kind of the resulting integer 5775 array. 5776 5777_NOTES_ 5778 This function follows TS18508. Because team-functionality is not 5779 yet implemented a null-pointer is passed for the TEAM argument at 5780 the moment. 5781 5782 5783File: gfortran.info, Node: _gfortran_caf_stopped_images, Next: _gfortran_caf_register, Prev: _gfortran_caf_failed_images, Up: Function ABI Documentation 5784 57858.2.7 '_gfortran_caf_stopped_images' -- Get an array of the indexes of the stopped images 5786----------------------------------------------------------------------------------------- 5787 5788_Description_: 5789 Get an array of image indexes in the current TEAM that have 5790 stopped. The array is sorted ascendingly. When TEAM is not 5791 provided the current team is to be used. When KIND is provided 5792 then the resulting array is of that integer kind else it is of 5793 default integer kind. The returns an unallocated size zero array 5794 when no images have failed. 5795 5796_Syntax_: 5797 'int _gfortran_caf_stopped_images (caf_team_t * team, int * kind)' 5798 5799_Arguments_: 5800 TEAM optional; team on the which the inquiry is to be 5801 performed. 5802 IMAGE optional; the kind of the resulting integer 5803 array. 5804 5805_NOTES_ 5806 This function follows TS18508. Because team-functionality is not 5807 yet implemented a null-pointer is passed for the TEAM argument at 5808 the moment. 5809 5810 5811File: gfortran.info, Node: _gfortran_caf_register, Next: _gfortran_caf_deregister, Prev: _gfortran_caf_stopped_images, Up: Function ABI Documentation 5812 58138.2.8 '_gfortran_caf_register' -- Registering coarrays 5814------------------------------------------------------ 5815 5816_Description_: 5817 Registers memory for a coarray and creates a token to identify the 5818 coarray. The routine is called for both coarrays with 'SAVE' 5819 attribute and using an explicit 'ALLOCATE' statement. If an error 5820 occurs and STAT is a 'NULL' pointer, the function shall abort with 5821 printing an error message and starting the error termination. If 5822 no error occurs and STAT is present, it shall be set to zero. 5823 Otherwise, it shall be set to a positive value and, if not-'NULL', 5824 ERRMSG shall be set to a string describing the failure. The 5825 routine shall register the memory provided in the 'DATA'-component 5826 of the array descriptor DESC, when that component is non-'NULL', 5827 else it shall allocate sufficient memory and provide a pointer to 5828 it in the 'DATA'-component of DESC. The array descriptor has rank 5829 zero, when a scalar object is to be registered and the array 5830 descriptor may be invalid after the call to 5831 '_gfortran_caf_register'. When an array is to be allocated the 5832 descriptor persists. 5833 5834 For 'CAF_REGTYPE_COARRAY_STATIC' and 'CAF_REGTYPE_COARRAY_ALLOC', 5835 the passed size is the byte size requested. For 5836 'CAF_REGTYPE_LOCK_STATIC', 'CAF_REGTYPE_LOCK_ALLOC' and 5837 'CAF_REGTYPE_CRITICAL' it is the array size or one for a scalar. 5838 5839 When 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' is used, then only a 5840 token for an allocatable or pointer component is created. The 5841 'SIZE' parameter is not used then. On the contrary when 5842 'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' is specified, then the 5843 TOKEN needs to be registered by a previous call with regtype 5844 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and either the memory 5845 specified in the DESC's data-ptr is registered or allocate when the 5846 data-ptr is 'NULL'. 5847 5848_Syntax_: 5849 'void caf_register (size_t size, caf_register_t type, caf_token_t 5850 *token, gfc_descriptor_t *desc, int *stat, char *errmsg, size_t 5851 errmsg_len)' 5852 5853_Arguments_: 5854 SIZE For normal coarrays, the byte size of the 5855 coarray to be allocated; for lock types and 5856 event types, the number of elements. 5857 TYPE one of the caf_register_t types. 5858 TOKEN intent(out) An opaque pointer identifying the 5859 coarray. 5860 DESC intent(inout) The (pseudo) array descriptor. 5861 STAT intent(out) For allocatable coarrays, stores the 5862 STAT=; may be 'NULL' 5863 ERRMSG intent(out) When an error occurs, this will be 5864 set to an error message; may be 'NULL' 5865 ERRMSG_LEN the buffer size of errmsg. 5866 5867_NOTES_ 5868 Nonallocatable coarrays have to be registered prior use from remote 5869 images. In order to guarantee this, they have to be registered 5870 before the main program. This can be achieved by creating 5871 constructor functions. That is what GCC does such that also for 5872 nonallocatable coarrays the memory is allocated and no static 5873 memory is used. The token permits to identify the coarray; to the 5874 processor, the token is a nonaliasing pointer. The library can, 5875 for instance, store the base address of the coarray in the token, 5876 some handle or a more complicated struct. The library may also 5877 store the array descriptor DESC when its rank is non-zero. 5878 5879 For lock types, the value shall only be used for checking the 5880 allocation status. Note that for critical blocks, the locking is 5881 only required on one image; in the locking statement, the processor 5882 shall always pass an image index of one for critical-block lock 5883 variables ('CAF_REGTYPE_CRITICAL'). For lock types and 5884 critical-block variables, the initial value shall be unlocked (or, 5885 respecitively, not in critical section) such as the value false; 5886 for event types, the initial state should be no event, e.g. zero. 5887 5888 5889File: gfortran.info, Node: _gfortran_caf_deregister, Next: _gfortran_caf_is_present, Prev: _gfortran_caf_register, Up: Function ABI Documentation 5890 58918.2.9 '_gfortran_caf_deregister' -- Deregistering coarrays 5892---------------------------------------------------------- 5893 5894_Description_: 5895 Called to free or deregister the memory of a coarray; the processor 5896 calls this function for automatic and explicit deallocation. In 5897 case of an error, this function shall fail with an error message, 5898 unless the STAT variable is not null. The library is only expected 5899 to free memory it allocated itself during a call to 5900 '_gfortran_caf_register'. 5901 5902_Syntax_: 5903 'void caf_deregister (caf_token_t *token, caf_deregister_t type, 5904 int *stat, char *errmsg, size_t errmsg_len)' 5905 5906_Arguments_: 5907 TOKEN the token to free. 5908 TYPE the type of action to take for the coarray. A 5909 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' is 5910 allowed only for allocatable or pointer 5911 components of derived type coarrays. The action 5912 only deallocates the local memory without 5913 deleting the token. 5914 STAT intent(out) Stores the STAT=; may be NULL 5915 ERRMSG intent(out) When an error occurs, this will be 5916 set to an error message; may be NULL 5917 ERRMSG_LEN the buffer size of errmsg. 5918 5919_NOTES_ 5920 For nonalloatable coarrays this function is never called. If a 5921 cleanup is required, it has to be handled via the finish, stop and 5922 error stop functions, and via destructors. 5923 5924 5925File: gfortran.info, Node: _gfortran_caf_is_present, Next: _gfortran_caf_send, Prev: _gfortran_caf_deregister, Up: Function ABI Documentation 5926 59278.2.10 '_gfortran_caf_is_present' -- Query whether an allocatable or pointer component in a derived type coarray is allocated 5928----------------------------------------------------------------------------------------------------------------------------- 5929 5930_Description_: 5931 Used to query the coarray library whether an allocatable component 5932 in a derived type coarray is allocated on a remote image. 5933 5934_Syntax_: 5935 'void _gfortran_caf_is_present (caf_token_t token, int image_index, 5936 gfc_reference_t *ref)' 5937 5938_Arguments_: 5939 TOKEN An opaque pointer identifying the coarray. 5940 IMAGE_INDEX The ID of the remote image; must be a positive 5941 number. 5942 REF A chain of references to address the allocatable 5943 or pointer component in the derived type 5944 coarray. The object reference needs to be a 5945 scalar or a full array reference, respectively. 5946 5947 5948File: gfortran.info, Node: _gfortran_caf_send, Next: _gfortran_caf_get, Prev: _gfortran_caf_is_present, Up: Function ABI Documentation 5949 59508.2.11 '_gfortran_caf_send' -- Sending data from a local image to a remote image 5951-------------------------------------------------------------------------------- 5952 5953_Description_: 5954 Called to send a scalar, an array section or a whole array from a 5955 local to a remote image identified by the image_index. 5956 5957_Syntax_: 5958 'void _gfortran_caf_send (caf_token_t token, size_t offset, int 5959 image_index, gfc_descriptor_t *dest, caf_vector_t *dst_vector, 5960 gfc_descriptor_t *src, int dst_kind, int src_kind, bool 5961 may_require_tmp, int *stat)' 5962 5963_Arguments_: 5964 TOKEN intent(in) An opaque pointer identifying the 5965 coarray. 5966 OFFSET intent(in) By which amount of bytes the actual 5967 data is shifted compared to the base address of 5968 the coarray. 5969 IMAGE_INDEX intent(in) The ID of the remote image; must be a 5970 positive number. 5971 DEST intent(in) Array descriptor for the remote image 5972 for the bounds and the size. The 'base_addr' 5973 shall not be accessed. 5974 DST_VECTOR intent(in) If not NULL, it contains the vector 5975 subscript of the destination array; the values 5976 are relative to the dimension triplet of the 5977 dest argument. 5978 SRC intent(in) Array descriptor of the local array 5979 to be transferred to the remote image 5980 DST_KIND intent(in) Kind of the destination argument 5981 SRC_KIND intent(in) Kind of the source argument 5982 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 5983 known at compile time that the DEST and SRC 5984 either cannot overlap or overlap (fully or 5985 partially) such that walking SRC and DEST in 5986 element wise element order (honoring the stride 5987 value) will not lead to wrong results. 5988 Otherwise, the value is 'true'. 5989 STAT intent(out) when non-NULL give the result of the 5990 operation, i.e., zero on success and non-zero on 5991 error. When NULL and an error occurs, then an 5992 error message is printed and the program is 5993 terminated. 5994 5995_NOTES_ 5996 It is permitted to have IMAGE_INDEX equal the current image; the 5997 memory of the send-to and the send-from might (partially) overlap 5998 in that case. The implementation has to take care that it handles 5999 this case, e.g. using 'memmove' which handles (partially) 6000 overlapping memory. If MAY_REQUIRE_TMP is true, the library might 6001 additionally create a temporary variable, unless additional checks 6002 show that this is not required (e.g. because walking backward is 6003 possible or because both arrays are contiguous and 'memmove' takes 6004 care of overlap issues). 6005 6006 Note that the assignment of a scalar to an array is permitted. In 6007 addition, the library has to handle numeric-type conversion and for 6008 strings, padding and different character kinds. 6009 6010 6011File: gfortran.info, Node: _gfortran_caf_get, Next: _gfortran_caf_sendget, Prev: _gfortran_caf_send, Up: Function ABI Documentation 6012 60138.2.12 '_gfortran_caf_get' -- Getting data from a remote image 6014-------------------------------------------------------------- 6015 6016_Description_: 6017 Called to get an array section or a whole array from a remote, 6018 image identified by the image_index. 6019 6020_Syntax_: 6021 'void _gfortran_caf_get (caf_token_t token, size_t offset, int 6022 image_index, gfc_descriptor_t *src, caf_vector_t *src_vector, 6023 gfc_descriptor_t *dest, int src_kind, int dst_kind, bool 6024 may_require_tmp, int *stat)' 6025 6026_Arguments_: 6027 TOKEN intent(in) An opaque pointer identifying the 6028 coarray. 6029 OFFSET intent(in) By which amount of bytes the actual 6030 data is shifted compared to the base address of 6031 the coarray. 6032 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6033 positive number. 6034 DEST intent(out) Array descriptor of the local array 6035 to store the data retrieved from the remote 6036 image 6037 SRC intent(in) Array descriptor for the remote image 6038 for the bounds and the size. The 'base_addr' 6039 shall not be accessed. 6040 SRC_VECTOR intent(in) If not NULL, it contains the vector 6041 subscript of the source array; the values are 6042 relative to the dimension triplet of the SRC 6043 argument. 6044 DST_KIND intent(in) Kind of the destination argument 6045 SRC_KIND intent(in) Kind of the source argument 6046 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 6047 known at compile time that the DEST and SRC 6048 either cannot overlap or overlap (fully or 6049 partially) such that walking SRC and DEST in 6050 element wise element order (honoring the stride 6051 value) will not lead to wrong results. 6052 Otherwise, the value is 'true'. 6053 STAT intent(out) When non-NULL give the result of the 6054 operation, i.e., zero on success and non-zero on 6055 error. When NULL and an error occurs, then an 6056 error message is printed and the program is 6057 terminated. 6058 6059_NOTES_ 6060 It is permitted to have IMAGE_INDEX equal the current image; the 6061 memory of the send-to and the send-from might (partially) overlap 6062 in that case. The implementation has to take care that it handles 6063 this case, e.g. using 'memmove' which handles (partially) 6064 overlapping memory. If MAY_REQUIRE_TMP is true, the library might 6065 additionally create a temporary variable, unless additional checks 6066 show that this is not required (e.g. because walking backward is 6067 possible or because both arrays are contiguous and 'memmove' takes 6068 care of overlap issues). 6069 6070 Note that the library has to handle numeric-type conversion and for 6071 strings, padding and different character kinds. 6072 6073 6074File: gfortran.info, Node: _gfortran_caf_sendget, Next: _gfortran_caf_send_by_ref, Prev: _gfortran_caf_get, Up: Function ABI Documentation 6075 60768.2.13 '_gfortran_caf_sendget' -- Sending data between remote images 6077-------------------------------------------------------------------- 6078 6079_Description_: 6080 Called to send a scalar, an array section or a whole array from a 6081 remote image identified by the SRC_IMAGE_INDEX to a remote image 6082 identified by the DST_IMAGE_INDEX. 6083 6084_Syntax_: 6085 'void _gfortran_caf_sendget (caf_token_t dst_token, size_t 6086 dst_offset, int dst_image_index, gfc_descriptor_t *dest, 6087 caf_vector_t *dst_vector, caf_token_t src_token, size_t src_offset, 6088 int src_image_index, gfc_descriptor_t *src, caf_vector_t 6089 *src_vector, int dst_kind, int src_kind, bool may_require_tmp, int 6090 *stat)' 6091 6092_Arguments_: 6093 DST_TOKEN intent(in) An opaque pointer identifying the 6094 destination coarray. 6095 DST_OFFSET intent(in) By which amount of bytes the actual 6096 data is shifted compared to the base address of 6097 the destination coarray. 6098 DST_IMAGE_INDEXintent(in) The ID of the destination remote 6099 image; must be a positive number. 6100 DEST intent(in) Array descriptor for the destination 6101 remote image for the bounds and the size. The 6102 'base_addr' shall not be accessed. 6103 DST_VECTOR intent(int) If not NULL, it contains the vector 6104 subscript of the destination array; the values 6105 are relative to the dimension triplet of the 6106 DEST argument. 6107 SRC_TOKEN intent(in) An opaque pointer identifying the 6108 source coarray. 6109 SRC_OFFSET intent(in) By which amount of bytes the actual 6110 data is shifted compared to the base address of 6111 the source coarray. 6112 SRC_IMAGE_INDEXintent(in) The ID of the source remote image; 6113 must be a positive number. 6114 SRC intent(in) Array descriptor of the local array 6115 to be transferred to the remote image. 6116 SRC_VECTOR intent(in) Array descriptor of the local array 6117 to be transferred to the remote image 6118 DST_KIND intent(in) Kind of the destination argument 6119 SRC_KIND intent(in) Kind of the source argument 6120 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 6121 known at compile time that the DEST and SRC 6122 either cannot overlap or overlap (fully or 6123 partially) such that walking SRC and DEST in 6124 element wise element order (honoring the stride 6125 value) will not lead to wrong results. 6126 Otherwise, the value is 'true'. 6127 STAT intent(out) when non-NULL give the result of the 6128 operation, i.e., zero on success and non-zero on 6129 error. When NULL and an error occurs, then an 6130 error message is printed and the program is 6131 terminated. 6132 6133_NOTES_ 6134 It is permitted to have the same image index for both 6135 SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and 6136 the send-from might (partially) overlap in that case. The 6137 implementation has to take care that it handles this case, e.g. 6138 using 'memmove' which handles (partially) overlapping memory. If 6139 MAY_REQUIRE_TMP is true, the library might additionally create a 6140 temporary variable, unless additional checks show that this is not 6141 required (e.g. because walking backward is possible or because 6142 both arrays are contiguous and 'memmove' takes care of overlap 6143 issues). 6144 6145 Note that the assignment of a scalar to an array is permitted. In 6146 addition, the library has to handle numeric-type conversion and for 6147 strings, padding and different character kinds. 6148 6149 6150File: gfortran.info, Node: _gfortran_caf_send_by_ref, Next: _gfortran_caf_get_by_ref, Prev: _gfortran_caf_sendget, Up: Function ABI Documentation 6151 61528.2.14 '_gfortran_caf_send_by_ref' -- Sending data from a local image to a remote image with enhanced referencing options 6153------------------------------------------------------------------------------------------------------------------------- 6154 6155_Description_: 6156 Called to send a scalar, an array section or a whole array from a 6157 local to a remote image identified by the IMAGE_INDEX. 6158 6159_Syntax_: 6160 'void _gfortran_caf_send_by_ref (caf_token_t token, int 6161 image_index, gfc_descriptor_t *src, caf_reference_t *refs, int 6162 dst_kind, int src_kind, bool may_require_tmp, bool 6163 dst_reallocatable, int *stat, int dst_type)' 6164 6165_Arguments_: 6166 TOKEN intent(in) An opaque pointer identifying the 6167 coarray. 6168 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6169 positive number. 6170 SRC intent(in) Array descriptor of the local array 6171 to be transferred to the remote image 6172 REFS intent(in) The references on the remote array to 6173 store the data given by src. Guaranteed to have 6174 at least one entry. 6175 DST_KIND intent(in) Kind of the destination argument 6176 SRC_KIND intent(in) Kind of the source argument 6177 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 6178 known at compile time that the DEST and SRC 6179 either cannot overlap or overlap (fully or 6180 partially) such that walking SRC and DEST in 6181 element wise element order (honoring the stride 6182 value) will not lead to wrong results. 6183 Otherwise, the value is 'true'. 6184 DST_REALLOCATABLEintent(in) Set when the destination is of 6185 allocatable or pointer type and the refs will 6186 allow reallocation, i.e., the ref is a full 6187 array or component ref. 6188 STAT intent(out) When non-'NULL' give the result of 6189 the operation, i.e., zero on success and 6190 non-zero on error. When 'NULL' and an error 6191 occurs, then an error message is printed and the 6192 program is terminated. 6193 DST_TYPE intent(in) Give the type of the destination. 6194 When the destination is not an array, than the 6195 precise type, e.g. of a component in a derived 6196 type, is not known, but provided here. 6197 6198_NOTES_ 6199 It is permitted to have IMAGE_INDEX equal the current image; the 6200 memory of the send-to and the send-from might (partially) overlap 6201 in that case. The implementation has to take care that it handles 6202 this case, e.g. using 'memmove' which handles (partially) 6203 overlapping memory. If MAY_REQUIRE_TMP is true, the library might 6204 additionally create a temporary variable, unless additional checks 6205 show that this is not required (e.g. because walking backward is 6206 possible or because both arrays are contiguous and 'memmove' takes 6207 care of overlap issues). 6208 6209 Note that the assignment of a scalar to an array is permitted. In 6210 addition, the library has to handle numeric-type conversion and for 6211 strings, padding and different character kinds. 6212 6213 Because of the more complicated references possible some operations 6214 may be unsupported by certain libraries. The library is expected 6215 to issue a precise error message why the operation is not 6216 permitted. 6217 6218 6219File: gfortran.info, Node: _gfortran_caf_get_by_ref, Next: _gfortran_caf_sendget_by_ref, Prev: _gfortran_caf_send_by_ref, Up: Function ABI Documentation 6220 62218.2.15 '_gfortran_caf_get_by_ref' -- Getting data from a remote image using enhanced references 6222----------------------------------------------------------------------------------------------- 6223 6224_Description_: 6225 Called to get a scalar, an array section or a whole array from a 6226 remote image identified by the IMAGE_INDEX. 6227 6228_Syntax_: 6229 'void _gfortran_caf_get_by_ref (caf_token_t token, int image_index, 6230 caf_reference_t *refs, gfc_descriptor_t *dst, int dst_kind, int 6231 src_kind, bool may_require_tmp, bool dst_reallocatable, int *stat, 6232 int src_type)' 6233 6234_Arguments_: 6235 TOKEN intent(in) An opaque pointer identifying the 6236 coarray. 6237 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6238 positive number. 6239 REFS intent(in) The references to apply to the remote 6240 structure to get the data. 6241 DST intent(in) Array descriptor of the local array 6242 to store the data transferred from the remote 6243 image. May be reallocated where needed and when 6244 DST_REALLOCATABLE allows it. 6245 DST_KIND intent(in) Kind of the destination argument 6246 SRC_KIND intent(in) Kind of the source argument 6247 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 6248 known at compile time that the DEST and SRC 6249 either cannot overlap or overlap (fully or 6250 partially) such that walking SRC and DEST in 6251 element wise element order (honoring the stride 6252 value) will not lead to wrong results. 6253 Otherwise, the value is 'true'. 6254 DST_REALLOCATABLEintent(in) Set when DST is of allocatable or 6255 pointer type and its refs allow reallocation, 6256 i.e., the full array or a component is 6257 referenced. 6258 STAT intent(out) When non-'NULL' give the result of 6259 the operation, i.e., zero on success and 6260 non-zero on error. When 'NULL' and an error 6261 occurs, then an error message is printed and the 6262 program is terminated. 6263 SRC_TYPE intent(in) Give the type of the source. When 6264 the source is not an array, than the precise 6265 type, e.g. of a component in a derived type, is 6266 not known, but provided here. 6267 6268_NOTES_ 6269 It is permitted to have 'image_index' equal the current image; the 6270 memory of the send-to and the send-from might (partially) overlap 6271 in that case. The implementation has to take care that it handles 6272 this case, e.g. using 'memmove' which handles (partially) 6273 overlapping memory. If MAY_REQUIRE_TMP is true, the library might 6274 additionally create a temporary variable, unless additional checks 6275 show that this is not required (e.g. because walking backward is 6276 possible or because both arrays are contiguous and 'memmove' takes 6277 care of overlap issues). 6278 6279 Note that the library has to handle numeric-type conversion and for 6280 strings, padding and different character kinds. 6281 6282 Because of the more complicated references possible some operations 6283 may be unsupported by certain libraries. The library is expected 6284 to issue a precise error message why the operation is not 6285 permitted. 6286 6287 6288File: gfortran.info, Node: _gfortran_caf_sendget_by_ref, Next: _gfortran_caf_lock, Prev: _gfortran_caf_get_by_ref, Up: Function ABI Documentation 6289 62908.2.16 '_gfortran_caf_sendget_by_ref' -- Sending data between remote images using enhanced references on both sides 6291------------------------------------------------------------------------------------------------------------------- 6292 6293_Description_: 6294 Called to send a scalar, an array section or a whole array from a 6295 remote image identified by the SRC_IMAGE_INDEX to a remote image 6296 identified by the DST_IMAGE_INDEX. 6297 6298_Syntax_: 6299 'void _gfortran_caf_sendget_by_ref (caf_token_t dst_token, int 6300 dst_image_index, caf_reference_t *dst_refs, caf_token_t src_token, 6301 int src_image_index, caf_reference_t *src_refs, int dst_kind, int 6302 src_kind, bool may_require_tmp, int *dst_stat, int *src_stat, int 6303 dst_type, int src_type)' 6304 6305_Arguments_: 6306 DST_TOKEN intent(in) An opaque pointer identifying the 6307 destination coarray. 6308 DST_IMAGE_INDEXintent(in) The ID of the destination remote 6309 image; must be a positive number. 6310 DST_REFS intent(in) The references on the remote array to 6311 store the data given by the source. Guaranteed 6312 to have at least one entry. 6313 SRC_TOKEN intent(in) An opaque pointer identifying the 6314 source coarray. 6315 SRC_IMAGE_INDEXintent(in) The ID of the source remote image; 6316 must be a positive number. 6317 SRC_REFS intent(in) The references to apply to the remote 6318 structure to get the data. 6319 DST_KIND intent(in) Kind of the destination argument 6320 SRC_KIND intent(in) Kind of the source argument 6321 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 6322 known at compile time that the DEST and SRC 6323 either cannot overlap or overlap (fully or 6324 partially) such that walking SRC and DEST in 6325 element wise element order (honoring the stride 6326 value) will not lead to wrong results. 6327 Otherwise, the value is 'true'. 6328 DST_STAT intent(out) when non-'NULL' give the result of 6329 the send-operation, i.e., zero on success and 6330 non-zero on error. When 'NULL' and an error 6331 occurs, then an error message is printed and the 6332 program is terminated. 6333 SRC_STAT intent(out) When non-'NULL' give the result of 6334 the get-operation, i.e., zero on success and 6335 non-zero on error. When 'NULL' and an error 6336 occurs, then an error message is printed and the 6337 program is terminated. 6338 DST_TYPE intent(in) Give the type of the destination. 6339 When the destination is not an array, than the 6340 precise type, e.g. of a component in a derived 6341 type, is not known, but provided here. 6342 SRC_TYPE intent(in) Give the type of the source. When 6343 the source is not an array, than the precise 6344 type, e.g. of a component in a derived type, is 6345 not known, but provided here. 6346 6347_NOTES_ 6348 It is permitted to have the same image index for both 6349 SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and 6350 the send-from might (partially) overlap in that case. The 6351 implementation has to take care that it handles this case, e.g. 6352 using 'memmove' which handles (partially) overlapping memory. If 6353 MAY_REQUIRE_TMP is true, the library might additionally create a 6354 temporary variable, unless additional checks show that this is not 6355 required (e.g. because walking backward is possible or because 6356 both arrays are contiguous and 'memmove' takes care of overlap 6357 issues). 6358 6359 Note that the assignment of a scalar to an array is permitted. In 6360 addition, the library has to handle numeric-type conversion and for 6361 strings, padding and different character kinds. 6362 6363 Because of the more complicated references possible some operations 6364 may be unsupported by certain libraries. The library is expected 6365 to issue a precise error message why the operation is not 6366 permitted. 6367 6368 6369File: gfortran.info, Node: _gfortran_caf_lock, Next: _gfortran_caf_unlock, Prev: _gfortran_caf_sendget_by_ref, Up: Function ABI Documentation 6370 63718.2.17 '_gfortran_caf_lock' -- Locking a lock variable 6372------------------------------------------------------ 6373 6374_Description_: 6375 Acquire a lock on the given image on a scalar locking variable or 6376 for the given array element for an array-valued variable. If the 6377 AQUIRED_LOCK is 'NULL', the function returns after having obtained 6378 the lock. If it is non-'NULL', then ACQUIRED_LOCK is assigned the 6379 value true (one) when the lock could be obtained and false (zero) 6380 otherwise. Locking a lock variable which has already been locked 6381 by the same image is an error. 6382 6383_Syntax_: 6384 'void _gfortran_caf_lock (caf_token_t token, size_t index, int 6385 image_index, int *aquired_lock, int *stat, char *errmsg, size_t 6386 errmsg_len)' 6387 6388_Arguments_: 6389 TOKEN intent(in) An opaque pointer identifying the 6390 coarray. 6391 INDEX intent(in) Array index; first array index is 0. 6392 For scalars, it is always 0. 6393 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6394 positive number. 6395 AQUIRED_LOCKintent(out) If not NULL, it returns whether lock 6396 could be obtained. 6397 STAT intent(out) Stores the STAT=; may be NULL. 6398 ERRMSG intent(out) When an error occurs, this will be 6399 set to an error message; may be NULL. 6400 ERRMSG_LEN intent(in) the buffer size of errmsg 6401 6402_NOTES_ 6403 This function is also called for critical blocks; for those, the 6404 array index is always zero and the image index is one. Libraries 6405 are permitted to use other images for critical-block locking 6406 variables. 6407 6408 6409File: gfortran.info, Node: _gfortran_caf_unlock, Next: _gfortran_caf_event_post, Prev: _gfortran_caf_lock, Up: Function ABI Documentation 6410 64118.2.18 '_gfortran_caf_lock' -- Unlocking a lock variable 6412-------------------------------------------------------- 6413 6414_Description_: 6415 Release a lock on the given image on a scalar locking variable or 6416 for the given array element for an array-valued variable. 6417 Unlocking a lock variable which is unlocked or has been locked by a 6418 different image is an error. 6419 6420_Syntax_: 6421 'void _gfortran_caf_unlock (caf_token_t token, size_t index, int 6422 image_index, int *stat, char *errmsg, size_t errmsg_len)' 6423 6424_Arguments_: 6425 TOKEN intent(in) An opaque pointer identifying the 6426 coarray. 6427 INDEX intent(in) Array index; first array index is 0. 6428 For scalars, it is always 0. 6429 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6430 positive number. 6431 STAT intent(out) For allocatable coarrays, stores the 6432 STAT=; may be NULL. 6433 ERRMSG intent(out) When an error occurs, this will be 6434 set to an error message; may be NULL. 6435 ERRMSG_LEN intent(in) the buffer size of errmsg 6436 6437_NOTES_ 6438 This function is also called for critical block; for those, the 6439 array index is always zero and the image index is one. Libraries 6440 are permitted to use other images for critical-block locking 6441 variables. 6442 6443 6444File: gfortran.info, Node: _gfortran_caf_event_post, Next: _gfortran_caf_event_wait, Prev: _gfortran_caf_unlock, Up: Function ABI Documentation 6445 64468.2.19 '_gfortran_caf_event_post' -- Post an event 6447-------------------------------------------------- 6448 6449_Description_: 6450 Increment the event count of the specified event variable. 6451 6452_Syntax_: 6453 'void _gfortran_caf_event_post (caf_token_t token, size_t index, 6454 int image_index, int *stat, char *errmsg, size_t errmsg_len)' 6455 6456_Arguments_: 6457 TOKEN intent(in) An opaque pointer identifying the 6458 coarray. 6459 INDEX intent(in) Array index; first array index is 0. 6460 For scalars, it is always 0. 6461 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6462 positive number; zero indicates the current 6463 image, when accessed noncoindexed. 6464 STAT intent(out) Stores the STAT=; may be NULL. 6465 ERRMSG intent(out) When an error occurs, this will be 6466 set to an error message; may be NULL. 6467 ERRMSG_LEN intent(in) the buffer size of errmsg 6468 6469_NOTES_ 6470 This acts like an atomic add of one to the remote image's event 6471 variable. The statement is an image-control statement but does not 6472 imply sync memory. Still, all preceeding push communications of 6473 this image to the specified remote image have to be completed 6474 before 'event_wait' on the remote image returns. 6475 6476 6477File: gfortran.info, Node: _gfortran_caf_event_wait, Next: _gfortran_caf_event_query, Prev: _gfortran_caf_event_post, Up: Function ABI Documentation 6478 64798.2.20 '_gfortran_caf_event_wait' -- Wait that an event occurred 6480---------------------------------------------------------------- 6481 6482_Description_: 6483 Wait until the event count has reached at least the specified 6484 UNTIL_COUNT; if so, atomically decrement the event variable by this 6485 amount and return. 6486 6487_Syntax_: 6488 'void _gfortran_caf_event_wait (caf_token_t token, size_t index, 6489 int until_count, int *stat, char *errmsg, size_t errmsg_len)' 6490 6491_Arguments_: 6492 TOKEN intent(in) An opaque pointer identifying the 6493 coarray. 6494 INDEX intent(in) Array index; first array index is 0. 6495 For scalars, it is always 0. 6496 UNTIL_COUNT intent(in) The number of events which have to be 6497 available before the function returns. 6498 STAT intent(out) Stores the STAT=; may be NULL. 6499 ERRMSG intent(out) When an error occurs, this will be 6500 set to an error message; may be NULL. 6501 ERRMSG_LEN intent(in) the buffer size of errmsg 6502 6503_NOTES_ 6504 This function only operates on a local coarray. It acts like a 6505 loop checking atomically the value of the event variable, breaking 6506 if the value is greater or equal the requested number of counts. 6507 Before the function returns, the event variable has to be 6508 decremented by the requested UNTIL_COUNT value. A possible 6509 implementation would be a busy loop for a certain number of spins 6510 (possibly depending on the number of threads relative to the number 6511 of available cores) followed by another waiting strategy such as a 6512 sleeping wait (possibly with an increasing number of sleep time) 6513 or, if possible, a futex wait. 6514 6515 The statement is an image-control statement but does not imply sync 6516 memory. Still, all preceeding push communications of this image to 6517 the specified remote image have to be completed before 'event_wait' 6518 on the remote image returns. 6519 6520 6521File: gfortran.info, Node: _gfortran_caf_event_query, Next: _gfortran_caf_sync_all, Prev: _gfortran_caf_event_wait, Up: Function ABI Documentation 6522 65238.2.21 '_gfortran_caf_event_query' -- Query event count 6524------------------------------------------------------- 6525 6526_Description_: 6527 Return the event count of the specified event variable. 6528 6529_Syntax_: 6530 'void _gfortran_caf_event_query (caf_token_t token, size_t index, 6531 int image_index, int *count, int *stat)' 6532 6533_Arguments_: 6534 TOKEN intent(in) An opaque pointer identifying the 6535 coarray. 6536 INDEX intent(in) Array index; first array index is 0. 6537 For scalars, it is always 0. 6538 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6539 positive number; zero indicates the current 6540 image when accessed noncoindexed. 6541 COUNT intent(out) The number of events currently 6542 posted to the event variable. 6543 STAT intent(out) Stores the STAT=; may be NULL. 6544 6545_NOTES_ 6546 The typical use is to check the local event variable to only call 6547 'event_wait' when the data is available. However, a coindexed 6548 variable is permitted; there is no ordering or synchronization 6549 implied. It acts like an atomic fetch of the value of the event 6550 variable. 6551 6552 6553File: gfortran.info, Node: _gfortran_caf_sync_all, Next: _gfortran_caf_sync_images, Prev: _gfortran_caf_event_query, Up: Function ABI Documentation 6554 65558.2.22 '_gfortran_caf_sync_all' -- All-image barrier 6556---------------------------------------------------- 6557 6558_Description_: 6559 Synchronization of all images in the current team; the program only 6560 continues on a given image after this function has been called on 6561 all images of the current team. Additionally, it ensures that all 6562 pending data transfers of previous segment have completed. 6563 6564_Syntax_: 6565 'void _gfortran_caf_sync_all (int *stat, char *errmsg, size_t 6566 errmsg_len)' 6567 6568_Arguments_: 6569 STAT intent(out) Stores the status STAT= and may be 6570 NULL. 6571 ERRMSG intent(out) When an error occurs, this will be 6572 set to an error message; may be NULL. 6573 ERRMSG_LEN intent(in) the buffer size of errmsg 6574 6575 6576File: gfortran.info, Node: _gfortran_caf_sync_images, Next: _gfortran_caf_sync_memory, Prev: _gfortran_caf_sync_all, Up: Function ABI Documentation 6577 65788.2.23 '_gfortran_caf_sync_images' -- Barrier for selected images 6579----------------------------------------------------------------- 6580 6581_Description_: 6582 Synchronization between the specified images; the program only 6583 continues on a given image after this function has been called on 6584 all images specified for that image. Note that one image can wait 6585 for all other images in the current team (e.g. via 'sync 6586 images(*)') while those only wait for that specific image. 6587 Additionally, 'sync images' ensures that all pending data transfers 6588 of previous segments have completed. 6589 6590_Syntax_: 6591 'void _gfortran_caf_sync_images (int count, int images[], int 6592 *stat, char *errmsg, size_t errmsg_len)' 6593 6594_Arguments_: 6595 COUNT intent(in) The number of images which are 6596 provided in the next argument. For a zero-sized 6597 array, the value is zero. For 'sync images 6598 (*)', the value is -1. 6599 IMAGES intent(in) An array with the images provided by 6600 the user. If COUNT is zero, a NULL pointer is 6601 passed. 6602 STAT intent(out) Stores the status STAT= and may be 6603 NULL. 6604 ERRMSG intent(out) When an error occurs, this will be 6605 set to an error message; may be NULL. 6606 ERRMSG_LEN intent(in) the buffer size of errmsg 6607 6608 6609File: gfortran.info, Node: _gfortran_caf_sync_memory, Next: _gfortran_caf_error_stop, Prev: _gfortran_caf_sync_images, Up: Function ABI Documentation 6610 66118.2.24 '_gfortran_caf_sync_memory' -- Wait for completion of segment-memory operations 6612-------------------------------------------------------------------------------------- 6613 6614_Description_: 6615 Acts as optimization barrier between different segments. It also 6616 ensures that all pending memory operations of this image have been 6617 completed. 6618 6619_Syntax_: 6620 'void _gfortran_caf_sync_memory (int *stat, char *errmsg, size_t 6621 errmsg_len)' 6622 6623_Arguments_: 6624 STAT intent(out) Stores the status STAT= and may be 6625 NULL. 6626 ERRMSG intent(out) When an error occurs, this will be 6627 set to an error message; may be NULL. 6628 ERRMSG_LEN intent(in) the buffer size of errmsg 6629 6630_NOTE_ A simple implementation could be 6631 '__asm__ __volatile__ ("":::"memory")' to prevent code movements. 6632 6633 6634File: gfortran.info, Node: _gfortran_caf_error_stop, Next: _gfortran_caf_error_stop_str, Prev: _gfortran_caf_sync_memory, Up: Function ABI Documentation 6635 66368.2.25 '_gfortran_caf_error_stop' -- Error termination with exit code 6637--------------------------------------------------------------------- 6638 6639_Description_: 6640 Invoked for an 'ERROR STOP' statement which has an integer 6641 argument. The function should terminate the program with the 6642 specified exit code. 6643 6644_Syntax_: 6645 'void _gfortran_caf_error_stop (int error)' 6646 6647_Arguments_: 6648 ERROR intent(in) The exit status to be used. 6649 6650 6651File: gfortran.info, Node: _gfortran_caf_error_stop_str, Next: _gfortran_caf_fail_image, Prev: _gfortran_caf_error_stop, Up: Function ABI Documentation 6652 66538.2.26 '_gfortran_caf_error_stop_str' -- Error termination with string 6654---------------------------------------------------------------------- 6655 6656_Description_: 6657 Invoked for an 'ERROR STOP' statement which has a string as 6658 argument. The function should terminate the program with a 6659 nonzero-exit code. 6660 6661_Syntax_: 6662 'void _gfortran_caf_error_stop (const char *string, size_t len)' 6663 6664_Arguments_: 6665 STRING intent(in) the error message (not zero 6666 terminated) 6667 LEN intent(in) the length of the string 6668 6669 6670File: gfortran.info, Node: _gfortran_caf_fail_image, Next: _gfortran_caf_atomic_define, Prev: _gfortran_caf_error_stop_str, Up: Function ABI Documentation 6671 66728.2.27 '_gfortran_caf_fail_image' -- Mark the image failed and end its execution 6673-------------------------------------------------------------------------------- 6674 6675_Description_: 6676 Invoked for an 'FAIL IMAGE' statement. The function should 6677 terminate the current image. 6678 6679_Syntax_: 6680 'void _gfortran_caf_fail_image ()' 6681 6682_NOTES_ 6683 This function follows TS18508. 6684 6685 6686File: gfortran.info, Node: _gfortran_caf_atomic_define, Next: _gfortran_caf_atomic_ref, Prev: _gfortran_caf_fail_image, Up: Function ABI Documentation 6687 66888.2.28 '_gfortran_caf_atomic_define' -- Atomic variable assignment 6689------------------------------------------------------------------ 6690 6691_Description_: 6692 Assign atomically a value to an integer or logical variable. 6693 6694_Syntax_: 6695 'void _gfortran_caf_atomic_define (caf_token_t token, size_t 6696 offset, int image_index, void *value, int *stat, int type, int 6697 kind)' 6698 6699_Arguments_: 6700 TOKEN intent(in) An opaque pointer identifying the 6701 coarray. 6702 OFFSET intent(in) By which amount of bytes the actual 6703 data is shifted compared to the base address of 6704 the coarray. 6705 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6706 positive number; zero indicates the current 6707 image when used noncoindexed. 6708 VALUE intent(in) the value to be assigned, passed by 6709 reference 6710 STAT intent(out) Stores the status STAT= and may be 6711 NULL. 6712 TYPE intent(in) The data type, i.e. 'BT_INTEGER' (1) 6713 or 'BT_LOGICAL' (2). 6714 KIND intent(in) The kind value (only 4; always 'int') 6715 6716 6717File: gfortran.info, Node: _gfortran_caf_atomic_ref, Next: _gfortran_caf_atomic_cas, Prev: _gfortran_caf_atomic_define, Up: Function ABI Documentation 6718 67198.2.29 '_gfortran_caf_atomic_ref' -- Atomic variable reference 6720-------------------------------------------------------------- 6721 6722_Description_: 6723 Reference atomically a value of a kind-4 integer or logical 6724 variable. 6725 6726_Syntax_: 6727 'void _gfortran_caf_atomic_ref (caf_token_t token, size_t offset, 6728 int image_index, void *value, int *stat, int type, int kind)' 6729 6730_Arguments_: 6731 TOKEN intent(in) An opaque pointer identifying the 6732 coarray. 6733 OFFSET intent(in) By which amount of bytes the actual 6734 data is shifted compared to the base address of 6735 the coarray. 6736 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6737 positive number; zero indicates the current 6738 image when used noncoindexed. 6739 VALUE intent(out) The variable assigned the atomically 6740 referenced variable. 6741 STAT intent(out) Stores the status STAT= and may be 6742 NULL. 6743 TYPE the data type, i.e. 'BT_INTEGER' (1) or 6744 'BT_LOGICAL' (2). 6745 KIND The kind value (only 4; always 'int') 6746 6747 6748File: gfortran.info, Node: _gfortran_caf_atomic_cas, Next: _gfortran_caf_atomic_op, Prev: _gfortran_caf_atomic_ref, Up: Function ABI Documentation 6749 67508.2.30 '_gfortran_caf_atomic_cas' -- Atomic compare and swap 6751------------------------------------------------------------ 6752 6753_Description_: 6754 Atomic compare and swap of a kind-4 integer or logical variable. 6755 Assigns atomically the specified value to the atomic variable, if 6756 the latter has the value specified by the passed condition value. 6757 6758_Syntax_: 6759 'void _gfortran_caf_atomic_cas (caf_token_t token, size_t offset, 6760 int image_index, void *old, void *compare, void *new_val, int 6761 *stat, int type, int kind)' 6762 6763_Arguments_: 6764 TOKEN intent(in) An opaque pointer identifying the 6765 coarray. 6766 OFFSET intent(in) By which amount of bytes the actual 6767 data is shifted compared to the base address of 6768 the coarray. 6769 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6770 positive number; zero indicates the current 6771 image when used noncoindexed. 6772 OLD intent(out) The value which the atomic variable 6773 had just before the cas operation. 6774 COMPARE intent(in) The value used for comparision. 6775 NEW_VAL intent(in) The new value for the atomic 6776 variable, assigned to the atomic variable, if 6777 'compare' equals the value of the atomic 6778 variable. 6779 STAT intent(out) Stores the status STAT= and may be 6780 NULL. 6781 TYPE intent(in) the data type, i.e. 'BT_INTEGER' (1) 6782 or 'BT_LOGICAL' (2). 6783 KIND intent(in) The kind value (only 4; always 'int') 6784 6785 6786File: gfortran.info, Node: _gfortran_caf_atomic_op, Next: _gfortran_caf_co_broadcast, Prev: _gfortran_caf_atomic_cas, Up: Function ABI Documentation 6787 67888.2.31 '_gfortran_caf_atomic_op' -- Atomic operation 6789---------------------------------------------------- 6790 6791_Description_: 6792 Apply an operation atomically to an atomic integer or logical 6793 variable. After the operation, OLD contains the value just before 6794 the operation, which, respectively, adds (GFC_CAF_ATOMIC_ADD) 6795 atomically the 'value' to the atomic integer variable or does a 6796 bitwise AND, OR or exclusive OR between the atomic variable and 6797 VALUE; the result is then stored in the atomic variable. 6798 6799_Syntax_: 6800 'void _gfortran_caf_atomic_op (int op, caf_token_t token, size_t 6801 offset, int image_index, void *value, void *old, int *stat, int 6802 type, int kind)' 6803 6804_Arguments_: 6805 OP intent(in) the operation to be performed; 6806 possible values 'GFC_CAF_ATOMIC_ADD' (1), 6807 'GFC_CAF_ATOMIC_AND' (2), 'GFC_CAF_ATOMIC_OR' 6808 (3), 'GFC_CAF_ATOMIC_XOR' (4). 6809 TOKEN intent(in) An opaque pointer identifying the 6810 coarray. 6811 OFFSET intent(in) By which amount of bytes the actual 6812 data is shifted compared to the base address of 6813 the coarray. 6814 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6815 positive number; zero indicates the current 6816 image when used noncoindexed. 6817 OLD intent(out) The value which the atomic variable 6818 had just before the atomic operation. 6819 VAL intent(in) The new value for the atomic 6820 variable, assigned to the atomic variable, if 6821 'compare' equals the value of the atomic 6822 variable. 6823 STAT intent(out) Stores the status STAT= and may be 6824 NULL. 6825 TYPE intent(in) the data type, i.e. 'BT_INTEGER' (1) 6826 or 'BT_LOGICAL' (2) 6827 KIND intent(in) the kind value (only 4; always 'int') 6828 6829 6830File: gfortran.info, Node: _gfortran_caf_co_broadcast, Next: _gfortran_caf_co_max, Prev: _gfortran_caf_atomic_op, Up: Function ABI Documentation 6831 68328.2.32 '_gfortran_caf_co_broadcast' -- Sending data to all images 6833----------------------------------------------------------------- 6834 6835_Description_: 6836 Distribute a value from a given image to all other images in the 6837 team. Has to be called collectively. 6838 6839_Syntax_: 6840 'void _gfortran_caf_co_broadcast (gfc_descriptor_t *a, int 6841 source_image, int *stat, char *errmsg, size_t errmsg_len)' 6842 6843_Arguments_: 6844 A intent(inout) An array descriptor with the data 6845 to be broadcasted (on SOURCE_IMAGE) or to be 6846 received (other images). 6847 SOURCE_IMAGEintent(in) The ID of the image from which the 6848 data should be broadcasted. 6849 STAT intent(out) Stores the status STAT= and may be 6850 NULL. 6851 ERRMSG intent(out) When an error occurs, this will be 6852 set to an error message; may be NULL. 6853 ERRMSG_LEN intent(in) the buffer size of errmsg. 6854 6855 6856File: gfortran.info, Node: _gfortran_caf_co_max, Next: _gfortran_caf_co_min, Prev: _gfortran_caf_co_broadcast, Up: Function ABI Documentation 6857 68588.2.33 '_gfortran_caf_co_max' -- Collective maximum reduction 6859------------------------------------------------------------- 6860 6861_Description_: 6862 Calculates for each array element of the variable A the maximum 6863 value for that element in the current team; if RESULT_IMAGE has the 6864 value 0, the result shall be stored on all images, otherwise, only 6865 on the specified image. This function operates on numeric values 6866 and character strings. 6867 6868_Syntax_: 6869 'void _gfortran_caf_co_max (gfc_descriptor_t *a, int result_image, 6870 int *stat, char *errmsg, int a_len, size_t errmsg_len)' 6871 6872_Arguments_: 6873 A intent(inout) An array descriptor for the data 6874 to be processed. On the destination image(s) 6875 the result overwrites the old content. 6876 RESULT_IMAGEintent(in) The ID of the image to which the 6877 reduced value should be copied to; if zero, it 6878 has to be copied to all images. 6879 STAT intent(out) Stores the status STAT= and may be 6880 NULL. 6881 ERRMSG intent(out) When an error occurs, this will be 6882 set to an error message; may be NULL. 6883 A_LEN intent(in) the string length of argument A 6884 ERRMSG_LEN intent(in) the buffer size of errmsg 6885 6886_NOTES_ 6887 If RESULT_IMAGE is nonzero, the data in the array descriptor A on 6888 all images except of the specified one become undefined; hence, the 6889 library may make use of this. 6890 6891 6892File: gfortran.info, Node: _gfortran_caf_co_min, Next: _gfortran_caf_co_sum, Prev: _gfortran_caf_co_max, Up: Function ABI Documentation 6893 68948.2.34 '_gfortran_caf_co_min' -- Collective minimum reduction 6895------------------------------------------------------------- 6896 6897_Description_: 6898 Calculates for each array element of the variable A the minimum 6899 value for that element in the current team; if RESULT_IMAGE has the 6900 value 0, the result shall be stored on all images, otherwise, only 6901 on the specified image. This function operates on numeric values 6902 and character strings. 6903 6904_Syntax_: 6905 'void _gfortran_caf_co_min (gfc_descriptor_t *a, int result_image, 6906 int *stat, char *errmsg, int a_len, size_t errmsg_len)' 6907 6908_Arguments_: 6909 A intent(inout) An array descriptor for the data 6910 to be processed. On the destination image(s) 6911 the result overwrites the old content. 6912 RESULT_IMAGEintent(in) The ID of the image to which the 6913 reduced value should be copied to; if zero, it 6914 has to be copied to all images. 6915 STAT intent(out) Stores the status STAT= and may be 6916 NULL. 6917 ERRMSG intent(out) When an error occurs, this will be 6918 set to an error message; may be NULL. 6919 A_LEN intent(in) the string length of argument A 6920 ERRMSG_LEN intent(in) the buffer size of errmsg 6921 6922_NOTES_ 6923 If RESULT_IMAGE is nonzero, the data in the array descriptor A on 6924 all images except of the specified one become undefined; hence, the 6925 library may make use of this. 6926 6927 6928File: gfortran.info, Node: _gfortran_caf_co_sum, Next: _gfortran_caf_co_reduce, Prev: _gfortran_caf_co_min, Up: Function ABI Documentation 6929 69308.2.35 '_gfortran_caf_co_sum' -- Collective summing reduction 6931------------------------------------------------------------- 6932 6933_Description_: 6934 Calculates for each array element of the variable A the sum of all 6935 values for that element in the current team; if RESULT_IMAGE has 6936 the value 0, the result shall be stored on all images, otherwise, 6937 only on the specified image. This function operates on numeric 6938 values only. 6939 6940_Syntax_: 6941 'void _gfortran_caf_co_sum (gfc_descriptor_t *a, int result_image, 6942 int *stat, char *errmsg, size_t errmsg_len)' 6943 6944_Arguments_: 6945 A intent(inout) An array descriptor with the data 6946 to be processed. On the destination image(s) 6947 the result overwrites the old content. 6948 RESULT_IMAGEintent(in) The ID of the image to which the 6949 reduced value should be copied to; if zero, it 6950 has to be copied to all images. 6951 STAT intent(out) Stores the status STAT= and may be 6952 NULL. 6953 ERRMSG intent(out) When an error occurs, this will be 6954 set to an error message; may be NULL. 6955 ERRMSG_LEN intent(in) the buffer size of errmsg 6956 6957_NOTES_ 6958 If RESULT_IMAGE is nonzero, the data in the array descriptor A on 6959 all images except of the specified one become undefined; hence, the 6960 library may make use of this. 6961 6962 6963File: gfortran.info, Node: _gfortran_caf_co_reduce, Prev: _gfortran_caf_co_sum, Up: Function ABI Documentation 6964 69658.2.36 '_gfortran_caf_co_reduce' -- Generic collective reduction 6966---------------------------------------------------------------- 6967 6968_Description_: 6969 Calculates for each array element of the variable A the reduction 6970 value for that element in the current team; if RESULT_IMAGE has the 6971 value 0, the result shall be stored on all images, otherwise, only 6972 on the specified image. The OPR is a pure function doing a 6973 mathematically commutative and associative operation. 6974 6975 The OPR_FLAGS denote the following; the values are bitwise ored. 6976 'GFC_CAF_BYREF' (1) if the result should be returned by reference; 6977 'GFC_CAF_HIDDENLEN' (2) whether the result and argument string 6978 lengths shall be specified as hidden arguments; 'GFC_CAF_ARG_VALUE' 6979 (4) whether the arguments shall be passed by value, 6980 'GFC_CAF_ARG_DESC' (8) whether the arguments shall be passed by 6981 descriptor. 6982 6983_Syntax_: 6984 'void _gfortran_caf_co_reduce (gfc_descriptor_t *a, void * (*opr) 6985 (void *, void *), int opr_flags, int result_image, int *stat, char 6986 *errmsg, int a_len, size_t errmsg_len)' 6987 6988_Arguments_: 6989 A intent(inout) An array descriptor with the data 6990 to be processed. On the destination image(s) 6991 the result overwrites the old content. 6992 OPR intent(in) Function pointer to the reduction 6993 function 6994 OPR_FLAGS intent(in) Flags regarding the reduction 6995 function 6996 RESULT_IMAGEintent(in) The ID of the image to which the 6997 reduced value should be copied to; if zero, it 6998 has to be copied to all images. 6999 STAT intent(out) Stores the status STAT= and may be 7000 NULL. 7001 ERRMSG intent(out) When an error occurs, this will be 7002 set to an error message; may be NULL. 7003 A_LEN intent(in) the string length of argument A 7004 ERRMSG_LEN intent(in) the buffer size of errmsg 7005 7006_NOTES_ 7007 If RESULT_IMAGE is nonzero, the data in the array descriptor A on 7008 all images except of the specified one become undefined; hence, the 7009 library may make use of this. 7010 7011 For character arguments, the result is passed as first argument, 7012 followed by the result string length, next come the two string 7013 arguments, followed by the two hidden string length arguments. 7014 With C binding, there are no hidden arguments and by-reference 7015 passing and either only a single character is passed or an array 7016 descriptor. 7017 7018 7019File: gfortran.info, Node: Intrinsic Procedures, Next: Intrinsic Modules, Prev: Coarray Programming, Up: Top 7020 70219 Intrinsic Procedures 7022********************** 7023 7024* Menu: 7025 7026* Introduction: Introduction to Intrinsics 7027* 'ABORT': ABORT, Abort the program 7028* 'ABS': ABS, Absolute value 7029* 'ACCESS': ACCESS, Checks file access modes 7030* 'ACHAR': ACHAR, Character in ASCII collating sequence 7031* 'ACOS': ACOS, Arccosine function 7032* 'ACOSD': ACOSD, Arccosine function, degrees 7033* 'ACOSH': ACOSH, Inverse hyperbolic cosine function 7034* 'ADJUSTL': ADJUSTL, Left adjust a string 7035* 'ADJUSTR': ADJUSTR, Right adjust a string 7036* 'AIMAG': AIMAG, Imaginary part of complex number 7037* 'AINT': AINT, Truncate to a whole number 7038* 'ALARM': ALARM, Set an alarm clock 7039* 'ALL': ALL, Determine if all values are true 7040* 'ALLOCATED': ALLOCATED, Status of allocatable entity 7041* 'AND': AND, Bitwise logical AND 7042* 'ANINT': ANINT, Nearest whole number 7043* 'ANY': ANY, Determine if any values are true 7044* 'ASIN': ASIN, Arcsine function 7045* 'ASIND': ASIND, Arcsine function, degrees 7046* 'ASINH': ASINH, Inverse hyperbolic sine function 7047* 'ASSOCIATED': ASSOCIATED, Status of a pointer or pointer/target pair 7048* 'ATAN': ATAN, Arctangent function 7049* 'ATAND': ATAND, Arctangent function, degrees 7050* 'ATAN2': ATAN2, Arctangent function 7051* 'ATAN2D': ATAN2D, Arctangent function, degrees 7052* 'ATANH': ATANH, Inverse hyperbolic tangent function 7053* 'ATOMIC_ADD': ATOMIC_ADD, Atomic ADD operation 7054* 'ATOMIC_AND': ATOMIC_AND, Atomic bitwise AND operation 7055* 'ATOMIC_CAS': ATOMIC_CAS, Atomic compare and swap 7056* 'ATOMIC_DEFINE': ATOMIC_DEFINE, Setting a variable atomically 7057* 'ATOMIC_FETCH_ADD': ATOMIC_FETCH_ADD, Atomic ADD operation with prior fetch 7058* 'ATOMIC_FETCH_AND': ATOMIC_FETCH_AND, Atomic bitwise AND operation with prior fetch 7059* 'ATOMIC_FETCH_OR': ATOMIC_FETCH_OR, Atomic bitwise OR operation with prior fetch 7060* 'ATOMIC_FETCH_XOR': ATOMIC_FETCH_XOR, Atomic bitwise XOR operation with prior fetch 7061* 'ATOMIC_OR': ATOMIC_OR, Atomic bitwise OR operation 7062* 'ATOMIC_REF': ATOMIC_REF, Obtaining the value of a variable atomically 7063* 'ATOMIC_XOR': ATOMIC_XOR, Atomic bitwise OR operation 7064* 'BACKTRACE': BACKTRACE, Show a backtrace 7065* 'BESSEL_J0': BESSEL_J0, Bessel function of the first kind of order 0 7066* 'BESSEL_J1': BESSEL_J1, Bessel function of the first kind of order 1 7067* 'BESSEL_JN': BESSEL_JN, Bessel function of the first kind 7068* 'BESSEL_Y0': BESSEL_Y0, Bessel function of the second kind of order 0 7069* 'BESSEL_Y1': BESSEL_Y1, Bessel function of the second kind of order 1 7070* 'BESSEL_YN': BESSEL_YN, Bessel function of the second kind 7071* 'BGE': BGE, Bitwise greater than or equal to 7072* 'BGT': BGT, Bitwise greater than 7073* 'BIT_SIZE': BIT_SIZE, Bit size inquiry function 7074* 'BLE': BLE, Bitwise less than or equal to 7075* 'BLT': BLT, Bitwise less than 7076* 'BTEST': BTEST, Bit test function 7077* 'C_ASSOCIATED': C_ASSOCIATED, Status of a C pointer 7078* 'C_F_POINTER': C_F_POINTER, Convert C into Fortran pointer 7079* 'C_F_PROCPOINTER': C_F_PROCPOINTER, Convert C into Fortran procedure pointer 7080* 'C_FUNLOC': C_FUNLOC, Obtain the C address of a procedure 7081* 'C_LOC': C_LOC, Obtain the C address of an object 7082* 'C_SIZEOF': C_SIZEOF, Size in bytes of an expression 7083* 'CEILING': CEILING, Integer ceiling function 7084* 'CHAR': CHAR, Integer-to-character conversion function 7085* 'CHDIR': CHDIR, Change working directory 7086* 'CHMOD': CHMOD, Change access permissions of files 7087* 'CMPLX': CMPLX, Complex conversion function 7088* 'CO_BROADCAST': CO_BROADCAST, Copy a value to all images the current set of images 7089* 'CO_MAX': CO_MAX, Maximal value on the current set of images 7090* 'CO_MIN': CO_MIN, Minimal value on the current set of images 7091* 'CO_REDUCE': CO_REDUCE, Reduction of values on the current set of images 7092* 'CO_SUM': CO_SUM, Sum of values on the current set of images 7093* 'COMMAND_ARGUMENT_COUNT': COMMAND_ARGUMENT_COUNT, Get number of command line arguments 7094* 'COMPILER_OPTIONS': COMPILER_OPTIONS, Options passed to the compiler 7095* 'COMPILER_VERSION': COMPILER_VERSION, Compiler version string 7096* 'COMPLEX': COMPLEX, Complex conversion function 7097* 'CONJG': CONJG, Complex conjugate function 7098* 'COS': COS, Cosine function 7099* 'COSD': COSD, Cosine function, degrees 7100* 'COSH': COSH, Hyperbolic cosine function 7101* 'COTAN': COTAN, Cotangent function 7102* 'COTAND': COTAND, Cotangent function, degrees 7103* 'COUNT': COUNT, Count occurrences of TRUE in an array 7104* 'CPU_TIME': CPU_TIME, CPU time subroutine 7105* 'CSHIFT': CSHIFT, Circular shift elements of an array 7106* 'CTIME': CTIME, Subroutine (or function) to convert a time into a string 7107* 'DATE_AND_TIME': DATE_AND_TIME, Date and time subroutine 7108* 'DBLE': DBLE, Double precision conversion function 7109* 'DCMPLX': DCMPLX, Double complex conversion function 7110* 'DIGITS': DIGITS, Significant digits function 7111* 'DIM': DIM, Positive difference 7112* 'DOT_PRODUCT': DOT_PRODUCT, Dot product function 7113* 'DPROD': DPROD, Double product function 7114* 'DREAL': DREAL, Double real part function 7115* 'DSHIFTL': DSHIFTL, Combined left shift 7116* 'DSHIFTR': DSHIFTR, Combined right shift 7117* 'DTIME': DTIME, Execution time subroutine (or function) 7118* 'EOSHIFT': EOSHIFT, End-off shift elements of an array 7119* 'EPSILON': EPSILON, Epsilon function 7120* 'ERF': ERF, Error function 7121* 'ERFC': ERFC, Complementary error function 7122* 'ERFC_SCALED': ERFC_SCALED, Exponentially-scaled complementary error function 7123* 'ETIME': ETIME, Execution time subroutine (or function) 7124* 'EVENT_QUERY': EVENT_QUERY, Query whether a coarray event has occurred 7125* 'EXECUTE_COMMAND_LINE': EXECUTE_COMMAND_LINE, Execute a shell command 7126* 'EXIT': EXIT, Exit the program with status. 7127* 'EXP': EXP, Exponential function 7128* 'EXPONENT': EXPONENT, Exponent function 7129* 'EXTENDS_TYPE_OF': EXTENDS_TYPE_OF, Query dynamic type for extension 7130* 'FDATE': FDATE, Subroutine (or function) to get the current time as a string 7131* 'FGET': FGET, Read a single character in stream mode from stdin 7132* 'FGETC': FGETC, Read a single character in stream mode 7133* 'FINDLOC': FINDLOC, Search an array for a value 7134* 'FLOOR': FLOOR, Integer floor function 7135* 'FLUSH': FLUSH, Flush I/O unit(s) 7136* 'FNUM': FNUM, File number function 7137* 'FPUT': FPUT, Write a single character in stream mode to stdout 7138* 'FPUTC': FPUTC, Write a single character in stream mode 7139* 'FRACTION': FRACTION, Fractional part of the model representation 7140* 'FREE': FREE, Memory de-allocation subroutine 7141* 'FSEEK': FSEEK, Low level file positioning subroutine 7142* 'FSTAT': FSTAT, Get file status 7143* 'FTELL': FTELL, Current stream position 7144* 'GAMMA': GAMMA, Gamma function 7145* 'GERROR': GERROR, Get last system error message 7146* 'GETARG': GETARG, Get command line arguments 7147* 'GET_COMMAND': GET_COMMAND, Get the entire command line 7148* 'GET_COMMAND_ARGUMENT': GET_COMMAND_ARGUMENT, Get command line arguments 7149* 'GETCWD': GETCWD, Get current working directory 7150* 'GETENV': GETENV, Get an environmental variable 7151* 'GET_ENVIRONMENT_VARIABLE': GET_ENVIRONMENT_VARIABLE, Get an environmental variable 7152* 'GETGID': GETGID, Group ID function 7153* 'GETLOG': GETLOG, Get login name 7154* 'GETPID': GETPID, Process ID function 7155* 'GETUID': GETUID, User ID function 7156* 'GMTIME': GMTIME, Convert time to GMT info 7157* 'HOSTNM': HOSTNM, Get system host name 7158* 'HUGE': HUGE, Largest number of a kind 7159* 'HYPOT': HYPOT, Euclidean distance function 7160* 'IACHAR': IACHAR, Code in ASCII collating sequence 7161* 'IALL': IALL, Bitwise AND of array elements 7162* 'IAND': IAND, Bitwise logical and 7163* 'IANY': IANY, Bitwise OR of array elements 7164* 'IARGC': IARGC, Get the number of command line arguments 7165* 'IBCLR': IBCLR, Clear bit 7166* 'IBITS': IBITS, Bit extraction 7167* 'IBSET': IBSET, Set bit 7168* 'ICHAR': ICHAR, Character-to-integer conversion function 7169* 'IDATE': IDATE, Current local time (day/month/year) 7170* 'IEOR': IEOR, Bitwise logical exclusive or 7171* 'IERRNO': IERRNO, Function to get the last system error number 7172* 'IMAGE_INDEX': IMAGE_INDEX, Cosubscript to image index conversion 7173* 'INDEX': INDEX intrinsic, Position of a substring within a string 7174* 'INT': INT, Convert to integer type 7175* 'INT2': INT2, Convert to 16-bit integer type 7176* 'INT8': INT8, Convert to 64-bit integer type 7177* 'IOR': IOR, Bitwise logical or 7178* 'IPARITY': IPARITY, Bitwise XOR of array elements 7179* 'IRAND': IRAND, Integer pseudo-random number 7180* 'IS_CONTIGUOUS': IS_CONTIGUOUS, Test whether an array is contiguous 7181* 'IS_IOSTAT_END': IS_IOSTAT_END, Test for end-of-file value 7182* 'IS_IOSTAT_EOR': IS_IOSTAT_EOR, Test for end-of-record value 7183* 'ISATTY': ISATTY, Whether a unit is a terminal device 7184* 'ISHFT': ISHFT, Shift bits 7185* 'ISHFTC': ISHFTC, Shift bits circularly 7186* 'ISNAN': ISNAN, Tests for a NaN 7187* 'ITIME': ITIME, Current local time (hour/minutes/seconds) 7188* 'KILL': KILL, Send a signal to a process 7189* 'KIND': KIND, Kind of an entity 7190* 'LBOUND': LBOUND, Lower dimension bounds of an array 7191* 'LCOBOUND': LCOBOUND, Lower codimension bounds of an array 7192* 'LEADZ': LEADZ, Number of leading zero bits of an integer 7193* 'LEN': LEN, Length of a character entity 7194* 'LEN_TRIM': LEN_TRIM, Length of a character entity without trailing blank characters 7195* 'LGE': LGE, Lexical greater than or equal 7196* 'LGT': LGT, Lexical greater than 7197* 'LINK': LINK, Create a hard link 7198* 'LLE': LLE, Lexical less than or equal 7199* 'LLT': LLT, Lexical less than 7200* 'LNBLNK': LNBLNK, Index of the last non-blank character in a string 7201* 'LOC': LOC, Returns the address of a variable 7202* 'LOG': LOG, Logarithm function 7203* 'LOG10': LOG10, Base 10 logarithm function 7204* 'LOG_GAMMA': LOG_GAMMA, Logarithm of the Gamma function 7205* 'LOGICAL': LOGICAL, Convert to logical type 7206* 'LONG': LONG, Convert to integer type 7207* 'LSHIFT': LSHIFT, Left shift bits 7208* 'LSTAT': LSTAT, Get file status 7209* 'LTIME': LTIME, Convert time to local time info 7210* 'MALLOC': MALLOC, Dynamic memory allocation function 7211* 'MASKL': MASKL, Left justified mask 7212* 'MASKR': MASKR, Right justified mask 7213* 'MATMUL': MATMUL, matrix multiplication 7214* 'MAX': MAX, Maximum value of an argument list 7215* 'MAXEXPONENT': MAXEXPONENT, Maximum exponent of a real kind 7216* 'MAXLOC': MAXLOC, Location of the maximum value within an array 7217* 'MAXVAL': MAXVAL, Maximum value of an array 7218* 'MCLOCK': MCLOCK, Time function 7219* 'MCLOCK8': MCLOCK8, Time function (64-bit) 7220* 'MERGE': MERGE, Merge arrays 7221* 'MERGE_BITS': MERGE_BITS, Merge of bits under mask 7222* 'MIN': MIN, Minimum value of an argument list 7223* 'MINEXPONENT': MINEXPONENT, Minimum exponent of a real kind 7224* 'MINLOC': MINLOC, Location of the minimum value within an array 7225* 'MINVAL': MINVAL, Minimum value of an array 7226* 'MOD': MOD, Remainder function 7227* 'MODULO': MODULO, Modulo function 7228* 'MOVE_ALLOC': MOVE_ALLOC, Move allocation from one object to another 7229* 'MVBITS': MVBITS, Move bits from one integer to another 7230* 'NEAREST': NEAREST, Nearest representable number 7231* 'NEW_LINE': NEW_LINE, New line character 7232* 'NINT': NINT, Nearest whole number 7233* 'NORM2': NORM2, Euclidean vector norm 7234* 'NOT': NOT, Logical negation 7235* 'NULL': NULL, Function that returns an disassociated pointer 7236* 'NUM_IMAGES': NUM_IMAGES, Number of images 7237* 'OR': OR, Bitwise logical OR 7238* 'PACK': PACK, Pack an array into an array of rank one 7239* 'PARITY': PARITY, Reduction with exclusive OR 7240* 'PERROR': PERROR, Print system error message 7241* 'POPCNT': POPCNT, Number of bits set 7242* 'POPPAR': POPPAR, Parity of the number of bits set 7243* 'PRECISION': PRECISION, Decimal precision of a real kind 7244* 'PRESENT': PRESENT, Determine whether an optional dummy argument is specified 7245* 'PRODUCT': PRODUCT, Product of array elements 7246* 'RADIX': RADIX, Base of a data model 7247* 'RAN': RAN, Real pseudo-random number 7248* 'RAND': RAND, Real pseudo-random number 7249* 'RANDOM_INIT': RANDOM_INIT, Initialize pseudo-random number generator 7250* 'RANDOM_NUMBER': RANDOM_NUMBER, Pseudo-random number 7251* 'RANDOM_SEED': RANDOM_SEED, Initialize a pseudo-random number sequence 7252* 'RANGE': RANGE, Decimal exponent range 7253* 'RANK' : RANK, Rank of a data object 7254* 'REAL': REAL, Convert to real type 7255* 'RENAME': RENAME, Rename a file 7256* 'REPEAT': REPEAT, Repeated string concatenation 7257* 'RESHAPE': RESHAPE, Function to reshape an array 7258* 'RRSPACING': RRSPACING, Reciprocal of the relative spacing 7259* 'RSHIFT': RSHIFT, Right shift bits 7260* 'SAME_TYPE_AS': SAME_TYPE_AS, Query dynamic types for equality 7261* 'SCALE': SCALE, Scale a real value 7262* 'SCAN': SCAN, Scan a string for the presence of a set of characters 7263* 'SECNDS': SECNDS, Time function 7264* 'SECOND': SECOND, CPU time function 7265* 'SELECTED_CHAR_KIND': SELECTED_CHAR_KIND, Choose character kind 7266* 'SELECTED_INT_KIND': SELECTED_INT_KIND, Choose integer kind 7267* 'SELECTED_REAL_KIND': SELECTED_REAL_KIND, Choose real kind 7268* 'SET_EXPONENT': SET_EXPONENT, Set the exponent of the model 7269* 'SHAPE': SHAPE, Determine the shape of an array 7270* 'SHIFTA': SHIFTA, Right shift with fill 7271* 'SHIFTL': SHIFTL, Left shift 7272* 'SHIFTR': SHIFTR, Right shift 7273* 'SIGN': SIGN, Sign copying function 7274* 'SIGNAL': SIGNAL, Signal handling subroutine (or function) 7275* 'SIN': SIN, Sine function 7276* 'SIND': SIND, Sine function, degrees 7277* 'SINH': SINH, Hyperbolic sine function 7278* 'SIZE': SIZE, Function to determine the size of an array 7279* 'SIZEOF': SIZEOF, Determine the size in bytes of an expression 7280* 'SLEEP': SLEEP, Sleep for the specified number of seconds 7281* 'SPACING': SPACING, Smallest distance between two numbers of a given type 7282* 'SPREAD': SPREAD, Add a dimension to an array 7283* 'SQRT': SQRT, Square-root function 7284* 'SRAND': SRAND, Reinitialize the random number generator 7285* 'STAT': STAT, Get file status 7286* 'STORAGE_SIZE': STORAGE_SIZE, Storage size in bits 7287* 'SUM': SUM, Sum of array elements 7288* 'SYMLNK': SYMLNK, Create a symbolic link 7289* 'SYSTEM': SYSTEM, Execute a shell command 7290* 'SYSTEM_CLOCK': SYSTEM_CLOCK, Time function 7291* 'TAN': TAN, Tangent function 7292* 'TAND': TAND, Tangent function, degrees 7293* 'TANH': TANH, Hyperbolic tangent function 7294* 'THIS_IMAGE': THIS_IMAGE, Cosubscript index of this image 7295* 'TIME': TIME, Time function 7296* 'TIME8': TIME8, Time function (64-bit) 7297* 'TINY': TINY, Smallest positive number of a real kind 7298* 'TRAILZ': TRAILZ, Number of trailing zero bits of an integer 7299* 'TRANSFER': TRANSFER, Transfer bit patterns 7300* 'TRANSPOSE': TRANSPOSE, Transpose an array of rank two 7301* 'TRIM': TRIM, Remove trailing blank characters of a string 7302* 'TTYNAM': TTYNAM, Get the name of a terminal device. 7303* 'UBOUND': UBOUND, Upper dimension bounds of an array 7304* 'UCOBOUND': UCOBOUND, Upper codimension bounds of an array 7305* 'UMASK': UMASK, Set the file creation mask 7306* 'UNLINK': UNLINK, Remove a file from the file system 7307* 'UNPACK': UNPACK, Unpack an array of rank one into an array 7308* 'VERIFY': VERIFY, Scan a string for the absence of a set of characters 7309* 'XOR': XOR, Bitwise logical exclusive or 7310 7311 7312File: gfortran.info, Node: Introduction to Intrinsics, Next: ABORT, Up: Intrinsic Procedures 7313 73149.1 Introduction to intrinsic procedures 7315======================================== 7316 7317The intrinsic procedures provided by GNU Fortran include all of the 7318intrinsic procedures required by the Fortran 95 standard, a set of 7319intrinsic procedures for backwards compatibility with G77, and a 7320selection of intrinsic procedures from the Fortran 2003 and Fortran 2008 7321standards. Any conflict between a description here and a description in 7322either the Fortran 95 standard, the Fortran 2003 standard or the Fortran 73232008 standard is unintentional, and the standard(s) should be considered 7324authoritative. 7325 7326 The enumeration of the 'KIND' type parameter is processor defined in 7327the Fortran 95 standard. GNU Fortran defines the default integer type 7328and default real type by 'INTEGER(KIND=4)' and 'REAL(KIND=4)', 7329respectively. The standard mandates that both data types shall have 7330another kind, which have more precision. On typical target 7331architectures supported by 'gfortran', this kind type parameter is 7332'KIND=8'. Hence, 'REAL(KIND=8)' and 'DOUBLE PRECISION' are equivalent. 7333In the description of generic intrinsic procedures, the kind type 7334parameter will be specified by 'KIND=*', and in the description of 7335specific names for an intrinsic procedure the kind type parameter will 7336be explicitly given (e.g., 'REAL(KIND=4)' or 'REAL(KIND=8)'). Finally, 7337for brevity the optional 'KIND=' syntax will be omitted. 7338 7339 Many of the intrinsic procedures take one or more optional arguments. 7340This document follows the convention used in the Fortran 95 standard, 7341and denotes such arguments by square brackets. 7342 7343 GNU Fortran offers the '-std=f95' and '-std=gnu' options, which can 7344be used to restrict the set of intrinsic procedures to a given standard. 7345By default, 'gfortran' sets the '-std=gnu' option, and so all intrinsic 7346procedures described here are accepted. There is one caveat. For a 7347select group of intrinsic procedures, 'g77' implemented both a function 7348and a subroutine. Both classes have been implemented in 'gfortran' for 7349backwards compatibility with 'g77'. It is noted here that these 7350functions and subroutines cannot be intermixed in a given subprogram. 7351In the descriptions that follow, the applicable standard for each 7352intrinsic procedure is noted. 7353 7354 7355File: gfortran.info, Node: ABORT, Next: ABS, Prev: Introduction to Intrinsics, Up: Intrinsic Procedures 7356 73579.2 'ABORT' -- Abort the program 7358================================ 7359 7360_Description_: 7361 'ABORT' causes immediate termination of the program. On operating 7362 systems that support a core dump, 'ABORT' will produce a core dump. 7363 It will also print a backtrace, unless '-fno-backtrace' is given. 7364 7365_Standard_: 7366 GNU extension 7367 7368_Class_: 7369 Subroutine 7370 7371_Syntax_: 7372 'CALL ABORT' 7373 7374_Return value_: 7375 Does not return. 7376 7377_Example_: 7378 program test_abort 7379 integer :: i = 1, j = 2 7380 if (i /= j) call abort 7381 end program test_abort 7382 7383_See also_: 7384 *note EXIT::, *note KILL::, *note BACKTRACE:: 7385 7386 7387File: gfortran.info, Node: ABS, Next: ACCESS, Prev: ABORT, Up: Intrinsic Procedures 7388 73899.3 'ABS' -- Absolute value 7390=========================== 7391 7392_Description_: 7393 'ABS(A)' computes the absolute value of 'A'. 7394 7395_Standard_: 7396 Fortran 77 and later, has overloads that are GNU extensions 7397 7398_Class_: 7399 Elemental function 7400 7401_Syntax_: 7402 'RESULT = ABS(A)' 7403 7404_Arguments_: 7405 A The type of the argument shall be an 'INTEGER', 7406 'REAL', or 'COMPLEX'. 7407 7408_Return value_: 7409 The return value is of the same type and kind as the argument 7410 except the return value is 'REAL' for a 'COMPLEX' argument. 7411 7412_Example_: 7413 program test_abs 7414 integer :: i = -1 7415 real :: x = -1.e0 7416 complex :: z = (-1.e0,0.e0) 7417 i = abs(i) 7418 x = abs(x) 7419 x = abs(z) 7420 end program test_abs 7421 7422_Specific names_: 7423 Name Argument Return type Standard 7424 'ABS(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and 7425 later 7426 'CABS(A)' 'COMPLEX(4) 'REAL(4)' Fortran 77 and 7427 A' later 7428 'DABS(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and 7429 later 7430 'IABS(A)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and 7431 A' later 7432 'BABS(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 7433 A' 7434 'IIABS(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 7435 A' 7436 'JIABS(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 7437 A' 7438 'KIABS(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 7439 A' 7440 'ZABS(A)' 'COMPLEX(8) 'REAL(8)' GNU extension 7441 A' 7442 'CDABS(A)' 'COMPLEX(8) 'REAL(8)' GNU extension 7443 A' 7444 7445 7446File: gfortran.info, Node: ACCESS, Next: ACHAR, Prev: ABS, Up: Intrinsic Procedures 7447 74489.4 'ACCESS' -- Checks file access modes 7449======================================== 7450 7451_Description_: 7452 'ACCESS(NAME, MODE)' checks whether the file NAME exists, is 7453 readable, writable or executable. Except for the executable check, 7454 'ACCESS' can be replaced by Fortran 95's 'INQUIRE'. 7455 7456_Standard_: 7457 GNU extension 7458 7459_Class_: 7460 Inquiry function 7461 7462_Syntax_: 7463 'RESULT = ACCESS(NAME, MODE)' 7464 7465_Arguments_: 7466 NAME Scalar 'CHARACTER' of default kind with the file 7467 name. Tailing blank are ignored unless the 7468 character 'achar(0)' is present, then all 7469 characters up to and excluding 'achar(0)' are 7470 used as file name. 7471 MODE Scalar 'CHARACTER' of default kind with the file 7472 access mode, may be any concatenation of '"r"' 7473 (readable), '"w"' (writable) and '"x"' 7474 (executable), or '" "' to check for existence. 7475 7476_Return value_: 7477 Returns a scalar 'INTEGER', which is '0' if the file is accessible 7478 in the given mode; otherwise or if an invalid argument has been 7479 given for 'MODE' the value '1' is returned. 7480 7481_Example_: 7482 program access_test 7483 implicit none 7484 character(len=*), parameter :: file = 'test.dat' 7485 character(len=*), parameter :: file2 = 'test.dat '//achar(0) 7486 if(access(file,' ') == 0) print *, trim(file),' is exists' 7487 if(access(file,'r') == 0) print *, trim(file),' is readable' 7488 if(access(file,'w') == 0) print *, trim(file),' is writable' 7489 if(access(file,'x') == 0) print *, trim(file),' is executable' 7490 if(access(file2,'rwx') == 0) & 7491 print *, trim(file2),' is readable, writable and executable' 7492 end program access_test 7493 7494 7495File: gfortran.info, Node: ACHAR, Next: ACOS, Prev: ACCESS, Up: Intrinsic Procedures 7496 74979.5 'ACHAR' -- Character in ASCII collating sequence 7498==================================================== 7499 7500_Description_: 7501 'ACHAR(I)' returns the character located at position 'I' in the 7502 ASCII collating sequence. 7503 7504_Standard_: 7505 Fortran 77 and later, with KIND argument Fortran 2003 and later 7506 7507_Class_: 7508 Elemental function 7509 7510_Syntax_: 7511 'RESULT = ACHAR(I [, KIND])' 7512 7513_Arguments_: 7514 I The type shall be 'INTEGER'. 7515 KIND (Optional) An 'INTEGER' initialization 7516 expression indicating the kind parameter of the 7517 result. 7518 7519_Return value_: 7520 The return value is of type 'CHARACTER' with a length of one. If 7521 the KIND argument is present, the return value is of the specified 7522 kind and of the default kind otherwise. 7523 7524_Example_: 7525 program test_achar 7526 character c 7527 c = achar(32) 7528 end program test_achar 7529 7530_Note_: 7531 See *note ICHAR:: for a discussion of converting between numerical 7532 values and formatted string representations. 7533 7534_See also_: 7535 *note CHAR::, *note IACHAR::, *note ICHAR:: 7536 7537 7538File: gfortran.info, Node: ACOS, Next: ACOSD, Prev: ACHAR, Up: Intrinsic Procedures 7539 75409.6 'ACOS' -- Arccosine function 7541================================ 7542 7543_Description_: 7544 'ACOS(X)' computes the arccosine of X (inverse of 'COS(X)'). 7545 7546_Standard_: 7547 Fortran 77 and later, for a complex argument Fortran 2008 or later 7548 7549_Class_: 7550 Elemental function 7551 7552_Syntax_: 7553 'RESULT = ACOS(X)' 7554 7555_Arguments_: 7556 X The type shall either be 'REAL' with a magnitude 7557 that is less than or equal to one - or the type 7558 shall be 'COMPLEX'. 7559 7560_Return value_: 7561 The return value is of the same type and kind as X. The real part 7562 of the result is in radians and lies in the range 0 \leq \Re 7563 \acos(x) \leq \pi. 7564 7565_Example_: 7566 program test_acos 7567 real(8) :: x = 0.866_8 7568 x = acos(x) 7569 end program test_acos 7570 7571_Specific names_: 7572 Name Argument Return type Standard 7573 'ACOS(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 7574 later 7575 'DACOS(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 7576 later 7577 7578_See also_: 7579 Inverse function: *note COS:: Degrees function: *note ACOSD:: 7580 7581 7582File: gfortran.info, Node: ACOSD, Next: ACOSH, Prev: ACOS, Up: Intrinsic Procedures 7583 75849.7 'ACOSD' -- Arccosine function, degrees 7585========================================== 7586 7587_Description_: 7588 'ACOSD(X)' computes the arccosine of X in degrees (inverse of 7589 'COSD(X)'). 7590 7591 This function is for compatibility only and should be avoided in 7592 favor of standard constructs wherever possible. 7593 7594_Standard_: 7595 GNU extension, enabled with '-fdec-math' 7596 7597_Class_: 7598 Elemental function 7599 7600_Syntax_: 7601 'RESULT = ACOSD(X)' 7602 7603_Arguments_: 7604 X The type shall either be 'REAL' with a magnitude 7605 that is less than or equal to one - or the type 7606 shall be 'COMPLEX'. 7607 7608_Return value_: 7609 The return value is of the same type and kind as X. The real part 7610 of the result is in degrees and lies in the range 0 \leq \Re 7611 \acos(x) \leq 180. 7612 7613_Example_: 7614 program test_acosd 7615 real(8) :: x = 0.866_8 7616 x = acosd(x) 7617 end program test_acosd 7618 7619_Specific names_: 7620 Name Argument Return type Standard 7621 'ACOSD(X)' 'REAL(4) X' 'REAL(4)' GNU extension 7622 'DACOSD(X)' 'REAL(8) X' 'REAL(8)' GNU extension 7623 7624_See also_: 7625 Inverse function: *note COSD:: Radians function: *note ACOS:: 7626 7627 7628File: gfortran.info, Node: ACOSH, Next: ADJUSTL, Prev: ACOSD, Up: Intrinsic Procedures 7629 76309.8 'ACOSH' -- Inverse hyperbolic cosine function 7631================================================= 7632 7633_Description_: 7634 'ACOSH(X)' computes the inverse hyperbolic cosine of X. 7635 7636_Standard_: 7637 Fortran 2008 and later 7638 7639_Class_: 7640 Elemental function 7641 7642_Syntax_: 7643 'RESULT = ACOSH(X)' 7644 7645_Arguments_: 7646 X The type shall be 'REAL' or 'COMPLEX'. 7647 7648_Return value_: 7649 The return value has the same type and kind as X. If X is complex, 7650 the imaginary part of the result is in radians and lies between 0 7651 \leq \Im \acosh(x) \leq \pi. 7652 7653_Example_: 7654 PROGRAM test_acosh 7655 REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /) 7656 WRITE (*,*) ACOSH(x) 7657 END PROGRAM 7658 7659_Specific names_: 7660 Name Argument Return type Standard 7661 'DACOSH(X)' 'REAL(8) X' 'REAL(8)' GNU extension 7662 7663_See also_: 7664 Inverse function: *note COSH:: 7665 7666 7667File: gfortran.info, Node: ADJUSTL, Next: ADJUSTR, Prev: ACOSH, Up: Intrinsic Procedures 7668 76699.9 'ADJUSTL' -- Left adjust a string 7670===================================== 7671 7672_Description_: 7673 'ADJUSTL(STRING)' will left adjust a string by removing leading 7674 spaces. Spaces are inserted at the end of the string as needed. 7675 7676_Standard_: 7677 Fortran 90 and later 7678 7679_Class_: 7680 Elemental function 7681 7682_Syntax_: 7683 'RESULT = ADJUSTL(STRING)' 7684 7685_Arguments_: 7686 STRING The type shall be 'CHARACTER'. 7687 7688_Return value_: 7689 The return value is of type 'CHARACTER' and of the same kind as 7690 STRING where leading spaces are removed and the same number of 7691 spaces are inserted on the end of STRING. 7692 7693_Example_: 7694 program test_adjustl 7695 character(len=20) :: str = ' gfortran' 7696 str = adjustl(str) 7697 print *, str 7698 end program test_adjustl 7699 7700_See also_: 7701 *note ADJUSTR::, *note TRIM:: 7702 7703 7704File: gfortran.info, Node: ADJUSTR, Next: AIMAG, Prev: ADJUSTL, Up: Intrinsic Procedures 7705 77069.10 'ADJUSTR' -- Right adjust a string 7707======================================= 7708 7709_Description_: 7710 'ADJUSTR(STRING)' will right adjust a string by removing trailing 7711 spaces. Spaces are inserted at the start of the string as needed. 7712 7713_Standard_: 7714 Fortran 90 and later 7715 7716_Class_: 7717 Elemental function 7718 7719_Syntax_: 7720 'RESULT = ADJUSTR(STRING)' 7721 7722_Arguments_: 7723 STR The type shall be 'CHARACTER'. 7724 7725_Return value_: 7726 The return value is of type 'CHARACTER' and of the same kind as 7727 STRING where trailing spaces are removed and the same number of 7728 spaces are inserted at the start of STRING. 7729 7730_Example_: 7731 program test_adjustr 7732 character(len=20) :: str = 'gfortran' 7733 str = adjustr(str) 7734 print *, str 7735 end program test_adjustr 7736 7737_See also_: 7738 *note ADJUSTL::, *note TRIM:: 7739 7740 7741File: gfortran.info, Node: AIMAG, Next: AINT, Prev: ADJUSTR, Up: Intrinsic Procedures 7742 77439.11 'AIMAG' -- Imaginary part of complex number 7744================================================ 7745 7746_Description_: 7747 'AIMAG(Z)' yields the imaginary part of complex argument 'Z'. The 7748 'IMAG(Z)' and 'IMAGPART(Z)' intrinsic functions are provided for 7749 compatibility with 'g77', and their use in new code is strongly 7750 discouraged. 7751 7752_Standard_: 7753 Fortran 77 and later, has overloads that are GNU extensions 7754 7755_Class_: 7756 Elemental function 7757 7758_Syntax_: 7759 'RESULT = AIMAG(Z)' 7760 7761_Arguments_: 7762 Z The type of the argument shall be 'COMPLEX'. 7763 7764_Return value_: 7765 The return value is of type 'REAL' with the kind type parameter of 7766 the argument. 7767 7768_Example_: 7769 program test_aimag 7770 complex(4) z4 7771 complex(8) z8 7772 z4 = cmplx(1.e0_4, 0.e0_4) 7773 z8 = cmplx(0.e0_8, 1.e0_8) 7774 print *, aimag(z4), dimag(z8) 7775 end program test_aimag 7776 7777_Specific names_: 7778 Name Argument Return type Standard 7779 'AIMAG(Z)' 'COMPLEX Z' 'REAL' Fortran 77 and 7780 later 7781 'DIMAG(Z)' 'COMPLEX(8) 'REAL(8)' GNU extension 7782 Z' 7783 'IMAG(Z)' 'COMPLEX Z' 'REAL' GNU extension 7784 'IMAGPART(Z)' 'COMPLEX Z' 'REAL' GNU extension 7785 7786 7787File: gfortran.info, Node: AINT, Next: ALARM, Prev: AIMAG, Up: Intrinsic Procedures 7788 77899.12 'AINT' -- Truncate to a whole number 7790========================================= 7791 7792_Description_: 7793 'AINT(A [, KIND])' truncates its argument to a whole number. 7794 7795_Standard_: 7796 Fortran 77 and later 7797 7798_Class_: 7799 Elemental function 7800 7801_Syntax_: 7802 'RESULT = AINT(A [, KIND])' 7803 7804_Arguments_: 7805 A The type of the argument shall be 'REAL'. 7806 KIND (Optional) An 'INTEGER' initialization 7807 expression indicating the kind parameter of the 7808 result. 7809 7810_Return value_: 7811 The return value is of type 'REAL' with the kind type parameter of 7812 the argument if the optional KIND is absent; otherwise, the kind 7813 type parameter will be given by KIND. If the magnitude of X is 7814 less than one, 'AINT(X)' returns zero. If the magnitude is equal 7815 to or greater than one then it returns the largest whole number 7816 that does not exceed its magnitude. The sign is the same as the 7817 sign of X. 7818 7819_Example_: 7820 program test_aint 7821 real(4) x4 7822 real(8) x8 7823 x4 = 1.234E0_4 7824 x8 = 4.321_8 7825 print *, aint(x4), dint(x8) 7826 x8 = aint(x4,8) 7827 end program test_aint 7828 7829_Specific names_: 7830 Name Argument Return type Standard 7831 'AINT(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and 7832 later 7833 'DINT(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and 7834 later 7835 7836 7837File: gfortran.info, Node: ALARM, Next: ALL, Prev: AINT, Up: Intrinsic Procedures 7838 78399.13 'ALARM' -- Execute a routine after a given delay 7840===================================================== 7841 7842_Description_: 7843 'ALARM(SECONDS, HANDLER [, STATUS])' causes external subroutine 7844 HANDLER to be executed after a delay of SECONDS by using 'alarm(2)' 7845 to set up a signal and 'signal(2)' to catch it. If STATUS is 7846 supplied, it will be returned with the number of seconds remaining 7847 until any previously scheduled alarm was due to be delivered, or 7848 zero if there was no previously scheduled alarm. 7849 7850_Standard_: 7851 GNU extension 7852 7853_Class_: 7854 Subroutine 7855 7856_Syntax_: 7857 'CALL ALARM(SECONDS, HANDLER [, STATUS])' 7858 7859_Arguments_: 7860 SECONDS The type of the argument shall be a scalar 7861 'INTEGER'. It is 'INTENT(IN)'. 7862 HANDLER Signal handler ('INTEGER FUNCTION' or 7863 'SUBROUTINE') or dummy/global 'INTEGER' scalar. 7864 The scalar values may be either 'SIG_IGN=1' to 7865 ignore the alarm generated or 'SIG_DFL=0' to set 7866 the default action. It is 'INTENT(IN)'. 7867 STATUS (Optional) STATUS shall be a scalar variable of 7868 the default 'INTEGER' kind. It is 7869 'INTENT(OUT)'. 7870 7871_Example_: 7872 program test_alarm 7873 external handler_print 7874 integer i 7875 call alarm (3, handler_print, i) 7876 print *, i 7877 call sleep(10) 7878 end program test_alarm 7879 This will cause the external routine HANDLER_PRINT to be called 7880 after 3 seconds. 7881 7882 7883File: gfortran.info, Node: ALL, Next: ALLOCATED, Prev: ALARM, Up: Intrinsic Procedures 7884 78859.14 'ALL' -- All values in MASK along DIM are true 7886=================================================== 7887 7888_Description_: 7889 'ALL(MASK [, DIM])' determines if all the values are true in MASK 7890 in the array along dimension DIM. 7891 7892_Standard_: 7893 Fortran 90 and later 7894 7895_Class_: 7896 Transformational function 7897 7898_Syntax_: 7899 'RESULT = ALL(MASK [, DIM])' 7900 7901_Arguments_: 7902 MASK The type of the argument shall be 'LOGICAL' and 7903 it shall not be scalar. 7904 DIM (Optional) DIM shall be a scalar integer with a 7905 value that lies between one and the rank of 7906 MASK. 7907 7908_Return value_: 7909 'ALL(MASK)' returns a scalar value of type 'LOGICAL' where the kind 7910 type parameter is the same as the kind type parameter of MASK. If 7911 DIM is present, then 'ALL(MASK, DIM)' returns an array with the 7912 rank of MASK minus 1. The shape is determined from the shape of 7913 MASK where the DIM dimension is elided. 7914 7915 (A) 7916 'ALL(MASK)' is true if all elements of MASK are true. It also 7917 is true if MASK has zero size; otherwise, it is false. 7918 (B) 7919 If the rank of MASK is one, then 'ALL(MASK,DIM)' is equivalent 7920 to 'ALL(MASK)'. If the rank is greater than one, then 7921 'ALL(MASK,DIM)' is determined by applying 'ALL' to the array 7922 sections. 7923 7924_Example_: 7925 program test_all 7926 logical l 7927 l = all((/.true., .true., .true./)) 7928 print *, l 7929 call section 7930 contains 7931 subroutine section 7932 integer a(2,3), b(2,3) 7933 a = 1 7934 b = 1 7935 b(2,2) = 2 7936 print *, all(a .eq. b, 1) 7937 print *, all(a .eq. b, 2) 7938 end subroutine section 7939 end program test_all 7940 7941 7942File: gfortran.info, Node: ALLOCATED, Next: AND, Prev: ALL, Up: Intrinsic Procedures 7943 79449.15 'ALLOCATED' -- Status of an allocatable entity 7945=================================================== 7946 7947_Description_: 7948 'ALLOCATED(ARRAY)' and 'ALLOCATED(SCALAR)' check the allocation 7949 status of ARRAY and SCALAR, respectively. 7950 7951_Standard_: 7952 Fortran 90 and later. Note, the 'SCALAR=' keyword and allocatable 7953 scalar entities are available in Fortran 2003 and later. 7954 7955_Class_: 7956 Inquiry function 7957 7958_Syntax_: 7959 'RESULT = ALLOCATED(ARRAY)' 7960 'RESULT = ALLOCATED(SCALAR)' 7961 7962_Arguments_: 7963 ARRAY The argument shall be an 'ALLOCATABLE' array. 7964 SCALAR The argument shall be an 'ALLOCATABLE' scalar. 7965 7966_Return value_: 7967 The return value is a scalar 'LOGICAL' with the default logical 7968 kind type parameter. If the argument is allocated, then the result 7969 is '.TRUE.'; otherwise, it returns '.FALSE.' 7970 7971_Example_: 7972 program test_allocated 7973 integer :: i = 4 7974 real(4), allocatable :: x(:) 7975 if (.not. allocated(x)) allocate(x(i)) 7976 end program test_allocated 7977 7978 7979File: gfortran.info, Node: AND, Next: ANINT, Prev: ALLOCATED, Up: Intrinsic Procedures 7980 79819.16 'AND' -- Bitwise logical AND 7982================================= 7983 7984_Description_: 7985 Bitwise logical 'AND'. 7986 7987 This intrinsic routine is provided for backwards compatibility with 7988 GNU Fortran 77. For integer arguments, programmers should consider 7989 the use of the *note IAND:: intrinsic defined by the Fortran 7990 standard. 7991 7992_Standard_: 7993 GNU extension 7994 7995_Class_: 7996 Function 7997 7998_Syntax_: 7999 'RESULT = AND(I, J)' 8000 8001_Arguments_: 8002 I The type shall be either a scalar 'INTEGER' type 8003 or a scalar 'LOGICAL' type or a 8004 boz-literal-constant. 8005 J The type shall be the same as the type of I or a 8006 boz-literal-constant. I and J shall not both be 8007 boz-literal-constants. If either I or J is a 8008 boz-literal-constant, then the other argument 8009 must be a scalar 'INTEGER'. 8010 8011_Return value_: 8012 The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'. 8013 If the kind type parameters differ, then the smaller kind type is 8014 implicitly converted to larger kind, and the return has the larger 8015 kind. A boz-literal-constant is converted to an 'INTEGER' with the 8016 kind type parameter of the other argument as-if a call to *note 8017 INT:: occurred. 8018 8019_Example_: 8020 PROGRAM test_and 8021 LOGICAL :: T = .TRUE., F = .FALSE. 8022 INTEGER :: a, b 8023 DATA a / Z'F' /, b / Z'3' / 8024 8025 WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F) 8026 WRITE (*,*) AND(a, b) 8027 END PROGRAM 8028 8029_See also_: 8030 Fortran 95 elemental function: *note IAND:: 8031 8032 8033File: gfortran.info, Node: ANINT, Next: ANY, Prev: AND, Up: Intrinsic Procedures 8034 80359.17 'ANINT' -- Nearest whole number 8036==================================== 8037 8038_Description_: 8039 'ANINT(A [, KIND])' rounds its argument to the nearest whole 8040 number. 8041 8042_Standard_: 8043 Fortran 77 and later 8044 8045_Class_: 8046 Elemental function 8047 8048_Syntax_: 8049 'RESULT = ANINT(A [, KIND])' 8050 8051_Arguments_: 8052 A The type of the argument shall be 'REAL'. 8053 KIND (Optional) An 'INTEGER' initialization 8054 expression indicating the kind parameter of the 8055 result. 8056 8057_Return value_: 8058 The return value is of type real with the kind type parameter of 8059 the argument if the optional KIND is absent; otherwise, the kind 8060 type parameter will be given by KIND. If A is greater than zero, 8061 'ANINT(A)' returns 'AINT(X+0.5)'. If A is less than or equal to 8062 zero then it returns 'AINT(X-0.5)'. 8063 8064_Example_: 8065 program test_anint 8066 real(4) x4 8067 real(8) x8 8068 x4 = 1.234E0_4 8069 x8 = 4.321_8 8070 print *, anint(x4), dnint(x8) 8071 x8 = anint(x4,8) 8072 end program test_anint 8073 8074_Specific names_: 8075 Name Argument Return type Standard 8076 'AINT(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and 8077 later 8078 'DNINT(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and 8079 later 8080 8081 8082File: gfortran.info, Node: ANY, Next: ASIN, Prev: ANINT, Up: Intrinsic Procedures 8083 80849.18 'ANY' -- Any value in MASK along DIM is true 8085================================================= 8086 8087_Description_: 8088 'ANY(MASK [, DIM])' determines if any of the values in the logical 8089 array MASK along dimension DIM are '.TRUE.'. 8090 8091_Standard_: 8092 Fortran 90 and later 8093 8094_Class_: 8095 Transformational function 8096 8097_Syntax_: 8098 'RESULT = ANY(MASK [, DIM])' 8099 8100_Arguments_: 8101 MASK The type of the argument shall be 'LOGICAL' and 8102 it shall not be scalar. 8103 DIM (Optional) DIM shall be a scalar integer with a 8104 value that lies between one and the rank of 8105 MASK. 8106 8107_Return value_: 8108 'ANY(MASK)' returns a scalar value of type 'LOGICAL' where the kind 8109 type parameter is the same as the kind type parameter of MASK. If 8110 DIM is present, then 'ANY(MASK, DIM)' returns an array with the 8111 rank of MASK minus 1. The shape is determined from the shape of 8112 MASK where the DIM dimension is elided. 8113 8114 (A) 8115 'ANY(MASK)' is true if any element of MASK is true; otherwise, 8116 it is false. It also is false if MASK has zero size. 8117 (B) 8118 If the rank of MASK is one, then 'ANY(MASK,DIM)' is equivalent 8119 to 'ANY(MASK)'. If the rank is greater than one, then 8120 'ANY(MASK,DIM)' is determined by applying 'ANY' to the array 8121 sections. 8122 8123_Example_: 8124 program test_any 8125 logical l 8126 l = any((/.true., .true., .true./)) 8127 print *, l 8128 call section 8129 contains 8130 subroutine section 8131 integer a(2,3), b(2,3) 8132 a = 1 8133 b = 1 8134 b(2,2) = 2 8135 print *, any(a .eq. b, 1) 8136 print *, any(a .eq. b, 2) 8137 end subroutine section 8138 end program test_any 8139 8140 8141File: gfortran.info, Node: ASIN, Next: ASIND, Prev: ANY, Up: Intrinsic Procedures 8142 81439.19 'ASIN' -- Arcsine function 8144=============================== 8145 8146_Description_: 8147 'ASIN(X)' computes the arcsine of its X (inverse of 'SIN(X)'). 8148 8149_Standard_: 8150 Fortran 77 and later, for a complex argument Fortran 2008 or later 8151 8152_Class_: 8153 Elemental function 8154 8155_Syntax_: 8156 'RESULT = ASIN(X)' 8157 8158_Arguments_: 8159 X The type shall be either 'REAL' and a magnitude 8160 that is less than or equal to one - or be 8161 'COMPLEX'. 8162 8163_Return value_: 8164 The return value is of the same type and kind as X. The real part 8165 of the result is in radians and lies in the range -\pi/2 \leq \Re 8166 \asin(x) \leq \pi/2. 8167 8168_Example_: 8169 program test_asin 8170 real(8) :: x = 0.866_8 8171 x = asin(x) 8172 end program test_asin 8173 8174_Specific names_: 8175 Name Argument Return type Standard 8176 'ASIN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 8177 later 8178 'DASIN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 8179 later 8180 8181_See also_: 8182 Inverse function: *note SIN:: Degrees function: *note ASIND:: 8183 8184 8185File: gfortran.info, Node: ASIND, Next: ASINH, Prev: ASIN, Up: Intrinsic Procedures 8186 81879.20 'ASIND' -- Arcsine function, degrees 8188========================================= 8189 8190_Description_: 8191 'ASIND(X)' computes the arcsine of its X in degrees (inverse of 8192 'SIND(X)'). 8193 8194 This function is for compatibility only and should be avoided in 8195 favor of standard constructs wherever possible. 8196 8197_Standard_: 8198 GNU extension, enabled with '-fdec-math'. 8199 8200_Class_: 8201 Elemental function 8202 8203_Syntax_: 8204 'RESULT = ASIND(X)' 8205 8206_Arguments_: 8207 X The type shall be either 'REAL' and a magnitude 8208 that is less than or equal to one - or be 8209 'COMPLEX'. 8210 8211_Return value_: 8212 The return value is of the same type and kind as X. The real part 8213 of the result is in degrees and lies in the range -90 \leq \Re 8214 \asin(x) \leq 90. 8215 8216_Example_: 8217 program test_asind 8218 real(8) :: x = 0.866_8 8219 x = asind(x) 8220 end program test_asind 8221 8222_Specific names_: 8223 Name Argument Return type Standard 8224 'ASIND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 8225 'DASIND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 8226 8227_See also_: 8228 Inverse function: *note SIND:: Radians function: *note ASIN:: 8229 8230 8231File: gfortran.info, Node: ASINH, Next: ASSOCIATED, Prev: ASIND, Up: Intrinsic Procedures 8232 82339.21 'ASINH' -- Inverse hyperbolic sine function 8234================================================ 8235 8236_Description_: 8237 'ASINH(X)' computes the inverse hyperbolic sine of X. 8238 8239_Standard_: 8240 Fortran 2008 and later 8241 8242_Class_: 8243 Elemental function 8244 8245_Syntax_: 8246 'RESULT = ASINH(X)' 8247 8248_Arguments_: 8249 X The type shall be 'REAL' or 'COMPLEX'. 8250 8251_Return value_: 8252 The return value is of the same type and kind as X. If X is 8253 complex, the imaginary part of the result is in radians and lies 8254 between -\pi/2 \leq \Im \asinh(x) \leq \pi/2. 8255 8256_Example_: 8257 PROGRAM test_asinh 8258 REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /) 8259 WRITE (*,*) ASINH(x) 8260 END PROGRAM 8261 8262_Specific names_: 8263 Name Argument Return type Standard 8264 'DASINH(X)' 'REAL(8) X' 'REAL(8)' GNU extension. 8265 8266_See also_: 8267 Inverse function: *note SINH:: 8268 8269 8270File: gfortran.info, Node: ASSOCIATED, Next: ATAN, Prev: ASINH, Up: Intrinsic Procedures 8271 82729.22 'ASSOCIATED' -- Status of a pointer or pointer/target pair 8273=============================================================== 8274 8275_Description_: 8276 'ASSOCIATED(POINTER [, TARGET])' determines the status of the 8277 pointer POINTER or if POINTER is associated with the target TARGET. 8278 8279_Standard_: 8280 Fortran 90 and later 8281 8282_Class_: 8283 Inquiry function 8284 8285_Syntax_: 8286 'RESULT = ASSOCIATED(POINTER [, TARGET])' 8287 8288_Arguments_: 8289 POINTER POINTER shall have the 'POINTER' attribute and 8290 it can be of any type. 8291 TARGET (Optional) TARGET shall be a pointer or a 8292 target. It must have the same type, kind type 8293 parameter, and array rank as POINTER. 8294 The association status of neither POINTER nor TARGET shall be 8295 undefined. 8296 8297_Return value_: 8298 'ASSOCIATED(POINTER)' returns a scalar value of type 'LOGICAL(4)'. 8299 There are several cases: 8300 (A) When the optional TARGET is not present then 8301 'ASSOCIATED(POINTER)' is true if POINTER is associated with a 8302 target; otherwise, it returns false. 8303 (B) If TARGET is present and a scalar target, the result is true if 8304 TARGET is not a zero-sized storage sequence and the target 8305 associated with POINTER occupies the same storage units. If 8306 POINTER is disassociated, the result is false. 8307 (C) If TARGET is present and an array target, the result is true if 8308 TARGET and POINTER have the same shape, are not zero-sized 8309 arrays, are arrays whose elements are not zero-sized storage 8310 sequences, and TARGET and POINTER occupy the same storage 8311 units in array element order. As in case(B), the result is 8312 false, if POINTER is disassociated. 8313 (D) If TARGET is present and an scalar pointer, the result is true 8314 if TARGET is associated with POINTER, the target associated 8315 with TARGET are not zero-sized storage sequences and occupy 8316 the same storage units. The result is false, if either TARGET 8317 or POINTER is disassociated. 8318 (E) If TARGET is present and an array pointer, the result is true if 8319 target associated with POINTER and the target associated with 8320 TARGET have the same shape, are not zero-sized arrays, are 8321 arrays whose elements are not zero-sized storage sequences, 8322 and TARGET and POINTER occupy the same storage units in array 8323 element order. The result is false, if either TARGET or 8324 POINTER is disassociated. 8325 8326_Example_: 8327 program test_associated 8328 implicit none 8329 real, target :: tgt(2) = (/1., 2./) 8330 real, pointer :: ptr(:) 8331 ptr => tgt 8332 if (associated(ptr) .eqv. .false.) call abort 8333 if (associated(ptr,tgt) .eqv. .false.) call abort 8334 end program test_associated 8335 8336_See also_: 8337 *note NULL:: 8338 8339 8340File: gfortran.info, Node: ATAN, Next: ATAND, Prev: ASSOCIATED, Up: Intrinsic Procedures 8341 83429.23 'ATAN' -- Arctangent function 8343================================== 8344 8345_Description_: 8346 'ATAN(X)' computes the arctangent of X. 8347 8348_Standard_: 8349 Fortran 77 and later, for a complex argument and for two arguments 8350 Fortran 2008 or later 8351 8352_Class_: 8353 Elemental function 8354 8355_Syntax_: 8356 'RESULT = ATAN(X)' 8357 'RESULT = ATAN(Y, X)' 8358 8359_Arguments_: 8360 X The type shall be 'REAL' or 'COMPLEX'; if Y is 8361 present, X shall be REAL. 8362 Y The type and kind type parameter shall be the 8363 same as X. 8364 8365_Return value_: 8366 The return value is of the same type and kind as X. If Y is 8367 present, the result is identical to 'ATAN2(Y,X)'. Otherwise, it 8368 the arcus tangent of X, where the real part of the result is in 8369 radians and lies in the range -\pi/2 \leq \Re \atan(x) \leq \pi/2. 8370 8371_Example_: 8372 program test_atan 8373 real(8) :: x = 2.866_8 8374 x = atan(x) 8375 end program test_atan 8376 8377_Specific names_: 8378 Name Argument Return type Standard 8379 'ATAN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 8380 later 8381 'DATAN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 8382 later 8383 8384_See also_: 8385 Inverse function: *note TAN:: Degrees function: *note ATAND:: 8386 8387 8388File: gfortran.info, Node: ATAND, Next: ATAN2, Prev: ATAN, Up: Intrinsic Procedures 8389 83909.24 'ATAND' -- Arctangent function, degrees 8391============================================ 8392 8393_Description_: 8394 'ATAND(X)' computes the arctangent of X in degrees (inverse of 8395 *note TAND::). 8396 8397 This function is for compatibility only and should be avoided in 8398 favor of standard constructs wherever possible. 8399 8400_Standard_: 8401 GNU extension, enabled with '-fdec-math'. 8402 8403_Class_: 8404 Elemental function 8405 8406_Syntax_: 8407 'RESULT = ATAND(X)' 8408 'RESULT = ATAND(Y, X)' 8409 8410_Arguments_: 8411 X The type shall be 'REAL' or 'COMPLEX'; if Y is 8412 present, X shall be REAL. 8413 Y The type and kind type parameter shall be the 8414 same as X. 8415 8416_Return value_: 8417 The return value is of the same type and kind as X. If Y is 8418 present, the result is identical to 'ATAND2(Y,X)'. Otherwise, it 8419 is the arcus tangent of X, where the real part of the result is in 8420 degrees and lies in the range -90 \leq \Re \atand(x) \leq 90. 8421 8422_Example_: 8423 program test_atand 8424 real(8) :: x = 2.866_8 8425 x = atand(x) 8426 end program test_atand 8427 8428_Specific names_: 8429 Name Argument Return type Standard 8430 'ATAND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 8431 'DATAND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 8432 8433_See also_: 8434 Inverse function: *note TAND:: Radians function: *note ATAN:: 8435 8436 8437File: gfortran.info, Node: ATAN2, Next: ATAN2D, Prev: ATAND, Up: Intrinsic Procedures 8438 84399.25 'ATAN2' -- Arctangent function 8440=================================== 8441 8442_Description_: 8443 'ATAN2(Y, X)' computes the principal value of the argument function 8444 of the complex number X + i Y. This function can be used to 8445 transform from Cartesian into polar coordinates and allows to 8446 determine the angle in the correct quadrant. 8447 8448_Standard_: 8449 Fortran 77 and later 8450 8451_Class_: 8452 Elemental function 8453 8454_Syntax_: 8455 'RESULT = ATAN2(Y, X)' 8456 8457_Arguments_: 8458 Y The type shall be 'REAL'. 8459 X The type and kind type parameter shall be the 8460 same as Y. If Y is zero, then X must be 8461 nonzero. 8462 8463_Return value_: 8464 The return value has the same type and kind type parameter as Y. 8465 It is the principal value of the complex number X + i Y. If X is 8466 nonzero, then it lies in the range -\pi \le \atan (x) \leq \pi. 8467 The sign is positive if Y is positive. If Y is zero, then the 8468 return value is zero if X is strictly positive, \pi if X is 8469 negative and Y is positive zero (or the processor does not handle 8470 signed zeros), and -\pi if X is negative and Y is negative zero. 8471 Finally, if X is zero, then the magnitude of the result is \pi/2. 8472 8473_Example_: 8474 program test_atan2 8475 real(4) :: x = 1.e0_4, y = 0.5e0_4 8476 x = atan2(y,x) 8477 end program test_atan2 8478 8479_Specific names_: 8480 Name Argument Return type Standard 8481 'ATAN2(X, 'REAL(4) X, 'REAL(4)' Fortran 77 and 8482 Y)' Y' later 8483 'DATAN2(X, 'REAL(8) X, 'REAL(8)' Fortran 77 and 8484 Y)' Y' later 8485 8486_See also_: 8487 Alias: *note ATAN:: Degrees function: *note ATAN2D:: 8488 8489 8490File: gfortran.info, Node: ATAN2D, Next: ATANH, Prev: ATAN2, Up: Intrinsic Procedures 8491 84929.26 'ATAN2D' -- Arctangent function, degrees 8493============================================= 8494 8495_Description_: 8496 'ATAN2D(Y, X)' computes the principal value of the argument 8497 function of the complex number X + i Y in degrees. This function 8498 can be used to transform from Cartesian into polar coordinates and 8499 allows to determine the angle in the correct quadrant. 8500 8501 This function is for compatibility only and should be avoided in 8502 favor of standard constructs wherever possible. 8503 8504_Standard_: 8505 GNU extension, enabled with '-fdec-math'. 8506 8507_Class_: 8508 Elemental function 8509 8510_Syntax_: 8511 'RESULT = ATAN2D(Y, X)' 8512 8513_Arguments_: 8514 Y The type shall be 'REAL'. 8515 X The type and kind type parameter shall be the 8516 same as Y. If Y is zero, then X must be 8517 nonzero. 8518 8519_Return value_: 8520 The return value has the same type and kind type parameter as Y. 8521 It is the principal value of the complex number X + i Y. If X is 8522 nonzero, then it lies in the range -180 \le \atan (x) \leq 180. 8523 The sign is positive if Y is positive. If Y is zero, then the 8524 return value is zero if X is strictly positive, 180 if X is 8525 negative and Y is positive zero (or the processor does not handle 8526 signed zeros), and -180 if X is negative and Y is negative zero. 8527 Finally, if X is zero, then the magnitude of the result is 90. 8528 8529_Example_: 8530 program test_atan2d 8531 real(4) :: x = 1.e0_4, y = 0.5e0_4 8532 x = atan2d(y,x) 8533 end program test_atan2d 8534 8535_Specific names_: 8536 Name Argument Return type Standard 8537 'ATAN2D(X, 'REAL(4) X, 'REAL(4)' GNU extension 8538 Y)' Y' 8539 'DATAN2D(X, 'REAL(8) X, 'REAL(8)' GNU extension 8540 Y)' Y' 8541 8542_See also_: 8543 Alias: *note ATAND:: Radians function: *note ATAN2:: 8544 8545 8546File: gfortran.info, Node: ATANH, Next: ATOMIC_ADD, Prev: ATAN2D, Up: Intrinsic Procedures 8547 85489.27 'ATANH' -- Inverse hyperbolic tangent function 8549=================================================== 8550 8551_Description_: 8552 'ATANH(X)' computes the inverse hyperbolic tangent of X. 8553 8554_Standard_: 8555 Fortran 2008 and later 8556 8557_Class_: 8558 Elemental function 8559 8560_Syntax_: 8561 'RESULT = ATANH(X)' 8562 8563_Arguments_: 8564 X The type shall be 'REAL' or 'COMPLEX'. 8565 8566_Return value_: 8567 The return value has same type and kind as X. If X is complex, the 8568 imaginary part of the result is in radians and lies between -\pi/2 8569 \leq \Im \atanh(x) \leq \pi/2. 8570 8571_Example_: 8572 PROGRAM test_atanh 8573 REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /) 8574 WRITE (*,*) ATANH(x) 8575 END PROGRAM 8576 8577_Specific names_: 8578 Name Argument Return type Standard 8579 'DATANH(X)' 'REAL(8) X' 'REAL(8)' GNU extension 8580 8581_See also_: 8582 Inverse function: *note TANH:: 8583 8584 8585File: gfortran.info, Node: ATOMIC_ADD, Next: ATOMIC_AND, Prev: ATANH, Up: Intrinsic Procedures 8586 85879.28 'ATOMIC_ADD' -- Atomic ADD operation 8588========================================= 8589 8590_Description_: 8591 'ATOMIC_ADD(ATOM, VALUE)' atomically adds the value of VAR to the 8592 variable ATOM. When STAT is present and the invocation was 8593 successful, it is assigned the value 0. If it is present and the 8594 invocation has failed, it is assigned a positive value; in 8595 particular, for a coindexed ATOM, if the remote image has stopped, 8596 it is assigned the value of 'ISO_FORTRAN_ENV''s 8597 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8598 'STAT_FAILED_IMAGE'. 8599 8600_Standard_: 8601 TS 18508 or later 8602 8603_Class_: 8604 Atomic subroutine 8605 8606_Syntax_: 8607 'CALL ATOMIC_ADD (ATOM, VALUE [, STAT])' 8608 8609_Arguments_: 8610 ATOM Scalar coarray or coindexed variable of integer 8611 type with 'ATOMIC_INT_KIND' kind. 8612 VALUE Scalar of the same type as ATOM. If the kind is 8613 different, the value is converted to the kind of 8614 ATOM. 8615 STAT (optional) Scalar default-kind integer variable. 8616 8617_Example_: 8618 program atomic 8619 use iso_fortran_env 8620 integer(atomic_int_kind) :: atom[*] 8621 call atomic_add (atom[1], this_image()) 8622 end program atomic 8623 8624_See also_: 8625 *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_ADD::, *note 8626 ISO_FORTRAN_ENV::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note 8627 ATOMIC_XOR:: 8628 8629 8630File: gfortran.info, Node: ATOMIC_AND, Next: ATOMIC_CAS, Prev: ATOMIC_ADD, Up: Intrinsic Procedures 8631 86329.29 'ATOMIC_AND' -- Atomic bitwise AND operation 8633================================================= 8634 8635_Description_: 8636 'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise 8637 AND between the values of ATOM and VALUE. When STAT is present and 8638 the invocation was successful, it is assigned the value 0. If it 8639 is present and the invocation has failed, it is assigned a positive 8640 value; in particular, for a coindexed ATOM, if the remote image has 8641 stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s 8642 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8643 'STAT_FAILED_IMAGE'. 8644 8645_Standard_: 8646 TS 18508 or later 8647 8648_Class_: 8649 Atomic subroutine 8650 8651_Syntax_: 8652 'CALL ATOMIC_AND (ATOM, VALUE [, STAT])' 8653 8654_Arguments_: 8655 ATOM Scalar coarray or coindexed variable of integer 8656 type with 'ATOMIC_INT_KIND' kind. 8657 VALUE Scalar of the same type as ATOM. If the kind is 8658 different, the value is converted to the kind of 8659 ATOM. 8660 STAT (optional) Scalar default-kind integer variable. 8661 8662_Example_: 8663 program atomic 8664 use iso_fortran_env 8665 integer(atomic_int_kind) :: atom[*] 8666 call atomic_and (atom[1], int(b'10100011101')) 8667 end program atomic 8668 8669_See also_: 8670 *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_AND::, *note 8671 ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note 8672 ATOMIC_XOR:: 8673 8674 8675File: gfortran.info, Node: ATOMIC_CAS, Next: ATOMIC_DEFINE, Prev: ATOMIC_AND, Up: Intrinsic Procedures 8676 86779.30 'ATOMIC_CAS' -- Atomic compare and swap 8678============================================ 8679 8680_Description_: 8681 'ATOMIC_CAS' compares the variable ATOM with the value of COMPARE; 8682 if the value is the same, ATOM is set to the value of NEW. 8683 Additionally, OLD is set to the value of ATOM that was used for the 8684 comparison. When STAT is present and the invocation was 8685 successful, it is assigned the value 0. If it is present and the 8686 invocation has failed, it is assigned a positive value; in 8687 particular, for a coindexed ATOM, if the remote image has stopped, 8688 it is assigned the value of 'ISO_FORTRAN_ENV''s 8689 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8690 'STAT_FAILED_IMAGE'. 8691 8692_Standard_: 8693 TS 18508 or later 8694 8695_Class_: 8696 Atomic subroutine 8697 8698_Syntax_: 8699 'CALL ATOMIC_CAS (ATOM, OLD, COMPARE, NEW [, STAT])' 8700 8701_Arguments_: 8702 ATOM Scalar coarray or coindexed variable of either 8703 integer type with 'ATOMIC_INT_KIND' kind or 8704 logical type with 'ATOMIC_LOGICAL_KIND' kind. 8705 OLD Scalar of the same type and kind as ATOM. 8706 COMPARE Scalar variable of the same type and kind as 8707 ATOM. 8708 NEW Scalar variable of the same type as ATOM. If 8709 kind is different, the value is converted to the 8710 kind of ATOM. 8711 STAT (optional) Scalar default-kind integer variable. 8712 8713_Example_: 8714 program atomic 8715 use iso_fortran_env 8716 logical(atomic_logical_kind) :: atom[*], prev 8717 call atomic_cas (atom[1], prev, .false., .true.)) 8718 end program atomic 8719 8720_See also_: 8721 *note ATOMIC_DEFINE::, *note ATOMIC_REF::, *note ISO_FORTRAN_ENV:: 8722 8723 8724File: gfortran.info, Node: ATOMIC_DEFINE, Next: ATOMIC_FETCH_ADD, Prev: ATOMIC_CAS, Up: Intrinsic Procedures 8725 87269.31 'ATOMIC_DEFINE' -- Setting a variable atomically 8727===================================================== 8728 8729_Description_: 8730 'ATOMIC_DEFINE(ATOM, VALUE)' defines the variable ATOM with the 8731 value VALUE atomically. When STAT is present and the invocation 8732 was successful, it is assigned the value 0. If it is present and 8733 the invocation has failed, it is assigned a positive value; in 8734 particular, for a coindexed ATOM, if the remote image has stopped, 8735 it is assigned the value of 'ISO_FORTRAN_ENV''s 8736 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8737 'STAT_FAILED_IMAGE'. 8738 8739_Standard_: 8740 Fortran 2008 and later; with STAT, TS 18508 or later 8741 8742_Class_: 8743 Atomic subroutine 8744 8745_Syntax_: 8746 'CALL ATOMIC_DEFINE (ATOM, VALUE [, STAT])' 8747 8748_Arguments_: 8749 ATOM Scalar coarray or coindexed variable of either 8750 integer type with 'ATOMIC_INT_KIND' kind or 8751 logical type with 'ATOMIC_LOGICAL_KIND' kind. 8752 8753 VALUE Scalar of the same type as ATOM. If the kind is 8754 different, the value is converted to the kind of 8755 ATOM. 8756 STAT (optional) Scalar default-kind integer variable. 8757 8758_Example_: 8759 program atomic 8760 use iso_fortran_env 8761 integer(atomic_int_kind) :: atom[*] 8762 call atomic_define (atom[1], this_image()) 8763 end program atomic 8764 8765_See also_: 8766 *note ATOMIC_REF::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::, 8767 *note ATOMIC_ADD::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note 8768 ATOMIC_XOR:: 8769 8770 8771File: gfortran.info, Node: ATOMIC_FETCH_ADD, Next: ATOMIC_FETCH_AND, Prev: ATOMIC_DEFINE, Up: Intrinsic Procedures 8772 87739.32 'ATOMIC_FETCH_ADD' -- Atomic ADD operation with prior fetch 8774================================================================ 8775 8776_Description_: 8777 'ATOMIC_FETCH_ADD(ATOM, VALUE, OLD)' atomically stores the value of 8778 ATOM in OLD and adds the value of VAR to the variable ATOM. When 8779 STAT is present and the invocation was successful, it is assigned 8780 the value 0. If it is present and the invocation has failed, it is 8781 assigned a positive value; in particular, for a coindexed ATOM, if 8782 the remote image has stopped, it is assigned the value of 8783 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote image 8784 has failed, the value 'STAT_FAILED_IMAGE'. 8785 8786_Standard_: 8787 TS 18508 or later 8788 8789_Class_: 8790 Atomic subroutine 8791 8792_Syntax_: 8793 'CALL ATOMIC_FETCH_ADD (ATOM, VALUE, old [, STAT])' 8794 8795_Arguments_: 8796 ATOM Scalar coarray or coindexed variable of integer 8797 type with 'ATOMIC_INT_KIND' kind. 8798 'ATOMIC_LOGICAL_KIND' kind. 8799 8800 VALUE Scalar of the same type as ATOM. If the kind is 8801 different, the value is converted to the kind of 8802 ATOM. 8803 OLD Scalar of the same type and kind as ATOM. 8804 STAT (optional) Scalar default-kind integer variable. 8805 8806_Example_: 8807 program atomic 8808 use iso_fortran_env 8809 integer(atomic_int_kind) :: atom[*], old 8810 call atomic_add (atom[1], this_image(), old) 8811 end program atomic 8812 8813_See also_: 8814 *note ATOMIC_DEFINE::, *note ATOMIC_ADD::, *note ISO_FORTRAN_ENV::, 8815 *note ATOMIC_FETCH_AND::, *note ATOMIC_FETCH_OR::, *note 8816 ATOMIC_FETCH_XOR:: 8817 8818 8819File: gfortran.info, Node: ATOMIC_FETCH_AND, Next: ATOMIC_FETCH_OR, Prev: ATOMIC_FETCH_ADD, Up: Intrinsic Procedures 8820 88219.33 'ATOMIC_FETCH_AND' -- Atomic bitwise AND operation with prior fetch 8822======================================================================== 8823 8824_Description_: 8825 'ATOMIC_AND(ATOM, VALUE)' atomically stores the value of ATOM in 8826 OLD and defines ATOM with the bitwise AND between the values of 8827 ATOM and VALUE. When STAT is present and the invocation was 8828 successful, it is assigned the value 0. If it is present and the 8829 invocation has failed, it is assigned a positive value; in 8830 particular, for a coindexed ATOM, if the remote image has stopped, 8831 it is assigned the value of 'ISO_FORTRAN_ENV''s 8832 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8833 'STAT_FAILED_IMAGE'. 8834 8835_Standard_: 8836 TS 18508 or later 8837 8838_Class_: 8839 Atomic subroutine 8840 8841_Syntax_: 8842 'CALL ATOMIC_FETCH_AND (ATOM, VALUE, OLD [, STAT])' 8843 8844_Arguments_: 8845 ATOM Scalar coarray or coindexed variable of integer 8846 type with 'ATOMIC_INT_KIND' kind. 8847 VALUE Scalar of the same type as ATOM. If the kind is 8848 different, the value is converted to the kind of 8849 ATOM. 8850 OLD Scalar of the same type and kind as ATOM. 8851 STAT (optional) Scalar default-kind integer variable. 8852 8853_Example_: 8854 program atomic 8855 use iso_fortran_env 8856 integer(atomic_int_kind) :: atom[*], old 8857 call atomic_fetch_and (atom[1], int(b'10100011101'), old) 8858 end program atomic 8859 8860_See also_: 8861 *note ATOMIC_DEFINE::, *note ATOMIC_AND::, *note ISO_FORTRAN_ENV::, 8862 *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_OR::, *note 8863 ATOMIC_FETCH_XOR:: 8864 8865 8866File: gfortran.info, Node: ATOMIC_FETCH_OR, Next: ATOMIC_FETCH_XOR, Prev: ATOMIC_FETCH_AND, Up: Intrinsic Procedures 8867 88689.34 'ATOMIC_FETCH_OR' -- Atomic bitwise OR operation with prior fetch 8869====================================================================== 8870 8871_Description_: 8872 'ATOMIC_OR(ATOM, VALUE)' atomically stores the value of ATOM in OLD 8873 and defines ATOM with the bitwise OR between the values of ATOM and 8874 VALUE. When STAT is present and the invocation was successful, it 8875 is assigned the value 0. If it is present and the invocation has 8876 failed, it is assigned a positive value; in particular, for a 8877 coindexed ATOM, if the remote image has stopped, it is assigned the 8878 value of 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote 8879 image has failed, the value 'STAT_FAILED_IMAGE'. 8880 8881_Standard_: 8882 TS 18508 or later 8883 8884_Class_: 8885 Atomic subroutine 8886 8887_Syntax_: 8888 'CALL ATOMIC_FETCH_OR (ATOM, VALUE, OLD [, STAT])' 8889 8890_Arguments_: 8891 ATOM Scalar coarray or coindexed variable of integer 8892 type with 'ATOMIC_INT_KIND' kind. 8893 VALUE Scalar of the same type as ATOM. If the kind is 8894 different, the value is converted to the kind of 8895 ATOM. 8896 OLD Scalar of the same type and kind as ATOM. 8897 STAT (optional) Scalar default-kind integer variable. 8898 8899_Example_: 8900 program atomic 8901 use iso_fortran_env 8902 integer(atomic_int_kind) :: atom[*], old 8903 call atomic_fetch_or (atom[1], int(b'10100011101'), old) 8904 end program atomic 8905 8906_See also_: 8907 *note ATOMIC_DEFINE::, *note ATOMIC_OR::, *note ISO_FORTRAN_ENV::, 8908 *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note 8909 ATOMIC_FETCH_XOR:: 8910 8911 8912File: gfortran.info, Node: ATOMIC_FETCH_XOR, Next: ATOMIC_OR, Prev: ATOMIC_FETCH_OR, Up: Intrinsic Procedures 8913 89149.35 'ATOMIC_FETCH_XOR' -- Atomic bitwise XOR operation with prior fetch 8915======================================================================== 8916 8917_Description_: 8918 'ATOMIC_XOR(ATOM, VALUE)' atomically stores the value of ATOM in 8919 OLD and defines ATOM with the bitwise XOR between the values of 8920 ATOM and VALUE. When STAT is present and the invocation was 8921 successful, it is assigned the value 0. If it is present and the 8922 invocation has failed, it is assigned a positive value; in 8923 particular, for a coindexed ATOM, if the remote image has stopped, 8924 it is assigned the value of 'ISO_FORTRAN_ENV''s 8925 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8926 'STAT_FAILED_IMAGE'. 8927 8928_Standard_: 8929 TS 18508 or later 8930 8931_Class_: 8932 Atomic subroutine 8933 8934_Syntax_: 8935 'CALL ATOMIC_FETCH_XOR (ATOM, VALUE, OLD [, STAT])' 8936 8937_Arguments_: 8938 ATOM Scalar coarray or coindexed variable of integer 8939 type with 'ATOMIC_INT_KIND' kind. 8940 VALUE Scalar of the same type as ATOM. If the kind is 8941 different, the value is converted to the kind of 8942 ATOM. 8943 OLD Scalar of the same type and kind as ATOM. 8944 STAT (optional) Scalar default-kind integer variable. 8945 8946_Example_: 8947 program atomic 8948 use iso_fortran_env 8949 integer(atomic_int_kind) :: atom[*], old 8950 call atomic_fetch_xor (atom[1], int(b'10100011101'), old) 8951 end program atomic 8952 8953_See also_: 8954 *note ATOMIC_DEFINE::, *note ATOMIC_XOR::, *note ISO_FORTRAN_ENV::, 8955 *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note 8956 ATOMIC_FETCH_OR:: 8957 8958 8959File: gfortran.info, Node: ATOMIC_OR, Next: ATOMIC_REF, Prev: ATOMIC_FETCH_XOR, Up: Intrinsic Procedures 8960 89619.36 'ATOMIC_OR' -- Atomic bitwise OR operation 8962=============================================== 8963 8964_Description_: 8965 'ATOMIC_OR(ATOM, VALUE)' atomically defines ATOM with the bitwise 8966 AND between the values of ATOM and VALUE. When STAT is present and 8967 the invocation was successful, it is assigned the value 0. If it 8968 is present and the invocation has failed, it is assigned a positive 8969 value; in particular, for a coindexed ATOM, if the remote image has 8970 stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s 8971 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8972 'STAT_FAILED_IMAGE'. 8973 8974_Standard_: 8975 TS 18508 or later 8976 8977_Class_: 8978 Atomic subroutine 8979 8980_Syntax_: 8981 'CALL ATOMIC_OR (ATOM, VALUE [, STAT])' 8982 8983_Arguments_: 8984 ATOM Scalar coarray or coindexed variable of integer 8985 type with 'ATOMIC_INT_KIND' kind. 8986 VALUE Scalar of the same type as ATOM. If the kind is 8987 different, the value is converted to the kind of 8988 ATOM. 8989 STAT (optional) Scalar default-kind integer variable. 8990 8991_Example_: 8992 program atomic 8993 use iso_fortran_env 8994 integer(atomic_int_kind) :: atom[*] 8995 call atomic_or (atom[1], int(b'10100011101')) 8996 end program atomic 8997 8998_See also_: 8999 *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_OR::, *note 9000 ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note 9001 ATOMIC_XOR:: 9002 9003 9004File: gfortran.info, Node: ATOMIC_REF, Next: ATOMIC_XOR, Prev: ATOMIC_OR, Up: Intrinsic Procedures 9005 90069.37 'ATOMIC_REF' -- Obtaining the value of a variable atomically 9007================================================================= 9008 9009_Description_: 9010 'ATOMIC_DEFINE(ATOM, VALUE)' atomically assigns the value of the 9011 variable ATOM to VALUE. When STAT is present and the invocation 9012 was successful, it is assigned the value 0. If it is present and 9013 the invocation has failed, it is assigned a positive value; in 9014 particular, for a coindexed ATOM, if the remote image has stopped, 9015 it is assigned the value of 'ISO_FORTRAN_ENV''s 9016 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 9017 'STAT_FAILED_IMAGE'. 9018 9019_Standard_: 9020 Fortran 2008 and later; with STAT, TS 18508 or later 9021 9022_Class_: 9023 Atomic subroutine 9024 9025_Syntax_: 9026 'CALL ATOMIC_REF(VALUE, ATOM [, STAT])' 9027 9028_Arguments_: 9029 VALUE Scalar of the same type as ATOM. If the kind is 9030 different, the value is converted to the kind of 9031 ATOM. 9032 ATOM Scalar coarray or coindexed variable of either 9033 integer type with 'ATOMIC_INT_KIND' kind or 9034 logical type with 'ATOMIC_LOGICAL_KIND' kind. 9035 STAT (optional) Scalar default-kind integer variable. 9036 9037_Example_: 9038 program atomic 9039 use iso_fortran_env 9040 logical(atomic_logical_kind) :: atom[*] 9041 logical :: val 9042 call atomic_ref (atom, .false.) 9043 ! ... 9044 call atomic_ref (atom, val) 9045 if (val) then 9046 print *, "Obtained" 9047 end if 9048 end program atomic 9049 9050_See also_: 9051 *note ATOMIC_DEFINE::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::, 9052 *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note 9053 ATOMIC_FETCH_OR::, *note ATOMIC_FETCH_XOR:: 9054 9055 9056File: gfortran.info, Node: ATOMIC_XOR, Next: BACKTRACE, Prev: ATOMIC_REF, Up: Intrinsic Procedures 9057 90589.38 'ATOMIC_XOR' -- Atomic bitwise OR operation 9059================================================ 9060 9061_Description_: 9062 'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise 9063 XOR between the values of ATOM and VALUE. When STAT is present and 9064 the invocation was successful, it is assigned the value 0. If it 9065 is present and the invocation has failed, it is assigned a positive 9066 value; in particular, for a coindexed ATOM, if the remote image has 9067 stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s 9068 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 9069 'STAT_FAILED_IMAGE'. 9070 9071_Standard_: 9072 TS 18508 or later 9073 9074_Class_: 9075 Atomic subroutine 9076 9077_Syntax_: 9078 'CALL ATOMIC_XOR (ATOM, VALUE [, STAT])' 9079 9080_Arguments_: 9081 ATOM Scalar coarray or coindexed variable of integer 9082 type with 'ATOMIC_INT_KIND' kind. 9083 VALUE Scalar of the same type as ATOM. If the kind is 9084 different, the value is converted to the kind of 9085 ATOM. 9086 STAT (optional) Scalar default-kind integer variable. 9087 9088_Example_: 9089 program atomic 9090 use iso_fortran_env 9091 integer(atomic_int_kind) :: atom[*] 9092 call atomic_xor (atom[1], int(b'10100011101')) 9093 end program atomic 9094 9095_See also_: 9096 *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_XOR::, *note 9097 ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note 9098 ATOMIC_XOR:: 9099 9100 9101File: gfortran.info, Node: BACKTRACE, Next: BESSEL_J0, Prev: ATOMIC_XOR, Up: Intrinsic Procedures 9102 91039.39 'BACKTRACE' -- Show a backtrace 9104==================================== 9105 9106_Description_: 9107 'BACKTRACE' shows a backtrace at an arbitrary place in user code. 9108 Program execution continues normally afterwards. The backtrace 9109 information is printed to the unit corresponding to 'ERROR_UNIT' in 9110 'ISO_FORTRAN_ENV'. 9111 9112_Standard_: 9113 GNU extension 9114 9115_Class_: 9116 Subroutine 9117 9118_Syntax_: 9119 'CALL BACKTRACE' 9120 9121_Arguments_: 9122 None 9123 9124_See also_: 9125 *note ABORT:: 9126 9127 9128File: gfortran.info, Node: BESSEL_J0, Next: BESSEL_J1, Prev: BACKTRACE, Up: Intrinsic Procedures 9129 91309.40 'BESSEL_J0' -- Bessel function of the first kind of order 0 9131================================================================ 9132 9133_Description_: 9134 'BESSEL_J0(X)' computes the Bessel function of the first kind of 9135 order 0 of X. This function is available under the name 'BESJ0' as 9136 a GNU extension. 9137 9138_Standard_: 9139 Fortran 2008 and later 9140 9141_Class_: 9142 Elemental function 9143 9144_Syntax_: 9145 'RESULT = BESSEL_J0(X)' 9146 9147_Arguments_: 9148 X The type shall be 'REAL'. 9149 9150_Return value_: 9151 The return value is of type 'REAL' and lies in the range - 9152 0.4027... \leq Bessel (0,x) \leq 1. It has the same kind as X. 9153 9154_Example_: 9155 program test_besj0 9156 real(8) :: x = 0.0_8 9157 x = bessel_j0(x) 9158 end program test_besj0 9159 9160_Specific names_: 9161 Name Argument Return type Standard 9162 'DBESJ0(X)' 'REAL(8) X' 'REAL(8)' GNU extension 9163 9164 9165File: gfortran.info, Node: BESSEL_J1, Next: BESSEL_JN, Prev: BESSEL_J0, Up: Intrinsic Procedures 9166 91679.41 'BESSEL_J1' -- Bessel function of the first kind of order 1 9168================================================================ 9169 9170_Description_: 9171 'BESSEL_J1(X)' computes the Bessel function of the first kind of 9172 order 1 of X. This function is available under the name 'BESJ1' as 9173 a GNU extension. 9174 9175_Standard_: 9176 Fortran 2008 9177 9178_Class_: 9179 Elemental function 9180 9181_Syntax_: 9182 'RESULT = BESSEL_J1(X)' 9183 9184_Arguments_: 9185 X The type shall be 'REAL'. 9186 9187_Return value_: 9188 The return value is of type 'REAL' and lies in the range - 9189 0.5818... \leq Bessel (0,x) \leq 0.5818 . It has the same kind as 9190 X. 9191 9192_Example_: 9193 program test_besj1 9194 real(8) :: x = 1.0_8 9195 x = bessel_j1(x) 9196 end program test_besj1 9197 9198_Specific names_: 9199 Name Argument Return type Standard 9200 'DBESJ1(X)' 'REAL(8) X' 'REAL(8)' GNU extension 9201 9202 9203File: gfortran.info, Node: BESSEL_JN, Next: BESSEL_Y0, Prev: BESSEL_J1, Up: Intrinsic Procedures 9204 92059.42 'BESSEL_JN' -- Bessel function of the first kind 9206===================================================== 9207 9208_Description_: 9209 'BESSEL_JN(N, X)' computes the Bessel function of the first kind of 9210 order N of X. This function is available under the name 'BESJN' as 9211 a GNU extension. If N and X are arrays, their ranks and shapes 9212 shall conform. 9213 9214 'BESSEL_JN(N1, N2, X)' returns an array with the Bessel functions 9215 of the first kind of the orders N1 to N2. 9216 9217_Standard_: 9218 Fortran 2008 and later, negative N is allowed as GNU extension 9219 9220_Class_: 9221 Elemental function, except for the transformational function 9222 'BESSEL_JN(N1, N2, X)' 9223 9224_Syntax_: 9225 'RESULT = BESSEL_JN(N, X)' 9226 'RESULT = BESSEL_JN(N1, N2, X)' 9227 9228_Arguments_: 9229 N Shall be a scalar or an array of type 'INTEGER'. 9230 N1 Shall be a non-negative scalar of type 9231 'INTEGER'. 9232 N2 Shall be a non-negative scalar of type 9233 'INTEGER'. 9234 X Shall be a scalar or an array of type 'REAL'; 9235 for 'BESSEL_JN(N1, N2, X)' it shall be scalar. 9236 9237_Return value_: 9238 The return value is a scalar of type 'REAL'. It has the same kind 9239 as X. 9240 9241_Note_: 9242 The transformational function uses a recurrence algorithm which 9243 might, for some values of X, lead to different results than calls 9244 to the elemental function. 9245 9246_Example_: 9247 program test_besjn 9248 real(8) :: x = 1.0_8 9249 x = bessel_jn(5,x) 9250 end program test_besjn 9251 9252_Specific names_: 9253 Name Argument Return type Standard 9254 'DBESJN(N, 'INTEGER N' 'REAL(8)' GNU extension 9255 X)' 9256 'REAL(8) X' 9257 9258 9259File: gfortran.info, Node: BESSEL_Y0, Next: BESSEL_Y1, Prev: BESSEL_JN, Up: Intrinsic Procedures 9260 92619.43 'BESSEL_Y0' -- Bessel function of the second kind of order 0 9262================================================================= 9263 9264_Description_: 9265 'BESSEL_Y0(X)' computes the Bessel function of the second kind of 9266 order 0 of X. This function is available under the name 'BESY0' as 9267 a GNU extension. 9268 9269_Standard_: 9270 Fortran 2008 and later 9271 9272_Class_: 9273 Elemental function 9274 9275_Syntax_: 9276 'RESULT = BESSEL_Y0(X)' 9277 9278_Arguments_: 9279 X The type shall be 'REAL'. 9280 9281_Return value_: 9282 The return value is of type 'REAL'. It has the same kind as X. 9283 9284_Example_: 9285 program test_besy0 9286 real(8) :: x = 0.0_8 9287 x = bessel_y0(x) 9288 end program test_besy0 9289 9290_Specific names_: 9291 Name Argument Return type Standard 9292 'DBESY0(X)' 'REAL(8) X' 'REAL(8)' GNU extension 9293 9294 9295File: gfortran.info, Node: BESSEL_Y1, Next: BESSEL_YN, Prev: BESSEL_Y0, Up: Intrinsic Procedures 9296 92979.44 'BESSEL_Y1' -- Bessel function of the second kind of order 1 9298================================================================= 9299 9300_Description_: 9301 'BESSEL_Y1(X)' computes the Bessel function of the second kind of 9302 order 1 of X. This function is available under the name 'BESY1' as 9303 a GNU extension. 9304 9305_Standard_: 9306 Fortran 2008 and later 9307 9308_Class_: 9309 Elemental function 9310 9311_Syntax_: 9312 'RESULT = BESSEL_Y1(X)' 9313 9314_Arguments_: 9315 X The type shall be 'REAL'. 9316 9317_Return value_: 9318 The return value is of type 'REAL'. It has the same kind as X. 9319 9320_Example_: 9321 program test_besy1 9322 real(8) :: x = 1.0_8 9323 x = bessel_y1(x) 9324 end program test_besy1 9325 9326_Specific names_: 9327 Name Argument Return type Standard 9328 'DBESY1(X)' 'REAL(8) X' 'REAL(8)' GNU extension 9329 9330 9331File: gfortran.info, Node: BESSEL_YN, Next: BGE, Prev: BESSEL_Y1, Up: Intrinsic Procedures 9332 93339.45 'BESSEL_YN' -- Bessel function of the second kind 9334====================================================== 9335 9336_Description_: 9337 'BESSEL_YN(N, X)' computes the Bessel function of the second kind 9338 of order N of X. This function is available under the name 'BESYN' 9339 as a GNU extension. If N and X are arrays, their ranks and shapes 9340 shall conform. 9341 9342 'BESSEL_YN(N1, N2, X)' returns an array with the Bessel functions 9343 of the first kind of the orders N1 to N2. 9344 9345_Standard_: 9346 Fortran 2008 and later, negative N is allowed as GNU extension 9347 9348_Class_: 9349 Elemental function, except for the transformational function 9350 'BESSEL_YN(N1, N2, X)' 9351 9352_Syntax_: 9353 'RESULT = BESSEL_YN(N, X)' 9354 'RESULT = BESSEL_YN(N1, N2, X)' 9355 9356_Arguments_: 9357 N Shall be a scalar or an array of type 'INTEGER' 9358 . 9359 N1 Shall be a non-negative scalar of type 9360 'INTEGER'. 9361 N2 Shall be a non-negative scalar of type 9362 'INTEGER'. 9363 X Shall be a scalar or an array of type 'REAL'; 9364 for 'BESSEL_YN(N1, N2, X)' it shall be scalar. 9365 9366_Return value_: 9367 The return value is a scalar of type 'REAL'. It has the same kind 9368 as X. 9369 9370_Note_: 9371 The transformational function uses a recurrence algorithm which 9372 might, for some values of X, lead to different results than calls 9373 to the elemental function. 9374 9375_Example_: 9376 program test_besyn 9377 real(8) :: x = 1.0_8 9378 x = bessel_yn(5,x) 9379 end program test_besyn 9380 9381_Specific names_: 9382 Name Argument Return type Standard 9383 'DBESYN(N,X)' 'INTEGER N' 'REAL(8)' GNU extension 9384 'REAL(8) X' 9385 9386 9387File: gfortran.info, Node: BGE, Next: BGT, Prev: BESSEL_YN, Up: Intrinsic Procedures 9388 93899.46 'BGE' -- Bitwise greater than or equal to 9390============================================== 9391 9392_Description_: 9393 Determines whether an integral is a bitwise greater than or equal 9394 to another. 9395 9396_Standard_: 9397 Fortran 2008 and later 9398 9399_Class_: 9400 Elemental function 9401 9402_Syntax_: 9403 'RESULT = BGE(I, J)' 9404 9405_Arguments_: 9406 I Shall be of 'INTEGER' type. 9407 J Shall be of 'INTEGER' type, and of the same kind 9408 as I. 9409 9410_Return value_: 9411 The return value is of type 'LOGICAL' and of the default kind. 9412 9413_See also_: 9414 *note BGT::, *note BLE::, *note BLT:: 9415 9416 9417File: gfortran.info, Node: BGT, Next: BIT_SIZE, Prev: BGE, Up: Intrinsic Procedures 9418 94199.47 'BGT' -- Bitwise greater than 9420================================== 9421 9422_Description_: 9423 Determines whether an integral is a bitwise greater than another. 9424 9425_Standard_: 9426 Fortran 2008 and later 9427 9428_Class_: 9429 Elemental function 9430 9431_Syntax_: 9432 'RESULT = BGT(I, J)' 9433 9434_Arguments_: 9435 I Shall be of 'INTEGER' type. 9436 J Shall be of 'INTEGER' type, and of the same kind 9437 as I. 9438 9439_Return value_: 9440 The return value is of type 'LOGICAL' and of the default kind. 9441 9442_See also_: 9443 *note BGE::, *note BLE::, *note BLT:: 9444 9445 9446File: gfortran.info, Node: BIT_SIZE, Next: BLE, Prev: BGT, Up: Intrinsic Procedures 9447 94489.48 'BIT_SIZE' -- Bit size inquiry function 9449============================================ 9450 9451_Description_: 9452 'BIT_SIZE(I)' returns the number of bits (integer precision plus 9453 sign bit) represented by the type of I. The result of 9454 'BIT_SIZE(I)' is independent of the actual value of I. 9455 9456_Standard_: 9457 Fortran 90 and later 9458 9459_Class_: 9460 Inquiry function 9461 9462_Syntax_: 9463 'RESULT = BIT_SIZE(I)' 9464 9465_Arguments_: 9466 I The type shall be 'INTEGER'. 9467 9468_Return value_: 9469 The return value is of type 'INTEGER' 9470 9471_Example_: 9472 program test_bit_size 9473 integer :: i = 123 9474 integer :: size 9475 size = bit_size(i) 9476 print *, size 9477 end program test_bit_size 9478 9479 9480File: gfortran.info, Node: BLE, Next: BLT, Prev: BIT_SIZE, Up: Intrinsic Procedures 9481 94829.49 'BLE' -- Bitwise less than or equal to 9483=========================================== 9484 9485_Description_: 9486 Determines whether an integral is a bitwise less than or equal to 9487 another. 9488 9489_Standard_: 9490 Fortran 2008 and later 9491 9492_Class_: 9493 Elemental function 9494 9495_Syntax_: 9496 'RESULT = BLE(I, J)' 9497 9498_Arguments_: 9499 I Shall be of 'INTEGER' type. 9500 J Shall be of 'INTEGER' type, and of the same kind 9501 as I. 9502 9503_Return value_: 9504 The return value is of type 'LOGICAL' and of the default kind. 9505 9506_See also_: 9507 *note BGT::, *note BGE::, *note BLT:: 9508 9509 9510File: gfortran.info, Node: BLT, Next: BTEST, Prev: BLE, Up: Intrinsic Procedures 9511 95129.50 'BLT' -- Bitwise less than 9513=============================== 9514 9515_Description_: 9516 Determines whether an integral is a bitwise less than another. 9517 9518_Standard_: 9519 Fortran 2008 and later 9520 9521_Class_: 9522 Elemental function 9523 9524_Syntax_: 9525 'RESULT = BLT(I, J)' 9526 9527_Arguments_: 9528 I Shall be of 'INTEGER' type. 9529 J Shall be of 'INTEGER' type, and of the same kind 9530 as I. 9531 9532_Return value_: 9533 The return value is of type 'LOGICAL' and of the default kind. 9534 9535_See also_: 9536 *note BGE::, *note BGT::, *note BLE:: 9537 9538 9539File: gfortran.info, Node: BTEST, Next: C_ASSOCIATED, Prev: BLT, Up: Intrinsic Procedures 9540 95419.51 'BTEST' -- Bit test function 9542================================= 9543 9544_Description_: 9545 'BTEST(I,POS)' returns logical '.TRUE.' if the bit at POS in I is 9546 set. The counting of the bits starts at 0. 9547 9548_Standard_: 9549 Fortran 90 and later, has overloads that are GNU extensions 9550 9551_Class_: 9552 Elemental function 9553 9554_Syntax_: 9555 'RESULT = BTEST(I, POS)' 9556 9557_Arguments_: 9558 I The type shall be 'INTEGER'. 9559 POS The type shall be 'INTEGER'. 9560 9561_Return value_: 9562 The return value is of type 'LOGICAL' 9563 9564_Example_: 9565 program test_btest 9566 integer :: i = 32768 + 1024 + 64 9567 integer :: pos 9568 logical :: bool 9569 do pos=0,16 9570 bool = btest(i, pos) 9571 print *, pos, bool 9572 end do 9573 end program test_btest 9574 9575_Specific names_: 9576 Name Argument Return type Standard 9577 'BTEST(I,POS)' 'INTEGER 'LOGICAL' Fortran 95 and 9578 I,POS' later 9579 'BBTEST(I,POS)''INTEGER(1) 'LOGICAL(1)' GNU extension 9580 I,POS' 9581 'BITEST(I,POS)''INTEGER(2) 'LOGICAL(2)' GNU extension 9582 I,POS' 9583 'BJTEST(I,POS)''INTEGER(4) 'LOGICAL(4)' GNU extension 9584 I,POS' 9585 'BKTEST(I,POS)''INTEGER(8) 'LOGICAL(8)' GNU extension 9586 I,POS' 9587 9588 9589File: gfortran.info, Node: C_ASSOCIATED, Next: C_F_POINTER, Prev: BTEST, Up: Intrinsic Procedures 9590 95919.52 'C_ASSOCIATED' -- Status of a C pointer 9592============================================ 9593 9594_Description_: 9595 'C_ASSOCIATED(c_ptr_1[, c_ptr_2])' determines the status of the C 9596 pointer C_PTR_1 or if C_PTR_1 is associated with the target 9597 C_PTR_2. 9598 9599_Standard_: 9600 Fortran 2003 and later 9601 9602_Class_: 9603 Inquiry function 9604 9605_Syntax_: 9606 'RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])' 9607 9608_Arguments_: 9609 C_PTR_1 Scalar of the type 'C_PTR' or 'C_FUNPTR'. 9610 C_PTR_2 (Optional) Scalar of the same type as C_PTR_1. 9611 9612_Return value_: 9613 The return value is of type 'LOGICAL'; it is '.false.' if either 9614 C_PTR_1 is a C NULL pointer or if C_PTR1 and C_PTR_2 point to 9615 different addresses. 9616 9617_Example_: 9618 subroutine association_test(a,b) 9619 use iso_c_binding, only: c_associated, c_loc, c_ptr 9620 implicit none 9621 real, pointer :: a 9622 type(c_ptr) :: b 9623 if(c_associated(b, c_loc(a))) & 9624 stop 'b and a do not point to same target' 9625 end subroutine association_test 9626 9627_See also_: 9628 *note C_LOC::, *note C_FUNLOC:: 9629 9630 9631File: gfortran.info, Node: C_F_POINTER, Next: C_F_PROCPOINTER, Prev: C_ASSOCIATED, Up: Intrinsic Procedures 9632 96339.53 'C_F_POINTER' -- Convert C into Fortran pointer 9634==================================================== 9635 9636_Description_: 9637 'C_F_POINTER(CPTR, FPTR[, SHAPE])' assigns the target of the C 9638 pointer CPTR to the Fortran pointer FPTR and specifies its shape. 9639 9640_Standard_: 9641 Fortran 2003 and later 9642 9643_Class_: 9644 Subroutine 9645 9646_Syntax_: 9647 'CALL C_F_POINTER(CPTR, FPTR[, SHAPE])' 9648 9649_Arguments_: 9650 CPTR scalar of the type 'C_PTR'. It is 'INTENT(IN)'. 9651 FPTR pointer interoperable with CPTR. It is 9652 'INTENT(OUT)'. 9653 SHAPE (Optional) Rank-one array of type 'INTEGER' with 9654 'INTENT(IN)'. It shall be present if and only 9655 if FPTR is an array. The size must be equal to 9656 the rank of FPTR. 9657 9658_Example_: 9659 program main 9660 use iso_c_binding 9661 implicit none 9662 interface 9663 subroutine my_routine(p) bind(c,name='myC_func') 9664 import :: c_ptr 9665 type(c_ptr), intent(out) :: p 9666 end subroutine 9667 end interface 9668 type(c_ptr) :: cptr 9669 real,pointer :: a(:) 9670 call my_routine(cptr) 9671 call c_f_pointer(cptr, a, [12]) 9672 end program main 9673 9674_See also_: 9675 *note C_LOC::, *note C_F_PROCPOINTER:: 9676 9677 9678File: gfortran.info, Node: C_F_PROCPOINTER, Next: C_FUNLOC, Prev: C_F_POINTER, Up: Intrinsic Procedures 9679 96809.54 'C_F_PROCPOINTER' -- Convert C into Fortran procedure pointer 9681================================================================== 9682 9683_Description_: 9684 'C_F_PROCPOINTER(CPTR, FPTR)' Assign the target of the C function 9685 pointer CPTR to the Fortran procedure pointer FPTR. 9686 9687_Standard_: 9688 Fortran 2003 and later 9689 9690_Class_: 9691 Subroutine 9692 9693_Syntax_: 9694 'CALL C_F_PROCPOINTER(cptr, fptr)' 9695 9696_Arguments_: 9697 CPTR scalar of the type 'C_FUNPTR'. It is 9698 'INTENT(IN)'. 9699 FPTR procedure pointer interoperable with CPTR. It 9700 is 'INTENT(OUT)'. 9701 9702_Example_: 9703 program main 9704 use iso_c_binding 9705 implicit none 9706 abstract interface 9707 function func(a) 9708 import :: c_float 9709 real(c_float), intent(in) :: a 9710 real(c_float) :: func 9711 end function 9712 end interface 9713 interface 9714 function getIterFunc() bind(c,name="getIterFunc") 9715 import :: c_funptr 9716 type(c_funptr) :: getIterFunc 9717 end function 9718 end interface 9719 type(c_funptr) :: cfunptr 9720 procedure(func), pointer :: myFunc 9721 cfunptr = getIterFunc() 9722 call c_f_procpointer(cfunptr, myFunc) 9723 end program main 9724 9725_See also_: 9726 *note C_LOC::, *note C_F_POINTER:: 9727 9728 9729File: gfortran.info, Node: C_FUNLOC, Next: C_LOC, Prev: C_F_PROCPOINTER, Up: Intrinsic Procedures 9730 97319.55 'C_FUNLOC' -- Obtain the C address of a procedure 9732====================================================== 9733 9734_Description_: 9735 'C_FUNLOC(x)' determines the C address of the argument. 9736 9737_Standard_: 9738 Fortran 2003 and later 9739 9740_Class_: 9741 Inquiry function 9742 9743_Syntax_: 9744 'RESULT = C_FUNLOC(x)' 9745 9746_Arguments_: 9747 X Interoperable function or pointer to such 9748 function. 9749 9750_Return value_: 9751 The return value is of type 'C_FUNPTR' and contains the C address 9752 of the argument. 9753 9754_Example_: 9755 module x 9756 use iso_c_binding 9757 implicit none 9758 contains 9759 subroutine sub(a) bind(c) 9760 real(c_float) :: a 9761 a = sqrt(a)+5.0 9762 end subroutine sub 9763 end module x 9764 program main 9765 use iso_c_binding 9766 use x 9767 implicit none 9768 interface 9769 subroutine my_routine(p) bind(c,name='myC_func') 9770 import :: c_funptr 9771 type(c_funptr), intent(in) :: p 9772 end subroutine 9773 end interface 9774 call my_routine(c_funloc(sub)) 9775 end program main 9776 9777_See also_: 9778 *note C_ASSOCIATED::, *note C_LOC::, *note C_F_POINTER::, *note 9779 C_F_PROCPOINTER:: 9780 9781 9782File: gfortran.info, Node: C_LOC, Next: C_SIZEOF, Prev: C_FUNLOC, Up: Intrinsic Procedures 9783 97849.56 'C_LOC' -- Obtain the C address of an object 9785================================================= 9786 9787_Description_: 9788 'C_LOC(X)' determines the C address of the argument. 9789 9790_Standard_: 9791 Fortran 2003 and later 9792 9793_Class_: 9794 Inquiry function 9795 9796_Syntax_: 9797 'RESULT = C_LOC(X)' 9798 9799_Arguments_: 9800 X Shall have either the POINTER or TARGET attribute. 9801 It shall not be a coindexed object. It shall either 9802 be a variable with interoperable type and kind type 9803 parameters, or be a scalar, nonpolymorphic variable 9804 with no length type parameters. 9805 9806 9807_Return value_: 9808 The return value is of type 'C_PTR' and contains the C address of 9809 the argument. 9810 9811_Example_: 9812 subroutine association_test(a,b) 9813 use iso_c_binding, only: c_associated, c_loc, c_ptr 9814 implicit none 9815 real, pointer :: a 9816 type(c_ptr) :: b 9817 if(c_associated(b, c_loc(a))) & 9818 stop 'b and a do not point to same target' 9819 end subroutine association_test 9820 9821_See also_: 9822 *note C_ASSOCIATED::, *note C_FUNLOC::, *note C_F_POINTER::, *note 9823 C_F_PROCPOINTER:: 9824 9825 9826File: gfortran.info, Node: C_SIZEOF, Next: CEILING, Prev: C_LOC, Up: Intrinsic Procedures 9827 98289.57 'C_SIZEOF' -- Size in bytes of an expression 9829================================================= 9830 9831_Description_: 9832 'C_SIZEOF(X)' calculates the number of bytes of storage the 9833 expression 'X' occupies. 9834 9835_Standard_: 9836 Fortran 2008 9837 9838_Class_: 9839 Inquiry function of the module 'ISO_C_BINDING' 9840 9841_Syntax_: 9842 'N = C_SIZEOF(X)' 9843 9844_Arguments_: 9845 X The argument shall be an interoperable data 9846 entity. 9847 9848_Return value_: 9849 The return value is of type integer and of the system-dependent 9850 kind 'C_SIZE_T' (from the 'ISO_C_BINDING' module). Its value is 9851 the number of bytes occupied by the argument. If the argument has 9852 the 'POINTER' attribute, the number of bytes of the storage area 9853 pointed to is returned. If the argument is of a derived type with 9854 'POINTER' or 'ALLOCATABLE' components, the return value does not 9855 account for the sizes of the data pointed to by these components. 9856 9857_Example_: 9858 use iso_c_binding 9859 integer(c_int) :: i 9860 real(c_float) :: r, s(5) 9861 print *, (c_sizeof(s)/c_sizeof(r) == 5) 9862 end 9863 The example will print 'T' unless you are using a platform where 9864 default 'REAL' variables are unusually padded. 9865 9866_See also_: 9867 *note SIZEOF::, *note STORAGE_SIZE:: 9868 9869 9870File: gfortran.info, Node: CEILING, Next: CHAR, Prev: C_SIZEOF, Up: Intrinsic Procedures 9871 98729.58 'CEILING' -- Integer ceiling function 9873========================================== 9874 9875_Description_: 9876 'CEILING(A)' returns the least integer greater than or equal to A. 9877 9878_Standard_: 9879 Fortran 95 and later 9880 9881_Class_: 9882 Elemental function 9883 9884_Syntax_: 9885 'RESULT = CEILING(A [, KIND])' 9886 9887_Arguments_: 9888 A The type shall be 'REAL'. 9889 KIND (Optional) An 'INTEGER' initialization 9890 expression indicating the kind parameter of the 9891 result. 9892 9893_Return value_: 9894 The return value is of type 'INTEGER(KIND)' if KIND is present and 9895 a default-kind 'INTEGER' otherwise. 9896 9897_Example_: 9898 program test_ceiling 9899 real :: x = 63.29 9900 real :: y = -63.59 9901 print *, ceiling(x) ! returns 64 9902 print *, ceiling(y) ! returns -63 9903 end program test_ceiling 9904 9905_See also_: 9906 *note FLOOR::, *note NINT:: 9907 9908 9909File: gfortran.info, Node: CHAR, Next: CHDIR, Prev: CEILING, Up: Intrinsic Procedures 9910 99119.59 'CHAR' -- Character conversion function 9912============================================ 9913 9914_Description_: 9915 'CHAR(I [, KIND])' returns the character represented by the integer 9916 I. 9917 9918_Standard_: 9919 Fortran 77 and later 9920 9921_Class_: 9922 Elemental function 9923 9924_Syntax_: 9925 'RESULT = CHAR(I [, KIND])' 9926 9927_Arguments_: 9928 I The type shall be 'INTEGER'. 9929 KIND (Optional) An 'INTEGER' initialization 9930 expression indicating the kind parameter of the 9931 result. 9932 9933_Return value_: 9934 The return value is of type 'CHARACTER(1)' 9935 9936_Example_: 9937 program test_char 9938 integer :: i = 74 9939 character(1) :: c 9940 c = char(i) 9941 print *, i, c ! returns 'J' 9942 end program test_char 9943 9944_Specific names_: 9945 Name Argument Return type Standard 9946 'CHAR(I)' 'INTEGER I' 'CHARACTER(LEN=1)'Fortran 77 and 9947 later 9948 9949_Note_: 9950 See *note ICHAR:: for a discussion of converting between numerical 9951 values and formatted string representations. 9952 9953_See also_: 9954 *note ACHAR::, *note IACHAR::, *note ICHAR:: 9955 9956 9957File: gfortran.info, Node: CHDIR, Next: CHMOD, Prev: CHAR, Up: Intrinsic Procedures 9958 99599.60 'CHDIR' -- Change working directory 9960======================================== 9961 9962_Description_: 9963 Change current working directory to a specified path. 9964 9965 This intrinsic is provided in both subroutine and function forms; 9966 however, only one form can be used in any given program unit. 9967 9968_Standard_: 9969 GNU extension 9970 9971_Class_: 9972 Subroutine, function 9973 9974_Syntax_: 9975 'CALL CHDIR(NAME [, STATUS])' 9976 'STATUS = CHDIR(NAME)' 9977 9978_Arguments_: 9979 NAME The type shall be 'CHARACTER' of default kind 9980 and shall specify a valid path within the file 9981 system. 9982 STATUS (Optional) 'INTEGER' status flag of the default 9983 kind. Returns 0 on success, and a system 9984 specific and nonzero error code otherwise. 9985 9986_Example_: 9987 PROGRAM test_chdir 9988 CHARACTER(len=255) :: path 9989 CALL getcwd(path) 9990 WRITE(*,*) TRIM(path) 9991 CALL chdir("/tmp") 9992 CALL getcwd(path) 9993 WRITE(*,*) TRIM(path) 9994 END PROGRAM 9995 9996_See also_: 9997 *note GETCWD:: 9998 9999 10000File: gfortran.info, Node: CHMOD, Next: CMPLX, Prev: CHDIR, Up: Intrinsic Procedures 10001 100029.61 'CHMOD' -- Change access permissions of files 10003================================================== 10004 10005_Description_: 10006 'CHMOD' changes the permissions of a file. 10007 10008 This intrinsic is provided in both subroutine and function forms; 10009 however, only one form can be used in any given program unit. 10010 10011_Standard_: 10012 GNU extension 10013 10014_Class_: 10015 Subroutine, function 10016 10017_Syntax_: 10018 'CALL CHMOD(NAME, MODE[, STATUS])' 10019 'STATUS = CHMOD(NAME, MODE)' 10020 10021_Arguments_: 10022 10023 NAME Scalar 'CHARACTER' of default kind with the file 10024 name. Trailing blanks are ignored unless the 10025 character 'achar(0)' is present, then all 10026 characters up to and excluding 'achar(0)' are 10027 used as the file name. 10028 10029 MODE Scalar 'CHARACTER' of default kind giving the 10030 file permission. MODE uses the same syntax as 10031 the 'chmod' utility as defined by the POSIX 10032 standard. The argument shall either be a string 10033 of a nonnegative octal number or a symbolic 10034 mode. 10035 10036 STATUS (optional) scalar 'INTEGER', which is '0' on 10037 success and nonzero otherwise. 10038 10039_Return value_: 10040 In either syntax, STATUS is set to '0' on success and nonzero 10041 otherwise. 10042 10043_Example_: 10044 'CHMOD' as subroutine 10045 program chmod_test 10046 implicit none 10047 integer :: status 10048 call chmod('test.dat','u+x',status) 10049 print *, 'Status: ', status 10050 end program chmod_test 10051 'CHMOD' as function: 10052 program chmod_test 10053 implicit none 10054 integer :: status 10055 status = chmod('test.dat','u+x') 10056 print *, 'Status: ', status 10057 end program chmod_test 10058 10059 10060File: gfortran.info, Node: CMPLX, Next: CO_BROADCAST, Prev: CHMOD, Up: Intrinsic Procedures 10061 100629.62 'CMPLX' -- Complex conversion function 10063=========================================== 10064 10065_Description_: 10066 'CMPLX(X [, Y [, KIND]])' returns a complex number where X is 10067 converted to the real component. If Y is present it is converted 10068 to the imaginary component. If Y is not present then the imaginary 10069 component is set to 0.0. If X is complex then Y must not be 10070 present. 10071 10072_Standard_: 10073 Fortran 77 and later 10074 10075_Class_: 10076 Elemental function 10077 10078_Syntax_: 10079 'RESULT = CMPLX(X [, Y [, KIND]])' 10080 10081_Arguments_: 10082 X The type may be 'INTEGER', 'REAL', or 'COMPLEX'. 10083 Y (Optional; only allowed if X is not 'COMPLEX'.) 10084 May be 'INTEGER' or 'REAL'. 10085 KIND (Optional) An 'INTEGER' initialization 10086 expression indicating the kind parameter of the 10087 result. 10088 10089_Return value_: 10090 The return value is of 'COMPLEX' type, with a kind equal to KIND if 10091 it is specified. If KIND is not specified, the result is of the 10092 default 'COMPLEX' kind, regardless of the kinds of X and Y. 10093 10094_Example_: 10095 program test_cmplx 10096 integer :: i = 42 10097 real :: x = 3.14 10098 complex :: z 10099 z = cmplx(i, x) 10100 print *, z, cmplx(x) 10101 end program test_cmplx 10102 10103_See also_: 10104 *note COMPLEX:: 10105 10106 10107File: gfortran.info, Node: CO_BROADCAST, Next: CO_MAX, Prev: CMPLX, Up: Intrinsic Procedures 10108 101099.63 'CO_BROADCAST' -- Copy a value to all images the current set of images 10110=========================================================================== 10111 10112_Description_: 10113 'CO_BROADCAST' copies the value of argument A on the image with 10114 image index 'SOURCE_IMAGE' to all images in the current team. A 10115 becomes defined as if by intrinsic assignment. If the execution 10116 was successful and STAT is present, it is assigned the value zero. 10117 If the execution failed, STAT gets assigned a nonzero value and, if 10118 present, ERRMSG gets assigned a value describing the occurred 10119 error. 10120 10121_Standard_: 10122 Technical Specification (TS) 18508 or later 10123 10124_Class_: 10125 Collective subroutine 10126 10127_Syntax_: 10128 'CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])' 10129 10130_Arguments_: 10131 A INTENT(INOUT) argument; shall have the same 10132 dynamic type and type parameters on all 10133 images of the current team. If it is an 10134 array, it shall have the same shape on all 10135 images. 10136 SOURCE_IMAGE a scalar integer expression. It shall have 10137 the same the same value on all images and 10138 refer to an image of the current team. 10139 STAT (optional) a scalar integer variable 10140 ERRMSG (optional) a scalar character variable 10141 10142_Example_: 10143 program test 10144 integer :: val(3) 10145 if (this_image() == 1) then 10146 val = [1, 5, 3] 10147 end if 10148 call co_broadcast (val, source_image=1) 10149 print *, this_image, ":", val 10150 end program test 10151 10152_See also_: 10153 *note CO_MAX::, *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE:: 10154 10155 10156File: gfortran.info, Node: CO_MAX, Next: CO_MIN, Prev: CO_BROADCAST, Up: Intrinsic Procedures 10157 101589.64 'CO_MAX' -- Maximal value on the current set of images 10159=========================================================== 10160 10161_Description_: 10162 'CO_MAX' determines element-wise the maximal value of A on all 10163 images of the current team. If RESULT_IMAGE is present, the 10164 maximum values are returned in A on the specified image only and 10165 the value of A on the other images become undefined. If 10166 RESULT_IMAGE is not present, the value is returned on all images. 10167 If the execution was successful and STAT is present, it is assigned 10168 the value zero. If the execution failed, STAT gets assigned a 10169 nonzero value and, if present, ERRMSG gets assigned a value 10170 describing the occurred error. 10171 10172_Standard_: 10173 Technical Specification (TS) 18508 or later 10174 10175_Class_: 10176 Collective subroutine 10177 10178_Syntax_: 10179 'CALL CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])' 10180 10181_Arguments_: 10182 A shall be an integer, real or character 10183 variable, which has the same type and type 10184 parameters on all images of the team. 10185 RESULT_IMAGE (optional) a scalar integer expression; if 10186 present, it shall have the same the same 10187 value on all images and refer to an image of 10188 the current team. 10189 STAT (optional) a scalar integer variable 10190 ERRMSG (optional) a scalar character variable 10191 10192_Example_: 10193 program test 10194 integer :: val 10195 val = this_image () 10196 call co_max (val, result_image=1) 10197 if (this_image() == 1) then 10198 write(*,*) "Maximal value", val ! prints num_images() 10199 end if 10200 end program test 10201 10202_See also_: 10203 *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::, *note 10204 CO_BROADCAST:: 10205 10206 10207File: gfortran.info, Node: CO_MIN, Next: CO_REDUCE, Prev: CO_MAX, Up: Intrinsic Procedures 10208 102099.65 'CO_MIN' -- Minimal value on the current set of images 10210=========================================================== 10211 10212_Description_: 10213 'CO_MIN' determines element-wise the minimal value of A on all 10214 images of the current team. If RESULT_IMAGE is present, the 10215 minimal values are returned in A on the specified image only and 10216 the value of A on the other images become undefined. If 10217 RESULT_IMAGE is not present, the value is returned on all images. 10218 If the execution was successful and STAT is present, it is assigned 10219 the value zero. If the execution failed, STAT gets assigned a 10220 nonzero value and, if present, ERRMSG gets assigned a value 10221 describing the occurred error. 10222 10223_Standard_: 10224 Technical Specification (TS) 18508 or later 10225 10226_Class_: 10227 Collective subroutine 10228 10229_Syntax_: 10230 'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])' 10231 10232_Arguments_: 10233 A shall be an integer, real or character 10234 variable, which has the same type and type 10235 parameters on all images of the team. 10236 RESULT_IMAGE (optional) a scalar integer expression; if 10237 present, it shall have the same the same 10238 value on all images and refer to an image of 10239 the current team. 10240 STAT (optional) a scalar integer variable 10241 ERRMSG (optional) a scalar character variable 10242 10243_Example_: 10244 program test 10245 integer :: val 10246 val = this_image () 10247 call co_min (val, result_image=1) 10248 if (this_image() == 1) then 10249 write(*,*) "Minimal value", val ! prints 1 10250 end if 10251 end program test 10252 10253_See also_: 10254 *note CO_MAX::, *note CO_SUM::, *note CO_REDUCE::, *note 10255 CO_BROADCAST:: 10256 10257 10258File: gfortran.info, Node: CO_REDUCE, Next: CO_SUM, Prev: CO_MIN, Up: Intrinsic Procedures 10259 102609.66 'CO_REDUCE' -- Reduction of values on the current set of images 10261==================================================================== 10262 10263_Description_: 10264 'CO_REDUCE' determines element-wise the reduction of the value of A 10265 on all images of the current team. The pure function passed as 10266 OPERATOR is used to pairwise reduce the values of A by passing 10267 either the value of A of different images or the result values of 10268 such a reduction as argument. If A is an array, the deduction is 10269 done element wise. If RESULT_IMAGE is present, the result values 10270 are returned in A on the specified image only and the value of A on 10271 the other images become undefined. If RESULT_IMAGE is not present, 10272 the value is returned on all images. If the execution was 10273 successful and STAT is present, it is assigned the value zero. If 10274 the execution failed, STAT gets assigned a nonzero value and, if 10275 present, ERRMSG gets assigned a value describing the occurred 10276 error. 10277 10278_Standard_: 10279 Technical Specification (TS) 18508 or later 10280 10281_Class_: 10282 Collective subroutine 10283 10284_Syntax_: 10285 'CALL CO_REDUCE(A, OPERATOR, [, RESULT_IMAGE, STAT, ERRMSG])' 10286 10287_Arguments_: 10288 A is an 'INTENT(INOUT)' argument and shall be 10289 nonpolymorphic. If it is allocatable, it 10290 shall be allocated; if it is a pointer, it 10291 shall be associated. A shall have the same 10292 type and type parameters on all images of the 10293 team; if it is an array, it shall have the 10294 same shape on all images. 10295 OPERATOR pure function with two scalar nonallocatable 10296 arguments, which shall be nonpolymorphic and 10297 have the same type and type parameters as A. 10298 The function shall return a nonallocatable 10299 scalar of the same type and type parameters 10300 as A. The function shall be the same on all 10301 images and with regards to the arguments 10302 mathematically commutative and associative. 10303 Note that OPERATOR may not be an elemental 10304 function, unless it is an intrisic function. 10305 RESULT_IMAGE (optional) a scalar integer expression; if 10306 present, it shall have the same the same 10307 value on all images and refer to an image of 10308 the current team. 10309 STAT (optional) a scalar integer variable 10310 ERRMSG (optional) a scalar character variable 10311 10312_Example_: 10313 program test 10314 integer :: val 10315 val = this_image () 10316 call co_reduce (val, result_image=1, operator=myprod) 10317 if (this_image() == 1) then 10318 write(*,*) "Product value", val ! prints num_images() factorial 10319 end if 10320 contains 10321 pure function myprod(a, b) 10322 integer, value :: a, b 10323 integer :: myprod 10324 myprod = a * b 10325 end function myprod 10326 end program test 10327 10328_Note_: 10329 While the rules permit in principle an intrinsic function, none of 10330 the intrinsics in the standard fulfill the criteria of having a 10331 specific function, which takes two arguments of the same type and 10332 returning that type as result. 10333 10334_See also_: 10335 *note CO_MIN::, *note CO_MAX::, *note CO_SUM::, *note 10336 CO_BROADCAST:: 10337 10338 10339File: gfortran.info, Node: CO_SUM, Next: COMMAND_ARGUMENT_COUNT, Prev: CO_REDUCE, Up: Intrinsic Procedures 10340 103419.67 'CO_SUM' -- Sum of values on the current set of images 10342=========================================================== 10343 10344_Description_: 10345 'CO_SUM' sums up the values of each element of A on all images of 10346 the current team. If RESULT_IMAGE is present, the summed-up values 10347 are returned in A on the specified image only and the value of A on 10348 the other images become undefined. If RESULT_IMAGE is not present, 10349 the value is returned on all images. If the execution was 10350 successful and STAT is present, it is assigned the value zero. If 10351 the execution failed, STAT gets assigned a nonzero value and, if 10352 present, ERRMSG gets assigned a value describing the occurred 10353 error. 10354 10355_Standard_: 10356 Technical Specification (TS) 18508 or later 10357 10358_Class_: 10359 Collective subroutine 10360 10361_Syntax_: 10362 'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])' 10363 10364_Arguments_: 10365 A shall be an integer, real or complex 10366 variable, which has the same type and type 10367 parameters on all images of the team. 10368 RESULT_IMAGE (optional) a scalar integer expression; if 10369 present, it shall have the same the same 10370 value on all images and refer to an image of 10371 the current team. 10372 STAT (optional) a scalar integer variable 10373 ERRMSG (optional) a scalar character variable 10374 10375_Example_: 10376 program test 10377 integer :: val 10378 val = this_image () 10379 call co_sum (val, result_image=1) 10380 if (this_image() == 1) then 10381 write(*,*) "The sum is ", val ! prints (n**2 + n)/2, 10382 ! with n = num_images() 10383 end if 10384 end program test 10385 10386_See also_: 10387 *note CO_MAX::, *note CO_MIN::, *note CO_REDUCE::, *note 10388 CO_BROADCAST:: 10389 10390 10391File: gfortran.info, Node: COMMAND_ARGUMENT_COUNT, Next: COMPILER_OPTIONS, Prev: CO_SUM, Up: Intrinsic Procedures 10392 103939.68 'COMMAND_ARGUMENT_COUNT' -- Get number of command line arguments 10394===================================================================== 10395 10396_Description_: 10397 'COMMAND_ARGUMENT_COUNT' returns the number of arguments passed on 10398 the command line when the containing program was invoked. 10399 10400_Standard_: 10401 Fortran 2003 and later 10402 10403_Class_: 10404 Inquiry function 10405 10406_Syntax_: 10407 'RESULT = COMMAND_ARGUMENT_COUNT()' 10408 10409_Arguments_: 10410 None 10411 10412_Return value_: 10413 The return value is an 'INTEGER' of default kind. 10414 10415_Example_: 10416 program test_command_argument_count 10417 integer :: count 10418 count = command_argument_count() 10419 print *, count 10420 end program test_command_argument_count 10421 10422_See also_: 10423 *note GET_COMMAND::, *note GET_COMMAND_ARGUMENT:: 10424 10425 10426File: gfortran.info, Node: COMPILER_OPTIONS, Next: COMPILER_VERSION, Prev: COMMAND_ARGUMENT_COUNT, Up: Intrinsic Procedures 10427 104289.69 'COMPILER_OPTIONS' -- Options passed to the compiler 10429========================================================= 10430 10431_Description_: 10432 'COMPILER_OPTIONS' returns a string with the options used for 10433 compiling. 10434 10435_Standard_: 10436 Fortran 2008 10437 10438_Class_: 10439 Inquiry function of the module 'ISO_FORTRAN_ENV' 10440 10441_Syntax_: 10442 'STR = COMPILER_OPTIONS()' 10443 10444_Arguments_: 10445 None 10446 10447_Return value_: 10448 The return value is a default-kind string with system-dependent 10449 length. It contains the compiler flags used to compile the file, 10450 which called the 'COMPILER_OPTIONS' intrinsic. 10451 10452_Example_: 10453 use iso_fortran_env 10454 print '(4a)', 'This file was compiled by ', & 10455 compiler_version(), ' using the options ', & 10456 compiler_options() 10457 end 10458 10459_See also_: 10460 *note COMPILER_VERSION::, *note ISO_FORTRAN_ENV:: 10461 10462 10463File: gfortran.info, Node: COMPILER_VERSION, Next: COMPLEX, Prev: COMPILER_OPTIONS, Up: Intrinsic Procedures 10464 104659.70 'COMPILER_VERSION' -- Compiler version string 10466================================================== 10467 10468_Description_: 10469 'COMPILER_VERSION' returns a string with the name and the version 10470 of the compiler. 10471 10472_Standard_: 10473 Fortran 2008 10474 10475_Class_: 10476 Inquiry function of the module 'ISO_FORTRAN_ENV' 10477 10478_Syntax_: 10479 'STR = COMPILER_VERSION()' 10480 10481_Arguments_: 10482 None 10483 10484_Return value_: 10485 The return value is a default-kind string with system-dependent 10486 length. It contains the name of the compiler and its version 10487 number. 10488 10489_Example_: 10490 use iso_fortran_env 10491 print '(4a)', 'This file was compiled by ', & 10492 compiler_version(), ' using the options ', & 10493 compiler_options() 10494 end 10495 10496_See also_: 10497 *note COMPILER_OPTIONS::, *note ISO_FORTRAN_ENV:: 10498 10499 10500File: gfortran.info, Node: COMPLEX, Next: CONJG, Prev: COMPILER_VERSION, Up: Intrinsic Procedures 10501 105029.71 'COMPLEX' -- Complex conversion function 10503============================================= 10504 10505_Description_: 10506 'COMPLEX(X, Y)' returns a complex number where X is converted to 10507 the real component and Y is converted to the imaginary component. 10508 10509_Standard_: 10510 GNU extension 10511 10512_Class_: 10513 Elemental function 10514 10515_Syntax_: 10516 'RESULT = COMPLEX(X, Y)' 10517 10518_Arguments_: 10519 X The type may be 'INTEGER' or 'REAL'. 10520 Y The type may be 'INTEGER' or 'REAL'. 10521 10522_Return value_: 10523 If X and Y are both of 'INTEGER' type, then the return value is of 10524 default 'COMPLEX' type. 10525 10526 If X and Y are of 'REAL' type, or one is of 'REAL' type and one is 10527 of 'INTEGER' type, then the return value is of 'COMPLEX' type with 10528 a kind equal to that of the 'REAL' argument with the highest 10529 precision. 10530 10531_Example_: 10532 program test_complex 10533 integer :: i = 42 10534 real :: x = 3.14 10535 print *, complex(i, x) 10536 end program test_complex 10537 10538_See also_: 10539 *note CMPLX:: 10540 10541 10542File: gfortran.info, Node: CONJG, Next: COS, Prev: COMPLEX, Up: Intrinsic Procedures 10543 105449.72 'CONJG' -- Complex conjugate function 10545========================================== 10546 10547_Description_: 10548 'CONJG(Z)' returns the conjugate of Z. If Z is '(x, y)' then the 10549 result is '(x, -y)' 10550 10551_Standard_: 10552 Fortran 77 and later, has an overload that is a GNU extension 10553 10554_Class_: 10555 Elemental function 10556 10557_Syntax_: 10558 'Z = CONJG(Z)' 10559 10560_Arguments_: 10561 Z The type shall be 'COMPLEX'. 10562 10563_Return value_: 10564 The return value is of type 'COMPLEX'. 10565 10566_Example_: 10567 program test_conjg 10568 complex :: z = (2.0, 3.0) 10569 complex(8) :: dz = (2.71_8, -3.14_8) 10570 z= conjg(z) 10571 print *, z 10572 dz = dconjg(dz) 10573 print *, dz 10574 end program test_conjg 10575 10576_Specific names_: 10577 Name Argument Return type Standard 10578 'DCONJG(Z)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 10579 Z' 10580 10581 10582File: gfortran.info, Node: COS, Next: COSD, Prev: CONJG, Up: Intrinsic Procedures 10583 105849.73 'COS' -- Cosine function 10585============================= 10586 10587_Description_: 10588 'COS(X)' computes the cosine of X. 10589 10590_Standard_: 10591 Fortran 77 and later, has overloads that are GNU extensions 10592 10593_Class_: 10594 Elemental function 10595 10596_Syntax_: 10597 'RESULT = COS(X)' 10598 10599_Arguments_: 10600 X The type shall be 'REAL' or 'COMPLEX'. 10601 10602_Return value_: 10603 The return value is of the same type and kind as X. The real part 10604 of the result is in radians. If X is of the type 'REAL', the 10605 return value lies in the range -1 \leq \cos (x) \leq 1. 10606 10607_Example_: 10608 program test_cos 10609 real :: x = 0.0 10610 x = cos(x) 10611 end program test_cos 10612 10613_Specific names_: 10614 Name Argument Return type Standard 10615 'COS(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 10616 later 10617 'DCOS(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 10618 later 10619 'CCOS(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and 10620 X' later 10621 'ZCOS(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 10622 X' 10623 'CDCOS(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 10624 X' 10625 10626_See also_: 10627 Inverse function: *note ACOS:: Degrees function: *note COSD:: 10628 10629 10630File: gfortran.info, Node: COSD, Next: COSH, Prev: COS, Up: Intrinsic Procedures 10631 106329.74 'COSD' -- Cosine function, degrees 10633======================================= 10634 10635_Description_: 10636 'COSD(X)' computes the cosine of X in degrees. 10637 10638 This function is for compatibility only and should be avoided in 10639 favor of standard constructs wherever possible. 10640 10641_Standard_: 10642 GNU extension, enabled with '-fdec-math'. 10643 10644_Class_: 10645 Elemental function 10646 10647_Syntax_: 10648 'RESULT = COSD(X)' 10649 10650_Arguments_: 10651 X The type shall be 'REAL' or 'COMPLEX'. 10652 10653_Return value_: 10654 The return value is of the same type and kind as X. The real part 10655 of the result is in degrees. If X is of the type 'REAL', the 10656 return value lies in the range -1 \leq \cosd (x) \leq 1. 10657 10658_Example_: 10659 program test_cosd 10660 real :: x = 0.0 10661 x = cosd(x) 10662 end program test_cosd 10663 10664_Specific names_: 10665 Name Argument Return type Standard 10666 'COSD(X)' 'REAL(4) X' 'REAL(4)' GNU extension 10667 'DCOSD(X)' 'REAL(8) X' 'REAL(8)' GNU extension 10668 'CCOSD(X)' 'COMPLEX(4) 'COMPLEX(4)' GNU extension 10669 X' 10670 'ZCOSD(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 10671 X' 10672 'CDCOSD(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 10673 X' 10674 10675_See also_: 10676 Inverse function: *note ACOSD:: Radians function: *note COS:: 10677 10678 10679File: gfortran.info, Node: COSH, Next: COTAN, Prev: COSD, Up: Intrinsic Procedures 10680 106819.75 'COSH' -- Hyperbolic cosine function 10682========================================= 10683 10684_Description_: 10685 'COSH(X)' computes the hyperbolic cosine of X. 10686 10687_Standard_: 10688 Fortran 77 and later, for a complex argument Fortran 2008 or later 10689 10690_Class_: 10691 Elemental function 10692 10693_Syntax_: 10694 'X = COSH(X)' 10695 10696_Arguments_: 10697 X The type shall be 'REAL' or 'COMPLEX'. 10698 10699_Return value_: 10700 The return value has same type and kind as X. If X is complex, the 10701 imaginary part of the result is in radians. If X is 'REAL', the 10702 return value has a lower bound of one, \cosh (x) \geq 1. 10703 10704_Example_: 10705 program test_cosh 10706 real(8) :: x = 1.0_8 10707 x = cosh(x) 10708 end program test_cosh 10709 10710_Specific names_: 10711 Name Argument Return type Standard 10712 'COSH(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 10713 later 10714 'DCOSH(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 10715 later 10716 10717_See also_: 10718 Inverse function: *note ACOSH:: 10719 10720 10721File: gfortran.info, Node: COTAN, Next: COTAND, Prev: COSH, Up: Intrinsic Procedures 10722 107239.76 'COTAN' -- Cotangent function 10724================================== 10725 10726_Description_: 10727 'COTAN(X)' computes the cotangent of X. Equivalent to 'COS(x)' 10728 divided by 'SIN(x)', or '1 / TAN(x)'. 10729 10730 This function is for compatibility only and should be avoided in 10731 favor of standard constructs wherever possible. 10732 10733_Standard_: 10734 GNU extension, enabled with '-fdec-math'. 10735 10736_Class_: 10737 Elemental function 10738 10739_Syntax_: 10740 'RESULT = COTAN(X)' 10741 10742_Arguments_: 10743 X The type shall be 'REAL' or 'COMPLEX'. 10744 10745_Return value_: 10746 The return value has same type and kind as X, and its value is in 10747 radians. 10748 10749_Example_: 10750 program test_cotan 10751 real(8) :: x = 0.165_8 10752 x = cotan(x) 10753 end program test_cotan 10754 10755_Specific names_: 10756 Name Argument Return type Standard 10757 'COTAN(X)' 'REAL(4) X' 'REAL(4)' GNU extension 10758 'DCOTAN(X)' 'REAL(8) X' 'REAL(8)' GNU extension 10759 10760_See also_: 10761 Converse function: *note TAN:: Degrees function: *note COTAND:: 10762 10763 10764File: gfortran.info, Node: COTAND, Next: COUNT, Prev: COTAN, Up: Intrinsic Procedures 10765 107669.77 'COTAND' -- Cotangent function, degrees 10767============================================ 10768 10769_Description_: 10770 'COTAND(X)' computes the cotangent of X in degrees. Equivalent to 10771 'COSD(x)' divided by 'SIND(x)', or '1 / TAND(x)'. 10772 10773_Standard_: 10774 GNU extension, enabled with '-fdec-math'. 10775 10776 This function is for compatibility only and should be avoided in 10777 favor of standard constructs wherever possible. 10778 10779_Class_: 10780 Elemental function 10781 10782_Syntax_: 10783 'RESULT = COTAND(X)' 10784 10785_Arguments_: 10786 X The type shall be 'REAL' or 'COMPLEX'. 10787 10788_Return value_: 10789 The return value has same type and kind as X, and its value is in 10790 degrees. 10791 10792_Example_: 10793 program test_cotand 10794 real(8) :: x = 0.165_8 10795 x = cotand(x) 10796 end program test_cotand 10797 10798_Specific names_: 10799 Name Argument Return type Standard 10800 'COTAND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 10801 'DCOTAND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 10802 10803_See also_: 10804 Converse function: *note TAND:: Radians function: *note COTAN:: 10805 10806 10807File: gfortran.info, Node: COUNT, Next: CPU_TIME, Prev: COTAND, Up: Intrinsic Procedures 10808 108099.78 'COUNT' -- Count function 10810============================== 10811 10812_Description_: 10813 10814 Counts the number of '.TRUE.' elements in a logical MASK, or, if 10815 the DIM argument is supplied, counts the number of elements along 10816 each row of the array in the DIM direction. If the array has zero 10817 size, or all of the elements of MASK are '.FALSE.', then the result 10818 is '0'. 10819 10820_Standard_: 10821 Fortran 90 and later, with KIND argument Fortran 2003 and later 10822 10823_Class_: 10824 Transformational function 10825 10826_Syntax_: 10827 'RESULT = COUNT(MASK [, DIM, KIND])' 10828 10829_Arguments_: 10830 MASK The type shall be 'LOGICAL'. 10831 DIM (Optional) The type shall be 'INTEGER'. 10832 KIND (Optional) An 'INTEGER' initialization 10833 expression indicating the kind parameter of the 10834 result. 10835 10836_Return value_: 10837 The return value is of type 'INTEGER' and of kind KIND. If KIND is 10838 absent, the return value is of default integer kind. If DIM is 10839 present, the result is an array with a rank one less than the rank 10840 of ARRAY, and a size corresponding to the shape of ARRAY with the 10841 DIM dimension removed. 10842 10843_Example_: 10844 program test_count 10845 integer, dimension(2,3) :: a, b 10846 logical, dimension(2,3) :: mask 10847 a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /)) 10848 b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /)) 10849 print '(3i3)', a(1,:) 10850 print '(3i3)', a(2,:) 10851 print * 10852 print '(3i3)', b(1,:) 10853 print '(3i3)', b(2,:) 10854 print * 10855 mask = a.ne.b 10856 print '(3l3)', mask(1,:) 10857 print '(3l3)', mask(2,:) 10858 print * 10859 print '(3i3)', count(mask) 10860 print * 10861 print '(3i3)', count(mask, 1) 10862 print * 10863 print '(3i3)', count(mask, 2) 10864 end program test_count 10865 10866 10867File: gfortran.info, Node: CPU_TIME, Next: CSHIFT, Prev: COUNT, Up: Intrinsic Procedures 10868 108699.79 'CPU_TIME' -- CPU elapsed time in seconds 10870============================================== 10871 10872_Description_: 10873 Returns a 'REAL' value representing the elapsed CPU time in 10874 seconds. This is useful for testing segments of code to determine 10875 execution time. 10876 10877 If a time source is available, time will be reported with 10878 microsecond resolution. If no time source is available, TIME is 10879 set to '-1.0'. 10880 10881 Note that TIME may contain a, system dependent, arbitrary offset 10882 and may not start with '0.0'. For 'CPU_TIME', the absolute value 10883 is meaningless, only differences between subsequent calls to this 10884 subroutine, as shown in the example below, should be used. 10885 10886_Standard_: 10887 Fortran 95 and later 10888 10889_Class_: 10890 Subroutine 10891 10892_Syntax_: 10893 'CALL CPU_TIME(TIME)' 10894 10895_Arguments_: 10896 TIME The type shall be 'REAL' with 'INTENT(OUT)'. 10897 10898_Return value_: 10899 None 10900 10901_Example_: 10902 program test_cpu_time 10903 real :: start, finish 10904 call cpu_time(start) 10905 ! put code to test here 10906 call cpu_time(finish) 10907 print '("Time = ",f6.3," seconds.")',finish-start 10908 end program test_cpu_time 10909 10910_See also_: 10911 *note SYSTEM_CLOCK::, *note DATE_AND_TIME:: 10912 10913 10914File: gfortran.info, Node: CSHIFT, Next: CTIME, Prev: CPU_TIME, Up: Intrinsic Procedures 10915 109169.80 'CSHIFT' -- Circular shift elements of an array 10917==================================================== 10918 10919_Description_: 10920 'CSHIFT(ARRAY, SHIFT [, DIM])' performs a circular shift on 10921 elements of ARRAY along the dimension of DIM. If DIM is omitted it 10922 is taken to be '1'. DIM is a scalar of type 'INTEGER' in the range 10923 of 1 \leq DIM \leq n) where n is the rank of ARRAY. If the rank of 10924 ARRAY is one, then all elements of ARRAY are shifted by SHIFT 10925 places. If rank is greater than one, then all complete rank one 10926 sections of ARRAY along the given dimension are shifted. Elements 10927 shifted out one end of each rank one section are shifted back in 10928 the other end. 10929 10930_Standard_: 10931 Fortran 90 and later 10932 10933_Class_: 10934 Transformational function 10935 10936_Syntax_: 10937 'RESULT = CSHIFT(ARRAY, SHIFT [, DIM])' 10938 10939_Arguments_: 10940 ARRAY Shall be an array of any type. 10941 SHIFT The type shall be 'INTEGER'. 10942 DIM The type shall be 'INTEGER'. 10943 10944_Return value_: 10945 Returns an array of same type and rank as the ARRAY argument. 10946 10947_Example_: 10948 program test_cshift 10949 integer, dimension(3,3) :: a 10950 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /)) 10951 print '(3i3)', a(1,:) 10952 print '(3i3)', a(2,:) 10953 print '(3i3)', a(3,:) 10954 a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2) 10955 print * 10956 print '(3i3)', a(1,:) 10957 print '(3i3)', a(2,:) 10958 print '(3i3)', a(3,:) 10959 end program test_cshift 10960 10961 10962File: gfortran.info, Node: CTIME, Next: DATE_AND_TIME, Prev: CSHIFT, Up: Intrinsic Procedures 10963 109649.81 'CTIME' -- Convert a time into a string 10965============================================ 10966 10967_Description_: 10968 'CTIME' converts a system time value, such as returned by *note 10969 TIME8::, to a string. The output will be of the form 'Sat Aug 19 10970 18:13:14 1995'. 10971 10972 This intrinsic is provided in both subroutine and function forms; 10973 however, only one form can be used in any given program unit. 10974 10975_Standard_: 10976 GNU extension 10977 10978_Class_: 10979 Subroutine, function 10980 10981_Syntax_: 10982 'CALL CTIME(TIME, RESULT)'. 10983 'RESULT = CTIME(TIME)'. 10984 10985_Arguments_: 10986 TIME The type shall be of type 'INTEGER'. 10987 RESULT The type shall be of type 'CHARACTER' and of 10988 default kind. It is an 'INTENT(OUT)' argument. 10989 If the length of this variable is too short for 10990 the time and date string to fit completely, it 10991 will be blank on procedure return. 10992 10993_Return value_: 10994 The converted date and time as a string. 10995 10996_Example_: 10997 program test_ctime 10998 integer(8) :: i 10999 character(len=30) :: date 11000 i = time8() 11001 11002 ! Do something, main part of the program 11003 11004 call ctime(i,date) 11005 print *, 'Program was started on ', date 11006 end program test_ctime 11007 11008_See Also_: 11009 *note DATE_AND_TIME::, *note GMTIME::, *note LTIME::, *note TIME::, 11010 *note TIME8:: 11011 11012 11013File: gfortran.info, Node: DATE_AND_TIME, Next: DBLE, Prev: CTIME, Up: Intrinsic Procedures 11014 110159.82 'DATE_AND_TIME' -- Date and time subroutine 11016================================================ 11017 11018_Description_: 11019 'DATE_AND_TIME(DATE, TIME, ZONE, VALUES)' gets the corresponding 11020 date and time information from the real-time system clock. DATE is 11021 'INTENT(OUT)' and has form ccyymmdd. TIME is 'INTENT(OUT)' and has 11022 form hhmmss.sss. ZONE is 'INTENT(OUT)' and has form (+-)hhmm, 11023 representing the difference with respect to Coordinated Universal 11024 Time (UTC). Unavailable time and date parameters return blanks. 11025 11026 VALUES is 'INTENT(OUT)' and provides the following: 11027 11028 'VALUE(1)': The year 11029 'VALUE(2)': The month 11030 'VALUE(3)': The day of the month 11031 'VALUE(4)': Time difference with UTC in 11032 minutes 11033 'VALUE(5)': The hour of the day 11034 'VALUE(6)': The minutes of the hour 11035 'VALUE(7)': The seconds of the minute 11036 'VALUE(8)': The milliseconds of the 11037 second 11038 11039_Standard_: 11040 Fortran 90 and later 11041 11042_Class_: 11043 Subroutine 11044 11045_Syntax_: 11046 'CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])' 11047 11048_Arguments_: 11049 DATE (Optional) The type shall be 'CHARACTER(LEN=8)' 11050 or larger, and of default kind. 11051 TIME (Optional) The type shall be 'CHARACTER(LEN=10)' 11052 or larger, and of default kind. 11053 ZONE (Optional) The type shall be 'CHARACTER(LEN=5)' 11054 or larger, and of default kind. 11055 VALUES (Optional) The type shall be 'INTEGER(8)'. 11056 11057_Return value_: 11058 None 11059 11060_Example_: 11061 program test_time_and_date 11062 character(8) :: date 11063 character(10) :: time 11064 character(5) :: zone 11065 integer,dimension(8) :: values 11066 ! using keyword arguments 11067 call date_and_time(date,time,zone,values) 11068 call date_and_time(DATE=date,ZONE=zone) 11069 call date_and_time(TIME=time) 11070 call date_and_time(VALUES=values) 11071 print '(a,2x,a,2x,a)', date, time, zone 11072 print '(8i5)', values 11073 end program test_time_and_date 11074 11075_See also_: 11076 *note CPU_TIME::, *note SYSTEM_CLOCK:: 11077 11078 11079File: gfortran.info, Node: DBLE, Next: DCMPLX, Prev: DATE_AND_TIME, Up: Intrinsic Procedures 11080 110819.83 'DBLE' -- Double conversion function 11082========================================= 11083 11084_Description_: 11085 'DBLE(A)' Converts A to double precision real type. 11086 11087_Standard_: 11088 Fortran 77 and later 11089 11090_Class_: 11091 Elemental function 11092 11093_Syntax_: 11094 'RESULT = DBLE(A)' 11095 11096_Arguments_: 11097 A The type shall be 'INTEGER', 'REAL', or 11098 'COMPLEX'. 11099 11100_Return value_: 11101 The return value is of type double precision real. 11102 11103_Example_: 11104 program test_dble 11105 real :: x = 2.18 11106 integer :: i = 5 11107 complex :: z = (2.3,1.14) 11108 print *, dble(x), dble(i), dble(z) 11109 end program test_dble 11110 11111_See also_: 11112 *note REAL:: 11113 11114 11115File: gfortran.info, Node: DCMPLX, Next: DIGITS, Prev: DBLE, Up: Intrinsic Procedures 11116 111179.84 'DCMPLX' -- Double complex conversion function 11118=================================================== 11119 11120_Description_: 11121 'DCMPLX(X [,Y])' returns a double complex number where X is 11122 converted to the real component. If Y is present it is converted 11123 to the imaginary component. If Y is not present then the imaginary 11124 component is set to 0.0. If X is complex then Y must not be 11125 present. 11126 11127_Standard_: 11128 GNU extension 11129 11130_Class_: 11131 Elemental function 11132 11133_Syntax_: 11134 'RESULT = DCMPLX(X [, Y])' 11135 11136_Arguments_: 11137 X The type may be 'INTEGER', 'REAL', or 'COMPLEX'. 11138 Y (Optional if X is not 'COMPLEX'.) May be 11139 'INTEGER' or 'REAL'. 11140 11141_Return value_: 11142 The return value is of type 'COMPLEX(8)' 11143 11144_Example_: 11145 program test_dcmplx 11146 integer :: i = 42 11147 real :: x = 3.14 11148 complex :: z 11149 z = cmplx(i, x) 11150 print *, dcmplx(i) 11151 print *, dcmplx(x) 11152 print *, dcmplx(z) 11153 print *, dcmplx(x,i) 11154 end program test_dcmplx 11155 11156 11157File: gfortran.info, Node: DIGITS, Next: DIM, Prev: DCMPLX, Up: Intrinsic Procedures 11158 111599.85 'DIGITS' -- Significant binary digits function 11160=================================================== 11161 11162_Description_: 11163 'DIGITS(X)' returns the number of significant binary digits of the 11164 internal model representation of X. For example, on a system using 11165 a 32-bit floating point representation, a default real number would 11166 likely return 24. 11167 11168_Standard_: 11169 Fortran 90 and later 11170 11171_Class_: 11172 Inquiry function 11173 11174_Syntax_: 11175 'RESULT = DIGITS(X)' 11176 11177_Arguments_: 11178 X The type may be 'INTEGER' or 'REAL'. 11179 11180_Return value_: 11181 The return value is of type 'INTEGER'. 11182 11183_Example_: 11184 program test_digits 11185 integer :: i = 12345 11186 real :: x = 3.143 11187 real(8) :: y = 2.33 11188 print *, digits(i) 11189 print *, digits(x) 11190 print *, digits(y) 11191 end program test_digits 11192 11193 11194File: gfortran.info, Node: DIM, Next: DOT_PRODUCT, Prev: DIGITS, Up: Intrinsic Procedures 11195 111969.86 'DIM' -- Positive difference 11197================================= 11198 11199_Description_: 11200 'DIM(X,Y)' returns the difference 'X-Y' if the result is positive; 11201 otherwise returns zero. 11202 11203_Standard_: 11204 Fortran 77 and later 11205 11206_Class_: 11207 Elemental function 11208 11209_Syntax_: 11210 'RESULT = DIM(X, Y)' 11211 11212_Arguments_: 11213 X The type shall be 'INTEGER' or 'REAL' 11214 Y The type shall be the same type and kind as X. 11215 (As a GNU extension, arguments of different 11216 kinds are permitted.) 11217 11218_Return value_: 11219 The return value is of type 'INTEGER' or 'REAL'. (As a GNU 11220 extension, kind is the largest kind of the actual arguments.) 11221 11222_Example_: 11223 program test_dim 11224 integer :: i 11225 real(8) :: x 11226 i = dim(4, 15) 11227 x = dim(4.345_8, 2.111_8) 11228 print *, i 11229 print *, x 11230 end program test_dim 11231 11232_Specific names_: 11233 Name Argument Return type Standard 11234 'DIM(X,Y)' 'REAL(4) X, 'REAL(4)' Fortran 77 and 11235 Y' later 11236 'IDIM(X,Y)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and 11237 X, Y' later 11238 'DDIM(X,Y)' 'REAL(8) X, 'REAL(8)' Fortran 77 and 11239 Y' later 11240 11241 11242File: gfortran.info, Node: DOT_PRODUCT, Next: DPROD, Prev: DIM, Up: Intrinsic Procedures 11243 112449.87 'DOT_PRODUCT' -- Dot product function 11245========================================== 11246 11247_Description_: 11248 'DOT_PRODUCT(VECTOR_A, VECTOR_B)' computes the dot product 11249 multiplication of two vectors VECTOR_A and VECTOR_B. The two 11250 vectors may be either numeric or logical and must be arrays of rank 11251 one and of equal size. If the vectors are 'INTEGER' or 'REAL', the 11252 result is 'SUM(VECTOR_A*VECTOR_B)'. If the vectors are 'COMPLEX', 11253 the result is 'SUM(CONJG(VECTOR_A)*VECTOR_B)'. If the vectors are 11254 'LOGICAL', the result is 'ANY(VECTOR_A .AND. VECTOR_B)'. 11255 11256_Standard_: 11257 Fortran 90 and later 11258 11259_Class_: 11260 Transformational function 11261 11262_Syntax_: 11263 'RESULT = DOT_PRODUCT(VECTOR_A, VECTOR_B)' 11264 11265_Arguments_: 11266 VECTOR_A The type shall be numeric or 'LOGICAL', rank 1. 11267 VECTOR_B The type shall be numeric if VECTOR_A is of 11268 numeric type or 'LOGICAL' if VECTOR_A is of type 11269 'LOGICAL'. VECTOR_B shall be a rank-one array. 11270 11271_Return value_: 11272 If the arguments are numeric, the return value is a scalar of 11273 numeric type, 'INTEGER', 'REAL', or 'COMPLEX'. If the arguments 11274 are 'LOGICAL', the return value is '.TRUE.' or '.FALSE.'. 11275 11276_Example_: 11277 program test_dot_prod 11278 integer, dimension(3) :: a, b 11279 a = (/ 1, 2, 3 /) 11280 b = (/ 4, 5, 6 /) 11281 print '(3i3)', a 11282 print * 11283 print '(3i3)', b 11284 print * 11285 print *, dot_product(a,b) 11286 end program test_dot_prod 11287 11288 11289File: gfortran.info, Node: DPROD, Next: DREAL, Prev: DOT_PRODUCT, Up: Intrinsic Procedures 11290 112919.88 'DPROD' -- Double product function 11292======================================= 11293 11294_Description_: 11295 'DPROD(X,Y)' returns the product 'X*Y'. 11296 11297_Standard_: 11298 Fortran 77 and later 11299 11300_Class_: 11301 Elemental function 11302 11303_Syntax_: 11304 'RESULT = DPROD(X, Y)' 11305 11306_Arguments_: 11307 X The type shall be 'REAL'. 11308 Y The type shall be 'REAL'. 11309 11310_Return value_: 11311 The return value is of type 'REAL(8)'. 11312 11313_Example_: 11314 program test_dprod 11315 real :: x = 5.2 11316 real :: y = 2.3 11317 real(8) :: d 11318 d = dprod(x,y) 11319 print *, d 11320 end program test_dprod 11321 11322_Specific names_: 11323 Name Argument Return type Standard 11324 'DPROD(X,Y)' 'REAL(4) X, 'REAL(8)' Fortran 77 and 11325 Y' later 11326 11327 11328File: gfortran.info, Node: DREAL, Next: DSHIFTL, Prev: DPROD, Up: Intrinsic Procedures 11329 113309.89 'DREAL' -- Double real part function 11331========================================= 11332 11333_Description_: 11334 'DREAL(Z)' returns the real part of complex variable Z. 11335 11336_Standard_: 11337 GNU extension 11338 11339_Class_: 11340 Elemental function 11341 11342_Syntax_: 11343 'RESULT = DREAL(A)' 11344 11345_Arguments_: 11346 A The type shall be 'COMPLEX(8)'. 11347 11348_Return value_: 11349 The return value is of type 'REAL(8)'. 11350 11351_Example_: 11352 program test_dreal 11353 complex(8) :: z = (1.3_8,7.2_8) 11354 print *, dreal(z) 11355 end program test_dreal 11356 11357_See also_: 11358 *note AIMAG:: 11359 11360 11361File: gfortran.info, Node: DSHIFTL, Next: DSHIFTR, Prev: DREAL, Up: Intrinsic Procedures 11362 113639.90 'DSHIFTL' -- Combined left shift 11364===================================== 11365 11366_Description_: 11367 'DSHIFTL(I, J, SHIFT)' combines bits of I and J. The rightmost 11368 SHIFT bits of the result are the leftmost SHIFT bits of J, and the 11369 remaining bits are the rightmost bits of I. 11370 11371_Standard_: 11372 Fortran 2008 and later 11373 11374_Class_: 11375 Elemental function 11376 11377_Syntax_: 11378 'RESULT = DSHIFTL(I, J, SHIFT)' 11379 11380_Arguments_: 11381 I Shall be of type 'INTEGER' or a BOZ constant. 11382 J Shall be of type 'INTEGER' or a BOZ constant. 11383 If both I and J have integer type, then they 11384 shall have the same kind type parameter. I and 11385 J shall not both be BOZ constants. 11386 SHIFT Shall be of type 'INTEGER'. It shall be 11387 nonnegative. If I is not a BOZ constant, then 11388 SHIFT shall be less than or equal to 11389 'BIT_SIZE(I)'; otherwise, SHIFT shall be less 11390 than or equal to 'BIT_SIZE(J)'. 11391 11392_Return value_: 11393 If either I or J is a BOZ constant, it is first converted as if by 11394 the intrinsic function 'INT' to an integer type with the kind type 11395 parameter of the other. 11396 11397_See also_: 11398 *note DSHIFTR:: 11399 11400 11401File: gfortran.info, Node: DSHIFTR, Next: DTIME, Prev: DSHIFTL, Up: Intrinsic Procedures 11402 114039.91 'DSHIFTR' -- Combined right shift 11404====================================== 11405 11406_Description_: 11407 'DSHIFTR(I, J, SHIFT)' combines bits of I and J. The leftmost 11408 SHIFT bits of the result are the rightmost SHIFT bits of I, and the 11409 remaining bits are the leftmost bits of J. 11410 11411_Standard_: 11412 Fortran 2008 and later 11413 11414_Class_: 11415 Elemental function 11416 11417_Syntax_: 11418 'RESULT = DSHIFTR(I, J, SHIFT)' 11419 11420_Arguments_: 11421 I Shall be of type 'INTEGER' or a BOZ constant. 11422 J Shall be of type 'INTEGER' or a BOZ constant. 11423 If both I and J have integer type, then they 11424 shall have the same kind type parameter. I and 11425 J shall not both be BOZ constants. 11426 SHIFT Shall be of type 'INTEGER'. It shall be 11427 nonnegative. If I is not a BOZ constant, then 11428 SHIFT shall be less than or equal to 11429 'BIT_SIZE(I)'; otherwise, SHIFT shall be less 11430 than or equal to 'BIT_SIZE(J)'. 11431 11432_Return value_: 11433 If either I or J is a BOZ constant, it is first converted as if by 11434 the intrinsic function 'INT' to an integer type with the kind type 11435 parameter of the other. 11436 11437_See also_: 11438 *note DSHIFTL:: 11439 11440 11441File: gfortran.info, Node: DTIME, Next: EOSHIFT, Prev: DSHIFTR, Up: Intrinsic Procedures 11442 114439.92 'DTIME' -- Execution time subroutine (or function) 11444======================================================= 11445 11446_Description_: 11447 'DTIME(VALUES, TIME)' initially returns the number of seconds of 11448 runtime since the start of the process's execution in TIME. VALUES 11449 returns the user and system components of this time in 'VALUES(1)' 11450 and 'VALUES(2)' respectively. TIME is equal to 'VALUES(1) + 11451 VALUES(2)'. 11452 11453 Subsequent invocations of 'DTIME' return values accumulated since 11454 the previous invocation. 11455 11456 On some systems, the underlying timings are represented using types 11457 with sufficiently small limits that overflows (wrap around) are 11458 possible, such as 32-bit types. Therefore, the values returned by 11459 this intrinsic might be, or become, negative, or numerically less 11460 than previous values, during a single run of the compiled program. 11461 11462 Please note, that this implementation is thread safe if used within 11463 OpenMP directives, i.e., its state will be consistent while called 11464 from multiple threads. However, if 'DTIME' is called from multiple 11465 threads, the result is still the time since the last invocation. 11466 This may not give the intended results. If possible, use 11467 'CPU_TIME' instead. 11468 11469 This intrinsic is provided in both subroutine and function forms; 11470 however, only one form can be used in any given program unit. 11471 11472 VALUES and TIME are 'INTENT(OUT)' and provide the following: 11473 11474 'VALUES(1)': User time in seconds. 11475 'VALUES(2)': System time in seconds. 11476 'TIME': Run time since start in 11477 seconds. 11478 11479_Standard_: 11480 GNU extension 11481 11482_Class_: 11483 Subroutine, function 11484 11485_Syntax_: 11486 'CALL DTIME(VALUES, TIME)'. 11487 'TIME = DTIME(VALUES)', (not recommended). 11488 11489_Arguments_: 11490 VALUES The type shall be 'REAL(4), DIMENSION(2)'. 11491 TIME The type shall be 'REAL(4)'. 11492 11493_Return value_: 11494 Elapsed time in seconds since the last invocation or since the 11495 start of program execution if not called before. 11496 11497_Example_: 11498 program test_dtime 11499 integer(8) :: i, j 11500 real, dimension(2) :: tarray 11501 real :: result 11502 call dtime(tarray, result) 11503 print *, result 11504 print *, tarray(1) 11505 print *, tarray(2) 11506 do i=1,100000000 ! Just a delay 11507 j = i * i - i 11508 end do 11509 call dtime(tarray, result) 11510 print *, result 11511 print *, tarray(1) 11512 print *, tarray(2) 11513 end program test_dtime 11514 11515_See also_: 11516 *note CPU_TIME:: 11517 11518 11519File: gfortran.info, Node: EOSHIFT, Next: EPSILON, Prev: DTIME, Up: Intrinsic Procedures 11520 115219.93 'EOSHIFT' -- End-off shift elements of an array 11522==================================================== 11523 11524_Description_: 11525 'EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])' performs an end-off shift 11526 on elements of ARRAY along the dimension of DIM. If DIM is omitted 11527 it is taken to be '1'. DIM is a scalar of type 'INTEGER' in the 11528 range of 1 \leq DIM \leq n) where n is the rank of ARRAY. If the 11529 rank of ARRAY is one, then all elements of ARRAY are shifted by 11530 SHIFT places. If rank is greater than one, then all complete rank 11531 one sections of ARRAY along the given dimension are shifted. 11532 Elements shifted out one end of each rank one section are dropped. 11533 If BOUNDARY is present then the corresponding value of from 11534 BOUNDARY is copied back in the other end. If BOUNDARY is not 11535 present then the following are copied in depending on the type of 11536 ARRAY. 11537 11538 _Array _Boundary Value_ 11539 Type_ 11540 Numeric 0 of the type and kind of ARRAY. 11541 Logical '.FALSE.'. 11542 Character(LEN)LEN blanks. 11543 11544_Standard_: 11545 Fortran 90 and later 11546 11547_Class_: 11548 Transformational function 11549 11550_Syntax_: 11551 'RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])' 11552 11553_Arguments_: 11554 ARRAY May be any type, not scalar. 11555 SHIFT The type shall be 'INTEGER'. 11556 BOUNDARY Same type as ARRAY. 11557 DIM The type shall be 'INTEGER'. 11558 11559_Return value_: 11560 Returns an array of same type and rank as the ARRAY argument. 11561 11562_Example_: 11563 program test_eoshift 11564 integer, dimension(3,3) :: a 11565 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /)) 11566 print '(3i3)', a(1,:) 11567 print '(3i3)', a(2,:) 11568 print '(3i3)', a(3,:) 11569 a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2) 11570 print * 11571 print '(3i3)', a(1,:) 11572 print '(3i3)', a(2,:) 11573 print '(3i3)', a(3,:) 11574 end program test_eoshift 11575 11576 11577File: gfortran.info, Node: EPSILON, Next: ERF, Prev: EOSHIFT, Up: Intrinsic Procedures 11578 115799.94 'EPSILON' -- Epsilon function 11580================================== 11581 11582_Description_: 11583 'EPSILON(X)' returns the smallest number E of the same kind as X 11584 such that 1 + E > 1. 11585 11586_Standard_: 11587 Fortran 90 and later 11588 11589_Class_: 11590 Inquiry function 11591 11592_Syntax_: 11593 'RESULT = EPSILON(X)' 11594 11595_Arguments_: 11596 X The type shall be 'REAL'. 11597 11598_Return value_: 11599 The return value is of same type as the argument. 11600 11601_Example_: 11602 program test_epsilon 11603 real :: x = 3.143 11604 real(8) :: y = 2.33 11605 print *, EPSILON(x) 11606 print *, EPSILON(y) 11607 end program test_epsilon 11608 11609 11610File: gfortran.info, Node: ERF, Next: ERFC, Prev: EPSILON, Up: Intrinsic Procedures 11611 116129.95 'ERF' -- Error function 11613============================ 11614 11615_Description_: 11616 'ERF(X)' computes the error function of X. 11617 11618_Standard_: 11619 Fortran 2008 and later 11620 11621_Class_: 11622 Elemental function 11623 11624_Syntax_: 11625 'RESULT = ERF(X)' 11626 11627_Arguments_: 11628 X The type shall be 'REAL'. 11629 11630_Return value_: 11631 The return value is of type 'REAL', of the same kind as X and lies 11632 in the range -1 \leq erf (x) \leq 1 . 11633 11634_Example_: 11635 program test_erf 11636 real(8) :: x = 0.17_8 11637 x = erf(x) 11638 end program test_erf 11639 11640_Specific names_: 11641 Name Argument Return type Standard 11642 'DERF(X)' 'REAL(8) X' 'REAL(8)' GNU extension 11643 11644 11645File: gfortran.info, Node: ERFC, Next: ERFC_SCALED, Prev: ERF, Up: Intrinsic Procedures 11646 116479.96 'ERFC' -- Error function 11648============================= 11649 11650_Description_: 11651 'ERFC(X)' computes the complementary error function of X. 11652 11653_Standard_: 11654 Fortran 2008 and later 11655 11656_Class_: 11657 Elemental function 11658 11659_Syntax_: 11660 'RESULT = ERFC(X)' 11661 11662_Arguments_: 11663 X The type shall be 'REAL'. 11664 11665_Return value_: 11666 The return value is of type 'REAL' and of the same kind as X. It 11667 lies in the range 0 \leq erfc (x) \leq 2 . 11668 11669_Example_: 11670 program test_erfc 11671 real(8) :: x = 0.17_8 11672 x = erfc(x) 11673 end program test_erfc 11674 11675_Specific names_: 11676 Name Argument Return type Standard 11677 'DERFC(X)' 'REAL(8) X' 'REAL(8)' GNU extension 11678 11679 11680File: gfortran.info, Node: ERFC_SCALED, Next: ETIME, Prev: ERFC, Up: Intrinsic Procedures 11681 116829.97 'ERFC_SCALED' -- Error function 11683==================================== 11684 11685_Description_: 11686 'ERFC_SCALED(X)' computes the exponentially-scaled complementary 11687 error function of X. 11688 11689_Standard_: 11690 Fortran 2008 and later 11691 11692_Class_: 11693 Elemental function 11694 11695_Syntax_: 11696 'RESULT = ERFC_SCALED(X)' 11697 11698_Arguments_: 11699 X The type shall be 'REAL'. 11700 11701_Return value_: 11702 The return value is of type 'REAL' and of the same kind as X. 11703 11704_Example_: 11705 program test_erfc_scaled 11706 real(8) :: x = 0.17_8 11707 x = erfc_scaled(x) 11708 end program test_erfc_scaled 11709 11710 11711File: gfortran.info, Node: ETIME, Next: EVENT_QUERY, Prev: ERFC_SCALED, Up: Intrinsic Procedures 11712 117139.98 'ETIME' -- Execution time subroutine (or function) 11714======================================================= 11715 11716_Description_: 11717 'ETIME(VALUES, TIME)' returns the number of seconds of runtime 11718 since the start of the process's execution in TIME. VALUES returns 11719 the user and system components of this time in 'VALUES(1)' and 11720 'VALUES(2)' respectively. TIME is equal to 'VALUES(1) + 11721 VALUES(2)'. 11722 11723 On some systems, the underlying timings are represented using types 11724 with sufficiently small limits that overflows (wrap around) are 11725 possible, such as 32-bit types. Therefore, the values returned by 11726 this intrinsic might be, or become, negative, or numerically less 11727 than previous values, during a single run of the compiled program. 11728 11729 This intrinsic is provided in both subroutine and function forms; 11730 however, only one form can be used in any given program unit. 11731 11732 VALUES and TIME are 'INTENT(OUT)' and provide the following: 11733 11734 'VALUES(1)': User time in seconds. 11735 'VALUES(2)': System time in seconds. 11736 'TIME': Run time since start in seconds. 11737 11738_Standard_: 11739 GNU extension 11740 11741_Class_: 11742 Subroutine, function 11743 11744_Syntax_: 11745 'CALL ETIME(VALUES, TIME)'. 11746 'TIME = ETIME(VALUES)', (not recommended). 11747 11748_Arguments_: 11749 VALUES The type shall be 'REAL(4), DIMENSION(2)'. 11750 TIME The type shall be 'REAL(4)'. 11751 11752_Return value_: 11753 Elapsed time in seconds since the start of program execution. 11754 11755_Example_: 11756 program test_etime 11757 integer(8) :: i, j 11758 real, dimension(2) :: tarray 11759 real :: result 11760 call ETIME(tarray, result) 11761 print *, result 11762 print *, tarray(1) 11763 print *, tarray(2) 11764 do i=1,100000000 ! Just a delay 11765 j = i * i - i 11766 end do 11767 call ETIME(tarray, result) 11768 print *, result 11769 print *, tarray(1) 11770 print *, tarray(2) 11771 end program test_etime 11772 11773_See also_: 11774 *note CPU_TIME:: 11775 11776 11777File: gfortran.info, Node: EVENT_QUERY, Next: EXECUTE_COMMAND_LINE, Prev: ETIME, Up: Intrinsic Procedures 11778 117799.99 'EVENT_QUERY' -- Query whether a coarray event has occurred 11780================================================================ 11781 11782_Description_: 11783 'EVENT_QUERY' assignes the number of events to COUNT which have 11784 been posted to the EVENT variable and not yet been removed by 11785 calling 'EVENT WAIT'. When STAT is present and the invocation was 11786 successful, it is assigned the value 0. If it is present and the 11787 invocation has failed, it is assigned a positive value and COUNT is 11788 assigned the value -1. 11789 11790_Standard_: 11791 TS 18508 or later 11792 11793_Class_: 11794 subroutine 11795 11796_Syntax_: 11797 'CALL EVENT_QUERY (EVENT, COUNT [, STAT])' 11798 11799_Arguments_: 11800 EVENT (intent(IN)) Scalar of type 'EVENT_TYPE', 11801 defined in 'ISO_FORTRAN_ENV'; shall not be 11802 coindexed. 11803 COUNT (intent(out))Scalar integer with at least the 11804 precision of default integer. 11805 STAT (optional) Scalar default-kind integer variable. 11806 11807_Example_: 11808 program atomic 11809 use iso_fortran_env 11810 implicit none 11811 type(event_type) :: event_value_has_been_set[*] 11812 integer :: cnt 11813 if (this_image() == 1) then 11814 call event_query (event_value_has_been_set, cnt) 11815 if (cnt > 0) write(*,*) "Value has been set" 11816 elseif (this_image() == 2) then 11817 event post (event_value_has_been_set[1]) 11818 end if 11819 end program atomic 11820 11821 11822File: gfortran.info, Node: EXECUTE_COMMAND_LINE, Next: EXIT, Prev: EVENT_QUERY, Up: Intrinsic Procedures 11823 118249.100 'EXECUTE_COMMAND_LINE' -- Execute a shell command 11825======================================================= 11826 11827_Description_: 11828 'EXECUTE_COMMAND_LINE' runs a shell command, synchronously or 11829 asynchronously. 11830 11831 The 'COMMAND' argument is passed to the shell and executed (The 11832 shell is 'sh' on Unix systems, and 'cmd.exe' on Windows.). If 11833 'WAIT' is present and has the value false, the execution of the 11834 command is asynchronous if the system supports it; otherwise, the 11835 command is executed synchronously using the C library's 'system' 11836 call. 11837 11838 The three last arguments allow the user to get status information. 11839 After synchronous execution, 'EXITSTAT' contains the integer exit 11840 code of the command, as returned by 'system'. 'CMDSTAT' is set to 11841 zero if the command line was executed (whatever its exit status 11842 was). 'CMDMSG' is assigned an error message if an error has 11843 occurred. 11844 11845 Note that the 'system' function need not be thread-safe. It is the 11846 responsibility of the user to ensure that 'system' is not called 11847 concurrently. 11848 11849 For asynchronous execution on supported targets, the POSIX 11850 'posix_spawn' or 'fork' functions are used. Also, a signal handler 11851 for the 'SIGCHLD' signal is installed. 11852 11853_Standard_: 11854 Fortran 2008 and later 11855 11856_Class_: 11857 Subroutine 11858 11859_Syntax_: 11860 'CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT, 11861 CMDMSG ])' 11862 11863_Arguments_: 11864 COMMAND Shall be a default 'CHARACTER' scalar. 11865 WAIT (Optional) Shall be a default 'LOGICAL' scalar. 11866 EXITSTAT (Optional) Shall be an 'INTEGER' of the default 11867 kind. 11868 CMDSTAT (Optional) Shall be an 'INTEGER' of the default 11869 kind. 11870 CMDMSG (Optional) Shall be an 'CHARACTER' scalar of the 11871 default kind. 11872 11873_Example_: 11874 program test_exec 11875 integer :: i 11876 11877 call execute_command_line ("external_prog.exe", exitstat=i) 11878 print *, "Exit status of external_prog.exe was ", i 11879 11880 call execute_command_line ("reindex_files.exe", wait=.false.) 11881 print *, "Now reindexing files in the background" 11882 11883 end program test_exec 11884 11885_Note_: 11886 11887 Because this intrinsic is implemented in terms of the 'system' 11888 function call, its behavior with respect to signaling is processor 11889 dependent. In particular, on POSIX-compliant systems, the SIGINT 11890 and SIGQUIT signals will be ignored, and the SIGCHLD will be 11891 blocked. As such, if the parent process is terminated, the child 11892 process might not be terminated alongside. 11893 11894_See also_: 11895 *note SYSTEM:: 11896 11897 11898File: gfortran.info, Node: EXIT, Next: EXP, Prev: EXECUTE_COMMAND_LINE, Up: Intrinsic Procedures 11899 119009.101 'EXIT' -- Exit the program with status. 11901============================================= 11902 11903_Description_: 11904 'EXIT' causes immediate termination of the program with status. If 11905 status is omitted it returns the canonical _success_ for the 11906 system. All Fortran I/O units are closed. 11907 11908_Standard_: 11909 GNU extension 11910 11911_Class_: 11912 Subroutine 11913 11914_Syntax_: 11915 'CALL EXIT([STATUS])' 11916 11917_Arguments_: 11918 STATUS Shall be an 'INTEGER' of the default kind. 11919 11920_Return value_: 11921 'STATUS' is passed to the parent process on exit. 11922 11923_Example_: 11924 program test_exit 11925 integer :: STATUS = 0 11926 print *, 'This program is going to exit.' 11927 call EXIT(STATUS) 11928 end program test_exit 11929 11930_See also_: 11931 *note ABORT::, *note KILL:: 11932 11933 11934File: gfortran.info, Node: EXP, Next: EXPONENT, Prev: EXIT, Up: Intrinsic Procedures 11935 119369.102 'EXP' -- Exponential function 11937=================================== 11938 11939_Description_: 11940 'EXP(X)' computes the base e exponential of X. 11941 11942_Standard_: 11943 Fortran 77 and later, has overloads that are GNU extensions 11944 11945_Class_: 11946 Elemental function 11947 11948_Syntax_: 11949 'RESULT = EXP(X)' 11950 11951_Arguments_: 11952 X The type shall be 'REAL' or 'COMPLEX'. 11953 11954_Return value_: 11955 The return value has same type and kind as X. 11956 11957_Example_: 11958 program test_exp 11959 real :: x = 1.0 11960 x = exp(x) 11961 end program test_exp 11962 11963_Specific names_: 11964 Name Argument Return type Standard 11965 'EXP(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 11966 later 11967 'DEXP(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 11968 later 11969 'CEXP(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and 11970 X' later 11971 'ZEXP(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 11972 X' 11973 'CDEXP(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 11974 X' 11975 11976 11977File: gfortran.info, Node: EXPONENT, Next: EXTENDS_TYPE_OF, Prev: EXP, Up: Intrinsic Procedures 11978 119799.103 'EXPONENT' -- Exponent function 11980===================================== 11981 11982_Description_: 11983 'EXPONENT(X)' returns the value of the exponent part of X. If X is 11984 zero the value returned is zero. 11985 11986_Standard_: 11987 Fortran 90 and later 11988 11989_Class_: 11990 Elemental function 11991 11992_Syntax_: 11993 'RESULT = EXPONENT(X)' 11994 11995_Arguments_: 11996 X The type shall be 'REAL'. 11997 11998_Return value_: 11999 The return value is of type default 'INTEGER'. 12000 12001_Example_: 12002 program test_exponent 12003 real :: x = 1.0 12004 integer :: i 12005 i = exponent(x) 12006 print *, i 12007 print *, exponent(0.0) 12008 end program test_exponent 12009 12010 12011File: gfortran.info, Node: EXTENDS_TYPE_OF, Next: FDATE, Prev: EXPONENT, Up: Intrinsic Procedures 12012 120139.104 'EXTENDS_TYPE_OF' -- Query dynamic type for extension 12014=========================================================== 12015 12016_Description_: 12017 Query dynamic type for extension. 12018 12019_Standard_: 12020 Fortran 2003 and later 12021 12022_Class_: 12023 Inquiry function 12024 12025_Syntax_: 12026 'RESULT = EXTENDS_TYPE_OF(A, MOLD)' 12027 12028_Arguments_: 12029 A Shall be an object of extensible declared type 12030 or unlimited polymorphic. 12031 MOLD Shall be an object of extensible declared type 12032 or unlimited polymorphic. 12033 12034_Return value_: 12035 The return value is a scalar of type default logical. It is true 12036 if and only if the dynamic type of A is an extension type of the 12037 dynamic type of MOLD. 12038 12039_See also_: 12040 *note SAME_TYPE_AS:: 12041 12042 12043File: gfortran.info, Node: FDATE, Next: FGET, Prev: EXTENDS_TYPE_OF, Up: Intrinsic Procedures 12044 120459.105 'FDATE' -- Get the current time as a string 12046================================================= 12047 12048_Description_: 12049 'FDATE(DATE)' returns the current date (using the same format as 12050 *note CTIME::) in DATE. It is equivalent to 'CALL CTIME(DATE, 12051 TIME())'. 12052 12053 This intrinsic is provided in both subroutine and function forms; 12054 however, only one form can be used in any given program unit. 12055 12056_Standard_: 12057 GNU extension 12058 12059_Class_: 12060 Subroutine, function 12061 12062_Syntax_: 12063 'CALL FDATE(DATE)'. 12064 'DATE = FDATE()'. 12065 12066_Arguments_: 12067 DATE The type shall be of type 'CHARACTER' of the 12068 default kind. It is an 'INTENT(OUT)' argument. 12069 If the length of this variable is too short for 12070 the date and time string to fit completely, it 12071 will be blank on procedure return. 12072 12073_Return value_: 12074 The current date and time as a string. 12075 12076_Example_: 12077 program test_fdate 12078 integer(8) :: i, j 12079 character(len=30) :: date 12080 call fdate(date) 12081 print *, 'Program started on ', date 12082 do i = 1, 100000000 ! Just a delay 12083 j = i * i - i 12084 end do 12085 call fdate(date) 12086 print *, 'Program ended on ', date 12087 end program test_fdate 12088 12089_See also_: 12090 *note DATE_AND_TIME::, *note CTIME:: 12091 12092 12093File: gfortran.info, Node: FGET, Next: FGETC, Prev: FDATE, Up: Intrinsic Procedures 12094 120959.106 'FGET' -- Read a single character in stream mode from stdin 12096================================================================= 12097 12098_Description_: 12099 Read a single character in stream mode from stdin by bypassing 12100 normal formatted output. Stream I/O should not be mixed with 12101 normal record-oriented (formatted or unformatted) I/O on the same 12102 unit; the results are unpredictable. 12103 12104 This intrinsic is provided in both subroutine and function forms; 12105 however, only one form can be used in any given program unit. 12106 12107 Note that the 'FGET' intrinsic is provided for backwards 12108 compatibility with 'g77'. GNU Fortran provides the Fortran 2003 12109 Stream facility. Programmers should consider the use of new stream 12110 IO feature in new code for future portability. See also *note 12111 Fortran 2003 status::. 12112 12113_Standard_: 12114 GNU extension 12115 12116_Class_: 12117 Subroutine, function 12118 12119_Syntax_: 12120 'CALL FGET(C [, STATUS])' 12121 'STATUS = FGET(C)' 12122 12123_Arguments_: 12124 C The type shall be 'CHARACTER' and of default 12125 kind. 12126 STATUS (Optional) status flag of type 'INTEGER'. 12127 Returns 0 on success, -1 on end-of-file, and a 12128 system specific positive error code otherwise. 12129 12130_Example_: 12131 PROGRAM test_fget 12132 INTEGER, PARAMETER :: strlen = 100 12133 INTEGER :: status, i = 1 12134 CHARACTER(len=strlen) :: str = "" 12135 12136 WRITE (*,*) 'Enter text:' 12137 DO 12138 CALL fget(str(i:i), status) 12139 if (status /= 0 .OR. i > strlen) exit 12140 i = i + 1 12141 END DO 12142 WRITE (*,*) TRIM(str) 12143 END PROGRAM 12144 12145_See also_: 12146 *note FGETC::, *note FPUT::, *note FPUTC:: 12147 12148 12149File: gfortran.info, Node: FGETC, Next: FINDLOC, Prev: FGET, Up: Intrinsic Procedures 12150 121519.107 'FGETC' -- Read a single character in stream mode 12152======================================================= 12153 12154_Description_: 12155 Read a single character in stream mode by bypassing normal 12156 formatted output. Stream I/O should not be mixed with normal 12157 record-oriented (formatted or unformatted) I/O on the same unit; 12158 the results are unpredictable. 12159 12160 This intrinsic is provided in both subroutine and function forms; 12161 however, only one form can be used in any given program unit. 12162 12163 Note that the 'FGET' intrinsic is provided for backwards 12164 compatibility with 'g77'. GNU Fortran provides the Fortran 2003 12165 Stream facility. Programmers should consider the use of new stream 12166 IO feature in new code for future portability. See also *note 12167 Fortran 2003 status::. 12168 12169_Standard_: 12170 GNU extension 12171 12172_Class_: 12173 Subroutine, function 12174 12175_Syntax_: 12176 'CALL FGETC(UNIT, C [, STATUS])' 12177 'STATUS = FGETC(UNIT, C)' 12178 12179_Arguments_: 12180 UNIT The type shall be 'INTEGER'. 12181 C The type shall be 'CHARACTER' and of default 12182 kind. 12183 STATUS (Optional) status flag of type 'INTEGER'. 12184 Returns 0 on success, -1 on end-of-file and a 12185 system specific positive error code otherwise. 12186 12187_Example_: 12188 PROGRAM test_fgetc 12189 INTEGER :: fd = 42, status 12190 CHARACTER :: c 12191 12192 OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD") 12193 DO 12194 CALL fgetc(fd, c, status) 12195 IF (status /= 0) EXIT 12196 call fput(c) 12197 END DO 12198 CLOSE(UNIT=fd) 12199 END PROGRAM 12200 12201_See also_: 12202 *note FGET::, *note FPUT::, *note FPUTC:: 12203 12204 12205File: gfortran.info, Node: FINDLOC, Next: FLOOR, Prev: FGETC, Up: Intrinsic Procedures 12206 122079.108 'FINDLOC' -- Search an array for a value 12208============================================== 12209 12210_Description_: 12211 Determines the location of the element in the array with the value 12212 given in the VALUE argument, or, if the DIM argument is supplied, 12213 determines the locations of the elements equal to the VALUE 12214 argument element along each row of the array in the DIM direction. 12215 If MASK is present, only the elements for which MASK is '.TRUE.' 12216 are considered. If more than one element in the array has the 12217 value VALUE, the location returned is that of the first such 12218 element in array element order if the BACK is not present or if it 12219 is '.FALSE.'. If BACK is true, the location returned is that of 12220 the last such element. If the array has zero size, or all of the 12221 elements of MASK are '.FALSE.', then the result is an array of 12222 zeroes. Similarly, if DIM is supplied and all of the elements of 12223 MASK along a given row are zero, the result value for that row is 12224 zero. 12225 12226_Standard_: 12227 Fortran 2008 and later. 12228 12229_Class_: 12230 Transformational function 12231 12232_Syntax_: 12233 'RESULT = FINDLOC(ARRAY, VALUE, DIM [, MASK] [,KIND] 12234 [,BACK])' 12235 'RESULT = FINDLOC(ARRAY, VALUE, [, MASK] [,KIND] 12236 [,BACK])' 12237 12238_Arguments_: 12239 ARRAY Shall be an array of intrinsic type. 12240 VALUE A scalar of intrinsic type which is in type 12241 conformance with ARRAY. 12242 DIM (Optional) Shall be a scalar of type 'INTEGER', 12243 with a value between one and the rank of ARRAY, 12244 inclusive. It may not be an optional dummy 12245 argument. 12246 KIND (Optional) An 'INTEGER' initialization 12247 expression indicating the kind parameter of the 12248 result. 12249 BACK (Optional) A scalar of type 'LOGICAL'. 12250 12251_Return value_: 12252 If DIM is absent, the result is a rank-one array with a length 12253 equal to the rank of ARRAY. If DIM is present, the result is an 12254 array with a rank one less than the rank of ARRAY, and a size 12255 corresponding to the size of ARRAY with the DIM dimension removed. 12256 If DIM is present and ARRAY has a rank of one, the result is a 12257 scalar. If the optional argument KIND is present, the result is an 12258 integer of kind KIND, otherwise it is of default kind. 12259 12260_See also_: 12261 *note MAXLOC::, *note MINLOC:: 12262 12263 12264File: gfortran.info, Node: FLOOR, Next: FLUSH, Prev: FINDLOC, Up: Intrinsic Procedures 12265 122669.109 'FLOOR' -- Integer floor function 12267======================================= 12268 12269_Description_: 12270 'FLOOR(A)' returns the greatest integer less than or equal to X. 12271 12272_Standard_: 12273 Fortran 95 and later 12274 12275_Class_: 12276 Elemental function 12277 12278_Syntax_: 12279 'RESULT = FLOOR(A [, KIND])' 12280 12281_Arguments_: 12282 A The type shall be 'REAL'. 12283 KIND (Optional) An 'INTEGER' initialization 12284 expression indicating the kind parameter of the 12285 result. 12286 12287_Return value_: 12288 The return value is of type 'INTEGER(KIND)' if KIND is present and 12289 of default-kind 'INTEGER' otherwise. 12290 12291_Example_: 12292 program test_floor 12293 real :: x = 63.29 12294 real :: y = -63.59 12295 print *, floor(x) ! returns 63 12296 print *, floor(y) ! returns -64 12297 end program test_floor 12298 12299_See also_: 12300 *note CEILING::, *note NINT:: 12301 12302 12303File: gfortran.info, Node: FLUSH, Next: FNUM, Prev: FLOOR, Up: Intrinsic Procedures 12304 123059.110 'FLUSH' -- Flush I/O unit(s) 12306================================== 12307 12308_Description_: 12309 Flushes Fortran unit(s) currently open for output. Without the 12310 optional argument, all units are flushed, otherwise just the unit 12311 specified. 12312 12313_Standard_: 12314 GNU extension 12315 12316_Class_: 12317 Subroutine 12318 12319_Syntax_: 12320 'CALL FLUSH(UNIT)' 12321 12322_Arguments_: 12323 UNIT (Optional) The type shall be 'INTEGER'. 12324 12325_Note_: 12326 Beginning with the Fortran 2003 standard, there is a 'FLUSH' 12327 statement that should be preferred over the 'FLUSH' intrinsic. 12328 12329 The 'FLUSH' intrinsic and the Fortran 2003 'FLUSH' statement have 12330 identical effect: they flush the runtime library's I/O buffer so 12331 that the data becomes visible to other processes. This does not 12332 guarantee that the data is committed to disk. 12333 12334 On POSIX systems, you can request that all data is transferred to 12335 the storage device by calling the 'fsync' function, with the POSIX 12336 file descriptor of the I/O unit as argument (retrieved with GNU 12337 intrinsic 'FNUM'). The following example shows how: 12338 12339 ! Declare the interface for POSIX fsync function 12340 interface 12341 function fsync (fd) bind(c,name="fsync") 12342 use iso_c_binding, only: c_int 12343 integer(c_int), value :: fd 12344 integer(c_int) :: fsync 12345 end function fsync 12346 end interface 12347 12348 ! Variable declaration 12349 integer :: ret 12350 12351 ! Opening unit 10 12352 open (10,file="foo") 12353 12354 ! ... 12355 ! Perform I/O on unit 10 12356 ! ... 12357 12358 ! Flush and sync 12359 flush(10) 12360 ret = fsync(fnum(10)) 12361 12362 ! Handle possible error 12363 if (ret /= 0) stop "Error calling FSYNC" 12364 12365 12366File: gfortran.info, Node: FNUM, Next: FPUT, Prev: FLUSH, Up: Intrinsic Procedures 12367 123689.111 'FNUM' -- File number function 12369==================================== 12370 12371_Description_: 12372 'FNUM(UNIT)' returns the POSIX file descriptor number corresponding 12373 to the open Fortran I/O unit 'UNIT'. 12374 12375_Standard_: 12376 GNU extension 12377 12378_Class_: 12379 Function 12380 12381_Syntax_: 12382 'RESULT = FNUM(UNIT)' 12383 12384_Arguments_: 12385 UNIT The type shall be 'INTEGER'. 12386 12387_Return value_: 12388 The return value is of type 'INTEGER' 12389 12390_Example_: 12391 program test_fnum 12392 integer :: i 12393 open (unit=10, status = "scratch") 12394 i = fnum(10) 12395 print *, i 12396 close (10) 12397 end program test_fnum 12398 12399 12400File: gfortran.info, Node: FPUT, Next: FPUTC, Prev: FNUM, Up: Intrinsic Procedures 12401 124029.112 'FPUT' -- Write a single character in stream mode to stdout 12403================================================================= 12404 12405_Description_: 12406 Write a single character in stream mode to stdout by bypassing 12407 normal formatted output. Stream I/O should not be mixed with 12408 normal record-oriented (formatted or unformatted) I/O on the same 12409 unit; the results are unpredictable. 12410 12411 This intrinsic is provided in both subroutine and function forms; 12412 however, only one form can be used in any given program unit. 12413 12414 Note that the 'FGET' intrinsic is provided for backwards 12415 compatibility with 'g77'. GNU Fortran provides the Fortran 2003 12416 Stream facility. Programmers should consider the use of new stream 12417 IO feature in new code for future portability. See also *note 12418 Fortran 2003 status::. 12419 12420_Standard_: 12421 GNU extension 12422 12423_Class_: 12424 Subroutine, function 12425 12426_Syntax_: 12427 'CALL FPUT(C [, STATUS])' 12428 'STATUS = FPUT(C)' 12429 12430_Arguments_: 12431 C The type shall be 'CHARACTER' and of default 12432 kind. 12433 STATUS (Optional) status flag of type 'INTEGER'. 12434 Returns 0 on success, -1 on end-of-file and a 12435 system specific positive error code otherwise. 12436 12437_Example_: 12438 PROGRAM test_fput 12439 CHARACTER(len=10) :: str = "gfortran" 12440 INTEGER :: i 12441 DO i = 1, len_trim(str) 12442 CALL fput(str(i:i)) 12443 END DO 12444 END PROGRAM 12445 12446_See also_: 12447 *note FPUTC::, *note FGET::, *note FGETC:: 12448 12449 12450File: gfortran.info, Node: FPUTC, Next: FRACTION, Prev: FPUT, Up: Intrinsic Procedures 12451 124529.113 'FPUTC' -- Write a single character in stream mode 12453======================================================== 12454 12455_Description_: 12456 Write a single character in stream mode by bypassing normal 12457 formatted output. Stream I/O should not be mixed with normal 12458 record-oriented (formatted or unformatted) I/O on the same unit; 12459 the results are unpredictable. 12460 12461 This intrinsic is provided in both subroutine and function forms; 12462 however, only one form can be used in any given program unit. 12463 12464 Note that the 'FGET' intrinsic is provided for backwards 12465 compatibility with 'g77'. GNU Fortran provides the Fortran 2003 12466 Stream facility. Programmers should consider the use of new stream 12467 IO feature in new code for future portability. See also *note 12468 Fortran 2003 status::. 12469 12470_Standard_: 12471 GNU extension 12472 12473_Class_: 12474 Subroutine, function 12475 12476_Syntax_: 12477 'CALL FPUTC(UNIT, C [, STATUS])' 12478 'STATUS = FPUTC(UNIT, C)' 12479 12480_Arguments_: 12481 UNIT The type shall be 'INTEGER'. 12482 C The type shall be 'CHARACTER' and of default 12483 kind. 12484 STATUS (Optional) status flag of type 'INTEGER'. 12485 Returns 0 on success, -1 on end-of-file and a 12486 system specific positive error code otherwise. 12487 12488_Example_: 12489 PROGRAM test_fputc 12490 CHARACTER(len=10) :: str = "gfortran" 12491 INTEGER :: fd = 42, i 12492 12493 OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW") 12494 DO i = 1, len_trim(str) 12495 CALL fputc(fd, str(i:i)) 12496 END DO 12497 CLOSE(fd) 12498 END PROGRAM 12499 12500_See also_: 12501 *note FPUT::, *note FGET::, *note FGETC:: 12502 12503 12504File: gfortran.info, Node: FRACTION, Next: FREE, Prev: FPUTC, Up: Intrinsic Procedures 12505 125069.114 'FRACTION' -- Fractional part of the model representation 12507=============================================================== 12508 12509_Description_: 12510 'FRACTION(X)' returns the fractional part of the model 12511 representation of 'X'. 12512 12513_Standard_: 12514 Fortran 90 and later 12515 12516_Class_: 12517 Elemental function 12518 12519_Syntax_: 12520 'Y = FRACTION(X)' 12521 12522_Arguments_: 12523 X The type of the argument shall be a 'REAL'. 12524 12525_Return value_: 12526 The return value is of the same type and kind as the argument. The 12527 fractional part of the model representation of 'X' is returned; it 12528 is 'X * RADIX(X)**(-EXPONENT(X))'. 12529 12530_Example_: 12531 program test_fraction 12532 real :: x 12533 x = 178.1387e-4 12534 print *, fraction(x), x * radix(x)**(-exponent(x)) 12535 end program test_fraction 12536 12537 12538File: gfortran.info, Node: FREE, Next: FSEEK, Prev: FRACTION, Up: Intrinsic Procedures 12539 125409.115 'FREE' -- Frees memory 12541============================ 12542 12543_Description_: 12544 Frees memory previously allocated by 'MALLOC'. The 'FREE' 12545 intrinsic is an extension intended to be used with Cray pointers, 12546 and is provided in GNU Fortran to allow user to compile legacy 12547 code. For new code using Fortran 95 pointers, the memory 12548 de-allocation intrinsic is 'DEALLOCATE'. 12549 12550_Standard_: 12551 GNU extension 12552 12553_Class_: 12554 Subroutine 12555 12556_Syntax_: 12557 'CALL FREE(PTR)' 12558 12559_Arguments_: 12560 PTR The type shall be 'INTEGER'. It represents the 12561 location of the memory that should be 12562 de-allocated. 12563 12564_Return value_: 12565 None 12566 12567_Example_: 12568 See 'MALLOC' for an example. 12569 12570_See also_: 12571 *note MALLOC:: 12572 12573 12574File: gfortran.info, Node: FSEEK, Next: FSTAT, Prev: FREE, Up: Intrinsic Procedures 12575 125769.116 'FSEEK' -- Low level file positioning subroutine 12577====================================================== 12578 12579_Description_: 12580 Moves UNIT to the specified OFFSET. If WHENCE is set to 0, the 12581 OFFSET is taken as an absolute value 'SEEK_SET', if set to 1, 12582 OFFSET is taken to be relative to the current position 'SEEK_CUR', 12583 and if set to 2 relative to the end of the file 'SEEK_END'. On 12584 error, STATUS is set to a nonzero value. If STATUS the seek fails 12585 silently. 12586 12587 This intrinsic routine is not fully backwards compatible with 12588 'g77'. In 'g77', the 'FSEEK' takes a statement label instead of a 12589 STATUS variable. If FSEEK is used in old code, change 12590 CALL FSEEK(UNIT, OFFSET, WHENCE, *label) 12591 to 12592 INTEGER :: status 12593 CALL FSEEK(UNIT, OFFSET, WHENCE, status) 12594 IF (status /= 0) GOTO label 12595 12596 Please note that GNU Fortran provides the Fortran 2003 Stream 12597 facility. Programmers should consider the use of new stream IO 12598 feature in new code for future portability. See also *note Fortran 12599 2003 status::. 12600 12601_Standard_: 12602 GNU extension 12603 12604_Class_: 12605 Subroutine 12606 12607_Syntax_: 12608 'CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])' 12609 12610_Arguments_: 12611 UNIT Shall be a scalar of type 'INTEGER'. 12612 OFFSET Shall be a scalar of type 'INTEGER'. 12613 WHENCE Shall be a scalar of type 'INTEGER'. Its value 12614 shall be either 0, 1 or 2. 12615 STATUS (Optional) shall be a scalar of type 12616 'INTEGER(4)'. 12617 12618_Example_: 12619 PROGRAM test_fseek 12620 INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2 12621 INTEGER :: fd, offset, ierr 12622 12623 ierr = 0 12624 offset = 5 12625 fd = 10 12626 12627 OPEN(UNIT=fd, FILE="fseek.test") 12628 CALL FSEEK(fd, offset, SEEK_SET, ierr) ! move to OFFSET 12629 print *, FTELL(fd), ierr 12630 12631 CALL FSEEK(fd, 0, SEEK_END, ierr) ! move to end 12632 print *, FTELL(fd), ierr 12633 12634 CALL FSEEK(fd, 0, SEEK_SET, ierr) ! move to beginning 12635 print *, FTELL(fd), ierr 12636 12637 CLOSE(UNIT=fd) 12638 END PROGRAM 12639 12640_See also_: 12641 *note FTELL:: 12642 12643 12644File: gfortran.info, Node: FSTAT, Next: FTELL, Prev: FSEEK, Up: Intrinsic Procedures 12645 126469.117 'FSTAT' -- Get file status 12647================================ 12648 12649_Description_: 12650 'FSTAT' is identical to *note STAT::, except that information about 12651 an already opened file is obtained. 12652 12653 The elements in 'VALUES' are the same as described by *note STAT::. 12654 12655 This intrinsic is provided in both subroutine and function forms; 12656 however, only one form can be used in any given program unit. 12657 12658_Standard_: 12659 GNU extension 12660 12661_Class_: 12662 Subroutine, function 12663 12664_Syntax_: 12665 'CALL FSTAT(UNIT, VALUES [, STATUS])' 12666 'STATUS = FSTAT(UNIT, VALUES)' 12667 12668_Arguments_: 12669 UNIT An open I/O unit number of type 'INTEGER'. 12670 VALUES The type shall be 'INTEGER(4), DIMENSION(13)'. 12671 STATUS (Optional) status flag of type 'INTEGER(4)'. 12672 Returns 0 on success and a system specific error 12673 code otherwise. 12674 12675_Example_: 12676 See *note STAT:: for an example. 12677 12678_See also_: 12679 To stat a link: *note LSTAT:: To stat a file: *note STAT:: 12680 12681 12682File: gfortran.info, Node: FTELL, Next: GAMMA, Prev: FSTAT, Up: Intrinsic Procedures 12683 126849.118 'FTELL' -- Current stream position 12685======================================== 12686 12687_Description_: 12688 Retrieves the current position within an open file. 12689 12690 This intrinsic is provided in both subroutine and function forms; 12691 however, only one form can be used in any given program unit. 12692 12693_Standard_: 12694 GNU extension 12695 12696_Class_: 12697 Subroutine, function 12698 12699_Syntax_: 12700 'CALL FTELL(UNIT, OFFSET)' 12701 'OFFSET = FTELL(UNIT)' 12702 12703_Arguments_: 12704 OFFSET Shall of type 'INTEGER'. 12705 UNIT Shall of type 'INTEGER'. 12706 12707_Return value_: 12708 In either syntax, OFFSET is set to the current offset of unit 12709 number UNIT, or to -1 if the unit is not currently open. 12710 12711_Example_: 12712 PROGRAM test_ftell 12713 INTEGER :: i 12714 OPEN(10, FILE="temp.dat") 12715 CALL ftell(10,i) 12716 WRITE(*,*) i 12717 END PROGRAM 12718 12719_See also_: 12720 *note FSEEK:: 12721 12722 12723File: gfortran.info, Node: GAMMA, Next: GERROR, Prev: FTELL, Up: Intrinsic Procedures 12724 127259.119 'GAMMA' -- Gamma function 12726=============================== 12727 12728_Description_: 12729 'GAMMA(X)' computes Gamma (\Gamma) of X. For positive, integer 12730 values of X the Gamma function simplifies to the factorial function 12731 \Gamma(x)=(x-1)!. 12732 12733_Standard_: 12734 Fortran 2008 and later 12735 12736_Class_: 12737 Elemental function 12738 12739_Syntax_: 12740 'X = GAMMA(X)' 12741 12742_Arguments_: 12743 X Shall be of type 'REAL' and neither zero nor a 12744 negative integer. 12745 12746_Return value_: 12747 The return value is of type 'REAL' of the same kind as X. 12748 12749_Example_: 12750 program test_gamma 12751 real :: x = 1.0 12752 x = gamma(x) ! returns 1.0 12753 end program test_gamma 12754 12755_Specific names_: 12756 Name Argument Return type Standard 12757 'DGAMMA(X)' 'REAL(8) X' 'REAL(8)' GNU extension 12758 12759_See also_: 12760 Logarithm of the Gamma function: *note LOG_GAMMA:: 12761 12762 12763File: gfortran.info, Node: GERROR, Next: GETARG, Prev: GAMMA, Up: Intrinsic Procedures 12764 127659.120 'GERROR' -- Get last system error message 12766=============================================== 12767 12768_Description_: 12769 Returns the system error message corresponding to the last system 12770 error. This resembles the functionality of 'strerror(3)' in C. 12771 12772_Standard_: 12773 GNU extension 12774 12775_Class_: 12776 Subroutine 12777 12778_Syntax_: 12779 'CALL GERROR(RESULT)' 12780 12781_Arguments_: 12782 RESULT Shall of type 'CHARACTER' and of default 12783 12784_Example_: 12785 PROGRAM test_gerror 12786 CHARACTER(len=100) :: msg 12787 CALL gerror(msg) 12788 WRITE(*,*) msg 12789 END PROGRAM 12790 12791_See also_: 12792 *note IERRNO::, *note PERROR:: 12793 12794 12795File: gfortran.info, Node: GETARG, Next: GET_COMMAND, Prev: GERROR, Up: Intrinsic Procedures 12796 127979.121 'GETARG' -- Get command line arguments 12798============================================ 12799 12800_Description_: 12801 Retrieve the POS-th argument that was passed on the command line 12802 when the containing program was invoked. 12803 12804 This intrinsic routine is provided for backwards compatibility with 12805 GNU Fortran 77. In new code, programmers should consider the use 12806 of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the 12807 Fortran 2003 standard. 12808 12809_Standard_: 12810 GNU extension 12811 12812_Class_: 12813 Subroutine 12814 12815_Syntax_: 12816 'CALL GETARG(POS, VALUE)' 12817 12818_Arguments_: 12819 POS Shall be of type 'INTEGER' and not wider than 12820 the default integer kind; POS \geq 0 12821 VALUE Shall be of type 'CHARACTER' and of default 12822 kind. 12823 VALUE Shall be of type 'CHARACTER'. 12824 12825_Return value_: 12826 After 'GETARG' returns, the VALUE argument holds the POSth command 12827 line argument. If VALUE cannot hold the argument, it is truncated 12828 to fit the length of VALUE. If there are less than POS arguments 12829 specified at the command line, VALUE will be filled with blanks. 12830 If POS = 0, VALUE is set to the name of the program (on systems 12831 that support this feature). 12832 12833_Example_: 12834 PROGRAM test_getarg 12835 INTEGER :: i 12836 CHARACTER(len=32) :: arg 12837 12838 DO i = 1, iargc() 12839 CALL getarg(i, arg) 12840 WRITE (*,*) arg 12841 END DO 12842 END PROGRAM 12843 12844_See also_: 12845 GNU Fortran 77 compatibility function: *note IARGC:: Fortran 2003 12846 functions and subroutines: *note GET_COMMAND::, *note 12847 GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT:: 12848 12849 12850File: gfortran.info, Node: GET_COMMAND, Next: GET_COMMAND_ARGUMENT, Prev: GETARG, Up: Intrinsic Procedures 12851 128529.122 'GET_COMMAND' -- Get the entire command line 12853================================================== 12854 12855_Description_: 12856 Retrieve the entire command line that was used to invoke the 12857 program. 12858 12859_Standard_: 12860 Fortran 2003 and later 12861 12862_Class_: 12863 Subroutine 12864 12865_Syntax_: 12866 'CALL GET_COMMAND([COMMAND, LENGTH, STATUS])' 12867 12868_Arguments_: 12869 COMMAND (Optional) shall be of type 'CHARACTER' and of 12870 default kind. 12871 LENGTH (Optional) Shall be of type 'INTEGER' and of 12872 default kind. 12873 STATUS (Optional) Shall be of type 'INTEGER' and of 12874 default kind. 12875 12876_Return value_: 12877 If COMMAND is present, stores the entire command line that was used 12878 to invoke the program in COMMAND. If LENGTH is present, it is 12879 assigned the length of the command line. If STATUS is present, it 12880 is assigned 0 upon success of the command, -1 if COMMAND is too 12881 short to store the command line, or a positive value in case of an 12882 error. 12883 12884_Example_: 12885 PROGRAM test_get_command 12886 CHARACTER(len=255) :: cmd 12887 CALL get_command(cmd) 12888 WRITE (*,*) TRIM(cmd) 12889 END PROGRAM 12890 12891_See also_: 12892 *note GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT:: 12893 12894 12895File: gfortran.info, Node: GET_COMMAND_ARGUMENT, Next: GETCWD, Prev: GET_COMMAND, Up: Intrinsic Procedures 12896 128979.123 'GET_COMMAND_ARGUMENT' -- Get command line arguments 12898========================================================== 12899 12900_Description_: 12901 Retrieve the NUMBER-th argument that was passed on the command line 12902 when the containing program was invoked. 12903 12904_Standard_: 12905 Fortran 2003 and later 12906 12907_Class_: 12908 Subroutine 12909 12910_Syntax_: 12911 'CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])' 12912 12913_Arguments_: 12914 NUMBER Shall be a scalar of type 'INTEGER' and of 12915 default kind, NUMBER \geq 0 12916 VALUE (Optional) Shall be a scalar of type 'CHARACTER' 12917 and of default kind. 12918 LENGTH (Optional) Shall be a scalar of type 'INTEGER' 12919 and of default kind. 12920 STATUS (Optional) Shall be a scalar of type 'INTEGER' 12921 and of default kind. 12922 12923_Return value_: 12924 After 'GET_COMMAND_ARGUMENT' returns, the VALUE argument holds the 12925 NUMBER-th command line argument. If VALUE cannot hold the 12926 argument, it is truncated to fit the length of VALUE. If there are 12927 less than NUMBER arguments specified at the command line, VALUE 12928 will be filled with blanks. If NUMBER = 0, VALUE is set to the 12929 name of the program (on systems that support this feature). The 12930 LENGTH argument contains the length of the NUMBER-th command line 12931 argument. If the argument retrieval fails, STATUS is a positive 12932 number; if VALUE contains a truncated command line argument, STATUS 12933 is -1; and otherwise the STATUS is zero. 12934 12935_Example_: 12936 PROGRAM test_get_command_argument 12937 INTEGER :: i 12938 CHARACTER(len=32) :: arg 12939 12940 i = 0 12941 DO 12942 CALL get_command_argument(i, arg) 12943 IF (LEN_TRIM(arg) == 0) EXIT 12944 12945 WRITE (*,*) TRIM(arg) 12946 i = i+1 12947 END DO 12948 END PROGRAM 12949 12950_See also_: 12951 *note GET_COMMAND::, *note COMMAND_ARGUMENT_COUNT:: 12952 12953 12954File: gfortran.info, Node: GETCWD, Next: GETENV, Prev: GET_COMMAND_ARGUMENT, Up: Intrinsic Procedures 12955 129569.124 'GETCWD' -- Get current working directory 12957=============================================== 12958 12959_Description_: 12960 Get current working directory. 12961 12962 This intrinsic is provided in both subroutine and function forms; 12963 however, only one form can be used in any given program unit. 12964 12965_Standard_: 12966 GNU extension 12967 12968_Class_: 12969 Subroutine, function 12970 12971_Syntax_: 12972 'CALL GETCWD(C [, STATUS])' 12973 'STATUS = GETCWD(C)' 12974 12975_Arguments_: 12976 C The type shall be 'CHARACTER' and of default 12977 kind. 12978 STATUS (Optional) status flag. Returns 0 on success, a 12979 system specific and nonzero error code 12980 otherwise. 12981 12982_Example_: 12983 PROGRAM test_getcwd 12984 CHARACTER(len=255) :: cwd 12985 CALL getcwd(cwd) 12986 WRITE(*,*) TRIM(cwd) 12987 END PROGRAM 12988 12989_See also_: 12990 *note CHDIR:: 12991 12992 12993File: gfortran.info, Node: GETENV, Next: GET_ENVIRONMENT_VARIABLE, Prev: GETCWD, Up: Intrinsic Procedures 12994 129959.125 'GETENV' -- Get an environmental variable 12996=============================================== 12997 12998_Description_: 12999 Get the VALUE of the environmental variable NAME. 13000 13001 This intrinsic routine is provided for backwards compatibility with 13002 GNU Fortran 77. In new code, programmers should consider the use 13003 of the *note GET_ENVIRONMENT_VARIABLE:: intrinsic defined by the 13004 Fortran 2003 standard. 13005 13006 Note that 'GETENV' need not be thread-safe. It is the 13007 responsibility of the user to ensure that the environment is not 13008 being updated concurrently with a call to the 'GETENV' intrinsic. 13009 13010_Standard_: 13011 GNU extension 13012 13013_Class_: 13014 Subroutine 13015 13016_Syntax_: 13017 'CALL GETENV(NAME, VALUE)' 13018 13019_Arguments_: 13020 NAME Shall be of type 'CHARACTER' and of default 13021 kind. 13022 VALUE Shall be of type 'CHARACTER' and of default 13023 kind. 13024 13025_Return value_: 13026 Stores the value of NAME in VALUE. If VALUE is not large enough to 13027 hold the data, it is truncated. If NAME is not set, VALUE will be 13028 filled with blanks. 13029 13030_Example_: 13031 PROGRAM test_getenv 13032 CHARACTER(len=255) :: homedir 13033 CALL getenv("HOME", homedir) 13034 WRITE (*,*) TRIM(homedir) 13035 END PROGRAM 13036 13037_See also_: 13038 *note GET_ENVIRONMENT_VARIABLE:: 13039 13040 13041File: gfortran.info, Node: GET_ENVIRONMENT_VARIABLE, Next: GETGID, Prev: GETENV, Up: Intrinsic Procedures 13042 130439.126 'GET_ENVIRONMENT_VARIABLE' -- Get an environmental variable 13044================================================================= 13045 13046_Description_: 13047 Get the VALUE of the environmental variable NAME. 13048 13049 Note that 'GET_ENVIRONMENT_VARIABLE' need not be thread-safe. It 13050 is the responsibility of the user to ensure that the environment is 13051 not being updated concurrently with a call to the 13052 'GET_ENVIRONMENT_VARIABLE' intrinsic. 13053 13054_Standard_: 13055 Fortran 2003 and later 13056 13057_Class_: 13058 Subroutine 13059 13060_Syntax_: 13061 'CALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS, 13062 TRIM_NAME)' 13063 13064_Arguments_: 13065 NAME Shall be a scalar of type 'CHARACTER' and of 13066 default kind. 13067 VALUE (Optional) Shall be a scalar of type 'CHARACTER' 13068 and of default kind. 13069 LENGTH (Optional) Shall be a scalar of type 'INTEGER' 13070 and of default kind. 13071 STATUS (Optional) Shall be a scalar of type 'INTEGER' 13072 and of default kind. 13073 TRIM_NAME (Optional) Shall be a scalar of type 'LOGICAL' 13074 and of default kind. 13075 13076_Return value_: 13077 Stores the value of NAME in VALUE. If VALUE is not large enough to 13078 hold the data, it is truncated. If NAME is not set, VALUE will be 13079 filled with blanks. Argument LENGTH contains the length needed for 13080 storing the environment variable NAME or zero if it is not present. 13081 STATUS is -1 if VALUE is present but too short for the environment 13082 variable; it is 1 if the environment variable does not exist and 2 13083 if the processor does not support environment variables; in all 13084 other cases STATUS is zero. If TRIM_NAME is present with the value 13085 '.FALSE.', the trailing blanks in NAME are significant; otherwise 13086 they are not part of the environment variable name. 13087 13088_Example_: 13089 PROGRAM test_getenv 13090 CHARACTER(len=255) :: homedir 13091 CALL get_environment_variable("HOME", homedir) 13092 WRITE (*,*) TRIM(homedir) 13093 END PROGRAM 13094 13095 13096File: gfortran.info, Node: GETGID, Next: GETLOG, Prev: GET_ENVIRONMENT_VARIABLE, Up: Intrinsic Procedures 13097 130989.127 'GETGID' -- Group ID function 13099=================================== 13100 13101_Description_: 13102 Returns the numerical group ID of the current process. 13103 13104_Standard_: 13105 GNU extension 13106 13107_Class_: 13108 Function 13109 13110_Syntax_: 13111 'RESULT = GETGID()' 13112 13113_Return value_: 13114 The return value of 'GETGID' is an 'INTEGER' of the default kind. 13115 13116_Example_: 13117 See 'GETPID' for an example. 13118 13119_See also_: 13120 *note GETPID::, *note GETUID:: 13121 13122 13123File: gfortran.info, Node: GETLOG, Next: GETPID, Prev: GETGID, Up: Intrinsic Procedures 13124 131259.128 'GETLOG' -- Get login name 13126================================ 13127 13128_Description_: 13129 Gets the username under which the program is running. 13130 13131_Standard_: 13132 GNU extension 13133 13134_Class_: 13135 Subroutine 13136 13137_Syntax_: 13138 'CALL GETLOG(C)' 13139 13140_Arguments_: 13141 C Shall be of type 'CHARACTER' and of default 13142 kind. 13143 13144_Return value_: 13145 Stores the current user name in LOGIN. (On systems where POSIX 13146 functions 'geteuid' and 'getpwuid' are not available, and the 13147 'getlogin' function is not implemented either, this will return a 13148 blank string.) 13149 13150_Example_: 13151 PROGRAM TEST_GETLOG 13152 CHARACTER(32) :: login 13153 CALL GETLOG(login) 13154 WRITE(*,*) login 13155 END PROGRAM 13156 13157_See also_: 13158 *note GETUID:: 13159 13160 13161File: gfortran.info, Node: GETPID, Next: GETUID, Prev: GETLOG, Up: Intrinsic Procedures 13162 131639.129 'GETPID' -- Process ID function 13164===================================== 13165 13166_Description_: 13167 Returns the numerical process identifier of the current process. 13168 13169_Standard_: 13170 GNU extension 13171 13172_Class_: 13173 Function 13174 13175_Syntax_: 13176 'RESULT = GETPID()' 13177 13178_Return value_: 13179 The return value of 'GETPID' is an 'INTEGER' of the default kind. 13180 13181_Example_: 13182 program info 13183 print *, "The current process ID is ", getpid() 13184 print *, "Your numerical user ID is ", getuid() 13185 print *, "Your numerical group ID is ", getgid() 13186 end program info 13187 13188_See also_: 13189 *note GETGID::, *note GETUID:: 13190 13191 13192File: gfortran.info, Node: GETUID, Next: GMTIME, Prev: GETPID, Up: Intrinsic Procedures 13193 131949.130 'GETUID' -- User ID function 13195================================== 13196 13197_Description_: 13198 Returns the numerical user ID of the current process. 13199 13200_Standard_: 13201 GNU extension 13202 13203_Class_: 13204 Function 13205 13206_Syntax_: 13207 'RESULT = GETUID()' 13208 13209_Return value_: 13210 The return value of 'GETUID' is an 'INTEGER' of the default kind. 13211 13212_Example_: 13213 See 'GETPID' for an example. 13214 13215_See also_: 13216 *note GETPID::, *note GETLOG:: 13217 13218 13219File: gfortran.info, Node: GMTIME, Next: HOSTNM, Prev: GETUID, Up: Intrinsic Procedures 13220 132219.131 'GMTIME' -- Convert time to GMT info 13222========================================== 13223 13224_Description_: 13225 Given a system time value TIME (as provided by the *note TIME:: 13226 intrinsic), fills VALUES with values extracted from it appropriate 13227 to the UTC time zone (Universal Coordinated Time, also known in 13228 some countries as GMT, Greenwich Mean Time), using 'gmtime(3)'. 13229 13230 This intrinsic routine is provided for backwards compatibility with 13231 GNU Fortran 77. In new code, programmers should consider the use 13232 of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95 13233 standard. 13234 13235_Standard_: 13236 GNU extension 13237 13238_Class_: 13239 Subroutine 13240 13241_Syntax_: 13242 'CALL GMTIME(TIME, VALUES)' 13243 13244_Arguments_: 13245 TIME An 'INTEGER' scalar expression corresponding to 13246 a system time, with 'INTENT(IN)'. 13247 VALUES A default 'INTEGER' array with 9 elements, with 13248 'INTENT(OUT)'. 13249 13250_Return value_: 13251 The elements of VALUES are assigned as follows: 13252 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap 13253 seconds 13254 2. Minutes after the hour, range 0-59 13255 3. Hours past midnight, range 0-23 13256 4. Day of month, range 1-31 13257 5. Number of months since January, range 0-11 13258 6. Years since 1900 13259 7. Number of days since Sunday, range 0-6 13260 8. Days since January 1, range 0-365 13261 9. Daylight savings indicator: positive if daylight savings is in 13262 effect, zero if not, and negative if the information is not 13263 available. 13264 13265_See also_: 13266 *note DATE_AND_TIME::, *note CTIME::, *note LTIME::, *note TIME::, 13267 *note TIME8:: 13268 13269 13270File: gfortran.info, Node: HOSTNM, Next: HUGE, Prev: GMTIME, Up: Intrinsic Procedures 13271 132729.132 'HOSTNM' -- Get system host name 13273====================================== 13274 13275_Description_: 13276 Retrieves the host name of the system on which the program is 13277 running. 13278 13279 This intrinsic is provided in both subroutine and function forms; 13280 however, only one form can be used in any given program unit. 13281 13282_Standard_: 13283 GNU extension 13284 13285_Class_: 13286 Subroutine, function 13287 13288_Syntax_: 13289 'CALL HOSTNM(C [, STATUS])' 13290 'STATUS = HOSTNM(NAME)' 13291 13292_Arguments_: 13293 C Shall of type 'CHARACTER' and of default kind. 13294 STATUS (Optional) status flag of type 'INTEGER'. 13295 Returns 0 on success, or a system specific error 13296 code otherwise. 13297 13298_Return value_: 13299 In either syntax, NAME is set to the current hostname if it can be 13300 obtained, or to a blank string otherwise. 13301 13302 13303File: gfortran.info, Node: HUGE, Next: HYPOT, Prev: HOSTNM, Up: Intrinsic Procedures 13304 133059.133 'HUGE' -- Largest number of a kind 13306======================================== 13307 13308_Description_: 13309 'HUGE(X)' returns the largest number that is not an infinity in the 13310 model of the type of 'X'. 13311 13312_Standard_: 13313 Fortran 90 and later 13314 13315_Class_: 13316 Inquiry function 13317 13318_Syntax_: 13319 'RESULT = HUGE(X)' 13320 13321_Arguments_: 13322 X Shall be of type 'REAL' or 'INTEGER'. 13323 13324_Return value_: 13325 The return value is of the same type and kind as X 13326 13327_Example_: 13328 program test_huge_tiny 13329 print *, huge(0), huge(0.0), huge(0.0d0) 13330 print *, tiny(0.0), tiny(0.0d0) 13331 end program test_huge_tiny 13332 13333 13334File: gfortran.info, Node: HYPOT, Next: IACHAR, Prev: HUGE, Up: Intrinsic Procedures 13335 133369.134 'HYPOT' -- Euclidean distance function 13337============================================ 13338 13339_Description_: 13340 'HYPOT(X,Y)' is the Euclidean distance function. It is equal to 13341 \sqrt{X^2 + Y^2}, without undue underflow or overflow. 13342 13343_Standard_: 13344 Fortran 2008 and later 13345 13346_Class_: 13347 Elemental function 13348 13349_Syntax_: 13350 'RESULT = HYPOT(X, Y)' 13351 13352_Arguments_: 13353 X The type shall be 'REAL'. 13354 Y The type and kind type parameter shall be the 13355 same as X. 13356 13357_Return value_: 13358 The return value has the same type and kind type parameter as X. 13359 13360_Example_: 13361 program test_hypot 13362 real(4) :: x = 1.e0_4, y = 0.5e0_4 13363 x = hypot(x,y) 13364 end program test_hypot 13365 13366 13367File: gfortran.info, Node: IACHAR, Next: IALL, Prev: HYPOT, Up: Intrinsic Procedures 13368 133699.135 'IACHAR' -- Code in ASCII collating sequence 13370================================================== 13371 13372_Description_: 13373 'IACHAR(C)' returns the code for the ASCII character in the first 13374 character position of 'C'. 13375 13376_Standard_: 13377 Fortran 95 and later, with KIND argument Fortran 2003 and later 13378 13379_Class_: 13380 Elemental function 13381 13382_Syntax_: 13383 'RESULT = IACHAR(C [, KIND])' 13384 13385_Arguments_: 13386 C Shall be a scalar 'CHARACTER', with 'INTENT(IN)' 13387 KIND (Optional) An 'INTEGER' initialization 13388 expression indicating the kind parameter of the 13389 result. 13390 13391_Return value_: 13392 The return value is of type 'INTEGER' and of kind KIND. If KIND is 13393 absent, the return value is of default integer kind. 13394 13395_Example_: 13396 program test_iachar 13397 integer i 13398 i = iachar(' ') 13399 end program test_iachar 13400 13401_Note_: 13402 See *note ICHAR:: for a discussion of converting between numerical 13403 values and formatted string representations. 13404 13405_See also_: 13406 *note ACHAR::, *note CHAR::, *note ICHAR:: 13407 13408 13409File: gfortran.info, Node: IALL, Next: IAND, Prev: IACHAR, Up: Intrinsic Procedures 13410 134119.136 'IALL' -- Bitwise AND of array elements 13412============================================= 13413 13414_Description_: 13415 Reduces with bitwise AND the elements of ARRAY along dimension DIM 13416 if the corresponding element in MASK is 'TRUE'. 13417 13418_Standard_: 13419 Fortran 2008 and later 13420 13421_Class_: 13422 Transformational function 13423 13424_Syntax_: 13425 'RESULT = IALL(ARRAY[, MASK])' 13426 'RESULT = IALL(ARRAY, DIM[, MASK])' 13427 13428_Arguments_: 13429 ARRAY Shall be an array of type 'INTEGER' 13430 DIM (Optional) shall be a scalar of type 'INTEGER' 13431 with a value in the range from 1 to n, where n 13432 equals the rank of ARRAY. 13433 MASK (Optional) shall be of type 'LOGICAL' and either 13434 be a scalar or an array of the same shape as 13435 ARRAY. 13436 13437_Return value_: 13438 The result is of the same type as ARRAY. 13439 13440 If DIM is absent, a scalar with the bitwise ALL of all elements in 13441 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 13442 the rank of ARRAY, and a shape similar to that of ARRAY with 13443 dimension DIM dropped is returned. 13444 13445_Example_: 13446 PROGRAM test_iall 13447 INTEGER(1) :: a(2) 13448 13449 a(1) = b'00100100' 13450 a(2) = b'01101010' 13451 13452 ! prints 00100000 13453 PRINT '(b8.8)', IALL(a) 13454 END PROGRAM 13455 13456_See also_: 13457 *note IANY::, *note IPARITY::, *note IAND:: 13458 13459 13460File: gfortran.info, Node: IAND, Next: IANY, Prev: IALL, Up: Intrinsic Procedures 13461 134629.137 'IAND' -- Bitwise logical and 13463=================================== 13464 13465_Description_: 13466 Bitwise logical 'AND'. 13467 13468_Standard_: 13469 Fortran 90 and later, with boz-literal-constant Fortran 2008 and 13470 later, has overloads that are GNU extensions 13471 13472_Class_: 13473 Elemental function 13474 13475_Syntax_: 13476 'RESULT = IAND(I, J)' 13477 13478_Arguments_: 13479 I The type shall be 'INTEGER' or a 13480 boz-literal-constant. 13481 J The type shall be 'INTEGER' with the same kind 13482 type parameter as I or a boz-literal-constant. 13483 I and J shall not both be boz-literal-constants. 13484 13485_Return value_: 13486 The return type is 'INTEGER' with the kind type parameter of the 13487 arguments. A boz-literal-constant is converted to an 'INTEGER' 13488 with the kind type parameter of the other argument as-if a call to 13489 *note INT:: occurred. 13490 13491_Example_: 13492 PROGRAM test_iand 13493 INTEGER :: a, b 13494 DATA a / Z'F' /, b / Z'3' / 13495 WRITE (*,*) IAND(a, b) 13496 END PROGRAM 13497 13498_Specific names_: 13499 Name Argument Return type Standard 13500 'IAND(A)' 'INTEGER A' 'INTEGER' Fortran 90 and 13501 later 13502 'BIAND(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 13503 A' 13504 'IIAND(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 13505 A' 13506 'JIAND(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 13507 A' 13508 'KIAND(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 13509 A' 13510 13511_See also_: 13512 *note IOR::, *note IEOR::, *note IBITS::, *note IBSET::, *note 13513 IBCLR::, *note NOT:: 13514 13515 13516File: gfortran.info, Node: IANY, Next: IARGC, Prev: IAND, Up: Intrinsic Procedures 13517 135189.138 'IANY' -- Bitwise OR of array elements 13519============================================ 13520 13521_Description_: 13522 Reduces with bitwise OR (inclusive or) the elements of ARRAY along 13523 dimension DIM if the corresponding element in MASK is 'TRUE'. 13524 13525_Standard_: 13526 Fortran 2008 and later 13527 13528_Class_: 13529 Transformational function 13530 13531_Syntax_: 13532 'RESULT = IANY(ARRAY[, MASK])' 13533 'RESULT = IANY(ARRAY, DIM[, MASK])' 13534 13535_Arguments_: 13536 ARRAY Shall be an array of type 'INTEGER' 13537 DIM (Optional) shall be a scalar of type 'INTEGER' 13538 with a value in the range from 1 to n, where n 13539 equals the rank of ARRAY. 13540 MASK (Optional) shall be of type 'LOGICAL' and either 13541 be a scalar or an array of the same shape as 13542 ARRAY. 13543 13544_Return value_: 13545 The result is of the same type as ARRAY. 13546 13547 If DIM is absent, a scalar with the bitwise OR of all elements in 13548 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 13549 the rank of ARRAY, and a shape similar to that of ARRAY with 13550 dimension DIM dropped is returned. 13551 13552_Example_: 13553 PROGRAM test_iany 13554 INTEGER(1) :: a(2) 13555 13556 a(1) = b'00100100' 13557 a(2) = b'01101010' 13558 13559 ! prints 01101110 13560 PRINT '(b8.8)', IANY(a) 13561 END PROGRAM 13562 13563_See also_: 13564 *note IPARITY::, *note IALL::, *note IOR:: 13565 13566 13567File: gfortran.info, Node: IARGC, Next: IBCLR, Prev: IANY, Up: Intrinsic Procedures 13568 135699.139 'IARGC' -- Get the number of command line arguments 13570========================================================= 13571 13572_Description_: 13573 'IARGC' returns the number of arguments passed on the command line 13574 when the containing program was invoked. 13575 13576 This intrinsic routine is provided for backwards compatibility with 13577 GNU Fortran 77. In new code, programmers should consider the use 13578 of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the 13579 Fortran 2003 standard. 13580 13581_Standard_: 13582 GNU extension 13583 13584_Class_: 13585 Function 13586 13587_Syntax_: 13588 'RESULT = IARGC()' 13589 13590_Arguments_: 13591 None 13592 13593_Return value_: 13594 The number of command line arguments, type 'INTEGER(4)'. 13595 13596_Example_: 13597 See *note GETARG:: 13598 13599_See also_: 13600 GNU Fortran 77 compatibility subroutine: *note GETARG:: Fortran 13601 2003 functions and subroutines: *note GET_COMMAND::, *note 13602 GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT:: 13603 13604 13605File: gfortran.info, Node: IBCLR, Next: IBITS, Prev: IARGC, Up: Intrinsic Procedures 13606 136079.140 'IBCLR' -- Clear bit 13608========================== 13609 13610_Description_: 13611 'IBCLR' returns the value of I with the bit at position POS set to 13612 zero. 13613 13614_Standard_: 13615 Fortran 90 and later, has overloads that are GNU extensions 13616 13617_Class_: 13618 Elemental function 13619 13620_Syntax_: 13621 'RESULT = IBCLR(I, POS)' 13622 13623_Arguments_: 13624 I The type shall be 'INTEGER'. 13625 POS The type shall be 'INTEGER'. 13626 13627_Return value_: 13628 The return value is of type 'INTEGER' and of the same kind as I. 13629 13630_Specific names_: 13631 Name Argument Return type Standard 13632 'IBCLR(A)' 'INTEGER A' 'INTEGER' Fortran 90 and 13633 later 13634 'BBCLR(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 13635 A' 13636 'IIBCLR(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 13637 A' 13638 'JIBCLR(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 13639 A' 13640 'KIBCLR(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 13641 A' 13642 13643_See also_: 13644 *note IBITS::, *note IBSET::, *note IAND::, *note IOR::, *note 13645 IEOR::, *note MVBITS:: 13646 13647 13648File: gfortran.info, Node: IBITS, Next: IBSET, Prev: IBCLR, Up: Intrinsic Procedures 13649 136509.141 'IBITS' -- Bit extraction 13651=============================== 13652 13653_Description_: 13654 'IBITS' extracts a field of length LEN from I, starting from bit 13655 position POS and extending left for LEN bits. The result is 13656 right-justified and the remaining bits are zeroed. The value of 13657 'POS+LEN' must be less than or equal to the value 'BIT_SIZE(I)'. 13658 13659_Standard_: 13660 Fortran 90 and later, has overloads that are GNU extensions 13661 13662_Class_: 13663 Elemental function 13664 13665_Syntax_: 13666 'RESULT = IBITS(I, POS, LEN)' 13667 13668_Arguments_: 13669 I The type shall be 'INTEGER'. 13670 POS The type shall be 'INTEGER'. 13671 LEN The type shall be 'INTEGER'. 13672 13673_Return value_: 13674 The return value is of type 'INTEGER' and of the same kind as I. 13675 13676_Specific names_: 13677 Name Argument Return type Standard 13678 'IBITS(A)' 'INTEGER A' 'INTEGER' Fortran 90 and 13679 later 13680 'BBITS(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 13681 A' 13682 'IIBITS(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 13683 A' 13684 'JIBITS(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 13685 A' 13686 'KIBITS(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 13687 A' 13688 13689_See also_: 13690 *note BIT_SIZE::, *note IBCLR::, *note IBSET::, *note IAND::, *note 13691 IOR::, *note IEOR:: 13692 13693 13694File: gfortran.info, Node: IBSET, Next: ICHAR, Prev: IBITS, Up: Intrinsic Procedures 13695 136969.142 'IBSET' -- Set bit 13697======================== 13698 13699_Description_: 13700 'IBSET' returns the value of I with the bit at position POS set to 13701 one. 13702 13703_Standard_: 13704 Fortran 90 and later, has overloads that are GNU extensions 13705 13706_Class_: 13707 Elemental function 13708 13709_Syntax_: 13710 'RESULT = IBSET(I, POS)' 13711 13712_Arguments_: 13713 I The type shall be 'INTEGER'. 13714 POS The type shall be 'INTEGER'. 13715 13716_Return value_: 13717 The return value is of type 'INTEGER' and of the same kind as I. 13718 13719_Specific names_: 13720 Name Argument Return type Standard 13721 'IBSET(A)' 'INTEGER A' 'INTEGER' Fortran 90 and 13722 later 13723 'BBSET(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 13724 A' 13725 'IIBSET(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 13726 A' 13727 'JIBSET(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 13728 A' 13729 'KIBSET(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 13730 A' 13731 13732_See also_: 13733 *note IBCLR::, *note IBITS::, *note IAND::, *note IOR::, *note 13734 IEOR::, *note MVBITS:: 13735 13736 13737File: gfortran.info, Node: ICHAR, Next: IDATE, Prev: IBSET, Up: Intrinsic Procedures 13738 137399.143 'ICHAR' -- Character-to-integer conversion function 13740========================================================= 13741 13742_Description_: 13743 'ICHAR(C)' returns the code for the character in the first 13744 character position of 'C' in the system's native character set. 13745 The correspondence between characters and their codes is not 13746 necessarily the same across different GNU Fortran implementations. 13747 13748_Standard_: 13749 Fortran 77 and later, with KIND argument Fortran 2003 and later 13750 13751_Class_: 13752 Elemental function 13753 13754_Syntax_: 13755 'RESULT = ICHAR(C [, KIND])' 13756 13757_Arguments_: 13758 C Shall be a scalar 'CHARACTER', with 'INTENT(IN)' 13759 KIND (Optional) An 'INTEGER' initialization 13760 expression indicating the kind parameter of the 13761 result. 13762 13763_Return value_: 13764 The return value is of type 'INTEGER' and of kind KIND. If KIND is 13765 absent, the return value is of default integer kind. 13766 13767_Example_: 13768 program test_ichar 13769 integer i 13770 i = ichar(' ') 13771 end program test_ichar 13772 13773_Specific names_: 13774 Name Argument Return type Standard 13775 'ICHAR(C)' 'CHARACTER 'INTEGER(4)' Fortran 77 and 13776 C' later 13777 13778_Note_: 13779 No intrinsic exists to convert between a numeric value and a 13780 formatted character string representation - for instance, given the 13781 'CHARACTER' value ''154'', obtaining an 'INTEGER' or 'REAL' value 13782 with the value 154, or vice versa. Instead, this functionality is 13783 provided by internal-file I/O, as in the following example: 13784 program read_val 13785 integer value 13786 character(len=10) string, string2 13787 string = '154' 13788 13789 ! Convert a string to a numeric value 13790 read (string,'(I10)') value 13791 print *, value 13792 13793 ! Convert a value to a formatted string 13794 write (string2,'(I10)') value 13795 print *, string2 13796 end program read_val 13797 13798_See also_: 13799 *note ACHAR::, *note CHAR::, *note IACHAR:: 13800 13801 13802File: gfortran.info, Node: IDATE, Next: IEOR, Prev: ICHAR, Up: Intrinsic Procedures 13803 138049.144 'IDATE' -- Get current local time subroutine (day/month/year) 13805=================================================================== 13806 13807_Description_: 13808 'IDATE(VALUES)' Fills VALUES with the numerical values at the 13809 current local time. The day (in the range 1-31), month (in the 13810 range 1-12), and year appear in elements 1, 2, and 3 of VALUES, 13811 respectively. The year has four significant digits. 13812 13813 This intrinsic routine is provided for backwards compatibility with 13814 GNU Fortran 77. In new code, programmers should consider the use 13815 of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95 13816 standard. 13817 13818_Standard_: 13819 GNU extension 13820 13821_Class_: 13822 Subroutine 13823 13824_Syntax_: 13825 'CALL IDATE(VALUES)' 13826 13827_Arguments_: 13828 VALUES The type shall be 'INTEGER, DIMENSION(3)' and 13829 the kind shall be the default integer kind. 13830 13831_Return value_: 13832 Does not return anything. 13833 13834_Example_: 13835 program test_idate 13836 integer, dimension(3) :: tarray 13837 call idate(tarray) 13838 print *, tarray(1) 13839 print *, tarray(2) 13840 print *, tarray(3) 13841 end program test_idate 13842 13843_See also_: 13844 *note DATE_AND_TIME:: 13845 13846 13847File: gfortran.info, Node: IEOR, Next: IERRNO, Prev: IDATE, Up: Intrinsic Procedures 13848 138499.145 'IEOR' -- Bitwise logical exclusive or 13850============================================ 13851 13852_Description_: 13853 'IEOR' returns the bitwise Boolean exclusive-OR of I and J. 13854 13855_Standard_: 13856 Fortran 90 and later, with boz-literal-constant Fortran 2008 and 13857 later, has overloads that are GNU extensions 13858 13859_Class_: 13860 Elemental function 13861 13862_Syntax_: 13863 'RESULT = IEOR(I, J)' 13864 13865_Arguments_: 13866 I The type shall be 'INTEGER' or a 13867 boz-literal-constant. 13868 J The type shall be 'INTEGER' with the same kind 13869 type parameter as I or a boz-literal-constant. 13870 I and J shall not both be boz-literal-constants. 13871 13872_Return value_: 13873 The return type is 'INTEGER' with the kind type parameter of the 13874 arguments. A boz-literal-constant is converted to an 'INTEGER' 13875 with the kind type parameter of the other argument as-if a call to 13876 *note INT:: occurred. 13877 13878_Specific names_: 13879 Name Argument Return type Standard 13880 'IEOR(A)' 'INTEGER A' 'INTEGER' Fortran 90 and 13881 later 13882 'BIEOR(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 13883 A' 13884 'IIEOR(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 13885 A' 13886 'JIEOR(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 13887 A' 13888 'KIEOR(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 13889 A' 13890 13891_See also_: 13892 *note IOR::, *note IAND::, *note IBITS::, *note IBSET::, *note 13893 IBCLR::, *note NOT:: 13894 13895 13896File: gfortran.info, Node: IERRNO, Next: IMAGE_INDEX, Prev: IEOR, Up: Intrinsic Procedures 13897 138989.146 'IERRNO' -- Get the last system error number 13899================================================== 13900 13901_Description_: 13902 Returns the last system error number, as given by the C 'errno' 13903 variable. 13904 13905_Standard_: 13906 GNU extension 13907 13908_Class_: 13909 Function 13910 13911_Syntax_: 13912 'RESULT = IERRNO()' 13913 13914_Arguments_: 13915 None 13916 13917_Return value_: 13918 The return value is of type 'INTEGER' and of the default integer 13919 kind. 13920 13921_See also_: 13922 *note PERROR:: 13923 13924 13925File: gfortran.info, Node: IMAGE_INDEX, Next: INDEX intrinsic, Prev: IERRNO, Up: Intrinsic Procedures 13926 139279.147 'IMAGE_INDEX' -- Function that converts a cosubscript to an image index 13928============================================================================= 13929 13930_Description_: 13931 Returns the image index belonging to a cosubscript. 13932 13933_Standard_: 13934 Fortran 2008 and later 13935 13936_Class_: 13937 Inquiry function. 13938 13939_Syntax_: 13940 'RESULT = IMAGE_INDEX(COARRAY, SUB)' 13941 13942_Arguments_: 13943 COARRAY Coarray of any type. 13944 SUB default integer rank-1 array of a size equal to 13945 the corank of COARRAY. 13946 13947_Return value_: 13948 Scalar default integer with the value of the image index which 13949 corresponds to the cosubscripts. For invalid cosubscripts the 13950 result is zero. 13951 13952_Example_: 13953 INTEGER :: array[2,-1:4,8,*] 13954 ! Writes 28 (or 0 if there are fewer than 28 images) 13955 WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1]) 13956 13957_See also_: 13958 *note THIS_IMAGE::, *note NUM_IMAGES:: 13959 13960 13961File: gfortran.info, Node: INDEX intrinsic, Next: INT, Prev: IMAGE_INDEX, Up: Intrinsic Procedures 13962 139639.148 'INDEX' -- Position of a substring within a string 13964======================================================== 13965 13966_Description_: 13967 Returns the position of the start of the first occurrence of string 13968 SUBSTRING as a substring in STRING, counting from one. If 13969 SUBSTRING is not present in STRING, zero is returned. If the BACK 13970 argument is present and true, the return value is the start of the 13971 last occurrence rather than the first. 13972 13973_Standard_: 13974 Fortran 77 and later, with KIND argument Fortran 2003 and later 13975 13976_Class_: 13977 Elemental function 13978 13979_Syntax_: 13980 'RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])' 13981 13982_Arguments_: 13983 STRING Shall be a scalar 'CHARACTER', with 'INTENT(IN)' 13984 SUBSTRING Shall be a scalar 'CHARACTER', with 'INTENT(IN)' 13985 BACK (Optional) Shall be a scalar 'LOGICAL', with 13986 'INTENT(IN)' 13987 KIND (Optional) An 'INTEGER' initialization 13988 expression indicating the kind parameter of the 13989 result. 13990 13991_Return value_: 13992 The return value is of type 'INTEGER' and of kind KIND. If KIND is 13993 absent, the return value is of default integer kind. 13994 13995_Specific names_: 13996 Name Argument Return type Standard 13997 'INDEX(STRING, 'CHARACTER' 'INTEGER(4)' Fortran 77 and 13998 SUBSTRING)' later 13999 14000_See also_: 14001 *note SCAN::, *note VERIFY:: 14002 14003 14004File: gfortran.info, Node: INT, Next: INT2, Prev: INDEX intrinsic, Up: Intrinsic Procedures 14005 140069.149 'INT' -- Convert to integer type 14007====================================== 14008 14009_Description_: 14010 Convert to integer type 14011 14012_Standard_: 14013 Fortran 77 and later, with boz-literal-constant Fortran 2008 and 14014 later. 14015 14016_Class_: 14017 Elemental function 14018 14019_Syntax_: 14020 'RESULT = INT(A [, KIND))' 14021 14022_Arguments_: 14023 A Shall be of type 'INTEGER', 'REAL', or 'COMPLEX' 14024 or or a boz-literal-constant. 14025 KIND (Optional) An 'INTEGER' initialization 14026 expression indicating the kind parameter of the 14027 result. 14028 14029_Return value_: 14030 These functions return a 'INTEGER' variable or array under the 14031 following rules: 14032 14033 (A) 14034 If A is of type 'INTEGER', 'INT(A) = A' 14035 (B) 14036 If A is of type 'REAL' and |A| < 1, 'INT(A)' equals '0'. If 14037 |A| \geq 1, then 'INT(A)' is the integer whose magnitude is 14038 the largest integer that does not exceed the magnitude of A 14039 and whose sign is the same as the sign of A. 14040 (C) 14041 If A is of type 'COMPLEX', rule B is applied to the real part 14042 of A. 14043 14044_Example_: 14045 program test_int 14046 integer :: i = 42 14047 complex :: z = (-3.7, 1.0) 14048 print *, int(i) 14049 print *, int(z), int(z,8) 14050 end program 14051 14052_Specific names_: 14053 Name Argument Return type Standard 14054 'INT(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and 14055 later 14056 'IFIX(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and 14057 later 14058 'IDINT(A)' 'REAL(8) A' 'INTEGER' Fortran 77 and 14059 later 14060 14061 14062File: gfortran.info, Node: INT2, Next: INT8, Prev: INT, Up: Intrinsic Procedures 14063 140649.150 'INT2' -- Convert to 16-bit integer type 14065============================================== 14066 14067_Description_: 14068 Convert to a 'KIND=2' integer type. This is equivalent to the 14069 standard 'INT' intrinsic with an optional argument of 'KIND=2', and 14070 is only included for backwards compatibility. 14071 14072 The 'SHORT' intrinsic is equivalent to 'INT2'. 14073 14074_Standard_: 14075 GNU extension 14076 14077_Class_: 14078 Elemental function 14079 14080_Syntax_: 14081 'RESULT = INT2(A)' 14082 14083_Arguments_: 14084 A Shall be of type 'INTEGER', 'REAL', or 14085 'COMPLEX'. 14086 14087_Return value_: 14088 The return value is a 'INTEGER(2)' variable. 14089 14090_See also_: 14091 *note INT::, *note INT8::, *note LONG:: 14092 14093 14094File: gfortran.info, Node: INT8, Next: IOR, Prev: INT2, Up: Intrinsic Procedures 14095 140969.151 'INT8' -- Convert to 64-bit integer type 14097============================================== 14098 14099_Description_: 14100 Convert to a 'KIND=8' integer type. This is equivalent to the 14101 standard 'INT' intrinsic with an optional argument of 'KIND=8', and 14102 is only included for backwards compatibility. 14103 14104_Standard_: 14105 GNU extension 14106 14107_Class_: 14108 Elemental function 14109 14110_Syntax_: 14111 'RESULT = INT8(A)' 14112 14113_Arguments_: 14114 A Shall be of type 'INTEGER', 'REAL', or 14115 'COMPLEX'. 14116 14117_Return value_: 14118 The return value is a 'INTEGER(8)' variable. 14119 14120_See also_: 14121 *note INT::, *note INT2::, *note LONG:: 14122 14123 14124File: gfortran.info, Node: IOR, Next: IPARITY, Prev: INT8, Up: Intrinsic Procedures 14125 141269.152 'IOR' -- Bitwise logical or 14127================================= 14128 14129_Description_: 14130 'IOR' returns the bitwise Boolean inclusive-OR of I and J. 14131 14132_Standard_: 14133 Fortran 90 and later, with boz-literal-constant Fortran 2008 and 14134 later, has overloads that are GNU extensions 14135 14136_Class_: 14137 Elemental function 14138 14139_Syntax_: 14140 'RESULT = IOR(I, J)' 14141 14142_Arguments_: 14143 I The type shall be 'INTEGER' or a 14144 boz-literal-constant. 14145 J The type shall be 'INTEGER' with the same kind 14146 type parameter as I or a boz-literal-constant. 14147 I and J shall not both be boz-literal-constants. 14148 14149_Return value_: 14150 The return type is 'INTEGER' with the kind type parameter of the 14151 arguments. A boz-literal-constant is converted to an 'INTEGER' 14152 with the kind type parameter of the other argument as-if a call to 14153 *note INT:: occurred. 14154 14155_Specific names_: 14156 Name Argument Return type Standard 14157 'IOR(A)' 'INTEGER A' 'INTEGER' Fortran 90 and 14158 later 14159 'BIOR(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 14160 A' 14161 'IIOR(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 14162 A' 14163 'JIOR(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 14164 A' 14165 'KIOR(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 14166 A' 14167 14168_See also_: 14169 *note IEOR::, *note IAND::, *note IBITS::, *note IBSET::, *note 14170 IBCLR::, *note NOT:: 14171 14172 14173File: gfortran.info, Node: IPARITY, Next: IRAND, Prev: IOR, Up: Intrinsic Procedures 14174 141759.153 'IPARITY' -- Bitwise XOR of array elements 14176================================================ 14177 14178_Description_: 14179 Reduces with bitwise XOR (exclusive or) the elements of ARRAY along 14180 dimension DIM if the corresponding element in MASK is 'TRUE'. 14181 14182_Standard_: 14183 Fortran 2008 and later 14184 14185_Class_: 14186 Transformational function 14187 14188_Syntax_: 14189 'RESULT = IPARITY(ARRAY[, MASK])' 14190 'RESULT = IPARITY(ARRAY, DIM[, MASK])' 14191 14192_Arguments_: 14193 ARRAY Shall be an array of type 'INTEGER' 14194 DIM (Optional) shall be a scalar of type 'INTEGER' 14195 with a value in the range from 1 to n, where n 14196 equals the rank of ARRAY. 14197 MASK (Optional) shall be of type 'LOGICAL' and either 14198 be a scalar or an array of the same shape as 14199 ARRAY. 14200 14201_Return value_: 14202 The result is of the same type as ARRAY. 14203 14204 If DIM is absent, a scalar with the bitwise XOR of all elements in 14205 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 14206 the rank of ARRAY, and a shape similar to that of ARRAY with 14207 dimension DIM dropped is returned. 14208 14209_Example_: 14210 PROGRAM test_iparity 14211 INTEGER(1) :: a(2) 14212 14213 a(1) = int(b'00100100', 1) 14214 a(2) = int(b'01101010', 1) 14215 14216 ! prints 01001110 14217 PRINT '(b8.8)', IPARITY(a) 14218 END PROGRAM 14219 14220_See also_: 14221 *note IANY::, *note IALL::, *note IEOR::, *note PARITY:: 14222 14223 14224File: gfortran.info, Node: IRAND, Next: IS_CONTIGUOUS, Prev: IPARITY, Up: Intrinsic Procedures 14225 142269.154 'IRAND' -- Integer pseudo-random number 14227============================================= 14228 14229_Description_: 14230 'IRAND(FLAG)' returns a pseudo-random number from a uniform 14231 distribution between 0 and a system-dependent limit (which is in 14232 most cases 2147483647). If FLAG is 0, the next number in the 14233 current sequence is returned; if FLAG is 1, the generator is 14234 restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is 14235 used as a new seed with 'SRAND'. 14236 14237 This intrinsic routine is provided for backwards compatibility with 14238 GNU Fortran 77. It implements a simple modulo generator as 14239 provided by 'g77'. For new code, one should consider the use of 14240 *note RANDOM_NUMBER:: as it implements a superior algorithm. 14241 14242_Standard_: 14243 GNU extension 14244 14245_Class_: 14246 Function 14247 14248_Syntax_: 14249 'RESULT = IRAND(I)' 14250 14251_Arguments_: 14252 I Shall be a scalar 'INTEGER' of kind 4. 14253 14254_Return value_: 14255 The return value is of 'INTEGER(kind=4)' type. 14256 14257_Example_: 14258 program test_irand 14259 integer,parameter :: seed = 86456 14260 14261 call srand(seed) 14262 print *, irand(), irand(), irand(), irand() 14263 print *, irand(seed), irand(), irand(), irand() 14264 end program test_irand 14265 14266 14267File: gfortran.info, Node: IS_CONTIGUOUS, Next: IS_IOSTAT_END, Prev: IRAND, Up: Intrinsic Procedures 14268 142699.155 'IS_CONTIGUOUS' -- Test whether an array is contiguous 14270============================================================ 14271 14272_Description_: 14273 'IS_CONTIGUOUS' tests whether an array is contiguous. 14274 14275_Standard_: 14276 Fortran 2008 and later 14277 14278_Class_: 14279 Inquiry function 14280 14281_Syntax_: 14282 'RESULT = IS_CONTIGUOUS(ARRAY)' 14283 14284_Arguments_: 14285 ARRAY Shall be an array of any type. 14286 14287_Return value_: 14288 Returns a 'LOGICAL' of the default kind, which '.TRUE.' if ARRAY is 14289 contiguous and false otherwise. 14290 14291_Example_: 14292 program test 14293 integer :: a(10) 14294 a = [1,2,3,4,5,6,7,8,9,10] 14295 call sub (a) ! every element, is contiguous 14296 call sub (a(::2)) ! every other element, is noncontiguous 14297 contains 14298 subroutine sub (x) 14299 integer :: x(:) 14300 if (is_contiguous (x)) then 14301 write (*,*) 'X is contiguous' 14302 else 14303 write (*,*) 'X is not contiguous' 14304 end if 14305 end subroutine sub 14306 end program test 14307 14308 14309File: gfortran.info, Node: IS_IOSTAT_END, Next: IS_IOSTAT_EOR, Prev: IS_CONTIGUOUS, Up: Intrinsic Procedures 14310 143119.156 'IS_IOSTAT_END' -- Test for end-of-file value 14312=================================================== 14313 14314_Description_: 14315 'IS_IOSTAT_END' tests whether an variable has the value of the I/O 14316 status "end of file". The function is equivalent to comparing the 14317 variable with the 'IOSTAT_END' parameter of the intrinsic module 14318 'ISO_FORTRAN_ENV'. 14319 14320_Standard_: 14321 Fortran 2003 and later 14322 14323_Class_: 14324 Elemental function 14325 14326_Syntax_: 14327 'RESULT = IS_IOSTAT_END(I)' 14328 14329_Arguments_: 14330 I Shall be of the type 'INTEGER'. 14331 14332_Return value_: 14333 Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has 14334 the value which indicates an end of file condition for 'IOSTAT=' 14335 specifiers, and is '.FALSE.' otherwise. 14336 14337_Example_: 14338 PROGRAM iostat 14339 IMPLICIT NONE 14340 INTEGER :: stat, i 14341 OPEN(88, FILE='test.dat') 14342 READ(88, *, IOSTAT=stat) i 14343 IF(IS_IOSTAT_END(stat)) STOP 'END OF FILE' 14344 END PROGRAM 14345 14346 14347File: gfortran.info, Node: IS_IOSTAT_EOR, Next: ISATTY, Prev: IS_IOSTAT_END, Up: Intrinsic Procedures 14348 143499.157 'IS_IOSTAT_EOR' -- Test for end-of-record value 14350===================================================== 14351 14352_Description_: 14353 'IS_IOSTAT_EOR' tests whether an variable has the value of the I/O 14354 status "end of record". The function is equivalent to comparing 14355 the variable with the 'IOSTAT_EOR' parameter of the intrinsic 14356 module 'ISO_FORTRAN_ENV'. 14357 14358_Standard_: 14359 Fortran 2003 and later 14360 14361_Class_: 14362 Elemental function 14363 14364_Syntax_: 14365 'RESULT = IS_IOSTAT_EOR(I)' 14366 14367_Arguments_: 14368 I Shall be of the type 'INTEGER'. 14369 14370_Return value_: 14371 Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has 14372 the value which indicates an end of file condition for 'IOSTAT=' 14373 specifiers, and is '.FALSE.' otherwise. 14374 14375_Example_: 14376 PROGRAM iostat 14377 IMPLICIT NONE 14378 INTEGER :: stat, i(50) 14379 OPEN(88, FILE='test.dat', FORM='UNFORMATTED') 14380 READ(88, IOSTAT=stat) i 14381 IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD' 14382 END PROGRAM 14383 14384 14385File: gfortran.info, Node: ISATTY, Next: ISHFT, Prev: IS_IOSTAT_EOR, Up: Intrinsic Procedures 14386 143879.158 'ISATTY' -- Whether a unit is a terminal device. 14388====================================================== 14389 14390_Description_: 14391 Determine whether a unit is connected to a terminal device. 14392 14393_Standard_: 14394 GNU extension 14395 14396_Class_: 14397 Function 14398 14399_Syntax_: 14400 'RESULT = ISATTY(UNIT)' 14401 14402_Arguments_: 14403 UNIT Shall be a scalar 'INTEGER'. 14404 14405_Return value_: 14406 Returns '.TRUE.' if the UNIT is connected to a terminal device, 14407 '.FALSE.' otherwise. 14408 14409_Example_: 14410 PROGRAM test_isatty 14411 INTEGER(kind=1) :: unit 14412 DO unit = 1, 10 14413 write(*,*) isatty(unit=unit) 14414 END DO 14415 END PROGRAM 14416_See also_: 14417 *note TTYNAM:: 14418 14419 14420File: gfortran.info, Node: ISHFT, Next: ISHFTC, Prev: ISATTY, Up: Intrinsic Procedures 14421 144229.159 'ISHFT' -- Shift bits 14423=========================== 14424 14425_Description_: 14426 'ISHFT' returns a value corresponding to I with all of the bits 14427 shifted SHIFT places. A value of SHIFT greater than zero 14428 corresponds to a left shift, a value of zero corresponds to no 14429 shift, and a value less than zero corresponds to a right shift. If 14430 the absolute value of SHIFT is greater than 'BIT_SIZE(I)', the 14431 value is undefined. Bits shifted out from the left end or right 14432 end are lost; zeros are shifted in from the opposite end. 14433 14434_Standard_: 14435 Fortran 90 and later, has overloads that are GNU extensions 14436 14437_Class_: 14438 Elemental function 14439 14440_Syntax_: 14441 'RESULT = ISHFT(I, SHIFT)' 14442 14443_Arguments_: 14444 I The type shall be 'INTEGER'. 14445 SHIFT The type shall be 'INTEGER'. 14446 14447_Return value_: 14448 The return value is of type 'INTEGER' and of the same kind as I. 14449 14450_Specific names_: 14451 Name Argument Return type Standard 14452 'ISHFT(A)' 'INTEGER A' 'INTEGER' Fortran 90 and 14453 later 14454 'BSHFT(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 14455 A' 14456 'IISHFT(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 14457 A' 14458 'JISHFT(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 14459 A' 14460 'KISHFT(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 14461 A' 14462 14463_See also_: 14464 *note ISHFTC:: 14465 14466 14467File: gfortran.info, Node: ISHFTC, Next: ISNAN, Prev: ISHFT, Up: Intrinsic Procedures 14468 144699.160 'ISHFTC' -- Shift bits circularly 14470======================================= 14471 14472_Description_: 14473 'ISHFTC' returns a value corresponding to I with the rightmost SIZE 14474 bits shifted circularly SHIFT places; that is, bits shifted out one 14475 end are shifted into the opposite end. A value of SHIFT greater 14476 than zero corresponds to a left shift, a value of zero corresponds 14477 to no shift, and a value less than zero corresponds to a right 14478 shift. The absolute value of SHIFT must be less than SIZE. If the 14479 SIZE argument is omitted, it is taken to be equivalent to 14480 'BIT_SIZE(I)'. 14481 14482_Standard_: 14483 Fortran 90 and later, has overloads that are GNU extensions 14484 14485_Class_: 14486 Elemental function 14487 14488_Syntax_: 14489 'RESULT = ISHFTC(I, SHIFT [, SIZE])' 14490 14491_Arguments_: 14492 I The type shall be 'INTEGER'. 14493 SHIFT The type shall be 'INTEGER'. 14494 SIZE (Optional) The type shall be 'INTEGER'; the 14495 value must be greater than zero and less than or 14496 equal to 'BIT_SIZE(I)'. 14497 14498_Return value_: 14499 The return value is of type 'INTEGER' and of the same kind as I. 14500 14501_Specific names_: 14502 Name Argument Return type Standard 14503 'ISHFTC(A)' 'INTEGER A' 'INTEGER' Fortran 90 and 14504 later 14505 'BSHFTC(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 14506 A' 14507 'IISHFTC(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 14508 A' 14509 'JISHFTC(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 14510 A' 14511 'KISHFTC(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 14512 A' 14513 14514_See also_: 14515 *note ISHFT:: 14516 14517 14518File: gfortran.info, Node: ISNAN, Next: ITIME, Prev: ISHFTC, Up: Intrinsic Procedures 14519 145209.161 'ISNAN' -- Test for a NaN 14521=============================== 14522 14523_Description_: 14524 'ISNAN' tests whether a floating-point value is an IEEE 14525 Not-a-Number (NaN). 14526_Standard_: 14527 GNU extension 14528 14529_Class_: 14530 Elemental function 14531 14532_Syntax_: 14533 'ISNAN(X)' 14534 14535_Arguments_: 14536 X Variable of the type 'REAL'. 14537 14538 14539_Return value_: 14540 Returns a default-kind 'LOGICAL'. The returned value is 'TRUE' if 14541 X is a NaN and 'FALSE' otherwise. 14542 14543_Example_: 14544 program test_nan 14545 implicit none 14546 real :: x 14547 x = -1.0 14548 x = sqrt(x) 14549 if (isnan(x)) stop '"x" is a NaN' 14550 end program test_nan 14551 14552 14553File: gfortran.info, Node: ITIME, Next: KILL, Prev: ISNAN, Up: Intrinsic Procedures 14554 145559.162 'ITIME' -- Get current local time subroutine (hour/minutes/seconds) 14556========================================================================= 14557 14558_Description_: 14559 'ITIME(VALUES)' Fills VALUES with the numerical values at the 14560 current local time. The hour (in the range 1-24), minute (in the 14561 range 1-60), and seconds (in the range 1-60) appear in elements 1, 14562 2, and 3 of VALUES, respectively. 14563 14564 This intrinsic routine is provided for backwards compatibility with 14565 GNU Fortran 77. In new code, programmers should consider the use 14566 of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95 14567 standard. 14568 14569_Standard_: 14570 GNU extension 14571 14572_Class_: 14573 Subroutine 14574 14575_Syntax_: 14576 'CALL ITIME(VALUES)' 14577 14578_Arguments_: 14579 VALUES The type shall be 'INTEGER, DIMENSION(3)' and 14580 the kind shall be the default integer kind. 14581 14582_Return value_: 14583 Does not return anything. 14584 14585_Example_: 14586 program test_itime 14587 integer, dimension(3) :: tarray 14588 call itime(tarray) 14589 print *, tarray(1) 14590 print *, tarray(2) 14591 print *, tarray(3) 14592 end program test_itime 14593 14594_See also_: 14595 *note DATE_AND_TIME:: 14596 14597 14598File: gfortran.info, Node: KILL, Next: KIND, Prev: ITIME, Up: Intrinsic Procedures 14599 146009.163 'KILL' -- Send a signal to a process 14601========================================== 14602 14603_Description_: 14604 Sends the signal specified by SIG to the process PID. See 14605 'kill(2)'. 14606 14607 This intrinsic is provided in both subroutine and function forms; 14608 however, only one form can be used in any given program unit. 14609_Standard_: 14610 GNU extension 14611 14612_Standard_: 14613 GNU extension 14614 14615_Class_: 14616 Subroutine, function 14617 14618_Syntax_: 14619 'CALL KILL(PID, SIG [, STATUS])' 14620 'STATUS = KILL(PID, SIG)' 14621 14622_Arguments_: 14623 PID Shall be a scalar 'INTEGER' with 'INTENT(IN)'. 14624 SIG Shall be a scalar 'INTEGER' with 'INTENT(IN)'. 14625 STATUS [Subroutine](Optional) Shall be a scalar 14626 'INTEGER'. Returns 0 on success; otherwise a 14627 system-specific error code is returned. 14628 STATUS [Function] The kind type parameter is that of 14629 'pid'. Returns 0 on success; otherwise a 14630 system-specific error code is returned. 14631 14632_See also_: 14633 *note ABORT::, *note EXIT:: 14634 14635 14636File: gfortran.info, Node: KIND, Next: LBOUND, Prev: KILL, Up: Intrinsic Procedures 14637 146389.164 'KIND' -- Kind of an entity 14639================================= 14640 14641_Description_: 14642 'KIND(X)' returns the kind value of the entity X. 14643 14644_Standard_: 14645 Fortran 95 and later 14646 14647_Class_: 14648 Inquiry function 14649 14650_Syntax_: 14651 'K = KIND(X)' 14652 14653_Arguments_: 14654 X Shall be of type 'LOGICAL', 'INTEGER', 'REAL', 14655 'COMPLEX' or 'CHARACTER'. It may be scalar or 14656 array valued. 14657 14658_Return value_: 14659 The return value is a scalar of type 'INTEGER' and of the default 14660 integer kind. 14661 14662_Example_: 14663 program test_kind 14664 integer,parameter :: kc = kind(' ') 14665 integer,parameter :: kl = kind(.true.) 14666 14667 print *, "The default character kind is ", kc 14668 print *, "The default logical kind is ", kl 14669 end program test_kind 14670 14671 14672File: gfortran.info, Node: LBOUND, Next: LCOBOUND, Prev: KIND, Up: Intrinsic Procedures 14673 146749.165 'LBOUND' -- Lower dimension bounds of an array 14675==================================================== 14676 14677_Description_: 14678 Returns the lower bounds of an array, or a single lower bound along 14679 the DIM dimension. 14680_Standard_: 14681 Fortran 90 and later, with KIND argument Fortran 2003 and later 14682 14683_Class_: 14684 Inquiry function 14685 14686_Syntax_: 14687 'RESULT = LBOUND(ARRAY [, DIM [, KIND]])' 14688 14689_Arguments_: 14690 ARRAY Shall be an array, of any type. 14691 DIM (Optional) Shall be a scalar 'INTEGER'. 14692 KIND (Optional) An 'INTEGER' initialization 14693 expression indicating the kind parameter of the 14694 result. 14695 14696_Return value_: 14697 The return value is of type 'INTEGER' and of kind KIND. If KIND is 14698 absent, the return value is of default integer kind. If DIM is 14699 absent, the result is an array of the lower bounds of ARRAY. If 14700 DIM is present, the result is a scalar corresponding to the lower 14701 bound of the array along that dimension. If ARRAY is an expression 14702 rather than a whole array or array structure component, or if it 14703 has a zero extent along the relevant dimension, the lower bound is 14704 taken to be 1. 14705 14706_See also_: 14707 *note UBOUND::, *note LCOBOUND:: 14708 14709 14710File: gfortran.info, Node: LCOBOUND, Next: LEADZ, Prev: LBOUND, Up: Intrinsic Procedures 14711 147129.166 'LCOBOUND' -- Lower codimension bounds of an array 14713======================================================== 14714 14715_Description_: 14716 Returns the lower bounds of a coarray, or a single lower cobound 14717 along the DIM codimension. 14718_Standard_: 14719 Fortran 2008 and later 14720 14721_Class_: 14722 Inquiry function 14723 14724_Syntax_: 14725 'RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])' 14726 14727_Arguments_: 14728 ARRAY Shall be an coarray, of any type. 14729 DIM (Optional) Shall be a scalar 'INTEGER'. 14730 KIND (Optional) An 'INTEGER' initialization 14731 expression indicating the kind parameter of the 14732 result. 14733 14734_Return value_: 14735 The return value is of type 'INTEGER' and of kind KIND. If KIND is 14736 absent, the return value is of default integer kind. If DIM is 14737 absent, the result is an array of the lower cobounds of COARRAY. 14738 If DIM is present, the result is a scalar corresponding to the 14739 lower cobound of the array along that codimension. 14740 14741_See also_: 14742 *note UCOBOUND::, *note LBOUND:: 14743 14744 14745File: gfortran.info, Node: LEADZ, Next: LEN, Prev: LCOBOUND, Up: Intrinsic Procedures 14746 147479.167 'LEADZ' -- Number of leading zero bits of an integer 14748========================================================== 14749 14750_Description_: 14751 'LEADZ' returns the number of leading zero bits of an integer. 14752 14753_Standard_: 14754 Fortran 2008 and later 14755 14756_Class_: 14757 Elemental function 14758 14759_Syntax_: 14760 'RESULT = LEADZ(I)' 14761 14762_Arguments_: 14763 I Shall be of type 'INTEGER'. 14764 14765_Return value_: 14766 The type of the return value is the default 'INTEGER'. If all the 14767 bits of 'I' are zero, the result value is 'BIT_SIZE(I)'. 14768 14769_Example_: 14770 PROGRAM test_leadz 14771 WRITE (*,*) BIT_SIZE(1) ! prints 32 14772 WRITE (*,*) LEADZ(1) ! prints 31 14773 END PROGRAM 14774 14775_See also_: 14776 *note BIT_SIZE::, *note TRAILZ::, *note POPCNT::, *note POPPAR:: 14777 14778 14779File: gfortran.info, Node: LEN, Next: LEN_TRIM, Prev: LEADZ, Up: Intrinsic Procedures 14780 147819.168 'LEN' -- Length of a character entity 14782=========================================== 14783 14784_Description_: 14785 Returns the length of a character string. If STRING is an array, 14786 the length of an element of STRING is returned. Note that STRING 14787 need not be defined when this intrinsic is invoked, since only the 14788 length, not the content, of STRING is needed. 14789 14790_Standard_: 14791 Fortran 77 and later, with KIND argument Fortran 2003 and later 14792 14793_Class_: 14794 Inquiry function 14795 14796_Syntax_: 14797 'L = LEN(STRING [, KIND])' 14798 14799_Arguments_: 14800 STRING Shall be a scalar or array of type 'CHARACTER', 14801 with 'INTENT(IN)' 14802 KIND (Optional) An 'INTEGER' initialization 14803 expression indicating the kind parameter of the 14804 result. 14805 14806_Return value_: 14807 The return value is of type 'INTEGER' and of kind KIND. If KIND is 14808 absent, the return value is of default integer kind. 14809 14810_Specific names_: 14811 Name Argument Return type Standard 14812 'LEN(STRING)' 'CHARACTER' 'INTEGER' Fortran 77 and 14813 later 14814 14815_See also_: 14816 *note LEN_TRIM::, *note ADJUSTL::, *note ADJUSTR:: 14817 14818 14819File: gfortran.info, Node: LEN_TRIM, Next: LGE, Prev: LEN, Up: Intrinsic Procedures 14820 148219.169 'LEN_TRIM' -- Length of a character entity without trailing blank characters 14822================================================================================== 14823 14824_Description_: 14825 Returns the length of a character string, ignoring any trailing 14826 blanks. 14827 14828_Standard_: 14829 Fortran 90 and later, with KIND argument Fortran 2003 and later 14830 14831_Class_: 14832 Elemental function 14833 14834_Syntax_: 14835 'RESULT = LEN_TRIM(STRING [, KIND])' 14836 14837_Arguments_: 14838 STRING Shall be a scalar of type 'CHARACTER', with 14839 'INTENT(IN)' 14840 KIND (Optional) An 'INTEGER' initialization 14841 expression indicating the kind parameter of the 14842 result. 14843 14844_Return value_: 14845 The return value is of type 'INTEGER' and of kind KIND. If KIND is 14846 absent, the return value is of default integer kind. 14847 14848_See also_: 14849 *note LEN::, *note ADJUSTL::, *note ADJUSTR:: 14850 14851 14852File: gfortran.info, Node: LGE, Next: LGT, Prev: LEN_TRIM, Up: Intrinsic Procedures 14853 148549.170 'LGE' -- Lexical greater than or equal 14855============================================ 14856 14857_Description_: 14858 Determines whether one string is lexically greater than or equal to 14859 another string, where the two strings are interpreted as containing 14860 ASCII character codes. If the String A and String B are not the 14861 same length, the shorter is compared as if spaces were appended to 14862 it to form a value that has the same length as the longer. 14863 14864 In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE', 14865 and 'LLT' differ from the corresponding intrinsic operators '.GE.', 14866 '.GT.', '.LE.', and '.LT.', in that the latter use the processor's 14867 character ordering (which is not ASCII on some targets), whereas 14868 the former always use the ASCII ordering. 14869 14870_Standard_: 14871 Fortran 77 and later 14872 14873_Class_: 14874 Elemental function 14875 14876_Syntax_: 14877 'RESULT = LGE(STRING_A, STRING_B)' 14878 14879_Arguments_: 14880 STRING_A Shall be of default 'CHARACTER' type. 14881 STRING_B Shall be of default 'CHARACTER' type. 14882 14883_Return value_: 14884 Returns '.TRUE.' if 'STRING_A >= STRING_B', and '.FALSE.' 14885 otherwise, based on the ASCII ordering. 14886 14887_Specific names_: 14888 Name Argument Return type Standard 14889 'LGE(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and 14890 STRING_B)' later 14891 14892_See also_: 14893 *note LGT::, *note LLE::, *note LLT:: 14894 14895 14896File: gfortran.info, Node: LGT, Next: LINK, Prev: LGE, Up: Intrinsic Procedures 14897 148989.171 'LGT' -- Lexical greater than 14899=================================== 14900 14901_Description_: 14902 Determines whether one string is lexically greater than another 14903 string, where the two strings are interpreted as containing ASCII 14904 character codes. If the String A and String B are not the same 14905 length, the shorter is compared as if spaces were appended to it to 14906 form a value that has the same length as the longer. 14907 14908 In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE', 14909 and 'LLT' differ from the corresponding intrinsic operators '.GE.', 14910 '.GT.', '.LE.', and '.LT.', in that the latter use the processor's 14911 character ordering (which is not ASCII on some targets), whereas 14912 the former always use the ASCII ordering. 14913 14914_Standard_: 14915 Fortran 77 and later 14916 14917_Class_: 14918 Elemental function 14919 14920_Syntax_: 14921 'RESULT = LGT(STRING_A, STRING_B)' 14922 14923_Arguments_: 14924 STRING_A Shall be of default 'CHARACTER' type. 14925 STRING_B Shall be of default 'CHARACTER' type. 14926 14927_Return value_: 14928 Returns '.TRUE.' if 'STRING_A > STRING_B', and '.FALSE.' otherwise, 14929 based on the ASCII ordering. 14930 14931_Specific names_: 14932 Name Argument Return type Standard 14933 'LGT(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and 14934 STRING_B)' later 14935 14936_See also_: 14937 *note LGE::, *note LLE::, *note LLT:: 14938 14939 14940File: gfortran.info, Node: LINK, Next: LLE, Prev: LGT, Up: Intrinsic Procedures 14941 149429.172 'LINK' -- Create a hard link 14943================================== 14944 14945_Description_: 14946 Makes a (hard) link from file PATH1 to PATH2. A null character 14947 ('CHAR(0)') can be used to mark the end of the names in PATH1 and 14948 PATH2; otherwise, trailing blanks in the file names are ignored. 14949 If the STATUS argument is supplied, it contains 0 on success or a 14950 nonzero error code upon return; see 'link(2)'. 14951 14952 This intrinsic is provided in both subroutine and function forms; 14953 however, only one form can be used in any given program unit. 14954 14955_Standard_: 14956 GNU extension 14957 14958_Class_: 14959 Subroutine, function 14960 14961_Syntax_: 14962 'CALL LINK(PATH1, PATH2 [, STATUS])' 14963 'STATUS = LINK(PATH1, PATH2)' 14964 14965_Arguments_: 14966 PATH1 Shall be of default 'CHARACTER' type. 14967 PATH2 Shall be of default 'CHARACTER' type. 14968 STATUS (Optional) Shall be of default 'INTEGER' type. 14969 14970_See also_: 14971 *note SYMLNK::, *note UNLINK:: 14972 14973 14974File: gfortran.info, Node: LLE, Next: LLT, Prev: LINK, Up: Intrinsic Procedures 14975 149769.173 'LLE' -- Lexical less than or equal 14977========================================= 14978 14979_Description_: 14980 Determines whether one string is lexically less than or equal to 14981 another string, where the two strings are interpreted as containing 14982 ASCII character codes. If the String A and String B are not the 14983 same length, the shorter is compared as if spaces were appended to 14984 it to form a value that has the same length as the longer. 14985 14986 In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE', 14987 and 'LLT' differ from the corresponding intrinsic operators '.GE.', 14988 '.GT.', '.LE.', and '.LT.', in that the latter use the processor's 14989 character ordering (which is not ASCII on some targets), whereas 14990 the former always use the ASCII ordering. 14991 14992_Standard_: 14993 Fortran 77 and later 14994 14995_Class_: 14996 Elemental function 14997 14998_Syntax_: 14999 'RESULT = LLE(STRING_A, STRING_B)' 15000 15001_Arguments_: 15002 STRING_A Shall be of default 'CHARACTER' type. 15003 STRING_B Shall be of default 'CHARACTER' type. 15004 15005_Return value_: 15006 Returns '.TRUE.' if 'STRING_A <= STRING_B', and '.FALSE.' 15007 otherwise, based on the ASCII ordering. 15008 15009_Specific names_: 15010 Name Argument Return type Standard 15011 'LLE(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and 15012 STRING_B)' later 15013 15014_See also_: 15015 *note LGE::, *note LGT::, *note LLT:: 15016 15017 15018File: gfortran.info, Node: LLT, Next: LNBLNK, Prev: LLE, Up: Intrinsic Procedures 15019 150209.174 'LLT' -- Lexical less than 15021================================ 15022 15023_Description_: 15024 Determines whether one string is lexically less than another 15025 string, where the two strings are interpreted as containing ASCII 15026 character codes. If the String A and String B are not the same 15027 length, the shorter is compared as if spaces were appended to it to 15028 form a value that has the same length as the longer. 15029 15030 In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE', 15031 and 'LLT' differ from the corresponding intrinsic operators '.GE.', 15032 '.GT.', '.LE.', and '.LT.', in that the latter use the processor's 15033 character ordering (which is not ASCII on some targets), whereas 15034 the former always use the ASCII ordering. 15035 15036_Standard_: 15037 Fortran 77 and later 15038 15039_Class_: 15040 Elemental function 15041 15042_Syntax_: 15043 'RESULT = LLT(STRING_A, STRING_B)' 15044 15045_Arguments_: 15046 STRING_A Shall be of default 'CHARACTER' type. 15047 STRING_B Shall be of default 'CHARACTER' type. 15048 15049_Return value_: 15050 Returns '.TRUE.' if 'STRING_A < STRING_B', and '.FALSE.' otherwise, 15051 based on the ASCII ordering. 15052 15053_Specific names_: 15054 Name Argument Return type Standard 15055 'LLT(STRING_A, 'CHARACTER' 'LOGICAL' Fortran 77 and 15056 STRING_B)' later 15057 15058_See also_: 15059 *note LGE::, *note LGT::, *note LLE:: 15060 15061 15062File: gfortran.info, Node: LNBLNK, Next: LOC, Prev: LLT, Up: Intrinsic Procedures 15063 150649.175 'LNBLNK' -- Index of the last non-blank character in a string 15065=================================================================== 15066 15067_Description_: 15068 Returns the length of a character string, ignoring any trailing 15069 blanks. This is identical to the standard 'LEN_TRIM' intrinsic, 15070 and is only included for backwards compatibility. 15071 15072_Standard_: 15073 GNU extension 15074 15075_Class_: 15076 Elemental function 15077 15078_Syntax_: 15079 'RESULT = LNBLNK(STRING)' 15080 15081_Arguments_: 15082 STRING Shall be a scalar of type 'CHARACTER', with 15083 'INTENT(IN)' 15084 15085_Return value_: 15086 The return value is of 'INTEGER(kind=4)' type. 15087 15088_See also_: 15089 *note INDEX intrinsic::, *note LEN_TRIM:: 15090 15091 15092File: gfortran.info, Node: LOC, Next: LOG, Prev: LNBLNK, Up: Intrinsic Procedures 15093 150949.176 'LOC' -- Returns the address of a variable 15095================================================ 15096 15097_Description_: 15098 'LOC(X)' returns the address of X as an integer. 15099 15100_Standard_: 15101 GNU extension 15102 15103_Class_: 15104 Inquiry function 15105 15106_Syntax_: 15107 'RESULT = LOC(X)' 15108 15109_Arguments_: 15110 X Variable of any type. 15111 15112_Return value_: 15113 The return value is of type 'INTEGER', with a 'KIND' corresponding 15114 to the size (in bytes) of a memory address on the target machine. 15115 15116_Example_: 15117 program test_loc 15118 integer :: i 15119 real :: r 15120 i = loc(r) 15121 print *, i 15122 end program test_loc 15123 15124 15125File: gfortran.info, Node: LOG, Next: LOG10, Prev: LOC, Up: Intrinsic Procedures 15126 151279.177 'LOG' -- Natural logarithm function 15128========================================= 15129 15130_Description_: 15131 'LOG(X)' computes the natural logarithm of X, i.e. the logarithm 15132 to the base e. 15133 15134_Standard_: 15135 Fortran 77 and later, has GNU extensions 15136 15137_Class_: 15138 Elemental function 15139 15140_Syntax_: 15141 'RESULT = LOG(X)' 15142 15143_Arguments_: 15144 X The type shall be 'REAL' or 'COMPLEX'. 15145 15146_Return value_: 15147 The return value is of type 'REAL' or 'COMPLEX'. The kind type 15148 parameter is the same as X. If X is 'COMPLEX', the imaginary part 15149 \omega is in the range -\pi < \omega \leq \pi. 15150 15151_Example_: 15152 program test_log 15153 real(8) :: x = 2.7182818284590451_8 15154 complex :: z = (1.0, 2.0) 15155 x = log(x) ! will yield (approximately) 1 15156 z = log(z) 15157 end program test_log 15158 15159_Specific names_: 15160 Name Argument Return type Standard 15161 'ALOG(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 or 15162 later 15163 'DLOG(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 or 15164 later 15165 'CLOG(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 or 15166 X' later 15167 'ZLOG(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 15168 X' 15169 'CDLOG(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 15170 X' 15171 15172 15173File: gfortran.info, Node: LOG10, Next: LOG_GAMMA, Prev: LOG, Up: Intrinsic Procedures 15174 151759.178 'LOG10' -- Base 10 logarithm function 15176=========================================== 15177 15178_Description_: 15179 'LOG10(X)' computes the base 10 logarithm of X. 15180 15181_Standard_: 15182 Fortran 77 and later 15183 15184_Class_: 15185 Elemental function 15186 15187_Syntax_: 15188 'RESULT = LOG10(X)' 15189 15190_Arguments_: 15191 X The type shall be 'REAL'. 15192 15193_Return value_: 15194 The return value is of type 'REAL' or 'COMPLEX'. The kind type 15195 parameter is the same as X. 15196 15197_Example_: 15198 program test_log10 15199 real(8) :: x = 10.0_8 15200 x = log10(x) 15201 end program test_log10 15202 15203_Specific names_: 15204 Name Argument Return type Standard 15205 'ALOG10(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 15206 later 15207 'DLOG10(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 15208 later 15209 15210 15211File: gfortran.info, Node: LOG_GAMMA, Next: LOGICAL, Prev: LOG10, Up: Intrinsic Procedures 15212 152139.179 'LOG_GAMMA' -- Logarithm of the Gamma function 15214==================================================== 15215 15216_Description_: 15217 'LOG_GAMMA(X)' computes the natural logarithm of the absolute value 15218 of the Gamma (\Gamma) function. 15219 15220_Standard_: 15221 Fortran 2008 and later 15222 15223_Class_: 15224 Elemental function 15225 15226_Syntax_: 15227 'X = LOG_GAMMA(X)' 15228 15229_Arguments_: 15230 X Shall be of type 'REAL' and neither zero nor a 15231 negative integer. 15232 15233_Return value_: 15234 The return value is of type 'REAL' of the same kind as X. 15235 15236_Example_: 15237 program test_log_gamma 15238 real :: x = 1.0 15239 x = lgamma(x) ! returns 0.0 15240 end program test_log_gamma 15241 15242_Specific names_: 15243 Name Argument Return type Standard 15244 'LGAMMA(X)' 'REAL(4) X' 'REAL(4)' GNU extension 15245 'ALGAMA(X)' 'REAL(4) X' 'REAL(4)' GNU extension 15246 'DLGAMA(X)' 'REAL(8) X' 'REAL(8)' GNU extension 15247 15248_See also_: 15249 Gamma function: *note GAMMA:: 15250 15251 15252File: gfortran.info, Node: LOGICAL, Next: LONG, Prev: LOG_GAMMA, Up: Intrinsic Procedures 15253 152549.180 'LOGICAL' -- Convert to logical type 15255========================================== 15256 15257_Description_: 15258 Converts one kind of 'LOGICAL' variable to another. 15259 15260_Standard_: 15261 Fortran 90 and later 15262 15263_Class_: 15264 Elemental function 15265 15266_Syntax_: 15267 'RESULT = LOGICAL(L [, KIND])' 15268 15269_Arguments_: 15270 L The type shall be 'LOGICAL'. 15271 KIND (Optional) An 'INTEGER' initialization 15272 expression indicating the kind parameter of the 15273 result. 15274 15275_Return value_: 15276 The return value is a 'LOGICAL' value equal to L, with a kind 15277 corresponding to KIND, or of the default logical kind if KIND is 15278 not given. 15279 15280_See also_: 15281 *note INT::, *note REAL::, *note CMPLX:: 15282 15283 15284File: gfortran.info, Node: LONG, Next: LSHIFT, Prev: LOGICAL, Up: Intrinsic Procedures 15285 152869.181 'LONG' -- Convert to integer type 15287======================================= 15288 15289_Description_: 15290 Convert to a 'KIND=4' integer type, which is the same size as a C 15291 'long' integer. This is equivalent to the standard 'INT' intrinsic 15292 with an optional argument of 'KIND=4', and is only included for 15293 backwards compatibility. 15294 15295_Standard_: 15296 GNU extension 15297 15298_Class_: 15299 Elemental function 15300 15301_Syntax_: 15302 'RESULT = LONG(A)' 15303 15304_Arguments_: 15305 A Shall be of type 'INTEGER', 'REAL', or 15306 'COMPLEX'. 15307 15308_Return value_: 15309 The return value is a 'INTEGER(4)' variable. 15310 15311_See also_: 15312 *note INT::, *note INT2::, *note INT8:: 15313 15314 15315File: gfortran.info, Node: LSHIFT, Next: LSTAT, Prev: LONG, Up: Intrinsic Procedures 15316 153179.182 'LSHIFT' -- Left shift bits 15318================================= 15319 15320_Description_: 15321 'LSHIFT' returns a value corresponding to I with all of the bits 15322 shifted left by SHIFT places. SHIFT shall be nonnegative and less 15323 than or equal to 'BIT_SIZE(I)', otherwise the result value is 15324 undefined. Bits shifted out from the left end are lost; zeros are 15325 shifted in from the opposite end. 15326 15327 This function has been superseded by the 'ISHFT' intrinsic, which 15328 is standard in Fortran 95 and later, and the 'SHIFTL' intrinsic, 15329 which is standard in Fortran 2008 and later. 15330 15331_Standard_: 15332 GNU extension 15333 15334_Class_: 15335 Elemental function 15336 15337_Syntax_: 15338 'RESULT = LSHIFT(I, SHIFT)' 15339 15340_Arguments_: 15341 I The type shall be 'INTEGER'. 15342 SHIFT The type shall be 'INTEGER'. 15343 15344_Return value_: 15345 The return value is of type 'INTEGER' and of the same kind as I. 15346 15347_See also_: 15348 *note ISHFT::, *note ISHFTC::, *note RSHIFT::, *note SHIFTA::, 15349 *note SHIFTL::, *note SHIFTR:: 15350 15351 15352File: gfortran.info, Node: LSTAT, Next: LTIME, Prev: LSHIFT, Up: Intrinsic Procedures 15353 153549.183 'LSTAT' -- Get file status 15355================================ 15356 15357_Description_: 15358 'LSTAT' is identical to *note STAT::, except that if path is a 15359 symbolic link, then the link itself is statted, not the file that 15360 it refers to. 15361 15362 The elements in 'VALUES' are the same as described by *note STAT::. 15363 15364 This intrinsic is provided in both subroutine and function forms; 15365 however, only one form can be used in any given program unit. 15366 15367_Standard_: 15368 GNU extension 15369 15370_Class_: 15371 Subroutine, function 15372 15373_Syntax_: 15374 'CALL LSTAT(NAME, VALUES [, STATUS])' 15375 'STATUS = LSTAT(NAME, VALUES)' 15376 15377_Arguments_: 15378 NAME The type shall be 'CHARACTER' of the default 15379 kind, a valid path within the file system. 15380 VALUES The type shall be 'INTEGER(4), DIMENSION(13)'. 15381 STATUS (Optional) status flag of type 'INTEGER(4)'. 15382 Returns 0 on success and a system specific error 15383 code otherwise. 15384 15385_Example_: 15386 See *note STAT:: for an example. 15387 15388_See also_: 15389 To stat an open file: *note FSTAT:: To stat a file: *note STAT:: 15390 15391 15392File: gfortran.info, Node: LTIME, Next: MALLOC, Prev: LSTAT, Up: Intrinsic Procedures 15393 153949.184 'LTIME' -- Convert time to local time info 15395================================================ 15396 15397_Description_: 15398 Given a system time value TIME (as provided by the *note TIME:: 15399 intrinsic), fills VALUES with values extracted from it appropriate 15400 to the local time zone using 'localtime(3)'. 15401 15402 This intrinsic routine is provided for backwards compatibility with 15403 GNU Fortran 77. In new code, programmers should consider the use 15404 of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95 15405 standard. 15406 15407_Standard_: 15408 GNU extension 15409 15410_Class_: 15411 Subroutine 15412 15413_Syntax_: 15414 'CALL LTIME(TIME, VALUES)' 15415 15416_Arguments_: 15417 TIME An 'INTEGER' scalar expression corresponding to 15418 a system time, with 'INTENT(IN)'. 15419 VALUES A default 'INTEGER' array with 9 elements, with 15420 'INTENT(OUT)'. 15421 15422_Return value_: 15423 The elements of VALUES are assigned as follows: 15424 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap 15425 seconds 15426 2. Minutes after the hour, range 0-59 15427 3. Hours past midnight, range 0-23 15428 4. Day of month, range 1-31 15429 5. Number of months since January, range 0-11 15430 6. Years since 1900 15431 7. Number of days since Sunday, range 0-6 15432 8. Days since January 1, range 0-365 15433 9. Daylight savings indicator: positive if daylight savings is in 15434 effect, zero if not, and negative if the information is not 15435 available. 15436 15437_See also_: 15438 *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note TIME::, 15439 *note TIME8:: 15440 15441 15442File: gfortran.info, Node: MALLOC, Next: MASKL, Prev: LTIME, Up: Intrinsic Procedures 15443 154449.185 'MALLOC' -- Allocate dynamic memory 15445========================================= 15446 15447_Description_: 15448 'MALLOC(SIZE)' allocates SIZE bytes of dynamic memory and returns 15449 the address of the allocated memory. The 'MALLOC' intrinsic is an 15450 extension intended to be used with Cray pointers, and is provided 15451 in GNU Fortran to allow the user to compile legacy code. For new 15452 code using Fortran 95 pointers, the memory allocation intrinsic is 15453 'ALLOCATE'. 15454 15455_Standard_: 15456 GNU extension 15457 15458_Class_: 15459 Function 15460 15461_Syntax_: 15462 'PTR = MALLOC(SIZE)' 15463 15464_Arguments_: 15465 SIZE The type shall be 'INTEGER'. 15466 15467_Return value_: 15468 The return value is of type 'INTEGER(K)', with K such that 15469 variables of type 'INTEGER(K)' have the same size as C pointers 15470 ('sizeof(void *)'). 15471 15472_Example_: 15473 The following example demonstrates the use of 'MALLOC' and 'FREE' 15474 with Cray pointers. 15475 15476 program test_malloc 15477 implicit none 15478 integer i 15479 real*8 x(*), z 15480 pointer(ptr_x,x) 15481 15482 ptr_x = malloc(20*8) 15483 do i = 1, 20 15484 x(i) = sqrt(1.0d0 / i) 15485 end do 15486 z = 0 15487 do i = 1, 20 15488 z = z + x(i) 15489 print *, z 15490 end do 15491 call free(ptr_x) 15492 end program test_malloc 15493 15494_See also_: 15495 *note FREE:: 15496 15497 15498File: gfortran.info, Node: MASKL, Next: MASKR, Prev: MALLOC, Up: Intrinsic Procedures 15499 155009.186 'MASKL' -- Left justified mask 15501==================================== 15502 15503_Description_: 15504 'MASKL(I[, KIND])' has its leftmost I bits set to 1, and the 15505 remaining bits set to 0. 15506 15507_Standard_: 15508 Fortran 2008 and later 15509 15510_Class_: 15511 Elemental function 15512 15513_Syntax_: 15514 'RESULT = MASKL(I[, KIND])' 15515 15516_Arguments_: 15517 I Shall be of type 'INTEGER'. 15518 KIND Shall be a scalar constant expression of type 15519 'INTEGER'. 15520 15521_Return value_: 15522 The return value is of type 'INTEGER'. If KIND is present, it 15523 specifies the kind value of the return type; otherwise, it is of 15524 the default integer kind. 15525 15526_See also_: 15527 *note MASKR:: 15528 15529 15530File: gfortran.info, Node: MASKR, Next: MATMUL, Prev: MASKL, Up: Intrinsic Procedures 15531 155329.187 'MASKR' -- Right justified mask 15533===================================== 15534 15535_Description_: 15536 'MASKL(I[, KIND])' has its rightmost I bits set to 1, and the 15537 remaining bits set to 0. 15538 15539_Standard_: 15540 Fortran 2008 and later 15541 15542_Class_: 15543 Elemental function 15544 15545_Syntax_: 15546 'RESULT = MASKR(I[, KIND])' 15547 15548_Arguments_: 15549 I Shall be of type 'INTEGER'. 15550 KIND Shall be a scalar constant expression of type 15551 'INTEGER'. 15552 15553_Return value_: 15554 The return value is of type 'INTEGER'. If KIND is present, it 15555 specifies the kind value of the return type; otherwise, it is of 15556 the default integer kind. 15557 15558_See also_: 15559 *note MASKL:: 15560 15561 15562File: gfortran.info, Node: MATMUL, Next: MAX, Prev: MASKR, Up: Intrinsic Procedures 15563 155649.188 'MATMUL' -- matrix multiplication 15565======================================= 15566 15567_Description_: 15568 Performs a matrix multiplication on numeric or logical arguments. 15569 15570_Standard_: 15571 Fortran 90 and later 15572 15573_Class_: 15574 Transformational function 15575 15576_Syntax_: 15577 'RESULT = MATMUL(MATRIX_A, MATRIX_B)' 15578 15579_Arguments_: 15580 MATRIX_A An array of 'INTEGER', 'REAL', 'COMPLEX', or 15581 'LOGICAL' type, with a rank of one or two. 15582 MATRIX_B An array of 'INTEGER', 'REAL', or 'COMPLEX' type 15583 if MATRIX_A is of a numeric type; otherwise, an 15584 array of 'LOGICAL' type. The rank shall be one 15585 or two, and the first (or only) dimension of 15586 MATRIX_B shall be equal to the last (or only) 15587 dimension of MATRIX_A. MATRIX_A and MATRIX_B 15588 shall not both be rank one arrays. 15589 15590_Return value_: 15591 The matrix product of MATRIX_A and MATRIX_B. The type and kind of 15592 the result follow the usual type and kind promotion rules, as for 15593 the '*' or '.AND.' operators. 15594 15595 15596File: gfortran.info, Node: MAX, Next: MAXEXPONENT, Prev: MATMUL, Up: Intrinsic Procedures 15597 155989.189 'MAX' -- Maximum value of an argument list 15599================================================ 15600 15601_Description_: 15602 Returns the argument with the largest (most positive) value. 15603 15604_Standard_: 15605 Fortran 77 and later 15606 15607_Class_: 15608 Elemental function 15609 15610_Syntax_: 15611 'RESULT = MAX(A1, A2 [, A3 [, ...]])' 15612 15613_Arguments_: 15614 A1 The type shall be 'INTEGER' or 'REAL'. 15615 A2, A3, An expression of the same type and kind as A1. 15616 ... (As a GNU extension, arguments of different 15617 kinds are permitted.) 15618 15619_Return value_: 15620 The return value corresponds to the maximum value among the 15621 arguments, and has the same type and kind as the first argument. 15622 15623_Specific names_: 15624 Name Argument Return type Standard 15625 'MAX0(A1)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and 15626 A1' later 15627 'AMAX0(A1)' 'INTEGER(4) 'REAL(MAX(X))' Fortran 77 and 15628 A1' later 15629 'MAX1(A1)' 'REAL A1' 'INT(MAX(X))' Fortran 77 and 15630 later 15631 'AMAX1(A1)' 'REAL(4) A1' 'REAL(4)' Fortran 77 and 15632 later 15633 'DMAX1(A1)' 'REAL(8) A1' 'REAL(8)' Fortran 77 and 15634 later 15635 15636_See also_: 15637 *note MAXLOC:: *note MAXVAL::, *note MIN:: 15638 15639 15640File: gfortran.info, Node: MAXEXPONENT, Next: MAXLOC, Prev: MAX, Up: Intrinsic Procedures 15641 156429.190 'MAXEXPONENT' -- Maximum exponent of a real kind 15643====================================================== 15644 15645_Description_: 15646 'MAXEXPONENT(X)' returns the maximum exponent in the model of the 15647 type of 'X'. 15648 15649_Standard_: 15650 Fortran 90 and later 15651 15652_Class_: 15653 Inquiry function 15654 15655_Syntax_: 15656 'RESULT = MAXEXPONENT(X)' 15657 15658_Arguments_: 15659 X Shall be of type 'REAL'. 15660 15661_Return value_: 15662 The return value is of type 'INTEGER' and of the default integer 15663 kind. 15664 15665_Example_: 15666 program exponents 15667 real(kind=4) :: x 15668 real(kind=8) :: y 15669 15670 print *, minexponent(x), maxexponent(x) 15671 print *, minexponent(y), maxexponent(y) 15672 end program exponents 15673 15674 15675File: gfortran.info, Node: MAXLOC, Next: MAXVAL, Prev: MAXEXPONENT, Up: Intrinsic Procedures 15676 156779.191 'MAXLOC' -- Location of the maximum value within an array 15678=============================================================== 15679 15680_Description_: 15681 Determines the location of the element in the array with the 15682 maximum value, or, if the DIM argument is supplied, determines the 15683 locations of the maximum element along each row of the array in the 15684 DIM direction. If MASK is present, only the elements for which 15685 MASK is '.TRUE.' are considered. If more than one element in the 15686 array has the maximum value, the location returned is that of the 15687 first such element in array element order if the BACK is not 15688 present, or is false; if BACK is true, the location returned is 15689 that of the last such element. If the array has zero size, or all 15690 of the elements of MASK are '.FALSE.', then the result is an array 15691 of zeroes. Similarly, if DIM is supplied and all of the elements 15692 of MASK along a given row are zero, the result value for that row 15693 is zero. 15694 15695_Standard_: 15696 Fortran 95 and later; ARRAY of 'CHARACTER' and the KIND argument 15697 are available in Fortran 2003 and later. The BACK argument is 15698 available in Fortran 2008 and later. 15699 15700_Class_: 15701 Transformational function 15702 15703_Syntax_: 15704 'RESULT = MAXLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])' 15705 'RESULT = MAXLOC(ARRAY [, MASK] [,KIND] [,BACK])' 15706 15707_Arguments_: 15708 ARRAY Shall be an array of type 'INTEGER' or 'REAL'. 15709 DIM (Optional) Shall be a scalar of type 'INTEGER', 15710 with a value between one and the rank of ARRAY, 15711 inclusive. It may not be an optional dummy 15712 argument. 15713 MASK Shall be an array of type 'LOGICAL', and 15714 conformable with ARRAY. 15715 KIND (Optional) An 'INTEGER' initialization 15716 expression indicating the kind parameter of the 15717 result. 15718 BACK (Optional) A scalar of type 'LOGICAL'. 15719 15720_Return value_: 15721 If DIM is absent, the result is a rank-one array with a length 15722 equal to the rank of ARRAY. If DIM is present, the result is an 15723 array with a rank one less than the rank of ARRAY, and a size 15724 corresponding to the size of ARRAY with the DIM dimension removed. 15725 If DIM is present and ARRAY has a rank of one, the result is a 15726 scalar. If the optional argument KIND is present, the result is an 15727 integer of kind KIND, otherwise it is of default kind. 15728 15729_See also_: 15730 *note FINDLOC::, *note MAX::, *note MAXVAL:: 15731 15732 15733File: gfortran.info, Node: MAXVAL, Next: MCLOCK, Prev: MAXLOC, Up: Intrinsic Procedures 15734 157359.192 'MAXVAL' -- Maximum value of an array 15736=========================================== 15737 15738_Description_: 15739 Determines the maximum value of the elements in an array value, or, 15740 if the DIM argument is supplied, determines the maximum value along 15741 each row of the array in the DIM direction. If MASK is present, 15742 only the elements for which MASK is '.TRUE.' are considered. If 15743 the array has zero size, or all of the elements of MASK are 15744 '.FALSE.', then the result is '-HUGE(ARRAY)' if ARRAY is numeric, 15745 or a string of nulls if ARRAY is of character type. 15746 15747_Standard_: 15748 Fortran 90 and later 15749 15750_Class_: 15751 Transformational function 15752 15753_Syntax_: 15754 'RESULT = MAXVAL(ARRAY, DIM [, MASK])' 15755 'RESULT = MAXVAL(ARRAY [, MASK])' 15756 15757_Arguments_: 15758 ARRAY Shall be an array of type 'INTEGER' or 'REAL'. 15759 DIM (Optional) Shall be a scalar of type 'INTEGER', 15760 with a value between one and the rank of ARRAY, 15761 inclusive. It may not be an optional dummy 15762 argument. 15763 MASK (Opional) Shall be an array of type 'LOGICAL', 15764 and conformable with ARRAY. 15765 15766_Return value_: 15767 If DIM is absent, or if ARRAY has a rank of one, the result is a 15768 scalar. If DIM is present, the result is an array with a rank one 15769 less than the rank of ARRAY, and a size corresponding to the size 15770 of ARRAY with the DIM dimension removed. In all cases, the result 15771 is of the same type and kind as ARRAY. 15772 15773_See also_: 15774 *note MAX::, *note MAXLOC:: 15775 15776 15777File: gfortran.info, Node: MCLOCK, Next: MCLOCK8, Prev: MAXVAL, Up: Intrinsic Procedures 15778 157799.193 'MCLOCK' -- Time function 15780=============================== 15781 15782_Description_: 15783 Returns the number of clock ticks since the start of the process, 15784 based on the function 'clock(3)' in the C standard library. 15785 15786 This intrinsic is not fully portable, such as to systems with 15787 32-bit 'INTEGER' types but supporting times wider than 32 bits. 15788 Therefore, the values returned by this intrinsic might be, or 15789 become, negative, or numerically less than previous values, during 15790 a single run of the compiled program. 15791 15792_Standard_: 15793 GNU extension 15794 15795_Class_: 15796 Function 15797 15798_Syntax_: 15799 'RESULT = MCLOCK()' 15800 15801_Return value_: 15802 The return value is a scalar of type 'INTEGER(4)', equal to the 15803 number of clock ticks since the start of the process, or '-1' if 15804 the system does not support 'clock(3)'. 15805 15806_See also_: 15807 *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note 15808 TIME:: 15809 15810 15811File: gfortran.info, Node: MCLOCK8, Next: MERGE, Prev: MCLOCK, Up: Intrinsic Procedures 15812 158139.194 'MCLOCK8' -- Time function (64-bit) 15814========================================= 15815 15816_Description_: 15817 Returns the number of clock ticks since the start of the process, 15818 based on the function 'clock(3)' in the C standard library. 15819 15820 _Warning:_ this intrinsic does not increase the range of the timing 15821 values over that returned by 'clock(3)'. On a system with a 32-bit 15822 'clock(3)', 'MCLOCK8' will return a 32-bit value, even though it is 15823 converted to a 64-bit 'INTEGER(8)' value. That means overflows of 15824 the 32-bit value can still occur. Therefore, the values returned 15825 by this intrinsic might be or become negative or numerically less 15826 than previous values during a single run of the compiled program. 15827 15828_Standard_: 15829 GNU extension 15830 15831_Class_: 15832 Function 15833 15834_Syntax_: 15835 'RESULT = MCLOCK8()' 15836 15837_Return value_: 15838 The return value is a scalar of type 'INTEGER(8)', equal to the 15839 number of clock ticks since the start of the process, or '-1' if 15840 the system does not support 'clock(3)'. 15841 15842_See also_: 15843 *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note 15844 TIME8:: 15845 15846 15847File: gfortran.info, Node: MERGE, Next: MERGE_BITS, Prev: MCLOCK8, Up: Intrinsic Procedures 15848 158499.195 'MERGE' -- Merge variables 15850================================ 15851 15852_Description_: 15853 Select values from two arrays according to a logical mask. The 15854 result is equal to TSOURCE if MASK is '.TRUE.', or equal to FSOURCE 15855 if it is '.FALSE.'. 15856 15857_Standard_: 15858 Fortran 90 and later 15859 15860_Class_: 15861 Elemental function 15862 15863_Syntax_: 15864 'RESULT = MERGE(TSOURCE, FSOURCE, MASK)' 15865 15866_Arguments_: 15867 TSOURCE May be of any type. 15868 FSOURCE Shall be of the same type and type parameters as 15869 TSOURCE. 15870 MASK Shall be of type 'LOGICAL'. 15871 15872_Return value_: 15873 The result is of the same type and type parameters as TSOURCE. 15874 15875 15876File: gfortran.info, Node: MERGE_BITS, Next: MIN, Prev: MERGE, Up: Intrinsic Procedures 15877 158789.196 'MERGE_BITS' -- Merge of bits under mask 15879============================================== 15880 15881_Description_: 15882 'MERGE_BITS(I, J, MASK)' merges the bits of I and J as determined 15883 by the mask. The i-th bit of the result is equal to the i-th bit 15884 of I if the i-th bit of MASK is 1; it is equal to the i-th bit of J 15885 otherwise. 15886 15887_Standard_: 15888 Fortran 2008 and later 15889 15890_Class_: 15891 Elemental function 15892 15893_Syntax_: 15894 'RESULT = MERGE_BITS(I, J, MASK)' 15895 15896_Arguments_: 15897 I Shall be of type 'INTEGER' or a 15898 boz-literal-constant. 15899 J Shall be of type 'INTEGER' with the same kind 15900 type parameter as I or a boz-literal-constant. 15901 I and J shall not both be boz-literal-constants. 15902 MASK Shall be of type 'INTEGER' or a 15903 boz-literal-constant and of the same kind as I. 15904 15905_Return value_: 15906 The result is of the same type and kind as I. 15907 15908 15909File: gfortran.info, Node: MIN, Next: MINEXPONENT, Prev: MERGE_BITS, Up: Intrinsic Procedures 15910 159119.197 'MIN' -- Minimum value of an argument list 15912================================================ 15913 15914_Description_: 15915 Returns the argument with the smallest (most negative) value. 15916 15917_Standard_: 15918 Fortran 77 and later 15919 15920_Class_: 15921 Elemental function 15922 15923_Syntax_: 15924 'RESULT = MIN(A1, A2 [, A3, ...])' 15925 15926_Arguments_: 15927 A1 The type shall be 'INTEGER' or 'REAL'. 15928 A2, A3, An expression of the same type and kind as A1. 15929 ... (As a GNU extension, arguments of different 15930 kinds are permitted.) 15931 15932_Return value_: 15933 The return value corresponds to the maximum value among the 15934 arguments, and has the same type and kind as the first argument. 15935 15936_Specific names_: 15937 Name Argument Return type Standard 15938 'MIN0(A1)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and 15939 A1' later 15940 'AMIN0(A1)' 'INTEGER(4) 'REAL(4)' Fortran 77 and 15941 A1' later 15942 'MIN1(A1)' 'REAL A1' 'INTEGER(4)' Fortran 77 and 15943 later 15944 'AMIN1(A1)' 'REAL(4) A1' 'REAL(4)' Fortran 77 and 15945 later 15946 'DMIN1(A1)' 'REAL(8) A1' 'REAL(8)' Fortran 77 and 15947 later 15948 15949_See also_: 15950 *note MAX::, *note MINLOC::, *note MINVAL:: 15951 15952 15953File: gfortran.info, Node: MINEXPONENT, Next: MINLOC, Prev: MIN, Up: Intrinsic Procedures 15954 159559.198 'MINEXPONENT' -- Minimum exponent of a real kind 15956====================================================== 15957 15958_Description_: 15959 'MINEXPONENT(X)' returns the minimum exponent in the model of the 15960 type of 'X'. 15961 15962_Standard_: 15963 Fortran 90 and later 15964 15965_Class_: 15966 Inquiry function 15967 15968_Syntax_: 15969 'RESULT = MINEXPONENT(X)' 15970 15971_Arguments_: 15972 X Shall be of type 'REAL'. 15973 15974_Return value_: 15975 The return value is of type 'INTEGER' and of the default integer 15976 kind. 15977 15978_Example_: 15979 See 'MAXEXPONENT' for an example. 15980 15981 15982File: gfortran.info, Node: MINLOC, Next: MINVAL, Prev: MINEXPONENT, Up: Intrinsic Procedures 15983 159849.199 'MINLOC' -- Location of the minimum value within an array 15985=============================================================== 15986 15987_Description_: 15988 Determines the location of the element in the array with the 15989 minimum value, or, if the DIM argument is supplied, determines the 15990 locations of the minimum element along each row of the array in the 15991 DIM direction. If MASK is present, only the elements for which 15992 MASK is '.TRUE.' are considered. If more than one element in the 15993 array has the minimum value, the location returned is that of the 15994 first such element in array element order if the BACK is not 15995 present, or is false; if BACK is true, the location returned is 15996 that of the last such element. If the array has zero size, or all 15997 of the elements of MASK are '.FALSE.', then the result is an array 15998 of zeroes. Similarly, if DIM is supplied and all of the elements 15999 of MASK along a given row are zero, the result value for that row 16000 is zero. 16001 16002_Standard_: 16003 Fortran 90 and later; ARRAY of 'CHARACTER' and the KIND argument 16004 are available in Fortran 2003 and later. The BACK argument is 16005 available in Fortran 2008 and later. 16006 16007_Class_: 16008 Transformational function 16009 16010_Syntax_: 16011 'RESULT = MINLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])' 16012 'RESULT = MINLOC(ARRAY [, MASK], [,KIND] [,BACK])' 16013 16014_Arguments_: 16015 ARRAY Shall be an array of type 'INTEGER', 'REAL' or 16016 'CHARACTER'. 16017 DIM (Optional) Shall be a scalar of type 'INTEGER', 16018 with a value between one and the rank of ARRAY, 16019 inclusive. It may not be an optional dummy 16020 argument. 16021 MASK Shall be an array of type 'LOGICAL', and 16022 conformable with ARRAY. 16023 KIND (Optional) An 'INTEGER' initialization 16024 expression indicating the kind parameter of the 16025 result. 16026 BACK (Optional) A scalar of type 'LOGICAL'. 16027 16028_Return value_: 16029 If DIM is absent, the result is a rank-one array with a length 16030 equal to the rank of ARRAY. If DIM is present, the result is an 16031 array with a rank one less than the rank of ARRAY, and a size 16032 corresponding to the size of ARRAY with the DIM dimension removed. 16033 If DIM is present and ARRAY has a rank of one, the result is a 16034 scalar. If the optional argument KIND is present, the result is an 16035 integer of kind KIND, otherwise it is of default kind. 16036 16037_See also_: 16038 *note FINDLOC::, *note MIN::, *note MINVAL:: 16039 16040 16041File: gfortran.info, Node: MINVAL, Next: MOD, Prev: MINLOC, Up: Intrinsic Procedures 16042 160439.200 'MINVAL' -- Minimum value of an array 16044=========================================== 16045 16046_Description_: 16047 Determines the minimum value of the elements in an array value, or, 16048 if the DIM argument is supplied, determines the minimum value along 16049 each row of the array in the DIM direction. If MASK is present, 16050 only the elements for which MASK is '.TRUE.' are considered. If 16051 the array has zero size, or all of the elements of MASK are 16052 '.FALSE.', then the result is 'HUGE(ARRAY)' if ARRAY is numeric, or 16053 a string of 'CHAR(255)' characters if ARRAY is of character type. 16054 16055_Standard_: 16056 Fortran 90 and later 16057 16058_Class_: 16059 Transformational function 16060 16061_Syntax_: 16062 'RESULT = MINVAL(ARRAY, DIM [, MASK])' 16063 'RESULT = MINVAL(ARRAY [, MASK])' 16064 16065_Arguments_: 16066 ARRAY Shall be an array of type 'INTEGER' or 'REAL'. 16067 DIM (Optional) Shall be a scalar of type 'INTEGER', 16068 with a value between one and the rank of ARRAY, 16069 inclusive. It may not be an optional dummy 16070 argument. 16071 MASK Shall be an array of type 'LOGICAL', and 16072 conformable with ARRAY. 16073 16074_Return value_: 16075 If DIM is absent, or if ARRAY has a rank of one, the result is a 16076 scalar. If DIM is present, the result is an array with a rank one 16077 less than the rank of ARRAY, and a size corresponding to the size 16078 of ARRAY with the DIM dimension removed. In all cases, the result 16079 is of the same type and kind as ARRAY. 16080 16081_See also_: 16082 *note MIN::, *note MINLOC:: 16083 16084 16085File: gfortran.info, Node: MOD, Next: MODULO, Prev: MINVAL, Up: Intrinsic Procedures 16086 160879.201 'MOD' -- Remainder function 16088================================= 16089 16090_Description_: 16091 'MOD(A,P)' computes the remainder of the division of A by P. 16092 16093_Standard_: 16094 Fortran 77 and later, has overloads that are GNU extensions 16095 16096_Class_: 16097 Elemental function 16098 16099_Syntax_: 16100 'RESULT = MOD(A, P)' 16101 16102_Arguments_: 16103 A Shall be a scalar of type 'INTEGER' or 'REAL'. 16104 P Shall be a scalar of the same type and kind as A 16105 and not equal to zero. (As a GNU extension, 16106 arguments of different kinds are permitted.) 16107 16108_Return value_: 16109 The return value is the result of 'A - (INT(A/P) * P)'. The type 16110 and kind of the return value is the same as that of the arguments. 16111 The returned value has the same sign as A and a magnitude less than 16112 the magnitude of P. (As a GNU extension, kind is the largest kind 16113 of the actual arguments.) 16114 16115_Example_: 16116 program test_mod 16117 print *, mod(17,3) 16118 print *, mod(17.5,5.5) 16119 print *, mod(17.5d0,5.5) 16120 print *, mod(17.5,5.5d0) 16121 16122 print *, mod(-17,3) 16123 print *, mod(-17.5,5.5) 16124 print *, mod(-17.5d0,5.5) 16125 print *, mod(-17.5,5.5d0) 16126 16127 print *, mod(17,-3) 16128 print *, mod(17.5,-5.5) 16129 print *, mod(17.5d0,-5.5) 16130 print *, mod(17.5,-5.5d0) 16131 end program test_mod 16132 16133_Specific names_: 16134 Name Arguments Return type Standard 16135 'MOD(A,P)' 'INTEGER 'INTEGER' Fortran 77 and 16136 A,P' later 16137 'AMOD(A,P)' 'REAL(4) 'REAL(4)' Fortran 77 and 16138 A,P' later 16139 'DMOD(A,P)' 'REAL(8) 'REAL(8)' Fortran 77 and 16140 A,P' later 16141 'BMOD(A,P)' 'INTEGER(1) 'INTEGER(1)' GNU extension 16142 A,P' 16143 'IMOD(A,P)' 'INTEGER(2) 'INTEGER(2)' GNU extension 16144 A,P' 16145 'JMOD(A,P)' 'INTEGER(4) 'INTEGER(4)' GNU extension 16146 A,P' 16147 'KMOD(A,P)' 'INTEGER(8) 'INTEGER(8)' GNU extension 16148 A,P' 16149 16150_See also_: 16151 *note MODULO:: 16152 16153 16154File: gfortran.info, Node: MODULO, Next: MOVE_ALLOC, Prev: MOD, Up: Intrinsic Procedures 16155 161569.202 'MODULO' -- Modulo function 16157================================= 16158 16159_Description_: 16160 'MODULO(A,P)' computes the A modulo P. 16161 16162_Standard_: 16163 Fortran 95 and later 16164 16165_Class_: 16166 Elemental function 16167 16168_Syntax_: 16169 'RESULT = MODULO(A, P)' 16170 16171_Arguments_: 16172 A Shall be a scalar of type 'INTEGER' or 'REAL'. 16173 P Shall be a scalar of the same type and kind as 16174 A. It shall not be zero. (As a GNU extension, 16175 arguments of different kinds are permitted.) 16176 16177_Return value_: 16178 The type and kind of the result are those of the arguments. (As a 16179 GNU extension, kind is the largest kind of the actual arguments.) 16180 If A and P are of type 'INTEGER': 16181 'MODULO(A,P)' has the value R such that 'A=Q*P+R', where Q is 16182 an integer and R is between 0 (inclusive) and P (exclusive). 16183 If A and P are of type 'REAL': 16184 'MODULO(A,P)' has the value of 'A - FLOOR (A / P) * P'. 16185 The returned value has the same sign as P and a magnitude less than 16186 the magnitude of P. 16187 16188_Example_: 16189 program test_modulo 16190 print *, modulo(17,3) 16191 print *, modulo(17.5,5.5) 16192 16193 print *, modulo(-17,3) 16194 print *, modulo(-17.5,5.5) 16195 16196 print *, modulo(17,-3) 16197 print *, modulo(17.5,-5.5) 16198 end program 16199 16200_See also_: 16201 *note MOD:: 16202 16203 16204File: gfortran.info, Node: MOVE_ALLOC, Next: MVBITS, Prev: MODULO, Up: Intrinsic Procedures 16205 162069.203 'MOVE_ALLOC' -- Move allocation from one object to another 16207================================================================ 16208 16209_Description_: 16210 'MOVE_ALLOC(FROM, TO)' moves the allocation from FROM to TO. FROM 16211 will become deallocated in the process. 16212 16213_Standard_: 16214 Fortran 2003 and later 16215 16216_Class_: 16217 Pure subroutine 16218 16219_Syntax_: 16220 'CALL MOVE_ALLOC(FROM, TO)' 16221 16222_Arguments_: 16223 FROM 'ALLOCATABLE', 'INTENT(INOUT)', may be of any 16224 type and kind. 16225 TO 'ALLOCATABLE', 'INTENT(OUT)', shall be of the 16226 same type, kind and rank as FROM. 16227 16228_Return value_: 16229 None 16230 16231_Example_: 16232 program test_move_alloc 16233 integer, allocatable :: a(:), b(:) 16234 16235 allocate(a(3)) 16236 a = [ 1, 2, 3 ] 16237 call move_alloc(a, b) 16238 print *, allocated(a), allocated(b) 16239 print *, b 16240 end program test_move_alloc 16241 16242 16243File: gfortran.info, Node: MVBITS, Next: NEAREST, Prev: MOVE_ALLOC, Up: Intrinsic Procedures 16244 162459.204 'MVBITS' -- Move bits from one integer to another 16246======================================================= 16247 16248_Description_: 16249 Moves LEN bits from positions FROMPOS through 'FROMPOS+LEN-1' of 16250 FROM to positions TOPOS through 'TOPOS+LEN-1' of TO. The portion 16251 of argument TO not affected by the movement of bits is unchanged. 16252 The values of 'FROMPOS+LEN-1' and 'TOPOS+LEN-1' must be less than 16253 'BIT_SIZE(FROM)'. 16254 16255_Standard_: 16256 Fortran 90 and later, has overloads that are GNU extensions 16257 16258_Class_: 16259 Elemental subroutine 16260 16261_Syntax_: 16262 'CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)' 16263 16264_Arguments_: 16265 FROM The type shall be 'INTEGER'. 16266 FROMPOS The type shall be 'INTEGER'. 16267 LEN The type shall be 'INTEGER'. 16268 TO The type shall be 'INTEGER', of the same kind as 16269 FROM. 16270 TOPOS The type shall be 'INTEGER'. 16271 16272_Specific names_: 16273 Name Argument Return type Standard 16274 'MVBITS(A)' 'INTEGER A' 'INTEGER' Fortran 90 and 16275 later 16276 'BMVBITS(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 16277 A' 16278 'IMVBITS(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 16279 A' 16280 'JMVBITS(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 16281 A' 16282 'KMVBITS(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 16283 A' 16284 16285_See also_: 16286 *note IBCLR::, *note IBSET::, *note IBITS::, *note IAND::, *note 16287 IOR::, *note IEOR:: 16288 16289 16290File: gfortran.info, Node: NEAREST, Next: NEW_LINE, Prev: MVBITS, Up: Intrinsic Procedures 16291 162929.205 'NEAREST' -- Nearest representable number 16293=============================================== 16294 16295_Description_: 16296 'NEAREST(X, S)' returns the processor-representable number nearest 16297 to 'X' in the direction indicated by the sign of 'S'. 16298 16299_Standard_: 16300 Fortran 90 and later 16301 16302_Class_: 16303 Elemental function 16304 16305_Syntax_: 16306 'RESULT = NEAREST(X, S)' 16307 16308_Arguments_: 16309 X Shall be of type 'REAL'. 16310 S Shall be of type 'REAL' and not equal to zero. 16311 16312_Return value_: 16313 The return value is of the same type as 'X'. If 'S' is positive, 16314 'NEAREST' returns the processor-representable number greater than 16315 'X' and nearest to it. If 'S' is negative, 'NEAREST' returns the 16316 processor-representable number smaller than 'X' and nearest to it. 16317 16318_Example_: 16319 program test_nearest 16320 real :: x, y 16321 x = nearest(42.0, 1.0) 16322 y = nearest(42.0, -1.0) 16323 write (*,"(3(G20.15))") x, y, x - y 16324 end program test_nearest 16325 16326 16327File: gfortran.info, Node: NEW_LINE, Next: NINT, Prev: NEAREST, Up: Intrinsic Procedures 16328 163299.206 'NEW_LINE' -- New line character 16330====================================== 16331 16332_Description_: 16333 'NEW_LINE(C)' returns the new-line character. 16334 16335_Standard_: 16336 Fortran 2003 and later 16337 16338_Class_: 16339 Inquiry function 16340 16341_Syntax_: 16342 'RESULT = NEW_LINE(C)' 16343 16344_Arguments_: 16345 C The argument shall be a scalar or array of the 16346 type 'CHARACTER'. 16347 16348_Return value_: 16349 Returns a CHARACTER scalar of length one with the new-line 16350 character of the same kind as parameter C. 16351 16352_Example_: 16353 program newline 16354 implicit none 16355 write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.' 16356 end program newline 16357 16358 16359File: gfortran.info, Node: NINT, Next: NORM2, Prev: NEW_LINE, Up: Intrinsic Procedures 16360 163619.207 'NINT' -- Nearest whole number 16362==================================== 16363 16364_Description_: 16365 'NINT(A)' rounds its argument to the nearest whole number. 16366 16367_Standard_: 16368 Fortran 77 and later, with KIND argument Fortran 90 and later 16369 16370_Class_: 16371 Elemental function 16372 16373_Syntax_: 16374 'RESULT = NINT(A [, KIND])' 16375 16376_Arguments_: 16377 A The type of the argument shall be 'REAL'. 16378 KIND (Optional) An 'INTEGER' initialization 16379 expression indicating the kind parameter of the 16380 result. 16381 16382_Return value_: 16383 Returns A with the fractional portion of its magnitude eliminated 16384 by rounding to the nearest whole number and with its sign 16385 preserved, converted to an 'INTEGER' of the default kind. 16386 16387_Example_: 16388 program test_nint 16389 real(4) x4 16390 real(8) x8 16391 x4 = 1.234E0_4 16392 x8 = 4.321_8 16393 print *, nint(x4), idnint(x8) 16394 end program test_nint 16395 16396_Specific names_: 16397 Name Argument Return Type Standard 16398 'NINT(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and 16399 later 16400 'IDNINT(A)' 'REAL(8) A' 'INTEGER' Fortran 77 and 16401 later 16402 16403_See also_: 16404 *note CEILING::, *note FLOOR:: 16405 16406 16407File: gfortran.info, Node: NORM2, Next: NOT, Prev: NINT, Up: Intrinsic Procedures 16408 164099.208 'NORM2' -- Euclidean vector norms 16410======================================= 16411 16412_Description_: 16413 Calculates the Euclidean vector norm (L_2 norm) of of ARRAY along 16414 dimension DIM. 16415 16416_Standard_: 16417 Fortran 2008 and later 16418 16419_Class_: 16420 Transformational function 16421 16422_Syntax_: 16423 'RESULT = NORM2(ARRAY[, DIM])' 16424 16425_Arguments_: 16426 ARRAY Shall be an array of type 'REAL' 16427 DIM (Optional) shall be a scalar of type 'INTEGER' 16428 with a value in the range from 1 to n, where n 16429 equals the rank of ARRAY. 16430 16431_Return value_: 16432 The result is of the same type as ARRAY. 16433 16434 If DIM is absent, a scalar with the square root of the sum of all 16435 elements in ARRAY squared is returned. Otherwise, an array of rank 16436 n-1, where n equals the rank of ARRAY, and a shape similar to that 16437 of ARRAY with dimension DIM dropped is returned. 16438 16439_Example_: 16440 PROGRAM test_sum 16441 REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ] 16442 print *, NORM2(x) ! = sqrt(55.) ~ 7.416 16443 END PROGRAM 16444 16445 16446File: gfortran.info, Node: NOT, Next: NULL, Prev: NORM2, Up: Intrinsic Procedures 16447 164489.209 'NOT' -- Logical negation 16449=============================== 16450 16451_Description_: 16452 'NOT' returns the bitwise Boolean inverse of I. 16453 16454_Standard_: 16455 Fortran 90 and later, has overloads that are GNU extensions 16456 16457_Class_: 16458 Elemental function 16459 16460_Syntax_: 16461 'RESULT = NOT(I)' 16462 16463_Arguments_: 16464 I The type shall be 'INTEGER'. 16465 16466_Return value_: 16467 The return type is 'INTEGER', of the same kind as the argument. 16468 16469_Specific names_: 16470 Name Argument Return type Standard 16471 'NOT(A)' 'INTEGER A' 'INTEGER' Fortran 95 and 16472 later 16473 'BNOT(A)' 'INTEGER(1) 'INTEGER(1)' GNU extension 16474 A' 16475 'INOT(A)' 'INTEGER(2) 'INTEGER(2)' GNU extension 16476 A' 16477 'JNOT(A)' 'INTEGER(4) 'INTEGER(4)' GNU extension 16478 A' 16479 'KNOT(A)' 'INTEGER(8) 'INTEGER(8)' GNU extension 16480 A' 16481 16482_See also_: 16483 *note IAND::, *note IEOR::, *note IOR::, *note IBITS::, *note 16484 IBSET::, *note IBCLR:: 16485 16486 16487File: gfortran.info, Node: NULL, Next: NUM_IMAGES, Prev: NOT, Up: Intrinsic Procedures 16488 164899.210 'NULL' -- Function that returns an disassociated pointer 16490============================================================== 16491 16492_Description_: 16493 Returns a disassociated pointer. 16494 16495 If MOLD is present, a disassociated pointer of the same type is 16496 returned, otherwise the type is determined by context. 16497 16498 In Fortran 95, MOLD is optional. Please note that Fortran 2003 16499 includes cases where it is required. 16500 16501_Standard_: 16502 Fortran 95 and later 16503 16504_Class_: 16505 Transformational function 16506 16507_Syntax_: 16508 'PTR => NULL([MOLD])' 16509 16510_Arguments_: 16511 MOLD (Optional) shall be a pointer of any association 16512 status and of any type. 16513 16514_Return value_: 16515 A disassociated pointer. 16516 16517_Example_: 16518 REAL, POINTER, DIMENSION(:) :: VEC => NULL () 16519 16520_See also_: 16521 *note ASSOCIATED:: 16522 16523 16524File: gfortran.info, Node: NUM_IMAGES, Next: OR, Prev: NULL, Up: Intrinsic Procedures 16525 165269.211 'NUM_IMAGES' -- Function that returns the number of images 16527================================================================ 16528 16529_Description_: 16530 Returns the number of images. 16531 16532_Standard_: 16533 Fortran 2008 and later. With DISTANCE or FAILED argument, 16534 Technical Specification (TS) 18508 or later 16535 16536_Class_: 16537 Transformational function 16538 16539_Syntax_: 16540 'RESULT = NUM_IMAGES(DISTANCE, FAILED)' 16541 16542_Arguments_: 16543 DISTANCE (optional, intent(in)) Nonnegative scalar 16544 integer 16545 FAILED (optional, intent(in)) Scalar logical expression 16546 16547_Return value_: 16548 Scalar default-kind integer. If DISTANCE is not present or has 16549 value 0, the number of images in the current team is returned. For 16550 values smaller or equal distance to the initial team, it returns 16551 the number of images index on the ancestor team which has a 16552 distance of DISTANCE from the invoking team. If DISTANCE is larger 16553 than the distance to the initial team, the number of images of the 16554 initial team is returned. If FAILED is not present the total 16555 number of images is returned; if it has the value '.TRUE.', the 16556 number of failed images is returned, otherwise, the number of 16557 images which do have not the failed status. 16558 16559_Example_: 16560 INTEGER :: value[*] 16561 INTEGER :: i 16562 value = THIS_IMAGE() 16563 SYNC ALL 16564 IF (THIS_IMAGE() == 1) THEN 16565 DO i = 1, NUM_IMAGES() 16566 WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i] 16567 END DO 16568 END IF 16569 16570_See also_: 16571 *note THIS_IMAGE::, *note IMAGE_INDEX:: 16572 16573 16574File: gfortran.info, Node: OR, Next: PACK, Prev: NUM_IMAGES, Up: Intrinsic Procedures 16575 165769.212 'OR' -- Bitwise logical OR 16577================================ 16578 16579_Description_: 16580 Bitwise logical 'OR'. 16581 16582 This intrinsic routine is provided for backwards compatibility with 16583 GNU Fortran 77. For integer arguments, programmers should consider 16584 the use of the *note IOR:: intrinsic defined by the Fortran 16585 standard. 16586 16587_Standard_: 16588 GNU extension 16589 16590_Class_: 16591 Function 16592 16593_Syntax_: 16594 'RESULT = OR(I, J)' 16595 16596_Arguments_: 16597 I The type shall be either a scalar 'INTEGER' type 16598 or a scalar 'LOGICAL' type or a 16599 boz-literal-constant. 16600 J The type shall be the same as the type of I or a 16601 boz-literal-constant. I and J shall not both be 16602 boz-literal-constants. If either I and J is a 16603 boz-literal-constant, then the other argument 16604 must be a scalar 'INTEGER'. 16605 16606_Return value_: 16607 The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'. 16608 If the kind type parameters differ, then the smaller kind type is 16609 implicitly converted to larger kind, and the return has the larger 16610 kind. A boz-literal-constant is converted to an 'INTEGER' with the 16611 kind type parameter of the other argument as-if a call to *note 16612 INT:: occurred. 16613 16614_Example_: 16615 PROGRAM test_or 16616 LOGICAL :: T = .TRUE., F = .FALSE. 16617 INTEGER :: a, b 16618 DATA a / Z'F' /, b / Z'3' / 16619 16620 WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F) 16621 WRITE (*,*) OR(a, b) 16622 END PROGRAM 16623 16624_See also_: 16625 Fortran 95 elemental function: *note IOR:: 16626 16627 16628File: gfortran.info, Node: PACK, Next: PARITY, Prev: OR, Up: Intrinsic Procedures 16629 166309.213 'PACK' -- Pack an array into an array of rank one 16631======================================================= 16632 16633_Description_: 16634 Stores the elements of ARRAY in an array of rank one. 16635 16636 The beginning of the resulting array is made up of elements whose 16637 MASK equals 'TRUE'. Afterwards, positions are filled with elements 16638 taken from VECTOR. 16639 16640_Standard_: 16641 Fortran 90 and later 16642 16643_Class_: 16644 Transformational function 16645 16646_Syntax_: 16647 'RESULT = PACK(ARRAY, MASK[,VECTOR])' 16648 16649_Arguments_: 16650 ARRAY Shall be an array of any type. 16651 MASK Shall be an array of type 'LOGICAL' and of the 16652 same size as ARRAY. Alternatively, it may be a 16653 'LOGICAL' scalar. 16654 VECTOR (Optional) shall be an array of the same type as 16655 ARRAY and of rank one. If present, the number 16656 of elements in VECTOR shall be equal to or 16657 greater than the number of true elements in 16658 MASK. If MASK is scalar, the number of elements 16659 in VECTOR shall be equal to or greater than the 16660 number of elements in ARRAY. 16661 16662_Return value_: 16663 The result is an array of rank one and the same type as that of 16664 ARRAY. If VECTOR is present, the result size is that of VECTOR, 16665 the number of 'TRUE' values in MASK otherwise. 16666 16667_Example_: 16668 Gathering nonzero elements from an array: 16669 PROGRAM test_pack_1 16670 INTEGER :: m(6) 16671 m = (/ 1, 0, 0, 0, 5, 0 /) 16672 WRITE(*, FMT="(6(I0, ' '))") pack(m, m /= 0) ! "1 5" 16673 END PROGRAM 16674 16675 Gathering nonzero elements from an array and appending elements 16676 from VECTOR: 16677 PROGRAM test_pack_2 16678 INTEGER :: m(4) 16679 m = (/ 1, 0, 0, 2 /) 16680 ! The following results in "1 2 3 4" 16681 WRITE(*, FMT="(4(I0, ' '))") pack(m, m /= 0, (/ 0, 0, 3, 4 /)) 16682 END PROGRAM 16683 16684_See also_: 16685 *note UNPACK:: 16686 16687 16688File: gfortran.info, Node: PARITY, Next: PERROR, Prev: PACK, Up: Intrinsic Procedures 16689 166909.214 'PARITY' -- Reduction with exclusive OR 16691============================================= 16692 16693_Description_: 16694 Calculates the parity, i.e. the reduction using '.XOR.', of MASK 16695 along dimension DIM. 16696 16697_Standard_: 16698 Fortran 2008 and later 16699 16700_Class_: 16701 Transformational function 16702 16703_Syntax_: 16704 'RESULT = PARITY(MASK[, DIM])' 16705 16706_Arguments_: 16707 LOGICAL Shall be an array of type 'LOGICAL' 16708 DIM (Optional) shall be a scalar of type 'INTEGER' 16709 with a value in the range from 1 to n, where n 16710 equals the rank of MASK. 16711 16712_Return value_: 16713 The result is of the same type as MASK. 16714 16715 If DIM is absent, a scalar with the parity of all elements in MASK 16716 is returned, i.e. true if an odd number of elements is '.true.' 16717 and false otherwise. If DIM is present, an array of rank n-1, 16718 where n equals the rank of ARRAY, and a shape similar to that of 16719 MASK with dimension DIM dropped is returned. 16720 16721_Example_: 16722 PROGRAM test_sum 16723 LOGICAL :: x(2) = [ .true., .false. ] 16724 print *, PARITY(x) ! prints "T" (true). 16725 END PROGRAM 16726 16727 16728File: gfortran.info, Node: PERROR, Next: POPCNT, Prev: PARITY, Up: Intrinsic Procedures 16729 167309.215 'PERROR' -- Print system error message 16731============================================ 16732 16733_Description_: 16734 Prints (on the C 'stderr' stream) a newline-terminated error 16735 message corresponding to the last system error. This is prefixed 16736 by STRING, a colon and a space. See 'perror(3)'. 16737 16738_Standard_: 16739 GNU extension 16740 16741_Class_: 16742 Subroutine 16743 16744_Syntax_: 16745 'CALL PERROR(STRING)' 16746 16747_Arguments_: 16748 STRING A scalar of type 'CHARACTER' and of the default 16749 kind. 16750 16751_See also_: 16752 *note IERRNO:: 16753 16754 16755File: gfortran.info, Node: POPCNT, Next: POPPAR, Prev: PERROR, Up: Intrinsic Procedures 16756 167579.216 'POPCNT' -- Number of bits set 16758==================================== 16759 16760_Description_: 16761 'POPCNT(I)' returns the number of bits set ('1' bits) in the binary 16762 representation of 'I'. 16763 16764_Standard_: 16765 Fortran 2008 and later 16766 16767_Class_: 16768 Elemental function 16769 16770_Syntax_: 16771 'RESULT = POPCNT(I)' 16772 16773_Arguments_: 16774 I Shall be of type 'INTEGER'. 16775 16776_Return value_: 16777 The return value is of type 'INTEGER' and of the default integer 16778 kind. 16779 16780_Example_: 16781 program test_population 16782 print *, popcnt(127), poppar(127) 16783 print *, popcnt(huge(0_4)), poppar(huge(0_4)) 16784 print *, popcnt(huge(0_8)), poppar(huge(0_8)) 16785 end program test_population 16786_See also_: 16787 *note POPPAR::, *note LEADZ::, *note TRAILZ:: 16788 16789 16790File: gfortran.info, Node: POPPAR, Next: PRECISION, Prev: POPCNT, Up: Intrinsic Procedures 16791 167929.217 'POPPAR' -- Parity of the number of bits set 16793================================================== 16794 16795_Description_: 16796 'POPPAR(I)' returns parity of the integer 'I', i.e. the parity of 16797 the number of bits set ('1' bits) in the binary representation of 16798 'I'. It is equal to 0 if 'I' has an even number of bits set, and 1 16799 for an odd number of '1' bits. 16800 16801_Standard_: 16802 Fortran 2008 and later 16803 16804_Class_: 16805 Elemental function 16806 16807_Syntax_: 16808 'RESULT = POPPAR(I)' 16809 16810_Arguments_: 16811 I Shall be of type 'INTEGER'. 16812 16813_Return value_: 16814 The return value is of type 'INTEGER' and of the default integer 16815 kind. 16816 16817_Example_: 16818 program test_population 16819 print *, popcnt(127), poppar(127) 16820 print *, popcnt(huge(0_4)), poppar(huge(0_4)) 16821 print *, popcnt(huge(0_8)), poppar(huge(0_8)) 16822 end program test_population 16823_See also_: 16824 *note POPCNT::, *note LEADZ::, *note TRAILZ:: 16825 16826 16827File: gfortran.info, Node: PRECISION, Next: PRESENT, Prev: POPPAR, Up: Intrinsic Procedures 16828 168299.218 'PRECISION' -- Decimal precision of a real kind 16830===================================================== 16831 16832_Description_: 16833 'PRECISION(X)' returns the decimal precision in the model of the 16834 type of 'X'. 16835 16836_Standard_: 16837 Fortran 90 and later 16838 16839_Class_: 16840 Inquiry function 16841 16842_Syntax_: 16843 'RESULT = PRECISION(X)' 16844 16845_Arguments_: 16846 X Shall be of type 'REAL' or 'COMPLEX'. It may be 16847 scalar or valued. 16848 16849_Return value_: 16850 The return value is of type 'INTEGER' and of the default integer 16851 kind. 16852 16853_Example_: 16854 program prec_and_range 16855 real(kind=4) :: x(2) 16856 complex(kind=8) :: y 16857 16858 print *, precision(x), range(x) 16859 print *, precision(y), range(y) 16860 end program prec_and_range 16861_See also_: 16862 *note SELECTED_REAL_KIND::, *note RANGE:: 16863 16864 16865File: gfortran.info, Node: PRESENT, Next: PRODUCT, Prev: PRECISION, Up: Intrinsic Procedures 16866 168679.219 'PRESENT' -- Determine whether an optional dummy argument is specified 16868============================================================================ 16869 16870_Description_: 16871 Determines whether an optional dummy argument is present. 16872 16873_Standard_: 16874 Fortran 90 and later 16875 16876_Class_: 16877 Inquiry function 16878 16879_Syntax_: 16880 'RESULT = PRESENT(A)' 16881 16882_Arguments_: 16883 A May be of any type and may be a pointer, scalar 16884 or array value, or a dummy procedure. It shall 16885 be the name of an optional dummy argument 16886 accessible within the current subroutine or 16887 function. 16888 16889_Return value_: 16890 Returns either 'TRUE' if the optional argument A is present, or 16891 'FALSE' otherwise. 16892 16893_Example_: 16894 PROGRAM test_present 16895 WRITE(*,*) f(), f(42) ! "F T" 16896 CONTAINS 16897 LOGICAL FUNCTION f(x) 16898 INTEGER, INTENT(IN), OPTIONAL :: x 16899 f = PRESENT(x) 16900 END FUNCTION 16901 END PROGRAM 16902 16903 16904File: gfortran.info, Node: PRODUCT, Next: RADIX, Prev: PRESENT, Up: Intrinsic Procedures 16905 169069.220 'PRODUCT' -- Product of array elements 16907============================================ 16908 16909_Description_: 16910 Multiplies the elements of ARRAY along dimension DIM if the 16911 corresponding element in MASK is 'TRUE'. 16912 16913_Standard_: 16914 Fortran 90 and later 16915 16916_Class_: 16917 Transformational function 16918 16919_Syntax_: 16920 'RESULT = PRODUCT(ARRAY[, MASK])' 16921 'RESULT = PRODUCT(ARRAY, DIM[, MASK])' 16922 16923_Arguments_: 16924 ARRAY Shall be an array of type 'INTEGER', 'REAL' or 16925 'COMPLEX'. 16926 DIM (Optional) shall be a scalar of type 'INTEGER' 16927 with a value in the range from 1 to n, where n 16928 equals the rank of ARRAY. 16929 MASK (Optional) shall be of type 'LOGICAL' and either 16930 be a scalar or an array of the same shape as 16931 ARRAY. 16932 16933_Return value_: 16934 The result is of the same type as ARRAY. 16935 16936 If DIM is absent, a scalar with the product of all elements in 16937 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 16938 the rank of ARRAY, and a shape similar to that of ARRAY with 16939 dimension DIM dropped is returned. 16940 16941_Example_: 16942 PROGRAM test_product 16943 INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /) 16944 print *, PRODUCT(x) ! all elements, product = 120 16945 print *, PRODUCT(x, MASK=MOD(x, 2)==1) ! odd elements, product = 15 16946 END PROGRAM 16947 16948_See also_: 16949 *note SUM:: 16950 16951 16952File: gfortran.info, Node: RADIX, Next: RAN, Prev: PRODUCT, Up: Intrinsic Procedures 16953 169549.221 'RADIX' -- Base of a model number 16955======================================= 16956 16957_Description_: 16958 'RADIX(X)' returns the base of the model representing the entity X. 16959 16960_Standard_: 16961 Fortran 90 and later 16962 16963_Class_: 16964 Inquiry function 16965 16966_Syntax_: 16967 'RESULT = RADIX(X)' 16968 16969_Arguments_: 16970 X Shall be of type 'INTEGER' or 'REAL' 16971 16972_Return value_: 16973 The return value is a scalar of type 'INTEGER' and of the default 16974 integer kind. 16975 16976_Example_: 16977 program test_radix 16978 print *, "The radix for the default integer kind is", radix(0) 16979 print *, "The radix for the default real kind is", radix(0.0) 16980 end program test_radix 16981_See also_: 16982 *note SELECTED_REAL_KIND:: 16983 16984 16985File: gfortran.info, Node: RAN, Next: RAND, Prev: RADIX, Up: Intrinsic Procedures 16986 169879.222 'RAN' -- Real pseudo-random number 16988======================================== 16989 16990_Description_: 16991 For compatibility with HP FORTRAN 77/iX, the 'RAN' intrinsic is 16992 provided as an alias for 'RAND'. See *note RAND:: for complete 16993 documentation. 16994 16995_Standard_: 16996 GNU extension 16997 16998_Class_: 16999 Function 17000 17001_See also_: 17002 *note RAND::, *note RANDOM_NUMBER:: 17003 17004 17005File: gfortran.info, Node: RAND, Next: RANDOM_INIT, Prev: RAN, Up: Intrinsic Procedures 17006 170079.223 'RAND' -- Real pseudo-random number 17008========================================= 17009 17010_Description_: 17011 'RAND(FLAG)' returns a pseudo-random number from a uniform 17012 distribution between 0 and 1. If FLAG is 0, the next number in the 17013 current sequence is returned; if FLAG is 1, the generator is 17014 restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is 17015 used as a new seed with 'SRAND'. 17016 17017 This intrinsic routine is provided for backwards compatibility with 17018 GNU Fortran 77. It implements a simple modulo generator as 17019 provided by 'g77'. For new code, one should consider the use of 17020 *note RANDOM_NUMBER:: as it implements a superior algorithm. 17021 17022_Standard_: 17023 GNU extension 17024 17025_Class_: 17026 Function 17027 17028_Syntax_: 17029 'RESULT = RAND(I)' 17030 17031_Arguments_: 17032 I Shall be a scalar 'INTEGER' of kind 4. 17033 17034_Return value_: 17035 The return value is of 'REAL' type and the default kind. 17036 17037_Example_: 17038 program test_rand 17039 integer,parameter :: seed = 86456 17040 17041 call srand(seed) 17042 print *, rand(), rand(), rand(), rand() 17043 print *, rand(seed), rand(), rand(), rand() 17044 end program test_rand 17045 17046_See also_: 17047 *note SRAND::, *note RANDOM_NUMBER:: 17048 17049 17050File: gfortran.info, Node: RANDOM_INIT, Next: RANDOM_NUMBER, Prev: RAND, Up: Intrinsic Procedures 17051 170529.224 'RANDOM_INIT' -- Initialize a pseudo-random number generator 17053================================================================== 17054 17055_Description_: 17056 Initializes the state of the pseudorandom number generator used by 17057 'RANDOM_NUMBER'. 17058 17059_Standard_: 17060 Fortran 2018 17061 17062_Class_: 17063 Subroutine 17064 17065_Syntax_: 17066 'CALL RANDOM_INIT(REPEATABLE, IMAGE_DISTINCT)' 17067 17068_Arguments_: 17069 REPEATABLE Shall be a scalar with a 'LOGICAL' type, and it 17070 is 'INTENT(IN)'. If it is '.true.', the seed is 17071 set to a processor-dependent value that is the 17072 same each time 'RANDOM_INIT' is called from the 17073 same image. The term "same image" means a 17074 single instance of program execution. The 17075 sequence of random numbers is different for 17076 repeated execution of the program. If it is 17077 '.false.', the seed is set to a 17078 processor-dependent value. 17079 IMAGE_DISTINCT Shall be a scalar with a 'LOGICAL' type, and it 17080 is 'INTENT(IN)'. If it is '.true.', the seed is 17081 set to a processor-dependent value that is 17082 distinct from th seed set by a call to 17083 'RANDOM_INIT' in another image. If it is 17084 '.false.', the seed is set value that does 17085 depend which image called 'RANDOM_INIT'. 17086 17087_Example_: 17088 program test_random_seed 17089 implicit none 17090 real x(3), y(3) 17091 call random_init(.true., .true.) 17092 call random_number(x) 17093 call random_init(.true., .true.) 17094 call random_number(y) 17095 ! x and y are the same sequence 17096 if (any(x /= y)) call abort 17097 end program test_random_seed 17098 17099_See also_: 17100 *note RANDOM_NUMBER::, *note RANDOM_SEED:: 17101 17102 17103File: gfortran.info, Node: RANDOM_NUMBER, Next: RANDOM_SEED, Prev: RANDOM_INIT, Up: Intrinsic Procedures 17104 171059.225 'RANDOM_NUMBER' -- Pseudo-random number 17106============================================= 17107 17108_Description_: 17109 Returns a single pseudorandom number or an array of pseudorandom 17110 numbers from the uniform distribution over the range 0 \leq x < 1. 17111 17112 The runtime-library implements the xoshiro256** pseudorandom number 17113 generator (PRNG). This generator has a period of 2^{256} - 1, and 17114 when using multiple threads up to 2^{128} threads can each generate 17115 2^{128} random numbers before any aliasing occurs. 17116 17117 Note that in a multi-threaded program (e.g. using OpenMP 17118 directives), each thread will have its own random number state. 17119 For details of the seeding procedure, see the documentation for the 17120 'RANDOM_SEED' intrinsic. 17121 17122_Standard_: 17123 Fortran 90 and later 17124 17125_Class_: 17126 Subroutine 17127 17128_Syntax_: 17129 'RANDOM_NUMBER(HARVEST)' 17130 17131_Arguments_: 17132 HARVEST Shall be a scalar or an array of type 'REAL'. 17133 17134_Example_: 17135 program test_random_number 17136 REAL :: r(5,5) 17137 CALL RANDOM_NUMBER(r) 17138 end program 17139 17140_See also_: 17141 *note RANDOM_SEED::, *note RANDOM_INIT:: 17142 17143 17144File: gfortran.info, Node: RANDOM_SEED, Next: RANGE, Prev: RANDOM_NUMBER, Up: Intrinsic Procedures 17145 171469.226 'RANDOM_SEED' -- Initialize a pseudo-random number sequence 17147================================================================= 17148 17149_Description_: 17150 Restarts or queries the state of the pseudorandom number generator 17151 used by 'RANDOM_NUMBER'. 17152 17153 If 'RANDOM_SEED' is called without arguments, it is seeded with 17154 random data retrieved from the operating system. 17155 17156 As an extension to the Fortran standard, the GFortran 17157 'RANDOM_NUMBER' supports multiple threads. Each thread in a 17158 multi-threaded program has its own seed. When 'RANDOM_SEED' is 17159 called either without arguments or with the PUT argument, the given 17160 seed is copied into a master seed as well as the seed of the 17161 current thread. When a new thread uses 'RANDOM_NUMBER' for the 17162 first time, the seed is copied from the master seed, and forwarded 17163 N * 2^{128} steps to guarantee that the random stream does not 17164 alias any other stream in the system, where N is the number of 17165 threads that have used 'RANDOM_NUMBER' so far during the program 17166 execution. 17167 17168_Standard_: 17169 Fortran 90 and later 17170 17171_Class_: 17172 Subroutine 17173 17174_Syntax_: 17175 'CALL RANDOM_SEED([SIZE, PUT, GET])' 17176 17177_Arguments_: 17178 SIZE (Optional) Shall be a scalar and of type default 17179 'INTEGER', with 'INTENT(OUT)'. It specifies the 17180 minimum size of the arrays used with the PUT and 17181 GET arguments. 17182 PUT (Optional) Shall be an array of type default 17183 'INTEGER' and rank one. It is 'INTENT(IN)' and 17184 the size of the array must be larger than or 17185 equal to the number returned by the SIZE 17186 argument. 17187 GET (Optional) Shall be an array of type default 17188 'INTEGER' and rank one. It is 'INTENT(OUT)' and 17189 the size of the array must be larger than or 17190 equal to the number returned by the SIZE 17191 argument. 17192 17193_Example_: 17194 program test_random_seed 17195 implicit none 17196 integer, allocatable :: seed(:) 17197 integer :: n 17198 17199 call random_seed(size = n) 17200 allocate(seed(n)) 17201 call random_seed(get=seed) 17202 write (*, *) seed 17203 end program test_random_seed 17204 17205_See also_: 17206 *note RANDOM_NUMBER::, *note RANDOM_INIT:: 17207 17208 17209File: gfortran.info, Node: RANGE, Next: RANK, Prev: RANDOM_SEED, Up: Intrinsic Procedures 17210 172119.227 'RANGE' -- Decimal exponent range 17212======================================= 17213 17214_Description_: 17215 'RANGE(X)' returns the decimal exponent range in the model of the 17216 type of 'X'. 17217 17218_Standard_: 17219 Fortran 90 and later 17220 17221_Class_: 17222 Inquiry function 17223 17224_Syntax_: 17225 'RESULT = RANGE(X)' 17226 17227_Arguments_: 17228 X Shall be of type 'INTEGER', 'REAL' or 'COMPLEX'. 17229 17230_Return value_: 17231 The return value is of type 'INTEGER' and of the default integer 17232 kind. 17233 17234_Example_: 17235 See 'PRECISION' for an example. 17236_See also_: 17237 *note SELECTED_REAL_KIND::, *note PRECISION:: 17238 17239 17240File: gfortran.info, Node: RANK, Next: REAL, Prev: RANGE, Up: Intrinsic Procedures 17241 172429.228 'RANK' -- Rank of a data object 17243===================================== 17244 17245_Description_: 17246 'RANK(A)' returns the rank of a scalar or array data object. 17247 17248_Standard_: 17249 Technical Specification (TS) 29113 17250 17251_Class_: 17252 Inquiry function 17253 17254_Syntax_: 17255 'RESULT = RANK(A)' 17256 17257_Arguments_: 17258 A can be of any type 17259 17260_Return value_: 17261 The return value is of type 'INTEGER' and of the default integer 17262 kind. For arrays, their rank is returned; for scalars zero is 17263 returned. 17264 17265_Example_: 17266 program test_rank 17267 integer :: a 17268 real, allocatable :: b(:,:) 17269 17270 print *, rank(a), rank(b) ! Prints: 0 2 17271 end program test_rank 17272 17273 17274File: gfortran.info, Node: REAL, Next: RENAME, Prev: RANK, Up: Intrinsic Procedures 17275 172769.229 'REAL' -- Convert to real type 17277==================================== 17278 17279_Description_: 17280 'REAL(A [, KIND])' converts its argument A to a real type. The 17281 'REALPART' function is provided for compatibility with 'g77', and 17282 its use is strongly discouraged. 17283 17284_Standard_: 17285 Fortran 77 and later, with KIND argument Fortran 90 and later, has 17286 GNU extensions 17287 17288_Class_: 17289 Elemental function 17290 17291_Syntax_: 17292 'RESULT = REAL(A [, KIND])' 17293 'RESULT = REALPART(Z)' 17294 17295_Arguments_: 17296 A Shall be 'INTEGER', 'REAL', or 'COMPLEX'. 17297 KIND (Optional) An 'INTEGER' initialization 17298 expression indicating the kind parameter of the 17299 result. 17300 17301_Return value_: 17302 These functions return a 'REAL' variable or array under the 17303 following rules: 17304 17305 (A) 17306 'REAL(A)' is converted to a default real type if A is an 17307 integer or real variable. 17308 (B) 17309 'REAL(A)' is converted to a real type with the kind type 17310 parameter of A if A is a complex variable. 17311 (C) 17312 'REAL(A, KIND)' is converted to a real type with kind type 17313 parameter KIND if A is a complex, integer, or real variable. 17314 17315_Example_: 17316 program test_real 17317 complex :: x = (1.0, 2.0) 17318 print *, real(x), real(x,8), realpart(x) 17319 end program test_real 17320 17321_Specific names_: 17322 Name Argument Return type Standard 17323 'FLOAT(A)' 'INTEGER(4)' 'REAL(4)' GNU extension 17324 'DFLOAT(A)' 'INTEGER(4)' 'REAL(8)' GNU extension 17325 'FLOATI(A)' 'INTEGER(2)' 'REAL(4)' GNU extension 17326 'FLOATJ(A)' 'INTEGER(4)' 'REAL(4)' GNU extension 17327 'FLOATK(A)' 'INTEGER(8)' 'REAL(4)' GNU extension 17328 'SNGL(A)' 'INTEGER(8)' 'REAL(4)' GNU extension 17329 17330_See also_: 17331 *note DBLE:: 17332 17333 17334File: gfortran.info, Node: RENAME, Next: REPEAT, Prev: REAL, Up: Intrinsic Procedures 17335 173369.230 'RENAME' -- Rename a file 17337=============================== 17338 17339_Description_: 17340 Renames a file from file PATH1 to PATH2. A null character 17341 ('CHAR(0)') can be used to mark the end of the names in PATH1 and 17342 PATH2; otherwise, trailing blanks in the file names are ignored. 17343 If the STATUS argument is supplied, it contains 0 on success or a 17344 nonzero error code upon return; see 'rename(2)'. 17345 17346 This intrinsic is provided in both subroutine and function forms; 17347 however, only one form can be used in any given program unit. 17348 17349_Standard_: 17350 GNU extension 17351 17352_Class_: 17353 Subroutine, function 17354 17355_Syntax_: 17356 'CALL RENAME(PATH1, PATH2 [, STATUS])' 17357 'STATUS = RENAME(PATH1, PATH2)' 17358 17359_Arguments_: 17360 PATH1 Shall be of default 'CHARACTER' type. 17361 PATH2 Shall be of default 'CHARACTER' type. 17362 STATUS (Optional) Shall be of default 'INTEGER' type. 17363 17364_See also_: 17365 *note LINK:: 17366 17367 17368File: gfortran.info, Node: REPEAT, Next: RESHAPE, Prev: RENAME, Up: Intrinsic Procedures 17369 173709.231 'REPEAT' -- Repeated string concatenation 17371=============================================== 17372 17373_Description_: 17374 Concatenates NCOPIES copies of a string. 17375 17376_Standard_: 17377 Fortran 90 and later 17378 17379_Class_: 17380 Transformational function 17381 17382_Syntax_: 17383 'RESULT = REPEAT(STRING, NCOPIES)' 17384 17385_Arguments_: 17386 STRING Shall be scalar and of type 'CHARACTER'. 17387 NCOPIES Shall be scalar and of type 'INTEGER'. 17388 17389_Return value_: 17390 A new scalar of type 'CHARACTER' built up from NCOPIES copies of 17391 STRING. 17392 17393_Example_: 17394 program test_repeat 17395 write(*,*) repeat("x", 5) ! "xxxxx" 17396 end program 17397 17398 17399File: gfortran.info, Node: RESHAPE, Next: RRSPACING, Prev: REPEAT, Up: Intrinsic Procedures 17400 174019.232 'RESHAPE' -- Function to reshape an array 17402=============================================== 17403 17404_Description_: 17405 Reshapes SOURCE to correspond to SHAPE. If necessary, the new 17406 array may be padded with elements from PAD or permuted as defined 17407 by ORDER. 17408 17409_Standard_: 17410 Fortran 90 and later 17411 17412_Class_: 17413 Transformational function 17414 17415_Syntax_: 17416 'RESULT = RESHAPE(SOURCE, SHAPE[, PAD, ORDER])' 17417 17418_Arguments_: 17419 SOURCE Shall be an array of any type. 17420 SHAPE Shall be of type 'INTEGER' and an array of rank 17421 one. Its values must be positive or zero. 17422 PAD (Optional) shall be an array of the same type as 17423 SOURCE. 17424 ORDER (Optional) shall be of type 'INTEGER' and an 17425 array of the same shape as SHAPE. Its values 17426 shall be a permutation of the numbers from 1 to 17427 n, where n is the size of SHAPE. If ORDER is 17428 absent, the natural ordering shall be assumed. 17429 17430_Return value_: 17431 The result is an array of shape SHAPE with the same type as SOURCE. 17432 17433_Example_: 17434 PROGRAM test_reshape 17435 INTEGER, DIMENSION(4) :: x 17436 WRITE(*,*) SHAPE(x) ! prints "4" 17437 WRITE(*,*) SHAPE(RESHAPE(x, (/2, 2/))) ! prints "2 2" 17438 END PROGRAM 17439 17440_See also_: 17441 *note SHAPE:: 17442 17443 17444File: gfortran.info, Node: RRSPACING, Next: RSHIFT, Prev: RESHAPE, Up: Intrinsic Procedures 17445 174469.233 'RRSPACING' -- Reciprocal of the relative spacing 17447======================================================= 17448 17449_Description_: 17450 'RRSPACING(X)' returns the reciprocal of the relative spacing of 17451 model numbers near X. 17452 17453_Standard_: 17454 Fortran 90 and later 17455 17456_Class_: 17457 Elemental function 17458 17459_Syntax_: 17460 'RESULT = RRSPACING(X)' 17461 17462_Arguments_: 17463 X Shall be of type 'REAL'. 17464 17465_Return value_: 17466 The return value is of the same type and kind as X. The value 17467 returned is equal to 'ABS(FRACTION(X)) * 17468 FLOAT(RADIX(X))**DIGITS(X)'. 17469 17470_See also_: 17471 *note SPACING:: 17472 17473 17474File: gfortran.info, Node: RSHIFT, Next: SAME_TYPE_AS, Prev: RRSPACING, Up: Intrinsic Procedures 17475 174769.234 'RSHIFT' -- Right shift bits 17477================================== 17478 17479_Description_: 17480 'RSHIFT' returns a value corresponding to I with all of the bits 17481 shifted right by SHIFT places. SHIFT shall be nonnegative and less 17482 than or equal to 'BIT_SIZE(I)', otherwise the result value is 17483 undefined. Bits shifted out from the right end are lost. The fill 17484 is arithmetic: the bits shifted in from the left end are equal to 17485 the leftmost bit, which in two's complement representation is the 17486 sign bit. 17487 17488 This function has been superseded by the 'SHIFTA' intrinsic, which 17489 is standard in Fortran 2008 and later. 17490 17491_Standard_: 17492 GNU extension 17493 17494_Class_: 17495 Elemental function 17496 17497_Syntax_: 17498 'RESULT = RSHIFT(I, SHIFT)' 17499 17500_Arguments_: 17501 I The type shall be 'INTEGER'. 17502 SHIFT The type shall be 'INTEGER'. 17503 17504_Return value_: 17505 The return value is of type 'INTEGER' and of the same kind as I. 17506 17507_See also_: 17508 *note ISHFT::, *note ISHFTC::, *note LSHIFT::, *note SHIFTA::, 17509 *note SHIFTR::, *note SHIFTL:: 17510 17511 17512File: gfortran.info, Node: SAME_TYPE_AS, Next: SCALE, Prev: RSHIFT, Up: Intrinsic Procedures 17513 175149.235 'SAME_TYPE_AS' -- Query dynamic types for equality 17515======================================================== 17516 17517_Description_: 17518 Query dynamic types for equality. 17519 17520_Standard_: 17521 Fortran 2003 and later 17522 17523_Class_: 17524 Inquiry function 17525 17526_Syntax_: 17527 'RESULT = SAME_TYPE_AS(A, B)' 17528 17529_Arguments_: 17530 A Shall be an object of extensible declared type 17531 or unlimited polymorphic. 17532 B Shall be an object of extensible declared type 17533 or unlimited polymorphic. 17534 17535_Return value_: 17536 The return value is a scalar of type default logical. It is true 17537 if and only if the dynamic type of A is the same as the dynamic 17538 type of B. 17539 17540_See also_: 17541 *note EXTENDS_TYPE_OF:: 17542 17543 17544File: gfortran.info, Node: SCALE, Next: SCAN, Prev: SAME_TYPE_AS, Up: Intrinsic Procedures 17545 175469.236 'SCALE' -- Scale a real value 17547=================================== 17548 17549_Description_: 17550 'SCALE(X,I)' returns 'X * RADIX(X)**I'. 17551 17552_Standard_: 17553 Fortran 90 and later 17554 17555_Class_: 17556 Elemental function 17557 17558_Syntax_: 17559 'RESULT = SCALE(X, I)' 17560 17561_Arguments_: 17562 X The type of the argument shall be a 'REAL'. 17563 I The type of the argument shall be a 'INTEGER'. 17564 17565_Return value_: 17566 The return value is of the same type and kind as X. Its value is 17567 'X * RADIX(X)**I'. 17568 17569_Example_: 17570 program test_scale 17571 real :: x = 178.1387e-4 17572 integer :: i = 5 17573 print *, scale(x,i), x*radix(x)**i 17574 end program test_scale 17575 17576 17577File: gfortran.info, Node: SCAN, Next: SECNDS, Prev: SCALE, Up: Intrinsic Procedures 17578 175799.237 'SCAN' -- Scan a string for the presence of a set of characters 17580===================================================================== 17581 17582_Description_: 17583 Scans a STRING for any of the characters in a SET of characters. 17584 17585 If BACK is either absent or equals 'FALSE', this function returns 17586 the position of the leftmost character of STRING that is in SET. 17587 If BACK equals 'TRUE', the rightmost position is returned. If no 17588 character of SET is found in STRING, the result is zero. 17589 17590_Standard_: 17591 Fortran 90 and later, with KIND argument Fortran 2003 and later 17592 17593_Class_: 17594 Elemental function 17595 17596_Syntax_: 17597 'RESULT = SCAN(STRING, SET[, BACK [, KIND]])' 17598 17599_Arguments_: 17600 STRING Shall be of type 'CHARACTER'. 17601 SET Shall be of type 'CHARACTER'. 17602 BACK (Optional) shall be of type 'LOGICAL'. 17603 KIND (Optional) An 'INTEGER' initialization 17604 expression indicating the kind parameter of the 17605 result. 17606 17607_Return value_: 17608 The return value is of type 'INTEGER' and of kind KIND. If KIND is 17609 absent, the return value is of default integer kind. 17610 17611_Example_: 17612 PROGRAM test_scan 17613 WRITE(*,*) SCAN("FORTRAN", "AO") ! 2, found 'O' 17614 WRITE(*,*) SCAN("FORTRAN", "AO", .TRUE.) ! 6, found 'A' 17615 WRITE(*,*) SCAN("FORTRAN", "C++") ! 0, found none 17616 END PROGRAM 17617 17618_See also_: 17619 *note INDEX intrinsic::, *note VERIFY:: 17620 17621 17622File: gfortran.info, Node: SECNDS, Next: SECOND, Prev: SCAN, Up: Intrinsic Procedures 17623 176249.238 'SECNDS' -- Time function 17625=============================== 17626 17627_Description_: 17628 'SECNDS(X)' gets the time in seconds from the real-time system 17629 clock. X is a reference time, also in seconds. If this is zero, 17630 the time in seconds from midnight is returned. This function is 17631 non-standard and its use is discouraged. 17632 17633_Standard_: 17634 GNU extension 17635 17636_Class_: 17637 Function 17638 17639_Syntax_: 17640 'RESULT = SECNDS (X)' 17641 17642_Arguments_: 17643 T Shall be of type 'REAL(4)'. 17644 X Shall be of type 'REAL(4)'. 17645 17646_Return value_: 17647 None 17648 17649_Example_: 17650 program test_secnds 17651 integer :: i 17652 real(4) :: t1, t2 17653 print *, secnds (0.0) ! seconds since midnight 17654 t1 = secnds (0.0) ! reference time 17655 do i = 1, 10000000 ! do something 17656 end do 17657 t2 = secnds (t1) ! elapsed time 17658 print *, "Something took ", t2, " seconds." 17659 end program test_secnds 17660 17661 17662File: gfortran.info, Node: SECOND, Next: SELECTED_CHAR_KIND, Prev: SECNDS, Up: Intrinsic Procedures 17663 176649.239 'SECOND' -- CPU time function 17665=================================== 17666 17667_Description_: 17668 Returns a 'REAL(4)' value representing the elapsed CPU time in 17669 seconds. This provides the same functionality as the standard 17670 'CPU_TIME' intrinsic, and is only included for backwards 17671 compatibility. 17672 17673 This intrinsic is provided in both subroutine and function forms; 17674 however, only one form can be used in any given program unit. 17675 17676_Standard_: 17677 GNU extension 17678 17679_Class_: 17680 Subroutine, function 17681 17682_Syntax_: 17683 'CALL SECOND(TIME)' 17684 'TIME = SECOND()' 17685 17686_Arguments_: 17687 TIME Shall be of type 'REAL(4)'. 17688 17689_Return value_: 17690 In either syntax, TIME is set to the process's current runtime in 17691 seconds. 17692 17693_See also_: 17694 *note CPU_TIME:: 17695 17696 17697File: gfortran.info, Node: SELECTED_CHAR_KIND, Next: SELECTED_INT_KIND, Prev: SECOND, Up: Intrinsic Procedures 17698 176999.240 'SELECTED_CHAR_KIND' -- Choose character kind 17700=================================================== 17701 17702_Description_: 17703 17704 'SELECTED_CHAR_KIND(NAME)' returns the kind value for the character 17705 set named NAME, if a character set with such a name is supported, 17706 or -1 otherwise. Currently, supported character sets include 17707 "ASCII" and "DEFAULT", which are equivalent, and "ISO_10646" 17708 (Universal Character Set, UCS-4) which is commonly known as 17709 Unicode. 17710 17711_Standard_: 17712 Fortran 2003 and later 17713 17714_Class_: 17715 Transformational function 17716 17717_Syntax_: 17718 'RESULT = SELECTED_CHAR_KIND(NAME)' 17719 17720_Arguments_: 17721 NAME Shall be a scalar and of the default character 17722 type. 17723 17724_Example_: 17725 program character_kind 17726 use iso_fortran_env 17727 implicit none 17728 integer, parameter :: ascii = selected_char_kind ("ascii") 17729 integer, parameter :: ucs4 = selected_char_kind ('ISO_10646') 17730 17731 character(kind=ascii, len=26) :: alphabet 17732 character(kind=ucs4, len=30) :: hello_world 17733 17734 alphabet = ascii_"abcdefghijklmnopqrstuvwxyz" 17735 hello_world = ucs4_'Hello World and Ni Hao -- ' & 17736 // char (int (z'4F60'), ucs4) & 17737 // char (int (z'597D'), ucs4) 17738 17739 write (*,*) alphabet 17740 17741 open (output_unit, encoding='UTF-8') 17742 write (*,*) trim (hello_world) 17743 end program character_kind 17744 17745 17746File: gfortran.info, Node: SELECTED_INT_KIND, Next: SELECTED_REAL_KIND, Prev: SELECTED_CHAR_KIND, Up: Intrinsic Procedures 17747 177489.241 'SELECTED_INT_KIND' -- Choose integer kind 17749================================================ 17750 17751_Description_: 17752 'SELECTED_INT_KIND(R)' return the kind value of the smallest 17753 integer type that can represent all values ranging from -10^R 17754 (exclusive) to 10^R (exclusive). If there is no integer kind that 17755 accommodates this range, 'SELECTED_INT_KIND' returns -1. 17756 17757_Standard_: 17758 Fortran 90 and later 17759 17760_Class_: 17761 Transformational function 17762 17763_Syntax_: 17764 'RESULT = SELECTED_INT_KIND(R)' 17765 17766_Arguments_: 17767 R Shall be a scalar and of type 'INTEGER'. 17768 17769_Example_: 17770 program large_integers 17771 integer,parameter :: k5 = selected_int_kind(5) 17772 integer,parameter :: k15 = selected_int_kind(15) 17773 integer(kind=k5) :: i5 17774 integer(kind=k15) :: i15 17775 17776 print *, huge(i5), huge(i15) 17777 17778 ! The following inequalities are always true 17779 print *, huge(i5) >= 10_k5**5-1 17780 print *, huge(i15) >= 10_k15**15-1 17781 end program large_integers 17782 17783 17784File: gfortran.info, Node: SELECTED_REAL_KIND, Next: SET_EXPONENT, Prev: SELECTED_INT_KIND, Up: Intrinsic Procedures 17785 177869.242 'SELECTED_REAL_KIND' -- Choose real kind 17787============================================== 17788 17789_Description_: 17790 'SELECTED_REAL_KIND(P,R)' returns the kind value of a real data 17791 type with decimal precision of at least 'P' digits, exponent range 17792 of at least 'R', and with a radix of 'RADIX'. 17793 17794_Standard_: 17795 Fortran 90 and later, with 'RADIX' Fortran 2008 or later 17796 17797_Class_: 17798 Transformational function 17799 17800_Syntax_: 17801 'RESULT = SELECTED_REAL_KIND([P, R, RADIX])' 17802 17803_Arguments_: 17804 P (Optional) shall be a scalar and of type 17805 'INTEGER'. 17806 R (Optional) shall be a scalar and of type 17807 'INTEGER'. 17808 RADIX (Optional) shall be a scalar and of type 17809 'INTEGER'. 17810 Before Fortran 2008, at least one of the arguments R or P shall be 17811 present; since Fortran 2008, they are assumed to be zero if absent. 17812 17813_Return value_: 17814 17815 'SELECTED_REAL_KIND' returns the value of the kind type parameter 17816 of a real data type with decimal precision of at least 'P' digits, 17817 a decimal exponent range of at least 'R', and with the requested 17818 'RADIX'. If the 'RADIX' parameter is absent, real kinds with any 17819 radix can be returned. If more than one real data type meet the 17820 criteria, the kind of the data type with the smallest decimal 17821 precision is returned. If no real data type matches the criteria, 17822 the result is 17823 -1 if the processor does not support a real data type with a 17824 precision greater than or equal to 'P', but the 'R' and 17825 'RADIX' requirements can be fulfilled 17826 -2 if the processor does not support a real type with an exponent 17827 range greater than or equal to 'R', but 'P' and 'RADIX' are 17828 fulfillable 17829 -3 if 'RADIX' but not 'P' and 'R' requirements 17830 are fulfillable 17831 -4 if 'RADIX' and either 'P' or 'R' requirements 17832 are fulfillable 17833 -5 if there is no real type with the given 'RADIX' 17834 17835_Example_: 17836 program real_kinds 17837 integer,parameter :: p6 = selected_real_kind(6) 17838 integer,parameter :: p10r100 = selected_real_kind(10,100) 17839 integer,parameter :: r400 = selected_real_kind(r=400) 17840 real(kind=p6) :: x 17841 real(kind=p10r100) :: y 17842 real(kind=r400) :: z 17843 17844 print *, precision(x), range(x) 17845 print *, precision(y), range(y) 17846 print *, precision(z), range(z) 17847 end program real_kinds 17848_See also_: 17849 *note PRECISION::, *note RANGE::, *note RADIX:: 17850 17851 17852File: gfortran.info, Node: SET_EXPONENT, Next: SHAPE, Prev: SELECTED_REAL_KIND, Up: Intrinsic Procedures 17853 178549.243 'SET_EXPONENT' -- Set the exponent of the model 17855===================================================== 17856 17857_Description_: 17858 'SET_EXPONENT(X, I)' returns the real number whose fractional part 17859 is that that of X and whose exponent part is I. 17860 17861_Standard_: 17862 Fortran 90 and later 17863 17864_Class_: 17865 Elemental function 17866 17867_Syntax_: 17868 'RESULT = SET_EXPONENT(X, I)' 17869 17870_Arguments_: 17871 X Shall be of type 'REAL'. 17872 I Shall be of type 'INTEGER'. 17873 17874_Return value_: 17875 The return value is of the same type and kind as X. The real 17876 number whose fractional part is that that of X and whose exponent 17877 part if I is returned; it is 'FRACTION(X) * RADIX(X)**I'. 17878 17879_Example_: 17880 PROGRAM test_setexp 17881 REAL :: x = 178.1387e-4 17882 INTEGER :: i = 17 17883 PRINT *, SET_EXPONENT(x, i), FRACTION(x) * RADIX(x)**i 17884 END PROGRAM 17885 17886 17887File: gfortran.info, Node: SHAPE, Next: SHIFTA, Prev: SET_EXPONENT, Up: Intrinsic Procedures 17888 178899.244 'SHAPE' -- Determine the shape of an array 17890================================================ 17891 17892_Description_: 17893 Determines the shape of an array. 17894 17895_Standard_: 17896 Fortran 90 and later, with KIND argument Fortran 2003 and later 17897 17898_Class_: 17899 Inquiry function 17900 17901_Syntax_: 17902 'RESULT = SHAPE(SOURCE [, KIND])' 17903 17904_Arguments_: 17905 SOURCE Shall be an array or scalar of any type. If 17906 SOURCE is a pointer it must be associated and 17907 allocatable arrays must be allocated. 17908 KIND (Optional) An 'INTEGER' initialization 17909 expression indicating the kind parameter of the 17910 result. 17911 17912_Return value_: 17913 An 'INTEGER' array of rank one with as many elements as SOURCE has 17914 dimensions. The elements of the resulting array correspond to the 17915 extend of SOURCE along the respective dimensions. If SOURCE is a 17916 scalar, the result is the rank one array of size zero. If KIND is 17917 absent, the return value has the default integer kind otherwise the 17918 specified kind. 17919 17920_Example_: 17921 PROGRAM test_shape 17922 INTEGER, DIMENSION(-1:1, -1:2) :: A 17923 WRITE(*,*) SHAPE(A) ! (/ 3, 4 /) 17924 WRITE(*,*) SIZE(SHAPE(42)) ! (/ /) 17925 END PROGRAM 17926 17927_See also_: 17928 *note RESHAPE::, *note SIZE:: 17929 17930 17931File: gfortran.info, Node: SHIFTA, Next: SHIFTL, Prev: SHAPE, Up: Intrinsic Procedures 17932 179339.245 'SHIFTA' -- Right shift with fill 17934======================================= 17935 17936_Description_: 17937 'SHIFTA' returns a value corresponding to I with all of the bits 17938 shifted right by SHIFT places. SHIFT that be nonnegative and less 17939 than or equal to 'BIT_SIZE(I)', otherwise the result value is 17940 undefined. Bits shifted out from the right end are lost. The fill 17941 is arithmetic: the bits shifted in from the left end are equal to 17942 the leftmost bit, which in two's complement representation is the 17943 sign bit. 17944 17945_Standard_: 17946 Fortran 2008 and later 17947 17948_Class_: 17949 Elemental function 17950 17951_Syntax_: 17952 'RESULT = SHIFTA(I, SHIFT)' 17953 17954_Arguments_: 17955 I The type shall be 'INTEGER'. 17956 SHIFT The type shall be 'INTEGER'. 17957 17958_Return value_: 17959 The return value is of type 'INTEGER' and of the same kind as I. 17960 17961_See also_: 17962 *note SHIFTL::, *note SHIFTR:: 17963 17964 17965File: gfortran.info, Node: SHIFTL, Next: SHIFTR, Prev: SHIFTA, Up: Intrinsic Procedures 17966 179679.246 'SHIFTL' -- Left shift 17968============================ 17969 17970_Description_: 17971 'SHIFTL' returns a value corresponding to I with all of the bits 17972 shifted left by SHIFT places. SHIFT shall be nonnegative and less 17973 than or equal to 'BIT_SIZE(I)', otherwise the result value is 17974 undefined. Bits shifted out from the left end are lost, and bits 17975 shifted in from the right end are set to 0. 17976 17977_Standard_: 17978 Fortran 2008 and later 17979 17980_Class_: 17981 Elemental function 17982 17983_Syntax_: 17984 'RESULT = SHIFTL(I, SHIFT)' 17985 17986_Arguments_: 17987 I The type shall be 'INTEGER'. 17988 SHIFT The type shall be 'INTEGER'. 17989 17990_Return value_: 17991 The return value is of type 'INTEGER' and of the same kind as I. 17992 17993_See also_: 17994 *note SHIFTA::, *note SHIFTR:: 17995 17996 17997File: gfortran.info, Node: SHIFTR, Next: SIGN, Prev: SHIFTL, Up: Intrinsic Procedures 17998 179999.247 'SHIFTR' -- Right shift 18000============================= 18001 18002_Description_: 18003 'SHIFTR' returns a value corresponding to I with all of the bits 18004 shifted right by SHIFT places. SHIFT shall be nonnegative and less 18005 than or equal to 'BIT_SIZE(I)', otherwise the result value is 18006 undefined. Bits shifted out from the right end are lost, and bits 18007 shifted in from the left end are set to 0. 18008 18009_Standard_: 18010 Fortran 2008 and later 18011 18012_Class_: 18013 Elemental function 18014 18015_Syntax_: 18016 'RESULT = SHIFTR(I, SHIFT)' 18017 18018_Arguments_: 18019 I The type shall be 'INTEGER'. 18020 SHIFT The type shall be 'INTEGER'. 18021 18022_Return value_: 18023 The return value is of type 'INTEGER' and of the same kind as I. 18024 18025_See also_: 18026 *note SHIFTA::, *note SHIFTL:: 18027 18028 18029File: gfortran.info, Node: SIGN, Next: SIGNAL, Prev: SHIFTR, Up: Intrinsic Procedures 18030 180319.248 'SIGN' -- Sign copying function 18032===================================== 18033 18034_Description_: 18035 'SIGN(A,B)' returns the value of A with the sign of B. 18036 18037_Standard_: 18038 Fortran 77 and later 18039 18040_Class_: 18041 Elemental function 18042 18043_Syntax_: 18044 'RESULT = SIGN(A, B)' 18045 18046_Arguments_: 18047 A Shall be of type 'INTEGER' or 'REAL' 18048 B Shall be of the same type and kind as A. 18049 18050_Return value_: 18051 The kind of the return value is that of A and B. If B\ge 0 then 18052 the result is 'ABS(A)', else it is '-ABS(A)'. 18053 18054_Example_: 18055 program test_sign 18056 print *, sign(-12,1) 18057 print *, sign(-12,0) 18058 print *, sign(-12,-1) 18059 18060 print *, sign(-12.,1.) 18061 print *, sign(-12.,0.) 18062 print *, sign(-12.,-1.) 18063 end program test_sign 18064 18065_Specific names_: 18066 Name Arguments Return type Standard 18067 'SIGN(A,B)' 'REAL(4) A, 'REAL(4)' Fortran 77 and 18068 B' later 18069 'ISIGN(A,B)' 'INTEGER(4) 'INTEGER(4)' Fortran 77 and 18070 A, B' later 18071 'DSIGN(A,B)' 'REAL(8) A, 'REAL(8)' Fortran 77 and 18072 B' later 18073 18074 18075File: gfortran.info, Node: SIGNAL, Next: SIN, Prev: SIGN, Up: Intrinsic Procedures 18076 180779.249 'SIGNAL' -- Signal handling subroutine (or function) 18078========================================================== 18079 18080_Description_: 18081 'SIGNAL(NUMBER, HANDLER [, STATUS])' causes external subroutine 18082 HANDLER to be executed with a single integer argument when signal 18083 NUMBER occurs. If HANDLER is an integer, it can be used to turn 18084 off handling of signal NUMBER or revert to its default action. See 18085 'signal(2)'. 18086 18087 If 'SIGNAL' is called as a subroutine and the STATUS argument is 18088 supplied, it is set to the value returned by 'signal(2)'. 18089 18090_Standard_: 18091 GNU extension 18092 18093_Class_: 18094 Subroutine, function 18095 18096_Syntax_: 18097 'CALL SIGNAL(NUMBER, HANDLER [, STATUS])' 18098 'STATUS = SIGNAL(NUMBER, HANDLER)' 18099 18100_Arguments_: 18101 NUMBER Shall be a scalar integer, with 'INTENT(IN)' 18102 HANDLER Signal handler ('INTEGER FUNCTION' or 18103 'SUBROUTINE') or dummy/global 'INTEGER' scalar. 18104 'INTEGER'. It is 'INTENT(IN)'. 18105 STATUS (Optional) STATUS shall be a scalar integer. It 18106 has 'INTENT(OUT)'. 18107 18108_Return value_: 18109 The 'SIGNAL' function returns the value returned by 'signal(2)'. 18110 18111_Example_: 18112 program test_signal 18113 intrinsic signal 18114 external handler_print 18115 18116 call signal (12, handler_print) 18117 call signal (10, 1) 18118 18119 call sleep (30) 18120 end program test_signal 18121 18122 18123File: gfortran.info, Node: SIN, Next: SIND, Prev: SIGNAL, Up: Intrinsic Procedures 18124 181259.250 'SIN' -- Sine function 18126============================ 18127 18128_Description_: 18129 'SIN(X)' computes the sine of X. 18130 18131_Standard_: 18132 Fortran 77 and later 18133 18134_Class_: 18135 Elemental function 18136 18137_Syntax_: 18138 'RESULT = SIN(X)' 18139 18140_Arguments_: 18141 X The type shall be 'REAL' or 'COMPLEX'. 18142 18143_Return value_: 18144 The return value has same type and kind as X. 18145 18146_Example_: 18147 program test_sin 18148 real :: x = 0.0 18149 x = sin(x) 18150 end program test_sin 18151 18152_Specific names_: 18153 Name Argument Return type Standard 18154 'SIN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 18155 later 18156 'DSIN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 18157 later 18158 'CSIN(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and 18159 X' later 18160 'ZSIN(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 18161 X' 18162 'CDSIN(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 18163 X' 18164 18165_See also_: 18166 Inverse function: *note ASIN:: Degrees function: *note SIND:: 18167 18168 18169File: gfortran.info, Node: SIND, Next: SINH, Prev: SIN, Up: Intrinsic Procedures 18170 181719.251 'SIND' -- Sine function, degrees 18172====================================== 18173 18174_Description_: 18175 'SIND(X)' computes the sine of X in degrees. 18176 18177 This function is for compatibility only and should be avoided in 18178 favor of standard constructs wherever possible. 18179 18180_Standard_: 18181 GNU extension, enabled with '-fdec-math'. 18182 18183_Class_: 18184 Elemental function 18185 18186_Syntax_: 18187 'RESULT = SIND(X)' 18188 18189_Arguments_: 18190 X The type shall be 'REAL' or 'COMPLEX'. 18191 18192_Return value_: 18193 The return value has same type and kind as X, and its value is in 18194 degrees. 18195 18196_Example_: 18197 program test_sind 18198 real :: x = 0.0 18199 x = sind(x) 18200 end program test_sind 18201 18202_Specific names_: 18203 Name Argument Return type Standard 18204 'SIND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 18205 'DSIND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 18206 'CSIND(X)' 'COMPLEX(4) 'COMPLEX(4)' GNU extension 18207 X' 18208 'ZSIND(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 18209 X' 18210 'CDSIND(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 18211 X' 18212 18213_See also_: 18214 Inverse function: *note ASIND:: Radians function: *note SIN:: 18215 18216 18217File: gfortran.info, Node: SINH, Next: SIZE, Prev: SIND, Up: Intrinsic Procedures 18218 182199.252 'SINH' -- Hyperbolic sine function 18220======================================== 18221 18222_Description_: 18223 'SINH(X)' computes the hyperbolic sine of X. 18224 18225_Standard_: 18226 Fortran 90 and later, for a complex argument Fortran 2008 or later, 18227 has a GNU extension 18228 18229_Class_: 18230 Elemental function 18231 18232_Syntax_: 18233 'RESULT = SINH(X)' 18234 18235_Arguments_: 18236 X The type shall be 'REAL' or 'COMPLEX'. 18237 18238_Return value_: 18239 The return value has same type and kind as X. 18240 18241_Example_: 18242 program test_sinh 18243 real(8) :: x = - 1.0_8 18244 x = sinh(x) 18245 end program test_sinh 18246 18247_Specific names_: 18248 Name Argument Return type Standard 18249 'DSINH(X)' 'REAL(8) X' 'REAL(8)' Fortran 90 and 18250 later 18251 18252_See also_: 18253 *note ASINH:: 18254 18255 18256File: gfortran.info, Node: SIZE, Next: SIZEOF, Prev: SINH, Up: Intrinsic Procedures 18257 182589.253 'SIZE' -- Determine the size of an array 18259============================================== 18260 18261_Description_: 18262 Determine the extent of ARRAY along a specified dimension DIM, or 18263 the total number of elements in ARRAY if DIM is absent. 18264 18265_Standard_: 18266 Fortran 90 and later, with KIND argument Fortran 2003 and later 18267 18268_Class_: 18269 Inquiry function 18270 18271_Syntax_: 18272 'RESULT = SIZE(ARRAY[, DIM [, KIND]])' 18273 18274_Arguments_: 18275 ARRAY Shall be an array of any type. If ARRAY is a 18276 pointer it must be associated and allocatable 18277 arrays must be allocated. 18278 DIM (Optional) shall be a scalar of type 'INTEGER' 18279 and its value shall be in the range from 1 to n, 18280 where n equals the rank of ARRAY. 18281 KIND (Optional) An 'INTEGER' initialization 18282 expression indicating the kind parameter of the 18283 result. 18284 18285_Return value_: 18286 The return value is of type 'INTEGER' and of kind KIND. If KIND is 18287 absent, the return value is of default integer kind. 18288 18289_Example_: 18290 PROGRAM test_size 18291 WRITE(*,*) SIZE((/ 1, 2 /)) ! 2 18292 END PROGRAM 18293 18294_See also_: 18295 *note SHAPE::, *note RESHAPE:: 18296 18297 18298File: gfortran.info, Node: SIZEOF, Next: SLEEP, Prev: SIZE, Up: Intrinsic Procedures 18299 183009.254 'SIZEOF' -- Size in bytes of an expression 18301================================================ 18302 18303_Description_: 18304 'SIZEOF(X)' calculates the number of bytes of storage the 18305 expression 'X' occupies. 18306 18307_Standard_: 18308 GNU extension 18309 18310_Class_: 18311 Inquiry function 18312 18313_Syntax_: 18314 'N = SIZEOF(X)' 18315 18316_Arguments_: 18317 X The argument shall be of any type, rank or 18318 shape. 18319 18320_Return value_: 18321 The return value is of type integer and of the system-dependent 18322 kind C_SIZE_T (from the ISO_C_BINDING module). Its value is the 18323 number of bytes occupied by the argument. If the argument has the 18324 'POINTER' attribute, the number of bytes of the storage area 18325 pointed to is returned. If the argument is of a derived type with 18326 'POINTER' or 'ALLOCATABLE' components, the return value does not 18327 account for the sizes of the data pointed to by these components. 18328 If the argument is polymorphic, the size according to the dynamic 18329 type is returned. The argument may not be a procedure or procedure 18330 pointer. Note that the code assumes for arrays that those are 18331 contiguous; for contiguous arrays, it returns the storage or an 18332 array element multiplied by the size of the array. 18333 18334_Example_: 18335 integer :: i 18336 real :: r, s(5) 18337 print *, (sizeof(s)/sizeof(r) == 5) 18338 end 18339 The example will print '.TRUE.' unless you are using a platform 18340 where default 'REAL' variables are unusually padded. 18341 18342_See also_: 18343 *note C_SIZEOF::, *note STORAGE_SIZE:: 18344 18345 18346File: gfortran.info, Node: SLEEP, Next: SPACING, Prev: SIZEOF, Up: Intrinsic Procedures 18347 183489.255 'SLEEP' -- Sleep for the specified number of seconds 18349========================================================== 18350 18351_Description_: 18352 Calling this subroutine causes the process to pause for SECONDS 18353 seconds. 18354 18355_Standard_: 18356 GNU extension 18357 18358_Class_: 18359 Subroutine 18360 18361_Syntax_: 18362 'CALL SLEEP(SECONDS)' 18363 18364_Arguments_: 18365 SECONDS The type shall be of default 'INTEGER'. 18366 18367_Example_: 18368 program test_sleep 18369 call sleep(5) 18370 end 18371 18372 18373File: gfortran.info, Node: SPACING, Next: SPREAD, Prev: SLEEP, Up: Intrinsic Procedures 18374 183759.256 'SPACING' -- Smallest distance between two numbers of a given type 18376======================================================================== 18377 18378_Description_: 18379 Determines the distance between the argument X and the nearest 18380 adjacent number of the same type. 18381 18382_Standard_: 18383 Fortran 90 and later 18384 18385_Class_: 18386 Elemental function 18387 18388_Syntax_: 18389 'RESULT = SPACING(X)' 18390 18391_Arguments_: 18392 X Shall be of type 'REAL'. 18393 18394_Return value_: 18395 The result is of the same type as the input argument X. 18396 18397_Example_: 18398 PROGRAM test_spacing 18399 INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37) 18400 INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200) 18401 18402 WRITE(*,*) spacing(1.0_SGL) ! "1.1920929E-07" on i686 18403 WRITE(*,*) spacing(1.0_DBL) ! "2.220446049250313E-016" on i686 18404 END PROGRAM 18405 18406_See also_: 18407 *note RRSPACING:: 18408 18409 18410File: gfortran.info, Node: SPREAD, Next: SQRT, Prev: SPACING, Up: Intrinsic Procedures 18411 184129.257 'SPREAD' -- Add a dimension to an array 18413============================================= 18414 18415_Description_: 18416 Replicates a SOURCE array NCOPIES times along a specified dimension 18417 DIM. 18418 18419_Standard_: 18420 Fortran 90 and later 18421 18422_Class_: 18423 Transformational function 18424 18425_Syntax_: 18426 'RESULT = SPREAD(SOURCE, DIM, NCOPIES)' 18427 18428_Arguments_: 18429 SOURCE Shall be a scalar or an array of any type and a 18430 rank less than seven. 18431 DIM Shall be a scalar of type 'INTEGER' with a value 18432 in the range from 1 to n+1, where n equals the 18433 rank of SOURCE. 18434 NCOPIES Shall be a scalar of type 'INTEGER'. 18435 18436_Return value_: 18437 The result is an array of the same type as SOURCE and has rank n+1 18438 where n equals the rank of SOURCE. 18439 18440_Example_: 18441 PROGRAM test_spread 18442 INTEGER :: a = 1, b(2) = (/ 1, 2 /) 18443 WRITE(*,*) SPREAD(A, 1, 2) ! "1 1" 18444 WRITE(*,*) SPREAD(B, 1, 2) ! "1 1 2 2" 18445 END PROGRAM 18446 18447_See also_: 18448 *note UNPACK:: 18449 18450 18451File: gfortran.info, Node: SQRT, Next: SRAND, Prev: SPREAD, Up: Intrinsic Procedures 18452 184539.258 'SQRT' -- Square-root function 18454==================================== 18455 18456_Description_: 18457 'SQRT(X)' computes the square root of X. 18458 18459_Standard_: 18460 Fortran 77 and later 18461 18462_Class_: 18463 Elemental function 18464 18465_Syntax_: 18466 'RESULT = SQRT(X)' 18467 18468_Arguments_: 18469 X The type shall be 'REAL' or 'COMPLEX'. 18470 18471_Return value_: 18472 The return value is of type 'REAL' or 'COMPLEX'. The kind type 18473 parameter is the same as X. 18474 18475_Example_: 18476 program test_sqrt 18477 real(8) :: x = 2.0_8 18478 complex :: z = (1.0, 2.0) 18479 x = sqrt(x) 18480 z = sqrt(z) 18481 end program test_sqrt 18482 18483_Specific names_: 18484 Name Argument Return type Standard 18485 'SQRT(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 18486 later 18487 'DSQRT(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 18488 later 18489 'CSQRT(X)' 'COMPLEX(4) 'COMPLEX(4)' Fortran 77 and 18490 X' later 18491 'ZSQRT(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 18492 X' 18493 'CDSQRT(X)' 'COMPLEX(8) 'COMPLEX(8)' GNU extension 18494 X' 18495 18496 18497File: gfortran.info, Node: SRAND, Next: STAT, Prev: SQRT, Up: Intrinsic Procedures 18498 184999.259 'SRAND' -- Reinitialize the random number generator 18500========================================================= 18501 18502_Description_: 18503 'SRAND' reinitializes the pseudo-random number generator called by 18504 'RAND' and 'IRAND'. The new seed used by the generator is 18505 specified by the required argument SEED. 18506 18507_Standard_: 18508 GNU extension 18509 18510_Class_: 18511 Subroutine 18512 18513_Syntax_: 18514 'CALL SRAND(SEED)' 18515 18516_Arguments_: 18517 SEED Shall be a scalar 'INTEGER(kind=4)'. 18518 18519_Return value_: 18520 Does not return anything. 18521 18522_Example_: 18523 See 'RAND' and 'IRAND' for examples. 18524 18525_Notes_: 18526 The Fortran standard specifies the intrinsic subroutines 18527 'RANDOM_SEED' to initialize the pseudo-random number generator and 18528 'RANDOM_NUMBER' to generate pseudo-random numbers. These 18529 subroutines should be used in new codes. 18530 18531 Please note that in GNU Fortran, these two sets of intrinsics 18532 ('RAND', 'IRAND' and 'SRAND' on the one hand, 'RANDOM_NUMBER' and 18533 'RANDOM_SEED' on the other hand) access two independent 18534 pseudo-random number generators. 18535 18536_See also_: 18537 *note RAND::, *note RANDOM_SEED::, *note RANDOM_NUMBER:: 18538 18539 18540File: gfortran.info, Node: STAT, Next: STORAGE_SIZE, Prev: SRAND, Up: Intrinsic Procedures 18541 185429.260 'STAT' -- Get file status 18543=============================== 18544 18545_Description_: 18546 This function returns information about a file. No permissions are 18547 required on the file itself, but execute (search) permission is 18548 required on all of the directories in path that lead to the file. 18549 18550 The elements that are obtained and stored in the array 'VALUES': 18551 'VALUES(1)' Device ID 18552 'VALUES(2)' Inode number 18553 'VALUES(3)' File mode 18554 'VALUES(4)' Number of links 18555 'VALUES(5)' Owner's uid 18556 'VALUES(6)' Owner's gid 18557 'VALUES(7)' ID of device containing directory entry for file 18558 (0 if not available) 18559 'VALUES(8)' File size (bytes) 18560 'VALUES(9)' Last access time 18561 'VALUES(10)'Last modification time 18562 'VALUES(11)'Last file status change time 18563 'VALUES(12)'Preferred I/O block size (-1 if not available) 18564 'VALUES(13)'Number of blocks allocated (-1 if not available) 18565 18566 Not all these elements are relevant on all systems. If an element 18567 is not relevant, it is returned as 0. 18568 18569 This intrinsic is provided in both subroutine and function forms; 18570 however, only one form can be used in any given program unit. 18571 18572_Standard_: 18573 GNU extension 18574 18575_Class_: 18576 Subroutine, function 18577 18578_Syntax_: 18579 'CALL STAT(NAME, VALUES [, STATUS])' 18580 'STATUS = STAT(NAME, VALUES)' 18581 18582_Arguments_: 18583 NAME The type shall be 'CHARACTER', of the default 18584 kind and a valid path within the file system. 18585 VALUES The type shall be 'INTEGER(4), DIMENSION(13)'. 18586 STATUS (Optional) status flag of type 'INTEGER(4)'. 18587 Returns 0 on success and a system specific error 18588 code otherwise. 18589 18590_Example_: 18591 PROGRAM test_stat 18592 INTEGER, DIMENSION(13) :: buff 18593 INTEGER :: status 18594 18595 CALL STAT("/etc/passwd", buff, status) 18596 18597 IF (status == 0) THEN 18598 WRITE (*, FMT="('Device ID:', T30, I19)") buff(1) 18599 WRITE (*, FMT="('Inode number:', T30, I19)") buff(2) 18600 WRITE (*, FMT="('File mode (octal):', T30, O19)") buff(3) 18601 WRITE (*, FMT="('Number of links:', T30, I19)") buff(4) 18602 WRITE (*, FMT="('Owner''s uid:', T30, I19)") buff(5) 18603 WRITE (*, FMT="('Owner''s gid:', T30, I19)") buff(6) 18604 WRITE (*, FMT="('Device where located:', T30, I19)") buff(7) 18605 WRITE (*, FMT="('File size:', T30, I19)") buff(8) 18606 WRITE (*, FMT="('Last access time:', T30, A19)") CTIME(buff(9)) 18607 WRITE (*, FMT="('Last modification time', T30, A19)") CTIME(buff(10)) 18608 WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11)) 18609 WRITE (*, FMT="('Preferred block size:', T30, I19)") buff(12) 18610 WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13) 18611 END IF 18612 END PROGRAM 18613 18614_See also_: 18615 To stat an open file: *note FSTAT:: To stat a link: *note LSTAT:: 18616 18617 18618File: gfortran.info, Node: STORAGE_SIZE, Next: SUM, Prev: STAT, Up: Intrinsic Procedures 18619 186209.261 'STORAGE_SIZE' -- Storage size in bits 18621============================================ 18622 18623_Description_: 18624 Returns the storage size of argument A in bits. 18625_Standard_: 18626 Fortran 2008 and later 18627_Class_: 18628 Inquiry function 18629_Syntax_: 18630 'RESULT = STORAGE_SIZE(A [, KIND])' 18631 18632_Arguments_: 18633 A Shall be a scalar or array of any type. 18634 KIND (Optional) shall be a scalar integer constant 18635 expression. 18636 18637_Return Value_: 18638 The result is a scalar integer with the kind type parameter 18639 specified by KIND (or default integer type if KIND is missing). 18640 The result value is the size expressed in bits for an element of an 18641 array that has the dynamic type and type parameters of A. 18642 18643_See also_: 18644 *note C_SIZEOF::, *note SIZEOF:: 18645 18646 18647File: gfortran.info, Node: SUM, Next: SYMLNK, Prev: STORAGE_SIZE, Up: Intrinsic Procedures 18648 186499.262 'SUM' -- Sum of array elements 18650==================================== 18651 18652_Description_: 18653 Adds the elements of ARRAY along dimension DIM if the corresponding 18654 element in MASK is 'TRUE'. 18655 18656_Standard_: 18657 Fortran 90 and later 18658 18659_Class_: 18660 Transformational function 18661 18662_Syntax_: 18663 'RESULT = SUM(ARRAY[, MASK])' 18664 'RESULT = SUM(ARRAY, DIM[, MASK])' 18665 18666_Arguments_: 18667 ARRAY Shall be an array of type 'INTEGER', 'REAL' or 18668 'COMPLEX'. 18669 DIM (Optional) shall be a scalar of type 'INTEGER' 18670 with a value in the range from 1 to n, where n 18671 equals the rank of ARRAY. 18672 MASK (Optional) shall be of type 'LOGICAL' and either 18673 be a scalar or an array of the same shape as 18674 ARRAY. 18675 18676_Return value_: 18677 The result is of the same type as ARRAY. 18678 18679 If DIM is absent, a scalar with the sum of all elements in ARRAY is 18680 returned. Otherwise, an array of rank n-1, where n equals the rank 18681 of ARRAY, and a shape similar to that of ARRAY with dimension DIM 18682 dropped is returned. 18683 18684_Example_: 18685 PROGRAM test_sum 18686 INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /) 18687 print *, SUM(x) ! all elements, sum = 15 18688 print *, SUM(x, MASK=MOD(x, 2)==1) ! odd elements, sum = 9 18689 END PROGRAM 18690 18691_See also_: 18692 *note PRODUCT:: 18693 18694 18695File: gfortran.info, Node: SYMLNK, Next: SYSTEM, Prev: SUM, Up: Intrinsic Procedures 18696 186979.263 'SYMLNK' -- Create a symbolic link 18698======================================== 18699 18700_Description_: 18701 Makes a symbolic link from file PATH1 to PATH2. A null character 18702 ('CHAR(0)') can be used to mark the end of the names in PATH1 and 18703 PATH2; otherwise, trailing blanks in the file names are ignored. 18704 If the STATUS argument is supplied, it contains 0 on success or a 18705 nonzero error code upon return; see 'symlink(2)'. If the system 18706 does not supply 'symlink(2)', 'ENOSYS' is returned. 18707 18708 This intrinsic is provided in both subroutine and function forms; 18709 however, only one form can be used in any given program unit. 18710 18711_Standard_: 18712 GNU extension 18713 18714_Class_: 18715 Subroutine, function 18716 18717_Syntax_: 18718 'CALL SYMLNK(PATH1, PATH2 [, STATUS])' 18719 'STATUS = SYMLNK(PATH1, PATH2)' 18720 18721_Arguments_: 18722 PATH1 Shall be of default 'CHARACTER' type. 18723 PATH2 Shall be of default 'CHARACTER' type. 18724 STATUS (Optional) Shall be of default 'INTEGER' type. 18725 18726_See also_: 18727 *note LINK::, *note UNLINK:: 18728 18729 18730File: gfortran.info, Node: SYSTEM, Next: SYSTEM_CLOCK, Prev: SYMLNK, Up: Intrinsic Procedures 18731 187329.264 'SYSTEM' -- Execute a shell command 18733========================================= 18734 18735_Description_: 18736 Passes the command COMMAND to a shell (see 'system(3)'). If 18737 argument STATUS is present, it contains the value returned by 18738 'system(3)', which is presumably 0 if the shell command succeeded. 18739 Note that which shell is used to invoke the command is 18740 system-dependent and environment-dependent. 18741 18742 This intrinsic is provided in both subroutine and function forms; 18743 however, only one form can be used in any given program unit. 18744 18745 Note that the 'system' function need not be thread-safe. It is the 18746 responsibility of the user to ensure that 'system' is not called 18747 concurrently. 18748 18749_Standard_: 18750 GNU extension 18751 18752_Class_: 18753 Subroutine, function 18754 18755_Syntax_: 18756 'CALL SYSTEM(COMMAND [, STATUS])' 18757 'STATUS = SYSTEM(COMMAND)' 18758 18759_Arguments_: 18760 COMMAND Shall be of default 'CHARACTER' type. 18761 STATUS (Optional) Shall be of default 'INTEGER' type. 18762 18763_See also_: 18764 *note EXECUTE_COMMAND_LINE::, which is part of the Fortran 2008 18765 standard and should considered in new code for future portability. 18766 18767 18768File: gfortran.info, Node: SYSTEM_CLOCK, Next: TAN, Prev: SYSTEM, Up: Intrinsic Procedures 18769 187709.265 'SYSTEM_CLOCK' -- Time function 18771===================================== 18772 18773_Description_: 18774 Determines the COUNT of a processor clock since an unspecified time 18775 in the past modulo COUNT_MAX, COUNT_RATE determines the number of 18776 clock ticks per second. If the platform supports a monotonic 18777 clock, that clock is used and can, depending on the platform clock 18778 implementation, provide up to nanosecond resolution. If a 18779 monotonic clock is not available, the implementation falls back to 18780 a realtime clock. 18781 18782 COUNT_RATE is system dependent and can vary depending on the kind 18783 of the arguments. For KIND=4 arguments (and smaller integer 18784 kinds), COUNT represents milliseconds, while for KIND=8 arguments 18785 (and larger integer kinds), COUNT typically represents micro- or 18786 nanoseconds depending on resolution of the underlying platform 18787 clock. COUNT_MAX usually equals 'HUGE(COUNT_MAX)'. Note that the 18788 millisecond resolution of the KIND=4 version implies that the COUNT 18789 will wrap around in roughly 25 days. In order to avoid issues with 18790 the wrap around and for more precise timing, please use the KIND=8 18791 version. 18792 18793 If there is no clock, or querying the clock fails, COUNT is set to 18794 '-HUGE(COUNT)', and COUNT_RATE and COUNT_MAX are set to zero. 18795 18796 When running on a platform using the GNU C library (glibc) version 18797 2.16 or older, or a derivative thereof, the high resolution 18798 monotonic clock is available only when linking with the RT library. 18799 This can be done explicitly by adding the '-lrt' flag when linking 18800 the application, but is also done implicitly when using OpenMP. 18801 18802 On the Windows platform, the version with KIND=4 arguments uses the 18803 'GetTickCount' function, whereas the KIND=8 version uses 18804 'QueryPerformanceCounter' and 'QueryPerformanceCounterFrequency'. 18805 For more information, and potential caveats, please see the 18806 platform documentation. 18807 18808_Standard_: 18809 Fortran 90 and later 18810 18811_Class_: 18812 Subroutine 18813 18814_Syntax_: 18815 'CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])' 18816 18817_Arguments_: 18818 COUNT (Optional) shall be a scalar of type 18819 'INTEGER' with 'INTENT(OUT)'. 18820 COUNT_RATE (Optional) shall be a scalar of type 18821 'INTEGER' or 'REAL', with 'INTENT(OUT)'. 18822 COUNT_MAX (Optional) shall be a scalar of type 18823 'INTEGER' with 'INTENT(OUT)'. 18824 18825_Example_: 18826 PROGRAM test_system_clock 18827 INTEGER :: count, count_rate, count_max 18828 CALL SYSTEM_CLOCK(count, count_rate, count_max) 18829 WRITE(*,*) count, count_rate, count_max 18830 END PROGRAM 18831 18832_See also_: 18833 *note DATE_AND_TIME::, *note CPU_TIME:: 18834 18835 18836File: gfortran.info, Node: TAN, Next: TAND, Prev: SYSTEM_CLOCK, Up: Intrinsic Procedures 18837 188389.266 'TAN' -- Tangent function 18839=============================== 18840 18841_Description_: 18842 'TAN(X)' computes the tangent of X. 18843 18844_Standard_: 18845 Fortran 77 and later, for a complex argument Fortran 2008 or later 18846 18847_Class_: 18848 Elemental function 18849 18850_Syntax_: 18851 'RESULT = TAN(X)' 18852 18853_Arguments_: 18854 X The type shall be 'REAL' or 'COMPLEX'. 18855 18856_Return value_: 18857 The return value has same type and kind as X, and its value is in 18858 radians. 18859 18860_Example_: 18861 program test_tan 18862 real(8) :: x = 0.165_8 18863 x = tan(x) 18864 end program test_tan 18865 18866_Specific names_: 18867 Name Argument Return type Standard 18868 'TAN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 18869 later 18870 'DTAN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 18871 later 18872 18873_See also_: 18874 Inverse function: *note ATAN:: Degrees function: *note TAND:: 18875 18876 18877File: gfortran.info, Node: TAND, Next: TANH, Prev: TAN, Up: Intrinsic Procedures 18878 188799.267 'TAND' -- Tangent function, degrees 18880========================================= 18881 18882_Description_: 18883 'TAND(X)' computes the tangent of X in degrees. 18884 18885 This function is for compatibility only and should be avoided in 18886 favor of standard constructs wherever possible. 18887 18888_Standard_: 18889 GNU extension, enabled with '-fdec-math'. 18890 18891_Class_: 18892 Elemental function 18893 18894_Syntax_: 18895 'RESULT = TAND(X)' 18896 18897_Arguments_: 18898 X The type shall be 'REAL' or 'COMPLEX'. 18899 18900_Return value_: 18901 The return value has same type and kind as X, and its value is in 18902 degrees. 18903 18904_Example_: 18905 program test_tand 18906 real(8) :: x = 0.165_8 18907 x = tand(x) 18908 end program test_tand 18909 18910_Specific names_: 18911 Name Argument Return type Standard 18912 'TAND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 18913 'DTAND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 18914 18915_See also_: 18916 Inverse function: *note ATAND:: Radians function: *note TAN:: 18917 18918 18919File: gfortran.info, Node: TANH, Next: THIS_IMAGE, Prev: TAND, Up: Intrinsic Procedures 18920 189219.268 'TANH' -- Hyperbolic tangent function 18922=========================================== 18923 18924_Description_: 18925 'TANH(X)' computes the hyperbolic tangent of X. 18926 18927_Standard_: 18928 Fortran 77 and later, for a complex argument Fortran 2008 or later 18929 18930_Class_: 18931 Elemental function 18932 18933_Syntax_: 18934 'X = TANH(X)' 18935 18936_Arguments_: 18937 X The type shall be 'REAL' or 'COMPLEX'. 18938 18939_Return value_: 18940 The return value has same type and kind as X. If X is complex, the 18941 imaginary part of the result is in radians. If X is 'REAL', the 18942 return value lies in the range - 1 \leq tanh(x) \leq 1 . 18943 18944_Example_: 18945 program test_tanh 18946 real(8) :: x = 2.1_8 18947 x = tanh(x) 18948 end program test_tanh 18949 18950_Specific names_: 18951 Name Argument Return type Standard 18952 'TANH(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and 18953 later 18954 'DTANH(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and 18955 later 18956 18957_See also_: 18958 *note ATANH:: 18959 18960 18961File: gfortran.info, Node: THIS_IMAGE, Next: TIME, Prev: TANH, Up: Intrinsic Procedures 18962 189639.269 'THIS_IMAGE' -- Function that returns the cosubscript index of this image 18964=============================================================================== 18965 18966_Description_: 18967 Returns the cosubscript for this image. 18968 18969_Standard_: 18970 Fortran 2008 and later. With DISTANCE argument, Technical 18971 Specification (TS) 18508 or later 18972 18973_Class_: 18974 Transformational function 18975 18976_Syntax_: 18977 'RESULT = THIS_IMAGE()' 18978 'RESULT = THIS_IMAGE(DISTANCE)' 18979 'RESULT = THIS_IMAGE(COARRAY [, DIM])' 18980 18981_Arguments_: 18982 DISTANCE (optional, intent(in)) Nonnegative scalar 18983 integer (not permitted together with COARRAY). 18984 COARRAY Coarray of any type (optional; if DIM present, 18985 required). 18986 DIM default integer scalar (optional). If present, 18987 DIM shall be between one and the corank of 18988 COARRAY. 18989 18990_Return value_: 18991 Default integer. If COARRAY is not present, it is scalar; if 18992 DISTANCE is not present or has value 0, its value is the image 18993 index on the invoking image for the current team, for values 18994 smaller or equal distance to the initial team, it returns the image 18995 index on the ancestor team which has a distance of DISTANCE from 18996 the invoking team. If DISTANCE is larger than the distance to the 18997 initial team, the image index of the initial team is returned. 18998 Otherwise when the COARRAY is present, if DIM is not present, a 18999 rank-1 array with corank elements is returned, containing the 19000 cosubscripts for COARRAY specifying the invoking image. If DIM is 19001 present, a scalar is returned, with the value of the DIM element of 19002 'THIS_IMAGE(COARRAY)'. 19003 19004_Example_: 19005 INTEGER :: value[*] 19006 INTEGER :: i 19007 value = THIS_IMAGE() 19008 SYNC ALL 19009 IF (THIS_IMAGE() == 1) THEN 19010 DO i = 1, NUM_IMAGES() 19011 WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i] 19012 END DO 19013 END IF 19014 19015 ! Check whether the current image is the initial image 19016 IF (THIS_IMAGE(HUGE(1)) /= THIS_IMAGE()) 19017 error stop "something is rotten here" 19018 19019_See also_: 19020 *note NUM_IMAGES::, *note IMAGE_INDEX:: 19021 19022 19023File: gfortran.info, Node: TIME, Next: TIME8, Prev: THIS_IMAGE, Up: Intrinsic Procedures 19024 190259.270 'TIME' -- Time function 19026============================= 19027 19028_Description_: 19029 Returns the current time encoded as an integer (in the manner of 19030 the function 'time(3)' in the C standard library). This value is 19031 suitable for passing to *note CTIME::, *note GMTIME::, and *note 19032 LTIME::. 19033 19034 This intrinsic is not fully portable, such as to systems with 19035 32-bit 'INTEGER' types but supporting times wider than 32 bits. 19036 Therefore, the values returned by this intrinsic might be, or 19037 become, negative, or numerically less than previous values, during 19038 a single run of the compiled program. 19039 19040 See *note TIME8::, for information on a similar intrinsic that 19041 might be portable to more GNU Fortran implementations, though to 19042 fewer Fortran compilers. 19043 19044_Standard_: 19045 GNU extension 19046 19047_Class_: 19048 Function 19049 19050_Syntax_: 19051 'RESULT = TIME()' 19052 19053_Return value_: 19054 The return value is a scalar of type 'INTEGER(4)'. 19055 19056_See also_: 19057 *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note 19058 LTIME::, *note MCLOCK::, *note TIME8:: 19059 19060 19061File: gfortran.info, Node: TIME8, Next: TINY, Prev: TIME, Up: Intrinsic Procedures 19062 190639.271 'TIME8' -- Time function (64-bit) 19064======================================= 19065 19066_Description_: 19067 Returns the current time encoded as an integer (in the manner of 19068 the function 'time(3)' in the C standard library). This value is 19069 suitable for passing to *note CTIME::, *note GMTIME::, and *note 19070 LTIME::. 19071 19072 _Warning:_ this intrinsic does not increase the range of the timing 19073 values over that returned by 'time(3)'. On a system with a 32-bit 19074 'time(3)', 'TIME8' will return a 32-bit value, even though it is 19075 converted to a 64-bit 'INTEGER(8)' value. That means overflows of 19076 the 32-bit value can still occur. Therefore, the values returned 19077 by this intrinsic might be or become negative or numerically less 19078 than previous values during a single run of the compiled program. 19079 19080_Standard_: 19081 GNU extension 19082 19083_Class_: 19084 Function 19085 19086_Syntax_: 19087 'RESULT = TIME8()' 19088 19089_Return value_: 19090 The return value is a scalar of type 'INTEGER(8)'. 19091 19092_See also_: 19093 *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note 19094 LTIME::, *note MCLOCK8::, *note TIME:: 19095 19096 19097File: gfortran.info, Node: TINY, Next: TRAILZ, Prev: TIME8, Up: Intrinsic Procedures 19098 190999.272 'TINY' -- Smallest positive number of a real kind 19100======================================================= 19101 19102_Description_: 19103 'TINY(X)' returns the smallest positive (non zero) number in the 19104 model of the type of 'X'. 19105 19106_Standard_: 19107 Fortran 90 and later 19108 19109_Class_: 19110 Inquiry function 19111 19112_Syntax_: 19113 'RESULT = TINY(X)' 19114 19115_Arguments_: 19116 X Shall be of type 'REAL'. 19117 19118_Return value_: 19119 The return value is of the same type and kind as X 19120 19121_Example_: 19122 See 'HUGE' for an example. 19123 19124 19125File: gfortran.info, Node: TRAILZ, Next: TRANSFER, Prev: TINY, Up: Intrinsic Procedures 19126 191279.273 'TRAILZ' -- Number of trailing zero bits of an integer 19128============================================================ 19129 19130_Description_: 19131 'TRAILZ' returns the number of trailing zero bits of an integer. 19132 19133_Standard_: 19134 Fortran 2008 and later 19135 19136_Class_: 19137 Elemental function 19138 19139_Syntax_: 19140 'RESULT = TRAILZ(I)' 19141 19142_Arguments_: 19143 I Shall be of type 'INTEGER'. 19144 19145_Return value_: 19146 The type of the return value is the default 'INTEGER'. If all the 19147 bits of 'I' are zero, the result value is 'BIT_SIZE(I)'. 19148 19149_Example_: 19150 PROGRAM test_trailz 19151 WRITE (*,*) TRAILZ(8) ! prints 3 19152 END PROGRAM 19153 19154_See also_: 19155 *note BIT_SIZE::, *note LEADZ::, *note POPPAR::, *note POPCNT:: 19156 19157 19158File: gfortran.info, Node: TRANSFER, Next: TRANSPOSE, Prev: TRAILZ, Up: Intrinsic Procedures 19159 191609.274 'TRANSFER' -- Transfer bit patterns 19161========================================= 19162 19163_Description_: 19164 Interprets the bitwise representation of SOURCE in memory as if it 19165 is the representation of a variable or array of the same type and 19166 type parameters as MOLD. 19167 19168 This is approximately equivalent to the C concept of _casting_ one 19169 type to another. 19170 19171_Standard_: 19172 Fortran 90 and later 19173 19174_Class_: 19175 Transformational function 19176 19177_Syntax_: 19178 'RESULT = TRANSFER(SOURCE, MOLD[, SIZE])' 19179 19180_Arguments_: 19181 SOURCE Shall be a scalar or an array of any type. 19182 MOLD Shall be a scalar or an array of any type. 19183 SIZE (Optional) shall be a scalar of type 'INTEGER'. 19184 19185_Return value_: 19186 The result has the same type as MOLD, with the bit level 19187 representation of SOURCE. If SIZE is present, the result is a 19188 one-dimensional array of length SIZE. If SIZE is absent but MOLD 19189 is an array (of any size or shape), the result is a one- 19190 dimensional array of the minimum length needed to contain the 19191 entirety of the bitwise representation of SOURCE. If SIZE is 19192 absent and MOLD is a scalar, the result is a scalar. 19193 19194 If the bitwise representation of the result is longer than that of 19195 SOURCE, then the leading bits of the result correspond to those of 19196 SOURCE and any trailing bits are filled arbitrarily. 19197 19198 When the resulting bit representation does not correspond to a 19199 valid representation of a variable of the same type as MOLD, the 19200 results are undefined, and subsequent operations on the result 19201 cannot be guaranteed to produce sensible behavior. For example, it 19202 is possible to create 'LOGICAL' variables for which 'VAR' and 19203 '.NOT.VAR' both appear to be true. 19204 19205_Example_: 19206 PROGRAM test_transfer 19207 integer :: x = 2143289344 19208 print *, transfer(x, 1.0) ! prints "NaN" on i686 19209 END PROGRAM 19210 19211 19212File: gfortran.info, Node: TRANSPOSE, Next: TRIM, Prev: TRANSFER, Up: Intrinsic Procedures 19213 192149.275 'TRANSPOSE' -- Transpose an array of rank two 19215=================================================== 19216 19217_Description_: 19218 Transpose an array of rank two. Element (i, j) of the result has 19219 the value 'MATRIX(j, i)', for all i, j. 19220 19221_Standard_: 19222 Fortran 90 and later 19223 19224_Class_: 19225 Transformational function 19226 19227_Syntax_: 19228 'RESULT = TRANSPOSE(MATRIX)' 19229 19230_Arguments_: 19231 MATRIX Shall be an array of any type and have a rank of 19232 two. 19233 19234_Return value_: 19235 The result has the same type as MATRIX, and has shape '(/ m, n /)' 19236 if MATRIX has shape '(/ n, m /)'. 19237 19238 19239File: gfortran.info, Node: TRIM, Next: TTYNAM, Prev: TRANSPOSE, Up: Intrinsic Procedures 19240 192419.276 'TRIM' -- Remove trailing blank characters of a string 19242============================================================ 19243 19244_Description_: 19245 Removes trailing blank characters of a string. 19246 19247_Standard_: 19248 Fortran 90 and later 19249 19250_Class_: 19251 Transformational function 19252 19253_Syntax_: 19254 'RESULT = TRIM(STRING)' 19255 19256_Arguments_: 19257 STRING Shall be a scalar of type 'CHARACTER'. 19258 19259_Return value_: 19260 A scalar of type 'CHARACTER' which length is that of STRING less 19261 the number of trailing blanks. 19262 19263_Example_: 19264 PROGRAM test_trim 19265 CHARACTER(len=10), PARAMETER :: s = "GFORTRAN " 19266 WRITE(*,*) LEN(s), LEN(TRIM(s)) ! "10 8", with/without trailing blanks 19267 END PROGRAM 19268 19269_See also_: 19270 *note ADJUSTL::, *note ADJUSTR:: 19271 19272 19273File: gfortran.info, Node: TTYNAM, Next: UBOUND, Prev: TRIM, Up: Intrinsic Procedures 19274 192759.277 'TTYNAM' -- Get the name of a terminal device. 19276==================================================== 19277 19278_Description_: 19279 Get the name of a terminal device. For more information, see 19280 'ttyname(3)'. 19281 19282 This intrinsic is provided in both subroutine and function forms; 19283 however, only one form can be used in any given program unit. 19284 19285_Standard_: 19286 GNU extension 19287 19288_Class_: 19289 Subroutine, function 19290 19291_Syntax_: 19292 'CALL TTYNAM(UNIT, NAME)' 19293 'NAME = TTYNAM(UNIT)' 19294 19295_Arguments_: 19296 UNIT Shall be a scalar 'INTEGER'. 19297 NAME Shall be of type 'CHARACTER'. 19298 19299_Example_: 19300 PROGRAM test_ttynam 19301 INTEGER :: unit 19302 DO unit = 1, 10 19303 IF (isatty(unit=unit)) write(*,*) ttynam(unit) 19304 END DO 19305 END PROGRAM 19306 19307_See also_: 19308 *note ISATTY:: 19309 19310 19311File: gfortran.info, Node: UBOUND, Next: UCOBOUND, Prev: TTYNAM, Up: Intrinsic Procedures 19312 193139.278 'UBOUND' -- Upper dimension bounds of an array 19314==================================================== 19315 19316_Description_: 19317 Returns the upper bounds of an array, or a single upper bound along 19318 the DIM dimension. 19319_Standard_: 19320 Fortran 90 and later, with KIND argument Fortran 2003 and later 19321 19322_Class_: 19323 Inquiry function 19324 19325_Syntax_: 19326 'RESULT = UBOUND(ARRAY [, DIM [, KIND]])' 19327 19328_Arguments_: 19329 ARRAY Shall be an array, of any type. 19330 DIM (Optional) Shall be a scalar 'INTEGER'. 19331 KIND (Optional) An 'INTEGER' initialization 19332 expression indicating the kind parameter of the 19333 result. 19334 19335_Return value_: 19336 The return value is of type 'INTEGER' and of kind KIND. If KIND is 19337 absent, the return value is of default integer kind. If DIM is 19338 absent, the result is an array of the upper bounds of ARRAY. If 19339 DIM is present, the result is a scalar corresponding to the upper 19340 bound of the array along that dimension. If ARRAY is an expression 19341 rather than a whole array or array structure component, or if it 19342 has a zero extent along the relevant dimension, the upper bound is 19343 taken to be the number of elements along the relevant dimension. 19344 19345_See also_: 19346 *note LBOUND::, *note LCOBOUND:: 19347 19348 19349File: gfortran.info, Node: UCOBOUND, Next: UMASK, Prev: UBOUND, Up: Intrinsic Procedures 19350 193519.279 'UCOBOUND' -- Upper codimension bounds of an array 19352======================================================== 19353 19354_Description_: 19355 Returns the upper cobounds of a coarray, or a single upper cobound 19356 along the DIM codimension. 19357_Standard_: 19358 Fortran 2008 and later 19359 19360_Class_: 19361 Inquiry function 19362 19363_Syntax_: 19364 'RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])' 19365 19366_Arguments_: 19367 ARRAY Shall be an coarray, of any type. 19368 DIM (Optional) Shall be a scalar 'INTEGER'. 19369 KIND (Optional) An 'INTEGER' initialization 19370 expression indicating the kind parameter of the 19371 result. 19372 19373_Return value_: 19374 The return value is of type 'INTEGER' and of kind KIND. If KIND is 19375 absent, the return value is of default integer kind. If DIM is 19376 absent, the result is an array of the lower cobounds of COARRAY. 19377 If DIM is present, the result is a scalar corresponding to the 19378 lower cobound of the array along that codimension. 19379 19380_See also_: 19381 *note LCOBOUND::, *note LBOUND:: 19382 19383 19384File: gfortran.info, Node: UMASK, Next: UNLINK, Prev: UCOBOUND, Up: Intrinsic Procedures 19385 193869.280 'UMASK' -- Set the file creation mask 19387=========================================== 19388 19389_Description_: 19390 Sets the file creation mask to MASK. If called as a function, it 19391 returns the old value. If called as a subroutine and argument OLD 19392 if it is supplied, it is set to the old value. See 'umask(2)'. 19393 19394_Standard_: 19395 GNU extension 19396 19397_Class_: 19398 Subroutine, function 19399 19400_Syntax_: 19401 'CALL UMASK(MASK [, OLD])' 19402 'OLD = UMASK(MASK)' 19403 19404_Arguments_: 19405 MASK Shall be a scalar of type 'INTEGER'. 19406 OLD (Optional) Shall be a scalar of type 'INTEGER'. 19407 19408 19409File: gfortran.info, Node: UNLINK, Next: UNPACK, Prev: UMASK, Up: Intrinsic Procedures 19410 194119.281 'UNLINK' -- Remove a file from the file system 19412==================================================== 19413 19414_Description_: 19415 Unlinks the file PATH. A null character ('CHAR(0)') can be used to 19416 mark the end of the name in PATH; otherwise, trailing blanks in the 19417 file name are ignored. If the STATUS argument is supplied, it 19418 contains 0 on success or a nonzero error code upon return; see 19419 'unlink(2)'. 19420 19421 This intrinsic is provided in both subroutine and function forms; 19422 however, only one form can be used in any given program unit. 19423 19424_Standard_: 19425 GNU extension 19426 19427_Class_: 19428 Subroutine, function 19429 19430_Syntax_: 19431 'CALL UNLINK(PATH [, STATUS])' 19432 'STATUS = UNLINK(PATH)' 19433 19434_Arguments_: 19435 PATH Shall be of default 'CHARACTER' type. 19436 STATUS (Optional) Shall be of default 'INTEGER' type. 19437 19438_See also_: 19439 *note LINK::, *note SYMLNK:: 19440 19441 19442File: gfortran.info, Node: UNPACK, Next: VERIFY, Prev: UNLINK, Up: Intrinsic Procedures 19443 194449.282 'UNPACK' -- Unpack an array of rank one into an array 19445=========================================================== 19446 19447_Description_: 19448 Store the elements of VECTOR in an array of higher rank. 19449 19450_Standard_: 19451 Fortran 90 and later 19452 19453_Class_: 19454 Transformational function 19455 19456_Syntax_: 19457 'RESULT = UNPACK(VECTOR, MASK, FIELD)' 19458 19459_Arguments_: 19460 VECTOR Shall be an array of any type and rank one. It 19461 shall have at least as many elements as MASK has 19462 'TRUE' values. 19463 MASK Shall be an array of type 'LOGICAL'. 19464 FIELD Shall be of the same type as VECTOR and have the 19465 same shape as MASK. 19466 19467_Return value_: 19468 The resulting array corresponds to FIELD with 'TRUE' elements of 19469 MASK replaced by values from VECTOR in array element order. 19470 19471_Example_: 19472 PROGRAM test_unpack 19473 integer :: vector(2) = (/1,1/) 19474 logical :: mask(4) = (/ .TRUE., .FALSE., .FALSE., .TRUE. /) 19475 integer :: field(2,2) = 0, unity(2,2) 19476 19477 ! result: unity matrix 19478 unity = unpack(vector, reshape(mask, (/2,2/)), field) 19479 END PROGRAM 19480 19481_See also_: 19482 *note PACK::, *note SPREAD:: 19483 19484 19485File: gfortran.info, Node: VERIFY, Next: XOR, Prev: UNPACK, Up: Intrinsic Procedures 19486 194879.283 'VERIFY' -- Scan a string for characters not a given set 19488============================================================== 19489 19490_Description_: 19491 Verifies that all the characters in STRING belong to the set of 19492 characters in SET. 19493 19494 If BACK is either absent or equals 'FALSE', this function returns 19495 the position of the leftmost character of STRING that is not in 19496 SET. If BACK equals 'TRUE', the rightmost position is returned. 19497 If all characters of STRING are found in SET, the result is zero. 19498 19499_Standard_: 19500 Fortran 90 and later, with KIND argument Fortran 2003 and later 19501 19502_Class_: 19503 Elemental function 19504 19505_Syntax_: 19506 'RESULT = VERIFY(STRING, SET[, BACK [, KIND]])' 19507 19508_Arguments_: 19509 STRING Shall be of type 'CHARACTER'. 19510 SET Shall be of type 'CHARACTER'. 19511 BACK (Optional) shall be of type 'LOGICAL'. 19512 KIND (Optional) An 'INTEGER' initialization 19513 expression indicating the kind parameter of the 19514 result. 19515 19516_Return value_: 19517 The return value is of type 'INTEGER' and of kind KIND. If KIND is 19518 absent, the return value is of default integer kind. 19519 19520_Example_: 19521 PROGRAM test_verify 19522 WRITE(*,*) VERIFY("FORTRAN", "AO") ! 1, found 'F' 19523 WRITE(*,*) VERIFY("FORTRAN", "FOO") ! 3, found 'R' 19524 WRITE(*,*) VERIFY("FORTRAN", "C++") ! 1, found 'F' 19525 WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.) ! 7, found 'N' 19526 WRITE(*,*) VERIFY("FORTRAN", "FORTRAN") ! 0' found none 19527 END PROGRAM 19528 19529_See also_: 19530 *note SCAN::, *note INDEX intrinsic:: 19531 19532 19533File: gfortran.info, Node: XOR, Prev: VERIFY, Up: Intrinsic Procedures 19534 195359.284 'XOR' -- Bitwise logical exclusive OR 19536=========================================== 19537 19538_Description_: 19539 Bitwise logical exclusive or. 19540 19541 This intrinsic routine is provided for backwards compatibility with 19542 GNU Fortran 77. For integer arguments, programmers should consider 19543 the use of the *note IEOR:: intrinsic and for logical arguments the 19544 '.NEQV.' operator, which are both defined by the Fortran standard. 19545 19546_Standard_: 19547 GNU extension 19548 19549_Class_: 19550 Function 19551 19552_Syntax_: 19553 'RESULT = XOR(I, J)' 19554 19555_Arguments_: 19556 I The type shall be either a scalar 'INTEGER' type 19557 or a scalar 'LOGICAL' type or a 19558 boz-literal-constant. 19559 J The type shall be the same as the type of I or a 19560 boz-literal-constant. I and J shall not both be 19561 boz-literal-constants. If either I and J is a 19562 boz-literal-constant, then the other argument 19563 must be a scalar 'INTEGER'. 19564 19565_Return value_: 19566 The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'. 19567 If the kind type parameters differ, then the smaller kind type is 19568 implicitly converted to larger kind, and the return has the larger 19569 kind. A boz-literal-constant is converted to an 'INTEGER' with the 19570 kind type parameter of the other argument as-if a call to *note 19571 INT:: occurred. 19572 19573_Example_: 19574 PROGRAM test_xor 19575 LOGICAL :: T = .TRUE., F = .FALSE. 19576 INTEGER :: a, b 19577 DATA a / Z'F' /, b / Z'3' / 19578 19579 WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F) 19580 WRITE (*,*) XOR(a, b) 19581 END PROGRAM 19582 19583_See also_: 19584 Fortran 95 elemental function: *note IEOR:: 19585 19586 19587File: gfortran.info, Node: Intrinsic Modules, Next: Contributing, Prev: Intrinsic Procedures, Up: Top 19588 1958910 Intrinsic Modules 19590******************** 19591 19592* Menu: 19593 19594* ISO_FORTRAN_ENV:: 19595* ISO_C_BINDING:: 19596* IEEE modules:: 19597* OpenMP Modules OMP_LIB and OMP_LIB_KINDS:: 19598* OpenACC Module OPENACC:: 19599 19600 19601File: gfortran.info, Node: ISO_FORTRAN_ENV, Next: ISO_C_BINDING, Up: Intrinsic Modules 19602 1960310.1 'ISO_FORTRAN_ENV' 19604====================== 19605 19606_Standard_: 19607 Fortran 2003 and later, except when otherwise noted 19608 19609 The 'ISO_FORTRAN_ENV' module provides the following scalar 19610default-integer named constants: 19611 19612'ATOMIC_INT_KIND': 19613 Default-kind integer constant to be used as kind parameter when 19614 defining integer variables used in atomic operations. (Fortran 19615 2008 or later.) 19616 19617'ATOMIC_LOGICAL_KIND': 19618 Default-kind integer constant to be used as kind parameter when 19619 defining logical variables used in atomic operations. (Fortran 19620 2008 or later.) 19621 19622'CHARACTER_KINDS': 19623 Default-kind integer constant array of rank one containing the 19624 supported kind parameters of the 'CHARACTER' type. (Fortran 2008 19625 or later.) 19626 19627'CHARACTER_STORAGE_SIZE': 19628 Size in bits of the character storage unit. 19629 19630'ERROR_UNIT': 19631 Identifies the preconnected unit used for error reporting. 19632 19633'FILE_STORAGE_SIZE': 19634 Size in bits of the file-storage unit. 19635 19636'INPUT_UNIT': 19637 Identifies the preconnected unit identified by the asterisk ('*') 19638 in 'READ' statement. 19639 19640'INT8', 'INT16', 'INT32', 'INT64': 19641 Kind type parameters to specify an INTEGER type with a storage size 19642 of 16, 32, and 64 bits. It is negative if a target platform does 19643 not support the particular kind. (Fortran 2008 or later.) 19644 19645'INTEGER_KINDS': 19646 Default-kind integer constant array of rank one containing the 19647 supported kind parameters of the 'INTEGER' type. (Fortran 2008 or 19648 later.) 19649 19650'IOSTAT_END': 19651 The value assigned to the variable passed to the 'IOSTAT=' 19652 specifier of an input/output statement if an end-of-file condition 19653 occurred. 19654 19655'IOSTAT_EOR': 19656 The value assigned to the variable passed to the 'IOSTAT=' 19657 specifier of an input/output statement if an end-of-record 19658 condition occurred. 19659 19660'IOSTAT_INQUIRE_INTERNAL_UNIT': 19661 Scalar default-integer constant, used by 'INQUIRE' for the 19662 'IOSTAT=' specifier to denote an that a unit number identifies an 19663 internal unit. (Fortran 2008 or later.) 19664 19665'NUMERIC_STORAGE_SIZE': 19666 The size in bits of the numeric storage unit. 19667 19668'LOGICAL_KINDS': 19669 Default-kind integer constant array of rank one containing the 19670 supported kind parameters of the 'LOGICAL' type. (Fortran 2008 or 19671 later.) 19672 19673'OUTPUT_UNIT': 19674 Identifies the preconnected unit identified by the asterisk ('*') 19675 in 'WRITE' statement. 19676 19677'REAL32', 'REAL64', 'REAL128': 19678 Kind type parameters to specify a REAL type with a storage size of 19679 32, 64, and 128 bits. It is negative if a target platform does not 19680 support the particular kind. (Fortran 2008 or later.) 19681 19682'REAL_KINDS': 19683 Default-kind integer constant array of rank one containing the 19684 supported kind parameters of the 'REAL' type. (Fortran 2008 or 19685 later.) 19686 19687'STAT_LOCKED': 19688 Scalar default-integer constant used as STAT= return value by 19689 'LOCK' to denote that the lock variable is locked by the executing 19690 image. (Fortran 2008 or later.) 19691 19692'STAT_LOCKED_OTHER_IMAGE': 19693 Scalar default-integer constant used as STAT= return value by 19694 'UNLOCK' to denote that the lock variable is locked by another 19695 image. (Fortran 2008 or later.) 19696 19697'STAT_STOPPED_IMAGE': 19698 Positive, scalar default-integer constant used as STAT= return 19699 value if the argument in the statement requires synchronisation 19700 with an image, which has initiated the termination of the 19701 execution. (Fortran 2008 or later.) 19702 19703'STAT_FAILED_IMAGE': 19704 Positive, scalar default-integer constant used as STAT= return 19705 value if the argument in the statement requires communication with 19706 an image, which has is in the failed state. (TS 18508 or later.) 19707 19708'STAT_UNLOCKED': 19709 Scalar default-integer constant used as STAT= return value by 19710 'UNLOCK' to denote that the lock variable is unlocked. (Fortran 19711 2008 or later.) 19712 19713 The module provides the following derived type: 19714 19715'LOCK_TYPE': 19716 Derived type with private components to be use with the 'LOCK' and 19717 'UNLOCK' statement. A variable of its type has to be always 19718 declared as coarray and may not appear in a variable-definition 19719 context. (Fortran 2008 or later.) 19720 19721 The module also provides the following intrinsic procedures: *note 19722COMPILER_OPTIONS:: and *note COMPILER_VERSION::. 19723 19724 19725File: gfortran.info, Node: ISO_C_BINDING, Next: IEEE modules, Prev: ISO_FORTRAN_ENV, Up: Intrinsic Modules 19726 1972710.2 'ISO_C_BINDING' 19728==================== 19729 19730_Standard_: 19731 Fortran 2003 and later, GNU extensions 19732 19733 The following intrinsic procedures are provided by the module; their 19734definition can be found in the section Intrinsic Procedures of this 19735manual. 19736 19737'C_ASSOCIATED' 19738'C_F_POINTER' 19739'C_F_PROCPOINTER' 19740'C_FUNLOC' 19741'C_LOC' 19742'C_SIZEOF' 19743 19744 The 'ISO_C_BINDING' module provides the following named constants of 19745type default integer, which can be used as KIND type parameters. 19746 19747 In addition to the integer named constants required by the Fortran 197482003 standard and 'C_PTRDIFF_T' of TS 29113, GNU Fortran provides as an 19749extension named constants for the 128-bit integer types supported by the 19750C compiler: 'C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T'. 19751Furthermore, if '__float128' is supported in C, the named constants 19752'C_FLOAT128, C_FLOAT128_COMPLEX' are defined. 19753 19754Fortran Named constant C type Extension 19755Type 19756'INTEGER' 'C_INT' 'int' 19757'INTEGER' 'C_SHORT' 'short int' 19758'INTEGER' 'C_LONG' 'long int' 19759'INTEGER' 'C_LONG_LONG' 'long long int' 19760'INTEGER' 'C_SIGNED_CHAR' 'signed char'/'unsigned 19761 char' 19762'INTEGER' 'C_SIZE_T' 'size_t' 19763'INTEGER' 'C_INT8_T' 'int8_t' 19764'INTEGER' 'C_INT16_T' 'int16_t' 19765'INTEGER' 'C_INT32_T' 'int32_t' 19766'INTEGER' 'C_INT64_T' 'int64_t' 19767'INTEGER' 'C_INT128_T' 'int128_t' Ext. 19768'INTEGER' 'C_INT_LEAST8_T' 'int_least8_t' 19769'INTEGER' 'C_INT_LEAST16_T' 'int_least16_t' 19770'INTEGER' 'C_INT_LEAST32_T' 'int_least32_t' 19771'INTEGER' 'C_INT_LEAST64_T' 'int_least64_t' 19772'INTEGER' 'C_INT_LEAST128_T' 'int_least128_t' Ext. 19773'INTEGER' 'C_INT_FAST8_T' 'int_fast8_t' 19774'INTEGER' 'C_INT_FAST16_T' 'int_fast16_t' 19775'INTEGER' 'C_INT_FAST32_T' 'int_fast32_t' 19776'INTEGER' 'C_INT_FAST64_T' 'int_fast64_t' 19777'INTEGER' 'C_INT_FAST128_T' 'int_fast128_t' Ext. 19778'INTEGER' 'C_INTMAX_T' 'intmax_t' 19779'INTEGER' 'C_INTPTR_T' 'intptr_t' 19780'INTEGER' 'C_PTRDIFF_T' 'ptrdiff_t' TS 29113 19781'REAL' 'C_FLOAT' 'float' 19782'REAL' 'C_DOUBLE' 'double' 19783'REAL' 'C_LONG_DOUBLE' 'long double' 19784'REAL' 'C_FLOAT128' '__float128' Ext. 19785'COMPLEX' 'C_FLOAT_COMPLEX' 'float _Complex' 19786'COMPLEX' 'C_DOUBLE_COMPLEX' 'double _Complex' 19787'COMPLEX' 'C_LONG_DOUBLE_COMPLEX' 'long double _Complex' 19788'REAL' 'C_FLOAT128_COMPLEX' '__float128 _Complex' Ext. 19789'LOGICAL' 'C_BOOL' '_Bool' 19790'CHARACTER' 'C_CHAR' 'char' 19791 19792 Additionally, the following parameters of type 19793'CHARACTER(KIND=C_CHAR)' are defined. 19794 19795Name C definition Value 19796'C_NULL_CHAR' null character ''\0'' 19797'C_ALERT' alert ''\a'' 19798'C_BACKSPACE' backspace ''\b'' 19799'C_FORM_FEED' form feed ''\f'' 19800'C_NEW_LINE' new line ''\n'' 19801'C_CARRIAGE_RETURN'carriage return ''\r'' 19802'C_HORIZONTAL_TAB'horizontal tab ''\t'' 19803'C_VERTICAL_TAB'vertical tab ''\v'' 19804 19805 Moreover, the following two named constants are defined: 19806 19807Name Type 19808'C_NULL_PTR' 'C_PTR' 19809'C_NULL_FUNPTR''C_FUNPTR' 19810 19811 Both are equivalent to the value 'NULL' in C. 19812 19813 19814File: gfortran.info, Node: IEEE modules, Next: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Prev: ISO_C_BINDING, Up: Intrinsic Modules 19815 1981610.3 IEEE modules: 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES' 19817============================================================================ 19818 19819_Standard_: 19820 Fortran 2003 and later 19821 19822 The 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES' 19823intrinsic modules provide support for exceptions and IEEE arithmetic, as 19824defined in Fortran 2003 and later standards, and the IEC 60559:1989 19825standard (_Binary floating-point arithmetic for microprocessor 19826systems_). These modules are only provided on the following supported 19827platforms: 19828 19829 * i386 and x86_64 processors 19830 * platforms which use the GNU C Library (glibc) 19831 * platforms with support for SysV/386 routines for floating point 19832 interface (including Solaris and BSDs) 19833 * platforms with the AIX OS 19834 19835 For full compliance with the Fortran standards, code using the 19836'IEEE_EXCEPTIONS' or 'IEEE_ARITHMETIC' modules should be compiled with 19837the following options: '-fno-unsafe-math-optimizations -frounding-math 19838-fsignaling-nans'. 19839 19840 19841File: gfortran.info, Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Next: OpenACC Module OPENACC, Prev: IEEE modules, Up: Intrinsic Modules 19842 1984310.4 OpenMP Modules 'OMP_LIB' and 'OMP_LIB_KINDS' 19844================================================= 19845 19846_Standard_: 19847 OpenMP Application Program Interface v4.5 19848 19849 The OpenMP Fortran runtime library routines are provided both in a 19850form of two Fortran 90 modules, named 'OMP_LIB' and 'OMP_LIB_KINDS', and 19851in a form of a Fortran 'include' file named 'omp_lib.h'. The procedures 19852provided by 'OMP_LIB' can be found in the *note Introduction: 19853(libgomp)Top. manual, the named constants defined in the modules are 19854listed below. 19855 19856 For details refer to the actual OpenMP Application Program Interface 19857v4.5 (http://www.openmp.org/wp-content/uploads/openmp-4.5.pdf). And for 19858the 'pause'-related constants to the OpenMP 5.0 specification. 19859 19860 'OMP_LIB_KINDS' provides the following scalar default-integer named 19861constants: 19862 19863'omp_lock_kind' 19864'omp_lock_hint_kind' 19865'omp_nest_lock_kind' 19866'omp_pause_resource_kind' 19867'omp_proc_bind_kind' 19868'omp_sched_kind' 19869 19870 'OMP_LIB' provides the scalar default-integer named constant 19871'openmp_version' with a value of the form YYYYMM, where 'yyyy' is the 19872year and MM the month of the OpenMP version; for OpenMP v4.5 the value 19873is '201511'. 19874 19875 The following scalar integer named constants of the kind 19876'omp_sched_kind': 19877 19878'omp_sched_static' 19879'omp_sched_dynamic' 19880'omp_sched_guided' 19881'omp_sched_auto' 19882 19883 And the following scalar integer named constants of the kind 19884'omp_proc_bind_kind': 19885 19886'omp_proc_bind_false' 19887'omp_proc_bind_true' 19888'omp_proc_bind_master' 19889'omp_proc_bind_close' 19890'omp_proc_bind_spread' 19891 19892 The following scalar integer named constants are of the kind 19893'omp_lock_hint_kind': 19894 19895'omp_lock_hint_none' 19896'omp_lock_hint_uncontended' 19897'omp_lock_hint_contended' 19898'omp_lock_hint_nonspeculative' 19899'omp_lock_hint_speculative' 19900 19901 And the following two scalar integer named constants are of the kind 19902'omp_pause_resource_kind': 19903 19904'omp_pause_soft' 19905'omp_pause_hard' 19906 19907 19908File: gfortran.info, Node: OpenACC Module OPENACC, Prev: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Up: Intrinsic Modules 19909 1991010.5 OpenACC Module 'OPENACC' 19911============================= 19912 19913_Standard_: 19914 OpenACC Application Programming Interface v2.6 19915 19916 The OpenACC Fortran runtime library routines are provided both in a 19917form of a Fortran 90 module, named 'OPENACC', and in form of a Fortran 19918'include' file named 'openacc_lib.h'. The procedures provided by 19919'OPENACC' can be found in the *note Introduction: (libgomp)Top. manual, 19920the named constants defined in the modules are listed below. 19921 19922 For details refer to the actual OpenACC Application Programming 19923Interface v2.6 (http://www.openacc.org/). 19924 19925 'OPENACC' provides the scalar default-integer named constant 19926'openacc_version' with a value of the form YYYYMM, where 'yyyy' is the 19927year and MM the month of the OpenACC version; for OpenACC v2.6 the value 19928is '201711'. 19929 19930 19931File: gfortran.info, Node: Contributing, Next: Copying, Prev: Intrinsic Modules, Up: Top 19932 19933Contributing 19934************ 19935 19936Free software is only possible if people contribute to efforts to create 19937it. We're always in need of more people helping out with ideas and 19938comments, writing documentation and contributing code. 19939 19940 If you want to contribute to GNU Fortran, have a look at the long 19941lists of projects you can take on. Some of these projects are small, 19942some of them are large; some are completely orthogonal to the rest of 19943what is happening on GNU Fortran, but others are "mainstream" projects 19944in need of enthusiastic hackers. All of these projects are important! 19945We will eventually get around to the things here, but they are also 19946things doable by someone who is willing and able. 19947 19948* Menu: 19949 19950* Contributors:: 19951* Projects:: 19952* Proposed Extensions:: 19953 19954 19955File: gfortran.info, Node: Contributors, Next: Projects, Up: Contributing 19956 19957Contributors to GNU Fortran 19958=========================== 19959 19960Most of the parser was hand-crafted by _Andy Vaught_, who is also the 19961initiator of the whole project. Thanks Andy! Most of the interface 19962with GCC was written by _Paul Brook_. 19963 19964 The following individuals have contributed code and/or ideas and 19965significant help to the GNU Fortran project (in alphabetical order): 19966 19967 - Janne Blomqvist 19968 - Steven Bosscher 19969 - Paul Brook 19970 - Tobias Burnus 19971 - Franc,ois-Xavier Coudert 19972 - Bud Davis 19973 - Jerry DeLisle 19974 - Erik Edelmann 19975 - Bernhard Fischer 19976 - Daniel Franke 19977 - Richard Guenther 19978 - Richard Henderson 19979 - Katherine Holcomb 19980 - Jakub Jelinek 19981 - Niels Kristian Bech Jensen 19982 - Steven Johnson 19983 - Steven G. Kargl 19984 - Thomas Koenig 19985 - Asher Langton 19986 - H. J. Lu 19987 - Toon Moene 19988 - Brooks Moses 19989 - Andrew Pinski 19990 - Tim Prince 19991 - Christopher D. Rickett 19992 - Richard Sandiford 19993 - Tobias Schlu"ter 19994 - Roger Sayle 19995 - Paul Thomas 19996 - Andy Vaught 19997 - Feng Wang 19998 - Janus Weil 19999 - Daniel Kraft 20000 20001 The following people have contributed bug reports, smaller or larger 20002patches, and much needed feedback and encouragement for the GNU Fortran 20003project: 20004 20005 - Bill Clodius 20006 - Dominique d'Humie`res 20007 - Kate Hedstrom 20008 - Erik Schnetter 20009 - Joost VandeVondele 20010 20011 Many other individuals have helped debug, test and improve the GNU 20012Fortran compiler over the past few years, and we welcome you to do the 20013same! If you already have done so, and you would like to see your name 20014listed in the list above, please contact us. 20015 20016 20017File: gfortran.info, Node: Projects, Next: Proposed Extensions, Prev: Contributors, Up: Contributing 20018 20019Projects 20020======== 20021 20022_Help build the test suite_ 20023 Solicit more code for donation to the test suite: the more 20024 extensive the testsuite, the smaller the risk of breaking things in 20025 the future! We can keep code private on request. 20026 20027_Bug hunting/squishing_ 20028 Find bugs and write more test cases! Test cases are especially 20029 very welcome, because it allows us to concentrate on fixing bugs 20030 instead of isolating them. Going through the bugzilla database at 20031 <https://gcc.gnu.org/bugzilla/> to reduce testcases posted there 20032 and add more information (for example, for which version does the 20033 testcase work, for which versions does it fail?) is also very 20034 helpful. 20035 20036 20037File: gfortran.info, Node: Proposed Extensions, Prev: Projects, Up: Contributing 20038 20039Proposed Extensions 20040=================== 20041 20042Here's a list of proposed extensions for the GNU Fortran compiler, in no 20043particular order. Most of these are necessary to be fully compatible 20044with existing Fortran compilers, but they are not part of the official 20045J3 Fortran 95 standard. 20046 20047Compiler extensions: 20048-------------------- 20049 20050 * User-specified alignment rules for structures. 20051 20052 * Automatically extend single precision constants to double. 20053 20054 * Compile code that conserves memory by dynamically allocating common 20055 and module storage either on stack or heap. 20056 20057 * Compile flag to generate code for array conformance checking 20058 (suggest -CC). 20059 20060 * User control of symbol names (underscores, etc). 20061 20062 * Compile setting for maximum size of stack frame size before 20063 spilling parts to static or heap. 20064 20065 * Flag to force local variables into static space. 20066 20067 * Flag to force local variables onto stack. 20068 20069Environment Options 20070------------------- 20071 20072 * Pluggable library modules for random numbers, linear algebra. LA 20073 should use BLAS calling conventions. 20074 20075 * Environment variables controlling actions on arithmetic exceptions 20076 like overflow, underflow, precision loss--Generate NaN, abort, 20077 default. action. 20078 20079 * Set precision for fp units that support it (i387). 20080 20081 * Variable for setting fp rounding mode. 20082 20083 * Variable to fill uninitialized variables with a user-defined bit 20084 pattern. 20085 20086 * Environment variable controlling filename that is opened for that 20087 unit number. 20088 20089 * Environment variable to clear/trash memory being freed. 20090 20091 * Environment variable to control tracing of allocations and frees. 20092 20093 * Environment variable to display allocated memory at normal program 20094 end. 20095 20096 * Environment variable for filename for * IO-unit. 20097 20098 * Environment variable for temporary file directory. 20099 20100 * Environment variable forcing standard output to be line buffered 20101 (Unix). 20102 20103 20104File: gfortran.info, Node: Copying, Next: GNU Free Documentation License, Prev: Contributing, Up: Top 20105 20106GNU General Public License 20107************************** 20108 20109 Version 3, 29 June 2007 20110 20111 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> 20112 20113 Everyone is permitted to copy and distribute verbatim copies of this 20114 license document, but changing it is not allowed. 20115 20116Preamble 20117======== 20118 20119The GNU General Public License is a free, copyleft license for software 20120and other kinds of works. 20121 20122 The licenses for most software and other practical works are designed 20123to take away your freedom to share and change the works. By contrast, 20124the GNU General Public License is intended to guarantee your freedom to 20125share and change all versions of a program-to make sure it remains free 20126software for all its users. We, the Free Software Foundation, use the 20127GNU General Public License for most of our software; it applies also to 20128any other work released this way by its authors. You can apply it to 20129your programs, too. 20130 20131 When we speak of free software, we are referring to freedom, not 20132price. Our General Public Licenses are designed to make sure that you 20133have the freedom to distribute copies of free software (and charge for 20134them if you wish), that you receive source code or can get it if you 20135want it, that you can change the software or use pieces of it in new 20136free programs, and that you know you can do these things. 20137 20138 To protect your rights, we need to prevent others from denying you 20139these rights or asking you to surrender the rights. Therefore, you have 20140certain responsibilities if you distribute copies of the software, or if 20141you modify it: responsibilities to respect the freedom of others. 20142 20143 For example, if you distribute copies of such a program, whether 20144gratis or for a fee, you must pass on to the recipients the same 20145freedoms that you received. You must make sure that they, too, receive 20146or can get the source code. And you must show them these terms so they 20147know their rights. 20148 20149 Developers that use the GNU GPL protect your rights with two steps: 20150(1) assert copyright on the software, and (2) offer you this License 20151giving you legal permission to copy, distribute and/or modify it. 20152 20153 For the developers' and authors' protection, the GPL clearly explains 20154that there is no warranty for this free software. For both users' and 20155authors' sake, the GPL requires that modified versions be marked as 20156changed, so that their problems will not be attributed erroneously to 20157authors of previous versions. 20158 20159 Some devices are designed to deny users access to install or run 20160modified versions of the software inside them, although the manufacturer 20161can do so. This is fundamentally incompatible with the aim of 20162protecting users' freedom to change the software. The systematic 20163pattern of such abuse occurs in the area of products for individuals to 20164use, which is precisely where it is most unacceptable. Therefore, we 20165have designed this version of the GPL to prohibit the practice for those 20166products. If such problems arise substantially in other domains, we 20167stand ready to extend this provision to those domains in future versions 20168of the GPL, as needed to protect the freedom of users. 20169 20170 Finally, every program is threatened constantly by software patents. 20171States should not allow patents to restrict development and use of 20172software on general-purpose computers, but in those that do, we wish to 20173avoid the special danger that patents applied to a free program could 20174make it effectively proprietary. To prevent this, the GPL assures that 20175patents cannot be used to render the program non-free. 20176 20177 The precise terms and conditions for copying, distribution and 20178modification follow. 20179 20180TERMS AND CONDITIONS 20181==================== 20182 20183 0. Definitions. 20184 20185 "This License" refers to version 3 of the GNU General Public 20186 License. 20187 20188 "Copyright" also means copyright-like laws that apply to other 20189 kinds of works, such as semiconductor masks. 20190 20191 "The Program" refers to any copyrightable work licensed under this 20192 License. Each licensee is addressed as "you". "Licensees" and 20193 "recipients" may be individuals or organizations. 20194 20195 To "modify" a work means to copy from or adapt all or part of the 20196 work in a fashion requiring copyright permission, other than the 20197 making of an exact copy. The resulting work is called a "modified 20198 version" of the earlier work or a work "based on" the earlier work. 20199 20200 A "covered work" means either the unmodified Program or a work 20201 based on the Program. 20202 20203 To "propagate" a work means to do anything with it that, without 20204 permission, would make you directly or secondarily liable for 20205 infringement under applicable copyright law, except executing it on 20206 a computer or modifying a private copy. Propagation includes 20207 copying, distribution (with or without modification), making 20208 available to the public, and in some countries other activities as 20209 well. 20210 20211 To "convey" a work means any kind of propagation that enables other 20212 parties to make or receive copies. Mere interaction with a user 20213 through a computer network, with no transfer of a copy, is not 20214 conveying. 20215 20216 An interactive user interface displays "Appropriate Legal Notices" 20217 to the extent that it includes a convenient and prominently visible 20218 feature that (1) displays an appropriate copyright notice, and (2) 20219 tells the user that there is no warranty for the work (except to 20220 the extent that warranties are provided), that licensees may convey 20221 the work under this License, and how to view a copy of this 20222 License. If the interface presents a list of user commands or 20223 options, such as a menu, a prominent item in the list meets this 20224 criterion. 20225 20226 1. Source Code. 20227 20228 The "source code" for a work means the preferred form of the work 20229 for making modifications to it. "Object code" means any non-source 20230 form of a work. 20231 20232 A "Standard Interface" means an interface that either is an 20233 official standard defined by a recognized standards body, or, in 20234 the case of interfaces specified for a particular programming 20235 language, one that is widely used among developers working in that 20236 language. 20237 20238 The "System Libraries" of an executable work include anything, 20239 other than the work as a whole, that (a) is included in the normal 20240 form of packaging a Major Component, but which is not part of that 20241 Major Component, and (b) serves only to enable use of the work with 20242 that Major Component, or to implement a Standard Interface for 20243 which an implementation is available to the public in source code 20244 form. A "Major Component", in this context, means a major 20245 essential component (kernel, window system, and so on) of the 20246 specific operating system (if any) on which the executable work 20247 runs, or a compiler used to produce the work, or an object code 20248 interpreter used to run it. 20249 20250 The "Corresponding Source" for a work in object code form means all 20251 the source code needed to generate, install, and (for an executable 20252 work) run the object code and to modify the work, including scripts 20253 to control those activities. However, it does not include the 20254 work's System Libraries, or general-purpose tools or generally 20255 available free programs which are used unmodified in performing 20256 those activities but which are not part of the work. For example, 20257 Corresponding Source includes interface definition files associated 20258 with source files for the work, and the source code for shared 20259 libraries and dynamically linked subprograms that the work is 20260 specifically designed to require, such as by intimate data 20261 communication or control flow between those subprograms and other 20262 parts of the work. 20263 20264 The Corresponding Source need not include anything that users can 20265 regenerate automatically from other parts of the Corresponding 20266 Source. 20267 20268 The Corresponding Source for a work in source code form is that 20269 same work. 20270 20271 2. Basic Permissions. 20272 20273 All rights granted under this License are granted for the term of 20274 copyright on the Program, and are irrevocable provided the stated 20275 conditions are met. This License explicitly affirms your unlimited 20276 permission to run the unmodified Program. The output from running 20277 a covered work is covered by this License only if the output, given 20278 its content, constitutes a covered work. This License acknowledges 20279 your rights of fair use or other equivalent, as provided by 20280 copyright law. 20281 20282 You may make, run and propagate covered works that you do not 20283 convey, without conditions so long as your license otherwise 20284 remains in force. You may convey covered works to others for the 20285 sole purpose of having them make modifications exclusively for you, 20286 or provide you with facilities for running those works, provided 20287 that you comply with the terms of this License in conveying all 20288 material for which you do not control copyright. Those thus making 20289 or running the covered works for you must do so exclusively on your 20290 behalf, under your direction and control, on terms that prohibit 20291 them from making any copies of your copyrighted material outside 20292 their relationship with you. 20293 20294 Conveying under any other circumstances is permitted solely under 20295 the conditions stated below. Sublicensing is not allowed; section 20296 10 makes it unnecessary. 20297 20298 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 20299 20300 No covered work shall be deemed part of an effective technological 20301 measure under any applicable law fulfilling obligations under 20302 article 11 of the WIPO copyright treaty adopted on 20 December 20303 1996, or similar laws prohibiting or restricting circumvention of 20304 such measures. 20305 20306 When you convey a covered work, you waive any legal power to forbid 20307 circumvention of technological measures to the extent such 20308 circumvention is effected by exercising rights under this License 20309 with respect to the covered work, and you disclaim any intention to 20310 limit operation or modification of the work as a means of 20311 enforcing, against the work's users, your or third parties' legal 20312 rights to forbid circumvention of technological measures. 20313 20314 4. Conveying Verbatim Copies. 20315 20316 You may convey verbatim copies of the Program's source code as you 20317 receive it, in any medium, provided that you conspicuously and 20318 appropriately publish on each copy an appropriate copyright notice; 20319 keep intact all notices stating that this License and any 20320 non-permissive terms added in accord with section 7 apply to the 20321 code; keep intact all notices of the absence of any warranty; and 20322 give all recipients a copy of this License along with the Program. 20323 20324 You may charge any price or no price for each copy that you convey, 20325 and you may offer support or warranty protection for a fee. 20326 20327 5. Conveying Modified Source Versions. 20328 20329 You may convey a work based on the Program, or the modifications to 20330 produce it from the Program, in the form of source code under the 20331 terms of section 4, provided that you also meet all of these 20332 conditions: 20333 20334 a. The work must carry prominent notices stating that you 20335 modified it, and giving a relevant date. 20336 20337 b. The work must carry prominent notices stating that it is 20338 released under this License and any conditions added under 20339 section 7. This requirement modifies the requirement in 20340 section 4 to "keep intact all notices". 20341 20342 c. You must license the entire work, as a whole, under this 20343 License to anyone who comes into possession of a copy. This 20344 License will therefore apply, along with any applicable 20345 section 7 additional terms, to the whole of the work, and all 20346 its parts, regardless of how they are packaged. This License 20347 gives no permission to license the work in any other way, but 20348 it does not invalidate such permission if you have separately 20349 received it. 20350 20351 d. If the work has interactive user interfaces, each must display 20352 Appropriate Legal Notices; however, if the Program has 20353 interactive interfaces that do not display Appropriate Legal 20354 Notices, your work need not make them do so. 20355 20356 A compilation of a covered work with other separate and independent 20357 works, which are not by their nature extensions of the covered 20358 work, and which are not combined with it such as to form a larger 20359 program, in or on a volume of a storage or distribution medium, is 20360 called an "aggregate" if the compilation and its resulting 20361 copyright are not used to limit the access or legal rights of the 20362 compilation's users beyond what the individual works permit. 20363 Inclusion of a covered work in an aggregate does not cause this 20364 License to apply to the other parts of the aggregate. 20365 20366 6. Conveying Non-Source Forms. 20367 20368 You may convey a covered work in object code form under the terms 20369 of sections 4 and 5, provided that you also convey the 20370 machine-readable Corresponding Source under the terms of this 20371 License, in one of these ways: 20372 20373 a. Convey the object code in, or embodied in, a physical product 20374 (including a physical distribution medium), accompanied by the 20375 Corresponding Source fixed on a durable physical medium 20376 customarily used for software interchange. 20377 20378 b. Convey the object code in, or embodied in, a physical product 20379 (including a physical distribution medium), accompanied by a 20380 written offer, valid for at least three years and valid for as 20381 long as you offer spare parts or customer support for that 20382 product model, to give anyone who possesses the object code 20383 either (1) a copy of the Corresponding Source for all the 20384 software in the product that is covered by this License, on a 20385 durable physical medium customarily used for software 20386 interchange, for a price no more than your reasonable cost of 20387 physically performing this conveying of source, or (2) access 20388 to copy the Corresponding Source from a network server at no 20389 charge. 20390 20391 c. Convey individual copies of the object code with a copy of the 20392 written offer to provide the Corresponding Source. This 20393 alternative is allowed only occasionally and noncommercially, 20394 and only if you received the object code with such an offer, 20395 in accord with subsection 6b. 20396 20397 d. Convey the object code by offering access from a designated 20398 place (gratis or for a charge), and offer equivalent access to 20399 the Corresponding Source in the same way through the same 20400 place at no further charge. You need not require recipients 20401 to copy the Corresponding Source along with the object code. 20402 If the place to copy the object code is a network server, the 20403 Corresponding Source may be on a different server (operated by 20404 you or a third party) that supports equivalent copying 20405 facilities, provided you maintain clear directions next to the 20406 object code saying where to find the Corresponding Source. 20407 Regardless of what server hosts the Corresponding Source, you 20408 remain obligated to ensure that it is available for as long as 20409 needed to satisfy these requirements. 20410 20411 e. Convey the object code using peer-to-peer transmission, 20412 provided you inform other peers where the object code and 20413 Corresponding Source of the work are being offered to the 20414 general public at no charge under subsection 6d. 20415 20416 A separable portion of the object code, whose source code is 20417 excluded from the Corresponding Source as a System Library, need 20418 not be included in conveying the object code work. 20419 20420 A "User Product" is either (1) a "consumer product", which means 20421 any tangible personal property which is normally used for personal, 20422 family, or household purposes, or (2) anything designed or sold for 20423 incorporation into a dwelling. In determining whether a product is 20424 a consumer product, doubtful cases shall be resolved in favor of 20425 coverage. For a particular product received by a particular user, 20426 "normally used" refers to a typical or common use of that class of 20427 product, regardless of the status of the particular user or of the 20428 way in which the particular user actually uses, or expects or is 20429 expected to use, the product. A product is a consumer product 20430 regardless of whether the product has substantial commercial, 20431 industrial or non-consumer uses, unless such uses represent the 20432 only significant mode of use of the product. 20433 20434 "Installation Information" for a User Product means any methods, 20435 procedures, authorization keys, or other information required to 20436 install and execute modified versions of a covered work in that 20437 User Product from a modified version of its Corresponding Source. 20438 The information must suffice to ensure that the continued 20439 functioning of the modified object code is in no case prevented or 20440 interfered with solely because modification has been made. 20441 20442 If you convey an object code work under this section in, or with, 20443 or specifically for use in, a User Product, and the conveying 20444 occurs as part of a transaction in which the right of possession 20445 and use of the User Product is transferred to the recipient in 20446 perpetuity or for a fixed term (regardless of how the transaction 20447 is characterized), the Corresponding Source conveyed under this 20448 section must be accompanied by the Installation Information. But 20449 this requirement does not apply if neither you nor any third party 20450 retains the ability to install modified object code on the User 20451 Product (for example, the work has been installed in ROM). 20452 20453 The requirement to provide Installation Information does not 20454 include a requirement to continue to provide support service, 20455 warranty, or updates for a work that has been modified or installed 20456 by the recipient, or for the User Product in which it has been 20457 modified or installed. Access to a network may be denied when the 20458 modification itself materially and adversely affects the operation 20459 of the network or violates the rules and protocols for 20460 communication across the network. 20461 20462 Corresponding Source conveyed, and Installation Information 20463 provided, in accord with this section must be in a format that is 20464 publicly documented (and with an implementation available to the 20465 public in source code form), and must require no special password 20466 or key for unpacking, reading or copying. 20467 20468 7. Additional Terms. 20469 20470 "Additional permissions" are terms that supplement the terms of 20471 this License by making exceptions from one or more of its 20472 conditions. Additional permissions that are applicable to the 20473 entire Program shall be treated as though they were included in 20474 this License, to the extent that they are valid under applicable 20475 law. If additional permissions apply only to part of the Program, 20476 that part may be used separately under those permissions, but the 20477 entire Program remains governed by this License without regard to 20478 the additional permissions. 20479 20480 When you convey a copy of a covered work, you may at your option 20481 remove any additional permissions from that copy, or from any part 20482 of it. (Additional permissions may be written to require their own 20483 removal in certain cases when you modify the work.) You may place 20484 additional permissions on material, added by you to a covered work, 20485 for which you have or can give appropriate copyright permission. 20486 20487 Notwithstanding any other provision of this License, for material 20488 you add to a covered work, you may (if authorized by the copyright 20489 holders of that material) supplement the terms of this License with 20490 terms: 20491 20492 a. Disclaiming warranty or limiting liability differently from 20493 the terms of sections 15 and 16 of this License; or 20494 20495 b. Requiring preservation of specified reasonable legal notices 20496 or author attributions in that material or in the Appropriate 20497 Legal Notices displayed by works containing it; or 20498 20499 c. Prohibiting misrepresentation of the origin of that material, 20500 or requiring that modified versions of such material be marked 20501 in reasonable ways as different from the original version; or 20502 20503 d. Limiting the use for publicity purposes of names of licensors 20504 or authors of the material; or 20505 20506 e. Declining to grant rights under trademark law for use of some 20507 trade names, trademarks, or service marks; or 20508 20509 f. Requiring indemnification of licensors and authors of that 20510 material by anyone who conveys the material (or modified 20511 versions of it) with contractual assumptions of liability to 20512 the recipient, for any liability that these contractual 20513 assumptions directly impose on those licensors and authors. 20514 20515 All other non-permissive additional terms are considered "further 20516 restrictions" within the meaning of section 10. If the Program as 20517 you received it, or any part of it, contains a notice stating that 20518 it is governed by this License along with a term that is a further 20519 restriction, you may remove that term. If a license document 20520 contains a further restriction but permits relicensing or conveying 20521 under this License, you may add to a covered work material governed 20522 by the terms of that license document, provided that the further 20523 restriction does not survive such relicensing or conveying. 20524 20525 If you add terms to a covered work in accord with this section, you 20526 must place, in the relevant source files, a statement of the 20527 additional terms that apply to those files, or a notice indicating 20528 where to find the applicable terms. 20529 20530 Additional terms, permissive or non-permissive, may be stated in 20531 the form of a separately written license, or stated as exceptions; 20532 the above requirements apply either way. 20533 20534 8. Termination. 20535 20536 You may not propagate or modify a covered work except as expressly 20537 provided under this License. Any attempt otherwise to propagate or 20538 modify it is void, and will automatically terminate your rights 20539 under this License (including any patent licenses granted under the 20540 third paragraph of section 11). 20541 20542 However, if you cease all violation of this License, then your 20543 license from a particular copyright holder is reinstated (a) 20544 provisionally, unless and until the copyright holder explicitly and 20545 finally terminates your license, and (b) permanently, if the 20546 copyright holder fails to notify you of the violation by some 20547 reasonable means prior to 60 days after the cessation. 20548 20549 Moreover, your license from a particular copyright holder is 20550 reinstated permanently if the copyright holder notifies you of the 20551 violation by some reasonable means, this is the first time you have 20552 received notice of violation of this License (for any work) from 20553 that copyright holder, and you cure the violation prior to 30 days 20554 after your receipt of the notice. 20555 20556 Termination of your rights under this section does not terminate 20557 the licenses of parties who have received copies or rights from you 20558 under this License. If your rights have been terminated and not 20559 permanently reinstated, you do not qualify to receive new licenses 20560 for the same material under section 10. 20561 20562 9. Acceptance Not Required for Having Copies. 20563 20564 You are not required to accept this License in order to receive or 20565 run a copy of the Program. Ancillary propagation of a covered work 20566 occurring solely as a consequence of using peer-to-peer 20567 transmission to receive a copy likewise does not require 20568 acceptance. However, nothing other than this License grants you 20569 permission to propagate or modify any covered work. These actions 20570 infringe copyright if you do not accept this License. Therefore, 20571 by modifying or propagating a covered work, you indicate your 20572 acceptance of this License to do so. 20573 20574 10. Automatic Licensing of Downstream Recipients. 20575 20576 Each time you convey a covered work, the recipient automatically 20577 receives a license from the original licensors, to run, modify and 20578 propagate that work, subject to this License. You are not 20579 responsible for enforcing compliance by third parties with this 20580 License. 20581 20582 An "entity transaction" is a transaction transferring control of an 20583 organization, or substantially all assets of one, or subdividing an 20584 organization, or merging organizations. If propagation of a 20585 covered work results from an entity transaction, each party to that 20586 transaction who receives a copy of the work also receives whatever 20587 licenses to the work the party's predecessor in interest had or 20588 could give under the previous paragraph, plus a right to possession 20589 of the Corresponding Source of the work from the predecessor in 20590 interest, if the predecessor has it or can get it with reasonable 20591 efforts. 20592 20593 You may not impose any further restrictions on the exercise of the 20594 rights granted or affirmed under this License. For example, you 20595 may not impose a license fee, royalty, or other charge for exercise 20596 of rights granted under this License, and you may not initiate 20597 litigation (including a cross-claim or counterclaim in a lawsuit) 20598 alleging that any patent claim is infringed by making, using, 20599 selling, offering for sale, or importing the Program or any portion 20600 of it. 20601 20602 11. Patents. 20603 20604 A "contributor" is a copyright holder who authorizes use under this 20605 License of the Program or a work on which the Program is based. 20606 The work thus licensed is called the contributor's "contributor 20607 version". 20608 20609 A contributor's "essential patent claims" are all patent claims 20610 owned or controlled by the contributor, whether already acquired or 20611 hereafter acquired, that would be infringed by some manner, 20612 permitted by this License, of making, using, or selling its 20613 contributor version, but do not include claims that would be 20614 infringed only as a consequence of further modification of the 20615 contributor version. For purposes of this definition, "control" 20616 includes the right to grant patent sublicenses in a manner 20617 consistent with the requirements of this License. 20618 20619 Each contributor grants you a non-exclusive, worldwide, 20620 royalty-free patent license under the contributor's essential 20621 patent claims, to make, use, sell, offer for sale, import and 20622 otherwise run, modify and propagate the contents of its contributor 20623 version. 20624 20625 In the following three paragraphs, a "patent license" is any 20626 express agreement or commitment, however denominated, not to 20627 enforce a patent (such as an express permission to practice a 20628 patent or covenant not to sue for patent infringement). To "grant" 20629 such a patent license to a party means to make such an agreement or 20630 commitment not to enforce a patent against the party. 20631 20632 If you convey a covered work, knowingly relying on a patent 20633 license, and the Corresponding Source of the work is not available 20634 for anyone to copy, free of charge and under the terms of this 20635 License, through a publicly available network server or other 20636 readily accessible means, then you must either (1) cause the 20637 Corresponding Source to be so available, or (2) arrange to deprive 20638 yourself of the benefit of the patent license for this particular 20639 work, or (3) arrange, in a manner consistent with the requirements 20640 of this License, to extend the patent license to downstream 20641 recipients. "Knowingly relying" means you have actual knowledge 20642 that, but for the patent license, your conveying the covered work 20643 in a country, or your recipient's use of the covered work in a 20644 country, would infringe one or more identifiable patents in that 20645 country that you have reason to believe are valid. 20646 20647 If, pursuant to or in connection with a single transaction or 20648 arrangement, you convey, or propagate by procuring conveyance of, a 20649 covered work, and grant a patent license to some of the parties 20650 receiving the covered work authorizing them to use, propagate, 20651 modify or convey a specific copy of the covered work, then the 20652 patent license you grant is automatically extended to all 20653 recipients of the covered work and works based on it. 20654 20655 A patent license is "discriminatory" if it does not include within 20656 the scope of its coverage, prohibits the exercise of, or is 20657 conditioned on the non-exercise of one or more of the rights that 20658 are specifically granted under this License. You may not convey a 20659 covered work if you are a party to an arrangement with a third 20660 party that is in the business of distributing software, under which 20661 you make payment to the third party based on the extent of your 20662 activity of conveying the work, and under which the third party 20663 grants, to any of the parties who would receive the covered work 20664 from you, a discriminatory patent license (a) in connection with 20665 copies of the covered work conveyed by you (or copies made from 20666 those copies), or (b) primarily for and in connection with specific 20667 products or compilations that contain the covered work, unless you 20668 entered into that arrangement, or that patent license was granted, 20669 prior to 28 March 2007. 20670 20671 Nothing in this License shall be construed as excluding or limiting 20672 any implied license or other defenses to infringement that may 20673 otherwise be available to you under applicable patent law. 20674 20675 12. No Surrender of Others' Freedom. 20676 20677 If conditions are imposed on you (whether by court order, agreement 20678 or otherwise) that contradict the conditions of this License, they 20679 do not excuse you from the conditions of this License. If you 20680 cannot convey a covered work so as to satisfy simultaneously your 20681 obligations under this License and any other pertinent obligations, 20682 then as a consequence you may not convey it at all. For example, 20683 if you agree to terms that obligate you to collect a royalty for 20684 further conveying from those to whom you convey the Program, the 20685 only way you could satisfy both those terms and this License would 20686 be to refrain entirely from conveying the Program. 20687 20688 13. Use with the GNU Affero General Public License. 20689 20690 Notwithstanding any other provision of this License, you have 20691 permission to link or combine any covered work with a work licensed 20692 under version 3 of the GNU Affero General Public License into a 20693 single combined work, and to convey the resulting work. The terms 20694 of this License will continue to apply to the part which is the 20695 covered work, but the special requirements of the GNU Affero 20696 General Public License, section 13, concerning interaction through 20697 a network will apply to the combination as such. 20698 20699 14. Revised Versions of this License. 20700 20701 The Free Software Foundation may publish revised and/or new 20702 versions of the GNU General Public License from time to time. Such 20703 new versions will be similar in spirit to the present version, but 20704 may differ in detail to address new problems or concerns. 20705 20706 Each version is given a distinguishing version number. If the 20707 Program specifies that a certain numbered version of the GNU 20708 General Public License "or any later version" applies to it, you 20709 have the option of following the terms and conditions either of 20710 that numbered version or of any later version published by the Free 20711 Software Foundation. If the Program does not specify a version 20712 number of the GNU General Public License, you may choose any 20713 version ever published by the Free Software Foundation. 20714 20715 If the Program specifies that a proxy can decide which future 20716 versions of the GNU General Public License can be used, that 20717 proxy's public statement of acceptance of a version permanently 20718 authorizes you to choose that version for the Program. 20719 20720 Later license versions may give you additional or different 20721 permissions. However, no additional obligations are imposed on any 20722 author or copyright holder as a result of your choosing to follow a 20723 later version. 20724 20725 15. Disclaimer of Warranty. 20726 20727 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 20728 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE 20729 COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" 20730 WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 20731 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20732 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE 20733 RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. 20734 SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL 20735 NECESSARY SERVICING, REPAIR OR CORRECTION. 20736 20737 16. Limitation of Liability. 20738 20739 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 20740 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES 20741 AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR 20742 DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 20743 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE 20744 THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA 20745 BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 20746 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 20747 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF 20748 THE POSSIBILITY OF SUCH DAMAGES. 20749 20750 17. Interpretation of Sections 15 and 16. 20751 20752 If the disclaimer of warranty and limitation of liability provided 20753 above cannot be given local legal effect according to their terms, 20754 reviewing courts shall apply local law that most closely 20755 approximates an absolute waiver of all civil liability in 20756 connection with the Program, unless a warranty or assumption of 20757 liability accompanies a copy of the Program in return for a fee. 20758 20759END OF TERMS AND CONDITIONS 20760=========================== 20761 20762How to Apply These Terms to Your New Programs 20763============================================= 20764 20765If you develop a new program, and you want it to be of the greatest 20766possible use to the public, the best way to achieve this is to make it 20767free software which everyone can redistribute and change under these 20768terms. 20769 20770 To do so, attach the following notices to the program. It is safest 20771to attach them to the start of each source file to most effectively 20772state the exclusion of warranty; and each file should have at least the 20773"copyright" line and a pointer to where the full notice is found. 20774 20775 ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. 20776 Copyright (C) YEAR NAME OF AUTHOR 20777 20778 This program is free software: you can redistribute it and/or modify 20779 it under the terms of the GNU General Public License as published by 20780 the Free Software Foundation, either version 3 of the License, or (at 20781 your option) any later version. 20782 20783 This program is distributed in the hope that it will be useful, but 20784 WITHOUT ANY WARRANTY; without even the implied warranty of 20785 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20786 General Public License for more details. 20787 20788 You should have received a copy of the GNU General Public License 20789 along with this program. If not, see <http://www.gnu.org/licenses/>. 20790 20791 Also add information on how to contact you by electronic and paper 20792mail. 20793 20794 If the program does terminal interaction, make it output a short 20795notice like this when it starts in an interactive mode: 20796 20797 PROGRAM Copyright (C) YEAR NAME OF AUTHOR 20798 This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. 20799 This is free software, and you are welcome to redistribute it 20800 under certain conditions; type 'show c' for details. 20801 20802 The hypothetical commands 'show w' and 'show c' should show the 20803appropriate parts of the General Public License. Of course, your 20804program's commands might be different; for a GUI interface, you would 20805use an "about box". 20806 20807 You should also get your employer (if you work as a programmer) or 20808school, if any, to sign a "copyright disclaimer" for the program, if 20809necessary. For more information on this, and how to apply and follow 20810the GNU GPL, see <http://www.gnu.org/licenses/>. 20811 20812 The GNU General Public License does not permit incorporating your 20813program into proprietary programs. If your program is a subroutine 20814library, you may consider it more useful to permit linking proprietary 20815applications with the library. If this is what you want to do, use the 20816GNU Lesser General Public License instead of this License. But first, 20817please read <https://www.gnu.org/licenses/why-not-lgpl.html>. 20818 20819 20820File: gfortran.info, Node: GNU Free Documentation License, Next: Funding, Prev: Copying, Up: Top 20821 20822GNU Free Documentation License 20823****************************** 20824 20825 Version 1.3, 3 November 2008 20826 20827 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 20828 <http://fsf.org/> 20829 20830 Everyone is permitted to copy and distribute verbatim copies 20831 of this license document, but changing it is not allowed. 20832 20833 0. PREAMBLE 20834 20835 The purpose of this License is to make a manual, textbook, or other 20836 functional and useful document "free" in the sense of freedom: to 20837 assure everyone the effective freedom to copy and redistribute it, 20838 with or without modifying it, either commercially or 20839 noncommercially. Secondarily, this License preserves for the 20840 author and publisher a way to get credit for their work, while not 20841 being considered responsible for modifications made by others. 20842 20843 This License is a kind of "copyleft", which means that derivative 20844 works of the document must themselves be free in the same sense. 20845 It complements the GNU General Public License, which is a copyleft 20846 license designed for free software. 20847 20848 We have designed this License in order to use it for manuals for 20849 free software, because free software needs free documentation: a 20850 free program should come with manuals providing the same freedoms 20851 that the software does. But this License is not limited to 20852 software manuals; it can be used for any textual work, regardless 20853 of subject matter or whether it is published as a printed book. We 20854 recommend this License principally for works whose purpose is 20855 instruction or reference. 20856 20857 1. APPLICABILITY AND DEFINITIONS 20858 20859 This License applies to any manual or other work, in any medium, 20860 that contains a notice placed by the copyright holder saying it can 20861 be distributed under the terms of this License. Such a notice 20862 grants a world-wide, royalty-free license, unlimited in duration, 20863 to use that work under the conditions stated herein. The 20864 "Document", below, refers to any such manual or work. Any member 20865 of the public is a licensee, and is addressed as "you". You accept 20866 the license if you copy, modify or distribute the work in a way 20867 requiring permission under copyright law. 20868 20869 A "Modified Version" of the Document means any work containing the 20870 Document or a portion of it, either copied verbatim, or with 20871 modifications and/or translated into another language. 20872 20873 A "Secondary Section" is a named appendix or a front-matter section 20874 of the Document that deals exclusively with the relationship of the 20875 publishers or authors of the Document to the Document's overall 20876 subject (or to related matters) and contains nothing that could 20877 fall directly within that overall subject. (Thus, if the Document 20878 is in part a textbook of mathematics, a Secondary Section may not 20879 explain any mathematics.) The relationship could be a matter of 20880 historical connection with the subject or with related matters, or 20881 of legal, commercial, philosophical, ethical or political position 20882 regarding them. 20883 20884 The "Invariant Sections" are certain Secondary Sections whose 20885 titles are designated, as being those of Invariant Sections, in the 20886 notice that says that the Document is released under this License. 20887 If a section does not fit the above definition of Secondary then it 20888 is not allowed to be designated as Invariant. The Document may 20889 contain zero Invariant Sections. If the Document does not identify 20890 any Invariant Sections then there are none. 20891 20892 The "Cover Texts" are certain short passages of text that are 20893 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 20894 that says that the Document is released under this License. A 20895 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 20896 be at most 25 words. 20897 20898 A "Transparent" copy of the Document means a machine-readable copy, 20899 represented in a format whose specification is available to the 20900 general public, that is suitable for revising the document 20901 straightforwardly with generic text editors or (for images composed 20902 of pixels) generic paint programs or (for drawings) some widely 20903 available drawing editor, and that is suitable for input to text 20904 formatters or for automatic translation to a variety of formats 20905 suitable for input to text formatters. A copy made in an otherwise 20906 Transparent file format whose markup, or absence of markup, has 20907 been arranged to thwart or discourage subsequent modification by 20908 readers is not Transparent. An image format is not Transparent if 20909 used for any substantial amount of text. A copy that is not 20910 "Transparent" is called "Opaque". 20911 20912 Examples of suitable formats for Transparent copies include plain 20913 ASCII without markup, Texinfo input format, LaTeX input format, 20914 SGML or XML using a publicly available DTD, and standard-conforming 20915 simple HTML, PostScript or PDF designed for human modification. 20916 Examples of transparent image formats include PNG, XCF and JPG. 20917 Opaque formats include proprietary formats that can be read and 20918 edited only by proprietary word processors, SGML or XML for which 20919 the DTD and/or processing tools are not generally available, and 20920 the machine-generated HTML, PostScript or PDF produced by some word 20921 processors for output purposes only. 20922 20923 The "Title Page" means, for a printed book, the title page itself, 20924 plus such following pages as are needed to hold, legibly, the 20925 material this License requires to appear in the title page. For 20926 works in formats which do not have any title page as such, "Title 20927 Page" means the text near the most prominent appearance of the 20928 work's title, preceding the beginning of the body of the text. 20929 20930 The "publisher" means any person or entity that distributes copies 20931 of the Document to the public. 20932 20933 A section "Entitled XYZ" means a named subunit of the Document 20934 whose title either is precisely XYZ or contains XYZ in parentheses 20935 following text that translates XYZ in another language. (Here XYZ 20936 stands for a specific section name mentioned below, such as 20937 "Acknowledgements", "Dedications", "Endorsements", or "History".) 20938 To "Preserve the Title" of such a section when you modify the 20939 Document means that it remains a section "Entitled XYZ" according 20940 to this definition. 20941 20942 The Document may include Warranty Disclaimers next to the notice 20943 which states that this License applies to the Document. These 20944 Warranty Disclaimers are considered to be included by reference in 20945 this License, but only as regards disclaiming warranties: any other 20946 implication that these Warranty Disclaimers may have is void and 20947 has no effect on the meaning of this License. 20948 20949 2. VERBATIM COPYING 20950 20951 You may copy and distribute the Document in any medium, either 20952 commercially or noncommercially, provided that this License, the 20953 copyright notices, and the license notice saying this License 20954 applies to the Document are reproduced in all copies, and that you 20955 add no other conditions whatsoever to those of this License. You 20956 may not use technical measures to obstruct or control the reading 20957 or further copying of the copies you make or distribute. However, 20958 you may accept compensation in exchange for copies. If you 20959 distribute a large enough number of copies you must also follow the 20960 conditions in section 3. 20961 20962 You may also lend copies, under the same conditions stated above, 20963 and you may publicly display copies. 20964 20965 3. COPYING IN QUANTITY 20966 20967 If you publish printed copies (or copies in media that commonly 20968 have printed covers) of the Document, numbering more than 100, and 20969 the Document's license notice requires Cover Texts, you must 20970 enclose the copies in covers that carry, clearly and legibly, all 20971 these Cover Texts: Front-Cover Texts on the front cover, and 20972 Back-Cover Texts on the back cover. Both covers must also clearly 20973 and legibly identify you as the publisher of these copies. The 20974 front cover must present the full title with all words of the title 20975 equally prominent and visible. You may add other material on the 20976 covers in addition. Copying with changes limited to the covers, as 20977 long as they preserve the title of the Document and satisfy these 20978 conditions, can be treated as verbatim copying in other respects. 20979 20980 If the required texts for either cover are too voluminous to fit 20981 legibly, you should put the first ones listed (as many as fit 20982 reasonably) on the actual cover, and continue the rest onto 20983 adjacent pages. 20984 20985 If you publish or distribute Opaque copies of the Document 20986 numbering more than 100, you must either include a machine-readable 20987 Transparent copy along with each Opaque copy, or state in or with 20988 each Opaque copy a computer-network location from which the general 20989 network-using public has access to download using public-standard 20990 network protocols a complete Transparent copy of the Document, free 20991 of added material. If you use the latter option, you must take 20992 reasonably prudent steps, when you begin distribution of Opaque 20993 copies in quantity, to ensure that this Transparent copy will 20994 remain thus accessible at the stated location until at least one 20995 year after the last time you distribute an Opaque copy (directly or 20996 through your agents or retailers) of that edition to the public. 20997 20998 It is requested, but not required, that you contact the authors of 20999 the Document well before redistributing any large number of copies, 21000 to give them a chance to provide you with an updated version of the 21001 Document. 21002 21003 4. MODIFICATIONS 21004 21005 You may copy and distribute a Modified Version of the Document 21006 under the conditions of sections 2 and 3 above, provided that you 21007 release the Modified Version under precisely this License, with the 21008 Modified Version filling the role of the Document, thus licensing 21009 distribution and modification of the Modified Version to whoever 21010 possesses a copy of it. In addition, you must do these things in 21011 the Modified Version: 21012 21013 A. Use in the Title Page (and on the covers, if any) a title 21014 distinct from that of the Document, and from those of previous 21015 versions (which should, if there were any, be listed in the 21016 History section of the Document). You may use the same title 21017 as a previous version if the original publisher of that 21018 version gives permission. 21019 21020 B. List on the Title Page, as authors, one or more persons or 21021 entities responsible for authorship of the modifications in 21022 the Modified Version, together with at least five of the 21023 principal authors of the Document (all of its principal 21024 authors, if it has fewer than five), unless they release you 21025 from this requirement. 21026 21027 C. State on the Title page the name of the publisher of the 21028 Modified Version, as the publisher. 21029 21030 D. Preserve all the copyright notices of the Document. 21031 21032 E. Add an appropriate copyright notice for your modifications 21033 adjacent to the other copyright notices. 21034 21035 F. Include, immediately after the copyright notices, a license 21036 notice giving the public permission to use the Modified 21037 Version under the terms of this License, in the form shown in 21038 the Addendum below. 21039 21040 G. Preserve in that license notice the full lists of Invariant 21041 Sections and required Cover Texts given in the Document's 21042 license notice. 21043 21044 H. Include an unaltered copy of this License. 21045 21046 I. Preserve the section Entitled "History", Preserve its Title, 21047 and add to it an item stating at least the title, year, new 21048 authors, and publisher of the Modified Version as given on the 21049 Title Page. If there is no section Entitled "History" in the 21050 Document, create one stating the title, year, authors, and 21051 publisher of the Document as given on its Title Page, then add 21052 an item describing the Modified Version as stated in the 21053 previous sentence. 21054 21055 J. Preserve the network location, if any, given in the Document 21056 for public access to a Transparent copy of the Document, and 21057 likewise the network locations given in the Document for 21058 previous versions it was based on. These may be placed in the 21059 "History" section. You may omit a network location for a work 21060 that was published at least four years before the Document 21061 itself, or if the original publisher of the version it refers 21062 to gives permission. 21063 21064 K. For any section Entitled "Acknowledgements" or "Dedications", 21065 Preserve the Title of the section, and preserve in the section 21066 all the substance and tone of each of the contributor 21067 acknowledgements and/or dedications given therein. 21068 21069 L. Preserve all the Invariant Sections of the Document, unaltered 21070 in their text and in their titles. Section numbers or the 21071 equivalent are not considered part of the section titles. 21072 21073 M. Delete any section Entitled "Endorsements". Such a section 21074 may not be included in the Modified Version. 21075 21076 N. Do not retitle any existing section to be Entitled 21077 "Endorsements" or to conflict in title with any Invariant 21078 Section. 21079 21080 O. Preserve any Warranty Disclaimers. 21081 21082 If the Modified Version includes new front-matter sections or 21083 appendices that qualify as Secondary Sections and contain no 21084 material copied from the Document, you may at your option designate 21085 some or all of these sections as invariant. To do this, add their 21086 titles to the list of Invariant Sections in the Modified Version's 21087 license notice. These titles must be distinct from any other 21088 section titles. 21089 21090 You may add a section Entitled "Endorsements", provided it contains 21091 nothing but endorsements of your Modified Version by various 21092 parties--for example, statements of peer review or that the text 21093 has been approved by an organization as the authoritative 21094 definition of a standard. 21095 21096 You may add a passage of up to five words as a Front-Cover Text, 21097 and a passage of up to 25 words as a Back-Cover Text, to the end of 21098 the list of Cover Texts in the Modified Version. Only one passage 21099 of Front-Cover Text and one of Back-Cover Text may be added by (or 21100 through arrangements made by) any one entity. If the Document 21101 already includes a cover text for the same cover, previously added 21102 by you or by arrangement made by the same entity you are acting on 21103 behalf of, you may not add another; but you may replace the old 21104 one, on explicit permission from the previous publisher that added 21105 the old one. 21106 21107 The author(s) and publisher(s) of the Document do not by this 21108 License give permission to use their names for publicity for or to 21109 assert or imply endorsement of any Modified Version. 21110 21111 5. COMBINING DOCUMENTS 21112 21113 You may combine the Document with other documents released under 21114 this License, under the terms defined in section 4 above for 21115 modified versions, provided that you include in the combination all 21116 of the Invariant Sections of all of the original documents, 21117 unmodified, and list them all as Invariant Sections of your 21118 combined work in its license notice, and that you preserve all 21119 their Warranty Disclaimers. 21120 21121 The combined work need only contain one copy of this License, and 21122 multiple identical Invariant Sections may be replaced with a single 21123 copy. If there are multiple Invariant Sections with the same name 21124 but different contents, make the title of each such section unique 21125 by adding at the end of it, in parentheses, the name of the 21126 original author or publisher of that section if known, or else a 21127 unique number. Make the same adjustment to the section titles in 21128 the list of Invariant Sections in the license notice of the 21129 combined work. 21130 21131 In the combination, you must combine any sections Entitled 21132 "History" in the various original documents, forming one section 21133 Entitled "History"; likewise combine any sections Entitled 21134 "Acknowledgements", and any sections Entitled "Dedications". You 21135 must delete all sections Entitled "Endorsements." 21136 21137 6. COLLECTIONS OF DOCUMENTS 21138 21139 You may make a collection consisting of the Document and other 21140 documents released under this License, and replace the individual 21141 copies of this License in the various documents with a single copy 21142 that is included in the collection, provided that you follow the 21143 rules of this License for verbatim copying of each of the documents 21144 in all other respects. 21145 21146 You may extract a single document from such a collection, and 21147 distribute it individually under this License, provided you insert 21148 a copy of this License into the extracted document, and follow this 21149 License in all other respects regarding verbatim copying of that 21150 document. 21151 21152 7. AGGREGATION WITH INDEPENDENT WORKS 21153 21154 A compilation of the Document or its derivatives with other 21155 separate and independent documents or works, in or on a volume of a 21156 storage or distribution medium, is called an "aggregate" if the 21157 copyright resulting from the compilation is not used to limit the 21158 legal rights of the compilation's users beyond what the individual 21159 works permit. When the Document is included in an aggregate, this 21160 License does not apply to the other works in the aggregate which 21161 are not themselves derivative works of the Document. 21162 21163 If the Cover Text requirement of section 3 is applicable to these 21164 copies of the Document, then if the Document is less than one half 21165 of the entire aggregate, the Document's Cover Texts may be placed 21166 on covers that bracket the Document within the aggregate, or the 21167 electronic equivalent of covers if the Document is in electronic 21168 form. Otherwise they must appear on printed covers that bracket 21169 the whole aggregate. 21170 21171 8. TRANSLATION 21172 21173 Translation is considered a kind of modification, so you may 21174 distribute translations of the Document under the terms of section 21175 4. Replacing Invariant Sections with translations requires special 21176 permission from their copyright holders, but you may include 21177 translations of some or all Invariant Sections in addition to the 21178 original versions of these Invariant Sections. You may include a 21179 translation of this License, and all the license notices in the 21180 Document, and any Warranty Disclaimers, provided that you also 21181 include the original English version of this License and the 21182 original versions of those notices and disclaimers. In case of a 21183 disagreement between the translation and the original version of 21184 this License or a notice or disclaimer, the original version will 21185 prevail. 21186 21187 If a section in the Document is Entitled "Acknowledgements", 21188 "Dedications", or "History", the requirement (section 4) to 21189 Preserve its Title (section 1) will typically require changing the 21190 actual title. 21191 21192 9. TERMINATION 21193 21194 You may not copy, modify, sublicense, or distribute the Document 21195 except as expressly provided under this License. Any attempt 21196 otherwise to copy, modify, sublicense, or distribute it is void, 21197 and will automatically terminate your rights under this License. 21198 21199 However, if you cease all violation of this License, then your 21200 license from a particular copyright holder is reinstated (a) 21201 provisionally, unless and until the copyright holder explicitly and 21202 finally terminates your license, and (b) permanently, if the 21203 copyright holder fails to notify you of the violation by some 21204 reasonable means prior to 60 days after the cessation. 21205 21206 Moreover, your license from a particular copyright holder is 21207 reinstated permanently if the copyright holder notifies you of the 21208 violation by some reasonable means, this is the first time you have 21209 received notice of violation of this License (for any work) from 21210 that copyright holder, and you cure the violation prior to 30 days 21211 after your receipt of the notice. 21212 21213 Termination of your rights under this section does not terminate 21214 the licenses of parties who have received copies or rights from you 21215 under this License. If your rights have been terminated and not 21216 permanently reinstated, receipt of a copy of some or all of the 21217 same material does not give you any rights to use it. 21218 21219 10. FUTURE REVISIONS OF THIS LICENSE 21220 21221 The Free Software Foundation may publish new, revised versions of 21222 the GNU Free Documentation License from time to time. Such new 21223 versions will be similar in spirit to the present version, but may 21224 differ in detail to address new problems or concerns. See 21225 <http://www.gnu.org/copyleft/>. 21226 21227 Each version of the License is given a distinguishing version 21228 number. If the Document specifies that a particular numbered 21229 version of this License "or any later version" applies to it, you 21230 have the option of following the terms and conditions either of 21231 that specified version or of any later version that has been 21232 published (not as a draft) by the Free Software Foundation. If the 21233 Document does not specify a version number of this License, you may 21234 choose any version ever published (not as a draft) by the Free 21235 Software Foundation. If the Document specifies that a proxy can 21236 decide which future versions of this License can be used, that 21237 proxy's public statement of acceptance of a version permanently 21238 authorizes you to choose that version for the Document. 21239 21240 11. RELICENSING 21241 21242 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any 21243 World Wide Web server that publishes copyrightable works and also 21244 provides prominent facilities for anybody to edit those works. A 21245 public wiki that anybody can edit is an example of such a server. 21246 A "Massive Multiauthor Collaboration" (or "MMC") contained in the 21247 site means any set of copyrightable works thus published on the MMC 21248 site. 21249 21250 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 21251 license published by Creative Commons Corporation, a not-for-profit 21252 corporation with a principal place of business in San Francisco, 21253 California, as well as future copyleft versions of that license 21254 published by that same organization. 21255 21256 "Incorporate" means to publish or republish a Document, in whole or 21257 in part, as part of another Document. 21258 21259 An MMC is "eligible for relicensing" if it is licensed under this 21260 License, and if all works that were first published under this 21261 License somewhere other than this MMC, and subsequently 21262 incorporated in whole or in part into the MMC, (1) had no cover 21263 texts or invariant sections, and (2) were thus incorporated prior 21264 to November 1, 2008. 21265 21266 The operator of an MMC Site may republish an MMC contained in the 21267 site under CC-BY-SA on the same site at any time before August 1, 21268 2009, provided the MMC is eligible for relicensing. 21269 21270ADDENDUM: How to use this License for your documents 21271==================================================== 21272 21273To use this License in a document you have written, include a copy of 21274the License in the document and put the following copyright and license 21275notices just after the title page: 21276 21277 Copyright (C) YEAR YOUR NAME. 21278 Permission is granted to copy, distribute and/or modify this document 21279 under the terms of the GNU Free Documentation License, Version 1.3 21280 or any later version published by the Free Software Foundation; 21281 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 21282 Texts. A copy of the license is included in the section entitled ``GNU 21283 Free Documentation License''. 21284 21285 If you have Invariant Sections, Front-Cover Texts and Back-Cover 21286Texts, replace the "with...Texts." line with this: 21287 21288 with the Invariant Sections being LIST THEIR TITLES, with 21289 the Front-Cover Texts being LIST, and with the Back-Cover Texts 21290 being LIST. 21291 21292 If you have Invariant Sections without Cover Texts, or some other 21293combination of the three, merge those two alternatives to suit the 21294situation. 21295 21296 If your document contains nontrivial examples of program code, we 21297recommend releasing these examples in parallel under your choice of free 21298software license, such as the GNU General Public License, to permit 21299their use in free software. 21300 21301 21302File: gfortran.info, Node: Funding, Next: Option Index, Prev: GNU Free Documentation License, Up: Top 21303 21304Funding Free Software 21305********************* 21306 21307If you want to have more free software a few years from now, it makes 21308sense for you to help encourage people to contribute funds for its 21309development. The most effective approach known is to encourage 21310commercial redistributors to donate. 21311 21312 Users of free software systems can boost the pace of development by 21313encouraging for-a-fee distributors to donate part of their selling price 21314to free software developers--the Free Software Foundation, and others. 21315 21316 The way to convince distributors to do this is to demand it and 21317expect it from them. So when you compare distributors, judge them 21318partly by how much they give to free software development. Show 21319distributors they must compete to be the one who gives the most. 21320 21321 To make this approach work, you must insist on numbers that you can 21322compare, such as, "We will donate ten dollars to the Frobnitz project 21323for each disk sold." Don't be satisfied with a vague promise, such as 21324"A portion of the profits are donated," since it doesn't give a basis 21325for comparison. 21326 21327 Even a precise fraction "of the profits from this disk" is not very 21328meaningful, since creative accounting and unrelated business decisions 21329can greatly alter what fraction of the sales price counts as profit. If 21330the price you pay is $50, ten percent of the profit is probably less 21331than a dollar; it might be a few cents, or nothing at all. 21332 21333 Some redistributors do development work themselves. This is useful 21334too; but to keep everyone honest, you need to inquire how much they do, 21335and what kind. Some kinds of development make much more long-term 21336difference than others. For example, maintaining a separate version of 21337a program contributes very little; maintaining the standard version of a 21338program for the whole community contributes much. Easy new ports 21339contribute little, since someone else would surely do them; difficult 21340ports such as adding a new CPU to the GNU Compiler Collection contribute 21341more; major new features or packages contribute the most. 21342 21343 By establishing the idea that supporting further development is "the 21344proper thing to do" when distributing free software for a fee, we can 21345assure a steady flow of resources into making more free software. 21346 21347 Copyright (C) 1994 Free Software Foundation, Inc. 21348 Verbatim copying and redistribution of this section is permitted 21349 without royalty; alteration is not permitted. 21350 21351 21352File: gfortran.info, Node: Option Index, Next: Keyword Index, Prev: Funding, Up: Top 21353 21354Option Index 21355************ 21356 21357'gfortran''s command line options are indexed here without any initial 21358'-' or '--'. Where an option has both positive and negative forms (such 21359as -foption and -fno-option), relevant entries in the manual are indexed 21360under the most appropriate form; it may sometimes be useful to look up 21361both forms. 21362 21363[index] 21364* Menu: 21365 21366* A-PREDICATE=ANSWER: Preprocessing Options. 21367 (line 119) 21368* allow-invalid-boz: Fortran Dialect Options. 21369 (line 40) 21370* APREDICATE=ANSWER: Preprocessing Options. 21371 (line 113) 21372* backslash: Fortran Dialect Options. 21373 (line 112) 21374* C: Preprocessing Options. 21375 (line 122) 21376* c-prototypes: Interoperability Options. 21377 (line 7) 21378* c-prototypes-external: Interoperability Options. 21379 (line 25) 21380* CC: Preprocessing Options. 21381 (line 137) 21382* cpp: Preprocessing Options. 21383 (line 12) 21384* dD: Preprocessing Options. 21385 (line 35) 21386* dI: Preprocessing Options. 21387 (line 51) 21388* dM: Preprocessing Options. 21389 (line 26) 21390* dN: Preprocessing Options. 21391 (line 41) 21392* DNAME: Preprocessing Options. 21393 (line 151) 21394* DNAME=DEFINITION: Preprocessing Options. 21395 (line 154) 21396* dU: Preprocessing Options. 21397 (line 44) 21398* faggressive-function-elimination: Code Gen Options. (line 435) 21399* falign-commons: Code Gen Options. (line 408) 21400* fall-intrinsics: Fortran Dialect Options. 21401 (line 17) 21402* fallow-argument-mismatch: Fortran Dialect Options. 21403 (line 26) 21404* fblas-matmul-limit: Code Gen Options. (line 337) 21405* fbounds-check: Code Gen Options. (line 205) 21406* fcheck: Code Gen Options. (line 144) 21407* fcheck-array-temporaries: Code Gen Options. (line 239) 21408* fcoarray: Code Gen Options. (line 130) 21409* fconvert=CONVERSION: Runtime Options. (line 10) 21410* fcray-pointer: Fortran Dialect Options. 21411 (line 167) 21412* fd-lines-as-code: Fortran Dialect Options. 21413 (line 47) 21414* fd-lines-as-comments: Fortran Dialect Options. 21415 (line 47) 21416* fdec: Fortran Dialect Options. 21417 (line 54) 21418* fdec-blank-format-item: Fortran Dialect Options. 21419 (line 102) 21420* fdec-char-conversions: Fortran Dialect Options. 21421 (line 69) 21422* fdec-format-defaults: Fortran Dialect Options. 21423 (line 98) 21424* fdec-include: Fortran Dialect Options. 21425 (line 93) 21426* fdec-intrinsic-ints: Fortran Dialect Options. 21427 (line 79) 21428* fdec-math: Fortran Dialect Options. 21429 (line 84) 21430* fdec-static: Fortran Dialect Options. 21431 (line 89) 21432* fdec-structure: Fortran Dialect Options. 21433 (line 73) 21434* fdefault-double-8: Fortran Dialect Options. 21435 (line 234) 21436* fdefault-integer-8: Fortran Dialect Options. 21437 (line 198) 21438* fdefault-real-10: Fortran Dialect Options. 21439 (line 214) 21440* fdefault-real-16: Fortran Dialect Options. 21441 (line 224) 21442* fdefault-real-8: Fortran Dialect Options. 21443 (line 204) 21444* fdollar-ok: Fortran Dialect Options. 21445 (line 106) 21446* fdump-fortran-global: Debugging Options. (line 33) 21447* fdump-fortran-optimized: Debugging Options. (line 18) 21448* fdump-fortran-original: Debugging Options. (line 10) 21449* fdump-parse-tree: Debugging Options. (line 25) 21450* fexternal-blas: Code Gen Options. (line 329) 21451* ff2c: Code Gen Options. (line 28) 21452* ffixed-form: Fortran Dialect Options. 21453 (line 11) 21454* ffixed-line-length-N: Fortran Dialect Options. 21455 (line 129) 21456* ffpe-summary=LIST: Debugging Options. (line 73) 21457* ffpe-trap=LIST: Debugging Options. (line 40) 21458* ffree-form: Fortran Dialect Options. 21459 (line 11) 21460* ffree-line-length-N: Fortran Dialect Options. 21461 (line 151) 21462* fimplicit-none: Fortran Dialect Options. 21463 (line 162) 21464* finit-character: Code Gen Options. (line 372) 21465* finit-derived: Code Gen Options. (line 372) 21466* finit-integer: Code Gen Options. (line 372) 21467* finit-local-zero: Code Gen Options. (line 372) 21468* finit-logical: Code Gen Options. (line 372) 21469* finit-real: Code Gen Options. (line 372) 21470* finline-arg-packing: Code Gen Options. (line 304) 21471* finline-matmul-limit: Code Gen Options. (line 348) 21472* finteger-4-integer-8: Fortran Dialect Options. 21473 (line 242) 21474* fintrinsic-modules-path DIR: Directory Options. (line 36) 21475* fmax-array-constructor: Code Gen Options. (line 242) 21476* fmax-errors=N: Error and Warning Options. 21477 (line 27) 21478* fmax-identifier-length=N: Fortran Dialect Options. 21479 (line 158) 21480* fmax-stack-var-size: Code Gen Options. (line 260) 21481* fmax-subrecord-length=LENGTH: Runtime Options. (line 29) 21482* fmodule-private: Fortran Dialect Options. 21483 (line 124) 21484* fno-automatic: Code Gen Options. (line 15) 21485* fno-backtrace: Debugging Options. (line 86) 21486* fno-protect-parens: Code Gen Options. (line 420) 21487* fno-underscoring: Code Gen Options. (line 57) 21488* fopenacc: Fortran Dialect Options. 21489 (line 171) 21490* fopenmp: Fortran Dialect Options. 21491 (line 178) 21492* fpack-derived: Code Gen Options. (line 282) 21493* fpad-source: Fortran Dialect Options. 21494 (line 143) 21495* fpp: Preprocessing Options. 21496 (line 12) 21497* frange-check: Fortran Dialect Options. 21498 (line 186) 21499* freal-4-real-10: Fortran Dialect Options. 21500 (line 257) 21501* freal-4-real-16: Fortran Dialect Options. 21502 (line 257) 21503* freal-4-real-8: Fortran Dialect Options. 21504 (line 257) 21505* freal-8-real-10: Fortran Dialect Options. 21506 (line 257) 21507* freal-8-real-16: Fortran Dialect Options. 21508 (line 257) 21509* freal-8-real-4: Fortran Dialect Options. 21510 (line 257) 21511* frealloc-lhs: Code Gen Options. (line 429) 21512* frecord-marker=LENGTH: Runtime Options. (line 21) 21513* frecursive: Code Gen Options. (line 362) 21514* frepack-arrays: Code Gen Options. (line 288) 21515* frontend-loop-interchange: Code Gen Options. (line 456) 21516* frontend-optimize: Code Gen Options. (line 443) 21517* fsecond-underscore: Code Gen Options. (line 113) 21518* fshort-enums: Code Gen Options. (line 298) 21519* fshort-enums <1>: Fortran 2003 status. (line 92) 21520* fsign-zero: Runtime Options. (line 34) 21521* fstack-arrays: Code Gen Options. (line 274) 21522* fsyntax-only: Error and Warning Options. 21523 (line 33) 21524* ftest-forall-temp: Fortran Dialect Options. 21525 (line 287) 21526* fworking-directory: Preprocessing Options. 21527 (line 55) 21528* H: Preprocessing Options. 21529 (line 174) 21530* IDIR: Directory Options. (line 14) 21531* idirafter DIR: Preprocessing Options. 21532 (line 69) 21533* imultilib DIR: Preprocessing Options. 21534 (line 76) 21535* iprefix PREFIX: Preprocessing Options. 21536 (line 80) 21537* iquote DIR: Preprocessing Options. 21538 (line 89) 21539* isysroot DIR: Preprocessing Options. 21540 (line 85) 21541* isystem DIR: Preprocessing Options. 21542 (line 96) 21543* JDIR: Directory Options. (line 29) 21544* MDIR: Directory Options. (line 29) 21545* nostdinc: Preprocessing Options. 21546 (line 104) 21547* P: Preprocessing Options. 21548 (line 179) 21549* pedantic: Error and Warning Options. 21550 (line 39) 21551* pedantic-errors: Error and Warning Options. 21552 (line 58) 21553* static-libgfortran: Link Options. (line 11) 21554* std=STD option: Fortran Dialect Options. 21555 (line 268) 21556* tail-call-workaround: Code Gen Options. (line 209) 21557* UNAME: Preprocessing Options. 21558 (line 185) 21559* undef: Preprocessing Options. 21560 (line 109) 21561* Waliasing: Error and Warning Options. 21562 (line 71) 21563* Walign-commons: Error and Warning Options. 21564 (line 228) 21565* Wall: Error and Warning Options. 21566 (line 62) 21567* Wampersand: Error and Warning Options. 21568 (line 88) 21569* Warray-temporaries: Error and Warning Options. 21570 (line 96) 21571* Wc-binding-type: Error and Warning Options. 21572 (line 101) 21573* Wcharacter-truncation: Error and Warning Options. 21574 (line 108) 21575* Wcompare-reals: Error and Warning Options. 21576 (line 256) 21577* Wconversion: Error and Warning Options. 21578 (line 117) 21579* Wconversion-extra: Error and Warning Options. 21580 (line 121) 21581* Wdo-subscript: Error and Warning Options. 21582 (line 268) 21583* Werror: Error and Warning Options. 21584 (line 280) 21585* Wextra: Error and Warning Options. 21586 (line 125) 21587* Wfrontend-loop-interchange: Error and Warning Options. 21588 (line 130) 21589* Wfunction-elimination: Error and Warning Options. 21590 (line 234) 21591* Wimplicit-interface: Error and Warning Options. 21592 (line 134) 21593* Wimplicit-procedure: Error and Warning Options. 21594 (line 140) 21595* Winteger-division: Error and Warning Options. 21596 (line 144) 21597* Wintrinsic-shadow: Error and Warning Options. 21598 (line 206) 21599* Wintrinsics-std: Error and Warning Options. 21600 (line 148) 21601* Wline-truncation: Error and Warning Options. 21602 (line 111) 21603* Woverwrite-recursive: Error and Warning Options. 21604 (line 155) 21605* Wpedantic: Error and Warning Options. 21606 (line 39) 21607* Wreal-q-constant: Error and Warning Options. 21608 (line 162) 21609* Wrealloc-lhs: Error and Warning Options. 21610 (line 239) 21611* Wrealloc-lhs-all: Error and Warning Options. 21612 (line 251) 21613* Wsurprising: Error and Warning Options. 21614 (line 166) 21615* Wtabs: Error and Warning Options. 21616 (line 188) 21617* Wtargt-lifetime: Error and Warning Options. 21618 (line 260) 21619* Wundefined-do-loop: Error and Warning Options. 21620 (line 196) 21621* Wunderflow: Error and Warning Options. 21622 (line 201) 21623* Wunused-dummy-argument: Error and Warning Options. 21624 (line 217) 21625* Wunused-parameter: Error and Warning Options. 21626 (line 221) 21627* Wuse-without-only: Error and Warning Options. 21628 (line 213) 21629* Wzerotrip: Error and Warning Options. 21630 (line 264) 21631 21632 21633File: gfortran.info, Node: Keyword Index, Prev: Option Index, Up: Top 21634 21635Keyword Index 21636************* 21637 21638[index] 21639* Menu: 21640 21641* $: Fortran Dialect Options. 21642 (line 106) 21643* %LOC: Argument list functions. 21644 (line 6) 21645* %REF: Argument list functions. 21646 (line 6) 21647* %VAL: Argument list functions. 21648 (line 6) 21649* &: Error and Warning Options. 21650 (line 88) 21651* [...]: Fortran 2003 status. (line 78) 21652* _gfortran_set_args: _gfortran_set_args. (line 6) 21653* _gfortran_set_convert: _gfortran_set_convert. 21654 (line 6) 21655* _gfortran_set_fpe: _gfortran_set_fpe. (line 6) 21656* _gfortran_set_max_subrecord_length: _gfortran_set_max_subrecord_length. 21657 (line 6) 21658* _gfortran_set_options: _gfortran_set_options. 21659 (line 6) 21660* _gfortran_set_record_marker: _gfortran_set_record_marker. 21661 (line 6) 21662* ABORT: ABORT. (line 6) 21663* ABS: ABS. (line 6) 21664* absolute value: ABS. (line 6) 21665* ACCESS: ACCESS. (line 6) 21666* ACCESS='STREAM' I/O: Fortran 2003 status. (line 102) 21667* ACHAR: ACHAR. (line 6) 21668* ACOS: ACOS. (line 6) 21669* ACOSD: ACOSD. (line 6) 21670* ACOSH: ACOSH. (line 6) 21671* adjust string: ADJUSTL. (line 6) 21672* adjust string <1>: ADJUSTR. (line 6) 21673* ADJUSTL: ADJUSTL. (line 6) 21674* ADJUSTR: ADJUSTR. (line 6) 21675* AIMAG: AIMAG. (line 6) 21676* AINT: AINT. (line 6) 21677* ALARM: ALARM. (line 6) 21678* ALGAMA: LOG_GAMMA. (line 6) 21679* aliasing: Error and Warning Options. 21680 (line 71) 21681* alignment of COMMON blocks: Error and Warning Options. 21682 (line 228) 21683* alignment of COMMON blocks <1>: Code Gen Options. (line 408) 21684* ALL: ALL. (line 6) 21685* all warnings: Error and Warning Options. 21686 (line 62) 21687* ALLOCATABLE components of derived types: Fortran 2003 status. 21688 (line 100) 21689* ALLOCATABLE dummy arguments: Fortran 2003 status. (line 98) 21690* ALLOCATABLE function results: Fortran 2003 status. (line 99) 21691* ALLOCATED: ALLOCATED. (line 6) 21692* allocation, moving: MOVE_ALLOC. (line 6) 21693* allocation, status: ALLOCATED. (line 6) 21694* ALOG: LOG. (line 6) 21695* ALOG10: LOG10. (line 6) 21696* AMAX0: MAX. (line 6) 21697* AMAX1: MAX. (line 6) 21698* AMIN0: MIN. (line 6) 21699* AMIN1: MIN. (line 6) 21700* AMOD: MOD. (line 6) 21701* AND: AND. (line 6) 21702* ANINT: ANINT. (line 6) 21703* ANY: ANY. (line 6) 21704* area hyperbolic cosine: ACOSH. (line 6) 21705* area hyperbolic sine: ASINH. (line 6) 21706* area hyperbolic tangent: ATANH. (line 6) 21707* argument list functions: Argument list functions. 21708 (line 6) 21709* arguments, to program: COMMAND_ARGUMENT_COUNT. 21710 (line 6) 21711* arguments, to program <1>: GETARG. (line 6) 21712* arguments, to program <2>: GET_COMMAND. (line 6) 21713* arguments, to program <3>: GET_COMMAND_ARGUMENT. 21714 (line 6) 21715* arguments, to program <4>: IARGC. (line 6) 21716* array, add elements: SUM. (line 6) 21717* array, AND: IALL. (line 6) 21718* array, apply condition: ALL. (line 6) 21719* array, apply condition <1>: ANY. (line 6) 21720* array, bounds checking: Code Gen Options. (line 144) 21721* array, change dimensions: RESHAPE. (line 6) 21722* array, combine arrays: MERGE. (line 6) 21723* array, condition testing: ALL. (line 6) 21724* array, condition testing <1>: ANY. (line 6) 21725* array, conditionally add elements: SUM. (line 6) 21726* array, conditionally count elements: COUNT. (line 6) 21727* array, conditionally multiply elements: PRODUCT. (line 6) 21728* array, constructors: Fortran 2003 status. (line 78) 21729* array, contiguity: IS_CONTIGUOUS. (line 6) 21730* array, count elements: SIZE. (line 6) 21731* array, duplicate dimensions: SPREAD. (line 6) 21732* array, duplicate elements: SPREAD. (line 6) 21733* array, element counting: COUNT. (line 6) 21734* array, gather elements: PACK. (line 6) 21735* array, increase dimension: SPREAD. (line 6) 21736* array, increase dimension <1>: UNPACK. (line 6) 21737* array, indices of type real: Real array indices. (line 6) 21738* array, location of maximum element: MAXLOC. (line 6) 21739* array, location of minimum element: MINLOC. (line 6) 21740* array, lower bound: LBOUND. (line 6) 21741* array, maximum value: MAXVAL. (line 6) 21742* array, merge arrays: MERGE. (line 6) 21743* array, minimum value: MINVAL. (line 6) 21744* array, multiply elements: PRODUCT. (line 6) 21745* array, number of elements: COUNT. (line 6) 21746* array, number of elements <1>: SIZE. (line 6) 21747* array, OR: IANY. (line 6) 21748* array, packing: PACK. (line 6) 21749* array, parity: IPARITY. (line 6) 21750* array, permutation: CSHIFT. (line 6) 21751* array, product: PRODUCT. (line 6) 21752* array, reduce dimension: PACK. (line 6) 21753* array, rotate: CSHIFT. (line 6) 21754* array, scatter elements: UNPACK. (line 6) 21755* array, shape: SHAPE. (line 6) 21756* array, shift: EOSHIFT. (line 6) 21757* array, shift circularly: CSHIFT. (line 6) 21758* array, size: SIZE. (line 6) 21759* array, sum: SUM. (line 6) 21760* array, transmogrify: RESHAPE. (line 6) 21761* array, transpose: TRANSPOSE. (line 6) 21762* array, unpacking: UNPACK. (line 6) 21763* array, upper bound: UBOUND. (line 6) 21764* array, XOR: IPARITY. (line 6) 21765* ASCII collating sequence: ACHAR. (line 6) 21766* ASCII collating sequence <1>: IACHAR. (line 6) 21767* ASIN: ASIN. (line 6) 21768* ASIND: ASIND. (line 6) 21769* ASINH: ASINH. (line 6) 21770* ASSOCIATED: ASSOCIATED. (line 6) 21771* association status: ASSOCIATED. (line 6) 21772* association status, C pointer: C_ASSOCIATED. (line 6) 21773* asynchronous I/O: Asynchronous I/O. (line 6) 21774* ATAN: ATAN. (line 6) 21775* ATAN2: ATAN2. (line 6) 21776* ATAN2D: ATAN2D. (line 6) 21777* ATAND: ATAND. (line 6) 21778* ATANH: ATANH. (line 6) 21779* Atomic subroutine, add: ATOMIC_ADD. (line 6) 21780* Atomic subroutine, ADD with fetch: ATOMIC_FETCH_ADD. (line 6) 21781* Atomic subroutine, AND: ATOMIC_AND. (line 6) 21782* Atomic subroutine, AND with fetch: ATOMIC_FETCH_AND. (line 6) 21783* Atomic subroutine, compare and swap: ATOMIC_CAS. (line 6) 21784* Atomic subroutine, define: ATOMIC_DEFINE. (line 6) 21785* Atomic subroutine, OR: ATOMIC_OR. (line 6) 21786* Atomic subroutine, OR with fetch: ATOMIC_FETCH_OR. (line 6) 21787* Atomic subroutine, reference: ATOMIC_REF. (line 6) 21788* Atomic subroutine, XOR: ATOMIC_XOR. (line 6) 21789* Atomic subroutine, XOR with fetch: ATOMIC_FETCH_XOR. (line 6) 21790* ATOMIC_ADD: ATOMIC_ADD. (line 6) 21791* ATOMIC_AND: ATOMIC_AND. (line 6) 21792* ATOMIC_DEFINE: ATOMIC_CAS. (line 6) 21793* ATOMIC_DEFINE <1>: ATOMIC_DEFINE. (line 6) 21794* ATOMIC_FETCH_ADD: ATOMIC_FETCH_ADD. (line 6) 21795* ATOMIC_FETCH_AND: ATOMIC_FETCH_AND. (line 6) 21796* ATOMIC_FETCH_OR: ATOMIC_FETCH_OR. (line 6) 21797* ATOMIC_FETCH_XOR: ATOMIC_FETCH_XOR. (line 6) 21798* ATOMIC_OR: ATOMIC_OR. (line 6) 21799* ATOMIC_REF: ATOMIC_REF. (line 6) 21800* ATOMIC_XOR: ATOMIC_XOR. (line 6) 21801* Authors: Contributors. (line 6) 21802* AUTOMATIC: AUTOMATIC and STATIC attributes. 21803 (line 6) 21804* BABS: ABS. (line 6) 21805* backslash: Fortran Dialect Options. 21806 (line 112) 21807* BACKSPACE: Read/Write after EOF marker. 21808 (line 6) 21809* BACKTRACE: BACKTRACE. (line 6) 21810* backtrace: Debugging Options. (line 86) 21811* backtrace <1>: BACKTRACE. (line 6) 21812* base 10 logarithm function: LOG10. (line 6) 21813* BBCLR: IBCLR. (line 6) 21814* BBITS: IBITS. (line 6) 21815* BBSET: IBSET. (line 6) 21816* BBTEST: BTEST. (line 6) 21817* BESJ0: BESSEL_J0. (line 6) 21818* BESJ1: BESSEL_J1. (line 6) 21819* BESJN: BESSEL_JN. (line 6) 21820* Bessel function, first kind: BESSEL_J0. (line 6) 21821* Bessel function, first kind <1>: BESSEL_J1. (line 6) 21822* Bessel function, first kind <2>: BESSEL_JN. (line 6) 21823* Bessel function, second kind: BESSEL_Y0. (line 6) 21824* Bessel function, second kind <1>: BESSEL_Y1. (line 6) 21825* Bessel function, second kind <2>: BESSEL_YN. (line 6) 21826* BESSEL_J0: BESSEL_J0. (line 6) 21827* BESSEL_J1: BESSEL_J1. (line 6) 21828* BESSEL_JN: BESSEL_JN. (line 6) 21829* BESSEL_Y0: BESSEL_Y0. (line 6) 21830* BESSEL_Y1: BESSEL_Y1. (line 6) 21831* BESSEL_YN: BESSEL_YN. (line 6) 21832* BESY0: BESSEL_Y0. (line 6) 21833* BESY1: BESSEL_Y1. (line 6) 21834* BESYN: BESSEL_YN. (line 6) 21835* BGE: BGE. (line 6) 21836* BGT: BGT. (line 6) 21837* BIAND: IAND. (line 6) 21838* BIEOR: IEOR. (line 6) 21839* binary representation: POPCNT. (line 6) 21840* binary representation <1>: POPPAR. (line 6) 21841* BIOR: IOR. (line 6) 21842* bit intrinsics checking: Code Gen Options. (line 144) 21843* BITEST: BTEST. (line 6) 21844* bits set: POPCNT. (line 6) 21845* bits, AND of array elements: IALL. (line 6) 21846* bits, clear: IBCLR. (line 6) 21847* bits, extract: IBITS. (line 6) 21848* bits, get: IBITS. (line 6) 21849* bits, merge: MERGE_BITS. (line 6) 21850* bits, move: MVBITS. (line 6) 21851* bits, move <1>: TRANSFER. (line 6) 21852* bits, negate: NOT. (line 6) 21853* bits, number of: BIT_SIZE. (line 6) 21854* bits, OR of array elements: IANY. (line 6) 21855* bits, set: IBSET. (line 6) 21856* bits, shift: ISHFT. (line 6) 21857* bits, shift circular: ISHFTC. (line 6) 21858* bits, shift left: LSHIFT. (line 6) 21859* bits, shift left <1>: SHIFTL. (line 6) 21860* bits, shift right: RSHIFT. (line 6) 21861* bits, shift right <1>: SHIFTA. (line 6) 21862* bits, shift right <2>: SHIFTR. (line 6) 21863* bits, testing: BTEST. (line 6) 21864* bits, unset: IBCLR. (line 6) 21865* bits, XOR of array elements: IPARITY. (line 6) 21866* bitwise comparison: BGE. (line 6) 21867* bitwise comparison <1>: BGT. (line 6) 21868* bitwise comparison <2>: BLE. (line 6) 21869* bitwise comparison <3>: BLT. (line 6) 21870* bitwise logical and: AND. (line 6) 21871* bitwise logical and <1>: IAND. (line 6) 21872* bitwise logical exclusive or: IEOR. (line 6) 21873* bitwise logical exclusive or <1>: XOR. (line 6) 21874* bitwise logical not: NOT. (line 6) 21875* bitwise logical or: IOR. (line 6) 21876* bitwise logical or <1>: OR. (line 6) 21877* BIT_SIZE: BIT_SIZE. (line 6) 21878* BJTEST: BTEST. (line 6) 21879* BKTEST: BTEST. (line 6) 21880* BLE: BLE. (line 6) 21881* BLT: BLT. (line 6) 21882* BMOD: MOD. (line 6) 21883* BMVBITS: MVBITS. (line 6) 21884* BNOT: NOT. (line 6) 21885* bounds checking: Code Gen Options. (line 144) 21886* BOZ literal constants: BOZ literal constants. 21887 (line 6) 21888* BSHFT: ISHFT. (line 6) 21889* BSHFTC: ISHFTC. (line 6) 21890* BTEST: BTEST. (line 6) 21891* CABS: ABS. (line 6) 21892* calling convention: Code Gen Options. (line 28) 21893* CARRIAGECONTROL: Extended I/O specifiers. 21894 (line 6) 21895* CCOS: COS. (line 6) 21896* CCOSD: COSD. (line 6) 21897* CDABS: ABS. (line 6) 21898* CDCOS: COS. (line 6) 21899* CDCOSD: COSD. (line 6) 21900* CDEXP: EXP. (line 6) 21901* CDLOG: LOG. (line 6) 21902* CDSIN: SIN. (line 6) 21903* CDSIND: SIND. (line 6) 21904* CDSQRT: SQRT. (line 6) 21905* CEILING: CEILING. (line 6) 21906* ceiling: ANINT. (line 6) 21907* ceiling <1>: CEILING. (line 6) 21908* CEXP: EXP. (line 6) 21909* CHAR: CHAR. (line 6) 21910* character kind: SELECTED_CHAR_KIND. (line 6) 21911* character set: Fortran Dialect Options. 21912 (line 106) 21913* CHDIR: CHDIR. (line 6) 21914* checking array temporaries: Code Gen Options. (line 144) 21915* checking subscripts: Code Gen Options. (line 144) 21916* CHMOD: CHMOD. (line 6) 21917* clock ticks: MCLOCK. (line 6) 21918* clock ticks <1>: MCLOCK8. (line 6) 21919* clock ticks <2>: SYSTEM_CLOCK. (line 6) 21920* CLOG: LOG. (line 6) 21921* CMPLX: CMPLX. (line 6) 21922* coarray, IMAGE_INDEX: IMAGE_INDEX. (line 6) 21923* coarray, lower bound: LCOBOUND. (line 6) 21924* coarray, NUM_IMAGES: NUM_IMAGES. (line 6) 21925* coarray, THIS_IMAGE: THIS_IMAGE. (line 6) 21926* coarray, upper bound: UCOBOUND. (line 6) 21927* Coarray, _gfortran_caf_atomic_cas: _gfortran_caf_atomic_cas. 21928 (line 6) 21929* Coarray, _gfortran_caf_atomic_define: _gfortran_caf_atomic_define. 21930 (line 6) 21931* Coarray, _gfortran_caf_atomic_op: _gfortran_caf_atomic_op. 21932 (line 6) 21933* Coarray, _gfortran_caf_atomic_ref: _gfortran_caf_atomic_ref. 21934 (line 6) 21935* Coarray, _gfortran_caf_co_broadcast: _gfortran_caf_co_broadcast. 21936 (line 6) 21937* Coarray, _gfortran_caf_co_max: _gfortran_caf_co_max. 21938 (line 6) 21939* Coarray, _gfortran_caf_co_min: _gfortran_caf_co_min. 21940 (line 6) 21941* Coarray, _gfortran_caf_co_reduce: _gfortran_caf_co_reduce. 21942 (line 6) 21943* Coarray, _gfortran_caf_co_sum: _gfortran_caf_co_sum. 21944 (line 6) 21945* Coarray, _gfortran_caf_deregister: _gfortran_caf_deregister. 21946 (line 6) 21947* Coarray, _gfortran_caf_error_stop: _gfortran_caf_error_stop. 21948 (line 6) 21949* Coarray, _gfortran_caf_error_stop_str: _gfortran_caf_error_stop_str. 21950 (line 6) 21951* Coarray, _gfortran_caf_event_post: _gfortran_caf_event_post. 21952 (line 6) 21953* Coarray, _gfortran_caf_event_query: _gfortran_caf_event_query. 21954 (line 6) 21955* Coarray, _gfortran_caf_event_wait: _gfortran_caf_event_wait. 21956 (line 6) 21957* Coarray, _gfortran_caf_failed_images: _gfortran_caf_failed_images. 21958 (line 6) 21959* Coarray, _gfortran_caf_fail_image: _gfortran_caf_fail_image. 21960 (line 6) 21961* Coarray, _gfortran_caf_finish: _gfortran_caf_finish. 21962 (line 6) 21963* Coarray, _gfortran_caf_get: _gfortran_caf_get. (line 6) 21964* Coarray, _gfortran_caf_get_by_ref: _gfortran_caf_get_by_ref. 21965 (line 6) 21966* Coarray, _gfortran_caf_image_status: _gfortran_caf_image_status. 21967 (line 6) 21968* Coarray, _gfortran_caf_init: _gfortran_caf_init. (line 6) 21969* Coarray, _gfortran_caf_is_present: _gfortran_caf_is_present. 21970 (line 6) 21971* Coarray, _gfortran_caf_lock: _gfortran_caf_lock. (line 6) 21972* Coarray, _gfortran_caf_num_images: _gfortran_caf_num_images. 21973 (line 6) 21974* Coarray, _gfortran_caf_register: _gfortran_caf_register. 21975 (line 6) 21976* Coarray, _gfortran_caf_send: _gfortran_caf_send. (line 6) 21977* Coarray, _gfortran_caf_sendget: _gfortran_caf_sendget. 21978 (line 6) 21979* Coarray, _gfortran_caf_sendget_by_ref: _gfortran_caf_sendget_by_ref. 21980 (line 6) 21981* Coarray, _gfortran_caf_send_by_ref: _gfortran_caf_send_by_ref. 21982 (line 6) 21983* Coarray, _gfortran_caf_stopped_images: _gfortran_caf_stopped_images. 21984 (line 6) 21985* Coarray, _gfortran_caf_sync_all: _gfortran_caf_sync_all. 21986 (line 6) 21987* Coarray, _gfortran_caf_sync_images: _gfortran_caf_sync_images. 21988 (line 6) 21989* Coarray, _gfortran_caf_sync_memory: _gfortran_caf_sync_memory. 21990 (line 6) 21991* Coarray, _gfortran_caf_this_image: _gfortran_caf_this_image. 21992 (line 6) 21993* Coarray, _gfortran_caf_unlock: _gfortran_caf_unlock. 21994 (line 6) 21995* coarrays: Code Gen Options. (line 130) 21996* Coarrays: Coarray Programming. (line 6) 21997* code generation, conventions: Code Gen Options. (line 6) 21998* collating sequence, ASCII: ACHAR. (line 6) 21999* collating sequence, ASCII <1>: IACHAR. (line 6) 22000* Collectives, generic reduction: CO_REDUCE. (line 6) 22001* Collectives, maximal value: CO_MAX. (line 6) 22002* Collectives, minimal value: CO_MIN. (line 6) 22003* Collectives, sum of values: CO_SUM. (line 6) 22004* Collectives, value broadcasting: CO_BROADCAST. (line 6) 22005* command line: EXECUTE_COMMAND_LINE. 22006 (line 6) 22007* command options: Invoking GNU Fortran. 22008 (line 6) 22009* command-line arguments: COMMAND_ARGUMENT_COUNT. 22010 (line 6) 22011* command-line arguments <1>: GETARG. (line 6) 22012* command-line arguments <2>: GET_COMMAND. (line 6) 22013* command-line arguments <3>: GET_COMMAND_ARGUMENT. 22014 (line 6) 22015* command-line arguments <4>: IARGC. (line 6) 22016* command-line arguments, number of: COMMAND_ARGUMENT_COUNT. 22017 (line 6) 22018* command-line arguments, number of <1>: IARGC. (line 6) 22019* COMMAND_ARGUMENT_COUNT: COMMAND_ARGUMENT_COUNT. 22020 (line 6) 22021* COMMON: Volatile COMMON blocks. 22022 (line 6) 22023* compiler flags inquiry function: COMPILER_OPTIONS. (line 6) 22024* compiler, name and version: COMPILER_VERSION. (line 6) 22025* COMPILER_OPTIONS: COMPILER_OPTIONS. (line 6) 22026* COMPILER_VERSION: COMPILER_VERSION. (line 6) 22027* COMPLEX: COMPLEX. (line 6) 22028* complex conjugate: CONJG. (line 6) 22029* Complex function: Alternate complex function syntax. 22030 (line 6) 22031* complex numbers, conversion to: CMPLX. (line 6) 22032* complex numbers, conversion to <1>: COMPLEX. (line 6) 22033* complex numbers, conversion to <2>: DCMPLX. (line 6) 22034* complex numbers, imaginary part: AIMAG. (line 6) 22035* complex numbers, real part: DREAL. (line 6) 22036* complex numbers, real part <1>: REAL. (line 6) 22037* Conditional compilation: Preprocessing and conditional compilation. 22038 (line 6) 22039* CONJG: CONJG. (line 6) 22040* consistency, durability: Data consistency and durability. 22041 (line 6) 22042* Contributing: Contributing. (line 6) 22043* Contributors: Contributors. (line 6) 22044* conversion: Error and Warning Options. 22045 (line 117) 22046* conversion <1>: Error and Warning Options. 22047 (line 121) 22048* conversion, to character: Character conversion. 22049 (line 6) 22050* conversion, to character <1>: CHAR. (line 6) 22051* conversion, to complex: CMPLX. (line 6) 22052* conversion, to complex <1>: COMPLEX. (line 6) 22053* conversion, to complex <2>: DCMPLX. (line 6) 22054* conversion, to integer: Implicitly convert LOGICAL and INTEGER values. 22055 (line 6) 22056* conversion, to integer <1>: IACHAR. (line 6) 22057* conversion, to integer <2>: ICHAR. (line 6) 22058* conversion, to integer <3>: INT. (line 6) 22059* conversion, to integer <4>: INT2. (line 6) 22060* conversion, to integer <5>: INT8. (line 6) 22061* conversion, to integer <6>: LONG. (line 6) 22062* conversion, to logical: Implicitly convert LOGICAL and INTEGER values. 22063 (line 6) 22064* conversion, to logical <1>: LOGICAL. (line 6) 22065* conversion, to real: DBLE. (line 6) 22066* conversion, to real <1>: REAL. (line 6) 22067* conversion, to string: CTIME. (line 6) 22068* CONVERT specifier: CONVERT specifier. (line 6) 22069* core, dump: ABORT. (line 6) 22070* COS: COS. (line 6) 22071* COSD: COSD. (line 6) 22072* COSH: COSH. (line 6) 22073* cosine: COS. (line 6) 22074* cosine, degrees: COSD. (line 6) 22075* cosine, hyperbolic: COSH. (line 6) 22076* cosine, hyperbolic, inverse: ACOSH. (line 6) 22077* cosine, inverse: ACOS. (line 6) 22078* cosine, inverse, degrees: ACOSD. (line 6) 22079* COTAN: COTAN. (line 6) 22080* COTAND: COTAND. (line 6) 22081* cotangent: COTAN. (line 6) 22082* cotangent, degrees: COTAND. (line 6) 22083* COUNT: COUNT. (line 6) 22084* CO_BROADCAST: CO_BROADCAST. (line 6) 22085* CO_MAX: CO_MAX. (line 6) 22086* CO_MIN: CO_MIN. (line 6) 22087* CO_REDUCE: CO_REDUCE. (line 6) 22088* CO_SUM: CO_SUM. (line 6) 22089* CPP: Preprocessing and conditional compilation. 22090 (line 6) 22091* CPP <1>: Preprocessing Options. 22092 (line 6) 22093* CPU_TIME: CPU_TIME. (line 6) 22094* Credits: Contributors. (line 6) 22095* CSHIFT: CSHIFT. (line 6) 22096* CSIN: SIN. (line 6) 22097* CSIND: SIND. (line 6) 22098* CSQRT: SQRT. (line 6) 22099* CTIME: CTIME. (line 6) 22100* current date: DATE_AND_TIME. (line 6) 22101* current date <1>: FDATE. (line 6) 22102* current date <2>: IDATE. (line 6) 22103* current time: DATE_AND_TIME. (line 6) 22104* current time <1>: FDATE. (line 6) 22105* current time <2>: ITIME. (line 6) 22106* current time <3>: TIME. (line 6) 22107* current time <4>: TIME8. (line 6) 22108* C_ASSOCIATED: C_ASSOCIATED. (line 6) 22109* C_FUNLOC: C_FUNLOC. (line 6) 22110* C_F_POINTER: C_F_POINTER. (line 6) 22111* C_F_PROCPOINTER: C_F_PROCPOINTER. (line 6) 22112* C_LOC: C_LOC. (line 6) 22113* C_SIZEOF: C_SIZEOF. (line 6) 22114* DABS: ABS. (line 6) 22115* DACOS: ACOS. (line 6) 22116* DACOSD: ACOSD. (line 6) 22117* DACOSH: ACOSH. (line 6) 22118* DASIN: ASIN. (line 6) 22119* DASIND: ASIND. (line 6) 22120* DASINH: ASINH. (line 6) 22121* DATAN: ATAN. (line 6) 22122* DATAN2: ATAN2. (line 6) 22123* DATAN2D: ATAN2D. (line 6) 22124* DATAND: ATAND. (line 6) 22125* DATANH: ATANH. (line 6) 22126* date, current: DATE_AND_TIME. (line 6) 22127* date, current <1>: FDATE. (line 6) 22128* date, current <2>: IDATE. (line 6) 22129* DATE_AND_TIME: DATE_AND_TIME. (line 6) 22130* DBESJ0: BESSEL_J0. (line 6) 22131* DBESJ1: BESSEL_J1. (line 6) 22132* DBESJN: BESSEL_JN. (line 6) 22133* DBESY0: BESSEL_Y0. (line 6) 22134* DBESY1: BESSEL_Y1. (line 6) 22135* DBESYN: BESSEL_YN. (line 6) 22136* DBLE: DBLE. (line 6) 22137* DCMPLX: DCMPLX. (line 6) 22138* DCONJG: CONJG. (line 6) 22139* DCOS: COS. (line 6) 22140* DCOSD: COSD. (line 6) 22141* DCOSH: COSH. (line 6) 22142* DCOTAN: COTAN. (line 6) 22143* DCOTAND: COTAND. (line 6) 22144* DDIM: DIM. (line 6) 22145* debugging information options: Debugging Options. (line 6) 22146* debugging, preprocessor: Preprocessing Options. 22147 (line 26) 22148* debugging, preprocessor <1>: Preprocessing Options. 22149 (line 35) 22150* debugging, preprocessor <2>: Preprocessing Options. 22151 (line 41) 22152* debugging, preprocessor <3>: Preprocessing Options. 22153 (line 44) 22154* debugging, preprocessor <4>: Preprocessing Options. 22155 (line 51) 22156* DECODE: ENCODE and DECODE statements. 22157 (line 6) 22158* delayed execution: ALARM. (line 6) 22159* delayed execution <1>: SLEEP. (line 6) 22160* DEXP: EXP. (line 6) 22161* DFLOAT: REAL. (line 6) 22162* DGAMMA: GAMMA. (line 6) 22163* dialect options: Fortran Dialect Options. 22164 (line 6) 22165* DIGITS: DIGITS. (line 6) 22166* DIM: DIM. (line 6) 22167* DIMAG: AIMAG. (line 6) 22168* DINT: AINT. (line 6) 22169* directive, INCLUDE: Directory Options. (line 6) 22170* directory, options: Directory Options. (line 6) 22171* directory, search paths for inclusion: Directory Options. (line 14) 22172* division, modulo: MODULO. (line 6) 22173* division, remainder: MOD. (line 6) 22174* DLGAMA: LOG_GAMMA. (line 6) 22175* DLOG: LOG. (line 6) 22176* DLOG10: LOG10. (line 6) 22177* DMAX1: MAX. (line 6) 22178* DMIN1: MIN. (line 6) 22179* DMOD: MOD. (line 6) 22180* DNINT: ANINT. (line 6) 22181* dot product: DOT_PRODUCT. (line 6) 22182* DOT_PRODUCT: DOT_PRODUCT. (line 6) 22183* DPROD: DPROD. (line 6) 22184* DREAL: DREAL. (line 6) 22185* DSHIFTL: DSHIFTL. (line 6) 22186* DSHIFTR: DSHIFTR. (line 6) 22187* DSIGN: SIGN. (line 6) 22188* DSIN: SIN. (line 6) 22189* DSIND: SIND. (line 6) 22190* DSINH: SINH. (line 6) 22191* DSQRT: SQRT. (line 6) 22192* DTAN: TAN. (line 6) 22193* DTAND: TAND. (line 6) 22194* DTANH: TANH. (line 6) 22195* DTIME: DTIME. (line 6) 22196* dummy argument, unused: Error and Warning Options. 22197 (line 217) 22198* elapsed time: DTIME. (line 6) 22199* elapsed time <1>: SECNDS. (line 6) 22200* elapsed time <2>: SECOND. (line 6) 22201* Elimination of functions with identical argument lists: Code Gen Options. 22202 (line 435) 22203* ENCODE: ENCODE and DECODE statements. 22204 (line 6) 22205* ENUM statement: Fortran 2003 status. (line 92) 22206* ENUMERATOR statement: Fortran 2003 status. (line 92) 22207* environment variable: Environment Variables. 22208 (line 6) 22209* environment variable <1>: Runtime. (line 6) 22210* environment variable <2>: GETENV. (line 6) 22211* environment variable <3>: GET_ENVIRONMENT_VARIABLE. 22212 (line 6) 22213* EOF: Read/Write after EOF marker. 22214 (line 6) 22215* EOSHIFT: EOSHIFT. (line 6) 22216* EPSILON: EPSILON. (line 6) 22217* ERF: ERF. (line 6) 22218* ERFC: ERFC. (line 6) 22219* ERFC_SCALED: ERFC_SCALED. (line 6) 22220* error function: ERF. (line 6) 22221* error function, complementary: ERFC. (line 6) 22222* error function, complementary, exponentially-scaled: ERFC_SCALED. 22223 (line 6) 22224* errors, limiting: Error and Warning Options. 22225 (line 27) 22226* escape characters: Fortran Dialect Options. 22227 (line 112) 22228* ETIME: ETIME. (line 6) 22229* Euclidean distance: HYPOT. (line 6) 22230* Euclidean vector norm: NORM2. (line 6) 22231* Events, EVENT_QUERY: EVENT_QUERY. (line 6) 22232* EVENT_QUERY: EVENT_QUERY. (line 6) 22233* EXECUTE_COMMAND_LINE: EXECUTE_COMMAND_LINE. 22234 (line 6) 22235* EXIT: EXIT. (line 6) 22236* EXP: EXP. (line 6) 22237* EXPONENT: EXPONENT. (line 6) 22238* exponent: Default exponents. (line 6) 22239* exponential function: EXP. (line 6) 22240* exponential function, inverse: LOG. (line 6) 22241* exponential function, inverse <1>: LOG10. (line 6) 22242* expression size: C_SIZEOF. (line 6) 22243* expression size <1>: SIZEOF. (line 6) 22244* EXTENDS_TYPE_OF: EXTENDS_TYPE_OF. (line 6) 22245* extensions: Extensions. (line 6) 22246* extensions, implemented: Extensions implemented in GNU Fortran. 22247 (line 6) 22248* extensions, not implemented: Extensions not implemented in GNU Fortran. 22249 (line 6) 22250* extra warnings: Error and Warning Options. 22251 (line 125) 22252* f2c calling convention: Code Gen Options. (line 28) 22253* f2c calling convention <1>: Code Gen Options. (line 113) 22254* Factorial function: GAMMA. (line 6) 22255* FDATE: FDATE. (line 6) 22256* FDL, GNU Free Documentation License: GNU Free Documentation License. 22257 (line 6) 22258* FGET: FGET. (line 6) 22259* FGETC: FGETC. (line 6) 22260* file format, fixed: Fortran Dialect Options. 22261 (line 11) 22262* file format, fixed <1>: Fortran Dialect Options. 22263 (line 129) 22264* file format, free: Fortran Dialect Options. 22265 (line 11) 22266* file format, free <1>: Fortran Dialect Options. 22267 (line 151) 22268* file operation, file number: FNUM. (line 6) 22269* file operation, flush: FLUSH. (line 6) 22270* file operation, position: FSEEK. (line 6) 22271* file operation, position <1>: FTELL. (line 6) 22272* file operation, read character: FGET. (line 6) 22273* file operation, read character <1>: FGETC. (line 6) 22274* file operation, seek: FSEEK. (line 6) 22275* file operation, write character: FPUT. (line 6) 22276* file operation, write character <1>: FPUTC. (line 6) 22277* file system, access mode: ACCESS. (line 6) 22278* file system, change access mode: CHMOD. (line 6) 22279* file system, create link: LINK. (line 6) 22280* file system, create link <1>: SYMLNK. (line 6) 22281* file system, file creation mask: UMASK. (line 6) 22282* file system, file status: FSTAT. (line 6) 22283* file system, file status <1>: LSTAT. (line 6) 22284* file system, file status <2>: STAT. (line 6) 22285* file system, hard link: LINK. (line 6) 22286* file system, remove file: UNLINK. (line 6) 22287* file system, rename file: RENAME. (line 6) 22288* file system, soft link: SYMLNK. (line 6) 22289* file, symbolic link: File operations on symbolic links. 22290 (line 6) 22291* file, unformatted sequential: File format of unformatted sequential files. 22292 (line 6) 22293* FINDLOC: FINDLOC. (line 6) 22294* findloc: FINDLOC. (line 6) 22295* flags inquiry function: COMPILER_OPTIONS. (line 6) 22296* FLOAT: REAL. (line 6) 22297* FLOATI: REAL. (line 6) 22298* floating point, exponent: EXPONENT. (line 6) 22299* floating point, fraction: FRACTION. (line 6) 22300* floating point, nearest different: NEAREST. (line 6) 22301* floating point, relative spacing: RRSPACING. (line 6) 22302* floating point, relative spacing <1>: SPACING. (line 6) 22303* floating point, scale: SCALE. (line 6) 22304* floating point, set exponent: SET_EXPONENT. (line 6) 22305* FLOATJ: REAL. (line 6) 22306* FLOATK: REAL. (line 6) 22307* FLOOR: FLOOR. (line 6) 22308* floor: AINT. (line 6) 22309* floor <1>: FLOOR. (line 6) 22310* FLUSH: FLUSH. (line 6) 22311* FLUSH statement: Fortran 2003 status. (line 88) 22312* FNUM: FNUM. (line 6) 22313* form feed whitespace: Form feed as whitespace. 22314 (line 6) 22315* FORMAT: Variable FORMAT expressions. 22316 (line 6) 22317* Fortran 77: GNU Fortran and G77. (line 6) 22318* FPP: Preprocessing and conditional compilation. 22319 (line 6) 22320* FPUT: FPUT. (line 6) 22321* FPUTC: FPUTC. (line 6) 22322* FRACTION: FRACTION. (line 6) 22323* FREE: FREE. (line 6) 22324* Front-end optimization: Code Gen Options. (line 443) 22325* FSEEK: FSEEK. (line 6) 22326* FSTAT: FSTAT. (line 6) 22327* FTELL: FTELL. (line 6) 22328* function elimination: Error and Warning Options. 22329 (line 234) 22330* g77: GNU Fortran and G77. (line 6) 22331* g77 calling convention: Code Gen Options. (line 28) 22332* g77 calling convention <1>: Code Gen Options. (line 113) 22333* GAMMA: GAMMA. (line 6) 22334* Gamma function: GAMMA. (line 6) 22335* Gamma function, logarithm of: LOG_GAMMA. (line 6) 22336* GCC: GNU Fortran and GCC. (line 6) 22337* Generating C prototypes from external procedures: Interoperability Options. 22338 (line 25) 22339* Generating C prototypes from Fortran BIND(C) enteties: Interoperability Options. 22340 (line 7) 22341* GERROR: GERROR. (line 6) 22342* GETARG: GETARG. (line 6) 22343* GETCWD: GETCWD. (line 6) 22344* GETENV: GETENV. (line 6) 22345* GETGID: GETGID. (line 6) 22346* GETLOG: GETLOG. (line 6) 22347* GETPID: GETPID. (line 6) 22348* GETUID: GETUID. (line 6) 22349* GET_COMMAND: GET_COMMAND. (line 6) 22350* GET_COMMAND_ARGUMENT: GET_COMMAND_ARGUMENT. 22351 (line 6) 22352* GET_ENVIRONMENT_VARIABLE: GET_ENVIRONMENT_VARIABLE. 22353 (line 6) 22354* GMTIME: GMTIME. (line 6) 22355* GNU Compiler Collection: GNU Fortran and GCC. (line 6) 22356* GNU Fortran command options: Invoking GNU Fortran. 22357 (line 6) 22358* Hollerith constants: Hollerith constants support. 22359 (line 6) 22360* HOSTNM: HOSTNM. (line 6) 22361* HUGE: HUGE. (line 6) 22362* hyperbolic cosine: COSH. (line 6) 22363* hyperbolic function, cosine: COSH. (line 6) 22364* hyperbolic function, cosine, inverse: ACOSH. (line 6) 22365* hyperbolic function, sine: SINH. (line 6) 22366* hyperbolic function, sine, inverse: ASINH. (line 6) 22367* hyperbolic function, tangent: TANH. (line 6) 22368* hyperbolic function, tangent, inverse: ATANH. (line 6) 22369* hyperbolic sine: SINH. (line 6) 22370* hyperbolic tangent: TANH. (line 6) 22371* HYPOT: HYPOT. (line 6) 22372* I/O item lists: I/O item lists. (line 6) 22373* I/O specifiers: Extended I/O specifiers. 22374 (line 6) 22375* IABS: ABS. (line 6) 22376* IACHAR: IACHAR. (line 6) 22377* IALL: IALL. (line 6) 22378* IAND: IAND. (line 6) 22379* IANY: IANY. (line 6) 22380* IARGC: IARGC. (line 6) 22381* IBCLR: IBCLR. (line 6) 22382* IBITS: IBITS. (line 6) 22383* IBSET: IBSET. (line 6) 22384* ICHAR: ICHAR. (line 6) 22385* IDATE: IDATE. (line 6) 22386* IDIM: DIM. (line 6) 22387* IDINT: INT. (line 6) 22388* IDNINT: NINT. (line 6) 22389* IEEE, ISNAN: ISNAN. (line 6) 22390* IEOR: IEOR. (line 6) 22391* IERRNO: IERRNO. (line 6) 22392* IFIX: INT. (line 6) 22393* IIABS: ABS. (line 6) 22394* IIAND: IAND. (line 6) 22395* IIBCLR: IBCLR. (line 6) 22396* IIBITS: IBITS. (line 6) 22397* IIBSET: IBSET. (line 6) 22398* IIEOR: IEOR. (line 6) 22399* IIOR: IOR. (line 6) 22400* IISHFT: ISHFT. (line 6) 22401* IISHFTC: ISHFTC. (line 6) 22402* IMAG: AIMAG. (line 6) 22403* images, cosubscript to image index conversion: IMAGE_INDEX. (line 6) 22404* images, index of this image: THIS_IMAGE. (line 6) 22405* images, number of: NUM_IMAGES. (line 6) 22406* IMAGE_INDEX: IMAGE_INDEX. (line 6) 22407* IMAGPART: AIMAG. (line 6) 22408* IMOD: MOD. (line 6) 22409* IMPORT statement: Fortran 2003 status. (line 119) 22410* IMVBITS: MVBITS. (line 6) 22411* INCLUDE directive: Directory Options. (line 6) 22412* inclusion, directory search paths for: Directory Options. (line 14) 22413* INDEX: INDEX intrinsic. (line 6) 22414* INOT: NOT. (line 6) 22415* input/output, asynchronous: Asynchronous I/O. (line 6) 22416* INT: INT. (line 6) 22417* INT2: INT2. (line 6) 22418* INT8: INT8. (line 6) 22419* integer kind: SELECTED_INT_KIND. (line 6) 22420* Interoperability: Mixed-Language Programming. 22421 (line 6) 22422* intrinsic: Error and Warning Options. 22423 (line 206) 22424* intrinsic <1>: Error and Warning Options. 22425 (line 213) 22426* intrinsic Modules: Intrinsic Modules. (line 6) 22427* intrinsic procedures: Intrinsic Procedures. 22428 (line 6) 22429* intrinsics, integer: Type variants for integer intrinsics. 22430 (line 6) 22431* intrinsics, math: Extended math intrinsics. 22432 (line 6) 22433* intrinsics, trigonometric functions: Extended math intrinsics. 22434 (line 6) 22435* Introduction: Top. (line 6) 22436* inverse hyperbolic cosine: ACOSH. (line 6) 22437* inverse hyperbolic sine: ASINH. (line 6) 22438* inverse hyperbolic tangent: ATANH. (line 6) 22439* IOMSG= specifier: Fortran 2003 status. (line 90) 22440* IOR: IOR. (line 6) 22441* IOSTAT, end of file: IS_IOSTAT_END. (line 6) 22442* IOSTAT, end of record: IS_IOSTAT_EOR. (line 6) 22443* IPARITY: IPARITY. (line 6) 22444* IRAND: IRAND. (line 6) 22445* ISATTY: ISATTY. (line 6) 22446* ISHFT: ISHFT. (line 6) 22447* ISHFTC: ISHFTC. (line 6) 22448* ISIGN: SIGN. (line 6) 22449* ISNAN: ISNAN. (line 6) 22450* ISO_FORTRAN_ENV statement: Fortran 2003 status. (line 127) 22451* IS_IOSTAT_END: IS_IOSTAT_END. (line 6) 22452* IS_IOSTAT_EOR: IS_CONTIGUOUS. (line 6) 22453* IS_IOSTAT_EOR <1>: IS_IOSTAT_EOR. (line 6) 22454* ITIME: ITIME. (line 6) 22455* JIABS: ABS. (line 6) 22456* JIAND: IAND. (line 6) 22457* JIBCLR: IBCLR. (line 6) 22458* JIBITS: IBITS. (line 6) 22459* JIBSET: IBSET. (line 6) 22460* JIEOR: IEOR. (line 6) 22461* JIOR: IOR. (line 6) 22462* JISHFT: ISHFT. (line 6) 22463* JISHFTC: ISHFTC. (line 6) 22464* JMOD: MOD. (line 6) 22465* JMVBITS: MVBITS. (line 6) 22466* JNOT: NOT. (line 6) 22467* KIABS: ABS. (line 6) 22468* KIAND: IAND. (line 6) 22469* KIBCLR: IBCLR. (line 6) 22470* KIBITS: IBITS. (line 6) 22471* KIBSET: IBSET. (line 6) 22472* KIEOR: IEOR. (line 6) 22473* KILL: KILL. (line 6) 22474* kind: KIND Type Parameters. 22475 (line 6) 22476* KIND: KIND. (line 6) 22477* kind <1>: KIND. (line 6) 22478* kind, character: SELECTED_CHAR_KIND. (line 6) 22479* kind, integer: SELECTED_INT_KIND. (line 6) 22480* kind, old-style: Old-style kind specifications. 22481 (line 6) 22482* kind, real: SELECTED_REAL_KIND. (line 6) 22483* KIOR: IOR. (line 6) 22484* KISHFT: ISHFT. (line 6) 22485* KISHFTC: ISHFTC. (line 6) 22486* KMOD: MOD. (line 6) 22487* KMVBITS: MVBITS. (line 6) 22488* KNOT: NOT. (line 6) 22489* L2 vector norm: NORM2. (line 6) 22490* language, dialect options: Fortran Dialect Options. 22491 (line 6) 22492* LBOUND: LBOUND. (line 6) 22493* LCOBOUND: LCOBOUND. (line 6) 22494* LEADZ: LEADZ. (line 6) 22495* left shift, combined: DSHIFTL. (line 6) 22496* LEN: LEN. (line 6) 22497* LEN_TRIM: LEN_TRIM. (line 6) 22498* lexical comparison of strings: LGE. (line 6) 22499* lexical comparison of strings <1>: LGT. (line 6) 22500* lexical comparison of strings <2>: LLE. (line 6) 22501* lexical comparison of strings <3>: LLT. (line 6) 22502* LGAMMA: LOG_GAMMA. (line 6) 22503* LGE: LGE. (line 6) 22504* LGT: LGT. (line 6) 22505* libf2c calling convention: Code Gen Options. (line 28) 22506* libf2c calling convention <1>: Code Gen Options. (line 113) 22507* libgfortran initialization, set_args: _gfortran_set_args. (line 6) 22508* libgfortran initialization, set_convert: _gfortran_set_convert. 22509 (line 6) 22510* libgfortran initialization, set_fpe: _gfortran_set_fpe. (line 6) 22511* libgfortran initialization, set_max_subrecord_length: _gfortran_set_max_subrecord_length. 22512 (line 6) 22513* libgfortran initialization, set_options: _gfortran_set_options. 22514 (line 6) 22515* libgfortran initialization, set_record_marker: _gfortran_set_record_marker. 22516 (line 6) 22517* limits, largest number: HUGE. (line 6) 22518* limits, smallest number: TINY. (line 6) 22519* LINK: LINK. (line 6) 22520* linking, static: Link Options. (line 6) 22521* LLE: LLE. (line 6) 22522* LLT: LLT. (line 6) 22523* LNBLNK: LNBLNK. (line 6) 22524* LOC: %LOC as an rvalue. (line 6) 22525* LOC <1>: LOC. (line 6) 22526* location of a variable in memory: LOC. (line 6) 22527* LOG: LOG. (line 6) 22528* LOG10: LOG10. (line 6) 22529* logarithm function: LOG. (line 6) 22530* logarithm function with base 10: LOG10. (line 6) 22531* logarithm function, inverse: EXP. (line 6) 22532* LOGICAL: LOGICAL. (line 6) 22533* logical and, bitwise: AND. (line 6) 22534* logical and, bitwise <1>: IAND. (line 6) 22535* logical exclusive or, bitwise: IEOR. (line 6) 22536* logical exclusive or, bitwise <1>: XOR. (line 6) 22537* logical not, bitwise: NOT. (line 6) 22538* logical or, bitwise: IOR. (line 6) 22539* logical or, bitwise <1>: OR. (line 6) 22540* logical, bitwise: Bitwise logical operators. 22541 (line 6) 22542* logical, variable representation: Internal representation of LOGICAL variables. 22543 (line 6) 22544* login name: GETLOG. (line 6) 22545* LOG_GAMMA: LOG_GAMMA. (line 6) 22546* LONG: LONG. (line 6) 22547* loop interchange, Fortran: Code Gen Options. (line 456) 22548* loop interchange, warning: Error and Warning Options. 22549 (line 130) 22550* LSHIFT: LSHIFT. (line 6) 22551* LSTAT: LSTAT. (line 6) 22552* LTIME: LTIME. (line 6) 22553* MALLOC: MALLOC. (line 6) 22554* MAP: UNION and MAP. (line 6) 22555* mask, left justified: MASKL. (line 6) 22556* mask, right justified: MASKR. (line 6) 22557* MASKL: MASKL. (line 6) 22558* MASKR: MASKR. (line 6) 22559* MATMUL: MATMUL. (line 6) 22560* matrix multiplication: MATMUL. (line 6) 22561* matrix, transpose: TRANSPOSE. (line 6) 22562* MAX: MAX. (line 6) 22563* MAX, MIN, NaN: MAX and MIN intrinsics with REAL NaN arguments. 22564 (line 6) 22565* MAX0: MAX. (line 6) 22566* MAX1: MAX. (line 6) 22567* MAXEXPONENT: MAXEXPONENT. (line 6) 22568* maximum value: MAX. (line 6) 22569* maximum value <1>: MAXVAL. (line 6) 22570* MAXLOC: MAXLOC. (line 6) 22571* MAXVAL: MAXVAL. (line 6) 22572* MCLOCK: MCLOCK. (line 6) 22573* MCLOCK8: MCLOCK8. (line 6) 22574* memory checking: Code Gen Options. (line 144) 22575* MERGE: MERGE. (line 6) 22576* MERGE_BITS: MERGE_BITS. (line 6) 22577* messages, error: Error and Warning Options. 22578 (line 6) 22579* messages, warning: Error and Warning Options. 22580 (line 6) 22581* MIN: MIN. (line 6) 22582* MIN0: MIN. (line 6) 22583* MIN1: MIN. (line 6) 22584* MINEXPONENT: MINEXPONENT. (line 6) 22585* minimum value: MIN. (line 6) 22586* minimum value <1>: MINVAL. (line 6) 22587* MINLOC: MINLOC. (line 6) 22588* MINVAL: MINVAL. (line 6) 22589* Mixed-language programming: Mixed-Language Programming. 22590 (line 6) 22591* MOD: MOD. (line 6) 22592* model representation, base: RADIX. (line 6) 22593* model representation, epsilon: EPSILON. (line 6) 22594* model representation, largest number: HUGE. (line 6) 22595* model representation, maximum exponent: MAXEXPONENT. (line 6) 22596* model representation, minimum exponent: MINEXPONENT. (line 6) 22597* model representation, precision: PRECISION. (line 6) 22598* model representation, radix: RADIX. (line 6) 22599* model representation, range: RANGE. (line 6) 22600* model representation, significant digits: DIGITS. (line 6) 22601* model representation, smallest number: TINY. (line 6) 22602* module entities: Fortran Dialect Options. 22603 (line 124) 22604* module search path: Directory Options. (line 14) 22605* module search path <1>: Directory Options. (line 29) 22606* module search path <2>: Directory Options. (line 36) 22607* MODULO: MODULO. (line 6) 22608* modulo: MODULO. (line 6) 22609* MOVE_ALLOC: MOVE_ALLOC. (line 6) 22610* moving allocation: MOVE_ALLOC. (line 6) 22611* multiply array elements: PRODUCT. (line 6) 22612* MVBITS: MVBITS. (line 6) 22613* NAME: OPEN( ... NAME=). (line 6) 22614* Namelist: Extensions to namelist. 22615 (line 6) 22616* natural logarithm function: LOG. (line 6) 22617* NEAREST: NEAREST. (line 6) 22618* newline: NEW_LINE. (line 6) 22619* NEW_LINE: NEW_LINE. (line 6) 22620* NINT: NINT. (line 6) 22621* norm, Euclidean: NORM2. (line 6) 22622* NORM2: NORM2. (line 6) 22623* NOSHARED: Extended I/O specifiers. 22624 (line 6) 22625* NOT: NOT. (line 6) 22626* NULL: NULL. (line 6) 22627* NUM_IMAGES: NUM_IMAGES. (line 6) 22628* open, action: Files opened without an explicit ACTION= specifier. 22629 (line 6) 22630* OpenACC: Fortran Dialect Options. 22631 (line 171) 22632* OpenACC <1>: OpenACC. (line 6) 22633* OpenMP: Fortran Dialect Options. 22634 (line 178) 22635* OpenMP <1>: OpenMP. (line 6) 22636* operators, unary: Unary operators. (line 6) 22637* operators, xor: .XOR. operator. (line 6) 22638* options inquiry function: COMPILER_OPTIONS. (line 6) 22639* options, code generation: Code Gen Options. (line 6) 22640* options, debugging: Debugging Options. (line 6) 22641* options, dialect: Fortran Dialect Options. 22642 (line 6) 22643* options, directory search: Directory Options. (line 6) 22644* options, errors: Error and Warning Options. 22645 (line 6) 22646* options, Fortran dialect: Fortran Dialect Options. 22647 (line 11) 22648* options, gfortran command: Invoking GNU Fortran. 22649 (line 6) 22650* options, linking: Link Options. (line 6) 22651* options, negative forms: Invoking GNU Fortran. 22652 (line 13) 22653* options, preprocessor: Preprocessing Options. 22654 (line 6) 22655* options, real kind type promotion: Fortran Dialect Options. 22656 (line 257) 22657* options, run-time: Code Gen Options. (line 6) 22658* options, runtime: Runtime Options. (line 6) 22659* options, warnings: Error and Warning Options. 22660 (line 6) 22661* OR: OR. (line 6) 22662* output, newline: NEW_LINE. (line 6) 22663* PACK: PACK. (line 6) 22664* PARAMETER: Legacy PARAMETER statements. 22665 (line 6) 22666* PARITY: PARITY. (line 6) 22667* Parity: PARITY. (line 6) 22668* parity: POPPAR. (line 6) 22669* paths, search: Directory Options. (line 14) 22670* paths, search <1>: Directory Options. (line 29) 22671* paths, search <2>: Directory Options. (line 36) 22672* PERROR: PERROR. (line 6) 22673* pointer checking: Code Gen Options. (line 144) 22674* pointer, C address of pointers: C_F_PROCPOINTER. (line 6) 22675* pointer, C address of procedures: C_FUNLOC. (line 6) 22676* pointer, C association status: C_ASSOCIATED. (line 6) 22677* pointer, convert C to Fortran: C_F_POINTER. (line 6) 22678* pointer, Cray: Cray pointers. (line 6) 22679* pointer, cray: FREE. (line 6) 22680* pointer, cray <1>: MALLOC. (line 6) 22681* pointer, disassociated: NULL. (line 6) 22682* pointer, status: ASSOCIATED. (line 6) 22683* pointer, status <1>: NULL. (line 6) 22684* POPCNT: POPCNT. (line 6) 22685* POPPAR: POPPAR. (line 6) 22686* positive difference: DIM. (line 6) 22687* PRECISION: PRECISION. (line 6) 22688* Preprocessing: Preprocessing and conditional compilation. 22689 (line 6) 22690* preprocessing, assertion: Preprocessing Options. 22691 (line 113) 22692* preprocessing, assertion <1>: Preprocessing Options. 22693 (line 119) 22694* preprocessing, define macros: Preprocessing Options. 22695 (line 151) 22696* preprocessing, define macros <1>: Preprocessing Options. 22697 (line 154) 22698* preprocessing, include path: Preprocessing Options. 22699 (line 69) 22700* preprocessing, include path <1>: Preprocessing Options. 22701 (line 76) 22702* preprocessing, include path <2>: Preprocessing Options. 22703 (line 80) 22704* preprocessing, include path <3>: Preprocessing Options. 22705 (line 85) 22706* preprocessing, include path <4>: Preprocessing Options. 22707 (line 89) 22708* preprocessing, include path <5>: Preprocessing Options. 22709 (line 96) 22710* preprocessing, keep comments: Preprocessing Options. 22711 (line 122) 22712* preprocessing, keep comments <1>: Preprocessing Options. 22713 (line 137) 22714* preprocessing, no linemarkers: Preprocessing Options. 22715 (line 179) 22716* preprocessing, undefine macros: Preprocessing Options. 22717 (line 185) 22718* preprocessor: Preprocessing Options. 22719 (line 6) 22720* preprocessor, debugging: Preprocessing Options. 22721 (line 26) 22722* preprocessor, debugging <1>: Preprocessing Options. 22723 (line 35) 22724* preprocessor, debugging <2>: Preprocessing Options. 22725 (line 41) 22726* preprocessor, debugging <3>: Preprocessing Options. 22727 (line 44) 22728* preprocessor, debugging <4>: Preprocessing Options. 22729 (line 51) 22730* preprocessor, disable: Preprocessing Options. 22731 (line 12) 22732* preprocessor, enable: Preprocessing Options. 22733 (line 12) 22734* preprocessor, include file handling: Preprocessing and conditional compilation. 22735 (line 6) 22736* preprocessor, working directory: Preprocessing Options. 22737 (line 55) 22738* PRESENT: PRESENT. (line 6) 22739* private: Fortran Dialect Options. 22740 (line 124) 22741* procedure pointer, convert C to Fortran: C_LOC. (line 6) 22742* process ID: GETPID. (line 6) 22743* PRODUCT: PRODUCT. (line 6) 22744* product, double-precision: DPROD. (line 6) 22745* product, matrix: MATMUL. (line 6) 22746* product, vector: DOT_PRODUCT. (line 6) 22747* program termination: EXIT. (line 6) 22748* program termination, with core dump: ABORT. (line 6) 22749* PROTECTED statement: Fortran 2003 status. (line 113) 22750* Q edit descriptor: Q edit descriptor. (line 6) 22751* Q exponent-letter: Q exponent-letter. (line 6) 22752* RADIX: RADIX. (line 6) 22753* radix, real: SELECTED_REAL_KIND. (line 6) 22754* RAN: RAN. (line 6) 22755* RAND: RAND. (line 6) 22756* random number generation: IRAND. (line 6) 22757* random number generation <1>: RAN. (line 6) 22758* random number generation <2>: RAND. (line 6) 22759* random number generation <3>: RANDOM_NUMBER. (line 6) 22760* random number generation, initialization: RANDOM_INIT. (line 6) 22761* random number generation, seeding: RANDOM_SEED. (line 6) 22762* random number generation, seeding <1>: SRAND. (line 6) 22763* RANDOM_INIT: RANDOM_INIT. (line 6) 22764* RANDOM_NUMBER: RANDOM_NUMBER. (line 6) 22765* RANDOM_SEED: RANDOM_SEED. (line 6) 22766* RANGE: RANGE. (line 6) 22767* range checking: Code Gen Options. (line 144) 22768* RANK: RANK. (line 6) 22769* rank: RANK. (line 6) 22770* re-association of parenthesized expressions: Code Gen Options. 22771 (line 420) 22772* read character, stream mode: FGET. (line 6) 22773* read character, stream mode <1>: FGETC. (line 6) 22774* READONLY: Extended I/O specifiers. 22775 (line 6) 22776* REAL: REAL. (line 6) 22777* real kind: SELECTED_REAL_KIND. (line 6) 22778* real number, exponent: EXPONENT. (line 6) 22779* real number, fraction: FRACTION. (line 6) 22780* real number, nearest different: NEAREST. (line 6) 22781* real number, relative spacing: RRSPACING. (line 6) 22782* real number, relative spacing <1>: SPACING. (line 6) 22783* real number, scale: SCALE. (line 6) 22784* real number, set exponent: SET_EXPONENT. (line 6) 22785* Reallocate the LHS in assignments: Code Gen Options. (line 429) 22786* Reallocate the LHS in assignments, notification: Error and Warning Options. 22787 (line 239) 22788* REALPART: REAL. (line 6) 22789* RECORD: STRUCTURE and RECORD. 22790 (line 6) 22791* record marker: File format of unformatted sequential files. 22792 (line 6) 22793* Reduction, XOR: PARITY. (line 6) 22794* remainder: MOD. (line 6) 22795* RENAME: RENAME. (line 6) 22796* repacking arrays: Code Gen Options. (line 288) 22797* REPEAT: REPEAT. (line 6) 22798* RESHAPE: RESHAPE. (line 6) 22799* REWIND: Read/Write after EOF marker. 22800 (line 6) 22801* right shift, combined: DSHIFTR. (line 6) 22802* root: SQRT. (line 6) 22803* rounding, ceiling: ANINT. (line 6) 22804* rounding, ceiling <1>: CEILING. (line 6) 22805* rounding, floor: AINT. (line 6) 22806* rounding, floor <1>: FLOOR. (line 6) 22807* rounding, nearest whole number: NINT. (line 6) 22808* RRSPACING: RRSPACING. (line 6) 22809* RSHIFT: RSHIFT. (line 6) 22810* run-time checking: Code Gen Options. (line 144) 22811* SAME_TYPE_AS: SAME_TYPE_AS. (line 6) 22812* SAVE statement: Code Gen Options. (line 15) 22813* SCALE: SCALE. (line 6) 22814* SCAN: SCAN. (line 6) 22815* search path: Directory Options. (line 6) 22816* search paths, for included files: Directory Options. (line 14) 22817* SECNDS: SECNDS. (line 6) 22818* SECOND: SECOND. (line 6) 22819* seeding a random number generator: RANDOM_SEED. (line 6) 22820* seeding a random number generator <1>: SRAND. (line 6) 22821* SELECTED_CHAR_KIND: SELECTED_CHAR_KIND. (line 6) 22822* SELECTED_INT_KIND: SELECTED_INT_KIND. (line 6) 22823* SELECTED_REAL_KIND: SELECTED_REAL_KIND. (line 6) 22824* sequential, unformatted: File format of unformatted sequential files. 22825 (line 6) 22826* SET_EXPONENT: SET_EXPONENT. (line 6) 22827* SHAPE: SHAPE. (line 6) 22828* SHARE: Extended I/O specifiers. 22829 (line 6) 22830* SHARED: Extended I/O specifiers. 22831 (line 6) 22832* shift, left: DSHIFTL. (line 6) 22833* shift, left <1>: SHIFTL. (line 6) 22834* shift, right: DSHIFTR. (line 6) 22835* shift, right <1>: SHIFTR. (line 6) 22836* shift, right with fill: SHIFTA. (line 6) 22837* SHIFTA: SHIFTA. (line 6) 22838* SHIFTL: SHIFTL. (line 6) 22839* SHIFTR: SHIFTR. (line 6) 22840* SHORT: INT2. (line 6) 22841* SIGN: SIGN. (line 6) 22842* sign copying: SIGN. (line 6) 22843* SIGNAL: SIGNAL. (line 6) 22844* SIN: SIN. (line 6) 22845* SIND: SIND. (line 6) 22846* sine: SIN. (line 6) 22847* sine, degrees: SIND. (line 6) 22848* sine, hyperbolic: SINH. (line 6) 22849* sine, hyperbolic, inverse: ASINH. (line 6) 22850* sine, inverse: ASIN. (line 6) 22851* sine, inverse, degrees: ASIND. (line 6) 22852* SINH: SINH. (line 6) 22853* SIZE: SIZE. (line 6) 22854* size of a variable, in bits: BIT_SIZE. (line 6) 22855* size of an expression: C_SIZEOF. (line 6) 22856* size of an expression <1>: SIZEOF. (line 6) 22857* SIZEOF: SIZEOF. (line 6) 22858* SLEEP: SLEEP. (line 6) 22859* SNGL: REAL. (line 6) 22860* SPACING: SPACING. (line 6) 22861* SPREAD: SPREAD. (line 6) 22862* SQRT: SQRT. (line 6) 22863* square-root: SQRT. (line 6) 22864* SRAND: SRAND. (line 6) 22865* Standards: Standards. (line 6) 22866* STAT: STAT. (line 6) 22867* statement, ENUM: Fortran 2003 status. (line 92) 22868* statement, ENUMERATOR: Fortran 2003 status. (line 92) 22869* statement, FLUSH: Fortran 2003 status. (line 88) 22870* statement, IMPORT: Fortran 2003 status. (line 119) 22871* statement, ISO_FORTRAN_ENV: Fortran 2003 status. (line 127) 22872* statement, PROTECTED: Fortran 2003 status. (line 113) 22873* statement, SAVE: Code Gen Options. (line 15) 22874* statement, USE, INTRINSIC: Fortran 2003 status. (line 127) 22875* statement, VALUE: Fortran 2003 status. (line 115) 22876* statement, VOLATILE: Fortran 2003 status. (line 117) 22877* STATIC: AUTOMATIC and STATIC attributes. 22878 (line 6) 22879* storage size: STORAGE_SIZE. (line 6) 22880* STORAGE_SIZE: STORAGE_SIZE. (line 6) 22881* STREAM I/O: Fortran 2003 status. (line 102) 22882* stream mode, read character: FGET. (line 6) 22883* stream mode, read character <1>: FGETC. (line 6) 22884* stream mode, write character: FPUT. (line 6) 22885* stream mode, write character <1>: FPUTC. (line 6) 22886* string, adjust left: ADJUSTL. (line 6) 22887* string, adjust right: ADJUSTR. (line 6) 22888* string, comparison: LGE. (line 6) 22889* string, comparison <1>: LGT. (line 6) 22890* string, comparison <2>: LLE. (line 6) 22891* string, comparison <3>: LLT. (line 6) 22892* string, concatenate: REPEAT. (line 6) 22893* string, find missing set: VERIFY. (line 6) 22894* string, find non-blank character: LNBLNK. (line 6) 22895* string, find subset: SCAN. (line 6) 22896* string, find substring: INDEX intrinsic. (line 6) 22897* string, length: LEN. (line 6) 22898* string, length, without trailing whitespace: LEN_TRIM. (line 6) 22899* string, remove trailing whitespace: TRIM. (line 6) 22900* string, repeat: REPEAT. (line 6) 22901* strings, varying length: Varying Length Character Strings. 22902 (line 6) 22903* STRUCTURE: STRUCTURE and RECORD. 22904 (line 6) 22905* structure packing: Code Gen Options. (line 282) 22906* subrecord: File format of unformatted sequential files. 22907 (line 6) 22908* subscript checking: Code Gen Options. (line 144) 22909* substring position: INDEX intrinsic. (line 6) 22910* SUM: SUM. (line 6) 22911* sum array elements: SUM. (line 6) 22912* suppressing warnings: Error and Warning Options. 22913 (line 6) 22914* symbol names: Fortran Dialect Options. 22915 (line 106) 22916* symbol names, transforming: Code Gen Options. (line 57) 22917* symbol names, transforming <1>: Code Gen Options. (line 113) 22918* symbol names, underscores: Code Gen Options. (line 57) 22919* symbol names, underscores <1>: Code Gen Options. (line 113) 22920* SYMLNK: SYMLNK. (line 6) 22921* syntax checking: Error and Warning Options. 22922 (line 33) 22923* SYSTEM: SYSTEM. (line 6) 22924* system, error handling: GERROR. (line 6) 22925* system, error handling <1>: IERRNO. (line 6) 22926* system, error handling <2>: PERROR. (line 6) 22927* system, group ID: GETGID. (line 6) 22928* system, host name: HOSTNM. (line 6) 22929* system, login name: GETLOG. (line 6) 22930* system, process ID: GETPID. (line 6) 22931* system, signal handling: SIGNAL. (line 6) 22932* system, system call: EXECUTE_COMMAND_LINE. 22933 (line 6) 22934* system, system call <1>: SYSTEM. (line 6) 22935* system, terminal: ISATTY. (line 6) 22936* system, terminal <1>: TTYNAM. (line 6) 22937* system, user ID: GETUID. (line 6) 22938* system, working directory: CHDIR. (line 6) 22939* system, working directory <1>: GETCWD. (line 6) 22940* SYSTEM_CLOCK: SYSTEM_CLOCK. (line 6) 22941* tabulators: Error and Warning Options. 22942 (line 188) 22943* TAN: TAN. (line 6) 22944* TAND: TAND. (line 6) 22945* tangent: TAN. (line 6) 22946* tangent, degrees: TAND. (line 6) 22947* tangent, hyperbolic: TANH. (line 6) 22948* tangent, hyperbolic, inverse: ATANH. (line 6) 22949* tangent, inverse: ATAN. (line 6) 22950* tangent, inverse <1>: ATAN2. (line 6) 22951* tangent, inverse, degrees: ATAND. (line 6) 22952* tangent, inverse, degrees <1>: ATAN2D. (line 6) 22953* TANH: TANH. (line 6) 22954* terminate program: EXIT. (line 6) 22955* terminate program, with core dump: ABORT. (line 6) 22956* THIS_IMAGE: THIS_IMAGE. (line 6) 22957* thread-safety, threads: Thread-safety of the runtime library. 22958 (line 6) 22959* TIME: TIME. (line 6) 22960* time, clock ticks: MCLOCK. (line 6) 22961* time, clock ticks <1>: MCLOCK8. (line 6) 22962* time, clock ticks <2>: SYSTEM_CLOCK. (line 6) 22963* time, conversion to GMT info: GMTIME. (line 6) 22964* time, conversion to local time info: LTIME. (line 6) 22965* time, conversion to string: CTIME. (line 6) 22966* time, current: DATE_AND_TIME. (line 6) 22967* time, current <1>: FDATE. (line 6) 22968* time, current <2>: ITIME. (line 6) 22969* time, current <3>: TIME. (line 6) 22970* time, current <4>: TIME8. (line 6) 22971* time, elapsed: CPU_TIME. (line 6) 22972* time, elapsed <1>: DTIME. (line 6) 22973* time, elapsed <2>: ETIME. (line 6) 22974* time, elapsed <3>: SECNDS. (line 6) 22975* time, elapsed <4>: SECOND. (line 6) 22976* TIME8: TIME8. (line 6) 22977* TINY: TINY. (line 6) 22978* TR 15581: Fortran 2003 status. (line 97) 22979* trace: Debugging Options. (line 86) 22980* TRAILZ: TRAILZ. (line 6) 22981* TRANSFER: TRANSFER. (line 6) 22982* transforming symbol names: Code Gen Options. (line 57) 22983* transforming symbol names <1>: Code Gen Options. (line 113) 22984* TRANSPOSE: TRANSPOSE. (line 6) 22985* transpose: TRANSPOSE. (line 6) 22986* trigonometric function, cosine: COS. (line 6) 22987* trigonometric function, cosine, degrees: COSD. (line 6) 22988* trigonometric function, cosine, inverse: ACOS. (line 6) 22989* trigonometric function, cosine, inverse, degrees: ACOSD. (line 6) 22990* trigonometric function, cotangent: COTAN. (line 6) 22991* trigonometric function, cotangent, degrees: COTAND. (line 6) 22992* trigonometric function, sine: SIN. (line 6) 22993* trigonometric function, sine, degrees: SIND. (line 6) 22994* trigonometric function, sine, inverse: ASIN. (line 6) 22995* trigonometric function, sine, inverse, degrees: ASIND. (line 6) 22996* trigonometric function, tangent: TAN. (line 6) 22997* trigonometric function, tangent, degrees: TAND. (line 6) 22998* trigonometric function, tangent, inverse: ATAN. (line 6) 22999* trigonometric function, tangent, inverse <1>: ATAN2. (line 6) 23000* trigonometric function, tangent, inverse, degrees: ATAND. (line 6) 23001* trigonometric function, tangent, inverse, degrees <1>: ATAN2D. 23002 (line 6) 23003* TRIM: TRIM. (line 6) 23004* TTYNAM: TTYNAM. (line 6) 23005* type alias print: TYPE as an alias for PRINT. 23006 (line 6) 23007* type cast: TRANSFER. (line 6) 23008* UBOUND: UBOUND. (line 6) 23009* UCOBOUND: UCOBOUND. (line 6) 23010* UMASK: UMASK. (line 6) 23011* underflow: Error and Warning Options. 23012 (line 201) 23013* underscore: Code Gen Options. (line 57) 23014* underscore <1>: Code Gen Options. (line 113) 23015* unformatted sequential: File format of unformatted sequential files. 23016 (line 6) 23017* UNION: UNION and MAP. (line 6) 23018* UNLINK: UNLINK. (line 6) 23019* UNPACK: UNPACK. (line 6) 23020* unused dummy argument: Error and Warning Options. 23021 (line 217) 23022* unused parameter: Error and Warning Options. 23023 (line 221) 23024* USE, INTRINSIC statement: Fortran 2003 status. (line 127) 23025* user id: GETUID. (line 6) 23026* VALUE statement: Fortran 2003 status. (line 115) 23027* variable attributes: AUTOMATIC and STATIC attributes. 23028 (line 6) 23029* Varying length character strings: Varying Length Character Strings. 23030 (line 6) 23031* Varying length strings: Varying Length Character Strings. 23032 (line 6) 23033* vector product: DOT_PRODUCT. (line 6) 23034* VERIFY: VERIFY. (line 6) 23035* version of the compiler: COMPILER_VERSION. (line 6) 23036* VOLATILE: Volatile COMMON blocks. 23037 (line 6) 23038* VOLATILE statement: Fortran 2003 status. (line 117) 23039* warning, C binding type: Error and Warning Options. 23040 (line 101) 23041* warnings, aliasing: Error and Warning Options. 23042 (line 71) 23043* warnings, alignment of COMMON blocks: Error and Warning Options. 23044 (line 228) 23045* warnings, all: Error and Warning Options. 23046 (line 62) 23047* warnings, ampersand: Error and Warning Options. 23048 (line 88) 23049* warnings, array temporaries: Error and Warning Options. 23050 (line 96) 23051* warnings, character truncation: Error and Warning Options. 23052 (line 108) 23053* warnings, conversion: Error and Warning Options. 23054 (line 117) 23055* warnings, conversion <1>: Error and Warning Options. 23056 (line 121) 23057* warnings, division of integers: Error and Warning Options. 23058 (line 144) 23059* warnings, extra: Error and Warning Options. 23060 (line 125) 23061* warnings, function elimination: Error and Warning Options. 23062 (line 234) 23063* warnings, implicit interface: Error and Warning Options. 23064 (line 134) 23065* warnings, implicit procedure: Error and Warning Options. 23066 (line 140) 23067* warnings, integer division: Error and Warning Options. 23068 (line 144) 23069* warnings, intrinsic: Error and Warning Options. 23070 (line 206) 23071* warnings, intrinsics of other standards: Error and Warning Options. 23072 (line 148) 23073* warnings, line truncation: Error and Warning Options. 23074 (line 111) 23075* warnings, loop interchange: Error and Warning Options. 23076 (line 130) 23077* warnings, non-standard intrinsics: Error and Warning Options. 23078 (line 148) 23079* warnings, overwrite recursive: Error and Warning Options. 23080 (line 155) 23081* warnings, q exponent-letter: Error and Warning Options. 23082 (line 162) 23083* warnings, suppressing: Error and Warning Options. 23084 (line 6) 23085* warnings, suspicious code: Error and Warning Options. 23086 (line 166) 23087* warnings, tabs: Error and Warning Options. 23088 (line 188) 23089* warnings, to errors: Error and Warning Options. 23090 (line 280) 23091* warnings, undefined do loop: Error and Warning Options. 23092 (line 196) 23093* warnings, underflow: Error and Warning Options. 23094 (line 201) 23095* warnings, unused dummy argument: Error and Warning Options. 23096 (line 217) 23097* warnings, unused parameter: Error and Warning Options. 23098 (line 221) 23099* warnings, use statements: Error and Warning Options. 23100 (line 213) 23101* write character, stream mode: FPUT. (line 6) 23102* write character, stream mode <1>: FPUTC. (line 6) 23103* XOR: XOR. (line 6) 23104* XOR reduction: PARITY. (line 6) 23105* ZABS: ABS. (line 6) 23106* ZCOS: COS. (line 6) 23107* ZCOSD: COSD. (line 6) 23108* zero bits: LEADZ. (line 6) 23109* zero bits <1>: TRAILZ. (line 6) 23110* ZEXP: EXP. (line 6) 23111* ZLOG: LOG. (line 6) 23112* ZSIN: SIN. (line 6) 23113* ZSIND: SIND. (line 6) 23114* ZSQRT: SQRT. (line 6) 23115 23116 23117 23118Tag Table: 23119Node: Top1950 23120Node: Introduction3367 23121Node: About GNU Fortran4116 23122Node: GNU Fortran and GCC8117 23123Node: Preprocessing and conditional compilation10231 23124Node: GNU Fortran and G7712320 23125Node: Project Status12893 23126Node: Standards15470 23127Node: Varying Length Character Strings16695 23128Node: Invoking GNU Fortran17447 23129Node: Option Summary19281 23130Node: Fortran Dialect Options23458 23131Node: Preprocessing Options37423 23132Node: Error and Warning Options45664 23133Node: Debugging Options57594 23134Node: Directory Options62366 23135Node: Link Options63801 23136Node: Runtime Options64427 23137Node: Code Gen Options66334 23138Node: Interoperability Options87463 23139Node: Environment Variables89541 23140Node: Runtime90154 23141Node: TMPDIR91325 23142Node: GFORTRAN_STDIN_UNIT91995 23143Node: GFORTRAN_STDOUT_UNIT92377 23144Node: GFORTRAN_STDERR_UNIT92778 23145Node: GFORTRAN_UNBUFFERED_ALL93180 23146Node: GFORTRAN_UNBUFFERED_PRECONNECTED93711 23147Node: GFORTRAN_SHOW_LOCUS94355 23148Node: GFORTRAN_OPTIONAL_PLUS94851 23149Node: GFORTRAN_LIST_SEPARATOR95329 23150Node: GFORTRAN_CONVERT_UNIT95937 23151Node: GFORTRAN_ERROR_BACKTRACE98792 23152Node: GFORTRAN_FORMATTED_BUFFER_SIZE99388 23153Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE99836 23154Node: Fortran standards status100265 23155Node: Fortran 2003 status100517 23156Node: Fortran 2008 status105672 23157Node: Fortran 2018 status111050 23158Node: Compiler Characteristics113408 23159Node: KIND Type Parameters114191 23160Node: Internal representation of LOGICAL variables115619 23161Node: Evaluation of logical expressions116476 23162Node: MAX and MIN intrinsics with REAL NaN arguments117327 23163Node: Thread-safety of the runtime library118148 23164Node: Data consistency and durability120553 23165Node: Files opened without an explicit ACTION= specifier123666 23166Node: File operations on symbolic links124357 23167Node: File format of unformatted sequential files125477 23168Node: Asynchronous I/O127849 23169Node: Extensions128549 23170Node: Extensions implemented in GNU Fortran129154 23171Node: Old-style kind specifications131128 23172Node: Old-style variable initialization132230 23173Node: Extensions to namelist133542 23174Node: X format descriptor without count field135845 23175Node: Commas in FORMAT specifications136372 23176Node: Missing period in FORMAT specifications137123 23177Node: Default widths for F, G and I format descriptors137719 23178Node: I/O item lists138424 23179Node: Q exponent-letter138818 23180Node: BOZ literal constants139416 23181Node: Real array indices140993 23182Node: Unary operators141292 23183Node: Implicitly convert LOGICAL and INTEGER values141706 23184Node: Hollerith constants support142665 23185Node: Character conversion144889 23186Node: Cray pointers145783 23187Node: CONVERT specifier151284 23188Node: OpenMP153279 23189Node: OpenACC155537 23190Node: Argument list functions156677 23191Node: Read/Write after EOF marker158320 23192Node: STRUCTURE and RECORD158923 23193Node: UNION and MAP164010 23194Node: Type variants for integer intrinsics166978 23195Node: AUTOMATIC and STATIC attributes168873 23196Node: Extended math intrinsics170407 23197Node: Form feed as whitespace172203 23198Node: TYPE as an alias for PRINT172749 23199Node: %LOC as an rvalue173214 23200Node: .XOR. operator173861 23201Node: Bitwise logical operators174261 23202Node: Extended I/O specifiers175762 23203Node: Legacy PARAMETER statements179482 23204Node: Default exponents180087 23205Node: Extensions not implemented in GNU Fortran180439 23206Node: ENCODE and DECODE statements181406 23207Node: Variable FORMAT expressions182737 23208Node: Alternate complex function syntax183842 23209Node: Volatile COMMON blocks184392 23210Node: OPEN( ... NAME=)184894 23211Node: Q edit descriptor185322 23212Node: Mixed-Language Programming186274 23213Node: Interoperability with C186854 23214Node: Intrinsic Types188188 23215Node: Derived Types and struct189184 23216Node: Interoperable Global Variables190542 23217Node: Interoperable Subroutines and Functions191817 23218Node: Working with Pointers195611 23219Node: Further Interoperability of Fortran with C200087 23220Node: GNU Fortran Compiler Directives203659 23221Node: ATTRIBUTES directive204035 23222Node: UNROLL directive207223 23223Node: BUILTIN directive207756 23224Node: IVDEP directive208598 23225Node: VECTOR directive209417 23226Node: NOVECTOR directive209815 23227Node: Non-Fortran Main Program210200 23228Node: _gfortran_set_args212388 23229Node: _gfortran_set_options213326 23230Node: _gfortran_set_convert216972 23231Node: _gfortran_set_record_marker217840 23232Node: _gfortran_set_fpe218650 23233Node: _gfortran_set_max_subrecord_length219848 23234Node: Naming and argument-passing conventions220771 23235Node: Naming conventions221490 23236Node: Argument passing conventions222962 23237Node: Coarray Programming228267 23238Node: Type and enum ABI Documentation228514 23239Node: caf_token_t228812 23240Node: caf_register_t229048 23241Node: caf_deregister_t230259 23242Node: caf_reference_t230761 23243Node: caf_team_t235085 23244Node: Function ABI Documentation235384 23245Node: _gfortran_caf_init237834 23246Node: _gfortran_caf_finish239260 23247Node: _gfortran_caf_this_image240199 23248Node: _gfortran_caf_num_images240954 23249Node: _gfortran_caf_image_status242065 23250Node: _gfortran_caf_failed_images243185 23251Node: _gfortran_caf_stopped_images244355 23252Node: _gfortran_caf_register245528 23253Node: _gfortran_caf_deregister249710 23254Node: _gfortran_caf_is_present251316 23255Node: _gfortran_caf_send252395 23256Node: _gfortran_caf_get255585 23257Node: _gfortran_caf_sendget258666 23258Node: _gfortran_caf_send_by_ref262577 23259Node: _gfortran_caf_get_by_ref266186 23260Node: _gfortran_caf_sendget_by_ref269705 23261Node: _gfortran_caf_lock274001 23262Node: _gfortran_caf_unlock275787 23263Node: _gfortran_caf_event_post277268 23264Node: _gfortran_caf_event_wait278717 23265Node: _gfortran_caf_event_query280824 23266Node: _gfortran_caf_sync_all282155 23267Node: _gfortran_caf_sync_images283083 23268Node: _gfortran_caf_sync_memory284618 23269Node: _gfortran_caf_error_stop285610 23270Node: _gfortran_caf_error_stop_str286214 23271Node: _gfortran_caf_fail_image286919 23272Node: _gfortran_caf_atomic_define287455 23273Node: _gfortran_caf_atomic_ref288770 23274Node: _gfortran_caf_atomic_cas290074 23275Node: _gfortran_caf_atomic_op291835 23276Node: _gfortran_caf_co_broadcast293937 23277Node: _gfortran_caf_co_max295042 23278Node: _gfortran_caf_co_min296668 23279Node: _gfortran_caf_co_sum298288 23280Node: _gfortran_caf_co_reduce299828 23281Node: Intrinsic Procedures302472 23282Node: Introduction to Intrinsics319731 23283Node: ABORT322081 23284Node: ABS322826 23285Node: ACCESS324776 23286Node: ACHAR326676 23287Node: ACOS327880 23288Node: ACOSD329166 23289Node: ACOSH330478 23290Node: ADJUSTL331474 23291Node: ADJUSTR332416 23292Node: AIMAG333366 23293Node: AINT334795 23294Node: ALARM336401 23295Node: ALL338033 23296Node: ALLOCATED339957 23297Node: AND341096 23298Node: ANINT342831 23299Node: ANY344328 23300Node: ASIN346254 23301Node: ASIND347529 23302Node: ASINH348827 23303Node: ASSOCIATED349833 23304Node: ATAN352844 23305Node: ATAND354317 23306Node: ATAN2355810 23307Node: ATAN2D357673 23308Node: ATANH359647 23309Node: ATOMIC_ADD360653 23310Node: ATOMIC_AND362185 23311Node: ATOMIC_CAS363773 23312Node: ATOMIC_DEFINE365632 23313Node: ATOMIC_FETCH_ADD367351 23314Node: ATOMIC_FETCH_AND369151 23315Node: ATOMIC_FETCH_OR370941 23316Node: ATOMIC_FETCH_XOR372718 23317Node: ATOMIC_OR374501 23318Node: ATOMIC_REF376086 23319Node: ATOMIC_XOR377982 23320Node: BACKTRACE379567 23321Node: BESSEL_J0380147 23322Node: BESSEL_J1381163 23323Node: BESSEL_JN382180 23324Node: BESSEL_Y0384005 23325Node: BESSEL_Y1384960 23326Node: BESSEL_YN385915 23327Node: BGE387746 23328Node: BGT388438 23329Node: BIT_SIZE389088 23330Node: BLE389910 23331Node: BLT390592 23332Node: BTEST391230 23333Node: C_ASSOCIATED392717 23334Node: C_F_POINTER393928 23335Node: C_F_PROCPOINTER395363 23336Node: C_FUNLOC396870 23337Node: C_LOC398241 23338Node: C_SIZEOF399520 23339Node: CEILING400928 23340Node: CHAR401936 23341Node: CHDIR403205 23342Node: CHMOD404379 23343Node: CMPLX406294 23344Node: CO_BROADCAST407737 23345Node: CO_MAX409558 23346Node: CO_MIN411465 23347Node: CO_REDUCE413358 23348Node: CO_SUM416929 23349Node: COMMAND_ARGUMENT_COUNT418909 23350Node: COMPILER_OPTIONS419826 23351Node: COMPILER_VERSION420851 23352Node: COMPLEX421814 23353Node: CONJG422953 23354Node: COS423947 23355Node: COSD425402 23356Node: COSH426851 23357Node: COTAN428034 23358Node: COTAND429173 23359Node: COUNT430352 23360Node: CPU_TIME432377 23361Node: CSHIFT433734 23362Node: CTIME435394 23363Node: DATE_AND_TIME436902 23364Node: DBLE439382 23365Node: DCMPLX440177 23366Node: DIGITS441359 23367Node: DIM442326 23368Node: DOT_PRODUCT443785 23369Node: DPROD445428 23370Node: DREAL446355 23371Node: DSHIFTL447021 23372Node: DSHIFTR448354 23373Node: DTIME449688 23374Node: EOSHIFT452503 23375Node: EPSILON454576 23376Node: ERF455303 23377Node: ERFC456084 23378Node: ERFC_SCALED456894 23379Node: ETIME457587 23380Node: EVENT_QUERY459826 23381Node: EXECUTE_COMMAND_LINE461415 23382Node: EXIT464195 23383Node: EXP465073 23384Node: EXPONENT466326 23385Node: EXTENDS_TYPE_OF467090 23386Node: FDATE467948 23387Node: FGET469434 23388Node: FGETC471261 23389Node: FINDLOC473071 23390Node: FLOOR475564 23391Node: FLUSH476555 23392Node: FNUM478434 23393Node: FPUT479159 23394Node: FPUTC480793 23395Node: FRACTION482574 23396Node: FREE483478 23397Node: FSEEK484321 23398Node: FSTAT486627 23399Node: FTELL487713 23400Node: GAMMA488695 23401Node: GERROR489685 23402Node: GETARG490407 23403Node: GET_COMMAND492178 23404Node: GET_COMMAND_ARGUMENT493552 23405Node: GETCWD495599 23406Node: GETENV496579 23407Node: GET_ENVIRONMENT_VARIABLE498011 23408Node: GETGID500174 23409Node: GETLOG500711 23410Node: GETPID501573 23411Node: GETUID502303 23412Node: GMTIME502819 23413Node: HOSTNM504579 23414Node: HUGE505500 23415Node: HYPOT506222 23416Node: IACHAR507048 23417Node: IALL508216 23418Node: IAND509701 23419Node: IANY511483 23420Node: IARGC512977 23421Node: IBCLR513996 23422Node: IBITS515244 23423Node: IBSET516748 23424Node: ICHAR517991 23425Node: IDATE520161 23426Node: IEOR521461 23427Node: IERRNO523136 23428Node: IMAGE_INDEX523684 23429Node: INDEX intrinsic524706 23430Node: INT526232 23431Node: INT2528076 23432Node: INT8528844 23433Node: IOR529559 23434Node: IPARITY531210 23435Node: IRAND532758 23436Node: IS_CONTIGUOUS534117 23437Node: IS_IOSTAT_END535283 23438Node: IS_IOSTAT_EOR536390 23439Node: ISATTY537519 23440Node: ISHFT538302 23441Node: ISHFTC539871 23442Node: ISNAN541678 23443Node: ITIME542445 23444Node: KILL543743 23445Node: KIND544879 23446Node: LBOUND545777 23447Node: LCOBOUND547115 23448Node: LEADZ548250 23449Node: LEN549111 23450Node: LEN_TRIM550407 23451Node: LGE551395 23452Node: LGT552908 23453Node: LINK554386 23454Node: LLE555425 23455Node: LLT556925 23456Node: LNBLNK558396 23457Node: LOC559174 23458Node: LOG559906 23459Node: LOG10561441 23460Node: LOG_GAMMA562431 23461Node: LOGICAL563533 23462Node: LONG564345 23463Node: LSHIFT565103 23464Node: LSTAT566212 23465Node: LTIME567411 23466Node: MALLOC569093 23467Node: MASKL570555 23468Node: MASKR571322 23469Node: MATMUL572092 23470Node: MAX573252 23471Node: MAXEXPONENT574787 23472Node: MAXLOC575604 23473Node: MAXVAL578221 23474Node: MCLOCK579871 23475Node: MCLOCK8580894 23476Node: MERGE582124 23477Node: MERGE_BITS582876 23478Node: MIN583915 23479Node: MINEXPONENT585453 23480Node: MINLOC586084 23481Node: MINVAL588732 23482Node: MOD590385 23483Node: MODULO592710 23484Node: MOVE_ALLOC594175 23485Node: MVBITS595208 23486Node: NEAREST596860 23487Node: NEW_LINE597960 23488Node: NINT598733 23489Node: NORM2600154 23490Node: NOT601296 23491Node: NULL602466 23492Node: NUM_IMAGES603374 23493Node: OR605075 23494Node: PACK606798 23495Node: PARITY608842 23496Node: PERROR610063 23497Node: POPCNT610688 23498Node: POPPAR611559 23499Node: PRECISION612612 23500Node: PRESENT613544 23501Node: PRODUCT614656 23502Node: RADIX616190 23503Node: RAN617001 23504Node: RAND617457 23505Node: RANDOM_INIT618790 23506Node: RANDOM_NUMBER620856 23507Node: RANDOM_SEED622103 23508Node: RANGE624573 23509Node: RANK625253 23510Node: REAL626034 23511Node: RENAME627975 23512Node: REPEAT628997 23513Node: RESHAPE629725 23514Node: RRSPACING631192 23515Node: RSHIFT631885 23516Node: SAME_TYPE_AS633053 23517Node: SCALE633885 23518Node: SCAN634666 23519Node: SECNDS636224 23520Node: SECOND637316 23521Node: SELECTED_CHAR_KIND638192 23522Node: SELECTED_INT_KIND639787 23523Node: SELECTED_REAL_KIND640964 23524Node: SET_EXPONENT643640 23525Node: SHAPE644637 23526Node: SHIFTA646061 23527Node: SHIFTL647052 23528Node: SHIFTR647912 23529Node: SIGN648773 23530Node: SIGNAL650114 23531Node: SIN651620 23532Node: SIND652884 23533Node: SINH654213 23534Node: SIZE655131 23535Node: SIZEOF656450 23536Node: SLEEP658105 23537Node: SPACING658666 23538Node: SPREAD659680 23539Node: SQRT660831 23540Node: SRAND662163 23541Node: STAT663397 23542Node: STORAGE_SIZE666564 23543Node: SUM667443 23544Node: SYMLNK668935 23545Node: SYSTEM670070 23546Node: SYSTEM_CLOCK671325 23547Node: TAN674173 23548Node: TAND675244 23549Node: TANH676328 23550Node: THIS_IMAGE677503 23551Node: TIME679803 23552Node: TIME8680974 23553Node: TINY682173 23554Node: TRAILZ682774 23555Node: TRANSFER683592 23556Node: TRANSPOSE685628 23557Node: TRIM686318 23558Node: TTYNAM687176 23559Node: UBOUND688094 23560Node: UCOBOUND689484 23561Node: UMASK690621 23562Node: UNLINK691303 23563Node: UNPACK692283 23564Node: VERIFY693578 23565Node: XOR695307 23566Node: Intrinsic Modules697117 23567Node: ISO_FORTRAN_ENV697406 23568Node: ISO_C_BINDING701809 23569Node: IEEE modules705515 23570Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS706658 23571Node: OpenACC Module OPENACC708674 23572Node: Contributing709601 23573Node: Contributors710455 23574Node: Projects712086 23575Node: Proposed Extensions712893 23576Node: Copying714903 23577Node: GNU Free Documentation License752448 23578Node: Funding777572 23579Node: Option Index780098 23580Node: Keyword Index799159 23581 23582End Tag Table 23583