1 This is gfortran.info, produced by makeinfo version 6.5 from 2 gfortran.texi. 3 4 Copyright (C) 1999-2022 Free Software Foundation, Inc. 5 6 Permission is granted to copy, distribute and/or modify this document 7 under the terms of the GNU Free Documentation License, Version 1.3 or 8 any later version published by the Free Software Foundation; with the 9 Invariant Sections being "Funding Free Software", the Front-Cover Texts 10 being (a) (see below), and with the Back-Cover Texts being (b) (see 11 below). A copy of the license is included in the section entitled "GNU 12 Free 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 21 software. Copies published by the Free Software Foundation raise funds 22 for GNU development. 23 INFO-DIR-SECTION Software development 24 START-INFO-DIR-ENTRY 25 * gfortran: (gfortran). The GNU Fortran Compiler. 26 END-INFO-DIR-ENTRY 27 28 This file documents the use and the internals of the GNU Fortran 29 compiler, ('gfortran'). 30 31 Published by the Free Software Foundation 51 Franklin Street, Fifth 32 Floor Boston, MA 02110-1301 USA 33 34 Copyright (C) 1999-2022 Free Software Foundation, Inc. 35 36 Permission is granted to copy, distribute and/or modify this document 37 under the terms of the GNU Free Documentation License, Version 1.3 or 38 any later version published by the Free Software Foundation; with the 39 Invariant Sections being "Funding Free Software", the Front-Cover Texts 40 being (a) (see below), and with the Back-Cover Texts being (b) (see 41 below). A copy of the license is included in the section entitled "GNU 42 Free 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 51 software. Copies published by the Free Software Foundation raise funds 52 for GNU development. 53 54 55 File: gfortran.info, Node: Top, Next: Introduction, Up: (dir) 56 57 Introduction 58 ************ 59 60 This manual documents the use of 'gfortran', the GNU Fortran compiler. 61 You can find in this manual how to invoke 'gfortran', as well as its 62 features and incompatibilities. 63 64 * Menu: 65 66 * Introduction:: 67 68 Part I: Invoking GNU Fortran 69 * Invoking GNU Fortran:: Command options supported by 'gfortran'. 70 * Runtime:: Influencing runtime behavior with environment variables. 71 72 Part II: Language Reference 73 * Compiler Characteristics:: User-visible implementation details. 74 * Extensions:: Language extensions implemented by GNU Fortran. 75 * Mixed-Language Programming:: Interoperability with C 76 * Coarray Programming:: 77 * Intrinsic Procedures:: Intrinsic procedures supported by GNU Fortran. 78 * Intrinsic Modules:: Intrinsic modules supported by GNU Fortran. 79 80 * Contributing:: How you can help. 81 * Copying:: GNU General Public License says 82 how you can copy and share GNU Fortran. 83 * GNU Free Documentation License:: 84 How you can copy and share this manual. 85 * Funding:: How to help assure continued work for free software. 86 * Option Index:: Index of command line options 87 * Keyword Index:: Index of concepts 88 89 90 File: gfortran.info, Node: Introduction, Next: Invoking GNU Fortran, Prev: Top, Up: Top 91 92 1 Introduction 93 ************** 94 95 * Menu: 96 97 * About GNU Fortran:: What you should know about the GNU Fortran compiler. 98 * GNU Fortran and GCC:: You can compile Fortran, C, or other programs. 99 * Standards:: Standards supported by GNU Fortran. 100 101 102 File: gfortran.info, Node: About GNU Fortran, Next: GNU Fortran and GCC, Up: Introduction 103 104 1.1 About GNU Fortran 105 ===================== 106 107 The GNU Fortran compiler is the successor to 'g77', the Fortran 77 front 108 end included in GCC prior to version 4 (released in 2005). While it is 109 backward-compatible with most 'g77' extensions and command-line options, 110 'gfortran' is a completely new implemention designed to support more 111 modern dialects of Fortran. GNU Fortran implements the Fortran 77, 90 112 and 95 standards completely, most of the Fortran 2003 and 2008 113 standards, and some features from the 2018 standard. It also implements 114 several extensions including OpenMP and OpenACC support for parallel 115 programming. 116 117 The GNU Fortran compiler passes the NIST Fortran 77 Test Suite 118 (http://www.fortran-2000.com/ArnaudRecipes/fcvs21_f95.html), and 119 produces acceptable results on the LAPACK Test Suite 120 (https://www.netlib.org/lapack/faq.html#1.21). It also provides 121 respectable performance on the Polyhedron Fortran compiler benchmarks 122 (https://polyhedron.com/?page_id=175) and the Livermore Fortran Kernels 123 test (https://www.netlib.org/benchmark/livermore). It has been used to 124 compile a number of large real-world programs, including the HARMONIE 125 and HIRLAM weather forecasting code (http://hirlam.org/) and the Tonto 126 quantum chemistry package (https://github.com/dylan-jayatilaka/tonto); 127 see <https://gcc.gnu.org/wiki/GfortranApps> for an extended list. 128 129 GNU Fortran provides the following functionality: 130 131 * Read a program, stored in a file and containing "source code" 132 instructions written in Fortran 77. 133 134 * Translate the program into instructions a computer can carry out 135 more quickly than it takes to translate the original Fortran 136 instructions. The result after compilation of a program is 137 "machine code", which is efficiently translated and processed by a 138 machine such as your computer. Humans usually are not as good 139 writing machine code as they are at writing Fortran (or C++, Ada, 140 or Java), because it is easy to make tiny mistakes writing machine 141 code. 142 143 * Provide information about the reasons why the compiler may be 144 unable to create a binary from the source code, for example if the 145 source code is flawed. The Fortran language standards require that 146 the compiler can point out mistakes in your code. An incorrect 147 usage of the language causes an "error message". 148 149 The compiler also attempts to diagnose cases where your program 150 contains a correct usage of the language, but instructs the 151 computer to do something questionable. This kind of diagnostic 152 message is called a "warning message". 153 154 * Provide optional information about the translation passes from the 155 source code to machine code. This can help you to find the cause 156 of certain bugs which may not be obvious in the source code, but 157 may be more easily found at a lower level compiler output. It also 158 helps developers to find bugs in the compiler itself. 159 160 * Provide information in the generated machine code that can make it 161 easier to find bugs in the program (using a debugging tool, called 162 a "debugger", such as the GNU Debugger 'gdb'). 163 164 * Locate and gather machine code already generated to perform actions 165 requested by statements in the program. This machine code is 166 organized into "modules" and is located and "linked" to the user 167 program. 168 169 The GNU Fortran compiler consists of several components: 170 171 * A version of the 'gcc' command (which also might be installed as 172 the system's 'cc' command) that also understands and accepts 173 Fortran source code. The 'gcc' command is the "driver" program for 174 all the languages in the GNU Compiler Collection (GCC); With 'gcc', 175 you can compile the source code of any language for which a front 176 end is available in GCC. 177 178 * The 'gfortran' command itself, which also might be installed as the 179 system's 'f95' command. 'gfortran' is just another driver program, 180 but specifically for the Fortran compiler only. The primary 181 difference between the 'gcc' and 'gfortran' commands is that the 182 latter automatically links the correct libraries to your program. 183 184 * A collection of run-time libraries. These libraries contain the 185 machine code needed to support capabilities of the Fortran language 186 that are not directly provided by the machine code generated by the 187 'gfortran' compilation phase, such as intrinsic functions and 188 subroutines, and routines for interaction with files and the 189 operating system. 190 191 * The Fortran compiler itself, ('f951'). This is the GNU Fortran 192 parser and code generator, linked to and interfaced with the GCC 193 backend library. 'f951' "translates" the source code to assembler 194 code. You would typically not use this program directly; instead, 195 the 'gcc' or 'gfortran' driver programs call it for you. 196 197 198 File: gfortran.info, Node: GNU Fortran and GCC, Next: Standards, Prev: About GNU Fortran, Up: Introduction 199 200 1.2 GNU Fortran and GCC 201 ======================= 202 203 GNU Fortran is a part of GCC, the "GNU Compiler Collection". GCC 204 consists of a collection of front ends for various languages, which 205 translate the source code into a language-independent form called 206 "GENERIC". This is then processed by a common middle end which provides 207 optimization, and then passed to one of a collection of back ends which 208 generate code for different computer architectures and operating 209 systems. 210 211 Functionally, this is implemented with a driver program ('gcc') which 212 provides the command-line interface for the compiler. It calls the 213 relevant compiler front-end program (e.g., 'f951' for Fortran) for each 214 file in the source code, and then calls the assembler and linker as 215 appropriate to produce the compiled output. In a copy of GCC that has 216 been compiled with Fortran language support enabled, 'gcc' recognizes 217 files with '.f', '.for', '.ftn', '.f90', '.f95', '.f03' and '.f08' 218 extensions as Fortran source code, and compiles it accordingly. A 219 'gfortran' driver program is also provided, which is identical to 'gcc' 220 except that it automatically links the Fortran runtime libraries into 221 the compiled program. 222 223 Source files with '.f', '.for', '.fpp', '.ftn', '.F', '.FOR', '.FPP', 224 and '.FTN' extensions are treated as fixed form. Source files with 225 '.f90', '.f95', '.f03', '.f08', '.F90', '.F95', '.F03' and '.F08' 226 extensions are treated as free form. The capitalized versions of either 227 form are run through preprocessing. Source files with the lower case 228 '.fpp' extension are also run through preprocessing. 229 230 This manual specifically documents the Fortran front end, which 231 handles the programming language's syntax and semantics. The aspects of 232 GCC that relate to the optimization passes and the back-end code 233 generation are documented in the GCC manual; see *note Introduction: 234 (gcc)Top. The two manuals together provide a complete reference for the 235 GNU Fortran compiler. 236 237 238 File: gfortran.info, Node: Standards, Prev: GNU Fortran and GCC, Up: Introduction 239 240 1.3 Standards 241 ============= 242 243 * Menu: 244 245 * Fortran 95 status:: 246 * Fortran 2003 status:: 247 * Fortran 2008 status:: 248 * Fortran 2018 status:: 249 250 Fortran is developed by the Working Group 5 of Sub-Committee 22 of the 251 Joint Technical Committee 1 of the International Organization for 252 Standardization and the International Electrotechnical Commission (IEC). 253 This group is known as WG5 (http://www.nag.co.uk/sc22wg5/). Official 254 Fortran standard documents are available for purchase from ISO; a 255 collection of free documents (typically final drafts) are also available 256 on the wiki (https://gcc.gnu.org/wiki/GFortranStandards). 257 258 The GNU Fortran compiler implements ISO/IEC 1539:1997 (Fortran 95). 259 As such, it can also compile essentially all standard-compliant Fortran 260 90 and Fortran 77 programs. It also supports the ISO/IEC TR-15581 261 enhancements to allocatable arrays. 262 263 GNU Fortran also supports almost all of ISO/IEC 1539-1:2004 (Fortran 264 2003) and ISO/IEC 1539-1:2010 (Fortran 2008). It has partial support 265 for features introduced in ISO/IEC 1539:2018 (Fortran 2018), the most 266 recent version of the Fortran language standard, including full support 267 for the Technical Specification 'Further Interoperability of Fortran 268 with C' (ISO/IEC TS 29113:2012). More details on support for these 269 standards can be found in the following sections of the documentation. 270 271 Additionally, the GNU Fortran compilers supports the OpenMP 272 specification (version 4.5 and partial support of the features of the 273 5.0 version, <https://openmp.org/openmp-specifications/>). There also 274 is support for the OpenACC specification (targeting version 2.6, 275 <https://www.openacc.org/>). See <https://gcc.gnu.org/wiki/OpenACC> for 276 more information. 277 278 279 File: gfortran.info, Node: Fortran 95 status, Next: Fortran 2003 status, Up: Standards 280 281 1.3.1 Fortran 95 status 282 ----------------------- 283 284 The Fortran 95 standard specifies in Part 2 (ISO/IEC 1539-2:2000) 285 varying length character strings. While GNU Fortran currently does not 286 support such strings directly, there exist two Fortran implementations 287 for them, which work with GNU Fortran. They can be found at 288 <https://www.fortran.com/iso_varying_string.f95> and at 289 <ftp://ftp.nag.co.uk/sc22wg5/ISO_VARYING_STRING/>. 290 291 Deferred-length character strings of Fortran 2003 supports part of 292 the features of 'ISO_VARYING_STRING' and should be considered as 293 replacement. (Namely, allocatable or pointers of the type 294 'character(len=:)'.) 295 296 Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines 297 Conditional Compilation, which is not widely used and not directly 298 supported by the GNU Fortran compiler. You can use the program coco to 299 preprocess such files (<http://www.daniellnagle.com/coco.html>). 300 301 302 File: gfortran.info, Node: Fortran 2003 status, Next: Fortran 2008 status, Prev: Fortran 95 status, Up: Standards 303 304 1.3.2 Fortran 2003 status 305 ------------------------- 306 307 GNU Fortran implements the Fortran 2003 (ISO/IEC 1539-1:2004) standard 308 except for finalization support, which is incomplete. See the wiki page 309 (https://gcc.gnu.org/wiki/Fortran2003) for a full list of new features 310 introduced by Fortran 2003 and their implementation status. 311 312 313 File: gfortran.info, Node: Fortran 2008 status, Next: Fortran 2018 status, Prev: Fortran 2003 status, Up: Standards 314 315 1.3.3 Fortran 2008 status 316 ------------------------- 317 318 The GNU Fortran compiler supports almost all features of Fortran 2008; 319 the wiki (https://gcc.gnu.org/wiki/Fortran2008Status) has some 320 information about the current implementation status. In particular, the 321 following are not yet supported: 322 323 * 'DO CONCURRENT' and 'FORALL' do not recognize a type-spec in the 324 loop header. 325 326 * The change to permit any constant expression in subscripts and 327 nested implied-do limits in a 'DATA' statement has not been 328 implemented. 329 330 331 File: gfortran.info, Node: Fortran 2018 status, Prev: Fortran 2008 status, Up: Standards 332 333 1.3.4 Fortran 2018 status 334 ------------------------- 335 336 Fortran 2018 (ISO/IEC 1539:2018) is the most recent version of the 337 Fortran language standard. GNU Fortran implements some of the new 338 features of this standard: 339 340 * All Fortran 2018 features derived from ISO/IEC TS 29113:2012, 341 "Further Interoperability of Fortran with C", are supported by GNU 342 Fortran. This includes assumed-type and assumed-rank objects and 343 the 'SELECT RANK' construct as well as the parts relating to 344 'BIND(C)' functions. See also *note Further Interoperability of 345 Fortran with C::. 346 347 * GNU Fortran supports a subset of features derived from ISO/IEC TS 348 18508:2015, "Additional Parallel Features in Fortran": 349 350 * The new atomic ADD, CAS, FETCH and ADD/OR/XOR, OR and XOR 351 intrinsics. 352 353 * The 'CO_MIN' and 'CO_MAX' and 'SUM' reduction intrinsics, and 354 the 'CO_BROADCAST' and 'CO_REDUCE' intrinsic, except that 355 those do not support polymorphic types or types with 356 allocatable, pointer or polymorphic components. 357 358 * Events ('EVENT POST', 'EVENT WAIT', 'EVENT_QUERY'). 359 360 * Failed images ('FAIL IMAGE', 'IMAGE_STATUS', 'FAILED_IMAGES', 361 'STOPPED_IMAGES'). 362 363 * An 'ERROR STOP' statement is permitted in a 'PURE' procedure. 364 365 * GNU Fortran supports the 'IMPLICIT NONE' statement with an 366 'implicit-none-spec-list'. 367 368 * The behavior of the 'INQUIRE' statement with the 'RECL=' specifier 369 now conforms to Fortran 2018. 370 371 372 File: gfortran.info, Node: Invoking GNU Fortran, Next: Runtime, Prev: Introduction, Up: Top 373 374 2 GNU Fortran Command Options 375 ***************************** 376 377 The 'gfortran' command supports all the options supported by the 'gcc' 378 command. Only options specific to GNU Fortran are documented here. 379 380 *Note GCC Command Options: (gcc)Invoking GCC, for information on the 381 non-Fortran-specific aspects of the 'gcc' command (and, therefore, the 382 'gfortran' command). 383 384 All GCC and GNU Fortran options are accepted both by 'gfortran' and 385 by 'gcc' (as well as any other drivers built at the same time, such as 386 'g++'), since adding GNU Fortran to the GCC distribution enables 387 acceptance of GNU Fortran options by all of the relevant drivers. 388 389 In some cases, options have positive and negative forms; the negative 390 form of '-ffoo' would be '-fno-foo'. This manual documents only one of 391 these two forms, whichever one is not the default. 392 393 * Menu: 394 395 * Option Summary:: Brief list of all 'gfortran' options, 396 without explanations. 397 * Fortran Dialect Options:: Controlling the variant of Fortran language 398 compiled. 399 * Preprocessing Options:: Enable and customize preprocessing. 400 * Error and Warning Options:: How picky should the compiler be? 401 * Debugging Options:: Symbol tables, measurements, and debugging dumps. 402 * Directory Options:: Where to find module files 403 * Link Options :: Influencing the linking step 404 * Runtime Options:: Influencing runtime behavior 405 * Code Gen Options:: Specifying conventions for function calls, data layout 406 and register usage. 407 * Interoperability Options:: Options for interoperability with other 408 languages. 409 * Environment Variables:: Environment variables that affect 'gfortran'. 410 411 412 File: gfortran.info, Node: Option Summary, Next: Fortran Dialect Options, Up: Invoking GNU Fortran 413 414 2.1 Option summary 415 ================== 416 417 Here is a summary of all the options specific to GNU Fortran, grouped by 418 type. Explanations are in the following sections. 419 420 _Fortran Language Options_ 421 *Note Options controlling Fortran dialect: Fortran Dialect Options. 422 -fall-intrinsics -fallow-argument-mismatch -fallow-invalid-boz 423 -fbackslash -fcray-pointer -fd-lines-as-code -fd-lines-as-comments 424 -fdec -fdec-char-conversions -fdec-structure -fdec-intrinsic-ints 425 -fdec-static -fdec-math -fdec-include -fdec-format-defaults 426 -fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8 427 -fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok 428 -ffixed-line-length-N -ffixed-line-length-none -fpad-source 429 -ffree-form -ffree-line-length-N -ffree-line-length-none 430 -fimplicit-none -finteger-4-integer-8 -fmax-identifier-length 431 -fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp 432 -freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10 433 -freal-8-real-16 -freal-8-real-4 -std=STD -ftest-forall-temp 434 435 436 _Preprocessing Options_ 437 *Note Enable and customize preprocessing: Preprocessing Options. 438 -A-QUESTION[=ANSWER] 439 -AQUESTION=ANSWER -C -CC -DMACRO[=DEFN] 440 -H -P 441 -UMACRO -cpp -dD -dI -dM -dN -dU -fworking-directory 442 -imultilib DIR 443 -iprefix FILE -iquote -isysroot DIR -isystem DIR -nocpp 444 -nostdinc 445 -undef 446 447 448 _Error and Warning Options_ 449 *Note Options to request or suppress errors and warnings: Error and 450 Warning Options. 451 -Waliasing -Wall -Wampersand -Warray-bounds 452 -Wc-binding-type -Wcharacter-truncation -Wconversion 453 -Wdo-subscript -Wfunction-elimination -Wimplicit-interface 454 -Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only 455 -Wintrinsics-std -Wline-truncation -Wno-align-commons 456 -Wno-overwrite-recursive -Wno-tabs -Wreal-q-constant -Wsurprising 457 -Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all 458 -Wfrontend-loop-interchange -Wtarget-lifetime -fmax-errors=N 459 -fsyntax-only -pedantic 460 -pedantic-errors 461 462 463 _Debugging Options_ 464 *Note Options for debugging your program or GNU Fortran: Debugging 465 Options. 466 -fbacktrace -fdump-fortran-optimized -fdump-fortran-original 467 -fdebug-aux-vars -fdump-fortran-global -fdump-parse-tree -ffpe-trap=LIST 468 -ffpe-summary=LIST 469 470 471 _Directory Options_ 472 *Note Options for directory search: Directory Options. 473 -IDIR -JDIR -fintrinsic-modules-path DIR 474 475 _Link Options_ 476 *Note Options for influencing the linking step: Link Options. 477 -static-libgfortran 478 479 _Runtime Options_ 480 *Note Options for influencing runtime behavior: Runtime Options. 481 -fconvert=CONVERSION -fmax-subrecord-length=LENGTH 482 -frecord-marker=LENGTH -fsign-zero 483 484 485 _Interoperability Options_ 486 *Note Options for interoperability: Interoperability Options. 487 -fc-prototypes -fc-prototypes-external 488 489 _Code Generation Options_ 490 *Note Options for code generation conventions: Code Gen Options. 491 -faggressive-function-elimination -fblas-matmul-limit=N 492 -fbounds-check -ftail-call-workaround -ftail-call-workaround=N 493 -fcheck-array-temporaries 494 -fcheck=<ALL|ARRAY-TEMPS|BITS|BOUNDS|DO|MEM|POINTER|RECURSION> 495 -fcoarray=<NONE|SINGLE|LIB> -fexternal-blas -ff2c 496 -ffrontend-loop-interchange -ffrontend-optimize 497 -finit-character=N -finit-integer=N -finit-local-zero 498 -finit-derived -finit-logical=<TRUE|FALSE> 499 -finit-real=<ZERO|INF|-INF|NAN|SNAN> 500 -finline-matmul-limit=N 501 -finline-arg-packing -fmax-array-constructor=N 502 -fmax-stack-var-size=N -fno-align-commons -fno-automatic 503 -fno-protect-parens -fno-underscoring -fsecond-underscore 504 -fpack-derived -frealloc-lhs -frecursive -frepack-arrays 505 -fshort-enums -fstack-arrays 506 507 508 509 File: gfortran.info, Node: Fortran Dialect Options, Next: Preprocessing Options, Prev: Option Summary, Up: Invoking GNU Fortran 510 511 2.2 Options controlling Fortran dialect 512 ======================================= 513 514 The following options control the details of the Fortran dialect 515 accepted by the compiler: 516 517 '-ffree-form' 518 '-ffixed-form' 519 Specify the layout used by the source file. The free form layout 520 was introduced in Fortran 90. Fixed form was traditionally used in 521 older Fortran programs. When neither option is specified, the 522 source form is determined by the file extension. 523 524 '-fall-intrinsics' 525 This option causes all intrinsic procedures (including the 526 GNU-specific extensions) to be accepted. This can be useful with 527 '-std=' to force standard-compliance but get access to the full 528 range of intrinsics available with 'gfortran'. As a consequence, 529 '-Wintrinsics-std' will be ignored and no user-defined procedure 530 with the same name as any intrinsic will be called except when it 531 is explicitly declared 'EXTERNAL'. 532 533 '-fallow-argument-mismatch' 534 Some code contains calls to external procedures with mismatches 535 between the calls and the procedure definition, or with mismatches 536 between different calls. Such code is non-conforming, and will 537 usually be flagged with an error. This options degrades the error 538 to a warning, which can only be disabled by disabling all warnings 539 via '-w'. Only a single occurrence per argument is flagged by this 540 warning. '-fallow-argument-mismatch' is implied by '-std=legacy'. 541 542 Using this option is _strongly_ discouraged. It is possible to 543 provide standard-conforming code which allows different types of 544 arguments by using an explicit interface and 'TYPE(*)'. 545 546 '-fallow-invalid-boz' 547 A BOZ literal constant can occur in a limited number of contexts in 548 standard conforming Fortran. This option degrades an error 549 condition to a warning, and allows a BOZ literal constant to appear 550 where the Fortran standard would otherwise prohibit its use. 551 552 '-fd-lines-as-code' 553 '-fd-lines-as-comments' 554 Enable special treatment for lines beginning with 'd' or 'D' in 555 fixed form sources. If the '-fd-lines-as-code' option is given 556 they are treated as if the first column contained a blank. If the 557 '-fd-lines-as-comments' option is given, they are treated as 558 comment lines. 559 560 '-fdec' 561 DEC compatibility mode. Enables extensions and other features that 562 mimic the default behavior of older compilers (such as DEC). These 563 features are non-standard and should be avoided at all costs. For 564 details on GNU Fortran's implementation of these extensions see the 565 full documentation. 566 567 Other flags enabled by this switch are: '-fdollar-ok' 568 '-fcray-pointer' '-fdec-char-conversions' '-fdec-structure' 569 '-fdec-intrinsic-ints' '-fdec-static' '-fdec-math' '-fdec-include' 570 '-fdec-blank-format-item' '-fdec-format-defaults' 571 572 If '-fd-lines-as-code'/'-fd-lines-as-comments' are unset, then 573 '-fdec' also sets '-fd-lines-as-comments'. 574 575 '-fdec-char-conversions' 576 Enable the use of character literals in assignments and 'DATA' 577 statements for non-character variables. 578 579 '-fdec-structure' 580 Enable DEC 'STRUCTURE' and 'RECORD' as well as 'UNION', 'MAP', and 581 dot ('.') as a member separator (in addition to '%'). This is 582 provided for compatibility only; Fortran 90 derived types should be 583 used instead where possible. 584 585 '-fdec-intrinsic-ints' 586 Enable B/I/J/K kind variants of existing integer functions (e.g. 587 BIAND, IIAND, JIAND, etc...). For a complete list of intrinsics 588 see the full documentation. 589 590 '-fdec-math' 591 Enable legacy math intrinsics such as COTAN and degree-valued 592 trigonometric functions (e.g. TAND, ATAND, etc...) for 593 compatability with older code. 594 595 '-fdec-static' 596 Enable DEC-style STATIC and AUTOMATIC attributes to explicitly 597 specify the storage of variables and other objects. 598 599 '-fdec-include' 600 Enable parsing of INCLUDE as a statement in addition to parsing it 601 as INCLUDE line. When parsed as INCLUDE statement, INCLUDE does 602 not have to be on a single line and can use line continuations. 603 604 '-fdec-format-defaults' 605 Enable format specifiers F, G and I to be used without width 606 specifiers, default widths will be used instead. 607 608 '-fdec-blank-format-item' 609 Enable a blank format item at the end of a format specification 610 i.e. nothing following the final comma. 611 612 '-fdollar-ok' 613 Allow '$' as a valid non-first character in a symbol name. Symbols 614 that start with '$' are rejected since it is unclear which rules to 615 apply to implicit typing as different vendors implement different 616 rules. Using '$' in 'IMPLICIT' statements is also rejected. 617 618 '-fbackslash' 619 Change the interpretation of backslashes in string literals from a 620 single backslash character to "C-style" escape characters. The 621 following combinations are expanded '\a', '\b', '\f', '\n', '\r', 622 '\t', '\v', '\\', and '\0' to the ASCII characters alert, 623 backspace, form feed, newline, carriage return, horizontal tab, 624 vertical tab, backslash, and NUL, respectively. Additionally, 625 '\x'NN, '\u'NNNN and '\U'NNNNNNNN (where each N is a hexadecimal 626 digit) are translated into the Unicode characters corresponding to 627 the specified code points. All other combinations of a character 628 preceded by \ are unexpanded. 629 630 '-fmodule-private' 631 Set the default accessibility of module entities to 'PRIVATE'. 632 Use-associated entities will not be accessible unless they are 633 explicitly declared as 'PUBLIC'. 634 635 '-ffixed-line-length-N' 636 Set column after which characters are ignored in typical fixed-form 637 lines in the source file, and, unless '-fno-pad-source', through 638 which spaces are assumed (as if padded to that length) after the 639 ends of short fixed-form lines. 640 641 Popular values for N include 72 (the standard and the default), 80 642 (card image), and 132 (corresponding to "extended-source" options 643 in some popular compilers). N may also be 'none', meaning that the 644 entire line is meaningful and that continued character constants 645 never have implicit spaces appended to them to fill out the line. 646 '-ffixed-line-length-0' means the same thing as 647 '-ffixed-line-length-none'. 648 649 '-fno-pad-source' 650 By default fixed-form lines have spaces assumed (as if padded to 651 that length) after the ends of short fixed-form lines. This is not 652 done either if '-ffixed-line-length-0', '-ffixed-line-length-none' 653 or if '-fno-pad-source' option is used. With any of those options 654 continued character constants never have implicit spaces appended 655 to them to fill out the line. 656 657 '-ffree-line-length-N' 658 Set column after which characters are ignored in typical free-form 659 lines in the source file. The default value is 132. N may be 660 'none', meaning that the entire line is meaningful. 661 '-ffree-line-length-0' means the same thing as 662 '-ffree-line-length-none'. 663 664 '-fmax-identifier-length=N' 665 Specify the maximum allowed identifier length. Typical values are 666 31 (Fortran 95) and 63 (Fortran 2003 and later). 667 668 '-fimplicit-none' 669 Specify that no implicit typing is allowed, unless overridden by 670 explicit 'IMPLICIT' statements. This is the equivalent of adding 671 'implicit none' to the start of every procedure. 672 673 '-fcray-pointer' 674 Enable the Cray pointer extension, which provides C-like pointer 675 functionality. 676 677 '-fopenacc' 678 Enable the OpenACC extensions. This includes OpenACC '!$acc' 679 directives in free form and 'c$acc', '*$acc' and '!$acc' directives 680 in fixed form, '!$' conditional compilation sentinels in free form 681 and 'c$', '*$' and '!$' sentinels in fixed form, and when linking 682 arranges for the OpenACC runtime library to be linked in. 683 684 '-fopenmp' 685 Enable the OpenMP extensions. This includes OpenMP '!$omp' 686 directives in free form and 'c$omp', '*$omp' and '!$omp' directives 687 in fixed form, '!$' conditional compilation sentinels in free form 688 and 'c$', '*$' and '!$' sentinels in fixed form, and when linking 689 arranges for the OpenMP runtime library to be linked in. The 690 option '-fopenmp' implies '-frecursive'. 691 692 '-fno-range-check' 693 Disable range checking on results of simplification of constant 694 expressions during compilation. For example, GNU Fortran will give 695 an error at compile time when simplifying 'a = 1. / 0'. With this 696 option, no error will be given and 'a' will be assigned the value 697 '+Infinity'. If an expression evaluates to a value outside of the 698 relevant range of ['-HUGE()':'HUGE()'], then the expression will be 699 replaced by '-Inf' or '+Inf' as appropriate. Similarly, 'DATA 700 i/Z'FFFFFFFF'/' will result in an integer overflow on most systems, 701 but with '-fno-range-check' the value will "wrap around" and 'i' 702 will be initialized to -1 instead. 703 704 '-fdefault-integer-8' 705 Set the default integer and logical types to an 8 byte wide type. 706 This option also affects the kind of integer constants like '42'. 707 Unlike '-finteger-4-integer-8', it does not promote variables with 708 explicit kind declaration. 709 710 '-fdefault-real-8' 711 Set the default real type to an 8 byte wide type. This option also 712 affects the kind of non-double real constants like '1.0'. This 713 option promotes the default width of 'DOUBLE PRECISION' and double 714 real constants like '1.d0' to 16 bytes if possible. If 715 '-fdefault-double-8' is given along with 'fdefault-real-8', 'DOUBLE 716 PRECISION' and double real constants are not promoted. Unlike 717 '-freal-4-real-8', 'fdefault-real-8' does not promote variables 718 with explicit kind declarations. 719 720 '-fdefault-real-10' 721 Set the default real type to an 10 byte wide type. This option 722 also affects the kind of non-double real constants like '1.0'. 723 This option promotes the default width of 'DOUBLE PRECISION' and 724 double real constants like '1.d0' to 16 bytes if possible. If 725 '-fdefault-double-8' is given along with 'fdefault-real-10', 726 'DOUBLE PRECISION' and double real constants are not promoted. 727 Unlike '-freal-4-real-10', 'fdefault-real-10' does not promote 728 variables with explicit kind declarations. 729 730 '-fdefault-real-16' 731 Set the default real type to an 16 byte wide type. This option 732 also affects the kind of non-double real constants like '1.0'. 733 This option promotes the default width of 'DOUBLE PRECISION' and 734 double real constants like '1.d0' to 16 bytes if possible. If 735 '-fdefault-double-8' is given along with 'fdefault-real-16', 736 'DOUBLE PRECISION' and double real constants are not promoted. 737 Unlike '-freal-4-real-16', 'fdefault-real-16' does not promote 738 variables with explicit kind declarations. 739 740 '-fdefault-double-8' 741 Set the 'DOUBLE PRECISION' type and double real constants like 742 '1.d0' to an 8 byte wide type. Do nothing if this is already the 743 default. This option prevents '-fdefault-real-8', 744 '-fdefault-real-10', and '-fdefault-real-16', from promoting 745 'DOUBLE PRECISION' and double real constants like '1.d0' to 16 746 bytes. 747 748 '-finteger-4-integer-8' 749 Promote all 'INTEGER(KIND=4)' entities to an 'INTEGER(KIND=8)' 750 entities. If 'KIND=8' is unavailable, then an error will be 751 issued. This option should be used with care and may not be 752 suitable for your codes. Areas of possible concern include calls 753 to external procedures, alignment in 'EQUIVALENCE' and/or 'COMMON', 754 generic interfaces, BOZ literal constant conversion, and I/O. 755 Inspection of the intermediate representation of the translated 756 Fortran code, produced by '-fdump-tree-original', is suggested. 757 758 '-freal-4-real-8' 759 '-freal-4-real-10' 760 '-freal-4-real-16' 761 '-freal-8-real-4' 762 '-freal-8-real-10' 763 '-freal-8-real-16' 764 Promote all 'REAL(KIND=M)' entities to 'REAL(KIND=N)' entities. If 765 'REAL(KIND=N)' is unavailable, then an error will be issued. The 766 '-freal-4-' flags also affect the default real kind and the 767 '-freal-8-' flags also the double-precision real kind. All other 768 real-kind types are unaffected by this option. The promotion is 769 also applied to real literal constants of default and 770 double-precision kind and a specified kind number of 4 or 8, 771 respectively. However, '-fdefault-real-8', '-fdefault-real-10', 772 '-fdefault-real-10', and '-fdefault-double-8' take precedence for 773 the default and double-precision real kinds, both for real literal 774 constants and for declarations without a kind number. Note that 775 for 'REAL(KIND=KIND(1.0))' the literal may get promoted and then 776 the result may get promoted again. These options should be used 777 with care and may not be suitable for your codes. Areas of 778 possible concern include calls to external procedures, alignment in 779 'EQUIVALENCE' and/or 'COMMON', generic interfaces, BOZ literal 780 constant conversion, and I/O and calls to intrinsic procedures when 781 passing a value to the 'kind=' dummy argument. Inspection of the 782 intermediate representation of the translated Fortran code, 783 produced by '-fdump-fortran-original' or '-fdump-tree-original', is 784 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 810 File: gfortran.info, Node: Preprocessing Options, Next: Error and Warning Options, Prev: Fortran Dialect Options, Up: Invoking GNU Fortran 811 812 2.3 Enable and customize preprocessing 813 ====================================== 814 815 Many Fortran compilers including GNU Fortran allow passing the source 816 code through a C preprocessor (CPP; sometimes also called the Fortran 817 preprocessor, FPP) to allow for conditional compilation. In the case of 818 GNU Fortran, this is the GNU C Preprocessor in the traditional mode. On 819 systems with case-preserving file names, the preprocessor is 820 automatically invoked if the filename extension is '.F', '.FOR', '.FTN', 821 '.fpp', '.FPP', '.F90', '.F95', '.F03' or '.F08'. To manually invoke 822 the preprocessor on any file, use '-cpp', to disable preprocessing on 823 files where the preprocessor is run automatically, use '-nocpp'. 824 825 If a preprocessed file includes another file with the Fortran 826 'INCLUDE' statement, the included file is not preprocessed. To 827 preprocess included files, use the equivalent preprocessor statement 828 '#include'. 829 830 If GNU Fortran invokes the preprocessor, '__GFORTRAN__' is defined. 831 The macros '__GNUC__', '__GNUC_MINOR__' and '__GNUC_PATCHLEVEL__' can be 832 used to determine the version of the compiler. See *note Overview: 833 (cpp)Top. for details. 834 835 GNU Fortran supports a number of 'INTEGER' and 'REAL' kind types in 836 additional to the kind types required by the Fortran standard. The 837 availability of any given kind type is architecture dependent. The 838 following pre-defined preprocessor macros can be used to conditionally 839 include code for these additional kind types: '__GFC_INT_1__', 840 '__GFC_INT_2__', '__GFC_INT_8__', '__GFC_INT_16__', '__GFC_REAL_10__', 841 and '__GFC_REAL_16__'. 842 843 While CPP is the de-facto standard for preprocessing Fortran code, 844 Part 3 of the Fortran 95 standard (ISO/IEC 1539-3:1998) defines 845 Conditional Compilation, which is not widely used and not directly 846 supported by the GNU Fortran compiler. You can use the program coco to 847 preprocess such files (<http://www.daniellnagle.com/coco.html>). 848 849 The following options control preprocessing of Fortran code: 850 851 '-cpp' 852 '-nocpp' 853 Enable preprocessing. The preprocessor is automatically invoked if 854 the file extension is '.fpp', '.FPP', '.F', '.FOR', '.FTN', '.F90', 855 '.F95', '.F03' or '.F08'. Use this option to manually enable 856 preprocessing of any kind of Fortran file. 857 858 To disable preprocessing of files with any of the above listed 859 extensions, use the negative form: '-nocpp'. 860 861 The preprocessor is run in traditional mode. Any restrictions of 862 the file-format, especially the limits on line length, apply for 863 preprocessed output as well, so it might be advisable to use the 864 '-ffree-line-length-none' or '-ffixed-line-length-none' options. 865 866 '-dM' 867 Instead of the normal output, generate a list of ''#define'' 868 directives for all the macros defined during the execution of the 869 preprocessor, including predefined macros. This gives you a way of 870 finding out what is predefined in your version of the preprocessor. 871 Assuming you have no file 'foo.f90', the command 872 touch foo.f90; gfortran -cpp -E -dM foo.f90 873 will show all the predefined macros. 874 875 '-dD' 876 Like '-dM' except in two respects: it does not include the 877 predefined macros, and it outputs both the '#define' directives and 878 the result of preprocessing. Both kinds of output go to the 879 standard output file. 880 881 '-dN' 882 Like '-dD', but emit only the macro names, not their expansions. 883 884 '-dU' 885 Like 'dD' except that only macros that are expanded, or whose 886 definedness is tested in preprocessor directives, are output; the 887 output is delayed until the use or test of the macro; and 888 ''#undef'' directives are also output for macros tested but 889 undefined at the time. 890 891 '-dI' 892 Output ''#include'' directives in addition to the result of 893 preprocessing. 894 895 '-fworking-directory' 896 Enable generation of linemarkers in the preprocessor output that 897 will let the compiler know the current working directory at the 898 time of preprocessing. When this option is enabled, the 899 preprocessor will emit, after the initial linemarker, a second 900 linemarker with the current working directory followed by two 901 slashes. GCC will use this directory, when it is present in the 902 preprocessed input, as the directory emitted as the current working 903 directory in some debugging information formats. This option is 904 implicitly enabled if debugging information is enabled, but this 905 can be inhibited with the negated form '-fno-working-directory'. 906 If the '-P' flag is present in the command line, this option has no 907 effect, since no '#line' directives are emitted whatsoever. 908 909 '-idirafter DIR' 910 Search DIR for include files, but do it after all directories 911 specified with '-I' and the standard system directories have been 912 exhausted. DIR is treated as a system include directory. If dir 913 begins with '=', then the '=' will be replaced by the sysroot 914 prefix; see '--sysroot' and '-isysroot'. 915 916 '-imultilib DIR' 917 Use DIR as a subdirectory of the directory containing 918 target-specific C++ headers. 919 920 '-iprefix PREFIX' 921 Specify PREFIX as the prefix for subsequent '-iwithprefix' options. 922 If the PREFIX represents a directory, you should include the final 923 ''/''. 924 925 '-isysroot DIR' 926 This option is like the '--sysroot' option, but applies only to 927 header files. See the '--sysroot' option for more information. 928 929 '-iquote DIR' 930 Search DIR only for header files requested with '#include "file"'; 931 they are not searched for '#include <file>', before all directories 932 specified by '-I' and before the standard system directories. If 933 DIR begins with '=', then the '=' will be replaced by the sysroot 934 prefix; see '--sysroot' and '-isysroot'. 935 936 '-isystem DIR' 937 Search DIR for header files, after all directories specified by 938 '-I' but before the standard system directories. Mark it as a 939 system directory, so that it gets the same special treatment as is 940 applied to the standard system directories. If DIR begins with 941 '=', then the '=' will be replaced by the sysroot prefix; see 942 '--sysroot' and '-isysroot'. 943 944 '-nostdinc' 945 Do not search the standard system directories for header files. 946 Only the directories you have specified with '-I' options (and the 947 directory of the current file, if appropriate) are searched. 948 949 '-undef' 950 Do not predefine any system-specific or GCC-specific macros. The 951 standard predefined macros remain defined. 952 953 '-APREDICATE=ANSWER' 954 Make an assertion with the predicate PREDICATE and answer ANSWER. 955 This form is preferred to the older form -A predicate(answer), 956 which is still supported, because it does not use shell special 957 characters. 958 959 '-A-PREDICATE=ANSWER' 960 Cancel an assertion with the predicate PREDICATE and answer ANSWER. 961 962 '-C' 963 Do not discard comments. All comments are passed through to the 964 output file, except for comments in processed directives, which are 965 deleted along with the directive. 966 967 You should be prepared for side effects when using '-C'; it causes 968 the preprocessor to treat comments as tokens in their own right. 969 For example, comments appearing at the start of what would be a 970 directive line have the effect of turning that line into an 971 ordinary source line, since the first token on the line is no 972 longer a ''#''. 973 974 Warning: this currently handles C-Style comments only. The 975 preprocessor does not yet recognize Fortran-style comments. 976 977 '-CC' 978 Do not discard comments, including during macro expansion. This is 979 like '-C', except that comments contained within macros are also 980 passed through to the output file where the macro is expanded. 981 982 In addition to the side-effects of the '-C' option, the '-CC' 983 option causes all C++-style comments inside a macro to be converted 984 to C-style comments. This is to prevent later use of that macro 985 from inadvertently commenting out the remainder of the source line. 986 The '-CC' option is generally used to support lint comments. 987 988 Warning: this currently handles C- and C++-Style comments only. 989 The preprocessor does not yet recognize Fortran-style comments. 990 991 '-DNAME' 992 Predefine name as a macro, with definition '1'. 993 994 '-DNAME=DEFINITION' 995 The contents of DEFINITION are tokenized and processed as if they 996 appeared during translation phase three in a ''#define'' directive. 997 In particular, the definition will be truncated by embedded newline 998 characters. 999 1000 If you are invoking the preprocessor from a shell or shell-like 1001 program you may need to use the shell's quoting syntax to protect 1002 characters such as spaces that have a meaning in the shell syntax. 1003 1004 If you wish to define a function-like macro on the command line, 1005 write its argument list with surrounding parentheses before the 1006 equals sign (if any). Parentheses are meaningful to most shells, 1007 so you will need to quote the option. With sh and csh, 1008 '-D'name(args...)=definition'' works. 1009 1010 '-D' and '-U' options are processed in the order they are given on 1011 the command line. All -imacros file and -include file options are 1012 processed after all -D and -U options. 1013 1014 '-H' 1015 Print the name of each header file used, in addition to other 1016 normal activities. Each name is indented to show how deep in the 1017 ''#include'' stack it is. 1018 1019 '-P' 1020 Inhibit generation of linemarkers in the output from the 1021 preprocessor. This might be useful when running the preprocessor 1022 on something that is not C code, and will be sent to a program 1023 which might be confused by the linemarkers. 1024 1025 '-UNAME' 1026 Cancel any previous definition of NAME, either built in or provided 1027 with a '-D' option. 1028 1029 1030 File: gfortran.info, Node: Error and Warning Options, Next: Debugging Options, Prev: Preprocessing Options, Up: Invoking GNU Fortran 1031 1032 2.4 Options to request or suppress errors and warnings 1033 ====================================================== 1034 1035 Errors are diagnostic messages that report that the GNU Fortran compiler 1036 cannot compile the relevant piece of source code. The compiler will 1037 continue to process the program in an attempt to report further errors 1038 to aid in debugging, but will not produce any compiled output. 1039 1040 Warnings are diagnostic messages that report constructions which are 1041 not inherently erroneous but which are risky or suggest there is likely 1042 to be a bug in the program. Unless '-Werror' is specified, they do not 1043 prevent compilation of the program. 1044 1045 You can request many specific warnings with options beginning '-W', 1046 for example '-Wimplicit' to request warnings on implicit declarations. 1047 Each of these specific warning options also has a negative form 1048 beginning '-Wno-' to turn off warnings; for example, '-Wno-implicit'. 1049 This manual lists only one of the two forms, whichever is not the 1050 default. 1051 1052 These options control the amount and kinds of errors and warnings 1053 produced by GNU Fortran: 1054 1055 '-fmax-errors=N' 1056 Limits the maximum number of error messages to N, at which point 1057 GNU Fortran bails out rather than attempting to continue processing 1058 the source code. If N is 0, there is no limit on the number of 1059 error messages produced. 1060 1061 '-fsyntax-only' 1062 Check the code for syntax errors, but do not actually compile it. 1063 This will generate module files for each module present in the 1064 code, but no other output file. 1065 1066 '-Wpedantic' 1067 '-pedantic' 1068 Issue warnings for uses of extensions to Fortran. '-pedantic' also 1069 applies to C-language constructs where they occur in GNU Fortran 1070 source files, such as use of '\e' in a character constant within a 1071 directive like '#include'. 1072 1073 Valid Fortran programs should compile properly with or without this 1074 option. However, without this option, certain GNU extensions and 1075 traditional Fortran features are supported as well. With this 1076 option, many of them are rejected. 1077 1078 Some users try to use '-pedantic' to check programs for 1079 conformance. They soon find that it does not do quite what they 1080 want--it finds some nonstandard practices, but not all. However, 1081 improvements to GNU Fortran in this area are welcome. 1082 1083 This should be used in conjunction with '-std=f95', '-std=f2003', 1084 '-std=f2008' or '-std=f2018'. 1085 1086 '-pedantic-errors' 1087 Like '-pedantic', except that errors are produced rather than 1088 warnings. 1089 1090 '-Wall' 1091 Enables commonly used warning options pertaining to usage that we 1092 recommend avoiding and that we believe are easy to avoid. This 1093 currently includes '-Waliasing', '-Wampersand', '-Wconversion', 1094 '-Wsurprising', '-Wc-binding-type', '-Wintrinsics-std', '-Wtabs', 1095 '-Wintrinsic-shadow', '-Wline-truncation', '-Wtarget-lifetime', 1096 '-Winteger-division', '-Wreal-q-constant', '-Wunused' and 1097 '-Wundefined-do-loop'. 1098 1099 '-Waliasing' 1100 Warn about possible aliasing of dummy arguments. Specifically, it 1101 warns if the same actual argument is associated with a dummy 1102 argument with 'INTENT(IN)' and a dummy argument with 'INTENT(OUT)' 1103 in a call with an explicit interface. 1104 1105 The following example will trigger the warning. 1106 interface 1107 subroutine bar(a,b) 1108 integer, intent(in) :: a 1109 integer, intent(out) :: b 1110 end subroutine 1111 end interface 1112 integer :: a 1113 1114 call bar(a,a) 1115 1116 '-Wampersand' 1117 Warn about missing ampersand in continued character constants. The 1118 warning is given with '-Wampersand', '-pedantic', '-std=f95', 1119 '-std=f2003', '-std=f2008' and '-std=f2018'. Note: With no 1120 ampersand given in a continued character constant, GNU Fortran 1121 assumes continuation at the first non-comment, non-whitespace 1122 character after the ampersand that initiated the continuation. 1123 1124 '-Warray-temporaries' 1125 Warn about array temporaries generated by the compiler. The 1126 information generated by this warning is sometimes useful in 1127 optimization, in order to avoid such temporaries. 1128 1129 '-Wc-binding-type' 1130 Warn if the a variable might not be C interoperable. In 1131 particular, warn if the variable has been declared using an 1132 intrinsic type with default kind instead of using a kind parameter 1133 defined for C interoperability in the intrinsic 'ISO_C_Binding' 1134 module. This option is implied by '-Wall'. 1135 1136 '-Wcharacter-truncation' 1137 Warn when a character assignment will truncate the assigned string. 1138 1139 '-Wline-truncation' 1140 Warn when a source code line will be truncated. This option is 1141 implied by '-Wall'. For free-form source code, the default is 1142 '-Werror=line-truncation' such that truncations are reported as 1143 error. 1144 1145 '-Wconversion' 1146 Warn about implicit conversions that are likely to change the value 1147 of the expression after conversion. Implied by '-Wall'. 1148 1149 '-Wconversion-extra' 1150 Warn about implicit conversions between different types and kinds. 1151 This option does _not_ imply '-Wconversion'. 1152 1153 '-Wextra' 1154 Enables some warning options for usages of language features which 1155 may be problematic. This currently includes '-Wcompare-reals', 1156 '-Wunused-parameter' and '-Wdo-subscript'. 1157 1158 '-Wfrontend-loop-interchange' 1159 Warn when using '-ffrontend-loop-interchange' for performing loop 1160 interchanges. 1161 1162 '-Wimplicit-interface' 1163 Warn if a procedure is called without an explicit interface. Note 1164 this only checks that an explicit interface is present. It does 1165 not check that the declared interfaces are consistent across 1166 program units. 1167 1168 '-Wimplicit-procedure' 1169 Warn if a procedure is called that has neither an explicit 1170 interface nor has been declared as 'EXTERNAL'. 1171 1172 '-Winteger-division' 1173 Warn if a constant integer division truncates its result. As an 1174 example, 3/5 evaluates to 0. 1175 1176 '-Wintrinsics-std' 1177 Warn if 'gfortran' finds a procedure named like an intrinsic not 1178 available in the currently selected standard (with '-std') and 1179 treats it as 'EXTERNAL' procedure because of this. 1180 '-fall-intrinsics' can be used to never trigger this behavior and 1181 always link to the intrinsic regardless of the selected standard. 1182 1183 '-Wno-overwrite-recursive' 1184 Do not warn when '-fno-automatic' is used with '-frecursive'. 1185 Recursion will be broken if the relevant local variables do not 1186 have the attribute 'AUTOMATIC' explicitly declared. This option 1187 can be used to suppress the warning when it is known that recursion 1188 is not broken. Useful for build environments that use '-Werror'. 1189 1190 '-Wreal-q-constant' 1191 Produce a warning if a real-literal-constant contains a 'q' 1192 exponent-letter. 1193 1194 '-Wsurprising' 1195 Produce a warning when "suspicious" code constructs are 1196 encountered. While technically legal these usually indicate that 1197 an error has been made. 1198 1199 This currently produces a warning under the following 1200 circumstances: 1201 1202 * An INTEGER SELECT construct has a CASE that can never be 1203 matched as its lower value is greater than its upper value. 1204 1205 * A LOGICAL SELECT construct has three CASE statements. 1206 1207 * A TRANSFER specifies a source that is shorter than the 1208 destination. 1209 1210 * The type of a function result is declared more than once with 1211 the same type. If '-pedantic' or standard-conforming mode is 1212 enabled, this is an error. 1213 1214 * A 'CHARACTER' variable is declared with negative length. 1215 1216 '-Wtabs' 1217 By default, tabs are accepted as whitespace, but tabs are not 1218 members of the Fortran Character Set. For continuation lines, a 1219 tab followed by a digit between 1 and 9 is supported. '-Wtabs' 1220 will cause a warning to be issued if a tab is encountered. Note, 1221 '-Wtabs' is active for '-pedantic', '-std=f95', '-std=f2003', 1222 '-std=f2008', '-std=f2018' and '-Wall'. 1223 1224 '-Wundefined-do-loop' 1225 Warn if a DO loop with step either 1 or -1 yields an underflow or 1226 an overflow during iteration of an induction variable of the loop. 1227 This option is implied by '-Wall'. 1228 1229 '-Wunderflow' 1230 Produce a warning when numerical constant expressions are 1231 encountered, which yield an UNDERFLOW during compilation. Enabled 1232 by default. 1233 1234 '-Wintrinsic-shadow' 1235 Warn if a user-defined procedure or module procedure has the same 1236 name as an intrinsic; in this case, an explicit interface or 1237 'EXTERNAL' or 'INTRINSIC' declaration might be needed to get calls 1238 later resolved to the desired intrinsic/procedure. This option is 1239 implied by '-Wall'. 1240 1241 '-Wuse-without-only' 1242 Warn if a 'USE' statement has no 'ONLY' qualifier and thus 1243 implicitly imports all public entities of the used module. 1244 1245 '-Wunused-dummy-argument' 1246 Warn about unused dummy arguments. This option is implied by 1247 '-Wall'. 1248 1249 '-Wunused-parameter' 1250 Contrary to 'gcc''s meaning of '-Wunused-parameter', 'gfortran''s 1251 implementation of this option does not warn about unused dummy 1252 arguments (see '-Wunused-dummy-argument'), but about unused 1253 'PARAMETER' values. '-Wunused-parameter' is implied by '-Wextra' 1254 if also '-Wunused' or '-Wall' is used. 1255 1256 '-Walign-commons' 1257 By default, 'gfortran' warns about any occasion of variables being 1258 padded for proper alignment inside a 'COMMON' block. This warning 1259 can be turned off via '-Wno-align-commons'. See also 1260 '-falign-commons'. 1261 1262 '-Wfunction-elimination' 1263 Warn if any calls to impure functions are eliminated by the 1264 optimizations enabled by the '-ffrontend-optimize' option. This 1265 option is implied by '-Wextra'. 1266 1267 '-Wrealloc-lhs' 1268 Warn when the compiler might insert code to for allocation or 1269 reallocation of an allocatable array variable of intrinsic type in 1270 intrinsic assignments. In hot loops, the Fortran 2003 reallocation 1271 feature may reduce the performance. If the array is already 1272 allocated with the correct shape, consider using a whole-array 1273 array-spec (e.g. '(:,:,:)') for the variable on the left-hand side 1274 to prevent the reallocation check. Note that in some cases the 1275 warning is shown, even if the compiler will optimize reallocation 1276 checks away. For instance, when the right-hand side contains the 1277 same variable multiplied by a scalar. See also '-frealloc-lhs'. 1278 1279 '-Wrealloc-lhs-all' 1280 Warn when the compiler inserts code to for allocation or 1281 reallocation of an allocatable variable; this includes scalars and 1282 derived types. 1283 1284 '-Wcompare-reals' 1285 Warn when comparing real or complex types for equality or 1286 inequality. This option is implied by '-Wextra'. 1287 1288 '-Wtarget-lifetime' 1289 Warn if the pointer in a pointer assignment might be longer than 1290 the its target. This option is implied by '-Wall'. 1291 1292 '-Wzerotrip' 1293 Warn if a 'DO' loop is known to execute zero times at compile time. 1294 This option is implied by '-Wall'. 1295 1296 '-Wdo-subscript' 1297 Warn if an array subscript inside a DO loop could lead to an 1298 out-of-bounds access even if the compiler cannot prove that the 1299 statement is actually executed, in cases like 1300 real a(3) 1301 do i=1,4 1302 if (condition(i)) then 1303 a(i) = 1.2 1304 end if 1305 end do 1306 This option is implied by '-Wextra'. 1307 1308 '-Werror' 1309 Turns all warnings into errors. 1310 1311 *Note Options to Request or Suppress Errors and Warnings: 1312 (gcc)Warning Options, for information on more options offered by the GBE 1313 shared by 'gfortran', 'gcc' and other GNU compilers. 1314 1315 Some of these have no effect when compiling programs written in 1316 Fortran. 1317 1318 1319 File: gfortran.info, Node: Debugging Options, Next: Directory Options, Prev: Error and Warning Options, Up: Invoking GNU Fortran 1320 1321 2.5 Options for debugging your program or GNU Fortran 1322 ===================================================== 1323 1324 GNU Fortran has various special options that are used for debugging 1325 either your program or the GNU Fortran compiler. 1326 1327 '-fdump-fortran-original' 1328 Output the internal parse tree after translating the source program 1329 into internal representation. This option is mostly useful for 1330 debugging the GNU Fortran compiler itself. The output generated by 1331 this option might change between releases. This option may also 1332 generate internal compiler errors for features which have only 1333 recently been added. 1334 1335 '-fdump-fortran-optimized' 1336 Output the parse tree after front-end optimization. Mostly useful 1337 for debugging the GNU Fortran compiler itself. The output 1338 generated by this option might change between releases. This 1339 option may also generate internal compiler errors for features 1340 which have only recently been added. 1341 1342 '-fdump-parse-tree' 1343 Output the internal parse tree after translating the source program 1344 into internal representation. Mostly useful for debugging the GNU 1345 Fortran compiler itself. The output generated by this option might 1346 change between releases. This option may also generate internal 1347 compiler errors for features which have only recently been added. 1348 This option is deprecated; use '-fdump-fortran-original' instead. 1349 1350 '-fdebug-aux-vars' 1351 Renames internal variables created by the gfortran front end and 1352 makes them accessible to a debugger. The name of the internal 1353 variables then start with upper-case letters followed by an 1354 underscore. This option is useful for debugging the compiler's 1355 code generation together with '-fdump-tree-original' and enabling 1356 debugging of the executable program by using '-g' or '-ggdb3'. 1357 1358 '-fdump-fortran-global' 1359 Output a list of the global identifiers after translating into 1360 middle-end representation. Mostly useful for debugging the GNU 1361 Fortran compiler itself. The output generated by this option might 1362 change between releases. This option may also generate internal 1363 compiler errors for features which have only recently been added. 1364 1365 '-ffpe-trap=LIST' 1366 Specify a list of floating point exception traps to enable. On 1367 most systems, if a floating point exception occurs and the trap for 1368 that exception is enabled, a SIGFPE signal will be sent and the 1369 program being aborted, producing a core file useful for debugging. 1370 LIST is a (possibly empty) comma-separated list of the following 1371 exceptions: 'invalid' (invalid floating point operation, such as 1372 'SQRT(-1.0)'), 'zero' (division by zero), 'overflow' (overflow in a 1373 floating point operation), 'underflow' (underflow in a floating 1374 point operation), 'inexact' (loss of precision during operation), 1375 and 'denormal' (operation performed on a denormal value). The 1376 first five exceptions correspond to the five IEEE 754 exceptions, 1377 whereas the last one ('denormal') is not part of the IEEE 754 1378 standard but is available on some common architectures such as x86. 1379 1380 The first three exceptions ('invalid', 'zero', and 'overflow') 1381 often indicate serious errors, and unless the program has 1382 provisions for dealing with these exceptions, enabling traps for 1383 these three exceptions is probably a good idea. 1384 1385 If the option is used more than once in the command line, the lists 1386 will be joined: ''ffpe-trap='LIST1 'ffpe-trap='LIST2' is equivalent 1387 to 'ffpe-trap='LIST1,LIST2. 1388 1389 Note that once enabled an exception cannot be disabled (no negative 1390 form). 1391 1392 Many, if not most, floating point operations incur loss of 1393 precision due to rounding, and hence the 'ffpe-trap=inexact' is 1394 likely to be uninteresting in practice. 1395 1396 By default no exception traps are enabled. 1397 1398 '-ffpe-summary=LIST' 1399 Specify a list of floating-point exceptions, whose flag status is 1400 printed to 'ERROR_UNIT' when invoking 'STOP' and 'ERROR STOP'. 1401 LIST can be either 'none', 'all' or a comma-separated list of the 1402 following exceptions: 'invalid', 'zero', 'overflow', 'underflow', 1403 'inexact' and 'denormal'. (See '-ffpe-trap' for a description of 1404 the exceptions.) 1405 1406 If the option is used more than once in the command line, only the 1407 last one will be used. 1408 1409 By default, a summary for all exceptions but 'inexact' is shown. 1410 1411 '-fno-backtrace' 1412 When a serious runtime error is encountered or a deadly signal is 1413 emitted (segmentation fault, illegal instruction, bus error, 1414 floating-point exception, and the other POSIX signals that have the 1415 action 'core'), the Fortran runtime library tries to output a 1416 backtrace of the error. '-fno-backtrace' disables the backtrace 1417 generation. This option only has influence for compilation of the 1418 Fortran main program. 1419 1420 *Note Options for Debugging Your Program or GCC: (gcc)Debugging 1421 Options, for more information on debugging options. 1422 1423 1424 File: gfortran.info, Node: Directory Options, Next: Link Options, Prev: Debugging Options, Up: Invoking GNU Fortran 1425 1426 2.6 Options for directory search 1427 ================================ 1428 1429 These options affect how GNU Fortran searches for files specified by the 1430 'INCLUDE' directive and where it searches for previously compiled 1431 modules. 1432 1433 It also affects the search paths used by 'cpp' when used to 1434 preprocess Fortran source. 1435 1436 '-IDIR' 1437 These affect interpretation of the 'INCLUDE' directive (as well as 1438 of the '#include' directive of the 'cpp' preprocessor). 1439 1440 Also note that the general behavior of '-I' and 'INCLUDE' is pretty 1441 much the same as of '-I' with '#include' in the 'cpp' preprocessor, 1442 with regard to looking for 'header.gcc' files and other such 1443 things. 1444 1445 This path is also used to search for '.mod' files when previously 1446 compiled modules are required by a 'USE' statement. 1447 1448 *Note Options for Directory Search: (gcc)Directory Options, for 1449 information on the '-I' option. 1450 1451 '-JDIR' 1452 This option specifies where to put '.mod' files for compiled 1453 modules. It is also added to the list of directories to searched 1454 by an 'USE' statement. 1455 1456 The default is the current directory. 1457 1458 '-fintrinsic-modules-path DIR' 1459 This option specifies the location of pre-compiled intrinsic 1460 modules, if they are not in the default location expected by the 1461 compiler. 1462 1463 1464 File: gfortran.info, Node: Link Options, Next: Runtime Options, Prev: Directory Options, Up: Invoking GNU Fortran 1465 1466 2.7 Influencing the linking step 1467 ================================ 1468 1469 These options come into play when the compiler links object files into 1470 an executable output file. They are meaningless if the compiler is not 1471 doing a link step. 1472 1473 '-static-libgfortran' 1474 On systems that provide 'libgfortran' as a shared and a static 1475 library, this option forces the use of the static version. If no 1476 shared version of 'libgfortran' was built when the compiler was 1477 configured, this option has no effect. 1478 1479 1480 File: gfortran.info, Node: Runtime Options, Next: Code Gen Options, Prev: Link Options, Up: Invoking GNU Fortran 1481 1482 2.8 Influencing runtime behavior 1483 ================================ 1484 1485 These options affect the runtime behavior of programs compiled with GNU 1486 Fortran. 1487 1488 '-fconvert=CONVERSION' 1489 Specify the representation of data for unformatted files. Valid 1490 values for conversion on most systems are: 'native', the default; 1491 'swap', swap between big- and little-endian; 'big-endian', use 1492 big-endian representation for unformatted files; 'little-endian', 1493 use little-endian representation for unformatted files. 1494 1495 On POWER systems which suppport '-mabi=ieeelongdouble', there are 1496 additional options, which can be combined with others with commas. 1497 Those are 1498 '-fconvert=r16_ieee' Use IEEE 128-bit format for 1499 'REAL(KIND=16)'. 1500 '-fconvert=r16_ibm' Use IBM long double format for 1501 'REAL(KIND=16)'. 1502 1503 _This option has an effect only when used in the main program. The 1504 'CONVERT' specifier and the GFORTRAN_CONVERT_UNIT environment 1505 variable override the default specified by '-fconvert'._ 1506 1507 '-frecord-marker=LENGTH' 1508 Specify the length of record markers for unformatted files. Valid 1509 values for LENGTH are 4 and 8. Default is 4. _This is different 1510 from previous versions of 'gfortran'_, which specified a default 1511 record marker length of 8 on most systems. If you want to read or 1512 write files compatible with earlier versions of 'gfortran', use 1513 '-frecord-marker=8'. 1514 1515 '-fmax-subrecord-length=LENGTH' 1516 Specify the maximum length for a subrecord. The maximum permitted 1517 value for length is 2147483639, which is also the default. Only 1518 really useful for use by the gfortran testsuite. 1519 1520 '-fsign-zero' 1521 When enabled, floating point numbers of value zero with the sign 1522 bit set are written as negative number in formatted output and 1523 treated as negative in the 'SIGN' intrinsic. '-fno-sign-zero' does 1524 not print the negative sign of zero values (or values rounded to 1525 zero for I/O) and regards zero as positive number in the 'SIGN' 1526 intrinsic for compatibility with Fortran 77. The default is 1527 '-fsign-zero'. 1528 1529 1530 File: gfortran.info, Node: Code Gen Options, Next: Interoperability Options, Prev: Runtime Options, Up: Invoking GNU Fortran 1531 1532 2.9 Options for code generation conventions 1533 =========================================== 1534 1535 These machine-independent options control the interface conventions used 1536 in code generation. 1537 1538 Most of them have both positive and negative forms; the negative form 1539 of '-ffoo' would be '-fno-foo'. In the table below, only one of the 1540 forms is listed--the one which is not the default. You can figure out 1541 the other form by either removing 'no-' or adding it. 1542 1543 '-fno-automatic' 1544 Treat each program unit (except those marked as RECURSIVE) as if 1545 the 'SAVE' statement were specified for every local variable and 1546 array referenced in it. Does not affect common blocks. (Some 1547 Fortran compilers provide this option under the name '-static' or 1548 '-save'.) The default, which is '-fautomatic', uses the stack for 1549 local variables smaller than the value given by 1550 '-fmax-stack-var-size'. Use the option '-frecursive' to use no 1551 static memory. 1552 1553 Local variables or arrays having an explicit 'SAVE' attribute are 1554 silently ignored unless the '-pedantic' option is added. 1555 1556 '-ff2c' 1557 Generate code designed to be compatible with code generated by 1558 'g77' and 'f2c'. 1559 1560 The calling conventions used by 'g77' (originally implemented in 1561 'f2c') require functions that return type default 'REAL' to 1562 actually return the C type 'double', and functions that return type 1563 'COMPLEX' to return the values via an extra argument in the calling 1564 sequence that points to where to store the return value. Under the 1565 default GNU calling conventions, such functions simply return their 1566 results as they would in GNU C--default 'REAL' functions return the 1567 C type 'float', and 'COMPLEX' functions return the GNU C type 1568 'complex'. Additionally, this option implies the 1569 '-fsecond-underscore' option, unless '-fno-second-underscore' is 1570 explicitly requested. 1571 1572 This does not affect the generation of code that interfaces with 1573 the 'libgfortran' library. 1574 1575 _Caution:_ It is not a good idea to mix Fortran code compiled with 1576 '-ff2c' with code compiled with the default '-fno-f2c' calling 1577 conventions as, calling 'COMPLEX' or default 'REAL' functions 1578 between program parts which were compiled with different calling 1579 conventions will break at execution time. 1580 1581 _Caution:_ This will break code which passes intrinsic functions of 1582 type default 'REAL' or 'COMPLEX' as actual arguments, as the 1583 library implementations use the '-fno-f2c' calling conventions. 1584 1585 '-fno-underscoring' 1586 Do not transform names of entities specified in the Fortran source 1587 file by appending underscores to them. 1588 1589 With '-funderscoring' in effect, GNU Fortran appends one underscore 1590 to external names with no underscores. This is done to ensure 1591 compatibility with code produced by many UNIX Fortran compilers. 1592 1593 _Caution_: The default behavior of GNU Fortran is incompatible with 1594 'f2c' and 'g77', please use the '-ff2c' option if you want object 1595 files compiled with GNU Fortran to be compatible with object code 1596 created with these tools. 1597 1598 Use of '-fno-underscoring' is not recommended unless you are 1599 experimenting with issues such as integration of GNU Fortran into 1600 existing system environments (vis-a`-vis existing libraries, tools, 1601 and so on). 1602 1603 For example, with '-funderscoring', and assuming that 'j()' and 1604 'max_count()' are external functions while 'my_var' and 'lvar' are 1605 local variables, a statement like 1606 I = J() + MAX_COUNT (MY_VAR, LVAR) 1607 is implemented as something akin to: 1608 i = j_() + max_count__(&my_var__, &lvar); 1609 1610 With '-fno-underscoring', the same statement is implemented as: 1611 1612 i = j() + max_count(&my_var, &lvar); 1613 1614 Use of '-fno-underscoring' allows direct specification of 1615 user-defined names while debugging and when interfacing GNU Fortran 1616 code with other languages. 1617 1618 Note that just because the names match does _not_ mean that the 1619 interface implemented by GNU Fortran for an external name matches 1620 the interface implemented by some other language for that same 1621 name. That is, getting code produced by GNU Fortran to link to 1622 code produced by some other compiler using this or any other method 1623 can be only a small part of the overall solution--getting the code 1624 generated by both compilers to agree on issues other than naming 1625 can require significant effort, and, unlike naming disagreements, 1626 linkers normally cannot detect disagreements in these other areas. 1627 1628 Also, note that with '-fno-underscoring', the lack of appended 1629 underscores introduces the very real possibility that a 1630 user-defined external name will conflict with a name in a system 1631 library, which could make finding unresolved-reference bugs quite 1632 difficult in some cases--they might occur at program run time, and 1633 show up only as buggy behavior at run time. 1634 1635 In future versions of GNU Fortran we hope to improve naming and 1636 linking issues so that debugging always involves using the names as 1637 they appear in the source, even if the names as seen by the linker 1638 are mangled to prevent accidental linking between procedures with 1639 incompatible interfaces. 1640 1641 '-fsecond-underscore' 1642 By default, GNU Fortran appends an underscore to external names. 1643 If this option is used GNU Fortran appends two underscores to names 1644 with underscores and one underscore to external names with no 1645 underscores. GNU Fortran also appends two underscores to internal 1646 names with underscores to avoid naming collisions with external 1647 names. 1648 1649 This option has no effect if '-fno-underscoring' is in effect. It 1650 is implied by the '-ff2c' option. 1651 1652 Otherwise, with this option, an external name such as 'MAX_COUNT' 1653 is implemented as a reference to the link-time external symbol 1654 'max_count__', instead of 'max_count_'. This is required for 1655 compatibility with 'g77' and 'f2c', and is implied by use of the 1656 '-ff2c' option. 1657 1658 '-fcoarray=<KEYWORD>' 1659 1660 'none' 1661 Disable coarray support; using coarray declarations and 1662 image-control statements will produce a compile-time error. 1663 (Default) 1664 1665 'single' 1666 Single-image mode, i.e. 'num_images()' is always one. 1667 1668 'lib' 1669 Library-based coarray parallelization; a suitable GNU Fortran 1670 coarray library needs to be linked. 1671 1672 '-fcheck=<KEYWORD>' 1673 1674 Enable the generation of run-time checks; the argument shall be a 1675 comma-delimited list of the following keywords. Prefixing a check 1676 with 'no-' disables it if it was activated by a previous 1677 specification. 1678 1679 'all' 1680 Enable all run-time test of '-fcheck'. 1681 1682 'array-temps' 1683 Warns at run time when for passing an actual argument a 1684 temporary array had to be generated. The information 1685 generated by this warning is sometimes useful in optimization, 1686 in order to avoid such temporaries. 1687 1688 Note: The warning is only printed once per location. 1689 1690 'bits' 1691 Enable generation of run-time checks for invalid arguments to 1692 the bit manipulation intrinsics. 1693 1694 'bounds' 1695 Enable generation of run-time checks for array subscripts and 1696 against the declared minimum and maximum values. It also 1697 checks array indices for assumed and deferred shape arrays 1698 against the actual allocated bounds and ensures that all 1699 string lengths are equal for character array constructors 1700 without an explicit typespec. 1701 1702 Some checks require that '-fcheck=bounds' is set for the 1703 compilation of the main program. 1704 1705 Note: In the future this may also include other forms of 1706 checking, e.g., checking substring references. 1707 1708 'do' 1709 Enable generation of run-time checks for invalid modification 1710 of loop iteration variables. 1711 1712 'mem' 1713 Enable generation of run-time checks for memory allocation. 1714 Note: This option does not affect explicit allocations using 1715 the 'ALLOCATE' statement, which will be always checked. 1716 1717 'pointer' 1718 Enable generation of run-time checks for pointers and 1719 allocatables. 1720 1721 'recursion' 1722 Enable generation of run-time checks for recursively called 1723 subroutines and functions which are not marked as recursive. 1724 See also '-frecursive'. Note: This check does not work for 1725 OpenMP programs and is disabled if used together with 1726 '-frecursive' and '-fopenmp'. 1727 1728 Example: Assuming you have a file 'foo.f90', the command 1729 gfortran -fcheck=all,no-array-temps foo.f90 1730 will compile the file with all checks enabled as specified above 1731 except warnings for generated array temporaries. 1732 1733 '-fbounds-check' 1734 Deprecated alias for '-fcheck=bounds'. 1735 1736 '-ftail-call-workaround' 1737 '-ftail-call-workaround=N' 1738 Some C interfaces to Fortran codes violate the gfortran ABI by 1739 omitting the hidden character length arguments as described in 1740 *Note Argument passing conventions::. This can lead to crashes 1741 because pushing arguments for tail calls can overflow the stack. 1742 1743 To provide a workaround for existing binary packages, this option 1744 disables tail call optimization for gfortran procedures with 1745 character arguments. With '-ftail-call-workaround=2' tail call 1746 optimization is disabled in all gfortran procedures with character 1747 arguments, with '-ftail-call-workaround=1' or equivalent 1748 '-ftail-call-workaround' only in gfortran procedures with character 1749 arguments that call implicitly prototyped procedures. 1750 1751 Using this option can lead to problems including crashes due to 1752 insufficient stack space. 1753 1754 It is _very strongly_ recommended to fix the code in question. The 1755 '-fc-prototypes-external' option can be used to generate prototypes 1756 which conform to gfortran's ABI, for inclusion in the source code. 1757 1758 Support for this option will likely be withdrawn in a future 1759 release of gfortran. 1760 1761 The negative form, '-fno-tail-call-workaround' or equivalent 1762 '-ftail-call-workaround=0', can be used to disable this option. 1763 1764 Default is currently '-ftail-call-workaround', this will change in 1765 future releases. 1766 1767 '-fcheck-array-temporaries' 1768 Deprecated alias for '-fcheck=array-temps'. 1769 1770 '-fmax-array-constructor=N' 1771 This option can be used to increase the upper limit permitted in 1772 array constructors. The code below requires this option to expand 1773 the array at compile time. 1774 1775 program test 1776 implicit none 1777 integer j 1778 integer, parameter :: n = 100000 1779 integer, parameter :: i(n) = (/ (2*j, j = 1, n) /) 1780 print '(10(I0,1X))', i 1781 end program test 1782 1783 _Caution: This option can lead to long compile times and 1784 excessively large object files._ 1785 1786 The default value for N is 65535. 1787 1788 '-fmax-stack-var-size=N' 1789 This option specifies the size in bytes of the largest array that 1790 will be put on the stack; if the size is exceeded static memory is 1791 used (except in procedures marked as RECURSIVE). Use the option 1792 '-frecursive' to allow for recursive procedures which do not have a 1793 RECURSIVE attribute or for parallel programs. Use '-fno-automatic' 1794 to never use the stack. 1795 1796 This option currently only affects local arrays declared with 1797 constant bounds, and may not apply to all character variables. 1798 Future versions of GNU Fortran may improve this behavior. 1799 1800 The default value for N is 65536. 1801 1802 '-fstack-arrays' 1803 Adding this option will make the Fortran compiler put all arrays of 1804 unknown size and array temporaries onto stack memory. If your 1805 program uses very large local arrays it is possible that you will 1806 have to extend your runtime limits for stack memory on some 1807 operating systems. This flag is enabled by default at optimization 1808 level '-Ofast' unless '-fmax-stack-var-size' is specified. 1809 1810 '-fpack-derived' 1811 This option tells GNU Fortran to pack derived type members as 1812 closely as possible. Code compiled with this option is likely to 1813 be incompatible with code compiled without this option, and may 1814 execute slower. 1815 1816 '-frepack-arrays' 1817 In some circumstances GNU Fortran may pass assumed shape array 1818 sections via a descriptor describing a noncontiguous area of 1819 memory. This option adds code to the function prologue to repack 1820 the data into a contiguous block at runtime. 1821 1822 This should result in faster accesses to the array. However it can 1823 introduce significant overhead to the function call, especially 1824 when the passed data is noncontiguous. 1825 1826 '-fshort-enums' 1827 This option is provided for interoperability with C code that was 1828 compiled with the '-fshort-enums' option. It will make GNU Fortran 1829 choose the smallest 'INTEGER' kind a given enumerator set will fit 1830 in, and give all its enumerators this kind. 1831 1832 '-finline-arg-packing' 1833 When passing an assumed-shape argument of a procedure as actual 1834 argument to an assumed-size or explicit size or as argument to a 1835 procedure that does not have an explicit interface, the argument 1836 may have to be packed, that is put into contiguous memory. An 1837 example is the call to 'foo' in 1838 subroutine foo(a) 1839 real, dimension(*) :: a 1840 end subroutine foo 1841 subroutine bar(b) 1842 real, dimension(:) :: b 1843 call foo(b) 1844 end subroutine bar 1845 1846 When '-finline-arg-packing' is in effect, this packing will be 1847 performed by inline code. This allows for more optimization while 1848 increasing code size. 1849 1850 '-finline-arg-packing' is implied by any of the '-O' options except 1851 when optimizing for size via '-Os'. If the code contains a very 1852 large number of argument that have to be packed, code size and also 1853 compilation time may become excessive. If that is the case, it may 1854 be better to disable this option. Instances of packing can be 1855 found by using '-Warray-temporaries'. 1856 1857 '-fexternal-blas' 1858 This option will make 'gfortran' generate calls to BLAS functions 1859 for some matrix operations like 'MATMUL', instead of using our own 1860 algorithms, if the size of the matrices involved is larger than a 1861 given limit (see '-fblas-matmul-limit'). This may be profitable if 1862 an optimized vendor BLAS library is available. The BLAS library 1863 will have to be specified at link time. 1864 1865 '-fblas-matmul-limit=N' 1866 Only significant when '-fexternal-blas' is in effect. Matrix 1867 multiplication of matrices with size larger than (or equal to) N 1868 will be performed by calls to BLAS functions, while others will be 1869 handled by 'gfortran' internal algorithms. If the matrices 1870 involved are not square, the size comparison is performed using the 1871 geometric mean of the dimensions of the argument and result 1872 matrices. 1873 1874 The default value for N is 30. 1875 1876 '-finline-matmul-limit=N' 1877 When front-end optimization is active, some calls to the 'MATMUL' 1878 intrinsic function will be inlined. This may result in code size 1879 increase if the size of the matrix cannot be determined at compile 1880 time, as code for both cases is generated. Setting 1881 '-finline-matmul-limit=0' will disable inlining in all cases. 1882 Setting this option with a value of N will produce inline code for 1883 matrices with size up to N. If the matrices involved are not 1884 square, the size comparison is performed using the geometric mean 1885 of the dimensions of the argument and result matrices. 1886 1887 The default value for N is 30. The '-fblas-matmul-limit' can be 1888 used to change this value. 1889 1890 '-frecursive' 1891 Allow indirect recursion by forcing all local arrays to be 1892 allocated on the stack. This flag cannot be used together with 1893 '-fmax-stack-var-size=' or '-fno-automatic'. 1894 1895 '-finit-local-zero' 1896 '-finit-derived' 1897 '-finit-integer=N' 1898 '-finit-real=<ZERO|INF|-INF|NAN|SNAN>' 1899 '-finit-logical=<TRUE|FALSE>' 1900 '-finit-character=N' 1901 The '-finit-local-zero' option instructs the compiler to initialize 1902 local 'INTEGER', 'REAL', and 'COMPLEX' variables to zero, 'LOGICAL' 1903 variables to false, and 'CHARACTER' variables to a string of null 1904 bytes. Finer-grained initialization options are provided by the 1905 '-finit-integer=N', '-finit-real=<ZERO|INF|-INF|NAN|SNAN>' (which 1906 also initializes the real and imaginary parts of local 'COMPLEX' 1907 variables), '-finit-logical=<TRUE|FALSE>', and '-finit-character=N' 1908 (where N is an ASCII character value) options. 1909 1910 With '-finit-derived', components of derived type variables will be 1911 initialized according to these flags. Components whose type is not 1912 covered by an explicit '-finit-*' flag will be treated as described 1913 above with '-finit-local-zero'. 1914 1915 These options do not initialize 1916 * objects with the POINTER attribute 1917 * allocatable arrays 1918 * variables that appear in an 'EQUIVALENCE' statement. 1919 (These limitations may be removed in future releases). 1920 1921 Note that the '-finit-real=nan' option initializes 'REAL' and 1922 'COMPLEX' variables with a quiet NaN. For a signalling NaN use 1923 '-finit-real=snan'; note, however, that compile-time optimizations 1924 may convert them into quiet NaN and that trapping needs to be 1925 enabled (e.g. via '-ffpe-trap'). 1926 1927 The '-finit-integer' option will parse the value into an integer of 1928 type 'INTEGER(kind=C_LONG)' on the host. Said value is then 1929 assigned to the integer variables in the Fortran code, which might 1930 result in wraparound if the value is too large for the kind. 1931 1932 Finally, note that enabling any of the '-finit-*' options will 1933 silence warnings that would have been emitted by '-Wuninitialized' 1934 for the affected local variables. 1935 1936 '-falign-commons' 1937 By default, 'gfortran' enforces proper alignment of all variables 1938 in a 'COMMON' block by padding them as needed. On certain 1939 platforms this is mandatory, on others it increases performance. 1940 If a 'COMMON' block is not declared with consistent data types 1941 everywhere, this padding can cause trouble, and 1942 '-fno-align-commons' can be used to disable automatic alignment. 1943 The same form of this option should be used for all files that 1944 share a 'COMMON' block. To avoid potential alignment issues in 1945 'COMMON' blocks, it is recommended to order objects from largest to 1946 smallest. 1947 1948 '-fno-protect-parens' 1949 By default the parentheses in expression are honored for all 1950 optimization levels such that the compiler does not do any 1951 re-association. Using '-fno-protect-parens' allows the compiler to 1952 reorder 'REAL' and 'COMPLEX' expressions to produce faster code. 1953 Note that for the re-association optimization '-fno-signed-zeros' 1954 and '-fno-trapping-math' need to be in effect. The parentheses 1955 protection is enabled by default, unless '-Ofast' is given. 1956 1957 '-frealloc-lhs' 1958 An allocatable left-hand side of an intrinsic assignment is 1959 automatically (re)allocated if it is either unallocated or has a 1960 different shape. The option is enabled by default except when 1961 '-std=f95' is given. See also '-Wrealloc-lhs'. 1962 1963 '-faggressive-function-elimination' 1964 Functions with identical argument lists are eliminated within 1965 statements, regardless of whether these functions are marked 'PURE' 1966 or not. For example, in 1967 a = f(b,c) + f(b,c) 1968 there will only be a single call to 'f'. This option only works if 1969 '-ffrontend-optimize' is in effect. 1970 1971 '-ffrontend-optimize' 1972 This option performs front-end optimization, based on manipulating 1973 parts the Fortran parse tree. Enabled by default by any '-O' 1974 option except '-O0' and '-Og'. Optimizations enabled by this 1975 option include: 1976 * inlining calls to 'MATMUL', 1977 * elimination of identical function calls within expressions, 1978 * removing unnecessary calls to 'TRIM' in comparisons and 1979 assignments, 1980 * replacing 'TRIM(a)' with 'a(1:LEN_TRIM(a))' and 1981 * short-circuiting of logical operators ('.AND.' and '.OR.'). 1982 It can be deselected by specifying '-fno-frontend-optimize'. 1983 1984 '-ffrontend-loop-interchange' 1985 Attempt to interchange loops in the Fortran front end where 1986 profitable. Enabled by default by any '-O' option. At the moment, 1987 this option only affects 'FORALL' and 'DO CONCURRENT' statements 1988 with several forall triplets. 1989 1990 *Note Options for Code Generation Conventions: (gcc)Code Gen Options, 1991 for information on more options offered by the GBE shared by 'gfortran', 1992 'gcc', and other GNU compilers. 1993 1994 1995 File: gfortran.info, Node: Interoperability Options, Next: Environment Variables, Prev: Code Gen Options, Up: Invoking GNU Fortran 1996 1997 2.10 Options for interoperability with other languages 1998 ====================================================== 1999 2000 -fc-prototypes 2001 This option will generate C prototypes from 'BIND(C)' variable 2002 declarations, types and procedure interfaces and writes them to 2003 standard output. 'ENUM' is not yet supported. 2004 2005 The generated prototypes may need inclusion of an appropriate 2006 header, such as '<stdint.h>' or '<stdlib.h>'. For types which are 2007 not specified using the appropriate kind from the 'iso_c_binding' 2008 module, a warning is added as a comment to the code. 2009 2010 For function pointers, a pointer to a function returning 'int' 2011 without an explicit argument list is generated. 2012 2013 Example of use: 2014 $ gfortran -fc-prototypes -fsyntax-only foo.f90 > foo.h 2015 where the C code intended for interoperating with the Fortran code 2016 then uses '#include "foo.h"'. 2017 2018 -fc-prototypes-external 2019 This option will generate C prototypes from external functions and 2020 subroutines and write them to standard output. This may be useful 2021 for making sure that C bindings to Fortran code are correct. This 2022 option does not generate prototypes for 'BIND(C)' procedures, use 2023 '-fc-prototypes' for that. 2024 2025 The generated prototypes may need inclusion of an appropriate 2026 header, such as '<stdint.h>' or '<stdlib.h>'. 2027 2028 This is primarily meant for legacy code to ensure that existing C 2029 bindings match what 'gfortran' emits. The generated C prototypes 2030 should be correct for the current version of the compiler, but may 2031 not match what other compilers or earlier versions of 'gfortran' 2032 need. For new developments, use of the 'BIND(C)' features is 2033 recommended. 2034 2035 Example of use: 2036 $ gfortran -fc-prototypes-external -fsyntax-only foo.f > foo.h 2037 where the C code intended for interoperating with the Fortran code 2038 then uses '#include "foo.h"'. 2039 2040 2041 File: gfortran.info, Node: Environment Variables, Prev: Interoperability Options, Up: Invoking GNU Fortran 2042 2043 2.11 Environment variables affecting 'gfortran' 2044 =============================================== 2045 2046 The 'gfortran' compiler currently does not make use of any environment 2047 variables to control its operation above and beyond those that affect 2048 the operation of 'gcc'. 2049 2050 *Note Environment Variables Affecting GCC: (gcc)Environment 2051 Variables, for information on environment variables. 2052 2053 *Note Runtime::, for environment variables that affect the run-time 2054 behavior of programs compiled with GNU Fortran. 2055 2056 2057 File: gfortran.info, Node: Runtime, Next: Compiler Characteristics, Prev: Invoking GNU Fortran, Up: Top 2058 2059 3 Runtime: Influencing runtime behavior with environment variables 2060 ****************************************************************** 2061 2062 The behavior of the 'gfortran' can be influenced by environment 2063 variables. 2064 2065 Malformed environment variables are silently ignored. 2066 2067 * Menu: 2068 2069 * TMPDIR:: Directory for scratch files 2070 * GFORTRAN_STDIN_UNIT:: Unit number for standard input 2071 * GFORTRAN_STDOUT_UNIT:: Unit number for standard output 2072 * GFORTRAN_STDERR_UNIT:: Unit number for standard error 2073 * GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units 2074 * GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units. 2075 * GFORTRAN_SHOW_LOCUS:: Show location for runtime errors 2076 * GFORTRAN_OPTIONAL_PLUS:: Print leading + where permitted 2077 * GFORTRAN_LIST_SEPARATOR:: Separator for list output 2078 * GFORTRAN_CONVERT_UNIT:: Set conversion for unformatted I/O 2079 * GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors 2080 * GFORTRAN_FORMATTED_BUFFER_SIZE:: Buffer size for formatted files 2081 * GFORTRAN_UNFORMATTED_BUFFER_SIZE:: Buffer size for unformatted files 2082 2083 2084 File: gfortran.info, Node: TMPDIR, Next: GFORTRAN_STDIN_UNIT, Up: Runtime 2085 2086 3.1 'TMPDIR'--Directory for scratch files 2087 ========================================= 2088 2089 When opening a file with 'STATUS='SCRATCH'', GNU Fortran tries to create 2090 the file in one of the potential directories by testing each directory 2091 in the order below. 2092 2093 1. The environment variable 'TMPDIR', if it exists. 2094 2095 2. On the MinGW target, the directory returned by the 'GetTempPath' 2096 function. Alternatively, on the Cygwin target, the 'TMP' and 2097 'TEMP' environment variables, if they exist, in that order. 2098 2099 3. The 'P_tmpdir' macro if it is defined, otherwise the directory 2100 '/tmp'. 2101 2102 2103 File: gfortran.info, Node: GFORTRAN_STDIN_UNIT, Next: GFORTRAN_STDOUT_UNIT, Prev: TMPDIR, Up: Runtime 2104 2105 3.2 'GFORTRAN_STDIN_UNIT'--Unit number for standard input 2106 ========================================================= 2107 2108 This environment variable can be used to select the unit number 2109 preconnected to standard input. This must be a positive integer. The 2110 default value is 5. 2111 2112 2113 File: gfortran.info, Node: GFORTRAN_STDOUT_UNIT, Next: GFORTRAN_STDERR_UNIT, Prev: GFORTRAN_STDIN_UNIT, Up: Runtime 2114 2115 3.3 'GFORTRAN_STDOUT_UNIT'--Unit number for standard output 2116 =========================================================== 2117 2118 This environment variable can be used to select the unit number 2119 preconnected to standard output. This must be a positive integer. The 2120 default value is 6. 2121 2122 2123 File: gfortran.info, Node: GFORTRAN_STDERR_UNIT, Next: GFORTRAN_UNBUFFERED_ALL, Prev: GFORTRAN_STDOUT_UNIT, Up: Runtime 2124 2125 3.4 'GFORTRAN_STDERR_UNIT'--Unit number for standard error 2126 ========================================================== 2127 2128 This environment variable can be used to select the unit number 2129 preconnected to standard error. This must be a positive integer. The 2130 default value is 0. 2131 2132 2133 File: gfortran.info, Node: GFORTRAN_UNBUFFERED_ALL, Next: GFORTRAN_UNBUFFERED_PRECONNECTED, Prev: GFORTRAN_STDERR_UNIT, Up: Runtime 2134 2135 3.5 'GFORTRAN_UNBUFFERED_ALL'--Do not buffer I/O on all units 2136 ============================================================= 2137 2138 This environment variable controls whether all I/O is unbuffered. If 2139 the first letter is 'y', 'Y' or '1', all I/O is unbuffered. This will 2140 slow down small sequential reads and writes. If the first letter is 2141 'n', 'N' or '0', I/O is buffered. This is the default. 2142 2143 2144 File: gfortran.info, Node: GFORTRAN_UNBUFFERED_PRECONNECTED, Next: GFORTRAN_SHOW_LOCUS, Prev: GFORTRAN_UNBUFFERED_ALL, Up: Runtime 2145 2146 3.6 'GFORTRAN_UNBUFFERED_PRECONNECTED'--Do not buffer I/O on preconnected units 2147 =============================================================================== 2148 2149 The environment variable named 'GFORTRAN_UNBUFFERED_PRECONNECTED' 2150 controls whether I/O on a preconnected unit (i.e. STDOUT or STDERR) is 2151 unbuffered. If the first letter is 'y', 'Y' or '1', I/O is unbuffered. 2152 This will slow down small sequential reads and writes. If the first 2153 letter is 'n', 'N' or '0', I/O is buffered. This is the default. 2154 2155 2156 File: gfortran.info, Node: GFORTRAN_SHOW_LOCUS, Next: GFORTRAN_OPTIONAL_PLUS, Prev: GFORTRAN_UNBUFFERED_PRECONNECTED, Up: Runtime 2157 2158 3.7 'GFORTRAN_SHOW_LOCUS'--Show location for runtime errors 2159 =========================================================== 2160 2161 If the first letter is 'y', 'Y' or '1', filename and line numbers for 2162 runtime errors are printed. If the first letter is 'n', 'N' or '0', do 2163 not print filename and line numbers for runtime errors. The default is 2164 to print the location. 2165 2166 2167 File: gfortran.info, Node: GFORTRAN_OPTIONAL_PLUS, Next: GFORTRAN_LIST_SEPARATOR, Prev: GFORTRAN_SHOW_LOCUS, Up: Runtime 2168 2169 3.8 'GFORTRAN_OPTIONAL_PLUS'--Print leading + where permitted 2170 ============================================================= 2171 2172 If the first letter is 'y', 'Y' or '1', a plus sign is printed where 2173 permitted by the Fortran standard. If the first letter is 'n', 'N' or 2174 '0', a plus sign is not printed in most cases. Default is not to print 2175 plus signs. 2176 2177 2178 File: gfortran.info, Node: GFORTRAN_LIST_SEPARATOR, Next: GFORTRAN_CONVERT_UNIT, Prev: GFORTRAN_OPTIONAL_PLUS, Up: Runtime 2179 2180 3.9 'GFORTRAN_LIST_SEPARATOR'--Separator for list output 2181 ======================================================== 2182 2183 This environment variable specifies the separator when writing 2184 list-directed output. It may contain any number of spaces and at most 2185 one comma. If you specify this on the command line, be sure to quote 2186 spaces, as in 2187 $ GFORTRAN_LIST_SEPARATOR=' , ' ./a.out 2188 when 'a.out' is the compiled Fortran program that you want to run. 2189 Default is a single space. 2190 2191 2192 File: gfortran.info, Node: GFORTRAN_CONVERT_UNIT, Next: GFORTRAN_ERROR_BACKTRACE, Prev: GFORTRAN_LIST_SEPARATOR, Up: Runtime 2193 2194 3.10 'GFORTRAN_CONVERT_UNIT'--Set conversion for unformatted I/O 2195 ================================================================ 2196 2197 By setting the 'GFORTRAN_CONVERT_UNIT' variable, it is possible to 2198 change the representation of data for unformatted files. The syntax for 2199 the 'GFORTRAN_CONVERT_UNIT' variable for most systems is: 2200 GFORTRAN_CONVERT_UNIT: mode | mode ';' exception | exception ; 2201 mode: 'native' | 'swap' | 'big_endian' | 'little_endian' ; 2202 exception: mode ':' unit_list | unit_list ; 2203 unit_list: unit_spec | unit_list unit_spec ; 2204 unit_spec: INTEGER | INTEGER '-' INTEGER ; 2205 The variable consists of an optional default mode, followed by a list 2206 of optional exceptions, which are separated by semicolons from the 2207 preceding default and each other. Each exception consists of a format 2208 and a comma-separated list of units. Valid values for the modes are the 2209 same as for the 'CONVERT' specifier: 2210 2211 'NATIVE' Use the native format. This is the default. 2212 'SWAP' Swap between little- and big-endian. 2213 'LITTLE_ENDIAN' Use the little-endian format for unformatted files. 2214 'BIG_ENDIAN' Use the big-endian format for unformatted files. 2215 For POWER systems which support '-mabi=ieeelongdouble', there are 2216 additional options, which can be combined with the others with commas. 2217 Those are 2218 'R16_IEEE' Use IEEE 128-bit format for 'REAL(KIND=16)'. 2219 'R16_IBM' Use IBM 'long double' format for 'REAL(KIND=16)'. 2220 A missing mode for an exception is taken to mean 'BIG_ENDIAN'. 2221 Examples of values for 'GFORTRAN_CONVERT_UNIT' are: 2222 ''big_endian'' Do all unformatted I/O in big_endian mode. 2223 ''little_endian;native:10-20,25'' Do all unformatted I/O in 2224 little_endian mode, except for units 10 to 20 and 25, which are in 2225 native format. 2226 ''10-20'' Units 10 to 20 are big-endian, the rest is native. 2227 ''big_endian,r16_ibm'' Do all unformatted I/O in big-endian mode 2228 and use IBM long double for output of 'REAL(KIND=16)' values. 2229 2230 Setting the environment variables should be done on the command line 2231 or via the 'export' command for 'sh'-compatible shells and via 'setenv' 2232 for 'csh'-compatible shells. 2233 2234 Example for 'sh': 2235 $ gfortran foo.f90 2236 $ GFORTRAN_CONVERT_UNIT='big_endian;native:10-20' ./a.out 2237 2238 Example code for 'csh': 2239 % gfortran foo.f90 2240 % setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20' 2241 % ./a.out 2242 2243 Using anything but the native representation for unformatted data 2244 carries a significant speed overhead. If speed in this area matters to 2245 you, it is best if you use this only for data that needs to be portable. 2246 2247 *Note CONVERT specifier::, for an alternative way to specify the data 2248 representation for unformatted files. *Note Runtime Options::, for 2249 setting a default data representation for the whole program. The 2250 'CONVERT' specifier overrides the '-fconvert' compile options. 2251 2252 _Note that the values specified via the GFORTRAN_CONVERT_UNIT 2253 environment variable will override the CONVERT specifier in the open 2254 statement_. This is to give control over data formats to users who do 2255 not have the source code of their program available. 2256 2257 2258 File: gfortran.info, Node: GFORTRAN_ERROR_BACKTRACE, Next: GFORTRAN_FORMATTED_BUFFER_SIZE, Prev: GFORTRAN_CONVERT_UNIT, Up: Runtime 2259 2260 3.11 'GFORTRAN_ERROR_BACKTRACE'--Show backtrace on run-time errors 2261 ================================================================== 2262 2263 If the 'GFORTRAN_ERROR_BACKTRACE' variable is set to 'y', 'Y' or '1' 2264 (only the first letter is relevant) then a backtrace is printed when a 2265 serious run-time error occurs. To disable the backtracing, set the 2266 variable to 'n', 'N', '0'. Default is to print a backtrace unless the 2267 '-fno-backtrace' compile option was used. 2268 2269 2270 File: gfortran.info, Node: GFORTRAN_FORMATTED_BUFFER_SIZE, Next: GFORTRAN_UNFORMATTED_BUFFER_SIZE, Prev: GFORTRAN_ERROR_BACKTRACE, Up: Runtime 2271 2272 3.12 'GFORTRAN_FORMATTED_BUFFER_SIZE'--Set buffer size for formatted I/O 2273 ======================================================================== 2274 2275 The 'GFORTRAN_FORMATTED_BUFFER_SIZE' environment variable specifies 2276 buffer size in bytes to be used for formatted output. The default value 2277 is 8192. 2278 2279 2280 File: gfortran.info, Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE, Prev: GFORTRAN_FORMATTED_BUFFER_SIZE, Up: Runtime 2281 2282 3.13 'GFORTRAN_UNFORMATTED_BUFFER_SIZE'--Set buffer size for unformatted I/O 2283 ============================================================================ 2284 2285 The 'GFORTRAN_UNFORMATTED_BUFFER_SIZE' environment variable specifies 2286 buffer size in bytes to be used for unformatted output. The default 2287 value is 131072. 2288 2289 2290 File: gfortran.info, Node: Compiler Characteristics, Next: Extensions, Prev: Runtime, Up: Top 2291 2292 4 Compiler Characteristics 2293 ************************** 2294 2295 This chapter describes certain characteristics of the GNU Fortran 2296 compiler, that are not specified by the Fortran standard, but which 2297 might in some way or another become visible to the programmer. 2298 2299 * Menu: 2300 2301 * KIND Type Parameters:: 2302 * Internal representation of LOGICAL variables:: 2303 * Evaluation of logical expressions:: 2304 * MAX and MIN intrinsics with REAL NaN arguments:: 2305 * Thread-safety of the runtime library:: 2306 * Data consistency and durability:: 2307 * Files opened without an explicit ACTION= specifier:: 2308 * File operations on symbolic links:: 2309 * File format of unformatted sequential files:: 2310 * Asynchronous I/O:: 2311 2312 2313 File: gfortran.info, Node: KIND Type Parameters, Next: Internal representation of LOGICAL variables, Up: Compiler Characteristics 2314 2315 4.1 KIND Type Parameters 2316 ======================== 2317 2318 The 'KIND' type parameters supported by GNU Fortran for the primitive 2319 data types are: 2320 2321 'INTEGER' 2322 1, 2, 4, 8*, 16*, default: 4** 2323 2324 'LOGICAL' 2325 1, 2, 4, 8*, 16*, default: 4** 2326 2327 'REAL' 2328 4, 8, 10*, 16*, default: 4*** 2329 2330 'COMPLEX' 2331 4, 8, 10*, 16*, default: 4*** 2332 2333 'DOUBLE PRECISION' 2334 4, 8, 10*, 16*, default: 8*** 2335 2336 'CHARACTER' 2337 1, 4, default: 1 2338 2339 * not available on all systems 2340 ** unless '-fdefault-integer-8' is used 2341 *** unless '-fdefault-real-8' is used (see *note Fortran Dialect 2342 Options::) 2343 2344 The 'KIND' value matches the storage size in bytes, except for 'COMPLEX' 2345 where the storage size is twice as much (or both real and imaginary part 2346 are a real value of the given size). It is recommended to use the *note 2347 SELECTED_CHAR_KIND::, *note SELECTED_INT_KIND:: and *note 2348 SELECTED_REAL_KIND:: intrinsics or the 'INT8', 'INT16', 'INT32', 2349 'INT64', 'REAL32', 'REAL64', and 'REAL128' parameters of the 2350 'ISO_FORTRAN_ENV' module instead of the concrete values. The available 2351 kind parameters can be found in the constant arrays 'CHARACTER_KINDS', 2352 'INTEGER_KINDS', 'LOGICAL_KINDS' and 'REAL_KINDS' in the *note 2353 ISO_FORTRAN_ENV:: module. For C interoperability, the kind parameters 2354 of the *note ISO_C_BINDING:: module should be used. 2355 2356 2357 File: gfortran.info, Node: Internal representation of LOGICAL variables, Next: Evaluation of logical expressions, Prev: KIND Type Parameters, Up: Compiler Characteristics 2358 2359 4.2 Internal representation of LOGICAL variables 2360 ================================================ 2361 2362 The Fortran standard does not specify how variables of 'LOGICAL' type 2363 are represented, beyond requiring that 'LOGICAL' variables of default 2364 kind have the same storage size as default 'INTEGER' and 'REAL' 2365 variables. The GNU Fortran internal representation is as follows. 2366 2367 A 'LOGICAL(KIND=N)' variable is represented as an 'INTEGER(KIND=N)' 2368 variable, however, with only two permissible values: '1' for '.TRUE.' 2369 and '0' for '.FALSE.'. Any other integer value results in undefined 2370 behavior. 2371 2372 See also *note Argument passing conventions:: and *note 2373 Interoperability with C::. 2374 2375 2376 File: 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 2377 2378 4.3 Evaluation of logical expressions 2379 ===================================== 2380 2381 The Fortran standard does not require the compiler to evaluate all parts 2382 of an expression, if they do not contribute to the final result. For 2383 logical expressions with '.AND.' or '.OR.' operators, in particular, GNU 2384 Fortran will optimize out function calls (even to impure functions) if 2385 the result of the expression can be established without them. However, 2386 since not all compilers do that, and such an optimization can 2387 potentially modify the program flow and subsequent results, GNU Fortran 2388 throws warnings for such situations with the '-Wfunction-elimination' 2389 flag. 2390 2391 2392 File: 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 2393 2394 4.4 MAX and MIN intrinsics with REAL NaN arguments 2395 ================================================== 2396 2397 The Fortran standard does not specify what the result of the 'MAX' and 2398 'MIN' intrinsics are if one of the arguments is a 'NaN'. Accordingly, 2399 the GNU Fortran compiler does not specify that either, as this allows 2400 for faster and more compact code to be generated. If the programmer 2401 wishes to take some specific action in case one of the arguments is a 2402 'NaN', it is necessary to explicitly test the arguments before calling 2403 'MAX' or 'MIN', e.g. with the 'IEEE_IS_NAN' function from the intrinsic 2404 module 'IEEE_ARITHMETIC'. 2405 2406 2407 File: 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 2408 2409 4.5 Thread-safety of the runtime library 2410 ======================================== 2411 2412 GNU Fortran can be used in programs with multiple threads, e.g. by using 2413 OpenMP, by calling OS thread handling functions via the 'ISO_C_BINDING' 2414 facility, or by GNU Fortran compiled library code being called from a 2415 multi-threaded program. 2416 2417 The GNU Fortran runtime library, ('libgfortran'), supports being 2418 called concurrently from multiple threads with the following exceptions. 2419 2420 During library initialization, the C 'getenv' function is used, which 2421 need not be thread-safe. Similarly, the 'getenv' function is used to 2422 implement the 'GET_ENVIRONMENT_VARIABLE' and 'GETENV' intrinsics. It is 2423 the responsibility of the user to ensure that the environment is not 2424 being updated concurrently when any of these actions are taking place. 2425 2426 The 'EXECUTE_COMMAND_LINE' and 'SYSTEM' intrinsics are implemented 2427 with the 'system' function, which need not be thread-safe. It is the 2428 responsibility of the user to ensure that 'system' is not called 2429 concurrently. 2430 2431 For platforms not supporting thread-safe POSIX functions, further 2432 functionality might not be thread-safe. For details, please consult the 2433 documentation for your operating system. 2434 2435 The GNU Fortran runtime library uses various C library functions that 2436 depend on the locale, such as 'strtod' and 'snprintf'. In order to work 2437 correctly in locale-aware programs that set the locale using 2438 'setlocale', the locale is reset to the default "C" locale while 2439 executing a formatted 'READ' or 'WRITE' statement. On targets 2440 supporting the POSIX 2008 per-thread locale functions (e.g. 2441 'newlocale', 'uselocale', 'freelocale'), these are used and thus the 2442 global locale set using 'setlocale' or the per-thread locales in other 2443 threads are not affected. However, on targets lacking this 2444 functionality, the global LC_NUMERIC locale is set to "C" during the 2445 formatted I/O. Thus, on such targets it's not safe to call 'setlocale' 2446 concurrently from another thread while a Fortran formatted I/O operation 2447 is in progress. Also, other threads doing something dependent on the 2448 LC_NUMERIC locale might not work correctly if a formatted I/O operation 2449 is in progress in another thread. 2450 2451 2452 File: 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 2453 2454 4.6 Data consistency and durability 2455 =================================== 2456 2457 This section contains a brief overview of data and metadata consistency 2458 and durability issues when doing I/O. 2459 2460 With respect to durability, GNU Fortran makes no effort to ensure 2461 that data is committed to stable storage. If this is required, the GNU 2462 Fortran programmer can use the intrinsic 'FNUM' to retrieve the low 2463 level file descriptor corresponding to an open Fortran unit. Then, 2464 using e.g. the 'ISO_C_BINDING' feature, one can call the underlying 2465 system call to flush dirty data to stable storage, such as 'fsync' on 2466 POSIX, '_commit' on MingW, or 'fcntl(fd, F_FULLSYNC, 0)' on Mac OS X. 2467 The following example shows how to call fsync: 2468 2469 ! Declare the interface for POSIX fsync function 2470 interface 2471 function fsync (fd) bind(c,name="fsync") 2472 use iso_c_binding, only: c_int 2473 integer(c_int), value :: fd 2474 integer(c_int) :: fsync 2475 end function fsync 2476 end interface 2477 2478 ! Variable declaration 2479 integer :: ret 2480 2481 ! Opening unit 10 2482 open (10,file="foo") 2483 2484 ! ... 2485 ! Perform I/O on unit 10 2486 ! ... 2487 2488 ! Flush and sync 2489 flush(10) 2490 ret = fsync(fnum(10)) 2491 2492 ! Handle possible error 2493 if (ret /= 0) stop "Error calling FSYNC" 2494 2495 With respect to consistency, for regular files GNU Fortran uses 2496 buffered I/O in order to improve performance. This buffer is flushed 2497 automatically when full and in some other situations, e.g. when closing 2498 a unit. It can also be explicitly flushed with the 'FLUSH' statement. 2499 Also, the buffering can be turned off with the 'GFORTRAN_UNBUFFERED_ALL' 2500 and 'GFORTRAN_UNBUFFERED_PRECONNECTED' environment variables. Special 2501 files, such as terminals and pipes, are always unbuffered. Sometimes, 2502 however, further things may need to be done in order to allow other 2503 processes to see data that GNU Fortran has written, as follows. 2504 2505 The Windows platform supports a relaxed metadata consistency model, 2506 where file metadata is written to the directory lazily. This means 2507 that, for instance, the 'dir' command can show a stale size for a file. 2508 One can force a directory metadata update by closing the unit, or by 2509 calling '_commit' on the file descriptor. Note, though, that '_commit' 2510 will force all dirty data to stable storage, which is often a very slow 2511 operation. 2512 2513 The Network File System (NFS) implements a relaxed consistency model 2514 called open-to-close consistency. Closing a file forces dirty data and 2515 metadata to be flushed to the server, and opening a file forces the 2516 client to contact the server in order to revalidate cached data. 2517 'fsync' will also force a flush of dirty data and metadata to the 2518 server. Similar to 'open' and 'close', acquiring and releasing 'fcntl' 2519 file locks, if the server supports them, will also force cache 2520 validation and flushing dirty data and metadata. 2521 2522 2523 File: gfortran.info, Node: Files opened without an explicit ACTION= specifier, Next: File operations on symbolic links, Prev: Data consistency and durability, Up: Compiler Characteristics 2524 2525 4.7 Files opened without an explicit ACTION= specifier 2526 ====================================================== 2527 2528 The Fortran standard says that if an 'OPEN' statement is executed 2529 without an explicit 'ACTION=' specifier, the default value is processor 2530 dependent. GNU Fortran behaves as follows: 2531 2532 1. Attempt to open the file with 'ACTION='READWRITE'' 2533 2. If that fails, try to open with 'ACTION='READ'' 2534 3. If that fails, try to open with 'ACTION='WRITE'' 2535 4. If that fails, generate an error 2536 2537 2538 File: 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 2539 2540 4.8 File operations on symbolic links 2541 ===================================== 2542 2543 This section documents the behavior of GNU Fortran for file operations 2544 on symbolic links, on systems that support them. 2545 2546 * Results of INQUIRE statements of the "inquire by file" form will 2547 relate to the target of the symbolic link. For example, 2548 'INQUIRE(FILE="foo",EXIST=ex)' will set EX to .TRUE. if FOO is a 2549 symbolic link pointing to an existing file, and .FALSE. if FOO 2550 points to an non-existing file ("dangling" symbolic link). 2551 2552 * Using the 'OPEN' statement with a 'STATUS="NEW"' specifier on a 2553 symbolic link will result in an error condition, whether the 2554 symbolic link points to an existing target or is dangling. 2555 2556 * If a symbolic link was connected, using the 'CLOSE' statement with 2557 a 'STATUS="DELETE"' specifier will cause the symbolic link itself 2558 to be deleted, not its target. 2559 2560 2561 File: gfortran.info, Node: File format of unformatted sequential files, Next: Asynchronous I/O, Prev: File operations on symbolic links, Up: Compiler Characteristics 2562 2563 4.9 File format of unformatted sequential files 2564 =============================================== 2565 2566 Unformatted sequential files are stored as logical records using record 2567 markers. Each logical record consists of one of more subrecords. 2568 2569 Each subrecord consists of a leading record marker, the data written 2570 by the user program, and a trailing record marker. The record markers 2571 are four-byte integers by default, and eight-byte integers if the 2572 '-fmax-subrecord-length=8' option (which exists for backwards 2573 compability only) is in effect. 2574 2575 The representation of the record markers is that of unformatted files 2576 given with the '-fconvert' option, the *note CONVERT specifier:: in an 2577 open statement or the *note GFORTRAN_CONVERT_UNIT:: environment 2578 variable. 2579 2580 The maximum number of bytes of user data in a subrecord is 2147483639 2581 (2 GiB - 9) for a four-byte record marker. This limit can be lowered 2582 with the '-fmax-subrecord-length' option, although this is rarely 2583 useful. If the length of a logical record exceeds this limit, the data 2584 is distributed among several subrecords. 2585 2586 The absolute of the number stored in the record markers is the number 2587 of bytes of user data in the corresponding subrecord. If the leading 2588 record marker of a subrecord contains a negative number, another 2589 subrecord follows the current one. If the trailing record marker 2590 contains a negative number, then there is a preceding subrecord. 2591 2592 In the most simple case, with only one subrecord per logical record, 2593 both record markers contain the number of bytes of user data in the 2594 record. 2595 2596 The format for unformatted sequential data can be duplicated using 2597 unformatted stream, as shown in the example program for an unformatted 2598 record containing a single subrecord: 2599 2600 program main 2601 use iso_fortran_env, only: int32 2602 implicit none 2603 integer(int32) :: i 2604 real, dimension(10) :: a, b 2605 call random_number(a) 2606 open (10,file='test.dat',form='unformatted',access='stream') 2607 inquire (iolength=i) a 2608 write (10) i, a, i 2609 close (10) 2610 open (10,file='test.dat',form='unformatted') 2611 read (10) b 2612 if (all (a == b)) print *,'success!' 2613 end program main 2614 2615 2616 File: gfortran.info, Node: Asynchronous I/O, Prev: File format of unformatted sequential files, Up: Compiler Characteristics 2617 2618 4.10 Asynchronous I/O 2619 ===================== 2620 2621 Asynchronous I/O is supported if the program is linked against the POSIX 2622 thread library. If that is not the case, all I/O is performed as 2623 synchronous. On systems which do not support pthread condition 2624 variables, such as AIX, I/O is also performed as synchronous. 2625 2626 On some systems, such as Darwin or Solaris, the POSIX thread library 2627 is always linked in, so asynchronous I/O is always performed. On other 2628 sytems, such as Linux, it is necessary to specify '-pthread', 2629 '-lpthread' or '-fopenmp' during the linking step. 2630 2631 2632 File: gfortran.info, Node: Extensions, Next: Mixed-Language Programming, Prev: Compiler Characteristics, Up: Top 2633 2634 5 Extensions 2635 ************ 2636 2637 The two sections below detail the extensions to standard Fortran that 2638 are implemented in GNU Fortran, as well as some of the popular or 2639 historically important extensions that are not (or not yet) implemented. 2640 For the latter case, we explain the alternatives available to GNU 2641 Fortran users, including replacement by standard-conforming code or GNU 2642 extensions. 2643 2644 * Menu: 2645 2646 * Extensions implemented in GNU Fortran:: 2647 * Extensions not implemented in GNU Fortran:: 2648 2649 2650 File: gfortran.info, Node: Extensions implemented in GNU Fortran, Next: Extensions not implemented in GNU Fortran, Up: Extensions 2651 2652 5.1 Extensions implemented in GNU Fortran 2653 ========================================= 2654 2655 GNU Fortran implements a number of extensions over standard Fortran. 2656 This chapter contains information on their syntax and meaning. There 2657 are currently two categories of GNU Fortran extensions, those that 2658 provide functionality beyond that provided by any standard, and those 2659 that are supported by GNU Fortran purely for backward compatibility with 2660 legacy compilers. By default, '-std=gnu' allows the compiler to accept 2661 both types of extensions, but to warn about the use of the latter. 2662 Specifying either '-std=f95', '-std=f2003', '-std=f2008', or 2663 '-std=f2018' disables both types of extensions, and '-std=legacy' allows 2664 both without warning. The special compile flag '-fdec' enables 2665 additional compatibility extensions along with those enabled by 2666 '-std=legacy'. 2667 2668 * Menu: 2669 2670 * Old-style kind specifications:: 2671 * Old-style variable initialization:: 2672 * Extensions to namelist:: 2673 * X format descriptor without count field:: 2674 * Commas in FORMAT specifications:: 2675 * Missing period in FORMAT specifications:: 2676 * Default widths for F, G and I format descriptors:: 2677 * I/O item lists:: 2678 * Q exponent-letter:: 2679 * BOZ literal constants:: 2680 * Real array indices:: 2681 * Unary operators:: 2682 * Implicitly convert LOGICAL and INTEGER values:: 2683 * Hollerith constants support:: 2684 * Character conversion:: 2685 * Cray pointers:: 2686 * CONVERT specifier:: 2687 * OpenMP:: 2688 * OpenACC:: 2689 * Argument list functions:: 2690 * Read/Write after EOF marker:: 2691 * STRUCTURE and RECORD:: 2692 * UNION and MAP:: 2693 * Type variants for integer intrinsics:: 2694 * AUTOMATIC and STATIC attributes:: 2695 * Extended math intrinsics:: 2696 * Form feed as whitespace:: 2697 * TYPE as an alias for PRINT:: 2698 * %LOC as an rvalue:: 2699 * .XOR. operator:: 2700 * Bitwise logical operators:: 2701 * Extended I/O specifiers:: 2702 * Legacy PARAMETER statements:: 2703 * Default exponents:: 2704 2705 2706 File: gfortran.info, Node: Old-style kind specifications, Next: Old-style variable initialization, Up: Extensions implemented in GNU Fortran 2707 2708 5.1.1 Old-style kind specifications 2709 ----------------------------------- 2710 2711 GNU Fortran allows old-style kind specifications in declarations. These 2712 look like: 2713 TYPESPEC*size x,y,z 2714 where 'TYPESPEC' is a basic type ('INTEGER', 'REAL', etc.), and where 2715 'size' is a byte count corresponding to the storage size of a valid kind 2716 for that type. (For 'COMPLEX' variables, 'size' is the total size of 2717 the real and imaginary parts.) The statement then declares 'x', 'y' and 2718 'z' to be of type 'TYPESPEC' with the appropriate kind. This is 2719 equivalent to the standard-conforming declaration 2720 TYPESPEC(k) x,y,z 2721 where 'k' is the kind parameter suitable for the intended precision. As 2722 kind parameters are implementation-dependent, use the 'KIND', 2723 'SELECTED_INT_KIND' and 'SELECTED_REAL_KIND' intrinsics to retrieve the 2724 correct value, for instance 'REAL*8 x' can be replaced by: 2725 INTEGER, PARAMETER :: dbl = KIND(1.0d0) 2726 REAL(KIND=dbl) :: x 2727 2728 2729 File: gfortran.info, Node: Old-style variable initialization, Next: Extensions to namelist, Prev: Old-style kind specifications, Up: Extensions implemented in GNU Fortran 2730 2731 5.1.2 Old-style variable initialization 2732 --------------------------------------- 2733 2734 GNU Fortran allows old-style initialization of variables of the form: 2735 INTEGER i/1/,j/2/ 2736 REAL x(2,2) /3*0.,1./ 2737 The syntax for the initializers is as for the 'DATA' statement, but 2738 unlike in a 'DATA' statement, an initializer only applies to the 2739 variable immediately preceding the initialization. In other words, 2740 something like 'INTEGER I,J/2,3/' is not valid. This style of 2741 initialization is only allowed in declarations without double colons 2742 ('::'); the double colons were introduced in Fortran 90, which also 2743 introduced a standard syntax for initializing variables in type 2744 declarations. 2745 2746 Examples of standard-conforming code equivalent to the above example 2747 are: 2748 ! Fortran 90 2749 INTEGER :: i = 1, j = 2 2750 REAL :: x(2,2) = RESHAPE((/0.,0.,0.,1./),SHAPE(x)) 2751 ! Fortran 77 2752 INTEGER i, j 2753 REAL x(2,2) 2754 DATA i/1/, j/2/, x/3*0.,1./ 2755 2756 Note that variables which are explicitly initialized in declarations 2757 or in 'DATA' statements automatically acquire the 'SAVE' attribute. 2758 2759 2760 File: gfortran.info, Node: Extensions to namelist, Next: X format descriptor without count field, Prev: Old-style variable initialization, Up: Extensions implemented in GNU Fortran 2761 2762 5.1.3 Extensions to namelist 2763 ---------------------------- 2764 2765 GNU Fortran fully supports the Fortran 95 standard for namelist I/O 2766 including array qualifiers, substrings and fully qualified derived 2767 types. The output from a namelist write is compatible with namelist 2768 read. The output has all names in upper case and indentation to column 2769 1 after the namelist name. Two extensions are permitted: 2770 2771 Old-style use of '$' instead of '&' 2772 $MYNML 2773 X(:)%Y(2) = 1.0 2.0 3.0 2774 CH(1:4) = "abcd" 2775 $END 2776 2777 It should be noted that the default terminator is '/' rather than 2778 '&END'. 2779 2780 Querying of the namelist when inputting from stdin. After at least 2781 one space, entering '?' sends to stdout the namelist name and the names 2782 of the variables in the namelist: 2783 ? 2784 2785 &mynml 2786 x 2787 x%y 2788 ch 2789 &end 2790 2791 Entering '=?' outputs the namelist to stdout, as if 'WRITE(*,NML = 2792 mynml)' had been called: 2793 =? 2794 2795 &MYNML 2796 X(1)%Y= 0.000000 , 1.000000 , 0.000000 , 2797 X(2)%Y= 0.000000 , 2.000000 , 0.000000 , 2798 X(3)%Y= 0.000000 , 3.000000 , 0.000000 , 2799 CH=abcd, / 2800 2801 To aid this dialog, when input is from stdin, errors send their 2802 messages to stderr and execution continues, even if 'IOSTAT' is set. 2803 2804 'PRINT' namelist is permitted. This causes an error if '-std=f95' is 2805 used. 2806 PROGRAM test_print 2807 REAL, dimension (4) :: x = (/1.0, 2.0, 3.0, 4.0/) 2808 NAMELIST /mynml/ x 2809 PRINT mynml 2810 END PROGRAM test_print 2811 2812 Expanded namelist reads are permitted. This causes an error if 2813 '-std=f95' is used. In the following example, the first element of the 2814 array will be given the value 0.00 and the two succeeding elements will 2815 be given the values 1.00 and 2.00. 2816 &MYNML 2817 X(1,1) = 0.00 , 1.00 , 2.00 2818 / 2819 2820 When writing a namelist, if no 'DELIM=' is specified, by default a 2821 double quote is used to delimit character strings. If -std=F95, F2003, 2822 or F2008, etc, the delim status is set to 'none'. Defaulting to quotes 2823 ensures that namelists with character strings can be subsequently read 2824 back in accurately. 2825 2826 2827 File: gfortran.info, Node: X format descriptor without count field, Next: Commas in FORMAT specifications, Prev: Extensions to namelist, Up: Extensions implemented in GNU Fortran 2828 2829 5.1.4 'X' format descriptor without count field 2830 ----------------------------------------------- 2831 2832 To support legacy codes, GNU Fortran permits the count field of the 'X' 2833 edit descriptor in 'FORMAT' statements to be omitted. When omitted, the 2834 count is implicitly assumed to be one. 2835 2836 PRINT 10, 2, 3 2837 10 FORMAT (I1, X, I1) 2838 2839 2840 File: 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 2841 2842 5.1.5 Commas in 'FORMAT' specifications 2843 --------------------------------------- 2844 2845 To support legacy codes, GNU Fortran allows the comma separator to be 2846 omitted immediately before and after character string edit descriptors 2847 in 'FORMAT' statements. A comma with no following format decriptor is 2848 permited if the '-fdec-blank-format-item' is given on the command line. 2849 This is considered non-conforming code and is discouraged. 2850 2851 PRINT 10, 2, 3 2852 10 FORMAT ('FOO='I1' BAR='I2) 2853 print 20, 5, 6 2854 20 FORMAT (I3, I3,) 2855 2856 2857 File: 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 2858 2859 5.1.6 Missing period in 'FORMAT' specifications 2860 ----------------------------------------------- 2861 2862 To support legacy codes, GNU Fortran allows missing periods in format 2863 specifications if and only if '-std=legacy' is given on the command 2864 line. This is considered non-conforming code and is discouraged. 2865 2866 REAL :: value 2867 READ(*,10) value 2868 10 FORMAT ('F4') 2869 2870 2871 File: 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 2872 2873 5.1.7 Default widths for 'F', 'G' and 'I' format descriptors 2874 ------------------------------------------------------------ 2875 2876 To support legacy codes, GNU Fortran allows width to be omitted from 2877 format specifications if and only if '-fdec-format-defaults' is given on 2878 the command line. Default widths will be used. This is considered 2879 non-conforming code and is discouraged. 2880 2881 REAL :: value1 2882 INTEGER :: value2 2883 WRITE(*,10) value1, value1, value2 2884 10 FORMAT ('F, G, I') 2885 2886 2887 File: 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 2888 2889 5.1.8 I/O item lists 2890 -------------------- 2891 2892 To support legacy codes, GNU Fortran allows the input item list of the 2893 'READ' statement, and the output item lists of the 'WRITE' and 'PRINT' 2894 statements, to start with a comma. 2895 2896 2897 File: gfortran.info, Node: Q exponent-letter, Next: BOZ literal constants, Prev: I/O item lists, Up: Extensions implemented in GNU Fortran 2898 2899 5.1.9 'Q' exponent-letter 2900 ------------------------- 2901 2902 GNU Fortran accepts real literal constants with an exponent-letter of 2903 'Q', for example, '1.23Q45'. The constant is interpreted as a 2904 'REAL(16)' entity on targets that support this type. If the target does 2905 not support 'REAL(16)' but has a 'REAL(10)' type, then the 2906 real-literal-constant will be interpreted as a 'REAL(10)' entity. In 2907 the absence of 'REAL(16)' and 'REAL(10)', an error will occur. 2908 2909 2910 File: gfortran.info, Node: BOZ literal constants, Next: Real array indices, Prev: Q exponent-letter, Up: Extensions implemented in GNU Fortran 2911 2912 5.1.10 BOZ literal constants 2913 ---------------------------- 2914 2915 Besides decimal constants, Fortran also supports binary ('b'), octal 2916 ('o') and hexadecimal ('z') integer constants. The syntax is: 'prefix 2917 quote digits quote', where the prefix is either 'b', 'o' or 'z', quote 2918 is either ''' or '"' and the digits are '0' or '1' for binary, between 2919 '0' and '7' for octal, and between '0' and 'F' for hexadecimal. 2920 (Example: 'b'01011101''.) 2921 2922 Up to Fortran 95, BOZ literal constants were only allowed to 2923 initialize integer variables in DATA statements. Since Fortran 2003 BOZ 2924 literal constants are also allowed as actual arguments to the 'REAL', 2925 'DBLE', 'INT' and 'CMPLX' intrinsic functions. The BOZ literal constant 2926 is simply a string of bits, which is padded or truncated as needed, 2927 during conversion to a numeric type. The Fortran standard states that 2928 the treatment of the sign bit is processor dependent. Gfortran 2929 interprets the sign bit as a user would expect. 2930 2931 As a deprecated extension, GNU Fortran allows hexadecimal BOZ literal 2932 constants to be specified using the 'X' prefix. That the BOZ literal 2933 constant can also be specified by adding a suffix to the string, for 2934 example, 'Z'ABC'' and ''ABC'X' are equivalent. Additionally, as 2935 extension, BOZ literals are permitted in some contexts outside of 'DATA' 2936 and the intrinsic functions listed in the Fortran standard. Use 2937 '-fallow-invalid-boz' to enable the extension. 2938 2939 2940 File: gfortran.info, Node: Real array indices, Next: Unary operators, Prev: BOZ literal constants, Up: Extensions implemented in GNU Fortran 2941 2942 5.1.11 Real array indices 2943 ------------------------- 2944 2945 As an extension, GNU Fortran allows the use of 'REAL' expressions or 2946 variables as array indices. 2947 2948 2949 File: gfortran.info, Node: Unary operators, Next: Implicitly convert LOGICAL and INTEGER values, Prev: Real array indices, Up: Extensions implemented in GNU Fortran 2950 2951 5.1.12 Unary operators 2952 ---------------------- 2953 2954 As an extension, GNU Fortran allows unary plus and unary minus operators 2955 to appear as the second operand of binary arithmetic operators without 2956 the need for parenthesis. 2957 2958 X = Y * -Z 2959 2960 2961 File: gfortran.info, Node: Implicitly convert LOGICAL and INTEGER values, Next: Hollerith constants support, Prev: Unary operators, Up: Extensions implemented in GNU Fortran 2962 2963 5.1.13 Implicitly convert 'LOGICAL' and 'INTEGER' values 2964 -------------------------------------------------------- 2965 2966 As an extension for backwards compatibility with other compilers, GNU 2967 Fortran allows the implicit conversion of 'LOGICAL' values to 'INTEGER' 2968 values and vice versa. When converting from a 'LOGICAL' to an 2969 'INTEGER', '.FALSE.' is interpreted as zero, and '.TRUE.' is interpreted 2970 as one. When converting from 'INTEGER' to 'LOGICAL', the value zero is 2971 interpreted as '.FALSE.' and any nonzero value is interpreted as 2972 '.TRUE.'. 2973 2974 LOGICAL :: l 2975 l = 1 2976 INTEGER :: i 2977 i = .TRUE. 2978 2979 However, there is no implicit conversion of 'INTEGER' values in 2980 'if'-statements, nor of 'LOGICAL' or 'INTEGER' values in I/O operations. 2981 2982 2983 File: gfortran.info, Node: Hollerith constants support, Next: Character conversion, Prev: Implicitly convert LOGICAL and INTEGER values, Up: Extensions implemented in GNU Fortran 2984 2985 5.1.14 Hollerith constants support 2986 ---------------------------------- 2987 2988 GNU Fortran supports Hollerith constants in assignments, 'DATA' 2989 statements, function and subroutine arguments. A Hollerith constant is 2990 written as a string of characters preceded by an integer constant 2991 indicating the character count, and the letter 'H' or 'h', and stored in 2992 bytewise fashion in a numeric ('INTEGER', 'REAL', or 'COMPLEX'), 2993 'LOGICAL' or 'CHARACTER' variable. The constant will be padded with 2994 spaces or truncated to fit the size of the variable in which it is 2995 stored. 2996 2997 Examples of valid uses of Hollerith constants: 2998 complex*16 x(2) 2999 data x /16Habcdefghijklmnop, 16Hqrstuvwxyz012345/ 3000 x(1) = 16HABCDEFGHIJKLMNOP 3001 call foo (4h abc) 3002 3003 Examples of Hollerith constants: 3004 integer*4 a 3005 a = 0H ! Invalid, at least one character is needed. 3006 a = 4HAB12 ! Valid 3007 a = 8H12345678 ! Valid, but the Hollerith constant will be truncated. 3008 a = 3Hxyz ! Valid, but the Hollerith constant will be padded. 3009 3010 In general, Hollerith constants were used to provide a rudimentary 3011 facility for handling character strings in early Fortran compilers, 3012 prior to the introduction of 'CHARACTER' variables in Fortran 77; in 3013 those cases, the standard-compliant equivalent is to convert the program 3014 to use proper character strings. On occasion, there may be a case where 3015 the intent is specifically to initialize a numeric variable with a given 3016 byte sequence. In these cases, the same result can be obtained by using 3017 the 'TRANSFER' statement, as in this example. 3018 integer(kind=4) :: a 3019 a = transfer ("abcd", a) ! equivalent to: a = 4Habcd 3020 3021 The use of the '-fdec' option extends support of Hollerith constants 3022 to comparisons: 3023 integer*4 a 3024 a = 4hABCD 3025 if (a .ne. 4habcd) then 3026 write(*,*) "no match" 3027 end if 3028 3029 Supported types are numeric ('INTEGER', 'REAL', or 'COMPLEX'), and 3030 'CHARACTER'. 3031 3032 3033 File: gfortran.info, Node: Character conversion, Next: Cray pointers, Prev: Hollerith constants support, Up: Extensions implemented in GNU Fortran 3034 3035 5.1.15 Character conversion 3036 --------------------------- 3037 3038 Allowing character literals to be used in a similar way to Hollerith 3039 constants is a non-standard extension. This feature is enabled using 3040 -fdec-char-conversions and only applies to character literals of 3041 'kind=1'. 3042 3043 Character literals can be used in 'DATA' statements and assignments 3044 with numeric ('INTEGER', 'REAL', or 'COMPLEX') or 'LOGICAL' variables. 3045 Like Hollerith constants they are copied byte-wise fashion. The 3046 constant will be padded with spaces or truncated to fit the size of the 3047 variable in which it is stored. 3048 3049 Examples: 3050 integer*4 x 3051 data x / 'abcd' / 3052 3053 x = 'A' ! Will be padded. 3054 x = 'ab1234' ! Will be truncated. 3055 3056 3057 File: gfortran.info, Node: Cray pointers, Next: CONVERT specifier, Prev: Character conversion, Up: Extensions implemented in GNU Fortran 3058 3059 5.1.16 Cray pointers 3060 -------------------- 3061 3062 Cray pointers are part of a non-standard extension that provides a 3063 C-like pointer in Fortran. This is accomplished through a pair of 3064 variables: an integer "pointer" that holds a memory address, and a 3065 "pointee" that is used to dereference the pointer. 3066 3067 Pointer/pointee pairs are declared in statements of the form: 3068 pointer ( <pointer> , <pointee> ) 3069 or, 3070 pointer ( <pointer1> , <pointee1> ), ( <pointer2> , <pointee2> ), ... 3071 The pointer is an integer that is intended to hold a memory address. 3072 The pointee may be an array or scalar. If an assumed-size array is 3073 permitted within the scoping unit, a pointee can be an assumed-size 3074 array. That is, the last dimension may be left unspecified by using a 3075 '*' in place of a value. A pointee cannot be an assumed shape array. 3076 No space is allocated for the pointee. 3077 3078 The pointee may have its type declared before or after the pointer 3079 statement, and its array specification (if any) may be declared before, 3080 during, or after the pointer statement. The pointer may be declared as 3081 an integer prior to the pointer statement. However, some machines have 3082 default integer sizes that are different than the size of a pointer, and 3083 so the following code is not portable: 3084 integer ipt 3085 pointer (ipt, iarr) 3086 If a pointer is declared with a kind that is too small, the compiler 3087 will issue a warning; the resulting binary will probably not work 3088 correctly, because the memory addresses stored in the pointers may be 3089 truncated. It is safer to omit the first line of the above example; if 3090 explicit declaration of ipt's type is omitted, then the compiler will 3091 ensure that ipt is an integer variable large enough to hold a pointer. 3092 3093 Pointer arithmetic is valid with Cray pointers, but it is not the 3094 same as C pointer arithmetic. Cray pointers are just ordinary integers, 3095 so the user is responsible for determining how many bytes to add to a 3096 pointer in order to increment it. Consider the following example: 3097 real target(10) 3098 real pointee(10) 3099 pointer (ipt, pointee) 3100 ipt = loc (target) 3101 ipt = ipt + 1 3102 The last statement does not set 'ipt' to the address of 'target(1)', 3103 as it would in C pointer arithmetic. Adding '1' to 'ipt' just adds one 3104 byte to the address stored in 'ipt'. 3105 3106 Any expression involving the pointee will be translated to use the 3107 value stored in the pointer as the base address. 3108 3109 To get the address of elements, this extension provides an intrinsic 3110 function 'LOC()'. The 'LOC()' function is equivalent to the '&' 3111 operator in C, except the address is cast to an integer type: 3112 real ar(10) 3113 pointer(ipt, arpte(10)) 3114 real arpte 3115 ipt = loc(ar) ! Makes arpte is an alias for ar 3116 arpte(1) = 1.0 ! Sets ar(1) to 1.0 3117 The pointer can also be set by a call to the 'MALLOC' intrinsic (see 3118 *note MALLOC::). 3119 3120 Cray pointees often are used to alias an existing variable. For 3121 example: 3122 integer target(10) 3123 integer iarr(10) 3124 pointer (ipt, iarr) 3125 ipt = loc(target) 3126 As long as 'ipt' remains unchanged, 'iarr' is now an alias for 3127 'target'. The optimizer, however, will not detect this aliasing, so it 3128 is unsafe to use 'iarr' and 'target' simultaneously. Using a pointee in 3129 any way that violates the Fortran aliasing rules or assumptions is 3130 illegal. It is the user's responsibility to avoid doing this; the 3131 compiler works under the assumption that no such aliasing occurs. 3132 3133 Cray pointers will work correctly when there is no aliasing (i.e., 3134 when they are used to access a dynamically allocated block of memory), 3135 and also in any routine where a pointee is used, but any variable with 3136 which it shares storage is not used. Code that violates these rules may 3137 not run as the user intends. This is not a bug in the optimizer; any 3138 code that violates the aliasing rules is illegal. (Note that this is 3139 not unique to GNU Fortran; any Fortran compiler that supports Cray 3140 pointers will "incorrectly" optimize code with illegal aliasing.) 3141 3142 There are a number of restrictions on the attributes that can be 3143 applied to Cray pointers and pointees. Pointees may not have the 3144 'ALLOCATABLE', 'INTENT', 'OPTIONAL', 'DUMMY', 'TARGET', 'INTRINSIC', or 3145 'POINTER' attributes. Pointers may not have the 'DIMENSION', 'POINTER', 3146 'TARGET', 'ALLOCATABLE', 'EXTERNAL', or 'INTRINSIC' attributes, nor may 3147 they be function results. Pointees may not occur in more than one 3148 pointer statement. A pointee cannot be a pointer. Pointees cannot 3149 occur in equivalence, common, or data statements. 3150 3151 A Cray pointer may also point to a function or a subroutine. For 3152 example, the following excerpt is valid: 3153 implicit none 3154 external sub 3155 pointer (subptr,subpte) 3156 external subpte 3157 subptr = loc(sub) 3158 call subpte() 3159 [...] 3160 subroutine sub 3161 [...] 3162 end subroutine sub 3163 3164 A pointer may be modified during the course of a program, and this 3165 will change the location to which the pointee refers. However, when 3166 pointees are passed as arguments, they are treated as ordinary variables 3167 in the invoked function. Subsequent changes to the pointer will not 3168 change the base address of the array that was passed. 3169 3170 3171 File: gfortran.info, Node: CONVERT specifier, Next: OpenMP, Prev: Cray pointers, Up: Extensions implemented in GNU Fortran 3172 3173 5.1.17 'CONVERT' specifier 3174 -------------------------- 3175 3176 GNU Fortran allows the conversion of unformatted data between little- 3177 and big-endian representation to facilitate moving of data between 3178 different systems. The conversion can be indicated with the 'CONVERT' 3179 specifier on the 'OPEN' statement. *Note GFORTRAN_CONVERT_UNIT::, for 3180 an alternative way of specifying the data format via an environment 3181 variable. 3182 3183 Valid values for 'CONVERT' on most systems are: 3184 'CONVERT='NATIVE'' Use the native format. This is the default. 3185 'CONVERT='SWAP'' Swap between little- and big-endian. 3186 'CONVERT='LITTLE_ENDIAN'' Use the little-endian representation for 3187 unformatted files. 3188 'CONVERT='BIG_ENDIAN'' Use the big-endian representation for 3189 unformatted files. 3190 On POWER systems which support '-mabi=ieeelongdouble', there are 3191 additional options, which can be combined with the others with commas. 3192 Those are 3193 'CONVERT='R16_IEEE'' Use IEEE 128-bit format for 'REAL(KIND=16)'. 3194 'CONVERT='R16_IBM'' Use IBM 'long double' format for 3195 real'REAL(KIND=16)'. 3196 3197 Using the option could look like this: 3198 open(file='big.dat',form='unformatted',access='sequential', & 3199 convert='big_endian') 3200 3201 The value of the conversion can be queried by using 3202 'INQUIRE(CONVERT=ch)'. The values returned are ''BIG_ENDIAN'' and 3203 ''LITTLE_ENDIAN''. 3204 3205 'CONVERT' works between big- and little-endian for 'INTEGER' values 3206 of all supported kinds and for 'REAL' on IEEE systems of kinds 4 and 8. 3207 Conversion between different "extended double" types on different 3208 architectures such as m68k and x86_64, which GNU Fortran supports as 3209 'REAL(KIND=10)' and 'REAL(KIND=16)', will probably not work. 3210 3211 _Note that the values specified via the GFORTRAN_CONVERT_UNIT 3212 environment variable will override the CONVERT specifier in the open 3213 statement_. This is to give control over data formats to users who do 3214 not have the source code of their program available. 3215 3216 Using anything but the native representation for unformatted data 3217 carries a significant speed overhead. If speed in this area matters to 3218 you, it is best if you use this only for data that needs to be portable. 3219 3220 3221 File: gfortran.info, Node: OpenMP, Next: OpenACC, Prev: CONVERT specifier, Up: Extensions implemented in GNU Fortran 3222 3223 5.1.18 OpenMP 3224 ------------- 3225 3226 OpenMP (Open Multi-Processing) is an application programming interface 3227 (API) that supports multi-platform shared memory multiprocessing 3228 programming in C/C++ and Fortran on many architectures, including Unix 3229 and Microsoft Windows platforms. It consists of a set of compiler 3230 directives, library routines, and environment variables that influence 3231 run-time behavior. 3232 3233 GNU Fortran strives to be compatible to the OpenMP Application 3234 Program Interface v4.5 (https://openmp.org/wp/openmp-specifications/). 3235 3236 To enable the processing of the OpenMP directive '!$omp' in free-form 3237 source code; the 'c$omp', '*$omp' and '!$omp' directives in fixed form; 3238 the '!$' conditional compilation sentinels in free form; and the 'c$', 3239 '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be invoked 3240 with the '-fopenmp'. This also arranges for automatic linking of the 3241 GNU Offloading and Multi Processing Runtime Library *note libgomp: 3242 (libgomp)Top. 3243 3244 The OpenMP Fortran runtime library routines are provided both in a 3245 form of a Fortran 90 module named 'omp_lib' and in a form of a Fortran 3246 'include' file named 'omp_lib.h'. 3247 3248 An example of a parallelized loop taken from Appendix A.1 of the 3249 OpenMP Application Program Interface v2.5: 3250 SUBROUTINE A1(N, A, B) 3251 INTEGER I, N 3252 REAL B(N), A(N) 3253 !$OMP PARALLEL DO !I is private by default 3254 DO I=2,N 3255 B(I) = (A(I) + A(I-1)) / 2.0 3256 ENDDO 3257 !$OMP END PARALLEL DO 3258 END SUBROUTINE A1 3259 3260 Please note: 3261 * '-fopenmp' implies '-frecursive', i.e., all local arrays will be 3262 allocated on the stack. When porting existing code to OpenMP, this 3263 may lead to surprising results, especially to segmentation faults 3264 if the stacksize is limited. 3265 3266 * On glibc-based systems, OpenMP enabled applications cannot be 3267 statically linked due to limitations of the underlying 3268 pthreads-implementation. It might be possible to get a working 3269 solution if '-Wl,--whole-archive -lpthread -Wl,--no-whole-archive' 3270 is added to the command line. However, this is not supported by 3271 'gcc' and thus not recommended. 3272 3273 3274 File: gfortran.info, Node: OpenACC, Next: Argument list functions, Prev: OpenMP, Up: Extensions implemented in GNU Fortran 3275 3276 5.1.19 OpenACC 3277 -------------- 3278 3279 OpenACC is an application programming interface (API) that supports 3280 offloading of code to accelerator devices. It consists of a set of 3281 compiler directives, library routines, and environment variables that 3282 influence run-time behavior. 3283 3284 GNU Fortran strives to be compatible to the OpenACC Application 3285 Programming Interface v2.6 (https://www.openacc.org/). 3286 3287 To enable the processing of the OpenACC directive '!$acc' in 3288 free-form source code; the 'c$acc', '*$acc' and '!$acc' directives in 3289 fixed form; the '!$' conditional compilation sentinels in free form; and 3290 the 'c$', '*$' and '!$' sentinels in fixed form, 'gfortran' needs to be 3291 invoked with the '-fopenacc'. This also arranges for automatic linking 3292 of the GNU Offloading and Multi Processing Runtime Library *note 3293 libgomp: (libgomp)Top. 3294 3295 The OpenACC Fortran runtime library routines are provided both in a 3296 form of a Fortran 90 module named 'openacc' and in a form of a Fortran 3297 'include' file named 'openacc_lib.h'. 3298 3299 3300 File: gfortran.info, Node: Argument list functions, Next: Read/Write after EOF marker, Prev: OpenACC, Up: Extensions implemented in GNU Fortran 3301 3302 5.1.20 Argument list functions '%VAL', '%REF' and '%LOC' 3303 -------------------------------------------------------- 3304 3305 GNU Fortran supports argument list functions '%VAL', '%REF' and '%LOC' 3306 statements, for backward compatibility with g77. It is recommended that 3307 these should be used only for code that is accessing facilities outside 3308 of GNU Fortran, such as operating system or windowing facilities. It is 3309 best to constrain such uses to isolated portions of a program-portions 3310 that deal specifically and exclusively with low-level, system-dependent 3311 facilities. Such portions might well provide a portable interface for 3312 use by the program as a whole, but are themselves not portable, and 3313 should be thoroughly tested each time they are rebuilt using a new 3314 compiler or version of a compiler. 3315 3316 '%VAL' passes a scalar argument by value, '%REF' passes it by 3317 reference and '%LOC' passes its memory location. Since gfortran already 3318 passes scalar arguments by reference, '%REF' is in effect a do-nothing. 3319 '%LOC' has the same effect as a Fortran pointer. 3320 3321 An example of passing an argument by value to a C subroutine foo.: 3322 C 3323 C prototype void foo_ (float x); 3324 C 3325 external foo 3326 real*4 x 3327 x = 3.14159 3328 call foo (%VAL (x)) 3329 end 3330 3331 For details refer to the g77 manual 3332 <https://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/index.html#Top>. 3333 3334 Also, 'c_by_val.f' and its partner 'c_by_val.c' of the GNU Fortran 3335 testsuite are worth a look. 3336 3337 3338 File: gfortran.info, Node: Read/Write after EOF marker, Next: STRUCTURE and RECORD, Prev: Argument list functions, Up: Extensions implemented in GNU Fortran 3339 3340 5.1.21 Read/Write after EOF marker 3341 ---------------------------------- 3342 3343 Some legacy codes rely on allowing 'READ' or 'WRITE' after the EOF file 3344 marker in order to find the end of a file. GNU Fortran normally rejects 3345 these codes with a run-time error message and suggests the user consider 3346 'BACKSPACE' or 'REWIND' to properly position the file before the EOF 3347 marker. As an extension, the run-time error may be disabled using 3348 -std=legacy. 3349 3350 3351 File: gfortran.info, Node: STRUCTURE and RECORD, Next: UNION and MAP, Prev: Read/Write after EOF marker, Up: Extensions implemented in GNU Fortran 3352 3353 5.1.22 'STRUCTURE' and 'RECORD' 3354 ------------------------------- 3355 3356 Record structures are a pre-Fortran-90 vendor extension to create 3357 user-defined aggregate data types. Support for record structures in GNU 3358 Fortran can be enabled with the '-fdec-structure' compile flag. If you 3359 have a choice, you should instead use Fortran 90's "derived types", 3360 which have a different syntax. 3361 3362 In many cases, record structures can easily be converted to derived 3363 types. To convert, replace 'STRUCTURE /'STRUCTURE-NAME'/' by 'TYPE' 3364 TYPE-NAME. Additionally, replace 'RECORD /'STRUCTURE-NAME'/' by 3365 'TYPE('TYPE-NAME')'. Finally, in the component access, replace the 3366 period ('.') by the percent sign ('%'). 3367 3368 Here is an example of code using the non portable record structure 3369 syntax: 3370 3371 ! Declaring a structure named ``item'' and containing three fields: 3372 ! an integer ID, an description string and a floating-point price. 3373 STRUCTURE /item/ 3374 INTEGER id 3375 CHARACTER(LEN=200) description 3376 REAL price 3377 END STRUCTURE 3378 3379 ! Define two variables, an single record of type ``item'' 3380 ! named ``pear'', and an array of items named ``store_catalog'' 3381 RECORD /item/ pear, store_catalog(100) 3382 3383 ! We can directly access the fields of both variables 3384 pear.id = 92316 3385 pear.description = "juicy D'Anjou pear" 3386 pear.price = 0.15 3387 store_catalog(7).id = 7831 3388 store_catalog(7).description = "milk bottle" 3389 store_catalog(7).price = 1.2 3390 3391 ! We can also manipulate the whole structure 3392 store_catalog(12) = pear 3393 print *, store_catalog(12) 3394 3395 This code can easily be rewritten in the Fortran 90 syntax as following: 3396 3397 ! ``STRUCTURE /name/ ... END STRUCTURE'' becomes 3398 ! ``TYPE name ... END TYPE'' 3399 TYPE item 3400 INTEGER id 3401 CHARACTER(LEN=200) description 3402 REAL price 3403 END TYPE 3404 3405 ! ``RECORD /name/ variable'' becomes ``TYPE(name) variable'' 3406 TYPE(item) pear, store_catalog(100) 3407 3408 ! Instead of using a dot (.) to access fields of a record, the 3409 ! standard syntax uses a percent sign (%) 3410 pear%id = 92316 3411 pear%description = "juicy D'Anjou pear" 3412 pear%price = 0.15 3413 store_catalog(7)%id = 7831 3414 store_catalog(7)%description = "milk bottle" 3415 store_catalog(7)%price = 1.2 3416 3417 ! Assignments of a whole variable do not change 3418 store_catalog(12) = pear 3419 print *, store_catalog(12) 3420 3421 GNU Fortran implements STRUCTURES like derived types with the following 3422 rules and exceptions: 3423 3424 * Structures act like derived types with the 'SEQUENCE' attribute. 3425 Otherwise they may contain no specifiers. 3426 3427 * Structures may contain a special field with the name '%FILL'. This 3428 will create an anonymous component which cannot be accessed but 3429 occupies space just as if a component of the same type was declared 3430 in its place, useful for alignment purposes. As an example, the 3431 following structure will consist of at least sixteen bytes: 3432 3433 structure /padded/ 3434 character(4) start 3435 character(8) %FILL 3436 character(4) end 3437 end structure 3438 3439 * Structures may share names with other symbols. For example, the 3440 following is invalid for derived types, but valid for structures: 3441 3442 structure /header/ 3443 ! ... 3444 end structure 3445 record /header/ header 3446 3447 * Structure types may be declared nested within another parent 3448 structure. The syntax is: 3449 structure /type-name/ 3450 ... 3451 structure [/<type-name>/] <field-list> 3452 ... 3453 3454 The type name may be ommitted, in which case the structure type 3455 itself is anonymous, and other structures of the same type cannot 3456 be instantiated. The following shows some examples: 3457 3458 structure /appointment/ 3459 ! nested structure definition: app_time is an array of two 'time' 3460 structure /time/ app_time (2) 3461 integer(1) hour, minute 3462 end structure 3463 character(10) memo 3464 end structure 3465 3466 ! The 'time' structure is still usable 3467 record /time/ now 3468 now = time(5, 30) 3469 3470 ... 3471 3472 structure /appointment/ 3473 ! anonymous nested structure definition 3474 structure start, end 3475 integer(1) hour, minute 3476 end structure 3477 character(10) memo 3478 end structure 3479 3480 * Structures may contain 'UNION' blocks. For more detail see the 3481 section on *note UNION and MAP::. 3482 3483 * Structures support old-style initialization of components, like 3484 those described in *note Old-style variable initialization::. For 3485 array initializers, an initializer may contain a repeat 3486 specification of the form '<literal-integer> * 3487 <constant-initializer>'. The value of the integer indicates the 3488 number of times to repeat the constant initializer when expanding 3489 the initializer list. 3490 3491 3492 File: gfortran.info, Node: UNION and MAP, Next: Type variants for integer intrinsics, Prev: STRUCTURE and RECORD, Up: Extensions implemented in GNU Fortran 3493 3494 5.1.23 'UNION' and 'MAP' 3495 ------------------------ 3496 3497 Unions are an old vendor extension which were commonly used with the 3498 non-standard *note STRUCTURE and RECORD:: extensions. Use of 'UNION' 3499 and 'MAP' is automatically enabled with '-fdec-structure'. 3500 3501 A 'UNION' declaration occurs within a structure; within the 3502 definition of each union is a number of 'MAP' blocks. Each 'MAP' shares 3503 storage with its sibling maps (in the same union), and the size of the 3504 union is the size of the largest map within it, just as with unions in 3505 C. The major difference is that component references do not indicate 3506 which union or map the component is in (the compiler gets to figure that 3507 out). 3508 3509 Here is a small example: 3510 structure /myunion/ 3511 union 3512 map 3513 character(2) w0, w1, w2 3514 end map 3515 map 3516 character(6) long 3517 end map 3518 end union 3519 end structure 3520 3521 record /myunion/ rec 3522 ! After this assignment... 3523 rec.long = 'hello!' 3524 3525 ! The following is true: 3526 ! rec.w0 === 'he' 3527 ! rec.w1 === 'll' 3528 ! rec.w2 === 'o!' 3529 3530 The two maps share memory, and the size of the union is ultimately 3531 six bytes: 3532 3533 0 1 2 3 4 5 6 Byte offset 3534 ------------------------------- 3535 | | | | | | | 3536 ------------------------------- 3537 3538 ^ W0 ^ W1 ^ W2 ^ 3539 \-------/ \-------/ \-------/ 3540 3541 ^ LONG ^ 3542 \---------------------------/ 3543 3544 Following is an example mirroring the layout of an Intel x86_64 3545 register: 3546 3547 structure /reg/ 3548 union ! U0 ! rax 3549 map 3550 character(16) rx 3551 end map 3552 map 3553 character(8) rh ! rah 3554 union ! U1 3555 map 3556 character(8) rl ! ral 3557 end map 3558 map 3559 character(8) ex ! eax 3560 end map 3561 map 3562 character(4) eh ! eah 3563 union ! U2 3564 map 3565 character(4) el ! eal 3566 end map 3567 map 3568 character(4) x ! ax 3569 end map 3570 map 3571 character(2) h ! ah 3572 character(2) l ! al 3573 end map 3574 end union 3575 end map 3576 end union 3577 end map 3578 end union 3579 end structure 3580 record /reg/ a 3581 3582 ! After this assignment... 3583 a.rx = 'AAAAAAAA.BBB.C.D' 3584 3585 ! The following is true: 3586 a.rx === 'AAAAAAAA.BBB.C.D' 3587 a.rh === 'AAAAAAAA' 3588 a.rl === '.BBB.C.D' 3589 a.ex === '.BBB.C.D' 3590 a.eh === '.BBB' 3591 a.el === '.C.D' 3592 a.x === '.C.D' 3593 a.h === '.C' 3594 a.l === '.D' 3595 3596 3597 File: gfortran.info, Node: Type variants for integer intrinsics, Next: AUTOMATIC and STATIC attributes, Prev: UNION and MAP, Up: Extensions implemented in GNU Fortran 3598 3599 5.1.24 Type variants for integer intrinsics 3600 ------------------------------------------- 3601 3602 Similar to the D/C prefixes to real functions to specify the 3603 input/output types, GNU Fortran offers B/I/J/K prefixes to integer 3604 functions for compatibility with DEC programs. The types implied by 3605 each are: 3606 3607 B - INTEGER(kind=1) 3608 I - INTEGER(kind=2) 3609 J - INTEGER(kind=4) 3610 K - INTEGER(kind=8) 3611 3612 GNU Fortran supports these with the flag '-fdec-intrinsic-ints'. 3613 Intrinsics for which prefixed versions are available and in what form 3614 are noted in *note Intrinsic Procedures::. The complete list of 3615 supported intrinsics is here: 3616 3617 Intrinsic B I J K 3618 3619 --------------------------------------------------------------------------- 3620 '*note ABS::' 'BABS' 'IIABS' 'JIABS' 'KIABS' 3621 '*note BTEST::''BBTEST' 'BITEST' 'BJTEST' 'BKTEST' 3622 '*note IAND::' 'BIAND' 'IIAND' 'JIAND' 'KIAND' 3623 '*note IBCLR::''BBCLR' 'IIBCLR' 'JIBCLR' 'KIBCLR' 3624 '*note IBITS::''BBITS' 'IIBITS' 'JIBITS' 'KIBITS' 3625 '*note IBSET::''BBSET' 'IIBSET' 'JIBSET' 'KIBSET' 3626 '*note IEOR::' 'BIEOR' 'IIEOR' 'JIEOR' 'KIEOR' 3627 '*note IOR::' 'BIOR' 'IIOR' 'JIOR' 'KIOR' 3628 '*note ISHFT::''BSHFT' 'IISHFT' 'JISHFT' 'KISHFT' 3629 '*note ISHFTC::''BSHFTC' 'IISHFTC' 'JISHFTC' 'KISHFTC' 3630 '*note MOD::' 'BMOD' 'IMOD' 'JMOD' 'KMOD' 3631 '*note NOT::' 'BNOT' 'INOT' 'JNOT' 'KNOT' 3632 '*note REAL::' '--' 'FLOATI' 'FLOATJ' 'FLOATK' 3633 3634 3635 File: gfortran.info, Node: AUTOMATIC and STATIC attributes, Next: Extended math intrinsics, Prev: Type variants for integer intrinsics, Up: Extensions implemented in GNU Fortran 3636 3637 5.1.25 'AUTOMATIC' and 'STATIC' attributes 3638 ------------------------------------------ 3639 3640 With '-fdec-static' GNU Fortran supports the DEC extended attributes 3641 'STATIC' and 'AUTOMATIC' to provide explicit specification of entity 3642 storage. These follow the syntax of the Fortran standard 'SAVE' 3643 attribute. 3644 3645 'STATIC' is exactly equivalent to 'SAVE', and specifies that an 3646 entity should be allocated in static memory. As an example, 'STATIC' 3647 local variables will retain their values across multiple calls to a 3648 function. 3649 3650 Entities marked 'AUTOMATIC' will be stack automatic whenever 3651 possible. 'AUTOMATIC' is the default for local variables smaller than 3652 '-fmax-stack-var-size', unless '-fno-automatic' is given. This 3653 attribute overrides '-fno-automatic', '-fmax-stack-var-size', and 3654 blanket 'SAVE' statements. 3655 3656 Examples: 3657 3658 subroutine f 3659 integer, automatic :: i ! automatic variable 3660 integer x, y ! static variables 3661 save 3662 ... 3663 endsubroutine 3664 subroutine f 3665 integer a, b, c, x, y, z 3666 static :: x 3667 save y 3668 automatic z, c 3669 ! a, b, c, and z are automatic 3670 ! x and y are static 3671 endsubroutine 3672 ! Compiled with -fno-automatic 3673 subroutine f 3674 integer a, b, c, d 3675 automatic :: a 3676 ! a is automatic; b, c, and d are static 3677 endsubroutine 3678 3679 3680 File: gfortran.info, Node: Extended math intrinsics, Next: Form feed as whitespace, Prev: AUTOMATIC and STATIC attributes, Up: Extensions implemented in GNU Fortran 3681 3682 5.1.26 Extended math intrinsics 3683 ------------------------------- 3684 3685 GNU Fortran supports an extended list of mathematical intrinsics with 3686 the compile flag '-fdec-math' for compatability with legacy code. These 3687 intrinsics are described fully in *note Intrinsic Procedures:: where it 3688 is noted that they are extensions and should be avoided whenever 3689 possible. 3690 3691 Specifically, '-fdec-math' enables the *note COTAN:: intrinsic, and 3692 trigonometric intrinsics which accept or produce values in degrees 3693 instead of radians. Here is a summary of the new intrinsics: 3694 3695 Radians Degrees 3696 -------------------------------------------------------------------------- 3697 '*note ACOS::' '*note ACOSD::'* 3698 '*note ASIN::' '*note ASIND::'* 3699 '*note ATAN::' '*note ATAND::'* 3700 '*note ATAN2::' '*note ATAN2D::'* 3701 '*note COS::' '*note COSD::'* 3702 '*note COTAN::'* '*note COTAND::'* 3703 '*note SIN::' '*note SIND::'* 3704 '*note TAN::' '*note TAND::'* 3705 3706 * Enabled with '-fdec-math'. 3707 3708 For advanced users, it may be important to know the implementation of 3709 these functions. They are simply wrappers around the standard radian 3710 functions, which have more accurate builtin versions. These functions 3711 convert their arguments (or results) to degrees (or radians) by taking 3712 the value modulus 360 (or 2*pi) and then multiplying it by a constant 3713 radian-to-degree (or degree-to-radian) factor, as appropriate. The 3714 factor is computed at compile-time as 180/pi (or pi/180). 3715 3716 3717 File: gfortran.info, Node: Form feed as whitespace, Next: TYPE as an alias for PRINT, Prev: Extended math intrinsics, Up: Extensions implemented in GNU Fortran 3718 3719 5.1.27 Form feed as whitespace 3720 ------------------------------ 3721 3722 Historically, legacy compilers allowed insertion of form feed characters 3723 ('\f', ASCII 0xC) at the beginning of lines for formatted output to line 3724 printers, though the Fortran standard does not mention this. GNU 3725 Fortran supports the interpretation of form feed characters in source as 3726 whitespace for compatibility. 3727 3728 3729 File: 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 3730 3731 5.1.28 TYPE as an alias for PRINT 3732 --------------------------------- 3733 3734 For compatibility, GNU Fortran will interpret 'TYPE' statements as 3735 'PRINT' statements with the flag '-fdec'. With this flag asserted, the 3736 following two examples are equivalent: 3737 3738 TYPE *, 'hello world' 3739 3740 PRINT *, 'hello world' 3741 3742 3743 File: gfortran.info, Node: %LOC as an rvalue, Next: .XOR. operator, Prev: TYPE as an alias for PRINT, Up: Extensions implemented in GNU Fortran 3744 3745 5.1.29 %LOC as an rvalue 3746 ------------------------ 3747 3748 Normally '%LOC' is allowed only in parameter lists. However the 3749 intrinsic function 'LOC' does the same thing, and is usable as the 3750 right-hand-side of assignments. For compatibility, GNU Fortran supports 3751 the use of '%LOC' as an alias for the builtin 'LOC' with '-std=legacy'. 3752 With this feature enabled the following two examples are equivalent: 3753 3754 integer :: i, l 3755 l = %loc(i) 3756 call sub(l) 3757 3758 integer :: i 3759 call sub(%loc(i)) 3760 3761 3762 File: gfortran.info, Node: .XOR. operator, Next: Bitwise logical operators, Prev: %LOC as an rvalue, Up: Extensions implemented in GNU Fortran 3763 3764 5.1.30 .XOR. operator 3765 --------------------- 3766 3767 GNU Fortran supports '.XOR.' as a logical operator with '-std=legacy' 3768 for compatibility with legacy code. '.XOR.' is equivalent to '.NEQV.'. 3769 That is, the output is true if and only if the inputs differ. 3770 3771 3772 File: gfortran.info, Node: Bitwise logical operators, Next: Extended I/O specifiers, Prev: .XOR. operator, Up: Extensions implemented in GNU Fortran 3773 3774 5.1.31 Bitwise logical operators 3775 -------------------------------- 3776 3777 With '-fdec', GNU Fortran relaxes the type constraints on logical 3778 operators to allow integer operands, and performs the corresponding 3779 bitwise operation instead. This flag is for compatibility only, and 3780 should be avoided in new code. Consider: 3781 3782 INTEGER :: i, j 3783 i = z'33' 3784 j = z'cc' 3785 print *, i .AND. j 3786 3787 In this example, compiled with '-fdec', GNU Fortran will replace the 3788 '.AND.' operation with a call to the intrinsic '*note IAND::' function, 3789 yielding the bitwise-and of 'i' and 'j'. 3790 3791 Note that this conversion will occur if at least one operand is of 3792 integral type. As a result, a logical operand will be converted to an 3793 integer when the other operand is an integer in a logical operation. In 3794 this case, '.TRUE.' is converted to '1' and '.FALSE.' to '0'. 3795 3796 Here is the mapping of logical operator to bitwise intrinsic used 3797 with '-fdec': 3798 3799 Operator Intrinsic Bitwise operation 3800 --------------------------------------------------------------------------- 3801 '.NOT.' '*note NOT::' complement 3802 '.AND.' '*note IAND::' intersection 3803 '.OR.' '*note IOR::' union 3804 '.NEQV.' '*note IEOR::' exclusive or 3805 '.EQV.' '*note NOT::(*note IEOR::)'complement of exclusive or 3806 3807 3808 File: gfortran.info, Node: Extended I/O specifiers, Next: Legacy PARAMETER statements, Prev: Bitwise logical operators, Up: Extensions implemented in GNU Fortran 3809 3810 5.1.32 Extended I/O specifiers 3811 ------------------------------ 3812 3813 GNU Fortran supports the additional legacy I/O specifiers 3814 'CARRIAGECONTROL', 'READONLY', and 'SHARE' with the compile flag 3815 '-fdec', for compatibility. 3816 3817 'CARRIAGECONTROL' 3818 The 'CARRIAGECONTROL' specifier allows a user to control line 3819 termination settings between output records for an I/O unit. The 3820 specifier has no meaning for readonly files. When 3821 'CARRAIGECONTROL' is specified upon opening a unit for formatted 3822 writing, the exact 'CARRIAGECONTROL' setting determines what 3823 characters to write between output records. The syntax is: 3824 3825 OPEN(..., CARRIAGECONTROL=cc) 3826 3827 Where _cc_ is a character expression that evaluates to one of the 3828 following values: 3829 3830 ''LIST'' One line feed between records (default) 3831 ''FORTRAN'' Legacy interpretation of the first character (see below) 3832 ''NONE'' No separator between records 3833 3834 With 'CARRIAGECONTROL='FORTRAN'', when a record is written, the 3835 first character of the input record is not written, and instead 3836 determines the output record separator as follows: 3837 3838 Leading character Meaning Output separating 3839 character(s) 3840 ---------------------------------------------------------------------------- 3841 ''+'' Overprinting Carriage return only 3842 ''-'' New line Line feed and carriage 3843 return 3844 ''0'' Skip line Two line feeds and carriage 3845 return 3846 ''1'' New page Form feed and carriage 3847 return 3848 ''$'' Prompting Line feed (no carriage 3849 return) 3850 'CHAR(0)' Overprinting (no None 3851 advance) 3852 3853 'READONLY' 3854 The 'READONLY' specifier may be given upon opening a unit, and is 3855 equivalent to specifying 'ACTION='READ'', except that the file may 3856 not be deleted on close (i.e. 'CLOSE' with 'STATUS="DELETE"'). 3857 The syntax is: 3858 3859 OPEN(..., READONLY) 3860 3861 'SHARE' 3862 The 'SHARE' specifier allows system-level locking on a unit upon 3863 opening it for controlled access from multiple processes/threads. 3864 The 'SHARE' specifier has several forms: 3865 3866 OPEN(..., SHARE=sh) 3867 OPEN(..., SHARED) 3868 OPEN(..., NOSHARED) 3869 3870 Where _sh_ in the first form is a character expression that 3871 evaluates to a value as seen in the table below. The latter two 3872 forms are aliases for particular values of _sh_: 3873 3874 Explicit form Short form Meaning 3875 ---------------------------------------------------------------------------- 3876 'SHARE='DENYRW'' 'NOSHARED' Exclusive (write) lock 3877 'SHARE='DENYNONE'' 'SHARED' Shared (read) lock 3878 3879 In general only one process may hold an exclusive (write) lock for 3880 a given file at a time, whereas many processes may hold shared 3881 (read) locks for the same file. 3882 3883 The behavior of locking may vary with your operating system. On 3884 POSIX systems, locking is implemented with 'fcntl'. Consult your 3885 corresponding operating system's manual pages for further details. 3886 Locking via 'SHARE=' is not supported on other systems. 3887 3888 3889 File: gfortran.info, Node: Legacy PARAMETER statements, Next: Default exponents, Prev: Extended I/O specifiers, Up: Extensions implemented in GNU Fortran 3890 3891 5.1.33 Legacy PARAMETER statements 3892 ---------------------------------- 3893 3894 For compatibility, GNU Fortran supports legacy PARAMETER statements 3895 without parentheses with '-std=legacy'. A warning is emitted if used 3896 with '-std=gnu', and an error is acknowledged with a real Fortran 3897 standard flag ('-std=f95', etc...). These statements take the following 3898 form: 3899 3900 implicit real (E) 3901 parameter e = 2.718282 3902 real c 3903 parameter c = 3.0e8 3904 3905 3906 File: gfortran.info, Node: Default exponents, Prev: Legacy PARAMETER statements, Up: Extensions implemented in GNU Fortran 3907 3908 5.1.34 Default exponents 3909 ------------------------ 3910 3911 For compatibility, GNU Fortran supports a default exponent of zero in 3912 real constants with '-fdec'. For example, '9e' would be interpreted as 3913 '9e0', rather than an error. 3914 3915 3916 File: gfortran.info, Node: Extensions not implemented in GNU Fortran, Prev: Extensions implemented in GNU Fortran, Up: Extensions 3917 3918 5.2 Extensions not implemented in GNU Fortran 3919 ============================================= 3920 3921 The long history of the Fortran language, its wide use and broad 3922 userbase, the large number of different compiler vendors and the lack of 3923 some features crucial to users in the first standards have lead to the 3924 existence of a number of important extensions to the language. While 3925 some of the most useful or popular extensions are supported by the GNU 3926 Fortran compiler, not all existing extensions are supported. This 3927 section aims at listing these extensions and offering advice on how best 3928 make code that uses them running with the GNU Fortran compiler. 3929 3930 * Menu: 3931 3932 * ENCODE and DECODE statements:: 3933 * Variable FORMAT expressions:: 3934 * Alternate complex function syntax:: 3935 * Volatile COMMON blocks:: 3936 * OPEN( ... NAME=):: 3937 * Q edit descriptor:: 3938 3939 3940 File: gfortran.info, Node: ENCODE and DECODE statements, Next: Variable FORMAT expressions, Up: Extensions not implemented in GNU Fortran 3941 3942 5.2.1 'ENCODE' and 'DECODE' statements 3943 -------------------------------------- 3944 3945 GNU Fortran does not support the 'ENCODE' and 'DECODE' statements. 3946 These statements are best replaced by 'READ' and 'WRITE' statements 3947 involving internal files ('CHARACTER' variables and arrays), which have 3948 been part of the Fortran standard since Fortran 77. For example, 3949 replace a code fragment like 3950 3951 INTEGER*1 LINE(80) 3952 REAL A, B, C 3953 c ... Code that sets LINE 3954 DECODE (80, 9000, LINE) A, B, C 3955 9000 FORMAT (1X, 3(F10.5)) 3956 3957 with the following: 3958 3959 CHARACTER(LEN=80) LINE 3960 REAL A, B, C 3961 c ... Code that sets LINE 3962 READ (UNIT=LINE, FMT=9000) A, B, C 3963 9000 FORMAT (1X, 3(F10.5)) 3964 3965 Similarly, replace a code fragment like 3966 3967 INTEGER*1 LINE(80) 3968 REAL A, B, C 3969 c ... Code that sets A, B and C 3970 ENCODE (80, 9000, LINE) A, B, C 3971 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5)) 3972 3973 with the following: 3974 3975 CHARACTER(LEN=80) LINE 3976 REAL A, B, C 3977 c ... Code that sets A, B and C 3978 WRITE (UNIT=LINE, FMT=9000) A, B, C 3979 9000 FORMAT (1X, 'OUTPUT IS ', 3(F10.5)) 3980 3981 3982 File: gfortran.info, Node: Variable FORMAT expressions, Next: Alternate complex function syntax, Prev: ENCODE and DECODE statements, Up: Extensions not implemented in GNU Fortran 3983 3984 5.2.2 Variable 'FORMAT' expressions 3985 ----------------------------------- 3986 3987 A variable 'FORMAT' expression is format statement which includes angle 3988 brackets enclosing a Fortran expression: 'FORMAT(I<N>)'. GNU Fortran 3989 does not support this legacy extension. The effect of variable format 3990 expressions can be reproduced by using the more powerful (and standard) 3991 combination of internal output and string formats. For example, replace 3992 a code fragment like this: 3993 3994 WRITE(6,20) INT1 3995 20 FORMAT(I<N+1>) 3996 3997 with the following: 3998 3999 c Variable declaration 4000 CHARACTER(LEN=20) FMT 4001 c 4002 c Other code here... 4003 c 4004 WRITE(FMT,'("(I", I0, ")")') N+1 4005 WRITE(6,FMT) INT1 4006 4007 or with: 4008 4009 c Variable declaration 4010 CHARACTER(LEN=20) FMT 4011 c 4012 c Other code here... 4013 c 4014 WRITE(FMT,*) N+1 4015 WRITE(6,"(I" // ADJUSTL(FMT) // ")") INT1 4016 4017 4018 File: gfortran.info, Node: Alternate complex function syntax, Next: Volatile COMMON blocks, Prev: Variable FORMAT expressions, Up: Extensions not implemented in GNU Fortran 4019 4020 5.2.3 Alternate complex function syntax 4021 --------------------------------------- 4022 4023 Some Fortran compilers, including 'g77', let the user declare complex 4024 functions with the syntax 'COMPLEX FUNCTION name*16()', as well as 4025 'COMPLEX*16 FUNCTION name()'. Both are non-standard, legacy extensions. 4026 'gfortran' accepts the latter form, which is more common, but not the 4027 former. 4028 4029 4030 File: gfortran.info, Node: Volatile COMMON blocks, Next: OPEN( ... NAME=), Prev: Alternate complex function syntax, Up: Extensions not implemented in GNU Fortran 4031 4032 5.2.4 Volatile 'COMMON' blocks 4033 ------------------------------ 4034 4035 Some Fortran compilers, including 'g77', let the user declare 'COMMON' 4036 with the 'VOLATILE' attribute. This is invalid standard Fortran syntax 4037 and is not supported by 'gfortran'. Note that 'gfortran' accepts 4038 'VOLATILE' variables in 'COMMON' blocks since revision 4.3. 4039 4040 4041 File: gfortran.info, Node: OPEN( ... NAME=), Next: Q edit descriptor, Prev: Volatile COMMON blocks, Up: Extensions not implemented in GNU Fortran 4042 4043 5.2.5 'OPEN( ... NAME=)' 4044 ------------------------ 4045 4046 Some Fortran compilers, including 'g77', let the user declare 'OPEN( ... 4047 NAME=)'. This is invalid standard Fortran syntax and is not supported 4048 by 'gfortran'. 'OPEN( ... NAME=)' should be replaced with 'OPEN( ... 4049 FILE=)'. 4050 4051 4052 File: gfortran.info, Node: Q edit descriptor, Prev: OPEN( ... NAME=), Up: Extensions not implemented in GNU Fortran 4053 4054 5.2.6 'Q' edit descriptor 4055 ------------------------- 4056 4057 Some Fortran compilers provide the 'Q' edit descriptor, which transfers 4058 the number of characters left within an input record into an integer 4059 variable. 4060 4061 A direct replacement of the 'Q' edit descriptor is not available in 4062 'gfortran'. How to replicate its functionality using 4063 standard-conforming code depends on what the intent of the original code 4064 is. 4065 4066 Options to replace 'Q' may be to read the whole line into a character 4067 variable and then counting the number of non-blank characters left using 4068 'LEN_TRIM'. Another method may be to use formatted stream, read the 4069 data up to the position where the 'Q' descriptor occurred, use 'INQUIRE' 4070 to get the file position, count the characters up to the next 'NEW_LINE' 4071 and then start reading from the position marked previously. 4072 4073 4074 File: gfortran.info, Node: Mixed-Language Programming, Next: Coarray Programming, Prev: Extensions, Up: Top 4075 4076 6 Mixed-Language Programming 4077 **************************** 4078 4079 * Menu: 4080 4081 * Interoperability with C:: 4082 * GNU Fortran Compiler Directives:: 4083 * Non-Fortran Main Program:: 4084 * Naming and argument-passing conventions:: 4085 4086 This chapter is about mixed-language interoperability, but also applies 4087 if you link Fortran code compiled by different compilers. In most 4088 cases, use of the C Binding features of the Fortran 2003 and later 4089 standards is sufficient. 4090 4091 For example, it is possible to mix Fortran code with C++ code as well 4092 as C, if you declare the interface functions as 'extern "C"' on the C++ 4093 side and 'BIND(C)' on the Fortran side, and follow the rules for 4094 interoperability with C. Note that you cannot manipulate C++ class 4095 objects in Fortran or vice versa except as opaque pointers. 4096 4097 You can use the 'gfortran' command to link both Fortran and 4098 non-Fortran code into the same program, or you can use 'gcc' or 'g++' if 4099 you also add an explicit '-lgfortran' option to link with the Fortran 4100 library. If your main program is written in C or some other language 4101 instead of Fortran, see *note Non-Fortran Main Program::, below. 4102 4103 4104 File: gfortran.info, Node: Interoperability with C, Next: GNU Fortran Compiler Directives, Up: Mixed-Language Programming 4105 4106 6.1 Interoperability with C 4107 =========================== 4108 4109 * Menu: 4110 4111 * Intrinsic Types:: 4112 * Derived Types and struct:: 4113 * Interoperable Global Variables:: 4114 * Interoperable Subroutines and Functions:: 4115 * Working with C Pointers:: 4116 * Further Interoperability of Fortran with C:: 4117 4118 Since Fortran 2003 (ISO/IEC 1539-1:2004(E)) there is a standardized way 4119 to generate procedure and derived-type declarations and global variables 4120 that are interoperable with C (ISO/IEC 9899:1999). The 'BIND(C)' 4121 attribute has been added to inform the compiler that a symbol shall be 4122 interoperable with C; also, some constraints are added. Note, however, 4123 that not all C features have a Fortran equivalent or vice versa. For 4124 instance, neither C's unsigned integers nor C's functions with variable 4125 number of arguments have an equivalent in Fortran. 4126 4127 Note that array dimensions are reversely ordered in C and that arrays 4128 in C always start with index 0 while in Fortran they start by default 4129 with 1. Thus, an array declaration 'A(n,m)' in Fortran matches 4130 'A[m][n]' in C and accessing the element 'A(i,j)' matches 'A[j-1][i-1]'. 4131 The element following 'A(i,j)' (C: 'A[j-1][i-1]'; assuming i < n) in 4132 memory is 'A(i+1,j)' (C: 'A[j-1][i]'). 4133 4134 4135 File: gfortran.info, Node: Intrinsic Types, Next: Derived Types and struct, Up: Interoperability with C 4136 4137 6.1.1 Intrinsic Types 4138 --------------------- 4139 4140 In order to ensure that exactly the same variable type and kind is used 4141 in C and Fortran, you should use the named constants for kind parameters 4142 that are defined in the 'ISO_C_BINDING' intrinsic module. That module 4143 contains named constants of character type representing the escaped 4144 special characters in C, such as newline. For a list of the constants, 4145 see *note ISO_C_BINDING::. 4146 4147 For logical types, please note that the Fortran standard only 4148 guarantees interoperability between C99's '_Bool' and Fortran's 4149 'C_Bool'-kind logicals and C99 defines that 'true' has the value 1 and 4150 'false' the value 0. Using any other integer value with GNU Fortran's 4151 'LOGICAL' (with any kind parameter) gives an undefined result. (Passing 4152 other integer values than 0 and 1 to GCC's '_Bool' is also undefined, 4153 unless the integer is explicitly or implicitly casted to '_Bool'.) 4154 4155 4156 File: gfortran.info, Node: Derived Types and struct, Next: Interoperable Global Variables, Prev: Intrinsic Types, Up: Interoperability with C 4157 4158 6.1.2 Derived Types and struct 4159 ------------------------------ 4160 4161 For compatibility of derived types with 'struct', use the 'BIND(C)' 4162 attribute in the type declaration. For instance, the following type 4163 declaration 4164 4165 USE ISO_C_BINDING 4166 TYPE, BIND(C) :: myType 4167 INTEGER(C_INT) :: i1, i2 4168 INTEGER(C_SIGNED_CHAR) :: i3 4169 REAL(C_DOUBLE) :: d1 4170 COMPLEX(C_FLOAT_COMPLEX) :: c1 4171 CHARACTER(KIND=C_CHAR) :: str(5) 4172 END TYPE 4173 4174 matches the following 'struct' declaration in C 4175 4176 struct { 4177 int i1, i2; 4178 /* Note: "char" might be signed or unsigned. */ 4179 signed char i3; 4180 double d1; 4181 float _Complex c1; 4182 char str[5]; 4183 } myType; 4184 4185 Derived types with the C binding attribute shall not have the 4186 'sequence' attribute, type parameters, the 'extends' attribute, nor 4187 type-bound procedures. Every component must be of interoperable type 4188 and kind and may not have the 'pointer' or 'allocatable' attribute. The 4189 names of the components are irrelevant for interoperability. 4190 4191 As there exist no direct Fortran equivalents, neither unions nor 4192 structs with bit field or variable-length array members are 4193 interoperable. 4194 4195 4196 File: gfortran.info, Node: Interoperable Global Variables, Next: Interoperable Subroutines and Functions, Prev: Derived Types and struct, Up: Interoperability with C 4197 4198 6.1.3 Interoperable Global Variables 4199 ------------------------------------ 4200 4201 Variables can be made accessible from C using the C binding attribute, 4202 optionally together with specifying a binding name. Those variables 4203 have to be declared in the declaration part of a 'MODULE', be of 4204 interoperable type, and have neither the 'pointer' nor the 'allocatable' 4205 attribute. 4206 4207 MODULE m 4208 USE myType_module 4209 USE ISO_C_BINDING 4210 integer(C_INT), bind(C, name="_MyProject_flags") :: global_flag 4211 type(myType), bind(C) :: tp 4212 END MODULE 4213 4214 Here, '_MyProject_flags' is the case-sensitive name of the variable 4215 as seen from C programs while 'global_flag' is the case-insensitive name 4216 as seen from Fortran. If no binding name is specified, as for TP, the C 4217 binding name is the (lowercase) Fortran binding name. If a binding name 4218 is specified, only a single variable may be after the double colon. 4219 Note of warning: You cannot use a global variable to access ERRNO of the 4220 C library as the C standard allows it to be a macro. Use the 'IERRNO' 4221 intrinsic (GNU extension) instead. 4222 4223 4224 File: gfortran.info, Node: Interoperable Subroutines and Functions, Next: Working with C Pointers, Prev: Interoperable Global Variables, Up: Interoperability with C 4225 4226 6.1.4 Interoperable Subroutines and Functions 4227 --------------------------------------------- 4228 4229 Subroutines and functions have to have the 'BIND(C)' attribute to be 4230 compatible with C. The dummy argument declaration is relatively 4231 straightforward. However, one needs to be careful because C uses 4232 call-by-value by default while Fortran behaves usually similar to 4233 call-by-reference. Furthermore, strings and pointers are handled 4234 differently. 4235 4236 To pass a variable by value, use the 'VALUE' attribute. Thus, the 4237 following C prototype 4238 4239 int func(int i, int *j) 4240 4241 matches the Fortran declaration 4242 4243 integer(c_int) function func(i,j) 4244 use iso_c_binding, only: c_int 4245 integer(c_int), VALUE :: i 4246 integer(c_int) :: j 4247 4248 Note that pointer arguments also frequently need the 'VALUE' 4249 attribute, see *note Working with C Pointers::. 4250 4251 Strings are handled quite differently in C and Fortran. In C a 4252 string is a 'NUL'-terminated array of characters while in Fortran each 4253 string has a length associated with it and is thus not terminated (by 4254 e.g. 'NUL'). For example, if you want to use the following C function, 4255 4256 #include <stdio.h> 4257 void print_C(char *string) /* equivalent: char string[] */ 4258 { 4259 printf("%s\n", string); 4260 } 4261 4262 to print "Hello World" from Fortran, you can call it using 4263 4264 use iso_c_binding, only: C_CHAR, C_NULL_CHAR 4265 interface 4266 subroutine print_c(string) bind(C, name="print_C") 4267 use iso_c_binding, only: c_char 4268 character(kind=c_char) :: string(*) 4269 end subroutine print_c 4270 end interface 4271 call print_c(C_CHAR_"Hello World"//C_NULL_CHAR) 4272 4273 As the example shows, you need to ensure that the string is 'NUL' 4274 terminated. Additionally, the dummy argument STRING of 'print_C' is a 4275 length-one assumed-size array; using 'character(len=*)' is not allowed. 4276 The example above uses 'c_char_"Hello World"' to ensure the string 4277 literal has the right type; typically the default character kind and 4278 'c_char' are the same and thus '"Hello World"' is equivalent. However, 4279 the standard does not guarantee this. 4280 4281 The use of strings is now further illustrated using the C library 4282 function 'strncpy', whose prototype is 4283 4284 char *strncpy(char *restrict s1, const char *restrict s2, size_t n); 4285 4286 The function 'strncpy' copies at most N characters from string S2 to S1 4287 and returns S1. In the following example, we ignore the return value: 4288 4289 use iso_c_binding 4290 implicit none 4291 character(len=30) :: str,str2 4292 interface 4293 ! Ignore the return value of strncpy -> subroutine 4294 ! "restrict" is always assumed if we do not pass a pointer 4295 subroutine strncpy(dest, src, n) bind(C) 4296 import 4297 character(kind=c_char), intent(out) :: dest(*) 4298 character(kind=c_char), intent(in) :: src(*) 4299 integer(c_size_t), value, intent(in) :: n 4300 end subroutine strncpy 4301 end interface 4302 str = repeat('X',30) ! Initialize whole string with 'X' 4303 call strncpy(str, c_char_"Hello World"//C_NULL_CHAR, & 4304 len(c_char_"Hello World",kind=c_size_t)) 4305 print '(a)', str ! prints: "Hello WorldXXXXXXXXXXXXXXXXXXX" 4306 end 4307 4308 The intrinsic procedures are described in *note Intrinsic 4309 Procedures::. 4310 4311 4312 File: gfortran.info, Node: Working with C Pointers, Next: Further Interoperability of Fortran with C, Prev: Interoperable Subroutines and Functions, Up: Interoperability with C 4313 4314 6.1.5 Working with C Pointers 4315 ----------------------------- 4316 4317 C pointers are represented in Fortran via the special opaque derived 4318 type 'type(c_ptr)' (with private components). C pointers are distinct 4319 from Fortran objects with the 'POINTER' attribute. Thus one needs to 4320 use intrinsic conversion procedures to convert from or to C pointers. 4321 For some applications, using an assumed type ('TYPE(*)') can be an 4322 alternative to a C pointer, and you can also use library routines to 4323 access Fortran pointers from C. See *note Further Interoperability of 4324 Fortran with C::. 4325 4326 Here is an example of using C pointers in Fortran: 4327 4328 use iso_c_binding 4329 type(c_ptr) :: cptr1, cptr2 4330 integer, target :: array(7), scalar 4331 integer, pointer :: pa(:), ps 4332 cptr1 = c_loc(array(1)) ! The programmer needs to ensure that the 4333 ! array is contiguous if required by the C 4334 ! procedure 4335 cptr2 = c_loc(scalar) 4336 call c_f_pointer(cptr2, ps) 4337 call c_f_pointer(cptr2, pa, shape=[7]) 4338 4339 When converting C to Fortran arrays, the one-dimensional 'SHAPE' 4340 argument has to be passed. 4341 4342 If a pointer is a dummy argument of an interoperable procedure, it 4343 usually has to be declared using the 'VALUE' attribute. 'void*' matches 4344 'TYPE(C_PTR), VALUE', while 'TYPE(C_PTR)' alone matches 'void**'. 4345 4346 Procedure pointers are handled analogously to pointers; the C type is 4347 'TYPE(C_FUNPTR)' and the intrinsic conversion procedures are 4348 'C_F_PROCPOINTER' and 'C_FUNLOC'. 4349 4350 Let us consider two examples of actually passing a procedure pointer 4351 from C to Fortran and vice versa. Note that these examples are also 4352 very similar to passing ordinary pointers between both languages. 4353 First, consider this code in C: 4354 4355 /* Procedure implemented in Fortran. */ 4356 void get_values (void (*)(double)); 4357 4358 /* Call-back routine we want called from Fortran. */ 4359 void 4360 print_it (double x) 4361 { 4362 printf ("Number is %f.\n", x); 4363 } 4364 4365 /* Call Fortran routine and pass call-back to it. */ 4366 void 4367 foobar () 4368 { 4369 get_values (&print_it); 4370 } 4371 4372 A matching implementation for 'get_values' in Fortran, that correctly 4373 receives the procedure pointer from C and is able to call it, is given 4374 in the following 'MODULE': 4375 4376 MODULE m 4377 IMPLICIT NONE 4378 4379 ! Define interface of call-back routine. 4380 ABSTRACT INTERFACE 4381 SUBROUTINE callback (x) 4382 USE, INTRINSIC :: ISO_C_BINDING 4383 REAL(KIND=C_DOUBLE), INTENT(IN), VALUE :: x 4384 END SUBROUTINE callback 4385 END INTERFACE 4386 4387 CONTAINS 4388 4389 ! Define C-bound procedure. 4390 SUBROUTINE get_values (cproc) BIND(C) 4391 USE, INTRINSIC :: ISO_C_BINDING 4392 TYPE(C_FUNPTR), INTENT(IN), VALUE :: cproc 4393 4394 PROCEDURE(callback), POINTER :: proc 4395 4396 ! Convert C to Fortran procedure pointer. 4397 CALL C_F_PROCPOINTER (cproc, proc) 4398 4399 ! Call it. 4400 CALL proc (1.0_C_DOUBLE) 4401 CALL proc (-42.0_C_DOUBLE) 4402 CALL proc (18.12_C_DOUBLE) 4403 END SUBROUTINE get_values 4404 4405 END MODULE m 4406 4407 Next, we want to call a C routine that expects a procedure pointer 4408 argument and pass it a Fortran procedure (which clearly must be 4409 interoperable!). Again, the C function may be: 4410 4411 int 4412 call_it (int (*func)(int), int arg) 4413 { 4414 return func (arg); 4415 } 4416 4417 It can be used as in the following Fortran code: 4418 4419 MODULE m 4420 USE, INTRINSIC :: ISO_C_BINDING 4421 IMPLICIT NONE 4422 4423 ! Define interface of C function. 4424 INTERFACE 4425 INTEGER(KIND=C_INT) FUNCTION call_it (func, arg) BIND(C) 4426 USE, INTRINSIC :: ISO_C_BINDING 4427 TYPE(C_FUNPTR), INTENT(IN), VALUE :: func 4428 INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg 4429 END FUNCTION call_it 4430 END INTERFACE 4431 4432 CONTAINS 4433 4434 ! Define procedure passed to C function. 4435 ! It must be interoperable! 4436 INTEGER(KIND=C_INT) FUNCTION double_it (arg) BIND(C) 4437 INTEGER(KIND=C_INT), INTENT(IN), VALUE :: arg 4438 double_it = arg + arg 4439 END FUNCTION double_it 4440 4441 ! Call C function. 4442 SUBROUTINE foobar () 4443 TYPE(C_FUNPTR) :: cproc 4444 INTEGER(KIND=C_INT) :: i 4445 4446 ! Get C procedure pointer. 4447 cproc = C_FUNLOC (double_it) 4448 4449 ! Use it. 4450 DO i = 1_C_INT, 10_C_INT 4451 PRINT *, call_it (cproc, i) 4452 END DO 4453 END SUBROUTINE foobar 4454 4455 END MODULE m 4456 4457 4458 File: gfortran.info, Node: Further Interoperability of Fortran with C, Prev: Working with C Pointers, Up: Interoperability with C 4459 4460 6.1.6 Further Interoperability of Fortran with C 4461 ------------------------------------------------ 4462 4463 GNU Fortran implements the Technical Specification ISO/IEC TS 4464 29113:2012, which extends the interoperability support of Fortran 2003 4465 and Fortran 2008 and is now part of the 2018 Fortran standard. Besides 4466 removing some restrictions and constraints, the Technical Specification 4467 adds assumed-type ('TYPE(*)') and assumed-rank ('DIMENSION(..)') 4468 variables and allows for interoperability of assumed-shape, 4469 assumed-rank, and deferred-shape arrays, as well as allocatables and 4470 pointers. Objects of these types are passed to 'BIND(C)' functions as 4471 descriptors with a standard interface, declared in the header file 4472 '<ISO_Fortran_binding.h>'. 4473 4474 Note: Currently, GNU Fortran does not use internally the array 4475 descriptor (dope vector) as specified in the Technical Specification, 4476 but uses an array descriptor with different fields in functions without 4477 the 'BIND(C)' attribute. Arguments to functions marked 'BIND(C)' are 4478 converted to the specified form. If you need to access GNU Fortran's 4479 internal array descriptor, you can use the Chasm Language 4480 Interoperability Tools, <http://chasm-interop.sourceforge.net/>. 4481 4482 4483 File: gfortran.info, Node: GNU Fortran Compiler Directives, Next: Non-Fortran Main Program, Prev: Interoperability with C, Up: Mixed-Language Programming 4484 4485 6.2 GNU Fortran Compiler Directives 4486 =================================== 4487 4488 * Menu: 4489 4490 * ATTRIBUTES directive:: 4491 * UNROLL directive:: 4492 * BUILTIN directive:: 4493 * IVDEP directive:: 4494 * VECTOR directive:: 4495 * NOVECTOR directive:: 4496 4497 4498 File: gfortran.info, Node: ATTRIBUTES directive, Next: UNROLL directive, Up: GNU Fortran Compiler Directives 4499 4500 6.2.1 ATTRIBUTES directive 4501 -------------------------- 4502 4503 The Fortran standard describes how a conforming program shall behave; 4504 however, the exact implementation is not standardized. In order to 4505 allow the user to choose specific implementation details, compiler 4506 directives can be used to set attributes of variables and procedures 4507 which are not part of the standard. Whether a given attribute is 4508 supported and its exact effects depend on both the operating system and 4509 on the processor; see *note C Extensions: (gcc)Top. for details. 4510 4511 For procedures and procedure pointers, the following attributes can 4512 be used to change the calling convention: 4513 4514 * 'CDECL' - standard C calling convention 4515 * 'STDCALL' - convention where the called procedure pops the stack 4516 * 'FASTCALL' - part of the arguments are passed via registers instead 4517 using the stack 4518 4519 Besides changing the calling convention, the attributes also 4520 influence the decoration of the symbol name, e.g., by a leading 4521 underscore or by a trailing at-sign followed by the number of bytes on 4522 the stack. When assigning a procedure to a procedure pointer, both 4523 should use the same calling convention. 4524 4525 On some systems, procedures and global variables (module variables 4526 and 'COMMON' blocks) need special handling to be accessible when they 4527 are in a shared library. The following attributes are available: 4528 4529 * 'DLLEXPORT' - provide a global pointer to a pointer in the DLL 4530 * 'DLLIMPORT' - reference the function or variable using a global 4531 pointer 4532 4533 For dummy arguments, the 'NO_ARG_CHECK' attribute can be used; in 4534 other compilers, it is also known as 'IGNORE_TKR'. For dummy arguments 4535 with this attribute actual arguments of any type and kind (similar to 4536 'TYPE(*)'), scalars and arrays of any rank (no equivalent in Fortran 4537 standard) are accepted. As with 'TYPE(*)', the argument is unlimited 4538 polymorphic and no type information is available. Additionally, the 4539 argument may only be passed to dummy arguments with the 'NO_ARG_CHECK' 4540 attribute and as argument to the 'PRESENT' intrinsic function and to 4541 'C_LOC' of the 'ISO_C_BINDING' module. 4542 4543 Variables with 'NO_ARG_CHECK' attribute shall be of assumed-type 4544 ('TYPE(*)'; recommended) or of type 'INTEGER', 'LOGICAL', 'REAL' or 4545 'COMPLEX'. They shall not have the 'ALLOCATE', 'CODIMENSION', 4546 'INTENT(OUT)', 'POINTER' or 'VALUE' attribute; furthermore, they shall 4547 be either scalar or of assumed-size ('dimension(*)'). As 'TYPE(*)', the 4548 'NO_ARG_CHECK' attribute requires an explicit interface. 4549 4550 * 'NO_ARG_CHECK' - disable the type, kind and rank checking 4551 * 'DEPRECATED' - print a warning when using a such-tagged deprecated 4552 procedure, variable or parameter; the warning can be suppressed 4553 with '-Wno-deprecated-declarations'. 4554 4555 The attributes are specified using the syntax 4556 4557 '!GCC$ ATTRIBUTES' ATTRIBUTE-LIST '::' VARIABLE-LIST 4558 4559 where in free-form source code only whitespace is allowed before 4560 '!GCC$' and in fixed-form source code '!GCC$', 'cGCC$' or '*GCC$' shall 4561 start in the first column. 4562 4563 For procedures, the compiler directives shall be placed into the body 4564 of the procedure; for variables and procedure pointers, they shall be in 4565 the same declaration part as the variable or procedure pointer. 4566 4567 4568 File: gfortran.info, Node: UNROLL directive, Next: BUILTIN directive, Prev: ATTRIBUTES directive, Up: GNU Fortran Compiler Directives 4569 4570 6.2.2 UNROLL directive 4571 ---------------------- 4572 4573 The syntax of the directive is 4574 4575 '!GCC$ unroll N' 4576 4577 You can use this directive to control how many times a loop should be 4578 unrolled. It must be placed immediately before a 'DO' loop and applies 4579 only to the loop that follows. N is an integer constant specifying the 4580 unrolling factor. The values of 0 and 1 block any unrolling of the 4581 loop. 4582 4583 4584 File: gfortran.info, Node: BUILTIN directive, Next: IVDEP directive, Prev: UNROLL directive, Up: GNU Fortran Compiler Directives 4585 4586 6.2.3 BUILTIN directive 4587 ----------------------- 4588 4589 The syntax of the directive is 4590 4591 '!GCC$ BUILTIN (B) attributes simd FLAGS IF('target')' 4592 4593 You can use this directive to define which middle-end built-ins 4594 provide vector implementations. 'B' is name of the middle-end built-in. 4595 'FLAGS' are optional and must be either "(inbranch)" or "(notinbranch)". 4596 'IF' statement is optional and is used to filter multilib ABIs for the 4597 built-in that should be vectorized. Example usage: 4598 4599 !GCC$ builtin (sinf) attributes simd (notinbranch) if('x86_64') 4600 4601 The purpose of the directive is to provide an API among the GCC 4602 compiler and the GNU C Library which would define vector implementations 4603 of math routines. 4604 4605 4606 File: gfortran.info, Node: IVDEP directive, Next: VECTOR directive, Prev: BUILTIN directive, Up: GNU Fortran Compiler Directives 4607 4608 6.2.4 IVDEP directive 4609 --------------------- 4610 4611 The syntax of the directive is 4612 4613 '!GCC$ ivdep' 4614 4615 This directive tells the compiler to ignore vector dependencies in 4616 the following loop. It must be placed immediately before a 'DO' loop 4617 and applies only to the loop that follows. 4618 4619 Sometimes the compiler may not have sufficient information to decide 4620 whether a particular loop is vectorizable due to potential dependencies 4621 between iterations. The purpose of the directive is to tell the 4622 compiler that vectorization is safe. 4623 4624 This directive is intended for annotation of existing code. For new 4625 code it is recommended to consider OpenMP SIMD directives as potential 4626 alternative. 4627 4628 4629 File: gfortran.info, Node: VECTOR directive, Next: NOVECTOR directive, Prev: IVDEP directive, Up: GNU Fortran Compiler Directives 4630 4631 6.2.5 VECTOR directive 4632 ---------------------- 4633 4634 The syntax of the directive is 4635 4636 '!GCC$ vector' 4637 4638 This directive tells the compiler to vectorize the following loop. 4639 It must be placed immediately before a 'DO' loop and applies only to the 4640 loop that follows. 4641 4642 4643 File: gfortran.info, Node: NOVECTOR directive, Prev: VECTOR directive, Up: GNU Fortran Compiler Directives 4644 4645 6.2.6 NOVECTOR directive 4646 ------------------------ 4647 4648 The syntax of the directive is 4649 4650 '!GCC$ novector' 4651 4652 This directive tells the compiler to not vectorize the following 4653 loop. It must be placed immediately before a 'DO' loop and applies only 4654 to the loop that follows. 4655 4656 4657 File: gfortran.info, Node: Non-Fortran Main Program, Next: Naming and argument-passing conventions, Prev: GNU Fortran Compiler Directives, Up: Mixed-Language Programming 4658 4659 6.3 Non-Fortran Main Program 4660 ============================ 4661 4662 * Menu: 4663 4664 * _gfortran_set_args:: Save command-line arguments 4665 * _gfortran_set_options:: Set library option flags 4666 * _gfortran_set_convert:: Set endian conversion 4667 * _gfortran_set_record_marker:: Set length of record markers 4668 * _gfortran_set_fpe:: Set when a Floating Point Exception should be raised 4669 * _gfortran_set_max_subrecord_length:: Set subrecord length 4670 4671 Even if you are doing mixed-language programming, it is very likely that 4672 you do not need to know or use the information in this section. Since 4673 it is about the internal structure of GNU Fortran, it may also change in 4674 GCC minor releases. 4675 4676 When you compile a 'PROGRAM' with GNU Fortran, a function with the 4677 name 'main' (in the symbol table of the object file) is generated, which 4678 initializes the libgfortran library and then calls the actual program 4679 which uses the name 'MAIN__', for historic reasons. If you link GNU 4680 Fortran compiled procedures to, e.g., a C or C++ program or to a Fortran 4681 program compiled by a different compiler, the libgfortran library is not 4682 initialized and thus a few intrinsic procedures do not work properly, 4683 e.g. those for obtaining the command-line arguments. 4684 4685 Therefore, if your 'PROGRAM' is not compiled with GNU Fortran and the 4686 GNU Fortran compiled procedures require intrinsics relying on the 4687 library initialization, you need to initialize the library yourself. 4688 Using the default options, gfortran calls '_gfortran_set_args' and 4689 '_gfortran_set_options'. The initialization of the former is needed if 4690 the called procedures access the command line (and for backtracing); the 4691 latter sets some flags based on the standard chosen or to enable 4692 backtracing. In typical programs, it is not necessary to call any 4693 initialization function. 4694 4695 If your 'PROGRAM' is compiled with GNU Fortran, you shall not call 4696 any of the following functions. The libgfortran initialization 4697 functions are shown in C syntax but using C bindings they are also 4698 accessible from Fortran. 4699 4700 4701 File: gfortran.info, Node: _gfortran_set_args, Next: _gfortran_set_options, Up: Non-Fortran Main Program 4702 4703 6.3.1 '_gfortran_set_args' -- Save command-line arguments 4704 --------------------------------------------------------- 4705 4706 _Description_: 4707 '_gfortran_set_args' saves the command-line arguments; this 4708 initialization is required if any of the command-line intrinsics is 4709 called. Additionally, it shall be called if backtracing is enabled 4710 (see '_gfortran_set_options'). 4711 4712 _Syntax_: 4713 'void _gfortran_set_args (int argc, char *argv[])' 4714 4715 _Arguments_: 4716 ARGC number of command line argument strings 4717 ARGV the command-line argument strings; argv[0] is 4718 the pathname of the executable itself. 4719 4720 _Example_: 4721 int main (int argc, char *argv[]) 4722 { 4723 /* Initialize libgfortran. */ 4724 _gfortran_set_args (argc, argv); 4725 return 0; 4726 } 4727 4728 4729 File: gfortran.info, Node: _gfortran_set_options, Next: _gfortran_set_convert, Prev: _gfortran_set_args, Up: Non-Fortran Main Program 4730 4731 6.3.2 '_gfortran_set_options' -- Set library option flags 4732 --------------------------------------------------------- 4733 4734 _Description_: 4735 '_gfortran_set_options' sets several flags related to the Fortran 4736 standard to be used, whether backtracing should be enabled and 4737 whether range checks should be performed. The syntax allows for 4738 upward compatibility since the number of passed flags is specified; 4739 for non-passed flags, the default value is used. See also *note 4740 Code Gen Options::. Please note that not all flags are actually 4741 used. 4742 4743 _Syntax_: 4744 'void _gfortran_set_options (int num, int options[])' 4745 4746 _Arguments_: 4747 NUM number of options passed 4748 ARGV The list of flag values 4749 4750 _option flag list_: 4751 OPTION[0] Allowed standard; can give run-time errors if 4752 e.g. an input-output edit descriptor is invalid 4753 in a given standard. Possible values are 4754 (bitwise or-ed) 'GFC_STD_F77' (1), 4755 'GFC_STD_F95_OBS' (2), 'GFC_STD_F95_DEL' (4), 4756 'GFC_STD_F95' (8), 'GFC_STD_F2003' (16), 4757 'GFC_STD_GNU' (32), 'GFC_STD_LEGACY' (64), 4758 'GFC_STD_F2008' (128), 'GFC_STD_F2008_OBS' 4759 (256), 'GFC_STD_F2008_TS' (512), 'GFC_STD_F2018' 4760 (1024), 'GFC_STD_F2018_OBS' (2048), and 4761 'GFC_STD=F2018_DEL' (4096). Default: 4762 'GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95 4763 | GFC_STD_F2003 | GFC_STD_F2008 | 4764 GFC_STD_F2008_TS | GFC_STD_F2008_OBS | 4765 GFC_STD_F77 | GFC_STD_F2018 | GFC_STD_F2018_OBS 4766 | GFC_STD_F2018_DEL | GFC_STD_GNU | 4767 GFC_STD_LEGACY'. 4768 OPTION[1] Standard-warning flag; prints a warning to 4769 standard error. Default: 'GFC_STD_F95_DEL | 4770 GFC_STD_LEGACY'. 4771 OPTION[2] If non zero, enable pedantic checking. Default: 4772 off. 4773 OPTION[3] Unused. 4774 OPTION[4] If non zero, enable backtracing on run-time 4775 errors. Default: off. (Default in the 4776 compiler: on.) Note: Installs a signal handler 4777 and requires command-line initialization using 4778 '_gfortran_set_args'. 4779 OPTION[5] If non zero, supports signed zeros. Default: 4780 enabled. 4781 OPTION[6] Enables run-time checking. Possible values are 4782 (bitwise or-ed): GFC_RTCHECK_BOUNDS (1), 4783 GFC_RTCHECK_ARRAY_TEMPS (2), 4784 GFC_RTCHECK_RECURSION (4), GFC_RTCHECK_DO (8), 4785 GFC_RTCHECK_POINTER (16), GFC_RTCHECK_MEM (32), 4786 GFC_RTCHECK_BITS (64). Default: disabled. 4787 OPTION[7] Unused. 4788 OPTION[8] Show a warning when invoking 'STOP' and 'ERROR 4789 STOP' if a floating-point exception occurred. 4790 Possible values are (bitwise or-ed) 4791 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2), 4792 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8), 4793 'GFC_FPE_UNDERFLOW' (16), 'GFC_FPE_INEXACT' 4794 (32). Default: None (0). (Default in the 4795 compiler: 'GFC_FPE_INVALID | GFC_FPE_DENORMAL | 4796 GFC_FPE_ZERO | GFC_FPE_OVERFLOW | 4797 GFC_FPE_UNDERFLOW'.) 4798 4799 _Example_: 4800 /* Use gfortran 4.9 default options. */ 4801 static int options[] = {68, 511, 0, 0, 1, 1, 0, 0, 31}; 4802 _gfortran_set_options (9, &options); 4803 4804 4805 File: gfortran.info, Node: _gfortran_set_convert, Next: _gfortran_set_record_marker, Prev: _gfortran_set_options, Up: Non-Fortran Main Program 4806 4807 6.3.3 '_gfortran_set_convert' -- Set endian conversion 4808 ------------------------------------------------------ 4809 4810 _Description_: 4811 '_gfortran_set_convert' set the representation of data for 4812 unformatted files. 4813 4814 _Syntax_: 4815 'void _gfortran_set_convert (int conv)' 4816 4817 _Arguments_: 4818 CONV Endian conversion, possible values: 4819 GFC_CONVERT_NATIVE (0, default), 4820 GFC_CONVERT_SWAP (1), GFC_CONVERT_BIG (2), 4821 GFC_CONVERT_LITTLE (3). 4822 4823 _Example_: 4824 int main (int argc, char *argv[]) 4825 { 4826 /* Initialize libgfortran. */ 4827 _gfortran_set_args (argc, argv); 4828 _gfortran_set_convert (1); 4829 return 0; 4830 } 4831 4832 4833 File: gfortran.info, Node: _gfortran_set_record_marker, Next: _gfortran_set_fpe, Prev: _gfortran_set_convert, Up: Non-Fortran Main Program 4834 4835 6.3.4 '_gfortran_set_record_marker' -- Set length of record markers 4836 ------------------------------------------------------------------- 4837 4838 _Description_: 4839 '_gfortran_set_record_marker' sets the length of record markers for 4840 unformatted files. 4841 4842 _Syntax_: 4843 'void _gfortran_set_record_marker (int val)' 4844 4845 _Arguments_: 4846 VAL Length of the record marker; valid values are 4 4847 and 8. Default is 4. 4848 4849 _Example_: 4850 int main (int argc, char *argv[]) 4851 { 4852 /* Initialize libgfortran. */ 4853 _gfortran_set_args (argc, argv); 4854 _gfortran_set_record_marker (8); 4855 return 0; 4856 } 4857 4858 4859 File: gfortran.info, Node: _gfortran_set_fpe, Next: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_record_marker, Up: Non-Fortran Main Program 4860 4861 6.3.5 '_gfortran_set_fpe' -- Enable floating point exception traps 4862 ------------------------------------------------------------------ 4863 4864 _Description_: 4865 '_gfortran_set_fpe' enables floating point exception traps for the 4866 specified exceptions. On most systems, this will result in a 4867 SIGFPE signal being sent and the program being aborted. 4868 4869 _Syntax_: 4870 'void _gfortran_set_fpe (int val)' 4871 4872 _Arguments_: 4873 OPTION[0] IEEE exceptions. Possible values are (bitwise 4874 or-ed) zero (0, default) no trapping, 4875 'GFC_FPE_INVALID' (1), 'GFC_FPE_DENORMAL' (2), 4876 'GFC_FPE_ZERO' (4), 'GFC_FPE_OVERFLOW' (8), 4877 'GFC_FPE_UNDERFLOW' (16), and 'GFC_FPE_INEXACT' 4878 (32). 4879 4880 _Example_: 4881 int main (int argc, char *argv[]) 4882 { 4883 /* Initialize libgfortran. */ 4884 _gfortran_set_args (argc, argv); 4885 /* FPE for invalid operations such as SQRT(-1.0). */ 4886 _gfortran_set_fpe (1); 4887 return 0; 4888 } 4889 4890 4891 File: gfortran.info, Node: _gfortran_set_max_subrecord_length, Prev: _gfortran_set_fpe, Up: Non-Fortran Main Program 4892 4893 6.3.6 '_gfortran_set_max_subrecord_length' -- Set subrecord length 4894 ------------------------------------------------------------------ 4895 4896 _Description_: 4897 '_gfortran_set_max_subrecord_length' set the maximum length for a 4898 subrecord. This option only makes sense for testing and debugging 4899 of unformatted I/O. 4900 4901 _Syntax_: 4902 'void _gfortran_set_max_subrecord_length (int val)' 4903 4904 _Arguments_: 4905 VAL the maximum length for a subrecord; the maximum 4906 permitted value is 2147483639, which is also the 4907 default. 4908 4909 _Example_: 4910 int main (int argc, char *argv[]) 4911 { 4912 /* Initialize libgfortran. */ 4913 _gfortran_set_args (argc, argv); 4914 _gfortran_set_max_subrecord_length (8); 4915 return 0; 4916 } 4917 4918 4919 File: gfortran.info, Node: Naming and argument-passing conventions, Prev: Non-Fortran Main Program, Up: Mixed-Language Programming 4920 4921 6.4 Naming and argument-passing conventions 4922 =========================================== 4923 4924 This section gives an overview about the naming convention of procedures 4925 and global variables and about the argument passing conventions used by 4926 GNU Fortran. If a C binding has been specified, the naming convention 4927 and some of the argument-passing conventions change. If possible, 4928 mixed-language and mixed-compiler projects should use the better defined 4929 C binding for interoperability. See *note Interoperability with C::. 4930 4931 * Menu: 4932 4933 * Naming conventions:: 4934 * Argument passing conventions:: 4935 4936 4937 File: gfortran.info, Node: Naming conventions, Next: Argument passing conventions, Up: Naming and argument-passing conventions 4938 4939 6.4.1 Naming conventions 4940 ------------------------ 4941 4942 According the Fortran standard, valid Fortran names consist of a letter 4943 between 'A' to 'Z', 'a' to 'z', digits '0', '1' to '9' and underscores 4944 ('_') with the restriction that names may only start with a letter. As 4945 vendor extension, the dollar sign ('$') is additionally permitted with 4946 the option '-fdollar-ok', but not as first character and only if the 4947 target system supports it. 4948 4949 By default, the procedure name is the lower-cased Fortran name with 4950 an appended underscore ('_'); using '-fno-underscoring' no underscore is 4951 appended while '-fsecond-underscore' appends two underscores. Depending 4952 on the target system and the calling convention, the procedure might be 4953 additionally dressed; for instance, on 32bit Windows with 'stdcall', an 4954 at-sign '@' followed by an integer number is appended. For the changing 4955 the calling convention, see *note GNU Fortran Compiler Directives::. 4956 4957 For common blocks, the same convention is used, i.e. by default an 4958 underscore is appended to the lower-cased Fortran name. Blank commons 4959 have the name '__BLNK__'. 4960 4961 For procedures and variables declared in the specification space of a 4962 module, the name is formed by '__', followed by the lower-cased module 4963 name, '_MOD_', and the lower-cased Fortran name. Note that no 4964 underscore is appended. 4965 4966 4967 File: gfortran.info, Node: Argument passing conventions, Prev: Naming conventions, Up: Naming and argument-passing conventions 4968 4969 6.4.2 Argument passing conventions 4970 ---------------------------------- 4971 4972 Subroutines do not return a value (matching C99's 'void') while 4973 functions either return a value as specified in the platform ABI or the 4974 result variable is passed as hidden argument to the function and no 4975 result is returned. A hidden result variable is used when the result 4976 variable is an array or of type 'CHARACTER'. 4977 4978 Arguments are passed according to the platform ABI. In particular, 4979 complex arguments might not be compatible to a struct with two real 4980 components for the real and imaginary part. The argument passing 4981 matches the one of C99's '_Complex'. Functions with scalar complex 4982 result variables return their value and do not use a by-reference 4983 argument. Note that with the '-ff2c' option, the argument passing is 4984 modified and no longer completely matches the platform ABI. Some other 4985 Fortran compilers use 'f2c' semantic by default; this might cause 4986 problems with interoperablility. 4987 4988 GNU Fortran passes most arguments by reference, i.e. by passing a 4989 pointer to the data. Note that the compiler might use a temporary 4990 variable into which the actual argument has been copied, if required 4991 semantically (copy-in/copy-out). 4992 4993 For arguments with 'ALLOCATABLE' and 'POINTER' attribute (including 4994 procedure pointers), a pointer to the pointer is passed such that the 4995 pointer address can be modified in the procedure. 4996 4997 For dummy arguments with the 'VALUE' attribute: Scalar arguments of 4998 the type 'INTEGER', 'LOGICAL', 'REAL' and 'COMPLEX' are passed by value 4999 according to the platform ABI. (As vendor extension and not recommended, 5000 using '%VAL()' in the call to a procedure has the same effect.) For 5001 'TYPE(C_PTR)' and procedure pointers, the pointer itself is passed such 5002 that it can be modified without affecting the caller. 5003 5004 For Boolean ('LOGICAL') arguments, please note that GCC expects only 5005 the integer value 0 and 1. If a GNU Fortran 'LOGICAL' variable contains 5006 another integer value, the result is undefined. As some other Fortran 5007 compilers use -1 for '.TRUE.', extra care has to be taken - such as 5008 passing the value as 'INTEGER'. (The same value restriction also 5009 applies to other front ends of GCC, e.g. to GCC's C99 compiler for 5010 '_Bool' or GCC's Ada compiler for 'Boolean'.) 5011 5012 For arguments of 'CHARACTER' type, the character length is passed as 5013 a hidden argument at the end of the argument list. For deferred-length 5014 strings, the value is passed by reference, otherwise by value. The 5015 character length has the C type 'size_t' (or 'INTEGER(kind=C_SIZE_T)' in 5016 Fortran). Note that this is different to older versions of the GNU 5017 Fortran compiler, where the type of the hidden character length argument 5018 was a C 'int'. In order to retain compatibility with older versions, 5019 one can e.g. for the following Fortran procedure 5020 5021 subroutine fstrlen (s, a) 5022 character(len=*) :: s 5023 integer :: a 5024 print*, len(s) 5025 end subroutine fstrlen 5026 5027 define the corresponding C prototype as follows: 5028 5029 #if __GNUC__ > 7 5030 typedef size_t fortran_charlen_t; 5031 #else 5032 typedef int fortran_charlen_t; 5033 #endif 5034 5035 void fstrlen_ (char*, int*, fortran_charlen_t); 5036 5037 In order to avoid such compiler-specific details, for new code it is 5038 instead recommended to use the ISO_C_BINDING feature. 5039 5040 Note with C binding, 'CHARACTER(len=1)' result variables are returned 5041 according to the platform ABI and no hidden length argument is used for 5042 dummy arguments; with 'VALUE', those variables are passed by value. 5043 5044 For 'OPTIONAL' dummy arguments, an absent argument is denoted by a 5045 NULL pointer, except for scalar dummy arguments of type 'INTEGER', 5046 'LOGICAL', 'REAL' and 'COMPLEX' which have the 'VALUE' attribute. For 5047 those, a hidden Boolean argument ('logical(kind=C_bool),value') is used 5048 to indicate whether the argument is present. 5049 5050 Arguments which are assumed-shape, assumed-rank or deferred-rank 5051 arrays or, with '-fcoarray=lib', allocatable scalar coarrays use an 5052 array descriptor. All other arrays pass the address of the first 5053 element of the array. With '-fcoarray=lib', the token and the offset 5054 belonging to nonallocatable coarrays dummy arguments are passed as 5055 hidden argument along the character length hidden arguments. The token 5056 is an opaque pointer identifying the coarray and the offset is a 5057 passed-by-value integer of kind 'C_PTRDIFF_T', denoting the byte offset 5058 between the base address of the coarray and the passed scalar or first 5059 element of the passed array. 5060 5061 The arguments are passed in the following order 5062 * Result variable, when the function result is passed by reference 5063 * Character length of the function result, if it is a of type 5064 'CHARACTER' and no C binding is used 5065 * The arguments in the order in which they appear in the Fortran 5066 declaration 5067 * The the present status for optional arguments with value attribute, 5068 which are internally passed by value 5069 * The character length and/or coarray token and offset for the first 5070 argument which is a 'CHARACTER' or a nonallocatable coarray dummy 5071 argument, followed by the hidden arguments of the next dummy 5072 argument of such a type 5073 5074 5075 File: gfortran.info, Node: Coarray Programming, Next: Intrinsic Procedures, Prev: Mixed-Language Programming, Up: Top 5076 5077 7 Coarray Programming 5078 ********************* 5079 5080 * Menu: 5081 5082 * Type and enum ABI Documentation:: 5083 * Function ABI Documentation:: 5084 5085 5086 File: gfortran.info, Node: Type and enum ABI Documentation, Next: Function ABI Documentation, Up: Coarray Programming 5087 5088 7.1 Type and enum ABI Documentation 5089 =================================== 5090 5091 * Menu: 5092 5093 * caf_token_t:: 5094 * caf_register_t:: 5095 * caf_deregister_t:: 5096 * caf_reference_t:: 5097 * caf_team_t:: 5098 5099 5100 File: gfortran.info, Node: caf_token_t, Next: caf_register_t, Up: Type and enum ABI Documentation 5101 5102 7.1.1 'caf_token_t' 5103 ------------------- 5104 5105 Typedef of type 'void *' on the compiler side. Can be any data type on 5106 the library side. 5107 5108 5109 File: gfortran.info, Node: caf_register_t, Next: caf_deregister_t, Prev: caf_token_t, Up: Type and enum ABI Documentation 5110 5111 7.1.2 'caf_register_t' 5112 ---------------------- 5113 5114 Indicates which kind of coarray variable should be registered. 5115 5116 typedef enum caf_register_t { 5117 CAF_REGTYPE_COARRAY_STATIC, 5118 CAF_REGTYPE_COARRAY_ALLOC, 5119 CAF_REGTYPE_LOCK_STATIC, 5120 CAF_REGTYPE_LOCK_ALLOC, 5121 CAF_REGTYPE_CRITICAL, 5122 CAF_REGTYPE_EVENT_STATIC, 5123 CAF_REGTYPE_EVENT_ALLOC, 5124 CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY, 5125 CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY 5126 } 5127 caf_register_t; 5128 5129 The values 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and 5130 'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' are for allocatable components 5131 in derived type coarrays only. The first one sets up the token without 5132 allocating memory for allocatable component. The latter one only 5133 allocates the memory for an allocatable component in a derived type 5134 coarray. The token needs to be setup previously by the REGISTER_ONLY. 5135 This allows to have allocatable components un-allocated on some images. 5136 The status whether an allocatable component is allocated on a remote 5137 image can be queried by '_caf_is_present' which used internally by the 5138 'ALLOCATED' intrinsic. 5139 5140 5141 File: gfortran.info, Node: caf_deregister_t, Next: caf_reference_t, Prev: caf_register_t, Up: Type and enum ABI Documentation 5142 5143 7.1.3 'caf_deregister_t' 5144 ------------------------ 5145 5146 typedef enum caf_deregister_t { 5147 CAF_DEREGTYPE_COARRAY_DEREGISTER, 5148 CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY 5149 } 5150 caf_deregister_t; 5151 5152 Allows to specifiy the type of deregistration of a coarray object. 5153 The 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' flag is only allowed for 5154 allocatable components in derived type coarrays. 5155 5156 5157 File: gfortran.info, Node: caf_reference_t, Next: caf_team_t, Prev: caf_deregister_t, Up: Type and enum ABI Documentation 5158 5159 7.1.4 'caf_reference_t' 5160 ----------------------- 5161 5162 The structure used for implementing arbitrary reference chains. A 5163 'CAF_REFERENCE_T' allows to specify a component reference or any kind of 5164 array reference of any rank supported by gfortran. For array references 5165 all kinds as known by the compiler/Fortran standard are supported 5166 indicated by a 'MODE'. 5167 5168 typedef enum caf_ref_type_t { 5169 /* Reference a component of a derived type, either regular one or an 5170 allocatable or pointer type. For regular ones idx in caf_reference_t is 5171 set to -1. */ 5172 CAF_REF_COMPONENT, 5173 /* Reference an allocatable array. */ 5174 CAF_REF_ARRAY, 5175 /* Reference a non-allocatable/non-pointer array. I.e., the coarray object 5176 has no array descriptor associated and the addressing is done 5177 completely using the ref. */ 5178 CAF_REF_STATIC_ARRAY 5179 } caf_ref_type_t; 5180 5181 typedef enum caf_array_ref_t { 5182 /* No array ref. This terminates the array ref. */ 5183 CAF_ARR_REF_NONE = 0, 5184 /* Reference array elements given by a vector. Only for this mode 5185 caf_reference_t.u.a.dim[i].v is valid. */ 5186 CAF_ARR_REF_VECTOR, 5187 /* A full array ref (:). */ 5188 CAF_ARR_REF_FULL, 5189 /* Reference a range on elements given by start, end and stride. */ 5190 CAF_ARR_REF_RANGE, 5191 /* Only a single item is referenced given in the start member. */ 5192 CAF_ARR_REF_SINGLE, 5193 /* An array ref of the kind (i:), where i is an arbitrary valid index in the 5194 array. The index i is given in the start member. */ 5195 CAF_ARR_REF_OPEN_END, 5196 /* An array ref of the kind (:i), where the lower bound of the array ref 5197 is given by the remote side. The index i is given in the end member. */ 5198 CAF_ARR_REF_OPEN_START 5199 } caf_array_ref_t; 5200 5201 /* References to remote components of a derived type. */ 5202 typedef struct caf_reference_t { 5203 /* A pointer to the next ref or NULL. */ 5204 struct caf_reference_t *next; 5205 /* The type of the reference. */ 5206 /* caf_ref_type_t, replaced by int to allow specification in fortran FE. */ 5207 int type; 5208 /* The size of an item referenced in bytes. I.e. in an array ref this is 5209 the factor to advance the array pointer with to get to the next item. 5210 For component refs this gives just the size of the element referenced. */ 5211 size_t item_size; 5212 union { 5213 struct { 5214 /* The offset (in bytes) of the component in the derived type. 5215 Unused for allocatable or pointer components. */ 5216 ptrdiff_t offset; 5217 /* The offset (in bytes) to the caf_token associated with this 5218 component. NULL, when not allocatable/pointer ref. */ 5219 ptrdiff_t caf_token_offset; 5220 } c; 5221 struct { 5222 /* The mode of the array ref. See CAF_ARR_REF_*. */ 5223 /* caf_array_ref_t, replaced by unsigend char to allow specification in 5224 fortran FE. */ 5225 unsigned char mode[GFC_MAX_DIMENSIONS]; 5226 /* The type of a static array. Unset for array's with descriptors. */ 5227 int static_array_type; 5228 /* Subscript refs (s) or vector refs (v). */ 5229 union { 5230 struct { 5231 /* The start and end boundary of the ref and the stride. */ 5232 index_type start, end, stride; 5233 } s; 5234 struct { 5235 /* nvec entries of kind giving the elements to reference. */ 5236 void *vector; 5237 /* The number of entries in vector. */ 5238 size_t nvec; 5239 /* The integer kind used for the elements in vector. */ 5240 int kind; 5241 } v; 5242 } dim[GFC_MAX_DIMENSIONS]; 5243 } a; 5244 } u; 5245 } caf_reference_t; 5246 5247 The references make up a single linked list of reference operations. 5248 The 'NEXT' member links to the next reference or NULL to indicate the 5249 end of the chain. Component and array refs can be arbitrarily mixed as 5250 long as they comply to the Fortran standard. 5251 5252 _NOTES_ The member 'STATIC_ARRAY_TYPE' is used only when the 'TYPE' 5253 is 'CAF_REF_STATIC_ARRAY'. The member gives the type of the data 5254 referenced. Because no array descriptor is available for a 5255 descriptor-less array and type conversion still needs to take place the 5256 type is transported here. 5257 5258 At the moment 'CAF_ARR_REF_VECTOR' is not implemented in the front 5259 end for descriptor-less arrays. The library caf_single has untested 5260 support for it. 5261 5262 5263 File: gfortran.info, Node: caf_team_t, Prev: caf_reference_t, Up: Type and enum ABI Documentation 5264 5265 7.1.5 'caf_team_t' 5266 ------------------ 5267 5268 Opaque pointer to represent a team-handle. This type is a stand-in for 5269 the future implementation of teams. It is about to change without 5270 further notice. 5271 5272 5273 File: gfortran.info, Node: Function ABI Documentation, Prev: Type and enum ABI Documentation, Up: Coarray Programming 5274 5275 7.2 Function ABI Documentation 5276 ============================== 5277 5278 * Menu: 5279 5280 * _gfortran_caf_init:: Initialiation function 5281 * _gfortran_caf_finish:: Finalization function 5282 * _gfortran_caf_this_image:: Querying the image number 5283 * _gfortran_caf_num_images:: Querying the maximal number of images 5284 * _gfortran_caf_image_status :: Query the status of an image 5285 * _gfortran_caf_failed_images :: Get an array of the indexes of the failed images 5286 * _gfortran_caf_stopped_images :: Get an array of the indexes of the stopped images 5287 * _gfortran_caf_register:: Registering coarrays 5288 * _gfortran_caf_deregister:: Deregistering coarrays 5289 * _gfortran_caf_is_present:: Query whether an allocatable or pointer component in a derived type coarray is allocated 5290 * _gfortran_caf_send:: Sending data from a local image to a remote image 5291 * _gfortran_caf_get:: Getting data from a remote image 5292 * _gfortran_caf_sendget:: Sending data between remote images 5293 * _gfortran_caf_send_by_ref:: Sending data from a local image to a remote image using enhanced references 5294 * _gfortran_caf_get_by_ref:: Getting data from a remote image using enhanced references 5295 * _gfortran_caf_sendget_by_ref:: Sending data between remote images using enhanced references 5296 * _gfortran_caf_lock:: Locking a lock variable 5297 * _gfortran_caf_unlock:: Unlocking a lock variable 5298 * _gfortran_caf_event_post:: Post an event 5299 * _gfortran_caf_event_wait:: Wait that an event occurred 5300 * _gfortran_caf_event_query:: Query event count 5301 * _gfortran_caf_sync_all:: All-image barrier 5302 * _gfortran_caf_sync_images:: Barrier for selected images 5303 * _gfortran_caf_sync_memory:: Wait for completion of segment-memory operations 5304 * _gfortran_caf_error_stop:: Error termination with exit code 5305 * _gfortran_caf_error_stop_str:: Error termination with string 5306 * _gfortran_caf_fail_image :: Mark the image failed and end its execution 5307 * _gfortran_caf_atomic_define:: Atomic variable assignment 5308 * _gfortran_caf_atomic_ref:: Atomic variable reference 5309 * _gfortran_caf_atomic_cas:: Atomic compare and swap 5310 * _gfortran_caf_atomic_op:: Atomic operation 5311 * _gfortran_caf_co_broadcast:: Sending data to all images 5312 * _gfortran_caf_co_max:: Collective maximum reduction 5313 * _gfortran_caf_co_min:: Collective minimum reduction 5314 * _gfortran_caf_co_sum:: Collective summing reduction 5315 * _gfortran_caf_co_reduce:: Generic collective reduction 5316 5317 5318 File: gfortran.info, Node: _gfortran_caf_init, Next: _gfortran_caf_finish, Up: Function ABI Documentation 5319 5320 7.2.1 '_gfortran_caf_init' -- Initialiation function 5321 ---------------------------------------------------- 5322 5323 _Description_: 5324 This function is called at startup of the program before the 5325 Fortran main program, if the latter has been compiled with 5326 '-fcoarray=lib'. It takes as arguments the command-line arguments 5327 of the program. It is permitted to pass two 'NULL' pointers as 5328 argument; if non-'NULL', the library is permitted to modify the 5329 arguments. 5330 5331 _Syntax_: 5332 'void _gfortran_caf_init (int *argc, char ***argv)' 5333 5334 _Arguments_: 5335 ARGC intent(inout) An integer pointer with the number 5336 of arguments passed to the program or 'NULL'. 5337 ARGV intent(inout) A pointer to an array of strings 5338 with the command-line arguments or 'NULL'. 5339 5340 _NOTES_ 5341 The function is modelled after the initialization function of the 5342 Message Passing Interface (MPI) specification. Due to the way 5343 coarray registration works, it might not be the first call to the 5344 library. If the main program is not written in Fortran and only a 5345 library uses coarrays, it can happen that this function is never 5346 called. Therefore, it is recommended that the library does not 5347 rely on the passed arguments and whether the call has been done. 5348 5349 5350 File: gfortran.info, Node: _gfortran_caf_finish, Next: _gfortran_caf_this_image, Prev: _gfortran_caf_init, Up: Function ABI Documentation 5351 5352 7.2.2 '_gfortran_caf_finish' -- Finalization function 5353 ----------------------------------------------------- 5354 5355 _Description_: 5356 This function is called at the end of the Fortran main program, if 5357 it has been compiled with the '-fcoarray=lib' option. 5358 5359 _Syntax_: 5360 'void _gfortran_caf_finish (void)' 5361 5362 _NOTES_ 5363 For non-Fortran programs, it is recommended to call the function at 5364 the end of the main program. To ensure that the shutdown is also 5365 performed for programs where this function is not explicitly 5366 invoked, for instance non-Fortran programs or calls to the system's 5367 exit() function, the library can use a destructor function. Note 5368 that programs can also be terminated using the STOP and ERROR STOP 5369 statements; those use different library calls. 5370 5371 5372 File: gfortran.info, Node: _gfortran_caf_this_image, Next: _gfortran_caf_num_images, Prev: _gfortran_caf_finish, Up: Function ABI Documentation 5373 5374 7.2.3 '_gfortran_caf_this_image' -- Querying the image number 5375 ------------------------------------------------------------- 5376 5377 _Description_: 5378 This function returns the current image number, which is a positive 5379 number. 5380 5381 _Syntax_: 5382 'int _gfortran_caf_this_image (int distance)' 5383 5384 _Arguments_: 5385 DISTANCE As specified for the 'this_image' intrinsic in 5386 TS18508. Shall be a non-negative number. 5387 5388 _NOTES_ 5389 If the Fortran intrinsic 'this_image' is invoked without an 5390 argument, which is the only permitted form in Fortran 2008, GCC 5391 passes '0' as first argument. 5392 5393 5394 File: gfortran.info, Node: _gfortran_caf_num_images, Next: _gfortran_caf_image_status, Prev: _gfortran_caf_this_image, Up: Function ABI Documentation 5395 5396 7.2.4 '_gfortran_caf_num_images' -- Querying the maximal number of images 5397 ------------------------------------------------------------------------- 5398 5399 _Description_: 5400 This function returns the number of images in the current team, if 5401 DISTANCE is 0 or the number of images in the parent team at the 5402 specified distance. If failed is -1, the function returns the 5403 number of all images at the specified distance; if it is 0, the 5404 function returns the number of nonfailed images, and if it is 1, it 5405 returns the number of failed images. 5406 5407 _Syntax_: 5408 'int _gfortran_caf_num_images(int distance, int failed)' 5409 5410 _Arguments_: 5411 DISTANCE the distance from this image to the ancestor. 5412 Shall be positive. 5413 FAILED shall be -1, 0, or 1 5414 5415 _NOTES_ 5416 This function follows TS18508. If the num_image intrinsic has no 5417 arguments, then the compiler passes 'distance=0' and 'failed=-1' to 5418 the function. 5419 5420 5421 File: gfortran.info, Node: _gfortran_caf_image_status, Next: _gfortran_caf_failed_images, Prev: _gfortran_caf_num_images, Up: Function ABI Documentation 5422 5423 7.2.5 '_gfortran_caf_image_status' -- Query the status of an image 5424 ------------------------------------------------------------------ 5425 5426 _Description_: 5427 Get the status of the image given by the id IMAGE of the team given 5428 by TEAM. Valid results are zero, for image is ok, 5429 'STAT_STOPPED_IMAGE' from the ISO_FORTRAN_ENV module to indicate 5430 that the image has been stopped and 'STAT_FAILED_IMAGE' also from 5431 ISO_FORTRAN_ENV to indicate that the image has executed a 'FAIL 5432 IMAGE' statement. 5433 5434 _Syntax_: 5435 'int _gfortran_caf_image_status (int image, caf_team_t * team)' 5436 5437 _Arguments_: 5438 IMAGE the positive scalar id of the image in the 5439 current TEAM. 5440 TEAM optional; team on the which the inquiry is to be 5441 performed. 5442 5443 _NOTES_ 5444 This function follows TS18508. Because team-functionality is not 5445 yet implemented a null-pointer is passed for the TEAM argument at 5446 the moment. 5447 5448 5449 File: gfortran.info, Node: _gfortran_caf_failed_images, Next: _gfortran_caf_stopped_images, Prev: _gfortran_caf_image_status, Up: Function ABI Documentation 5450 5451 7.2.6 '_gfortran_caf_failed_images' -- Get an array of the indexes of the failed images 5452 --------------------------------------------------------------------------------------- 5453 5454 _Description_: 5455 Get an array of image indexes in the current TEAM that have failed. 5456 The array is sorted ascendingly. When TEAM is not provided the 5457 current team is to be used. When KIND is provided then the 5458 resulting array is of that integer kind else it is of default 5459 integer kind. The returns an unallocated size zero array when no 5460 images have failed. 5461 5462 _Syntax_: 5463 'int _gfortran_caf_failed_images (caf_team_t * team, int * kind)' 5464 5465 _Arguments_: 5466 TEAM optional; team on the which the inquiry is to be 5467 performed. 5468 IMAGE optional; the kind of the resulting integer 5469 array. 5470 5471 _NOTES_ 5472 This function follows TS18508. Because team-functionality is not 5473 yet implemented a null-pointer is passed for the TEAM argument at 5474 the moment. 5475 5476 5477 File: gfortran.info, Node: _gfortran_caf_stopped_images, Next: _gfortran_caf_register, Prev: _gfortran_caf_failed_images, Up: Function ABI Documentation 5478 5479 7.2.7 '_gfortran_caf_stopped_images' -- Get an array of the indexes of the stopped images 5480 ----------------------------------------------------------------------------------------- 5481 5482 _Description_: 5483 Get an array of image indexes in the current TEAM that have 5484 stopped. The array is sorted ascendingly. When TEAM is not 5485 provided the current team is to be used. When KIND is provided 5486 then the resulting array is of that integer kind else it is of 5487 default integer kind. The returns an unallocated size zero array 5488 when no images have failed. 5489 5490 _Syntax_: 5491 'int _gfortran_caf_stopped_images (caf_team_t * team, int * kind)' 5492 5493 _Arguments_: 5494 TEAM optional; team on the which the inquiry is to be 5495 performed. 5496 IMAGE optional; the kind of the resulting integer 5497 array. 5498 5499 _NOTES_ 5500 This function follows TS18508. Because team-functionality is not 5501 yet implemented a null-pointer is passed for the TEAM argument at 5502 the moment. 5503 5504 5505 File: gfortran.info, Node: _gfortran_caf_register, Next: _gfortran_caf_deregister, Prev: _gfortran_caf_stopped_images, Up: Function ABI Documentation 5506 5507 7.2.8 '_gfortran_caf_register' -- Registering coarrays 5508 ------------------------------------------------------ 5509 5510 _Description_: 5511 Registers memory for a coarray and creates a token to identify the 5512 coarray. The routine is called for both coarrays with 'SAVE' 5513 attribute and using an explicit 'ALLOCATE' statement. If an error 5514 occurs and STAT is a 'NULL' pointer, the function shall abort with 5515 printing an error message and starting the error termination. If 5516 no error occurs and STAT is present, it shall be set to zero. 5517 Otherwise, it shall be set to a positive value and, if not-'NULL', 5518 ERRMSG shall be set to a string describing the failure. The 5519 routine shall register the memory provided in the 'DATA'-component 5520 of the array descriptor DESC, when that component is non-'NULL', 5521 else it shall allocate sufficient memory and provide a pointer to 5522 it in the 'DATA'-component of DESC. The array descriptor has rank 5523 zero, when a scalar object is to be registered and the array 5524 descriptor may be invalid after the call to 5525 '_gfortran_caf_register'. When an array is to be allocated the 5526 descriptor persists. 5527 5528 For 'CAF_REGTYPE_COARRAY_STATIC' and 'CAF_REGTYPE_COARRAY_ALLOC', 5529 the passed size is the byte size requested. For 5530 'CAF_REGTYPE_LOCK_STATIC', 'CAF_REGTYPE_LOCK_ALLOC' and 5531 'CAF_REGTYPE_CRITICAL' it is the array size or one for a scalar. 5532 5533 When 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' is used, then only a 5534 token for an allocatable or pointer component is created. The 5535 'SIZE' parameter is not used then. On the contrary when 5536 'CAF_REGTYPE_COARRAY_ALLOC_ALLOCATE_ONLY' is specified, then the 5537 TOKEN needs to be registered by a previous call with regtype 5538 'CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY' and either the memory 5539 specified in the DESC's data-ptr is registered or allocate when the 5540 data-ptr is 'NULL'. 5541 5542 _Syntax_: 5543 'void caf_register (size_t size, caf_register_t type, caf_token_t 5544 *token, gfc_descriptor_t *desc, int *stat, char *errmsg, size_t 5545 errmsg_len)' 5546 5547 _Arguments_: 5548 SIZE For normal coarrays, the byte size of the 5549 coarray to be allocated; for lock types and 5550 event types, the number of elements. 5551 TYPE one of the caf_register_t types. 5552 TOKEN intent(out) An opaque pointer identifying the 5553 coarray. 5554 DESC intent(inout) The (pseudo) array descriptor. 5555 STAT intent(out) For allocatable coarrays, stores the 5556 STAT=; may be 'NULL' 5557 ERRMSG intent(out) When an error occurs, this will be 5558 set to an error message; may be 'NULL' 5559 ERRMSG_LEN the buffer size of errmsg. 5560 5561 _NOTES_ 5562 Nonallocatable coarrays have to be registered prior use from remote 5563 images. In order to guarantee this, they have to be registered 5564 before the main program. This can be achieved by creating 5565 constructor functions. That is what GCC does such that also for 5566 nonallocatable coarrays the memory is allocated and no static 5567 memory is used. The token permits to identify the coarray; to the 5568 processor, the token is a nonaliasing pointer. The library can, 5569 for instance, store the base address of the coarray in the token, 5570 some handle or a more complicated struct. The library may also 5571 store the array descriptor DESC when its rank is non-zero. 5572 5573 For lock types, the value shall only be used for checking the 5574 allocation status. Note that for critical blocks, the locking is 5575 only required on one image; in the locking statement, the processor 5576 shall always pass an image index of one for critical-block lock 5577 variables ('CAF_REGTYPE_CRITICAL'). For lock types and 5578 critical-block variables, the initial value shall be unlocked (or, 5579 respectively, not in critical section) such as the value false; for 5580 event types, the initial state should be no event, e.g. zero. 5581 5582 5583 File: gfortran.info, Node: _gfortran_caf_deregister, Next: _gfortran_caf_is_present, Prev: _gfortran_caf_register, Up: Function ABI Documentation 5584 5585 7.2.9 '_gfortran_caf_deregister' -- Deregistering coarrays 5586 ---------------------------------------------------------- 5587 5588 _Description_: 5589 Called to free or deregister the memory of a coarray; the processor 5590 calls this function for automatic and explicit deallocation. In 5591 case of an error, this function shall fail with an error message, 5592 unless the STAT variable is not null. The library is only expected 5593 to free memory it allocated itself during a call to 5594 '_gfortran_caf_register'. 5595 5596 _Syntax_: 5597 'void caf_deregister (caf_token_t *token, caf_deregister_t type, 5598 int *stat, char *errmsg, size_t errmsg_len)' 5599 5600 _Arguments_: 5601 TOKEN the token to free. 5602 TYPE the type of action to take for the coarray. A 5603 'CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY' is 5604 allowed only for allocatable or pointer 5605 components of derived type coarrays. The action 5606 only deallocates the local memory without 5607 deleting the token. 5608 STAT intent(out) Stores the STAT=; may be NULL 5609 ERRMSG intent(out) When an error occurs, this will be 5610 set to an error message; may be NULL 5611 ERRMSG_LEN the buffer size of errmsg. 5612 5613 _NOTES_ 5614 For nonalloatable coarrays this function is never called. If a 5615 cleanup is required, it has to be handled via the finish, stop and 5616 error stop functions, and via destructors. 5617 5618 5619 File: gfortran.info, Node: _gfortran_caf_is_present, Next: _gfortran_caf_send, Prev: _gfortran_caf_deregister, Up: Function ABI Documentation 5620 5621 7.2.10 '_gfortran_caf_is_present' -- Query whether an allocatable or pointer component in a derived type coarray is allocated 5622 ----------------------------------------------------------------------------------------------------------------------------- 5623 5624 _Description_: 5625 Used to query the coarray library whether an allocatable component 5626 in a derived type coarray is allocated on a remote image. 5627 5628 _Syntax_: 5629 'void _gfortran_caf_is_present (caf_token_t token, int image_index, 5630 gfc_reference_t *ref)' 5631 5632 _Arguments_: 5633 TOKEN An opaque pointer identifying the coarray. 5634 IMAGE_INDEX The ID of the remote image; must be a positive 5635 number. 5636 REF A chain of references to address the allocatable 5637 or pointer component in the derived type 5638 coarray. The object reference needs to be a 5639 scalar or a full array reference, respectively. 5640 5641 5642 File: gfortran.info, Node: _gfortran_caf_send, Next: _gfortran_caf_get, Prev: _gfortran_caf_is_present, Up: Function ABI Documentation 5643 5644 7.2.11 '_gfortran_caf_send' -- Sending data from a local image to a remote image 5645 -------------------------------------------------------------------------------- 5646 5647 _Description_: 5648 Called to send a scalar, an array section or a whole array from a 5649 local to a remote image identified by the image_index. 5650 5651 _Syntax_: 5652 'void _gfortran_caf_send (caf_token_t token, size_t offset, int 5653 image_index, gfc_descriptor_t *dest, caf_vector_t *dst_vector, 5654 gfc_descriptor_t *src, int dst_kind, int src_kind, bool 5655 may_require_tmp, int *stat)' 5656 5657 _Arguments_: 5658 TOKEN intent(in) An opaque pointer identifying the 5659 coarray. 5660 OFFSET intent(in) By which amount of bytes the actual 5661 data is shifted compared to the base address of 5662 the coarray. 5663 IMAGE_INDEX intent(in) The ID of the remote image; must be a 5664 positive number. 5665 DEST intent(in) Array descriptor for the remote image 5666 for the bounds and the size. The 'base_addr' 5667 shall not be accessed. 5668 DST_VECTOR intent(in) If not NULL, it contains the vector 5669 subscript of the destination array; the values 5670 are relative to the dimension triplet of the 5671 dest argument. 5672 SRC intent(in) Array descriptor of the local array 5673 to be transferred to the remote image 5674 DST_KIND intent(in) Kind of the destination argument 5675 SRC_KIND intent(in) Kind of the source argument 5676 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 5677 known at compile time that the DEST and SRC 5678 either cannot overlap or overlap (fully or 5679 partially) such that walking SRC and DEST in 5680 element wise element order (honoring the stride 5681 value) will not lead to wrong results. 5682 Otherwise, the value is 'true'. 5683 STAT intent(out) when non-NULL give the result of the 5684 operation, i.e., zero on success and non-zero on 5685 error. When NULL and an error occurs, then an 5686 error message is printed and the program is 5687 terminated. 5688 5689 _NOTES_ 5690 It is permitted to have IMAGE_INDEX equal the current image; the 5691 memory of the send-to and the send-from might (partially) overlap 5692 in that case. The implementation has to take care that it handles 5693 this case, e.g. using 'memmove' which handles (partially) 5694 overlapping memory. If MAY_REQUIRE_TMP is true, the library might 5695 additionally create a temporary variable, unless additional checks 5696 show that this is not required (e.g. because walking backward is 5697 possible or because both arrays are contiguous and 'memmove' takes 5698 care of overlap issues). 5699 5700 Note that the assignment of a scalar to an array is permitted. In 5701 addition, the library has to handle numeric-type conversion and for 5702 strings, padding and different character kinds. 5703 5704 5705 File: gfortran.info, Node: _gfortran_caf_get, Next: _gfortran_caf_sendget, Prev: _gfortran_caf_send, Up: Function ABI Documentation 5706 5707 7.2.12 '_gfortran_caf_get' -- Getting data from a remote image 5708 -------------------------------------------------------------- 5709 5710 _Description_: 5711 Called to get an array section or a whole array from a remote, 5712 image identified by the image_index. 5713 5714 _Syntax_: 5715 'void _gfortran_caf_get (caf_token_t token, size_t offset, int 5716 image_index, gfc_descriptor_t *src, caf_vector_t *src_vector, 5717 gfc_descriptor_t *dest, int src_kind, int dst_kind, bool 5718 may_require_tmp, int *stat)' 5719 5720 _Arguments_: 5721 TOKEN intent(in) An opaque pointer identifying the 5722 coarray. 5723 OFFSET intent(in) By which amount of bytes the actual 5724 data is shifted compared to the base address of 5725 the coarray. 5726 IMAGE_INDEX intent(in) The ID of the remote image; must be a 5727 positive number. 5728 DEST intent(out) Array descriptor of the local array 5729 to store the data retrieved from the remote 5730 image 5731 SRC intent(in) Array descriptor for the remote image 5732 for the bounds and the size. The 'base_addr' 5733 shall not be accessed. 5734 SRC_VECTOR intent(in) If not NULL, it contains the vector 5735 subscript of the source array; the values are 5736 relative to the dimension triplet of the SRC 5737 argument. 5738 DST_KIND intent(in) Kind of the destination argument 5739 SRC_KIND intent(in) Kind of the source argument 5740 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 5741 known at compile time that the DEST and SRC 5742 either cannot overlap or overlap (fully or 5743 partially) such that walking SRC and DEST in 5744 element wise element order (honoring the stride 5745 value) will not lead to wrong results. 5746 Otherwise, the value is 'true'. 5747 STAT intent(out) When non-NULL give the result of the 5748 operation, i.e., zero on success and non-zero on 5749 error. When NULL and an error occurs, then an 5750 error message is printed and the program is 5751 terminated. 5752 5753 _NOTES_ 5754 It is permitted to have IMAGE_INDEX equal the current image; the 5755 memory of the send-to and the send-from might (partially) overlap 5756 in that case. The implementation has to take care that it handles 5757 this case, e.g. using 'memmove' which handles (partially) 5758 overlapping memory. If MAY_REQUIRE_TMP is true, the library might 5759 additionally create a temporary variable, unless additional checks 5760 show that this is not required (e.g. because walking backward is 5761 possible or because both arrays are contiguous and 'memmove' takes 5762 care of overlap issues). 5763 5764 Note that the library has to handle numeric-type conversion and for 5765 strings, padding and different character kinds. 5766 5767 5768 File: gfortran.info, Node: _gfortran_caf_sendget, Next: _gfortran_caf_send_by_ref, Prev: _gfortran_caf_get, Up: Function ABI Documentation 5769 5770 7.2.13 '_gfortran_caf_sendget' -- Sending data between remote images 5771 -------------------------------------------------------------------- 5772 5773 _Description_: 5774 Called to send a scalar, an array section or a whole array from a 5775 remote image identified by the SRC_IMAGE_INDEX to a remote image 5776 identified by the DST_IMAGE_INDEX. 5777 5778 _Syntax_: 5779 'void _gfortran_caf_sendget (caf_token_t dst_token, size_t 5780 dst_offset, int dst_image_index, gfc_descriptor_t *dest, 5781 caf_vector_t *dst_vector, caf_token_t src_token, size_t src_offset, 5782 int src_image_index, gfc_descriptor_t *src, caf_vector_t 5783 *src_vector, int dst_kind, int src_kind, bool may_require_tmp, int 5784 *stat)' 5785 5786 _Arguments_: 5787 DST_TOKEN intent(in) An opaque pointer identifying the 5788 destination coarray. 5789 DST_OFFSET intent(in) By which amount of bytes the actual 5790 data is shifted compared to the base address of 5791 the destination coarray. 5792 DST_IMAGE_INDEXintent(in) The ID of the destination remote 5793 image; must be a positive number. 5794 DEST intent(in) Array descriptor for the destination 5795 remote image for the bounds and the size. The 5796 'base_addr' shall not be accessed. 5797 DST_VECTOR intent(int) If not NULL, it contains the vector 5798 subscript of the destination array; the values 5799 are relative to the dimension triplet of the 5800 DEST argument. 5801 SRC_TOKEN intent(in) An opaque pointer identifying the 5802 source coarray. 5803 SRC_OFFSET intent(in) By which amount of bytes the actual 5804 data is shifted compared to the base address of 5805 the source coarray. 5806 SRC_IMAGE_INDEXintent(in) The ID of the source remote image; 5807 must be a positive number. 5808 SRC intent(in) Array descriptor of the local array 5809 to be transferred to the remote image. 5810 SRC_VECTOR intent(in) Array descriptor of the local array 5811 to be transferred to the remote image 5812 DST_KIND intent(in) Kind of the destination argument 5813 SRC_KIND intent(in) Kind of the source argument 5814 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 5815 known at compile time that the DEST and SRC 5816 either cannot overlap or overlap (fully or 5817 partially) such that walking SRC and DEST in 5818 element wise element order (honoring the stride 5819 value) will not lead to wrong results. 5820 Otherwise, the value is 'true'. 5821 STAT intent(out) when non-NULL give the result of the 5822 operation, i.e., zero on success and non-zero on 5823 error. When NULL and an error occurs, then an 5824 error message is printed and the program is 5825 terminated. 5826 5827 _NOTES_ 5828 It is permitted to have the same image index for both 5829 SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and 5830 the send-from might (partially) overlap in that case. The 5831 implementation has to take care that it handles this case, e.g. 5832 using 'memmove' which handles (partially) overlapping memory. If 5833 MAY_REQUIRE_TMP is true, the library might additionally create a 5834 temporary variable, unless additional checks show that this is not 5835 required (e.g. because walking backward is possible or because 5836 both arrays are contiguous and 'memmove' takes care of overlap 5837 issues). 5838 5839 Note that the assignment of a scalar to an array is permitted. In 5840 addition, the library has to handle numeric-type conversion and for 5841 strings, padding and different character kinds. 5842 5843 5844 File: gfortran.info, Node: _gfortran_caf_send_by_ref, Next: _gfortran_caf_get_by_ref, Prev: _gfortran_caf_sendget, Up: Function ABI Documentation 5845 5846 7.2.14 '_gfortran_caf_send_by_ref' -- Sending data from a local image to a remote image with enhanced referencing options 5847 ------------------------------------------------------------------------------------------------------------------------- 5848 5849 _Description_: 5850 Called to send a scalar, an array section or a whole array from a 5851 local to a remote image identified by the IMAGE_INDEX. 5852 5853 _Syntax_: 5854 'void _gfortran_caf_send_by_ref (caf_token_t token, int 5855 image_index, gfc_descriptor_t *src, caf_reference_t *refs, int 5856 dst_kind, int src_kind, bool may_require_tmp, bool 5857 dst_reallocatable, int *stat, int dst_type)' 5858 5859 _Arguments_: 5860 TOKEN intent(in) An opaque pointer identifying the 5861 coarray. 5862 IMAGE_INDEX intent(in) The ID of the remote image; must be a 5863 positive number. 5864 SRC intent(in) Array descriptor of the local array 5865 to be transferred to the remote image 5866 REFS intent(in) The references on the remote array to 5867 store the data given by src. Guaranteed to have 5868 at least one entry. 5869 DST_KIND intent(in) Kind of the destination argument 5870 SRC_KIND intent(in) Kind of the source argument 5871 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 5872 known at compile time that the DEST and SRC 5873 either cannot overlap or overlap (fully or 5874 partially) such that walking SRC and DEST in 5875 element wise element order (honoring the stride 5876 value) will not lead to wrong results. 5877 Otherwise, the value is 'true'. 5878 DST_REALLOCATABLEintent(in) Set when the destination is of 5879 allocatable or pointer type and the refs will 5880 allow reallocation, i.e., the ref is a full 5881 array or component ref. 5882 STAT intent(out) When non-'NULL' give the result of 5883 the operation, i.e., zero on success and 5884 non-zero on error. When 'NULL' and an error 5885 occurs, then an error message is printed and the 5886 program is terminated. 5887 DST_TYPE intent(in) Give the type of the destination. 5888 When the destination is not an array, than the 5889 precise type, e.g. of a component in a derived 5890 type, is not known, but provided here. 5891 5892 _NOTES_ 5893 It is permitted to have IMAGE_INDEX equal the current image; the 5894 memory of the send-to and the send-from might (partially) overlap 5895 in that case. The implementation has to take care that it handles 5896 this case, e.g. using 'memmove' which handles (partially) 5897 overlapping memory. If MAY_REQUIRE_TMP is true, the library might 5898 additionally create a temporary variable, unless additional checks 5899 show that this is not required (e.g. because walking backward is 5900 possible or because both arrays are contiguous and 'memmove' takes 5901 care of overlap issues). 5902 5903 Note that the assignment of a scalar to an array is permitted. In 5904 addition, the library has to handle numeric-type conversion and for 5905 strings, padding and different character kinds. 5906 5907 Because of the more complicated references possible some operations 5908 may be unsupported by certain libraries. The library is expected 5909 to issue a precise error message why the operation is not 5910 permitted. 5911 5912 5913 File: gfortran.info, Node: _gfortran_caf_get_by_ref, Next: _gfortran_caf_sendget_by_ref, Prev: _gfortran_caf_send_by_ref, Up: Function ABI Documentation 5914 5915 7.2.15 '_gfortran_caf_get_by_ref' -- Getting data from a remote image using enhanced references 5916 ----------------------------------------------------------------------------------------------- 5917 5918 _Description_: 5919 Called to get a scalar, an array section or a whole array from a 5920 remote image identified by the IMAGE_INDEX. 5921 5922 _Syntax_: 5923 'void _gfortran_caf_get_by_ref (caf_token_t token, int image_index, 5924 caf_reference_t *refs, gfc_descriptor_t *dst, int dst_kind, int 5925 src_kind, bool may_require_tmp, bool dst_reallocatable, int *stat, 5926 int src_type)' 5927 5928 _Arguments_: 5929 TOKEN intent(in) An opaque pointer identifying the 5930 coarray. 5931 IMAGE_INDEX intent(in) The ID of the remote image; must be a 5932 positive number. 5933 REFS intent(in) The references to apply to the remote 5934 structure to get the data. 5935 DST intent(in) Array descriptor of the local array 5936 to store the data transferred from the remote 5937 image. May be reallocated where needed and when 5938 DST_REALLOCATABLE allows it. 5939 DST_KIND intent(in) Kind of the destination argument 5940 SRC_KIND intent(in) Kind of the source argument 5941 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 5942 known at compile time that the DEST and SRC 5943 either cannot overlap or overlap (fully or 5944 partially) such that walking SRC and DEST in 5945 element wise element order (honoring the stride 5946 value) will not lead to wrong results. 5947 Otherwise, the value is 'true'. 5948 DST_REALLOCATABLEintent(in) Set when DST is of allocatable or 5949 pointer type and its refs allow reallocation, 5950 i.e., the full array or a component is 5951 referenced. 5952 STAT intent(out) When non-'NULL' give the result of 5953 the operation, i.e., zero on success and 5954 non-zero on error. When 'NULL' and an error 5955 occurs, then an error message is printed and the 5956 program is terminated. 5957 SRC_TYPE intent(in) Give the type of the source. When 5958 the source is not an array, than the precise 5959 type, e.g. of a component in a derived type, is 5960 not known, but provided here. 5961 5962 _NOTES_ 5963 It is permitted to have 'image_index' equal the current image; the 5964 memory of the send-to and the send-from might (partially) overlap 5965 in that case. The implementation has to take care that it handles 5966 this case, e.g. using 'memmove' which handles (partially) 5967 overlapping memory. If MAY_REQUIRE_TMP is true, the library might 5968 additionally create a temporary variable, unless additional checks 5969 show that this is not required (e.g. because walking backward is 5970 possible or because both arrays are contiguous and 'memmove' takes 5971 care of overlap issues). 5972 5973 Note that the library has to handle numeric-type conversion and for 5974 strings, padding and different character kinds. 5975 5976 Because of the more complicated references possible some operations 5977 may be unsupported by certain libraries. The library is expected 5978 to issue a precise error message why the operation is not 5979 permitted. 5980 5981 5982 File: gfortran.info, Node: _gfortran_caf_sendget_by_ref, Next: _gfortran_caf_lock, Prev: _gfortran_caf_get_by_ref, Up: Function ABI Documentation 5983 5984 7.2.16 '_gfortran_caf_sendget_by_ref' -- Sending data between remote images using enhanced references on both sides 5985 ------------------------------------------------------------------------------------------------------------------- 5986 5987 _Description_: 5988 Called to send a scalar, an array section or a whole array from a 5989 remote image identified by the SRC_IMAGE_INDEX to a remote image 5990 identified by the DST_IMAGE_INDEX. 5991 5992 _Syntax_: 5993 'void _gfortran_caf_sendget_by_ref (caf_token_t dst_token, int 5994 dst_image_index, caf_reference_t *dst_refs, caf_token_t src_token, 5995 int src_image_index, caf_reference_t *src_refs, int dst_kind, int 5996 src_kind, bool may_require_tmp, int *dst_stat, int *src_stat, int 5997 dst_type, int src_type)' 5998 5999 _Arguments_: 6000 DST_TOKEN intent(in) An opaque pointer identifying the 6001 destination coarray. 6002 DST_IMAGE_INDEXintent(in) The ID of the destination remote 6003 image; must be a positive number. 6004 DST_REFS intent(in) The references on the remote array to 6005 store the data given by the source. Guaranteed 6006 to have at least one entry. 6007 SRC_TOKEN intent(in) An opaque pointer identifying the 6008 source coarray. 6009 SRC_IMAGE_INDEXintent(in) The ID of the source remote image; 6010 must be a positive number. 6011 SRC_REFS intent(in) The references to apply to the remote 6012 structure to get the data. 6013 DST_KIND intent(in) Kind of the destination argument 6014 SRC_KIND intent(in) Kind of the source argument 6015 MAY_REQUIRE_TMPintent(in) The variable is 'false' when it is 6016 known at compile time that the DEST and SRC 6017 either cannot overlap or overlap (fully or 6018 partially) such that walking SRC and DEST in 6019 element wise element order (honoring the stride 6020 value) will not lead to wrong results. 6021 Otherwise, the value is 'true'. 6022 DST_STAT intent(out) when non-'NULL' give the result of 6023 the send-operation, i.e., zero on success and 6024 non-zero on error. When 'NULL' and an error 6025 occurs, then an error message is printed and the 6026 program is terminated. 6027 SRC_STAT intent(out) When non-'NULL' give the result of 6028 the get-operation, i.e., zero on success and 6029 non-zero on error. When 'NULL' and an error 6030 occurs, then an error message is printed and the 6031 program is terminated. 6032 DST_TYPE intent(in) Give the type of the destination. 6033 When the destination is not an array, than the 6034 precise type, e.g. of a component in a derived 6035 type, is not known, but provided here. 6036 SRC_TYPE intent(in) Give the type of the source. When 6037 the source is not an array, than the precise 6038 type, e.g. of a component in a derived type, is 6039 not known, but provided here. 6040 6041 _NOTES_ 6042 It is permitted to have the same image index for both 6043 SRC_IMAGE_INDEX and DST_IMAGE_INDEX; the memory of the send-to and 6044 the send-from might (partially) overlap in that case. The 6045 implementation has to take care that it handles this case, e.g. 6046 using 'memmove' which handles (partially) overlapping memory. If 6047 MAY_REQUIRE_TMP is true, the library might additionally create a 6048 temporary variable, unless additional checks show that this is not 6049 required (e.g. because walking backward is possible or because 6050 both arrays are contiguous and 'memmove' takes care of overlap 6051 issues). 6052 6053 Note that the assignment of a scalar to an array is permitted. In 6054 addition, the library has to handle numeric-type conversion and for 6055 strings, padding and different character kinds. 6056 6057 Because of the more complicated references possible some operations 6058 may be unsupported by certain libraries. The library is expected 6059 to issue a precise error message why the operation is not 6060 permitted. 6061 6062 6063 File: gfortran.info, Node: _gfortran_caf_lock, Next: _gfortran_caf_unlock, Prev: _gfortran_caf_sendget_by_ref, Up: Function ABI Documentation 6064 6065 7.2.17 '_gfortran_caf_lock' -- Locking a lock variable 6066 ------------------------------------------------------ 6067 6068 _Description_: 6069 Acquire a lock on the given image on a scalar locking variable or 6070 for the given array element for an array-valued variable. If the 6071 ACQUIRED_LOCK is 'NULL', the function returns after having obtained 6072 the lock. If it is non-'NULL', then ACQUIRED_LOCK is assigned the 6073 value true (one) when the lock could be obtained and false (zero) 6074 otherwise. Locking a lock variable which has already been locked 6075 by the same image is an error. 6076 6077 _Syntax_: 6078 'void _gfortran_caf_lock (caf_token_t token, size_t index, int 6079 image_index, int *acquired_lock, int *stat, char *errmsg, size_t 6080 errmsg_len)' 6081 6082 _Arguments_: 6083 TOKEN intent(in) An opaque pointer identifying the 6084 coarray. 6085 INDEX intent(in) Array index; first array index is 0. 6086 For scalars, it is always 0. 6087 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6088 positive number. 6089 ACQUIRED_LOCKintent(out) If not NULL, it returns whether lock 6090 could be obtained. 6091 STAT intent(out) Stores the STAT=; may be NULL. 6092 ERRMSG intent(out) When an error occurs, this will be 6093 set to an error message; may be NULL. 6094 ERRMSG_LEN intent(in) the buffer size of errmsg 6095 6096 _NOTES_ 6097 This function is also called for critical blocks; for those, the 6098 array index is always zero and the image index is one. Libraries 6099 are permitted to use other images for critical-block locking 6100 variables. 6101 6102 6103 File: gfortran.info, Node: _gfortran_caf_unlock, Next: _gfortran_caf_event_post, Prev: _gfortran_caf_lock, Up: Function ABI Documentation 6104 6105 7.2.18 '_gfortran_caf_lock' -- Unlocking a lock variable 6106 -------------------------------------------------------- 6107 6108 _Description_: 6109 Release a lock on the given image on a scalar locking variable or 6110 for the given array element for an array-valued variable. 6111 Unlocking a lock variable which is unlocked or has been locked by a 6112 different image is an error. 6113 6114 _Syntax_: 6115 'void _gfortran_caf_unlock (caf_token_t token, size_t index, int 6116 image_index, int *stat, char *errmsg, size_t errmsg_len)' 6117 6118 _Arguments_: 6119 TOKEN intent(in) An opaque pointer identifying the 6120 coarray. 6121 INDEX intent(in) Array index; first array index is 0. 6122 For scalars, it is always 0. 6123 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6124 positive number. 6125 STAT intent(out) For allocatable coarrays, stores the 6126 STAT=; may be NULL. 6127 ERRMSG intent(out) When an error occurs, this will be 6128 set to an error message; may be NULL. 6129 ERRMSG_LEN intent(in) the buffer size of errmsg 6130 6131 _NOTES_ 6132 This function is also called for critical block; for those, the 6133 array index is always zero and the image index is one. Libraries 6134 are permitted to use other images for critical-block locking 6135 variables. 6136 6137 6138 File: gfortran.info, Node: _gfortran_caf_event_post, Next: _gfortran_caf_event_wait, Prev: _gfortran_caf_unlock, Up: Function ABI Documentation 6139 6140 7.2.19 '_gfortran_caf_event_post' -- Post an event 6141 -------------------------------------------------- 6142 6143 _Description_: 6144 Increment the event count of the specified event variable. 6145 6146 _Syntax_: 6147 'void _gfortran_caf_event_post (caf_token_t token, size_t index, 6148 int image_index, int *stat, char *errmsg, size_t errmsg_len)' 6149 6150 _Arguments_: 6151 TOKEN intent(in) An opaque pointer identifying the 6152 coarray. 6153 INDEX intent(in) Array index; first array index is 0. 6154 For scalars, it is always 0. 6155 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6156 positive number; zero indicates the current 6157 image, when accessed noncoindexed. 6158 STAT intent(out) Stores the STAT=; may be NULL. 6159 ERRMSG intent(out) When an error occurs, this will be 6160 set to an error message; may be NULL. 6161 ERRMSG_LEN intent(in) the buffer size of errmsg 6162 6163 _NOTES_ 6164 This acts like an atomic add of one to the remote image's event 6165 variable. The statement is an image-control statement but does not 6166 imply sync memory. Still, all preceeding push communications of 6167 this image to the specified remote image have to be completed 6168 before 'event_wait' on the remote image returns. 6169 6170 6171 File: gfortran.info, Node: _gfortran_caf_event_wait, Next: _gfortran_caf_event_query, Prev: _gfortran_caf_event_post, Up: Function ABI Documentation 6172 6173 7.2.20 '_gfortran_caf_event_wait' -- Wait that an event occurred 6174 ---------------------------------------------------------------- 6175 6176 _Description_: 6177 Wait until the event count has reached at least the specified 6178 UNTIL_COUNT; if so, atomically decrement the event variable by this 6179 amount and return. 6180 6181 _Syntax_: 6182 'void _gfortran_caf_event_wait (caf_token_t token, size_t index, 6183 int until_count, int *stat, char *errmsg, size_t errmsg_len)' 6184 6185 _Arguments_: 6186 TOKEN intent(in) An opaque pointer identifying the 6187 coarray. 6188 INDEX intent(in) Array index; first array index is 0. 6189 For scalars, it is always 0. 6190 UNTIL_COUNT intent(in) The number of events which have to be 6191 available before the function returns. 6192 STAT intent(out) Stores the STAT=; may be NULL. 6193 ERRMSG intent(out) When an error occurs, this will be 6194 set to an error message; may be NULL. 6195 ERRMSG_LEN intent(in) the buffer size of errmsg 6196 6197 _NOTES_ 6198 This function only operates on a local coarray. It acts like a 6199 loop checking atomically the value of the event variable, breaking 6200 if the value is greater or equal the requested number of counts. 6201 Before the function returns, the event variable has to be 6202 decremented by the requested UNTIL_COUNT value. A possible 6203 implementation would be a busy loop for a certain number of spins 6204 (possibly depending on the number of threads relative to the number 6205 of available cores) followed by another waiting strategy such as a 6206 sleeping wait (possibly with an increasing number of sleep time) 6207 or, if possible, a futex wait. 6208 6209 The statement is an image-control statement but does not imply sync 6210 memory. Still, all preceeding push communications of this image to 6211 the specified remote image have to be completed before 'event_wait' 6212 on the remote image returns. 6213 6214 6215 File: gfortran.info, Node: _gfortran_caf_event_query, Next: _gfortran_caf_sync_all, Prev: _gfortran_caf_event_wait, Up: Function ABI Documentation 6216 6217 7.2.21 '_gfortran_caf_event_query' -- Query event count 6218 ------------------------------------------------------- 6219 6220 _Description_: 6221 Return the event count of the specified event variable. 6222 6223 _Syntax_: 6224 'void _gfortran_caf_event_query (caf_token_t token, size_t index, 6225 int image_index, int *count, int *stat)' 6226 6227 _Arguments_: 6228 TOKEN intent(in) An opaque pointer identifying the 6229 coarray. 6230 INDEX intent(in) Array index; first array index is 0. 6231 For scalars, it is always 0. 6232 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6233 positive number; zero indicates the current 6234 image when accessed noncoindexed. 6235 COUNT intent(out) The number of events currently 6236 posted to the event variable. 6237 STAT intent(out) Stores the STAT=; may be NULL. 6238 6239 _NOTES_ 6240 The typical use is to check the local event variable to only call 6241 'event_wait' when the data is available. However, a coindexed 6242 variable is permitted; there is no ordering or synchronization 6243 implied. It acts like an atomic fetch of the value of the event 6244 variable. 6245 6246 6247 File: gfortran.info, Node: _gfortran_caf_sync_all, Next: _gfortran_caf_sync_images, Prev: _gfortran_caf_event_query, Up: Function ABI Documentation 6248 6249 7.2.22 '_gfortran_caf_sync_all' -- All-image barrier 6250 ---------------------------------------------------- 6251 6252 _Description_: 6253 Synchronization of all images in the current team; the program only 6254 continues on a given image after this function has been called on 6255 all images of the current team. Additionally, it ensures that all 6256 pending data transfers of previous segment have completed. 6257 6258 _Syntax_: 6259 'void _gfortran_caf_sync_all (int *stat, char *errmsg, size_t 6260 errmsg_len)' 6261 6262 _Arguments_: 6263 STAT intent(out) Stores the status STAT= and may be 6264 NULL. 6265 ERRMSG intent(out) When an error occurs, this will be 6266 set to an error message; may be NULL. 6267 ERRMSG_LEN intent(in) the buffer size of errmsg 6268 6269 6270 File: gfortran.info, Node: _gfortran_caf_sync_images, Next: _gfortran_caf_sync_memory, Prev: _gfortran_caf_sync_all, Up: Function ABI Documentation 6271 6272 7.2.23 '_gfortran_caf_sync_images' -- Barrier for selected images 6273 ----------------------------------------------------------------- 6274 6275 _Description_: 6276 Synchronization between the specified images; the program only 6277 continues on a given image after this function has been called on 6278 all images specified for that image. Note that one image can wait 6279 for all other images in the current team (e.g. via 'sync 6280 images(*)') while those only wait for that specific image. 6281 Additionally, 'sync images' ensures that all pending data transfers 6282 of previous segments have completed. 6283 6284 _Syntax_: 6285 'void _gfortran_caf_sync_images (int count, int images[], int 6286 *stat, char *errmsg, size_t errmsg_len)' 6287 6288 _Arguments_: 6289 COUNT intent(in) The number of images which are 6290 provided in the next argument. For a zero-sized 6291 array, the value is zero. For 'sync images 6292 (*)', the value is -1. 6293 IMAGES intent(in) An array with the images provided by 6294 the user. If COUNT is zero, a NULL pointer is 6295 passed. 6296 STAT intent(out) Stores the status STAT= and may be 6297 NULL. 6298 ERRMSG intent(out) When an error occurs, this will be 6299 set to an error message; may be NULL. 6300 ERRMSG_LEN intent(in) the buffer size of errmsg 6301 6302 6303 File: gfortran.info, Node: _gfortran_caf_sync_memory, Next: _gfortran_caf_error_stop, Prev: _gfortran_caf_sync_images, Up: Function ABI Documentation 6304 6305 7.2.24 '_gfortran_caf_sync_memory' -- Wait for completion of segment-memory operations 6306 -------------------------------------------------------------------------------------- 6307 6308 _Description_: 6309 Acts as optimization barrier between different segments. It also 6310 ensures that all pending memory operations of this image have been 6311 completed. 6312 6313 _Syntax_: 6314 'void _gfortran_caf_sync_memory (int *stat, char *errmsg, size_t 6315 errmsg_len)' 6316 6317 _Arguments_: 6318 STAT intent(out) Stores the status STAT= and may be 6319 NULL. 6320 ERRMSG intent(out) When an error occurs, this will be 6321 set to an error message; may be NULL. 6322 ERRMSG_LEN intent(in) the buffer size of errmsg 6323 6324 _NOTE_ A simple implementation could be 6325 '__asm__ __volatile__ ("":::"memory")' to prevent code movements. 6326 6327 6328 File: gfortran.info, Node: _gfortran_caf_error_stop, Next: _gfortran_caf_error_stop_str, Prev: _gfortran_caf_sync_memory, Up: Function ABI Documentation 6329 6330 7.2.25 '_gfortran_caf_error_stop' -- Error termination with exit code 6331 --------------------------------------------------------------------- 6332 6333 _Description_: 6334 Invoked for an 'ERROR STOP' statement which has an integer 6335 argument. The function should terminate the program with the 6336 specified exit code. 6337 6338 _Syntax_: 6339 'void _gfortran_caf_error_stop (int error)' 6340 6341 _Arguments_: 6342 ERROR intent(in) The exit status to be used. 6343 6344 6345 File: gfortran.info, Node: _gfortran_caf_error_stop_str, Next: _gfortran_caf_fail_image, Prev: _gfortran_caf_error_stop, Up: Function ABI Documentation 6346 6347 7.2.26 '_gfortran_caf_error_stop_str' -- Error termination with string 6348 ---------------------------------------------------------------------- 6349 6350 _Description_: 6351 Invoked for an 'ERROR STOP' statement which has a string as 6352 argument. The function should terminate the program with a 6353 nonzero-exit code. 6354 6355 _Syntax_: 6356 'void _gfortran_caf_error_stop (const char *string, size_t len)' 6357 6358 _Arguments_: 6359 STRING intent(in) the error message (not zero 6360 terminated) 6361 LEN intent(in) the length of the string 6362 6363 6364 File: gfortran.info, Node: _gfortran_caf_fail_image, Next: _gfortran_caf_atomic_define, Prev: _gfortran_caf_error_stop_str, Up: Function ABI Documentation 6365 6366 7.2.27 '_gfortran_caf_fail_image' -- Mark the image failed and end its execution 6367 -------------------------------------------------------------------------------- 6368 6369 _Description_: 6370 Invoked for an 'FAIL IMAGE' statement. The function should 6371 terminate the current image. 6372 6373 _Syntax_: 6374 'void _gfortran_caf_fail_image ()' 6375 6376 _NOTES_ 6377 This function follows TS18508. 6378 6379 6380 File: gfortran.info, Node: _gfortran_caf_atomic_define, Next: _gfortran_caf_atomic_ref, Prev: _gfortran_caf_fail_image, Up: Function ABI Documentation 6381 6382 7.2.28 '_gfortran_caf_atomic_define' -- Atomic variable assignment 6383 ------------------------------------------------------------------ 6384 6385 _Description_: 6386 Assign atomically a value to an integer or logical variable. 6387 6388 _Syntax_: 6389 'void _gfortran_caf_atomic_define (caf_token_t token, size_t 6390 offset, int image_index, void *value, int *stat, int type, int 6391 kind)' 6392 6393 _Arguments_: 6394 TOKEN intent(in) An opaque pointer identifying the 6395 coarray. 6396 OFFSET intent(in) By which amount of bytes the actual 6397 data is shifted compared to the base address of 6398 the coarray. 6399 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6400 positive number; zero indicates the current 6401 image when used noncoindexed. 6402 VALUE intent(in) the value to be assigned, passed by 6403 reference 6404 STAT intent(out) Stores the status STAT= and may be 6405 NULL. 6406 TYPE intent(in) The data type, i.e. 'BT_INTEGER' (1) 6407 or 'BT_LOGICAL' (2). 6408 KIND intent(in) The kind value (only 4; always 'int') 6409 6410 6411 File: gfortran.info, Node: _gfortran_caf_atomic_ref, Next: _gfortran_caf_atomic_cas, Prev: _gfortran_caf_atomic_define, Up: Function ABI Documentation 6412 6413 7.2.29 '_gfortran_caf_atomic_ref' -- Atomic variable reference 6414 -------------------------------------------------------------- 6415 6416 _Description_: 6417 Reference atomically a value of a kind-4 integer or logical 6418 variable. 6419 6420 _Syntax_: 6421 'void _gfortran_caf_atomic_ref (caf_token_t token, size_t offset, 6422 int image_index, void *value, int *stat, int type, int kind)' 6423 6424 _Arguments_: 6425 TOKEN intent(in) An opaque pointer identifying the 6426 coarray. 6427 OFFSET intent(in) By which amount of bytes the actual 6428 data is shifted compared to the base address of 6429 the coarray. 6430 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6431 positive number; zero indicates the current 6432 image when used noncoindexed. 6433 VALUE intent(out) The variable assigned the atomically 6434 referenced variable. 6435 STAT intent(out) Stores the status STAT= and may be 6436 NULL. 6437 TYPE the data type, i.e. 'BT_INTEGER' (1) or 6438 'BT_LOGICAL' (2). 6439 KIND The kind value (only 4; always 'int') 6440 6441 6442 File: gfortran.info, Node: _gfortran_caf_atomic_cas, Next: _gfortran_caf_atomic_op, Prev: _gfortran_caf_atomic_ref, Up: Function ABI Documentation 6443 6444 7.2.30 '_gfortran_caf_atomic_cas' -- Atomic compare and swap 6445 ------------------------------------------------------------ 6446 6447 _Description_: 6448 Atomic compare and swap of a kind-4 integer or logical variable. 6449 Assigns atomically the specified value to the atomic variable, if 6450 the latter has the value specified by the passed condition value. 6451 6452 _Syntax_: 6453 'void _gfortran_caf_atomic_cas (caf_token_t token, size_t offset, 6454 int image_index, void *old, void *compare, void *new_val, int 6455 *stat, int type, int kind)' 6456 6457 _Arguments_: 6458 TOKEN intent(in) An opaque pointer identifying the 6459 coarray. 6460 OFFSET intent(in) By which amount of bytes the actual 6461 data is shifted compared to the base address of 6462 the coarray. 6463 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6464 positive number; zero indicates the current 6465 image when used noncoindexed. 6466 OLD intent(out) The value which the atomic variable 6467 had just before the cas operation. 6468 COMPARE intent(in) The value used for comparision. 6469 NEW_VAL intent(in) The new value for the atomic 6470 variable, assigned to the atomic variable, if 6471 'compare' equals the value of the atomic 6472 variable. 6473 STAT intent(out) Stores the status STAT= and may be 6474 NULL. 6475 TYPE intent(in) the data type, i.e. 'BT_INTEGER' (1) 6476 or 'BT_LOGICAL' (2). 6477 KIND intent(in) The kind value (only 4; always 'int') 6478 6479 6480 File: gfortran.info, Node: _gfortran_caf_atomic_op, Next: _gfortran_caf_co_broadcast, Prev: _gfortran_caf_atomic_cas, Up: Function ABI Documentation 6481 6482 7.2.31 '_gfortran_caf_atomic_op' -- Atomic operation 6483 ---------------------------------------------------- 6484 6485 _Description_: 6486 Apply an operation atomically to an atomic integer or logical 6487 variable. After the operation, OLD contains the value just before 6488 the operation, which, respectively, adds (GFC_CAF_ATOMIC_ADD) 6489 atomically the 'value' to the atomic integer variable or does a 6490 bitwise AND, OR or exclusive OR between the atomic variable and 6491 VALUE; the result is then stored in the atomic variable. 6492 6493 _Syntax_: 6494 'void _gfortran_caf_atomic_op (int op, caf_token_t token, size_t 6495 offset, int image_index, void *value, void *old, int *stat, int 6496 type, int kind)' 6497 6498 _Arguments_: 6499 OP intent(in) the operation to be performed; 6500 possible values 'GFC_CAF_ATOMIC_ADD' (1), 6501 'GFC_CAF_ATOMIC_AND' (2), 'GFC_CAF_ATOMIC_OR' 6502 (3), 'GFC_CAF_ATOMIC_XOR' (4). 6503 TOKEN intent(in) An opaque pointer identifying the 6504 coarray. 6505 OFFSET intent(in) By which amount of bytes the actual 6506 data is shifted compared to the base address of 6507 the coarray. 6508 IMAGE_INDEX intent(in) The ID of the remote image; must be a 6509 positive number; zero indicates the current 6510 image when used noncoindexed. 6511 OLD intent(out) The value which the atomic variable 6512 had just before the atomic operation. 6513 VAL intent(in) The new value for the atomic 6514 variable, assigned to the atomic variable, if 6515 'compare' equals the value of the atomic 6516 variable. 6517 STAT intent(out) Stores the status STAT= and may be 6518 NULL. 6519 TYPE intent(in) the data type, i.e. 'BT_INTEGER' (1) 6520 or 'BT_LOGICAL' (2) 6521 KIND intent(in) the kind value (only 4; always 'int') 6522 6523 6524 File: gfortran.info, Node: _gfortran_caf_co_broadcast, Next: _gfortran_caf_co_max, Prev: _gfortran_caf_atomic_op, Up: Function ABI Documentation 6525 6526 7.2.32 '_gfortran_caf_co_broadcast' -- Sending data to all images 6527 ----------------------------------------------------------------- 6528 6529 _Description_: 6530 Distribute a value from a given image to all other images in the 6531 team. Has to be called collectively. 6532 6533 _Syntax_: 6534 'void _gfortran_caf_co_broadcast (gfc_descriptor_t *a, int 6535 source_image, int *stat, char *errmsg, size_t errmsg_len)' 6536 6537 _Arguments_: 6538 A intent(inout) An array descriptor with the data 6539 to be broadcasted (on SOURCE_IMAGE) or to be 6540 received (other images). 6541 SOURCE_IMAGEintent(in) The ID of the image from which the 6542 data should be broadcasted. 6543 STAT intent(out) Stores the status STAT= and may be 6544 NULL. 6545 ERRMSG intent(out) When an error occurs, this will be 6546 set to an error message; may be NULL. 6547 ERRMSG_LEN intent(in) the buffer size of errmsg. 6548 6549 6550 File: gfortran.info, Node: _gfortran_caf_co_max, Next: _gfortran_caf_co_min, Prev: _gfortran_caf_co_broadcast, Up: Function ABI Documentation 6551 6552 7.2.33 '_gfortran_caf_co_max' -- Collective maximum reduction 6553 ------------------------------------------------------------- 6554 6555 _Description_: 6556 Calculates for each array element of the variable A the maximum 6557 value for that element in the current team; if RESULT_IMAGE has the 6558 value 0, the result shall be stored on all images, otherwise, only 6559 on the specified image. This function operates on numeric values 6560 and character strings. 6561 6562 _Syntax_: 6563 'void _gfortran_caf_co_max (gfc_descriptor_t *a, int result_image, 6564 int *stat, char *errmsg, int a_len, size_t errmsg_len)' 6565 6566 _Arguments_: 6567 A intent(inout) An array descriptor for the data 6568 to be processed. On the destination image(s) 6569 the result overwrites the old content. 6570 RESULT_IMAGEintent(in) The ID of the image to which the 6571 reduced value should be copied to; if zero, it 6572 has to be copied to all images. 6573 STAT intent(out) Stores the status STAT= and may be 6574 NULL. 6575 ERRMSG intent(out) When an error occurs, this will be 6576 set to an error message; may be NULL. 6577 A_LEN intent(in) the string length of argument A 6578 ERRMSG_LEN intent(in) the buffer size of errmsg 6579 6580 _NOTES_ 6581 If RESULT_IMAGE is nonzero, the data in the array descriptor A on 6582 all images except of the specified one become undefined; hence, the 6583 library may make use of this. 6584 6585 6586 File: gfortran.info, Node: _gfortran_caf_co_min, Next: _gfortran_caf_co_sum, Prev: _gfortran_caf_co_max, Up: Function ABI Documentation 6587 6588 7.2.34 '_gfortran_caf_co_min' -- Collective minimum reduction 6589 ------------------------------------------------------------- 6590 6591 _Description_: 6592 Calculates for each array element of the variable A the minimum 6593 value for that element in the current team; if RESULT_IMAGE has the 6594 value 0, the result shall be stored on all images, otherwise, only 6595 on the specified image. This function operates on numeric values 6596 and character strings. 6597 6598 _Syntax_: 6599 'void _gfortran_caf_co_min (gfc_descriptor_t *a, int result_image, 6600 int *stat, char *errmsg, int a_len, size_t errmsg_len)' 6601 6602 _Arguments_: 6603 A intent(inout) An array descriptor for the data 6604 to be processed. On the destination image(s) 6605 the result overwrites the old content. 6606 RESULT_IMAGEintent(in) The ID of the image to which the 6607 reduced value should be copied to; if zero, it 6608 has to be copied to all images. 6609 STAT intent(out) Stores the status STAT= and may be 6610 NULL. 6611 ERRMSG intent(out) When an error occurs, this will be 6612 set to an error message; may be NULL. 6613 A_LEN intent(in) the string length of argument A 6614 ERRMSG_LEN intent(in) the buffer size of errmsg 6615 6616 _NOTES_ 6617 If RESULT_IMAGE is nonzero, the data in the array descriptor A on 6618 all images except of the specified one become undefined; hence, the 6619 library may make use of this. 6620 6621 6622 File: gfortran.info, Node: _gfortran_caf_co_sum, Next: _gfortran_caf_co_reduce, Prev: _gfortran_caf_co_min, Up: Function ABI Documentation 6623 6624 7.2.35 '_gfortran_caf_co_sum' -- Collective summing reduction 6625 ------------------------------------------------------------- 6626 6627 _Description_: 6628 Calculates for each array element of the variable A the sum of all 6629 values for that element in the current team; if RESULT_IMAGE has 6630 the value 0, the result shall be stored on all images, otherwise, 6631 only on the specified image. This function operates on numeric 6632 values only. 6633 6634 _Syntax_: 6635 'void _gfortran_caf_co_sum (gfc_descriptor_t *a, int result_image, 6636 int *stat, char *errmsg, size_t errmsg_len)' 6637 6638 _Arguments_: 6639 A intent(inout) An array descriptor with the data 6640 to be processed. On the destination image(s) 6641 the result overwrites the old content. 6642 RESULT_IMAGEintent(in) The ID of the image to which the 6643 reduced value should be copied to; if zero, it 6644 has to be copied to all images. 6645 STAT intent(out) Stores the status STAT= and may be 6646 NULL. 6647 ERRMSG intent(out) When an error occurs, this will be 6648 set to an error message; may be NULL. 6649 ERRMSG_LEN intent(in) the buffer size of errmsg 6650 6651 _NOTES_ 6652 If RESULT_IMAGE is nonzero, the data in the array descriptor A on 6653 all images except of the specified one become undefined; hence, the 6654 library may make use of this. 6655 6656 6657 File: gfortran.info, Node: _gfortran_caf_co_reduce, Prev: _gfortran_caf_co_sum, Up: Function ABI Documentation 6658 6659 7.2.36 '_gfortran_caf_co_reduce' -- Generic collective reduction 6660 ---------------------------------------------------------------- 6661 6662 _Description_: 6663 Calculates for each array element of the variable A the reduction 6664 value for that element in the current team; if RESULT_IMAGE has the 6665 value 0, the result shall be stored on all images, otherwise, only 6666 on the specified image. The OPR is a pure function doing a 6667 mathematically commutative and associative operation. 6668 6669 The OPR_FLAGS denote the following; the values are bitwise ored. 6670 'GFC_CAF_BYREF' (1) if the result should be returned by reference; 6671 'GFC_CAF_HIDDENLEN' (2) whether the result and argument string 6672 lengths shall be specified as hidden arguments; 'GFC_CAF_ARG_VALUE' 6673 (4) whether the arguments shall be passed by value, 6674 'GFC_CAF_ARG_DESC' (8) whether the arguments shall be passed by 6675 descriptor. 6676 6677 _Syntax_: 6678 'void _gfortran_caf_co_reduce (gfc_descriptor_t *a, void * (*opr) 6679 (void *, void *), int opr_flags, int result_image, int *stat, char 6680 *errmsg, int a_len, size_t errmsg_len)' 6681 6682 _Arguments_: 6683 A intent(inout) An array descriptor with the data 6684 to be processed. On the destination image(s) 6685 the result overwrites the old content. 6686 OPR intent(in) Function pointer to the reduction 6687 function 6688 OPR_FLAGS intent(in) Flags regarding the reduction 6689 function 6690 RESULT_IMAGEintent(in) The ID of the image to which the 6691 reduced value should be copied to; if zero, it 6692 has to be copied to all images. 6693 STAT intent(out) Stores the status STAT= and may be 6694 NULL. 6695 ERRMSG intent(out) When an error occurs, this will be 6696 set to an error message; may be NULL. 6697 A_LEN intent(in) the string length of argument A 6698 ERRMSG_LEN intent(in) the buffer size of errmsg 6699 6700 _NOTES_ 6701 If RESULT_IMAGE is nonzero, the data in the array descriptor A on 6702 all images except of the specified one become undefined; hence, the 6703 library may make use of this. 6704 6705 For character arguments, the result is passed as first argument, 6706 followed by the result string length, next come the two string 6707 arguments, followed by the two hidden string length arguments. 6708 With C binding, there are no hidden arguments and by-reference 6709 passing and either only a single character is passed or an array 6710 descriptor. 6711 6712 6713 File: gfortran.info, Node: Intrinsic Procedures, Next: Intrinsic Modules, Prev: Coarray Programming, Up: Top 6714 6715 8 Intrinsic Procedures 6716 ********************** 6717 6718 * Menu: 6719 6720 * Introduction: Introduction to Intrinsics 6721 * 'ABORT': ABORT, Abort the program 6722 * 'ABS': ABS, Absolute value 6723 * 'ACCESS': ACCESS, Checks file access modes 6724 * 'ACHAR': ACHAR, Character in ASCII collating sequence 6725 * 'ACOS': ACOS, Arccosine function 6726 * 'ACOSD': ACOSD, Arccosine function, degrees 6727 * 'ACOSH': ACOSH, Inverse hyperbolic cosine function 6728 * 'ADJUSTL': ADJUSTL, Left adjust a string 6729 * 'ADJUSTR': ADJUSTR, Right adjust a string 6730 * 'AIMAG': AIMAG, Imaginary part of complex number 6731 * 'AINT': AINT, Truncate to a whole number 6732 * 'ALARM': ALARM, Set an alarm clock 6733 * 'ALL': ALL, Determine if all values are true 6734 * 'ALLOCATED': ALLOCATED, Status of allocatable entity 6735 * 'AND': AND, Bitwise logical AND 6736 * 'ANINT': ANINT, Nearest whole number 6737 * 'ANY': ANY, Determine if any values are true 6738 * 'ASIN': ASIN, Arcsine function 6739 * 'ASIND': ASIND, Arcsine function, degrees 6740 * 'ASINH': ASINH, Inverse hyperbolic sine function 6741 * 'ASSOCIATED': ASSOCIATED, Status of a pointer or pointer/target pair 6742 * 'ATAN': ATAN, Arctangent function 6743 * 'ATAND': ATAND, Arctangent function, degrees 6744 * 'ATAN2': ATAN2, Arctangent function 6745 * 'ATAN2D': ATAN2D, Arctangent function, degrees 6746 * 'ATANH': ATANH, Inverse hyperbolic tangent function 6747 * 'ATOMIC_ADD': ATOMIC_ADD, Atomic ADD operation 6748 * 'ATOMIC_AND': ATOMIC_AND, Atomic bitwise AND operation 6749 * 'ATOMIC_CAS': ATOMIC_CAS, Atomic compare and swap 6750 * 'ATOMIC_DEFINE': ATOMIC_DEFINE, Setting a variable atomically 6751 * 'ATOMIC_FETCH_ADD': ATOMIC_FETCH_ADD, Atomic ADD operation with prior fetch 6752 * 'ATOMIC_FETCH_AND': ATOMIC_FETCH_AND, Atomic bitwise AND operation with prior fetch 6753 * 'ATOMIC_FETCH_OR': ATOMIC_FETCH_OR, Atomic bitwise OR operation with prior fetch 6754 * 'ATOMIC_FETCH_XOR': ATOMIC_FETCH_XOR, Atomic bitwise XOR operation with prior fetch 6755 * 'ATOMIC_OR': ATOMIC_OR, Atomic bitwise OR operation 6756 * 'ATOMIC_REF': ATOMIC_REF, Obtaining the value of a variable atomically 6757 * 'ATOMIC_XOR': ATOMIC_XOR, Atomic bitwise OR operation 6758 * 'BACKTRACE': BACKTRACE, Show a backtrace 6759 * 'BESSEL_J0': BESSEL_J0, Bessel function of the first kind of order 0 6760 * 'BESSEL_J1': BESSEL_J1, Bessel function of the first kind of order 1 6761 * 'BESSEL_JN': BESSEL_JN, Bessel function of the first kind 6762 * 'BESSEL_Y0': BESSEL_Y0, Bessel function of the second kind of order 0 6763 * 'BESSEL_Y1': BESSEL_Y1, Bessel function of the second kind of order 1 6764 * 'BESSEL_YN': BESSEL_YN, Bessel function of the second kind 6765 * 'BGE': BGE, Bitwise greater than or equal to 6766 * 'BGT': BGT, Bitwise greater than 6767 * 'BIT_SIZE': BIT_SIZE, Bit size inquiry function 6768 * 'BLE': BLE, Bitwise less than or equal to 6769 * 'BLT': BLT, Bitwise less than 6770 * 'BTEST': BTEST, Bit test function 6771 * 'C_ASSOCIATED': C_ASSOCIATED, Status of a C pointer 6772 * 'C_F_POINTER': C_F_POINTER, Convert C into Fortran pointer 6773 * 'C_F_PROCPOINTER': C_F_PROCPOINTER, Convert C into Fortran procedure pointer 6774 * 'C_FUNLOC': C_FUNLOC, Obtain the C address of a procedure 6775 * 'C_LOC': C_LOC, Obtain the C address of an object 6776 * 'C_SIZEOF': C_SIZEOF, Size in bytes of an expression 6777 * 'CEILING': CEILING, Integer ceiling function 6778 * 'CHAR': CHAR, Integer-to-character conversion function 6779 * 'CHDIR': CHDIR, Change working directory 6780 * 'CHMOD': CHMOD, Change access permissions of files 6781 * 'CMPLX': CMPLX, Complex conversion function 6782 * 'CO_BROADCAST': CO_BROADCAST, Copy a value to all images the current set of images 6783 * 'CO_MAX': CO_MAX, Maximal value on the current set of images 6784 * 'CO_MIN': CO_MIN, Minimal value on the current set of images 6785 * 'CO_REDUCE': CO_REDUCE, Reduction of values on the current set of images 6786 * 'CO_SUM': CO_SUM, Sum of values on the current set of images 6787 * 'COMMAND_ARGUMENT_COUNT': COMMAND_ARGUMENT_COUNT, Get number of command line arguments 6788 * 'COMPILER_OPTIONS': COMPILER_OPTIONS, Options passed to the compiler 6789 * 'COMPILER_VERSION': COMPILER_VERSION, Compiler version string 6790 * 'COMPLEX': COMPLEX, Complex conversion function 6791 * 'CONJG': CONJG, Complex conjugate function 6792 * 'COS': COS, Cosine function 6793 * 'COSD': COSD, Cosine function, degrees 6794 * 'COSH': COSH, Hyperbolic cosine function 6795 * 'COTAN': COTAN, Cotangent function 6796 * 'COTAND': COTAND, Cotangent function, degrees 6797 * 'COUNT': COUNT, Count occurrences of TRUE in an array 6798 * 'CPU_TIME': CPU_TIME, CPU time subroutine 6799 * 'CSHIFT': CSHIFT, Circular shift elements of an array 6800 * 'CTIME': CTIME, Subroutine (or function) to convert a time into a string 6801 * 'DATE_AND_TIME': DATE_AND_TIME, Date and time subroutine 6802 * 'DBLE': DBLE, Double precision conversion function 6803 * 'DCMPLX': DCMPLX, Double complex conversion function 6804 * 'DIGITS': DIGITS, Significant digits function 6805 * 'DIM': DIM, Positive difference 6806 * 'DOT_PRODUCT': DOT_PRODUCT, Dot product function 6807 * 'DPROD': DPROD, Double product function 6808 * 'DREAL': DREAL, Double real part function 6809 * 'DSHIFTL': DSHIFTL, Combined left shift 6810 * 'DSHIFTR': DSHIFTR, Combined right shift 6811 * 'DTIME': DTIME, Execution time subroutine (or function) 6812 * 'EOSHIFT': EOSHIFT, End-off shift elements of an array 6813 * 'EPSILON': EPSILON, Epsilon function 6814 * 'ERF': ERF, Error function 6815 * 'ERFC': ERFC, Complementary error function 6816 * 'ERFC_SCALED': ERFC_SCALED, Exponentially-scaled complementary error function 6817 * 'ETIME': ETIME, Execution time subroutine (or function) 6818 * 'EVENT_QUERY': EVENT_QUERY, Query whether a coarray event has occurred 6819 * 'EXECUTE_COMMAND_LINE': EXECUTE_COMMAND_LINE, Execute a shell command 6820 * 'EXIT': EXIT, Exit the program with status. 6821 * 'EXP': EXP, Exponential function 6822 * 'EXPONENT': EXPONENT, Exponent function 6823 * 'EXTENDS_TYPE_OF': EXTENDS_TYPE_OF, Query dynamic type for extension 6824 * 'FDATE': FDATE, Subroutine (or function) to get the current time as a string 6825 * 'FGET': FGET, Read a single character in stream mode from stdin 6826 * 'FGETC': FGETC, Read a single character in stream mode 6827 * 'FINDLOC': FINDLOC, Search an array for a value 6828 * 'FLOOR': FLOOR, Integer floor function 6829 * 'FLUSH': FLUSH, Flush I/O unit(s) 6830 * 'FNUM': FNUM, File number function 6831 * 'FPUT': FPUT, Write a single character in stream mode to stdout 6832 * 'FPUTC': FPUTC, Write a single character in stream mode 6833 * 'FRACTION': FRACTION, Fractional part of the model representation 6834 * 'FREE': FREE, Memory de-allocation subroutine 6835 * 'FSEEK': FSEEK, Low level file positioning subroutine 6836 * 'FSTAT': FSTAT, Get file status 6837 * 'FTELL': FTELL, Current stream position 6838 * 'GAMMA': GAMMA, Gamma function 6839 * 'GERROR': GERROR, Get last system error message 6840 * 'GETARG': GETARG, Get command line arguments 6841 * 'GET_COMMAND': GET_COMMAND, Get the entire command line 6842 * 'GET_COMMAND_ARGUMENT': GET_COMMAND_ARGUMENT, Get command line arguments 6843 * 'GETCWD': GETCWD, Get current working directory 6844 * 'GETENV': GETENV, Get an environmental variable 6845 * 'GET_ENVIRONMENT_VARIABLE': GET_ENVIRONMENT_VARIABLE, Get an environmental variable 6846 * 'GETGID': GETGID, Group ID function 6847 * 'GETLOG': GETLOG, Get login name 6848 * 'GETPID': GETPID, Process ID function 6849 * 'GETUID': GETUID, User ID function 6850 * 'GMTIME': GMTIME, Convert time to GMT info 6851 * 'HOSTNM': HOSTNM, Get system host name 6852 * 'HUGE': HUGE, Largest number of a kind 6853 * 'HYPOT': HYPOT, Euclidean distance function 6854 * 'IACHAR': IACHAR, Code in ASCII collating sequence 6855 * 'IALL': IALL, Bitwise AND of array elements 6856 * 'IAND': IAND, Bitwise logical and 6857 * 'IANY': IANY, Bitwise OR of array elements 6858 * 'IARGC': IARGC, Get the number of command line arguments 6859 * 'IBCLR': IBCLR, Clear bit 6860 * 'IBITS': IBITS, Bit extraction 6861 * 'IBSET': IBSET, Set bit 6862 * 'ICHAR': ICHAR, Character-to-integer conversion function 6863 * 'IDATE': IDATE, Current local time (day/month/year) 6864 * 'IEOR': IEOR, Bitwise logical exclusive or 6865 * 'IERRNO': IERRNO, Function to get the last system error number 6866 * 'IMAGE_INDEX': IMAGE_INDEX, Cosubscript to image index conversion 6867 * 'INDEX': INDEX intrinsic, Position of a substring within a string 6868 * 'INT': INT, Convert to integer type 6869 * 'INT2': INT2, Convert to 16-bit integer type 6870 * 'INT8': INT8, Convert to 64-bit integer type 6871 * 'IOR': IOR, Bitwise logical or 6872 * 'IPARITY': IPARITY, Bitwise XOR of array elements 6873 * 'IRAND': IRAND, Integer pseudo-random number 6874 * 'IS_CONTIGUOUS': IS_CONTIGUOUS, Test whether an array is contiguous 6875 * 'IS_IOSTAT_END': IS_IOSTAT_END, Test for end-of-file value 6876 * 'IS_IOSTAT_EOR': IS_IOSTAT_EOR, Test for end-of-record value 6877 * 'ISATTY': ISATTY, Whether a unit is a terminal device 6878 * 'ISHFT': ISHFT, Shift bits 6879 * 'ISHFTC': ISHFTC, Shift bits circularly 6880 * 'ISNAN': ISNAN, Tests for a NaN 6881 * 'ITIME': ITIME, Current local time (hour/minutes/seconds) 6882 * 'KILL': KILL, Send a signal to a process 6883 * 'KIND': KIND, Kind of an entity 6884 * 'LBOUND': LBOUND, Lower dimension bounds of an array 6885 * 'LCOBOUND': LCOBOUND, Lower codimension bounds of an array 6886 * 'LEADZ': LEADZ, Number of leading zero bits of an integer 6887 * 'LEN': LEN, Length of a character entity 6888 * 'LEN_TRIM': LEN_TRIM, Length of a character entity without trailing blank characters 6889 * 'LGE': LGE, Lexical greater than or equal 6890 * 'LGT': LGT, Lexical greater than 6891 * 'LINK': LINK, Create a hard link 6892 * 'LLE': LLE, Lexical less than or equal 6893 * 'LLT': LLT, Lexical less than 6894 * 'LNBLNK': LNBLNK, Index of the last non-blank character in a string 6895 * 'LOC': LOC, Returns the address of a variable 6896 * 'LOG': LOG, Logarithm function 6897 * 'LOG10': LOG10, Base 10 logarithm function 6898 * 'LOG_GAMMA': LOG_GAMMA, Logarithm of the Gamma function 6899 * 'LOGICAL': LOGICAL, Convert to logical type 6900 * 'LSHIFT': LSHIFT, Left shift bits 6901 * 'LSTAT': LSTAT, Get file status 6902 * 'LTIME': LTIME, Convert time to local time info 6903 * 'MALLOC': MALLOC, Dynamic memory allocation function 6904 * 'MASKL': MASKL, Left justified mask 6905 * 'MASKR': MASKR, Right justified mask 6906 * 'MATMUL': MATMUL, matrix multiplication 6907 * 'MAX': MAX, Maximum value of an argument list 6908 * 'MAXEXPONENT': MAXEXPONENT, Maximum exponent of a real kind 6909 * 'MAXLOC': MAXLOC, Location of the maximum value within an array 6910 * 'MAXVAL': MAXVAL, Maximum value of an array 6911 * 'MCLOCK': MCLOCK, Time function 6912 * 'MCLOCK8': MCLOCK8, Time function (64-bit) 6913 * 'MERGE': MERGE, Merge arrays 6914 * 'MERGE_BITS': MERGE_BITS, Merge of bits under mask 6915 * 'MIN': MIN, Minimum value of an argument list 6916 * 'MINEXPONENT': MINEXPONENT, Minimum exponent of a real kind 6917 * 'MINLOC': MINLOC, Location of the minimum value within an array 6918 * 'MINVAL': MINVAL, Minimum value of an array 6919 * 'MOD': MOD, Remainder function 6920 * 'MODULO': MODULO, Modulo function 6921 * 'MOVE_ALLOC': MOVE_ALLOC, Move allocation from one object to another 6922 * 'MVBITS': MVBITS, Move bits from one integer to another 6923 * 'NEAREST': NEAREST, Nearest representable number 6924 * 'NEW_LINE': NEW_LINE, New line character 6925 * 'NINT': NINT, Nearest whole number 6926 * 'NORM2': NORM2, Euclidean vector norm 6927 * 'NOT': NOT, Logical negation 6928 * 'NULL': NULL, Function that returns an disassociated pointer 6929 * 'NUM_IMAGES': NUM_IMAGES, Number of images 6930 * 'OR': OR, Bitwise logical OR 6931 * 'PACK': PACK, Pack an array into an array of rank one 6932 * 'PARITY': PARITY, Reduction with exclusive OR 6933 * 'PERROR': PERROR, Print system error message 6934 * 'POPCNT': POPCNT, Number of bits set 6935 * 'POPPAR': POPPAR, Parity of the number of bits set 6936 * 'PRECISION': PRECISION, Decimal precision of a real kind 6937 * 'PRESENT': PRESENT, Determine whether an optional dummy argument is specified 6938 * 'PRODUCT': PRODUCT, Product of array elements 6939 * 'RADIX': RADIX, Base of a data model 6940 * 'RAN': RAN, Real pseudo-random number 6941 * 'RAND': RAND, Real pseudo-random number 6942 * 'RANDOM_INIT': RANDOM_INIT, Initialize pseudo-random number generator 6943 * 'RANDOM_NUMBER': RANDOM_NUMBER, Pseudo-random number 6944 * 'RANDOM_SEED': RANDOM_SEED, Initialize a pseudo-random number sequence 6945 * 'RANGE': RANGE, Decimal exponent range 6946 * 'RANK' : RANK, Rank of a data object 6947 * 'REAL': REAL, Convert to real type 6948 * 'RENAME': RENAME, Rename a file 6949 * 'REPEAT': REPEAT, Repeated string concatenation 6950 * 'RESHAPE': RESHAPE, Function to reshape an array 6951 * 'RRSPACING': RRSPACING, Reciprocal of the relative spacing 6952 * 'RSHIFT': RSHIFT, Right shift bits 6953 * 'SAME_TYPE_AS': SAME_TYPE_AS, Query dynamic types for equality 6954 * 'SCALE': SCALE, Scale a real value 6955 * 'SCAN': SCAN, Scan a string for the presence of a set of characters 6956 * 'SECNDS': SECNDS, Time function 6957 * 'SECOND': SECOND, CPU time function 6958 * 'SELECTED_CHAR_KIND': SELECTED_CHAR_KIND, Choose character kind 6959 * 'SELECTED_INT_KIND': SELECTED_INT_KIND, Choose integer kind 6960 * 'SELECTED_REAL_KIND': SELECTED_REAL_KIND, Choose real kind 6961 * 'SET_EXPONENT': SET_EXPONENT, Set the exponent of the model 6962 * 'SHAPE': SHAPE, Determine the shape of an array 6963 * 'SHIFTA': SHIFTA, Right shift with fill 6964 * 'SHIFTL': SHIFTL, Left shift 6965 * 'SHIFTR': SHIFTR, Right shift 6966 * 'SIGN': SIGN, Sign copying function 6967 * 'SIGNAL': SIGNAL, Signal handling subroutine (or function) 6968 * 'SIN': SIN, Sine function 6969 * 'SIND': SIND, Sine function, degrees 6970 * 'SINH': SINH, Hyperbolic sine function 6971 * 'SIZE': SIZE, Function to determine the size of an array 6972 * 'SIZEOF': SIZEOF, Determine the size in bytes of an expression 6973 * 'SLEEP': SLEEP, Sleep for the specified number of seconds 6974 * 'SPACING': SPACING, Smallest distance between two numbers of a given type 6975 * 'SPREAD': SPREAD, Add a dimension to an array 6976 * 'SQRT': SQRT, Square-root function 6977 * 'SRAND': SRAND, Reinitialize the random number generator 6978 * 'STAT': STAT, Get file status 6979 * 'STORAGE_SIZE': STORAGE_SIZE, Storage size in bits 6980 * 'SUM': SUM, Sum of array elements 6981 * 'SYMLNK': SYMLNK, Create a symbolic link 6982 * 'SYSTEM': SYSTEM, Execute a shell command 6983 * 'SYSTEM_CLOCK': SYSTEM_CLOCK, Time function 6984 * 'TAN': TAN, Tangent function 6985 * 'TAND': TAND, Tangent function, degrees 6986 * 'TANH': TANH, Hyperbolic tangent function 6987 * 'THIS_IMAGE': THIS_IMAGE, Cosubscript index of this image 6988 * 'TIME': TIME, Time function 6989 * 'TIME8': TIME8, Time function (64-bit) 6990 * 'TINY': TINY, Smallest positive number of a real kind 6991 * 'TRAILZ': TRAILZ, Number of trailing zero bits of an integer 6992 * 'TRANSFER': TRANSFER, Transfer bit patterns 6993 * 'TRANSPOSE': TRANSPOSE, Transpose an array of rank two 6994 * 'TRIM': TRIM, Remove trailing blank characters of a string 6995 * 'TTYNAM': TTYNAM, Get the name of a terminal device. 6996 * 'UBOUND': UBOUND, Upper dimension bounds of an array 6997 * 'UCOBOUND': UCOBOUND, Upper codimension bounds of an array 6998 * 'UMASK': UMASK, Set the file creation mask 6999 * 'UNLINK': UNLINK, Remove a file from the file system 7000 * 'UNPACK': UNPACK, Unpack an array of rank one into an array 7001 * 'VERIFY': VERIFY, Scan a string for the absence of a set of characters 7002 * 'XOR': XOR, Bitwise logical exclusive or 7003 7004 7005 File: gfortran.info, Node: Introduction to Intrinsics, Next: ABORT, Up: Intrinsic Procedures 7006 7007 8.1 Introduction to intrinsic procedures 7008 ======================================== 7009 7010 The intrinsic procedures provided by GNU Fortran include procedures 7011 required by the Fortran 95 and later supported standards, and a set of 7012 intrinsic procedures for backwards compatibility with G77. Any conflict 7013 between a description here and a description in the Fortran standards is 7014 unintentional, and the standard(s) should be considered authoritative. 7015 7016 The enumeration of the 'KIND' type parameter is processor defined in 7017 the Fortran 95 standard. GNU Fortran defines the default integer type 7018 and default real type by 'INTEGER(KIND=4)' and 'REAL(KIND=4)', 7019 respectively. The standard mandates that both data types shall have 7020 another kind, which have more precision. On typical target 7021 architectures supported by 'gfortran', this kind type parameter is 7022 'KIND=8'. Hence, 'REAL(KIND=8)' and 'DOUBLE PRECISION' are equivalent. 7023 In the description of generic intrinsic procedures, the kind type 7024 parameter will be specified by 'KIND=*', and in the description of 7025 specific names for an intrinsic procedure the kind type parameter will 7026 be explicitly given (e.g., 'REAL(KIND=4)' or 'REAL(KIND=8)'). Finally, 7027 for brevity the optional 'KIND=' syntax will be omitted. 7028 7029 Many of the intrinsic procedures take one or more optional arguments. 7030 This document follows the convention used in the Fortran 95 standard, 7031 and denotes such arguments by square brackets. 7032 7033 GNU Fortran offers the '-std=' command-line option, which can be used 7034 to restrict the set of intrinsic procedures to a given standard. By 7035 default, 'gfortran' sets the '-std=gnu' option, and so all intrinsic 7036 procedures described here are accepted. There is one caveat. For a 7037 select group of intrinsic procedures, 'g77' implemented both a function 7038 and a subroutine. Both classes have been implemented in 'gfortran' for 7039 backwards compatibility with 'g77'. It is noted here that these 7040 functions and subroutines cannot be intermixed in a given subprogram. 7041 In the descriptions that follow, the applicable standard for each 7042 intrinsic procedure is noted. 7043 7044 7045 File: gfortran.info, Node: ABORT, Next: ABS, Prev: Introduction to Intrinsics, Up: Intrinsic Procedures 7046 7047 8.2 'ABORT' -- Abort the program 7048 ================================ 7049 7050 _Description_: 7051 'ABORT' causes immediate termination of the program. On operating 7052 systems that support a core dump, 'ABORT' will produce a core dump. 7053 It will also print a backtrace, unless '-fno-backtrace' is given. 7054 7055 _Standard_: 7056 GNU extension 7057 7058 _Class_: 7059 Subroutine 7060 7061 _Syntax_: 7062 'CALL ABORT' 7063 7064 _Return value_: 7065 Does not return. 7066 7067 _Example_: 7068 program test_abort 7069 integer :: i = 1, j = 2 7070 if (i /= j) call abort 7071 end program test_abort 7072 7073 _See also_: 7074 *note EXIT::, *note KILL::, *note BACKTRACE:: 7075 7076 7077 File: gfortran.info, Node: ABS, Next: ACCESS, Prev: ABORT, Up: Intrinsic Procedures 7078 7079 8.3 'ABS' -- Absolute value 7080 =========================== 7081 7082 _Description_: 7083 'ABS(A)' computes the absolute value of 'A'. 7084 7085 _Standard_: 7086 Fortran 77 and later, has overloads that are GNU extensions 7087 7088 _Class_: 7089 Elemental function 7090 7091 _Syntax_: 7092 'RESULT = ABS(A)' 7093 7094 _Arguments_: 7095 A The type of the argument shall be an 'INTEGER', 7096 'REAL', or 'COMPLEX'. 7097 7098 _Return value_: 7099 The return value is of the same type and kind as the argument 7100 except the return value is 'REAL' for a 'COMPLEX' argument. 7101 7102 _Example_: 7103 program test_abs 7104 integer :: i = -1 7105 real :: x = -1.e0 7106 complex :: z = (-1.e0,0.e0) 7107 i = abs(i) 7108 x = abs(x) 7109 x = abs(z) 7110 end program test_abs 7111 7112 _Specific names_: 7113 Name Argument Return type Standard 7114 ------------------------------------------------------------------------- 7115 'ABS(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and later 7116 'CABS(A)' 'COMPLEX(4) A' 'REAL(4)' Fortran 77 and later 7117 'DABS(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and later 7118 'IABS(A)' 'INTEGER(4) A' 'INTEGER(4)' Fortran 77 and later 7119 'BABS(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 7120 'IIABS(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 7121 'JIABS(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 7122 'KIABS(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 7123 'ZABS(A)' 'COMPLEX(8) A' 'REAL(8)' GNU extension 7124 'CDABS(A)' 'COMPLEX(8) A' 'REAL(8)' GNU extension 7125 7126 7127 File: gfortran.info, Node: ACCESS, Next: ACHAR, Prev: ABS, Up: Intrinsic Procedures 7128 7129 8.4 'ACCESS' -- Checks file access modes 7130 ======================================== 7131 7132 _Description_: 7133 'ACCESS(NAME, MODE)' checks whether the file NAME exists, is 7134 readable, writable or executable. Except for the executable check, 7135 'ACCESS' can be replaced by Fortran 95's 'INQUIRE'. 7136 7137 _Standard_: 7138 GNU extension 7139 7140 _Class_: 7141 Inquiry function 7142 7143 _Syntax_: 7144 'RESULT = ACCESS(NAME, MODE)' 7145 7146 _Arguments_: 7147 NAME Scalar 'CHARACTER' of default kind with the file 7148 name. Trailing blank are ignored unless the 7149 character 'achar(0)' is present, then all 7150 characters up to and excluding 'achar(0)' are 7151 used as file name. 7152 MODE Scalar 'CHARACTER' of default kind with the file 7153 access mode, may be any concatenation of '"r"' 7154 (readable), '"w"' (writable) and '"x"' 7155 (executable), or '" "' to check for existence. 7156 7157 _Return value_: 7158 Returns a scalar 'INTEGER', which is '0' if the file is accessible 7159 in the given mode; otherwise or if an invalid argument has been 7160 given for 'MODE' the value '1' is returned. 7161 7162 _Example_: 7163 program access_test 7164 implicit none 7165 character(len=*), parameter :: file = 'test.dat' 7166 character(len=*), parameter :: file2 = 'test.dat '//achar(0) 7167 if(access(file,' ') == 0) print *, trim(file),' is exists' 7168 if(access(file,'r') == 0) print *, trim(file),' is readable' 7169 if(access(file,'w') == 0) print *, trim(file),' is writable' 7170 if(access(file,'x') == 0) print *, trim(file),' is executable' 7171 if(access(file2,'rwx') == 0) & 7172 print *, trim(file2),' is readable, writable and executable' 7173 end program access_test 7174 7175 7176 File: gfortran.info, Node: ACHAR, Next: ACOS, Prev: ACCESS, Up: Intrinsic Procedures 7177 7178 8.5 'ACHAR' -- Character in ASCII collating sequence 7179 ==================================================== 7180 7181 _Description_: 7182 'ACHAR(I)' returns the character located at position 'I' in the 7183 ASCII collating sequence. 7184 7185 _Standard_: 7186 Fortran 77 and later, with KIND argument Fortran 2003 and later 7187 7188 _Class_: 7189 Elemental function 7190 7191 _Syntax_: 7192 'RESULT = ACHAR(I [, KIND])' 7193 7194 _Arguments_: 7195 I The type shall be 'INTEGER'. 7196 KIND (Optional) An 'INTEGER' initialization 7197 expression indicating the kind parameter of the 7198 result. 7199 7200 _Return value_: 7201 The return value is of type 'CHARACTER' with a length of one. If 7202 the KIND argument is present, the return value is of the specified 7203 kind and of the default kind otherwise. 7204 7205 _Example_: 7206 program test_achar 7207 character c 7208 c = achar(32) 7209 end program test_achar 7210 7211 _Note_: 7212 See *note ICHAR:: for a discussion of converting between numerical 7213 values and formatted string representations. 7214 7215 _See also_: 7216 *note CHAR::, *note IACHAR::, *note ICHAR:: 7217 7218 7219 File: gfortran.info, Node: ACOS, Next: ACOSD, Prev: ACHAR, Up: Intrinsic Procedures 7220 7221 8.6 'ACOS' -- Arccosine function 7222 ================================ 7223 7224 _Description_: 7225 'ACOS(X)' computes the arccosine of X (inverse of 'COS(X)'). 7226 7227 _Standard_: 7228 Fortran 77 and later, for a complex argument Fortran 2008 or later 7229 7230 _Class_: 7231 Elemental function 7232 7233 _Syntax_: 7234 'RESULT = ACOS(X)' 7235 7236 _Arguments_: 7237 X The type shall either be 'REAL' with a magnitude 7238 that is less than or equal to one - or the type 7239 shall be 'COMPLEX'. 7240 7241 _Return value_: 7242 The return value is of the same type and kind as X. The real part 7243 of the result is in radians and lies in the range 0 \leq \Re 7244 \acos(x) \leq \pi. 7245 7246 _Example_: 7247 program test_acos 7248 real(8) :: x = 0.866_8 7249 x = acos(x) 7250 end program test_acos 7251 7252 _Specific names_: 7253 Name Argument Return type Standard 7254 ------------------------------------------------------------------------- 7255 'ACOS(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 7256 'DACOS(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 7257 7258 _See also_: 7259 Inverse function: *note COS:: Degrees function: *note ACOSD:: 7260 7261 7262 File: gfortran.info, Node: ACOSD, Next: ACOSH, Prev: ACOS, Up: Intrinsic Procedures 7263 7264 8.7 'ACOSD' -- Arccosine function, degrees 7265 ========================================== 7266 7267 _Description_: 7268 'ACOSD(X)' computes the arccosine of X in degrees (inverse of 7269 'COSD(X)'). 7270 7271 This function is for compatibility only and should be avoided in 7272 favor of standard constructs wherever possible. 7273 7274 _Standard_: 7275 GNU extension, enabled with '-fdec-math' 7276 7277 _Class_: 7278 Elemental function 7279 7280 _Syntax_: 7281 'RESULT = ACOSD(X)' 7282 7283 _Arguments_: 7284 X The type shall either be 'REAL' with a magnitude 7285 that is less than or equal to one - or the type 7286 shall be 'COMPLEX'. 7287 7288 _Return value_: 7289 The return value is of the same type and kind as X. The real part 7290 of the result is in degrees and lies in the range 0 \leq \Re 7291 \acos(x) \leq 180. 7292 7293 _Example_: 7294 program test_acosd 7295 real(8) :: x = 0.866_8 7296 x = acosd(x) 7297 end program test_acosd 7298 7299 _Specific names_: 7300 Name Argument Return type Standard 7301 ------------------------------------------------------------------------- 7302 'ACOSD(X)' 'REAL(4) X' 'REAL(4)' GNU extension 7303 'DACOSD(X)' 'REAL(8) X' 'REAL(8)' GNU extension 7304 7305 _See also_: 7306 Inverse function: *note COSD:: Radians function: *note ACOS:: 7307 7308 7309 File: gfortran.info, Node: ACOSH, Next: ADJUSTL, Prev: ACOSD, Up: Intrinsic Procedures 7310 7311 8.8 'ACOSH' -- Inverse hyperbolic cosine function 7312 ================================================= 7313 7314 _Description_: 7315 'ACOSH(X)' computes the inverse hyperbolic cosine of X. 7316 7317 _Standard_: 7318 Fortran 2008 and later 7319 7320 _Class_: 7321 Elemental function 7322 7323 _Syntax_: 7324 'RESULT = ACOSH(X)' 7325 7326 _Arguments_: 7327 X The type shall be 'REAL' or 'COMPLEX'. 7328 7329 _Return value_: 7330 The return value has the same type and kind as X. If X is complex, 7331 the imaginary part of the result is in radians and lies between 0 7332 \leq \Im \acosh(x) \leq \pi. 7333 7334 _Example_: 7335 PROGRAM test_acosh 7336 REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /) 7337 WRITE (*,*) ACOSH(x) 7338 END PROGRAM 7339 7340 _Specific names_: 7341 Name Argument Return type Standard 7342 ------------------------------------------------------------------------- 7343 'DACOSH(X)' 'REAL(8) X' 'REAL(8)' GNU extension 7344 7345 _See also_: 7346 Inverse function: *note COSH:: 7347 7348 7349 File: gfortran.info, Node: ADJUSTL, Next: ADJUSTR, Prev: ACOSH, Up: Intrinsic Procedures 7350 7351 8.9 'ADJUSTL' -- Left adjust a string 7352 ===================================== 7353 7354 _Description_: 7355 'ADJUSTL(STRING)' will left adjust a string by removing leading 7356 spaces. Spaces are inserted at the end of the string as needed. 7357 7358 _Standard_: 7359 Fortran 90 and later 7360 7361 _Class_: 7362 Elemental function 7363 7364 _Syntax_: 7365 'RESULT = ADJUSTL(STRING)' 7366 7367 _Arguments_: 7368 STRING The type shall be 'CHARACTER'. 7369 7370 _Return value_: 7371 The return value is of type 'CHARACTER' and of the same kind as 7372 STRING where leading spaces are removed and the same number of 7373 spaces are inserted on the end of STRING. 7374 7375 _Example_: 7376 program test_adjustl 7377 character(len=20) :: str = ' gfortran' 7378 str = adjustl(str) 7379 print *, str 7380 end program test_adjustl 7381 7382 _See also_: 7383 *note ADJUSTR::, *note TRIM:: 7384 7385 7386 File: gfortran.info, Node: ADJUSTR, Next: AIMAG, Prev: ADJUSTL, Up: Intrinsic Procedures 7387 7388 8.10 'ADJUSTR' -- Right adjust a string 7389 ======================================= 7390 7391 _Description_: 7392 'ADJUSTR(STRING)' will right adjust a string by removing trailing 7393 spaces. Spaces are inserted at the start of the string as needed. 7394 7395 _Standard_: 7396 Fortran 90 and later 7397 7398 _Class_: 7399 Elemental function 7400 7401 _Syntax_: 7402 'RESULT = ADJUSTR(STRING)' 7403 7404 _Arguments_: 7405 STR The type shall be 'CHARACTER'. 7406 7407 _Return value_: 7408 The return value is of type 'CHARACTER' and of the same kind as 7409 STRING where trailing spaces are removed and the same number of 7410 spaces are inserted at the start of STRING. 7411 7412 _Example_: 7413 program test_adjustr 7414 character(len=20) :: str = 'gfortran' 7415 str = adjustr(str) 7416 print *, str 7417 end program test_adjustr 7418 7419 _See also_: 7420 *note ADJUSTL::, *note TRIM:: 7421 7422 7423 File: gfortran.info, Node: AIMAG, Next: AINT, Prev: ADJUSTR, Up: Intrinsic Procedures 7424 7425 8.11 'AIMAG' -- Imaginary part of complex number 7426 ================================================ 7427 7428 _Description_: 7429 'AIMAG(Z)' yields the imaginary part of complex argument 'Z'. The 7430 'IMAG(Z)' and 'IMAGPART(Z)' intrinsic functions are provided for 7431 compatibility with 'g77', and their use in new code is strongly 7432 discouraged. 7433 7434 _Standard_: 7435 Fortran 77 and later, has overloads that are GNU extensions 7436 7437 _Class_: 7438 Elemental function 7439 7440 _Syntax_: 7441 'RESULT = AIMAG(Z)' 7442 7443 _Arguments_: 7444 Z The type of the argument shall be 'COMPLEX'. 7445 7446 _Return value_: 7447 The return value is of type 'REAL' with the kind type parameter of 7448 the argument. 7449 7450 _Example_: 7451 program test_aimag 7452 complex(4) z4 7453 complex(8) z8 7454 z4 = cmplx(1.e0_4, 0.e0_4) 7455 z8 = cmplx(0.e0_8, 1.e0_8) 7456 print *, aimag(z4), dimag(z8) 7457 end program test_aimag 7458 7459 _Specific names_: 7460 Name Argument Return type Standard 7461 ------------------------------------------------------------------------- 7462 'AIMAG(Z)' 'COMPLEX Z' 'REAL' Fortran 77 and later 7463 'DIMAG(Z)' 'COMPLEX(8) Z' 'REAL(8)' GNU extension 7464 'IMAG(Z)' 'COMPLEX Z' 'REAL' GNU extension 7465 'IMAGPART(Z)' 'COMPLEX Z' 'REAL' GNU extension 7466 7467 7468 File: gfortran.info, Node: AINT, Next: ALARM, Prev: AIMAG, Up: Intrinsic Procedures 7469 7470 8.12 'AINT' -- Truncate to a whole number 7471 ========================================= 7472 7473 _Description_: 7474 'AINT(A [, KIND])' truncates its argument to a whole number. 7475 7476 _Standard_: 7477 Fortran 77 and later 7478 7479 _Class_: 7480 Elemental function 7481 7482 _Syntax_: 7483 'RESULT = AINT(A [, KIND])' 7484 7485 _Arguments_: 7486 A The type of the argument shall be 'REAL'. 7487 KIND (Optional) An 'INTEGER' initialization 7488 expression indicating the kind parameter of the 7489 result. 7490 7491 _Return value_: 7492 The return value is of type 'REAL' with the kind type parameter of 7493 the argument if the optional KIND is absent; otherwise, the kind 7494 type parameter will be given by KIND. If the magnitude of X is 7495 less than one, 'AINT(X)' returns zero. If the magnitude is equal 7496 to or greater than one then it returns the largest whole number 7497 that does not exceed its magnitude. The sign is the same as the 7498 sign of X. 7499 7500 _Example_: 7501 program test_aint 7502 real(4) x4 7503 real(8) x8 7504 x4 = 1.234E0_4 7505 x8 = 4.321_8 7506 print *, aint(x4), dint(x8) 7507 x8 = aint(x4,8) 7508 end program test_aint 7509 7510 _Specific names_: 7511 Name Argument Return type Standard 7512 ------------------------------------------------------------------------- 7513 'AINT(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and later 7514 'DINT(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and later 7515 7516 7517 File: gfortran.info, Node: ALARM, Next: ALL, Prev: AINT, Up: Intrinsic Procedures 7518 7519 8.13 'ALARM' -- Execute a routine after a given delay 7520 ===================================================== 7521 7522 _Description_: 7523 'ALARM(SECONDS, HANDLER [, STATUS])' causes external subroutine 7524 HANDLER to be executed after a delay of SECONDS by using 'alarm(2)' 7525 to set up a signal and 'signal(2)' to catch it. If STATUS is 7526 supplied, it will be returned with the number of seconds remaining 7527 until any previously scheduled alarm was due to be delivered, or 7528 zero if there was no previously scheduled alarm. 7529 7530 _Standard_: 7531 GNU extension 7532 7533 _Class_: 7534 Subroutine 7535 7536 _Syntax_: 7537 'CALL ALARM(SECONDS, HANDLER [, STATUS])' 7538 7539 _Arguments_: 7540 SECONDS The type of the argument shall be a scalar 7541 'INTEGER'. It is 'INTENT(IN)'. 7542 HANDLER Signal handler ('INTEGER FUNCTION' or 7543 'SUBROUTINE') or dummy/global 'INTEGER' scalar. 7544 The scalar values may be either 'SIG_IGN=1' to 7545 ignore the alarm generated or 'SIG_DFL=0' to set 7546 the default action. It is 'INTENT(IN)'. 7547 STATUS (Optional) STATUS shall be a scalar variable of 7548 the default 'INTEGER' kind. It is 7549 'INTENT(OUT)'. 7550 7551 _Example_: 7552 program test_alarm 7553 external handler_print 7554 integer i 7555 call alarm (3, handler_print, i) 7556 print *, i 7557 call sleep(10) 7558 end program test_alarm 7559 This will cause the external routine HANDLER_PRINT to be called 7560 after 3 seconds. 7561 7562 7563 File: gfortran.info, Node: ALL, Next: ALLOCATED, Prev: ALARM, Up: Intrinsic Procedures 7564 7565 8.14 'ALL' -- All values in MASK along DIM are true 7566 =================================================== 7567 7568 _Description_: 7569 'ALL(MASK [, DIM])' determines if all the values are true in MASK 7570 in the array along dimension DIM. 7571 7572 _Standard_: 7573 Fortran 90 and later 7574 7575 _Class_: 7576 Transformational function 7577 7578 _Syntax_: 7579 'RESULT = ALL(MASK [, DIM])' 7580 7581 _Arguments_: 7582 MASK The type of the argument shall be 'LOGICAL' and 7583 it shall not be scalar. 7584 DIM (Optional) DIM shall be a scalar integer with a 7585 value that lies between one and the rank of 7586 MASK. 7587 7588 _Return value_: 7589 'ALL(MASK)' returns a scalar value of type 'LOGICAL' where the kind 7590 type parameter is the same as the kind type parameter of MASK. If 7591 DIM is present, then 'ALL(MASK, DIM)' returns an array with the 7592 rank of MASK minus 1. The shape is determined from the shape of 7593 MASK where the DIM dimension is elided. 7594 7595 (A) 7596 'ALL(MASK)' is true if all elements of MASK are true. It also 7597 is true if MASK has zero size; otherwise, it is false. 7598 (B) 7599 If the rank of MASK is one, then 'ALL(MASK,DIM)' is equivalent 7600 to 'ALL(MASK)'. If the rank is greater than one, then 7601 'ALL(MASK,DIM)' is determined by applying 'ALL' to the array 7602 sections. 7603 7604 _Example_: 7605 program test_all 7606 logical l 7607 l = all((/.true., .true., .true./)) 7608 print *, l 7609 call section 7610 contains 7611 subroutine section 7612 integer a(2,3), b(2,3) 7613 a = 1 7614 b = 1 7615 b(2,2) = 2 7616 print *, all(a .eq. b, 1) 7617 print *, all(a .eq. b, 2) 7618 end subroutine section 7619 end program test_all 7620 7621 7622 File: gfortran.info, Node: ALLOCATED, Next: AND, Prev: ALL, Up: Intrinsic Procedures 7623 7624 8.15 'ALLOCATED' -- Status of an allocatable entity 7625 =================================================== 7626 7627 _Description_: 7628 'ALLOCATED(ARRAY)' and 'ALLOCATED(SCALAR)' check the allocation 7629 status of ARRAY and SCALAR, respectively. 7630 7631 _Standard_: 7632 Fortran 90 and later. Note, the 'SCALAR=' keyword and allocatable 7633 scalar entities are available in Fortran 2003 and later. 7634 7635 _Class_: 7636 Inquiry function 7637 7638 _Syntax_: 7639 'RESULT = ALLOCATED(ARRAY)' 7640 'RESULT = ALLOCATED(SCALAR)' 7641 7642 _Arguments_: 7643 ARRAY The argument shall be an 'ALLOCATABLE' array. 7644 SCALAR The argument shall be an 'ALLOCATABLE' scalar. 7645 7646 _Return value_: 7647 The return value is a scalar 'LOGICAL' with the default logical 7648 kind type parameter. If the argument is allocated, then the result 7649 is '.TRUE.'; otherwise, it returns '.FALSE.' 7650 7651 _Example_: 7652 program test_allocated 7653 integer :: i = 4 7654 real(4), allocatable :: x(:) 7655 if (.not. allocated(x)) allocate(x(i)) 7656 end program test_allocated 7657 7658 7659 File: gfortran.info, Node: AND, Next: ANINT, Prev: ALLOCATED, Up: Intrinsic Procedures 7660 7661 8.16 'AND' -- Bitwise logical AND 7662 ================================= 7663 7664 _Description_: 7665 Bitwise logical 'AND'. 7666 7667 This intrinsic routine is provided for backwards compatibility with 7668 GNU Fortran 77. For integer arguments, programmers should consider 7669 the use of the *note IAND:: intrinsic defined by the Fortran 7670 standard. 7671 7672 _Standard_: 7673 GNU extension 7674 7675 _Class_: 7676 Function 7677 7678 _Syntax_: 7679 'RESULT = AND(I, J)' 7680 7681 _Arguments_: 7682 I The type shall be either a scalar 'INTEGER' type 7683 or a scalar 'LOGICAL' type or a 7684 boz-literal-constant. 7685 J The type shall be the same as the type of I or a 7686 boz-literal-constant. I and J shall not both be 7687 boz-literal-constants. If either I or J is a 7688 boz-literal-constant, then the other argument 7689 must be a scalar 'INTEGER'. 7690 7691 _Return value_: 7692 The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'. 7693 If the kind type parameters differ, then the smaller kind type is 7694 implicitly converted to larger kind, and the return has the larger 7695 kind. A boz-literal-constant is converted to an 'INTEGER' with the 7696 kind type parameter of the other argument as-if a call to *note 7697 INT:: occurred. 7698 7699 _Example_: 7700 PROGRAM test_and 7701 LOGICAL :: T = .TRUE., F = .FALSE. 7702 INTEGER :: a, b 7703 DATA a / Z'F' /, b / Z'3' / 7704 7705 WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F) 7706 WRITE (*,*) AND(a, b) 7707 END PROGRAM 7708 7709 _See also_: 7710 Fortran 95 elemental function: *note IAND:: 7711 7712 7713 File: gfortran.info, Node: ANINT, Next: ANY, Prev: AND, Up: Intrinsic Procedures 7714 7715 8.17 'ANINT' -- Nearest whole number 7716 ==================================== 7717 7718 _Description_: 7719 'ANINT(A [, KIND])' rounds its argument to the nearest whole 7720 number. 7721 7722 _Standard_: 7723 Fortran 77 and later 7724 7725 _Class_: 7726 Elemental function 7727 7728 _Syntax_: 7729 'RESULT = ANINT(A [, KIND])' 7730 7731 _Arguments_: 7732 A The type of the argument shall be 'REAL'. 7733 KIND (Optional) An 'INTEGER' initialization 7734 expression indicating the kind parameter of the 7735 result. 7736 7737 _Return value_: 7738 The return value is of type real with the kind type parameter of 7739 the argument if the optional KIND is absent; otherwise, the kind 7740 type parameter will be given by KIND. If A is greater than zero, 7741 'ANINT(A)' returns 'AINT(X+0.5)'. If A is less than or equal to 7742 zero then it returns 'AINT(X-0.5)'. 7743 7744 _Example_: 7745 program test_anint 7746 real(4) x4 7747 real(8) x8 7748 x4 = 1.234E0_4 7749 x8 = 4.321_8 7750 print *, anint(x4), dnint(x8) 7751 x8 = anint(x4,8) 7752 end program test_anint 7753 7754 _Specific names_: 7755 Name Argument Return type Standard 7756 ------------------------------------------------------------------------- 7757 'ANINT(A)' 'REAL(4) A' 'REAL(4)' Fortran 77 and later 7758 'DNINT(A)' 'REAL(8) A' 'REAL(8)' Fortran 77 and later 7759 7760 7761 File: gfortran.info, Node: ANY, Next: ASIN, Prev: ANINT, Up: Intrinsic Procedures 7762 7763 8.18 'ANY' -- Any value in MASK along DIM is true 7764 ================================================= 7765 7766 _Description_: 7767 'ANY(MASK [, DIM])' determines if any of the values in the logical 7768 array MASK along dimension DIM are '.TRUE.'. 7769 7770 _Standard_: 7771 Fortran 90 and later 7772 7773 _Class_: 7774 Transformational function 7775 7776 _Syntax_: 7777 'RESULT = ANY(MASK [, DIM])' 7778 7779 _Arguments_: 7780 MASK The type of the argument shall be 'LOGICAL' and 7781 it shall not be scalar. 7782 DIM (Optional) DIM shall be a scalar integer with a 7783 value that lies between one and the rank of 7784 MASK. 7785 7786 _Return value_: 7787 'ANY(MASK)' returns a scalar value of type 'LOGICAL' where the kind 7788 type parameter is the same as the kind type parameter of MASK. If 7789 DIM is present, then 'ANY(MASK, DIM)' returns an array with the 7790 rank of MASK minus 1. The shape is determined from the shape of 7791 MASK where the DIM dimension is elided. 7792 7793 (A) 7794 'ANY(MASK)' is true if any element of MASK is true; otherwise, 7795 it is false. It also is false if MASK has zero size. 7796 (B) 7797 If the rank of MASK is one, then 'ANY(MASK,DIM)' is equivalent 7798 to 'ANY(MASK)'. If the rank is greater than one, then 7799 'ANY(MASK,DIM)' is determined by applying 'ANY' to the array 7800 sections. 7801 7802 _Example_: 7803 program test_any 7804 logical l 7805 l = any((/.true., .true., .true./)) 7806 print *, l 7807 call section 7808 contains 7809 subroutine section 7810 integer a(2,3), b(2,3) 7811 a = 1 7812 b = 1 7813 b(2,2) = 2 7814 print *, any(a .eq. b, 1) 7815 print *, any(a .eq. b, 2) 7816 end subroutine section 7817 end program test_any 7818 7819 7820 File: gfortran.info, Node: ASIN, Next: ASIND, Prev: ANY, Up: Intrinsic Procedures 7821 7822 8.19 'ASIN' -- Arcsine function 7823 =============================== 7824 7825 _Description_: 7826 'ASIN(X)' computes the arcsine of its X (inverse of 'SIN(X)'). 7827 7828 _Standard_: 7829 Fortran 77 and later, for a complex argument Fortran 2008 or later 7830 7831 _Class_: 7832 Elemental function 7833 7834 _Syntax_: 7835 'RESULT = ASIN(X)' 7836 7837 _Arguments_: 7838 X The type shall be either 'REAL' and a magnitude 7839 that is less than or equal to one - or be 7840 'COMPLEX'. 7841 7842 _Return value_: 7843 The return value is of the same type and kind as X. The real part 7844 of the result is in radians and lies in the range -\pi/2 \leq \Re 7845 \asin(x) \leq \pi/2. 7846 7847 _Example_: 7848 program test_asin 7849 real(8) :: x = 0.866_8 7850 x = asin(x) 7851 end program test_asin 7852 7853 _Specific names_: 7854 Name Argument Return type Standard 7855 ------------------------------------------------------------------------- 7856 'ASIN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 7857 'DASIN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 7858 7859 _See also_: 7860 Inverse function: *note SIN:: Degrees function: *note ASIND:: 7861 7862 7863 File: gfortran.info, Node: ASIND, Next: ASINH, Prev: ASIN, Up: Intrinsic Procedures 7864 7865 8.20 'ASIND' -- Arcsine function, degrees 7866 ========================================= 7867 7868 _Description_: 7869 'ASIND(X)' computes the arcsine of its X in degrees (inverse of 7870 'SIND(X)'). 7871 7872 This function is for compatibility only and should be avoided in 7873 favor of standard constructs wherever possible. 7874 7875 _Standard_: 7876 GNU extension, enabled with '-fdec-math'. 7877 7878 _Class_: 7879 Elemental function 7880 7881 _Syntax_: 7882 'RESULT = ASIND(X)' 7883 7884 _Arguments_: 7885 X The type shall be either 'REAL' and a magnitude 7886 that is less than or equal to one - or be 7887 'COMPLEX'. 7888 7889 _Return value_: 7890 The return value is of the same type and kind as X. The real part 7891 of the result is in degrees and lies in the range -90 \leq \Re 7892 \asin(x) \leq 90. 7893 7894 _Example_: 7895 program test_asind 7896 real(8) :: x = 0.866_8 7897 x = asind(x) 7898 end program test_asind 7899 7900 _Specific names_: 7901 Name Argument Return type Standard 7902 ------------------------------------------------------------------------- 7903 'ASIND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 7904 'DASIND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 7905 7906 _See also_: 7907 Inverse function: *note SIND:: Radians function: *note ASIN:: 7908 7909 7910 File: gfortran.info, Node: ASINH, Next: ASSOCIATED, Prev: ASIND, Up: Intrinsic Procedures 7911 7912 8.21 'ASINH' -- Inverse hyperbolic sine function 7913 ================================================ 7914 7915 _Description_: 7916 'ASINH(X)' computes the inverse hyperbolic sine of X. 7917 7918 _Standard_: 7919 Fortran 2008 and later 7920 7921 _Class_: 7922 Elemental function 7923 7924 _Syntax_: 7925 'RESULT = ASINH(X)' 7926 7927 _Arguments_: 7928 X The type shall be 'REAL' or 'COMPLEX'. 7929 7930 _Return value_: 7931 The return value is of the same type and kind as X. If X is 7932 complex, the imaginary part of the result is in radians and lies 7933 between -\pi/2 \leq \Im \asinh(x) \leq \pi/2. 7934 7935 _Example_: 7936 PROGRAM test_asinh 7937 REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /) 7938 WRITE (*,*) ASINH(x) 7939 END PROGRAM 7940 7941 _Specific names_: 7942 Name Argument Return type Standard 7943 ------------------------------------------------------------------------- 7944 'DASINH(X)' 'REAL(8) X' 'REAL(8)' GNU extension. 7945 7946 _See also_: 7947 Inverse function: *note SINH:: 7948 7949 7950 File: gfortran.info, Node: ASSOCIATED, Next: ATAN, Prev: ASINH, Up: Intrinsic Procedures 7951 7952 8.22 'ASSOCIATED' -- Status of a pointer or pointer/target pair 7953 =============================================================== 7954 7955 _Description_: 7956 'ASSOCIATED(POINTER [, TARGET])' determines the status of the 7957 pointer POINTER or if POINTER is associated with the target TARGET. 7958 7959 _Standard_: 7960 Fortran 90 and later 7961 7962 _Class_: 7963 Inquiry function 7964 7965 _Syntax_: 7966 'RESULT = ASSOCIATED(POINTER [, TARGET])' 7967 7968 _Arguments_: 7969 POINTER POINTER shall have the 'POINTER' attribute and 7970 it can be of any type. 7971 TARGET (Optional) TARGET shall be a pointer or a 7972 target. It must have the same type, kind type 7973 parameter, and array rank as POINTER. 7974 The association status of neither POINTER nor TARGET shall be 7975 undefined. 7976 7977 _Return value_: 7978 'ASSOCIATED(POINTER)' returns a scalar value of type 'LOGICAL(4)'. 7979 There are several cases: 7980 (A) When the optional TARGET is not present then 7981 'ASSOCIATED(POINTER)' is true if POINTER is associated with a 7982 target; otherwise, it returns false. 7983 (B) If TARGET is present and a scalar target, the result is true if 7984 TARGET is not a zero-sized storage sequence and the target 7985 associated with POINTER occupies the same storage units. If 7986 POINTER is disassociated, the result is false. 7987 (C) If TARGET is present and an array target, the result is true if 7988 TARGET and POINTER have the same shape, are not zero-sized 7989 arrays, are arrays whose elements are not zero-sized storage 7990 sequences, and TARGET and POINTER occupy the same storage 7991 units in array element order. As in case(B), the result is 7992 false, if POINTER is disassociated. 7993 (D) If TARGET is present and an scalar pointer, the result is true 7994 if TARGET is associated with POINTER, the target associated 7995 with TARGET are not zero-sized storage sequences and occupy 7996 the same storage units. The result is false, if either TARGET 7997 or POINTER is disassociated. 7998 (E) If TARGET is present and an array pointer, the result is true if 7999 target associated with POINTER and the target associated with 8000 TARGET have the same shape, are not zero-sized arrays, are 8001 arrays whose elements are not zero-sized storage sequences, 8002 and TARGET and POINTER occupy the same storage units in array 8003 element order. The result is false, if either TARGET or 8004 POINTER is disassociated. 8005 8006 _Example_: 8007 program test_associated 8008 implicit none 8009 real, target :: tgt(2) = (/1., 2./) 8010 real, pointer :: ptr(:) 8011 ptr => tgt 8012 if (associated(ptr) .eqv. .false.) call abort 8013 if (associated(ptr,tgt) .eqv. .false.) call abort 8014 end program test_associated 8015 8016 _See also_: 8017 *note NULL:: 8018 8019 8020 File: gfortran.info, Node: ATAN, Next: ATAND, Prev: ASSOCIATED, Up: Intrinsic Procedures 8021 8022 8.23 'ATAN' -- Arctangent function 8023 ================================== 8024 8025 _Description_: 8026 'ATAN(X)' computes the arctangent of X. 8027 8028 _Standard_: 8029 Fortran 77 and later, for a complex argument and for two arguments 8030 Fortran 2008 or later 8031 8032 _Class_: 8033 Elemental function 8034 8035 _Syntax_: 8036 'RESULT = ATAN(X)' 8037 'RESULT = ATAN(Y, X)' 8038 8039 _Arguments_: 8040 X The type shall be 'REAL' or 'COMPLEX'; if Y is 8041 present, X shall be REAL. 8042 Y The type and kind type parameter shall be the 8043 same as X. 8044 8045 _Return value_: 8046 The return value is of the same type and kind as X. If Y is 8047 present, the result is identical to 'ATAN2(Y,X)'. Otherwise, it 8048 the arcus tangent of X, where the real part of the result is in 8049 radians and lies in the range -\pi/2 \leq \Re \atan(x) \leq \pi/2. 8050 8051 _Example_: 8052 program test_atan 8053 real(8) :: x = 2.866_8 8054 x = atan(x) 8055 end program test_atan 8056 8057 _Specific names_: 8058 Name Argument Return type Standard 8059 ------------------------------------------------------------------------- 8060 'ATAN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 8061 'DATAN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 8062 8063 _See also_: 8064 Inverse function: *note TAN:: Degrees function: *note ATAND:: 8065 8066 8067 File: gfortran.info, Node: ATAND, Next: ATAN2, Prev: ATAN, Up: Intrinsic Procedures 8068 8069 8.24 'ATAND' -- Arctangent function, degrees 8070 ============================================ 8071 8072 _Description_: 8073 'ATAND(X)' computes the arctangent of X in degrees (inverse of 8074 *note TAND::). 8075 8076 This function is for compatibility only and should be avoided in 8077 favor of standard constructs wherever possible. 8078 8079 _Standard_: 8080 GNU extension, enabled with '-fdec-math'. 8081 8082 _Class_: 8083 Elemental function 8084 8085 _Syntax_: 8086 'RESULT = ATAND(X)' 8087 'RESULT = ATAND(Y, X)' 8088 8089 _Arguments_: 8090 X The type shall be 'REAL' or 'COMPLEX'; if Y is 8091 present, X shall be REAL. 8092 Y The type and kind type parameter shall be the 8093 same as X. 8094 8095 _Return value_: 8096 The return value is of the same type and kind as X. If Y is 8097 present, the result is identical to 'ATAND2(Y,X)'. Otherwise, it 8098 is the arcus tangent of X, where the real part of the result is in 8099 degrees and lies in the range -90 \leq \Re \atand(x) \leq 90. 8100 8101 _Example_: 8102 program test_atand 8103 real(8) :: x = 2.866_8 8104 x = atand(x) 8105 end program test_atand 8106 8107 _Specific names_: 8108 Name Argument Return type Standard 8109 -------------------------------------------------------------------------- 8110 'ATAND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 8111 'DATAND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 8112 8113 _See also_: 8114 Inverse function: *note TAND:: Radians function: *note ATAN:: 8115 8116 8117 File: gfortran.info, Node: ATAN2, Next: ATAN2D, Prev: ATAND, Up: Intrinsic Procedures 8118 8119 8.25 'ATAN2' -- Arctangent function 8120 =================================== 8121 8122 _Description_: 8123 'ATAN2(Y, X)' computes the principal value of the argument function 8124 of the complex number X + i Y. This function can be used to 8125 transform from Cartesian into polar coordinates and allows to 8126 determine the angle in the correct quadrant. 8127 8128 _Standard_: 8129 Fortran 77 and later 8130 8131 _Class_: 8132 Elemental function 8133 8134 _Syntax_: 8135 'RESULT = ATAN2(Y, X)' 8136 8137 _Arguments_: 8138 Y The type shall be 'REAL'. 8139 X The type and kind type parameter shall be the 8140 same as Y. If Y is zero, then X must be 8141 nonzero. 8142 8143 _Return value_: 8144 The return value has the same type and kind type parameter as Y. 8145 It is the principal value of the complex number X + i Y. If X is 8146 nonzero, then it lies in the range -\pi \le \atan (x) \leq \pi. 8147 The sign is positive if Y is positive. If Y is zero, then the 8148 return value is zero if X is strictly positive, \pi if X is 8149 negative and Y is positive zero (or the processor does not handle 8150 signed zeros), and -\pi if X is negative and Y is negative zero. 8151 Finally, if X is zero, then the magnitude of the result is \pi/2. 8152 8153 _Example_: 8154 program test_atan2 8155 real(4) :: x = 1.e0_4, y = 0.5e0_4 8156 x = atan2(y,x) 8157 end program test_atan2 8158 8159 _Specific names_: 8160 Name Argument Return type Standard 8161 ------------------------------------------------------------------------- 8162 'ATAN2(X, Y)' 'REAL(4) X, Y' 'REAL(4)' Fortran 77 and later 8163 'DATAN2(X, Y)' 'REAL(8) X, Y' 'REAL(8)' Fortran 77 and later 8164 8165 _See also_: 8166 Alias: *note ATAN:: Degrees function: *note ATAN2D:: 8167 8168 8169 File: gfortran.info, Node: ATAN2D, Next: ATANH, Prev: ATAN2, Up: Intrinsic Procedures 8170 8171 8.26 'ATAN2D' -- Arctangent function, degrees 8172 ============================================= 8173 8174 _Description_: 8175 'ATAN2D(Y, X)' computes the principal value of the argument 8176 function of the complex number X + i Y in degrees. This function 8177 can be used to transform from Cartesian into polar coordinates and 8178 allows to determine the angle in the correct quadrant. 8179 8180 This function is for compatibility only and should be avoided in 8181 favor of standard constructs wherever possible. 8182 8183 _Standard_: 8184 GNU extension, enabled with '-fdec-math'. 8185 8186 _Class_: 8187 Elemental function 8188 8189 _Syntax_: 8190 'RESULT = ATAN2D(Y, X)' 8191 8192 _Arguments_: 8193 Y The type shall be 'REAL'. 8194 X The type and kind type parameter shall be the 8195 same as Y. If Y is zero, then X must be 8196 nonzero. 8197 8198 _Return value_: 8199 The return value has the same type and kind type parameter as Y. 8200 It is the principal value of the complex number X + i Y. If X is 8201 nonzero, then it lies in the range -180 \le \atan (x) \leq 180. 8202 The sign is positive if Y is positive. If Y is zero, then the 8203 return value is zero if X is strictly positive, 180 if X is 8204 negative and Y is positive zero (or the processor does not handle 8205 signed zeros), and -180 if X is negative and Y is negative zero. 8206 Finally, if X is zero, then the magnitude of the result is 90. 8207 8208 _Example_: 8209 program test_atan2d 8210 real(4) :: x = 1.e0_4, y = 0.5e0_4 8211 x = atan2d(y,x) 8212 end program test_atan2d 8213 8214 _Specific names_: 8215 Name Argument Return type Standard 8216 -------------------------------------------------------------------------- 8217 'ATAN2D(X, Y)' 'REAL(4) X, Y' 'REAL(4)' GNU extension 8218 'DATAN2D(X, Y)' 'REAL(8) X, Y' 'REAL(8)' GNU extension 8219 8220 _See also_: 8221 Alias: *note ATAND:: Radians function: *note ATAN2:: 8222 8223 8224 File: gfortran.info, Node: ATANH, Next: ATOMIC_ADD, Prev: ATAN2D, Up: Intrinsic Procedures 8225 8226 8.27 'ATANH' -- Inverse hyperbolic tangent function 8227 =================================================== 8228 8229 _Description_: 8230 'ATANH(X)' computes the inverse hyperbolic tangent of X. 8231 8232 _Standard_: 8233 Fortran 2008 and later 8234 8235 _Class_: 8236 Elemental function 8237 8238 _Syntax_: 8239 'RESULT = ATANH(X)' 8240 8241 _Arguments_: 8242 X The type shall be 'REAL' or 'COMPLEX'. 8243 8244 _Return value_: 8245 The return value has same type and kind as X. If X is complex, the 8246 imaginary part of the result is in radians and lies between -\pi/2 8247 \leq \Im \atanh(x) \leq \pi/2. 8248 8249 _Example_: 8250 PROGRAM test_atanh 8251 REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /) 8252 WRITE (*,*) ATANH(x) 8253 END PROGRAM 8254 8255 _Specific names_: 8256 Name Argument Return type Standard 8257 ------------------------------------------------------------------------- 8258 'DATANH(X)' 'REAL(8) X' 'REAL(8)' GNU extension 8259 8260 _See also_: 8261 Inverse function: *note TANH:: 8262 8263 8264 File: gfortran.info, Node: ATOMIC_ADD, Next: ATOMIC_AND, Prev: ATANH, Up: Intrinsic Procedures 8265 8266 8.28 'ATOMIC_ADD' -- Atomic ADD operation 8267 ========================================= 8268 8269 _Description_: 8270 'ATOMIC_ADD(ATOM, VALUE)' atomically adds the value of VALUE to the 8271 variable ATOM. When STAT is present and the invocation was 8272 successful, it is assigned the value 0. If it is present and the 8273 invocation has failed, it is assigned a positive value; in 8274 particular, for a coindexed ATOM, if the remote image has stopped, 8275 it is assigned the value of 'ISO_FORTRAN_ENV''s 8276 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8277 'STAT_FAILED_IMAGE'. 8278 8279 _Standard_: 8280 TS 18508 or later 8281 8282 _Class_: 8283 Atomic subroutine 8284 8285 _Syntax_: 8286 'CALL ATOMIC_ADD (ATOM, VALUE [, STAT])' 8287 8288 _Arguments_: 8289 ATOM Scalar coarray or coindexed variable of integer 8290 type with 'ATOMIC_INT_KIND' kind. 8291 VALUE Scalar of the same type as ATOM. If the kind is 8292 different, the value is converted to the kind of 8293 ATOM. 8294 STAT (optional) Scalar default-kind integer variable. 8295 8296 _Example_: 8297 program atomic 8298 use iso_fortran_env 8299 integer(atomic_int_kind) :: atom[*] 8300 call atomic_add (atom[1], this_image()) 8301 end program atomic 8302 8303 _See also_: 8304 *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_ADD::, *note 8305 ISO_FORTRAN_ENV::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note 8306 ATOMIC_XOR:: 8307 8308 8309 File: gfortran.info, Node: ATOMIC_AND, Next: ATOMIC_CAS, Prev: ATOMIC_ADD, Up: Intrinsic Procedures 8310 8311 8.29 'ATOMIC_AND' -- Atomic bitwise AND operation 8312 ================================================= 8313 8314 _Description_: 8315 'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise 8316 AND between the values of ATOM and VALUE. When STAT is present and 8317 the invocation was successful, it is assigned the value 0. If it 8318 is present and the invocation has failed, it is assigned a positive 8319 value; in particular, for a coindexed ATOM, if the remote image has 8320 stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s 8321 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8322 'STAT_FAILED_IMAGE'. 8323 8324 _Standard_: 8325 TS 18508 or later 8326 8327 _Class_: 8328 Atomic subroutine 8329 8330 _Syntax_: 8331 'CALL ATOMIC_AND (ATOM, VALUE [, STAT])' 8332 8333 _Arguments_: 8334 ATOM Scalar coarray or coindexed variable of integer 8335 type with 'ATOMIC_INT_KIND' kind. 8336 VALUE Scalar of the same type as ATOM. If the kind is 8337 different, the value is converted to the kind of 8338 ATOM. 8339 STAT (optional) Scalar default-kind integer variable. 8340 8341 _Example_: 8342 program atomic 8343 use iso_fortran_env 8344 integer(atomic_int_kind) :: atom[*] 8345 call atomic_and (atom[1], int(b'10100011101')) 8346 end program atomic 8347 8348 _See also_: 8349 *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_AND::, *note 8350 ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note 8351 ATOMIC_XOR:: 8352 8353 8354 File: gfortran.info, Node: ATOMIC_CAS, Next: ATOMIC_DEFINE, Prev: ATOMIC_AND, Up: Intrinsic Procedures 8355 8356 8.30 'ATOMIC_CAS' -- Atomic compare and swap 8357 ============================================ 8358 8359 _Description_: 8360 'ATOMIC_CAS' compares the variable ATOM with the value of COMPARE; 8361 if the value is the same, ATOM is set to the value of NEW. 8362 Additionally, OLD is set to the value of ATOM that was used for the 8363 comparison. When STAT is present and the invocation was 8364 successful, it is assigned the value 0. If it is present and the 8365 invocation has failed, it is assigned a positive value; in 8366 particular, for a coindexed ATOM, if the remote image has stopped, 8367 it is assigned the value of 'ISO_FORTRAN_ENV''s 8368 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8369 'STAT_FAILED_IMAGE'. 8370 8371 _Standard_: 8372 TS 18508 or later 8373 8374 _Class_: 8375 Atomic subroutine 8376 8377 _Syntax_: 8378 'CALL ATOMIC_CAS (ATOM, OLD, COMPARE, NEW [, STAT])' 8379 8380 _Arguments_: 8381 ATOM Scalar coarray or coindexed variable of either 8382 integer type with 'ATOMIC_INT_KIND' kind or 8383 logical type with 'ATOMIC_LOGICAL_KIND' kind. 8384 OLD Scalar of the same type and kind as ATOM. 8385 COMPARE Scalar variable of the same type and kind as 8386 ATOM. 8387 NEW Scalar variable of the same type as ATOM. If 8388 kind is different, the value is converted to the 8389 kind of ATOM. 8390 STAT (optional) Scalar default-kind integer variable. 8391 8392 _Example_: 8393 program atomic 8394 use iso_fortran_env 8395 logical(atomic_logical_kind) :: atom[*], prev 8396 call atomic_cas (atom[1], prev, .false., .true.)) 8397 end program atomic 8398 8399 _See also_: 8400 *note ATOMIC_DEFINE::, *note ATOMIC_REF::, *note ISO_FORTRAN_ENV:: 8401 8402 8403 File: gfortran.info, Node: ATOMIC_DEFINE, Next: ATOMIC_FETCH_ADD, Prev: ATOMIC_CAS, Up: Intrinsic Procedures 8404 8405 8.31 'ATOMIC_DEFINE' -- Setting a variable atomically 8406 ===================================================== 8407 8408 _Description_: 8409 'ATOMIC_DEFINE(ATOM, VALUE)' defines the variable ATOM with the 8410 value VALUE atomically. When STAT is present and the invocation 8411 was successful, it is assigned the value 0. If it is present and 8412 the invocation has failed, it is assigned a positive value; in 8413 particular, for a coindexed ATOM, if the remote image has stopped, 8414 it is assigned the value of 'ISO_FORTRAN_ENV''s 8415 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8416 'STAT_FAILED_IMAGE'. 8417 8418 _Standard_: 8419 Fortran 2008 and later; with STAT, TS 18508 or later 8420 8421 _Class_: 8422 Atomic subroutine 8423 8424 _Syntax_: 8425 'CALL ATOMIC_DEFINE (ATOM, VALUE [, STAT])' 8426 8427 _Arguments_: 8428 ATOM Scalar coarray or coindexed variable of either 8429 integer type with 'ATOMIC_INT_KIND' kind or 8430 logical type with 'ATOMIC_LOGICAL_KIND' kind. 8431 8432 VALUE Scalar of the same type as ATOM. If the kind is 8433 different, the value is converted to the kind of 8434 ATOM. 8435 STAT (optional) Scalar default-kind integer variable. 8436 8437 _Example_: 8438 program atomic 8439 use iso_fortran_env 8440 integer(atomic_int_kind) :: atom[*] 8441 call atomic_define (atom[1], this_image()) 8442 end program atomic 8443 8444 _See also_: 8445 *note ATOMIC_REF::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::, 8446 *note ATOMIC_ADD::, *note ATOMIC_AND::, *note ATOMIC_OR::, *note 8447 ATOMIC_XOR:: 8448 8449 8450 File: gfortran.info, Node: ATOMIC_FETCH_ADD, Next: ATOMIC_FETCH_AND, Prev: ATOMIC_DEFINE, Up: Intrinsic Procedures 8451 8452 8.32 'ATOMIC_FETCH_ADD' -- Atomic ADD operation with prior fetch 8453 ================================================================ 8454 8455 _Description_: 8456 'ATOMIC_FETCH_ADD(ATOM, VALUE, OLD)' atomically stores the value of 8457 ATOM in OLD and adds the value of VALUE to the variable ATOM. When 8458 STAT is present and the invocation was successful, it is assigned 8459 the value 0. If it is present and the invocation has failed, it is 8460 assigned a positive value; in particular, for a coindexed ATOM, if 8461 the remote image has stopped, it is assigned the value of 8462 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote image 8463 has failed, the value 'STAT_FAILED_IMAGE'. 8464 8465 _Standard_: 8466 TS 18508 or later 8467 8468 _Class_: 8469 Atomic subroutine 8470 8471 _Syntax_: 8472 'CALL ATOMIC_FETCH_ADD (ATOM, VALUE, old [, STAT])' 8473 8474 _Arguments_: 8475 ATOM Scalar coarray or coindexed variable of integer 8476 type with 'ATOMIC_INT_KIND' kind. 8477 'ATOMIC_LOGICAL_KIND' kind. 8478 8479 VALUE Scalar of the same type as ATOM. If the kind is 8480 different, the value is converted to the kind of 8481 ATOM. 8482 OLD Scalar of the same type and kind as ATOM. 8483 STAT (optional) Scalar default-kind integer variable. 8484 8485 _Example_: 8486 program atomic 8487 use iso_fortran_env 8488 integer(atomic_int_kind) :: atom[*], old 8489 call atomic_add (atom[1], this_image(), old) 8490 end program atomic 8491 8492 _See also_: 8493 *note ATOMIC_DEFINE::, *note ATOMIC_ADD::, *note ISO_FORTRAN_ENV::, 8494 *note ATOMIC_FETCH_AND::, *note ATOMIC_FETCH_OR::, *note 8495 ATOMIC_FETCH_XOR:: 8496 8497 8498 File: gfortran.info, Node: ATOMIC_FETCH_AND, Next: ATOMIC_FETCH_OR, Prev: ATOMIC_FETCH_ADD, Up: Intrinsic Procedures 8499 8500 8.33 'ATOMIC_FETCH_AND' -- Atomic bitwise AND operation with prior fetch 8501 ======================================================================== 8502 8503 _Description_: 8504 'ATOMIC_AND(ATOM, VALUE)' atomically stores the value of ATOM in 8505 OLD and defines ATOM with the bitwise AND between the values of 8506 ATOM and VALUE. When STAT is present and the invocation was 8507 successful, it is assigned the value 0. If it is present and the 8508 invocation has failed, it is assigned a positive value; in 8509 particular, for a coindexed ATOM, if the remote image has stopped, 8510 it is assigned the value of 'ISO_FORTRAN_ENV''s 8511 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8512 'STAT_FAILED_IMAGE'. 8513 8514 _Standard_: 8515 TS 18508 or later 8516 8517 _Class_: 8518 Atomic subroutine 8519 8520 _Syntax_: 8521 'CALL ATOMIC_FETCH_AND (ATOM, VALUE, OLD [, STAT])' 8522 8523 _Arguments_: 8524 ATOM Scalar coarray or coindexed variable of integer 8525 type with 'ATOMIC_INT_KIND' kind. 8526 VALUE Scalar of the same type as ATOM. If the kind is 8527 different, the value is converted to the kind of 8528 ATOM. 8529 OLD Scalar of the same type and kind as ATOM. 8530 STAT (optional) Scalar default-kind integer variable. 8531 8532 _Example_: 8533 program atomic 8534 use iso_fortran_env 8535 integer(atomic_int_kind) :: atom[*], old 8536 call atomic_fetch_and (atom[1], int(b'10100011101'), old) 8537 end program atomic 8538 8539 _See also_: 8540 *note ATOMIC_DEFINE::, *note ATOMIC_AND::, *note ISO_FORTRAN_ENV::, 8541 *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_OR::, *note 8542 ATOMIC_FETCH_XOR:: 8543 8544 8545 File: gfortran.info, Node: ATOMIC_FETCH_OR, Next: ATOMIC_FETCH_XOR, Prev: ATOMIC_FETCH_AND, Up: Intrinsic Procedures 8546 8547 8.34 'ATOMIC_FETCH_OR' -- Atomic bitwise OR operation with prior fetch 8548 ====================================================================== 8549 8550 _Description_: 8551 'ATOMIC_OR(ATOM, VALUE)' atomically stores the value of ATOM in OLD 8552 and defines ATOM with the bitwise OR between the values of ATOM and 8553 VALUE. When STAT is present and the invocation was successful, it 8554 is assigned the value 0. If it is present and the invocation has 8555 failed, it is assigned a positive value; in particular, for a 8556 coindexed ATOM, if the remote image has stopped, it is assigned the 8557 value of 'ISO_FORTRAN_ENV''s 'STAT_STOPPED_IMAGE' and if the remote 8558 image has failed, the value 'STAT_FAILED_IMAGE'. 8559 8560 _Standard_: 8561 TS 18508 or later 8562 8563 _Class_: 8564 Atomic subroutine 8565 8566 _Syntax_: 8567 'CALL ATOMIC_FETCH_OR (ATOM, VALUE, OLD [, STAT])' 8568 8569 _Arguments_: 8570 ATOM Scalar coarray or coindexed variable of integer 8571 type with 'ATOMIC_INT_KIND' kind. 8572 VALUE Scalar of the same type as ATOM. If the kind is 8573 different, the value is converted to the kind of 8574 ATOM. 8575 OLD Scalar of the same type and kind as ATOM. 8576 STAT (optional) Scalar default-kind integer variable. 8577 8578 _Example_: 8579 program atomic 8580 use iso_fortran_env 8581 integer(atomic_int_kind) :: atom[*], old 8582 call atomic_fetch_or (atom[1], int(b'10100011101'), old) 8583 end program atomic 8584 8585 _See also_: 8586 *note ATOMIC_DEFINE::, *note ATOMIC_OR::, *note ISO_FORTRAN_ENV::, 8587 *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note 8588 ATOMIC_FETCH_XOR:: 8589 8590 8591 File: gfortran.info, Node: ATOMIC_FETCH_XOR, Next: ATOMIC_OR, Prev: ATOMIC_FETCH_OR, Up: Intrinsic Procedures 8592 8593 8.35 'ATOMIC_FETCH_XOR' -- Atomic bitwise XOR operation with prior fetch 8594 ======================================================================== 8595 8596 _Description_: 8597 'ATOMIC_XOR(ATOM, VALUE)' atomically stores the value of ATOM in 8598 OLD and defines ATOM with the bitwise XOR between the values of 8599 ATOM and VALUE. When STAT is present and the invocation was 8600 successful, it is assigned the value 0. If it is present and the 8601 invocation has failed, it is assigned a positive value; in 8602 particular, for a coindexed ATOM, if the remote image has stopped, 8603 it is assigned the value of 'ISO_FORTRAN_ENV''s 8604 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8605 'STAT_FAILED_IMAGE'. 8606 8607 _Standard_: 8608 TS 18508 or later 8609 8610 _Class_: 8611 Atomic subroutine 8612 8613 _Syntax_: 8614 'CALL ATOMIC_FETCH_XOR (ATOM, VALUE, OLD [, STAT])' 8615 8616 _Arguments_: 8617 ATOM Scalar coarray or coindexed variable of integer 8618 type with 'ATOMIC_INT_KIND' kind. 8619 VALUE Scalar of the same type as ATOM. If the kind is 8620 different, the value is converted to the kind of 8621 ATOM. 8622 OLD Scalar of the same type and kind as ATOM. 8623 STAT (optional) Scalar default-kind integer variable. 8624 8625 _Example_: 8626 program atomic 8627 use iso_fortran_env 8628 integer(atomic_int_kind) :: atom[*], old 8629 call atomic_fetch_xor (atom[1], int(b'10100011101'), old) 8630 end program atomic 8631 8632 _See also_: 8633 *note ATOMIC_DEFINE::, *note ATOMIC_XOR::, *note ISO_FORTRAN_ENV::, 8634 *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note 8635 ATOMIC_FETCH_OR:: 8636 8637 8638 File: gfortran.info, Node: ATOMIC_OR, Next: ATOMIC_REF, Prev: ATOMIC_FETCH_XOR, Up: Intrinsic Procedures 8639 8640 8.36 'ATOMIC_OR' -- Atomic bitwise OR operation 8641 =============================================== 8642 8643 _Description_: 8644 'ATOMIC_OR(ATOM, VALUE)' atomically defines ATOM with the bitwise 8645 AND between the values of ATOM and VALUE. When STAT is present and 8646 the invocation was successful, it is assigned the value 0. If it 8647 is present and the invocation has failed, it is assigned a positive 8648 value; in particular, for a coindexed ATOM, if the remote image has 8649 stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s 8650 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8651 'STAT_FAILED_IMAGE'. 8652 8653 _Standard_: 8654 TS 18508 or later 8655 8656 _Class_: 8657 Atomic subroutine 8658 8659 _Syntax_: 8660 'CALL ATOMIC_OR (ATOM, VALUE [, STAT])' 8661 8662 _Arguments_: 8663 ATOM Scalar coarray or coindexed variable of integer 8664 type with 'ATOMIC_INT_KIND' kind. 8665 VALUE Scalar of the same type as ATOM. If the kind is 8666 different, the value is converted to the kind of 8667 ATOM. 8668 STAT (optional) Scalar default-kind integer variable. 8669 8670 _Example_: 8671 program atomic 8672 use iso_fortran_env 8673 integer(atomic_int_kind) :: atom[*] 8674 call atomic_or (atom[1], int(b'10100011101')) 8675 end program atomic 8676 8677 _See also_: 8678 *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_OR::, *note 8679 ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note 8680 ATOMIC_XOR:: 8681 8682 8683 File: gfortran.info, Node: ATOMIC_REF, Next: ATOMIC_XOR, Prev: ATOMIC_OR, Up: Intrinsic Procedures 8684 8685 8.37 'ATOMIC_REF' -- Obtaining the value of a variable atomically 8686 ================================================================= 8687 8688 _Description_: 8689 'ATOMIC_DEFINE(ATOM, VALUE)' atomically assigns the value of the 8690 variable ATOM to VALUE. When STAT is present and the invocation 8691 was successful, it is assigned the value 0. If it is present and 8692 the invocation has failed, it is assigned a positive value; in 8693 particular, for a coindexed ATOM, if the remote image has stopped, 8694 it is assigned the value of 'ISO_FORTRAN_ENV''s 8695 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8696 'STAT_FAILED_IMAGE'. 8697 8698 _Standard_: 8699 Fortran 2008 and later; with STAT, TS 18508 or later 8700 8701 _Class_: 8702 Atomic subroutine 8703 8704 _Syntax_: 8705 'CALL ATOMIC_REF(VALUE, ATOM [, STAT])' 8706 8707 _Arguments_: 8708 VALUE Scalar of the same type as ATOM. If the kind is 8709 different, the value is converted to the kind of 8710 ATOM. 8711 ATOM Scalar coarray or coindexed variable of either 8712 integer type with 'ATOMIC_INT_KIND' kind or 8713 logical type with 'ATOMIC_LOGICAL_KIND' kind. 8714 STAT (optional) Scalar default-kind integer variable. 8715 8716 _Example_: 8717 program atomic 8718 use iso_fortran_env 8719 logical(atomic_logical_kind) :: atom[*] 8720 logical :: val 8721 call atomic_ref (atom, .false.) 8722 ! ... 8723 call atomic_ref (atom, val) 8724 if (val) then 8725 print *, "Obtained" 8726 end if 8727 end program atomic 8728 8729 _See also_: 8730 *note ATOMIC_DEFINE::, *note ATOMIC_CAS::, *note ISO_FORTRAN_ENV::, 8731 *note ATOMIC_FETCH_ADD::, *note ATOMIC_FETCH_AND::, *note 8732 ATOMIC_FETCH_OR::, *note ATOMIC_FETCH_XOR:: 8733 8734 8735 File: gfortran.info, Node: ATOMIC_XOR, Next: BACKTRACE, Prev: ATOMIC_REF, Up: Intrinsic Procedures 8736 8737 8.38 'ATOMIC_XOR' -- Atomic bitwise OR operation 8738 ================================================ 8739 8740 _Description_: 8741 'ATOMIC_AND(ATOM, VALUE)' atomically defines ATOM with the bitwise 8742 XOR between the values of ATOM and VALUE. When STAT is present and 8743 the invocation was successful, it is assigned the value 0. If it 8744 is present and the invocation has failed, it is assigned a positive 8745 value; in particular, for a coindexed ATOM, if the remote image has 8746 stopped, it is assigned the value of 'ISO_FORTRAN_ENV''s 8747 'STAT_STOPPED_IMAGE' and if the remote image has failed, the value 8748 'STAT_FAILED_IMAGE'. 8749 8750 _Standard_: 8751 TS 18508 or later 8752 8753 _Class_: 8754 Atomic subroutine 8755 8756 _Syntax_: 8757 'CALL ATOMIC_XOR (ATOM, VALUE [, STAT])' 8758 8759 _Arguments_: 8760 ATOM Scalar coarray or coindexed variable of integer 8761 type with 'ATOMIC_INT_KIND' kind. 8762 VALUE Scalar of the same type as ATOM. If the kind is 8763 different, the value is converted to the kind of 8764 ATOM. 8765 STAT (optional) Scalar default-kind integer variable. 8766 8767 _Example_: 8768 program atomic 8769 use iso_fortran_env 8770 integer(atomic_int_kind) :: atom[*] 8771 call atomic_xor (atom[1], int(b'10100011101')) 8772 end program atomic 8773 8774 _See also_: 8775 *note ATOMIC_DEFINE::, *note ATOMIC_FETCH_XOR::, *note 8776 ISO_FORTRAN_ENV::, *note ATOMIC_ADD::, *note ATOMIC_OR::, *note 8777 ATOMIC_XOR:: 8778 8779 8780 File: gfortran.info, Node: BACKTRACE, Next: BESSEL_J0, Prev: ATOMIC_XOR, Up: Intrinsic Procedures 8781 8782 8.39 'BACKTRACE' -- Show a backtrace 8783 ==================================== 8784 8785 _Description_: 8786 'BACKTRACE' shows a backtrace at an arbitrary place in user code. 8787 Program execution continues normally afterwards. The backtrace 8788 information is printed to the unit corresponding to 'ERROR_UNIT' in 8789 'ISO_FORTRAN_ENV'. 8790 8791 _Standard_: 8792 GNU extension 8793 8794 _Class_: 8795 Subroutine 8796 8797 _Syntax_: 8798 'CALL BACKTRACE' 8799 8800 _Arguments_: 8801 None 8802 8803 _See also_: 8804 *note ABORT:: 8805 8806 8807 File: gfortran.info, Node: BESSEL_J0, Next: BESSEL_J1, Prev: BACKTRACE, Up: Intrinsic Procedures 8808 8809 8.40 'BESSEL_J0' -- Bessel function of the first kind of order 0 8810 ================================================================ 8811 8812 _Description_: 8813 'BESSEL_J0(X)' computes the Bessel function of the first kind of 8814 order 0 of X. This function is available under the name 'BESJ0' as 8815 a GNU extension. 8816 8817 _Standard_: 8818 Fortran 2008 and later 8819 8820 _Class_: 8821 Elemental function 8822 8823 _Syntax_: 8824 'RESULT = BESSEL_J0(X)' 8825 8826 _Arguments_: 8827 X The type shall be 'REAL'. 8828 8829 _Return value_: 8830 The return value is of type 'REAL' and lies in the range - 8831 0.4027... \leq Bessel (0,x) \leq 1. It has the same kind as X. 8832 8833 _Example_: 8834 program test_besj0 8835 real(8) :: x = 0.0_8 8836 x = bessel_j0(x) 8837 end program test_besj0 8838 8839 _Specific names_: 8840 Name Argument Return type Standard 8841 ------------------------------------------------------------------------- 8842 'DBESJ0(X)' 'REAL(8) X' 'REAL(8)' GNU extension 8843 8844 8845 File: gfortran.info, Node: BESSEL_J1, Next: BESSEL_JN, Prev: BESSEL_J0, Up: Intrinsic Procedures 8846 8847 8.41 'BESSEL_J1' -- Bessel function of the first kind of order 1 8848 ================================================================ 8849 8850 _Description_: 8851 'BESSEL_J1(X)' computes the Bessel function of the first kind of 8852 order 1 of X. This function is available under the name 'BESJ1' as 8853 a GNU extension. 8854 8855 _Standard_: 8856 Fortran 2008 8857 8858 _Class_: 8859 Elemental function 8860 8861 _Syntax_: 8862 'RESULT = BESSEL_J1(X)' 8863 8864 _Arguments_: 8865 X The type shall be 'REAL'. 8866 8867 _Return value_: 8868 The return value is of type 'REAL' and lies in the range - 8869 0.5818... \leq Bessel (0,x) \leq 0.5818 . It has the same kind as 8870 X. 8871 8872 _Example_: 8873 program test_besj1 8874 real(8) :: x = 1.0_8 8875 x = bessel_j1(x) 8876 end program test_besj1 8877 8878 _Specific names_: 8879 Name Argument Return type Standard 8880 ------------------------------------------------------------------------- 8881 'DBESJ1(X)' 'REAL(8) X' 'REAL(8)' GNU extension 8882 8883 8884 File: gfortran.info, Node: BESSEL_JN, Next: BESSEL_Y0, Prev: BESSEL_J1, Up: Intrinsic Procedures 8885 8886 8.42 'BESSEL_JN' -- Bessel function of the first kind 8887 ===================================================== 8888 8889 _Description_: 8890 'BESSEL_JN(N, X)' computes the Bessel function of the first kind of 8891 order N of X. This function is available under the name 'BESJN' as 8892 a GNU extension. If N and X are arrays, their ranks and shapes 8893 shall conform. 8894 8895 'BESSEL_JN(N1, N2, X)' returns an array with the Bessel functions 8896 of the first kind of the orders N1 to N2. 8897 8898 _Standard_: 8899 Fortran 2008 and later, negative N is allowed as GNU extension 8900 8901 _Class_: 8902 Elemental function, except for the transformational function 8903 'BESSEL_JN(N1, N2, X)' 8904 8905 _Syntax_: 8906 'RESULT = BESSEL_JN(N, X)' 8907 'RESULT = BESSEL_JN(N1, N2, X)' 8908 8909 _Arguments_: 8910 N Shall be a scalar or an array of type 'INTEGER'. 8911 N1 Shall be a non-negative scalar of type 8912 'INTEGER'. 8913 N2 Shall be a non-negative scalar of type 8914 'INTEGER'. 8915 X Shall be a scalar or an array of type 'REAL'; 8916 for 'BESSEL_JN(N1, N2, X)' it shall be scalar. 8917 8918 _Return value_: 8919 The return value is a scalar of type 'REAL'. It has the same kind 8920 as X. 8921 8922 _Note_: 8923 The transformational function uses a recurrence algorithm which 8924 might, for some values of X, lead to different results than calls 8925 to the elemental function. 8926 8927 _Example_: 8928 program test_besjn 8929 real(8) :: x = 1.0_8 8930 x = bessel_jn(5,x) 8931 end program test_besjn 8932 8933 _Specific names_: 8934 Name Argument Return type Standard 8935 ------------------------------------------------------------------------- 8936 'DBESJN(N, X)' 'INTEGER N' 'REAL(8)' GNU extension 8937 'REAL(8) X' 8938 8939 8940 File: gfortran.info, Node: BESSEL_Y0, Next: BESSEL_Y1, Prev: BESSEL_JN, Up: Intrinsic Procedures 8941 8942 8.43 'BESSEL_Y0' -- Bessel function of the second kind of order 0 8943 ================================================================= 8944 8945 _Description_: 8946 'BESSEL_Y0(X)' computes the Bessel function of the second kind of 8947 order 0 of X. This function is available under the name 'BESY0' as 8948 a GNU extension. 8949 8950 _Standard_: 8951 Fortran 2008 and later 8952 8953 _Class_: 8954 Elemental function 8955 8956 _Syntax_: 8957 'RESULT = BESSEL_Y0(X)' 8958 8959 _Arguments_: 8960 X The type shall be 'REAL'. 8961 8962 _Return value_: 8963 The return value is of type 'REAL'. It has the same kind as X. 8964 8965 _Example_: 8966 program test_besy0 8967 real(8) :: x = 0.0_8 8968 x = bessel_y0(x) 8969 end program test_besy0 8970 8971 _Specific names_: 8972 Name Argument Return type Standard 8973 ------------------------------------------------------------------------- 8974 'DBESY0(X)' 'REAL(8) X' 'REAL(8)' GNU extension 8975 8976 8977 File: gfortran.info, Node: BESSEL_Y1, Next: BESSEL_YN, Prev: BESSEL_Y0, Up: Intrinsic Procedures 8978 8979 8.44 'BESSEL_Y1' -- Bessel function of the second kind of order 1 8980 ================================================================= 8981 8982 _Description_: 8983 'BESSEL_Y1(X)' computes the Bessel function of the second kind of 8984 order 1 of X. This function is available under the name 'BESY1' as 8985 a GNU extension. 8986 8987 _Standard_: 8988 Fortran 2008 and later 8989 8990 _Class_: 8991 Elemental function 8992 8993 _Syntax_: 8994 'RESULT = BESSEL_Y1(X)' 8995 8996 _Arguments_: 8997 X The type shall be 'REAL'. 8998 8999 _Return value_: 9000 The return value is of type 'REAL'. It has the same kind as X. 9001 9002 _Example_: 9003 program test_besy1 9004 real(8) :: x = 1.0_8 9005 x = bessel_y1(x) 9006 end program test_besy1 9007 9008 _Specific names_: 9009 Name Argument Return type Standard 9010 ------------------------------------------------------------------------- 9011 'DBESY1(X)' 'REAL(8) X' 'REAL(8)' GNU extension 9012 9013 9014 File: gfortran.info, Node: BESSEL_YN, Next: BGE, Prev: BESSEL_Y1, Up: Intrinsic Procedures 9015 9016 8.45 'BESSEL_YN' -- Bessel function of the second kind 9017 ====================================================== 9018 9019 _Description_: 9020 'BESSEL_YN(N, X)' computes the Bessel function of the second kind 9021 of order N of X. This function is available under the name 'BESYN' 9022 as a GNU extension. If N and X are arrays, their ranks and shapes 9023 shall conform. 9024 9025 'BESSEL_YN(N1, N2, X)' returns an array with the Bessel functions 9026 of the first kind of the orders N1 to N2. 9027 9028 _Standard_: 9029 Fortran 2008 and later, negative N is allowed as GNU extension 9030 9031 _Class_: 9032 Elemental function, except for the transformational function 9033 'BESSEL_YN(N1, N2, X)' 9034 9035 _Syntax_: 9036 'RESULT = BESSEL_YN(N, X)' 9037 'RESULT = BESSEL_YN(N1, N2, X)' 9038 9039 _Arguments_: 9040 N Shall be a scalar or an array of type 'INTEGER' 9041 . 9042 N1 Shall be a non-negative scalar of type 9043 'INTEGER'. 9044 N2 Shall be a non-negative scalar of type 9045 'INTEGER'. 9046 X Shall be a scalar or an array of type 'REAL'; 9047 for 'BESSEL_YN(N1, N2, X)' it shall be scalar. 9048 9049 _Return value_: 9050 The return value is a scalar of type 'REAL'. It has the same kind 9051 as X. 9052 9053 _Note_: 9054 The transformational function uses a recurrence algorithm which 9055 might, for some values of X, lead to different results than calls 9056 to the elemental function. 9057 9058 _Example_: 9059 program test_besyn 9060 real(8) :: x = 1.0_8 9061 x = bessel_yn(5,x) 9062 end program test_besyn 9063 9064 _Specific names_: 9065 Name Argument Return type Standard 9066 ------------------------------------------------------------------------- 9067 'DBESYN(N,X)' 'INTEGER N' 'REAL(8)' GNU extension 9068 'REAL(8) X' 9069 9070 9071 File: gfortran.info, Node: BGE, Next: BGT, Prev: BESSEL_YN, Up: Intrinsic Procedures 9072 9073 8.46 'BGE' -- Bitwise greater than or equal to 9074 ============================================== 9075 9076 _Description_: 9077 Determines whether an integral is a bitwise greater than or equal 9078 to another. 9079 9080 _Standard_: 9081 Fortran 2008 and later 9082 9083 _Class_: 9084 Elemental function 9085 9086 _Syntax_: 9087 'RESULT = BGE(I, J)' 9088 9089 _Arguments_: 9090 I Shall be of 'INTEGER' type. 9091 J Shall be of 'INTEGER' type, and of the same kind 9092 as I. 9093 9094 _Return value_: 9095 The return value is of type 'LOGICAL' and of the default kind. 9096 9097 _See also_: 9098 *note BGT::, *note BLE::, *note BLT:: 9099 9100 9101 File: gfortran.info, Node: BGT, Next: BIT_SIZE, Prev: BGE, Up: Intrinsic Procedures 9102 9103 8.47 'BGT' -- Bitwise greater than 9104 ================================== 9105 9106 _Description_: 9107 Determines whether an integral is a bitwise greater than another. 9108 9109 _Standard_: 9110 Fortran 2008 and later 9111 9112 _Class_: 9113 Elemental function 9114 9115 _Syntax_: 9116 'RESULT = BGT(I, J)' 9117 9118 _Arguments_: 9119 I Shall be of 'INTEGER' type. 9120 J Shall be of 'INTEGER' type, and of the same kind 9121 as I. 9122 9123 _Return value_: 9124 The return value is of type 'LOGICAL' and of the default kind. 9125 9126 _See also_: 9127 *note BGE::, *note BLE::, *note BLT:: 9128 9129 9130 File: gfortran.info, Node: BIT_SIZE, Next: BLE, Prev: BGT, Up: Intrinsic Procedures 9131 9132 8.48 'BIT_SIZE' -- Bit size inquiry function 9133 ============================================ 9134 9135 _Description_: 9136 'BIT_SIZE(I)' returns the number of bits (integer precision plus 9137 sign bit) represented by the type of I. The result of 9138 'BIT_SIZE(I)' is independent of the actual value of I. 9139 9140 _Standard_: 9141 Fortran 90 and later 9142 9143 _Class_: 9144 Inquiry function 9145 9146 _Syntax_: 9147 'RESULT = BIT_SIZE(I)' 9148 9149 _Arguments_: 9150 I The type shall be 'INTEGER'. 9151 9152 _Return value_: 9153 The return value is of type 'INTEGER' 9154 9155 _Example_: 9156 program test_bit_size 9157 integer :: i = 123 9158 integer :: size 9159 size = bit_size(i) 9160 print *, size 9161 end program test_bit_size 9162 9163 9164 File: gfortran.info, Node: BLE, Next: BLT, Prev: BIT_SIZE, Up: Intrinsic Procedures 9165 9166 8.49 'BLE' -- Bitwise less than or equal to 9167 =========================================== 9168 9169 _Description_: 9170 Determines whether an integral is a bitwise less than or equal to 9171 another. 9172 9173 _Standard_: 9174 Fortran 2008 and later 9175 9176 _Class_: 9177 Elemental function 9178 9179 _Syntax_: 9180 'RESULT = BLE(I, J)' 9181 9182 _Arguments_: 9183 I Shall be of 'INTEGER' type. 9184 J Shall be of 'INTEGER' type, and of the same kind 9185 as I. 9186 9187 _Return value_: 9188 The return value is of type 'LOGICAL' and of the default kind. 9189 9190 _See also_: 9191 *note BGT::, *note BGE::, *note BLT:: 9192 9193 9194 File: gfortran.info, Node: BLT, Next: BTEST, Prev: BLE, Up: Intrinsic Procedures 9195 9196 8.50 'BLT' -- Bitwise less than 9197 =============================== 9198 9199 _Description_: 9200 Determines whether an integral is a bitwise less than another. 9201 9202 _Standard_: 9203 Fortran 2008 and later 9204 9205 _Class_: 9206 Elemental function 9207 9208 _Syntax_: 9209 'RESULT = BLT(I, J)' 9210 9211 _Arguments_: 9212 I Shall be of 'INTEGER' type. 9213 J Shall be of 'INTEGER' type, and of the same kind 9214 as I. 9215 9216 _Return value_: 9217 The return value is of type 'LOGICAL' and of the default kind. 9218 9219 _See also_: 9220 *note BGE::, *note BGT::, *note BLE:: 9221 9222 9223 File: gfortran.info, Node: BTEST, Next: C_ASSOCIATED, Prev: BLT, Up: Intrinsic Procedures 9224 9225 8.51 'BTEST' -- Bit test function 9226 ================================= 9227 9228 _Description_: 9229 'BTEST(I,POS)' returns logical '.TRUE.' if the bit at POS in I is 9230 set. The counting of the bits starts at 0. 9231 9232 _Standard_: 9233 Fortran 90 and later, has overloads that are GNU extensions 9234 9235 _Class_: 9236 Elemental function 9237 9238 _Syntax_: 9239 'RESULT = BTEST(I, POS)' 9240 9241 _Arguments_: 9242 I The type shall be 'INTEGER'. 9243 POS The type shall be 'INTEGER'. 9244 9245 _Return value_: 9246 The return value is of type 'LOGICAL' 9247 9248 _Example_: 9249 program test_btest 9250 integer :: i = 32768 + 1024 + 64 9251 integer :: pos 9252 logical :: bool 9253 do pos=0,16 9254 bool = btest(i, pos) 9255 print *, pos, bool 9256 end do 9257 end program test_btest 9258 9259 _Specific names_: 9260 Name Argument Return type Standard 9261 -------------------------------------------------------------------------- 9262 'BTEST(I,POS)' 'INTEGER I,POS' 'LOGICAL' Fortran 95 and later 9263 'BBTEST(I,POS)' 'INTEGER(1) I,POS' 'LOGICAL(1)' GNU extension 9264 'BITEST(I,POS)' 'INTEGER(2) I,POS' 'LOGICAL(2)' GNU extension 9265 'BJTEST(I,POS)' 'INTEGER(4) I,POS' 'LOGICAL(4)' GNU extension 9266 'BKTEST(I,POS)' 'INTEGER(8) I,POS' 'LOGICAL(8)' GNU extension 9267 9268 9269 File: gfortran.info, Node: C_ASSOCIATED, Next: C_F_POINTER, Prev: BTEST, Up: Intrinsic Procedures 9270 9271 8.52 'C_ASSOCIATED' -- Status of a C pointer 9272 ============================================ 9273 9274 _Description_: 9275 'C_ASSOCIATED(c_ptr_1[, c_ptr_2])' determines the status of the C 9276 pointer C_PTR_1 or if C_PTR_1 is associated with the target 9277 C_PTR_2. 9278 9279 _Standard_: 9280 Fortran 2003 and later 9281 9282 _Class_: 9283 Inquiry function 9284 9285 _Syntax_: 9286 'RESULT = C_ASSOCIATED(c_ptr_1[, c_ptr_2])' 9287 9288 _Arguments_: 9289 C_PTR_1 Scalar of the type 'C_PTR' or 'C_FUNPTR'. 9290 C_PTR_2 (Optional) Scalar of the same type as C_PTR_1. 9291 9292 _Return value_: 9293 The return value is of type 'LOGICAL'; it is '.false.' if either 9294 C_PTR_1 is a C NULL pointer or if C_PTR1 and C_PTR_2 point to 9295 different addresses. 9296 9297 _Example_: 9298 subroutine association_test(a,b) 9299 use iso_c_binding, only: c_associated, c_loc, c_ptr 9300 implicit none 9301 real, pointer :: a 9302 type(c_ptr) :: b 9303 if(c_associated(b, c_loc(a))) & 9304 stop 'b and a do not point to same target' 9305 end subroutine association_test 9306 9307 _See also_: 9308 *note C_LOC::, *note C_FUNLOC:: 9309 9310 9311 File: gfortran.info, Node: C_F_POINTER, Next: C_F_PROCPOINTER, Prev: C_ASSOCIATED, Up: Intrinsic Procedures 9312 9313 8.53 'C_F_POINTER' -- Convert C into Fortran pointer 9314 ==================================================== 9315 9316 _Description_: 9317 'C_F_POINTER(CPTR, FPTR[, SHAPE])' assigns the target of the C 9318 pointer CPTR to the Fortran pointer FPTR and specifies its shape. 9319 9320 _Standard_: 9321 Fortran 2003 and later 9322 9323 _Class_: 9324 Subroutine 9325 9326 _Syntax_: 9327 'CALL C_F_POINTER(CPTR, FPTR[, SHAPE])' 9328 9329 _Arguments_: 9330 CPTR scalar of the type 'C_PTR'. It is 'INTENT(IN)'. 9331 FPTR pointer interoperable with CPTR. It is 9332 'INTENT(OUT)'. 9333 SHAPE (Optional) Rank-one array of type 'INTEGER' with 9334 'INTENT(IN)'. It shall be present if and only 9335 if FPTR is an array. The size must be equal to 9336 the rank of FPTR. 9337 9338 _Example_: 9339 program main 9340 use iso_c_binding 9341 implicit none 9342 interface 9343 subroutine my_routine(p) bind(c,name='myC_func') 9344 import :: c_ptr 9345 type(c_ptr), intent(out) :: p 9346 end subroutine 9347 end interface 9348 type(c_ptr) :: cptr 9349 real,pointer :: a(:) 9350 call my_routine(cptr) 9351 call c_f_pointer(cptr, a, [12]) 9352 end program main 9353 9354 _See also_: 9355 *note C_LOC::, *note C_F_PROCPOINTER:: 9356 9357 9358 File: gfortran.info, Node: C_F_PROCPOINTER, Next: C_FUNLOC, Prev: C_F_POINTER, Up: Intrinsic Procedures 9359 9360 8.54 'C_F_PROCPOINTER' -- Convert C into Fortran procedure pointer 9361 ================================================================== 9362 9363 _Description_: 9364 'C_F_PROCPOINTER(CPTR, FPTR)' Assign the target of the C function 9365 pointer CPTR to the Fortran procedure pointer FPTR. 9366 9367 _Standard_: 9368 Fortran 2003 and later 9369 9370 _Class_: 9371 Subroutine 9372 9373 _Syntax_: 9374 'CALL C_F_PROCPOINTER(cptr, fptr)' 9375 9376 _Arguments_: 9377 CPTR scalar of the type 'C_FUNPTR'. It is 9378 'INTENT(IN)'. 9379 FPTR procedure pointer interoperable with CPTR. It 9380 is 'INTENT(OUT)'. 9381 9382 _Example_: 9383 program main 9384 use iso_c_binding 9385 implicit none 9386 abstract interface 9387 function func(a) 9388 import :: c_float 9389 real(c_float), intent(in) :: a 9390 real(c_float) :: func 9391 end function 9392 end interface 9393 interface 9394 function getIterFunc() bind(c,name="getIterFunc") 9395 import :: c_funptr 9396 type(c_funptr) :: getIterFunc 9397 end function 9398 end interface 9399 type(c_funptr) :: cfunptr 9400 procedure(func), pointer :: myFunc 9401 cfunptr = getIterFunc() 9402 call c_f_procpointer(cfunptr, myFunc) 9403 end program main 9404 9405 _See also_: 9406 *note C_LOC::, *note C_F_POINTER:: 9407 9408 9409 File: gfortran.info, Node: C_FUNLOC, Next: C_LOC, Prev: C_F_PROCPOINTER, Up: Intrinsic Procedures 9410 9411 8.55 'C_FUNLOC' -- Obtain the C address of a procedure 9412 ====================================================== 9413 9414 _Description_: 9415 'C_FUNLOC(x)' determines the C address of the argument. 9416 9417 _Standard_: 9418 Fortran 2003 and later 9419 9420 _Class_: 9421 Inquiry function 9422 9423 _Syntax_: 9424 'RESULT = C_FUNLOC(x)' 9425 9426 _Arguments_: 9427 X Interoperable function or pointer to such 9428 function. 9429 9430 _Return value_: 9431 The return value is of type 'C_FUNPTR' and contains the C address 9432 of the argument. 9433 9434 _Example_: 9435 module x 9436 use iso_c_binding 9437 implicit none 9438 contains 9439 subroutine sub(a) bind(c) 9440 real(c_float) :: a 9441 a = sqrt(a)+5.0 9442 end subroutine sub 9443 end module x 9444 program main 9445 use iso_c_binding 9446 use x 9447 implicit none 9448 interface 9449 subroutine my_routine(p) bind(c,name='myC_func') 9450 import :: c_funptr 9451 type(c_funptr), intent(in) :: p 9452 end subroutine 9453 end interface 9454 call my_routine(c_funloc(sub)) 9455 end program main 9456 9457 _See also_: 9458 *note C_ASSOCIATED::, *note C_LOC::, *note C_F_POINTER::, *note 9459 C_F_PROCPOINTER:: 9460 9461 9462 File: gfortran.info, Node: C_LOC, Next: C_SIZEOF, Prev: C_FUNLOC, Up: Intrinsic Procedures 9463 9464 8.56 'C_LOC' -- Obtain the C address of an object 9465 ================================================= 9466 9467 _Description_: 9468 'C_LOC(X)' determines the C address of the argument. 9469 9470 _Standard_: 9471 Fortran 2003 and later 9472 9473 _Class_: 9474 Inquiry function 9475 9476 _Syntax_: 9477 'RESULT = C_LOC(X)' 9478 9479 _Arguments_: 9480 X Shall have either the POINTER or TARGET attribute. 9481 It shall not be a coindexed object. It shall either 9482 be a variable with interoperable type and kind type 9483 parameters, or be a scalar, nonpolymorphic variable 9484 with no length type parameters. 9485 9486 9487 _Return value_: 9488 The return value is of type 'C_PTR' and contains the C address of 9489 the argument. 9490 9491 _Example_: 9492 subroutine association_test(a,b) 9493 use iso_c_binding, only: c_associated, c_loc, c_ptr 9494 implicit none 9495 real, pointer :: a 9496 type(c_ptr) :: b 9497 if(c_associated(b, c_loc(a))) & 9498 stop 'b and a do not point to same target' 9499 end subroutine association_test 9500 9501 _See also_: 9502 *note C_ASSOCIATED::, *note C_FUNLOC::, *note C_F_POINTER::, *note 9503 C_F_PROCPOINTER:: 9504 9505 9506 File: gfortran.info, Node: C_SIZEOF, Next: CEILING, Prev: C_LOC, Up: Intrinsic Procedures 9507 9508 8.57 'C_SIZEOF' -- Size in bytes of an expression 9509 ================================================= 9510 9511 _Description_: 9512 'C_SIZEOF(X)' calculates the number of bytes of storage the 9513 expression 'X' occupies. 9514 9515 _Standard_: 9516 Fortran 2008 9517 9518 _Class_: 9519 Inquiry function of the module 'ISO_C_BINDING' 9520 9521 _Syntax_: 9522 'N = C_SIZEOF(X)' 9523 9524 _Arguments_: 9525 X The argument shall be an interoperable data 9526 entity. 9527 9528 _Return value_: 9529 The return value is of type integer and of the system-dependent 9530 kind 'C_SIZE_T' (from the 'ISO_C_BINDING' module). Its value is 9531 the number of bytes occupied by the argument. If the argument has 9532 the 'POINTER' attribute, the number of bytes of the storage area 9533 pointed to is returned. If the argument is of a derived type with 9534 'POINTER' or 'ALLOCATABLE' components, the return value does not 9535 account for the sizes of the data pointed to by these components. 9536 9537 _Example_: 9538 use iso_c_binding 9539 integer(c_int) :: i 9540 real(c_float) :: r, s(5) 9541 print *, (c_sizeof(s)/c_sizeof(r) == 5) 9542 end 9543 The example will print 'T' unless you are using a platform where 9544 default 'REAL' variables are unusually padded. 9545 9546 _See also_: 9547 *note SIZEOF::, *note STORAGE_SIZE:: 9548 9549 9550 File: gfortran.info, Node: CEILING, Next: CHAR, Prev: C_SIZEOF, Up: Intrinsic Procedures 9551 9552 8.58 'CEILING' -- Integer ceiling function 9553 ========================================== 9554 9555 _Description_: 9556 'CEILING(A)' returns the least integer greater than or equal to A. 9557 9558 _Standard_: 9559 Fortran 95 and later 9560 9561 _Class_: 9562 Elemental function 9563 9564 _Syntax_: 9565 'RESULT = CEILING(A [, KIND])' 9566 9567 _Arguments_: 9568 A The type shall be 'REAL'. 9569 KIND (Optional) An 'INTEGER' initialization 9570 expression indicating the kind parameter of the 9571 result. 9572 9573 _Return value_: 9574 The return value is of type 'INTEGER(KIND)' if KIND is present and 9575 a default-kind 'INTEGER' otherwise. 9576 9577 _Example_: 9578 program test_ceiling 9579 real :: x = 63.29 9580 real :: y = -63.59 9581 print *, ceiling(x) ! returns 64 9582 print *, ceiling(y) ! returns -63 9583 end program test_ceiling 9584 9585 _See also_: 9586 *note FLOOR::, *note NINT:: 9587 9588 9589 File: gfortran.info, Node: CHAR, Next: CHDIR, Prev: CEILING, Up: Intrinsic Procedures 9590 9591 8.59 'CHAR' -- Character conversion function 9592 ============================================ 9593 9594 _Description_: 9595 'CHAR(I [, KIND])' returns the character represented by the integer 9596 I. 9597 9598 _Standard_: 9599 Fortran 77 and later 9600 9601 _Class_: 9602 Elemental function 9603 9604 _Syntax_: 9605 'RESULT = CHAR(I [, KIND])' 9606 9607 _Arguments_: 9608 I The type shall be 'INTEGER'. 9609 KIND (Optional) An 'INTEGER' initialization 9610 expression indicating the kind parameter of the 9611 result. 9612 9613 _Return value_: 9614 The return value is of type 'CHARACTER(1)' 9615 9616 _Example_: 9617 program test_char 9618 integer :: i = 74 9619 character(1) :: c 9620 c = char(i) 9621 print *, i, c ! returns 'J' 9622 end program test_char 9623 9624 _Specific names_: 9625 Name Argument Return type Standard 9626 -------------------------------------------------------------------------- 9627 'CHAR(I)' 'INTEGER I' 'CHARACTER(LEN=1)' Fortran 77 and later 9628 9629 _Note_: 9630 See *note ICHAR:: for a discussion of converting between numerical 9631 values and formatted string representations. 9632 9633 _See also_: 9634 *note ACHAR::, *note IACHAR::, *note ICHAR:: 9635 9636 9637 File: gfortran.info, Node: CHDIR, Next: CHMOD, Prev: CHAR, Up: Intrinsic Procedures 9638 9639 8.60 'CHDIR' -- Change working directory 9640 ======================================== 9641 9642 _Description_: 9643 Change current working directory to a specified path. 9644 9645 This intrinsic is provided in both subroutine and function forms; 9646 however, only one form can be used in any given program unit. 9647 9648 _Standard_: 9649 GNU extension 9650 9651 _Class_: 9652 Subroutine, function 9653 9654 _Syntax_: 9655 'CALL CHDIR(NAME [, STATUS])' 9656 'STATUS = CHDIR(NAME)' 9657 9658 _Arguments_: 9659 NAME The type shall be 'CHARACTER' of default kind 9660 and shall specify a valid path within the file 9661 system. 9662 STATUS (Optional) 'INTEGER' status flag of the default 9663 kind. Returns 0 on success, and a system 9664 specific and nonzero error code otherwise. 9665 9666 _Example_: 9667 PROGRAM test_chdir 9668 CHARACTER(len=255) :: path 9669 CALL getcwd(path) 9670 WRITE(*,*) TRIM(path) 9671 CALL chdir("/tmp") 9672 CALL getcwd(path) 9673 WRITE(*,*) TRIM(path) 9674 END PROGRAM 9675 9676 _See also_: 9677 *note GETCWD:: 9678 9679 9680 File: gfortran.info, Node: CHMOD, Next: CMPLX, Prev: CHDIR, Up: Intrinsic Procedures 9681 9682 8.61 'CHMOD' -- Change access permissions of files 9683 ================================================== 9684 9685 _Description_: 9686 'CHMOD' changes the permissions of a file. 9687 9688 This intrinsic is provided in both subroutine and function forms; 9689 however, only one form can be used in any given program unit. 9690 9691 _Standard_: 9692 GNU extension 9693 9694 _Class_: 9695 Subroutine, function 9696 9697 _Syntax_: 9698 'CALL CHMOD(NAME, MODE[, STATUS])' 9699 'STATUS = CHMOD(NAME, MODE)' 9700 9701 _Arguments_: 9702 9703 NAME Scalar 'CHARACTER' of default kind with the file 9704 name. Trailing blanks are ignored unless the 9705 character 'achar(0)' is present, then all 9706 characters up to and excluding 'achar(0)' are 9707 used as the file name. 9708 9709 MODE Scalar 'CHARACTER' of default kind giving the 9710 file permission. MODE uses the same syntax as 9711 the 'chmod' utility as defined by the POSIX 9712 standard. The argument shall either be a string 9713 of a nonnegative octal number or a symbolic 9714 mode. 9715 9716 STATUS (optional) scalar 'INTEGER', which is '0' on 9717 success and nonzero otherwise. 9718 9719 _Return value_: 9720 In either syntax, STATUS is set to '0' on success and nonzero 9721 otherwise. 9722 9723 _Example_: 9724 'CHMOD' as subroutine 9725 program chmod_test 9726 implicit none 9727 integer :: status 9728 call chmod('test.dat','u+x',status) 9729 print *, 'Status: ', status 9730 end program chmod_test 9731 'CHMOD' as function: 9732 program chmod_test 9733 implicit none 9734 integer :: status 9735 status = chmod('test.dat','u+x') 9736 print *, 'Status: ', status 9737 end program chmod_test 9738 9739 9740 File: gfortran.info, Node: CMPLX, Next: CO_BROADCAST, Prev: CHMOD, Up: Intrinsic Procedures 9741 9742 8.62 'CMPLX' -- Complex conversion function 9743 =========================================== 9744 9745 _Description_: 9746 'CMPLX(X [, Y [, KIND]])' returns a complex number where X is 9747 converted to the real component. If Y is present it is converted 9748 to the imaginary component. If Y is not present then the imaginary 9749 component is set to 0.0. If X is complex then Y must not be 9750 present. 9751 9752 _Standard_: 9753 Fortran 77 and later 9754 9755 _Class_: 9756 Elemental function 9757 9758 _Syntax_: 9759 'RESULT = CMPLX(X [, Y [, KIND]])' 9760 9761 _Arguments_: 9762 X The type may be 'INTEGER', 'REAL', or 'COMPLEX'. 9763 Y (Optional; only allowed if X is not 'COMPLEX'.) 9764 May be 'INTEGER' or 'REAL'. 9765 KIND (Optional) An 'INTEGER' initialization 9766 expression indicating the kind parameter of the 9767 result. 9768 9769 _Return value_: 9770 The return value is of 'COMPLEX' type, with a kind equal to KIND if 9771 it is specified. If KIND is not specified, the result is of the 9772 default 'COMPLEX' kind, regardless of the kinds of X and Y. 9773 9774 _Example_: 9775 program test_cmplx 9776 integer :: i = 42 9777 real :: x = 3.14 9778 complex :: z 9779 z = cmplx(i, x) 9780 print *, z, cmplx(x) 9781 end program test_cmplx 9782 9783 _See also_: 9784 *note COMPLEX:: 9785 9786 9787 File: gfortran.info, Node: CO_BROADCAST, Next: CO_MAX, Prev: CMPLX, Up: Intrinsic Procedures 9788 9789 8.63 'CO_BROADCAST' -- Copy a value to all images the current set of images 9790 =========================================================================== 9791 9792 _Description_: 9793 'CO_BROADCAST' copies the value of argument A on the image with 9794 image index 'SOURCE_IMAGE' to all images in the current team. A 9795 becomes defined as if by intrinsic assignment. If the execution 9796 was successful and STAT is present, it is assigned the value zero. 9797 If the execution failed, STAT gets assigned a nonzero value and, if 9798 present, ERRMSG gets assigned a value describing the occurred 9799 error. 9800 9801 _Standard_: 9802 Technical Specification (TS) 18508 or later 9803 9804 _Class_: 9805 Collective subroutine 9806 9807 _Syntax_: 9808 'CALL CO_BROADCAST(A, SOURCE_IMAGE [, STAT, ERRMSG])' 9809 9810 _Arguments_: 9811 A INTENT(INOUT) argument; shall have the same 9812 dynamic type and type parameters on all 9813 images of the current team. If it is an 9814 array, it shall have the same shape on all 9815 images. 9816 SOURCE_IMAGE a scalar integer expression. It shall have 9817 the same value on all images and refer to an 9818 image of the current team. 9819 STAT (optional) a scalar integer variable 9820 ERRMSG (optional) a scalar character variable 9821 9822 _Example_: 9823 program test 9824 integer :: val(3) 9825 if (this_image() == 1) then 9826 val = [1, 5, 3] 9827 end if 9828 call co_broadcast (val, source_image=1) 9829 print *, this_image, ":", val 9830 end program test 9831 9832 _See also_: 9833 *note CO_MAX::, *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE:: 9834 9835 9836 File: gfortran.info, Node: CO_MAX, Next: CO_MIN, Prev: CO_BROADCAST, Up: Intrinsic Procedures 9837 9838 8.64 'CO_MAX' -- Maximal value on the current set of images 9839 =========================================================== 9840 9841 _Description_: 9842 'CO_MAX' determines element-wise the maximal value of A on all 9843 images of the current team. If RESULT_IMAGE is present, the 9844 maximum values are returned in A on the specified image only and 9845 the value of A on the other images become undefined. If 9846 RESULT_IMAGE is not present, the value is returned on all images. 9847 If the execution was successful and STAT is present, it is assigned 9848 the value zero. If the execution failed, STAT gets assigned a 9849 nonzero value and, if present, ERRMSG gets assigned a value 9850 describing the occurred error. 9851 9852 _Standard_: 9853 Technical Specification (TS) 18508 or later 9854 9855 _Class_: 9856 Collective subroutine 9857 9858 _Syntax_: 9859 'CALL CO_MAX(A [, RESULT_IMAGE, STAT, ERRMSG])' 9860 9861 _Arguments_: 9862 A shall be an integer, real or character 9863 variable, which has the same type and type 9864 parameters on all images of the team. 9865 RESULT_IMAGE (optional) a scalar integer expression; if 9866 present, it shall have the same value on all 9867 images and refer to an image of the current 9868 team. 9869 STAT (optional) a scalar integer variable 9870 ERRMSG (optional) a scalar character variable 9871 9872 _Example_: 9873 program test 9874 integer :: val 9875 val = this_image () 9876 call co_max (val, result_image=1) 9877 if (this_image() == 1) then 9878 write(*,*) "Maximal value", val ! prints num_images() 9879 end if 9880 end program test 9881 9882 _See also_: 9883 *note CO_MIN::, *note CO_SUM::, *note CO_REDUCE::, *note 9884 CO_BROADCAST:: 9885 9886 9887 File: gfortran.info, Node: CO_MIN, Next: CO_REDUCE, Prev: CO_MAX, Up: Intrinsic Procedures 9888 9889 8.65 'CO_MIN' -- Minimal value on the current set of images 9890 =========================================================== 9891 9892 _Description_: 9893 'CO_MIN' determines element-wise the minimal value of A on all 9894 images of the current team. If RESULT_IMAGE is present, the 9895 minimal values are returned in A on the specified image only and 9896 the value of A on the other images become undefined. If 9897 RESULT_IMAGE is not present, the value is returned on all images. 9898 If the execution was successful and STAT is present, it is assigned 9899 the value zero. If the execution failed, STAT gets assigned a 9900 nonzero value and, if present, ERRMSG gets assigned a value 9901 describing the occurred error. 9902 9903 _Standard_: 9904 Technical Specification (TS) 18508 or later 9905 9906 _Class_: 9907 Collective subroutine 9908 9909 _Syntax_: 9910 'CALL CO_MIN(A [, RESULT_IMAGE, STAT, ERRMSG])' 9911 9912 _Arguments_: 9913 A shall be an integer, real or character 9914 variable, which has the same type and type 9915 parameters on all images of the team. 9916 RESULT_IMAGE (optional) a scalar integer expression; if 9917 present, it shall have the same value on all 9918 images and refer to an image of the current 9919 team. 9920 STAT (optional) a scalar integer variable 9921 ERRMSG (optional) a scalar character variable 9922 9923 _Example_: 9924 program test 9925 integer :: val 9926 val = this_image () 9927 call co_min (val, result_image=1) 9928 if (this_image() == 1) then 9929 write(*,*) "Minimal value", val ! prints 1 9930 end if 9931 end program test 9932 9933 _See also_: 9934 *note CO_MAX::, *note CO_SUM::, *note CO_REDUCE::, *note 9935 CO_BROADCAST:: 9936 9937 9938 File: gfortran.info, Node: CO_REDUCE, Next: CO_SUM, Prev: CO_MIN, Up: Intrinsic Procedures 9939 9940 8.66 'CO_REDUCE' -- Reduction of values on the current set of images 9941 ==================================================================== 9942 9943 _Description_: 9944 'CO_REDUCE' determines element-wise the reduction of the value of A 9945 on all images of the current team. The pure function passed as 9946 OPERATION is used to pairwise reduce the values of A by passing 9947 either the value of A of different images or the result values of 9948 such a reduction as argument. If A is an array, the deduction is 9949 done element wise. If RESULT_IMAGE is present, the result values 9950 are returned in A on the specified image only and the value of A on 9951 the other images become undefined. If RESULT_IMAGE is not present, 9952 the value is returned on all images. If the execution was 9953 successful and STAT is present, it is assigned the value zero. If 9954 the execution failed, STAT gets assigned a nonzero value and, if 9955 present, ERRMSG gets assigned a value describing the occurred 9956 error. 9957 9958 _Standard_: 9959 Technical Specification (TS) 18508 or later 9960 9961 _Class_: 9962 Collective subroutine 9963 9964 _Syntax_: 9965 'CALL CO_REDUCE(A, OPERATION, [, RESULT_IMAGE, STAT, ERRMSG])' 9966 9967 _Arguments_: 9968 A is an 'INTENT(INOUT)' argument and shall be 9969 nonpolymorphic. If it is allocatable, it 9970 shall be allocated; if it is a pointer, it 9971 shall be associated. A shall have the same 9972 type and type parameters on all images of the 9973 team; if it is an array, it shall have the 9974 same shape on all images. 9975 OPERATION pure function with two scalar nonallocatable 9976 arguments, which shall be nonpolymorphic and 9977 have the same type and type parameters as A. 9978 The function shall return a nonallocatable 9979 scalar of the same type and type parameters 9980 as A. The function shall be the same on all 9981 images and with regards to the arguments 9982 mathematically commutative and associative. 9983 Note that OPERATION may not be an elemental 9984 function, unless it is an intrisic function. 9985 RESULT_IMAGE (optional) a scalar integer expression; if 9986 present, it shall have the same value on all 9987 images and refer to an image of the current 9988 team. 9989 STAT (optional) a scalar integer variable 9990 ERRMSG (optional) a scalar character variable 9991 9992 _Example_: 9993 program test 9994 integer :: val 9995 val = this_image () 9996 call co_reduce (val, result_image=1, operation=myprod) 9997 if (this_image() == 1) then 9998 write(*,*) "Product value", val ! prints num_images() factorial 9999 end if 10000 contains 10001 pure function myprod(a, b) 10002 integer, value :: a, b 10003 integer :: myprod 10004 myprod = a * b 10005 end function myprod 10006 end program test 10007 10008 _Note_: 10009 While the rules permit in principle an intrinsic function, none of 10010 the intrinsics in the standard fulfill the criteria of having a 10011 specific function, which takes two arguments of the same type and 10012 returning that type as result. 10013 10014 _See also_: 10015 *note CO_MIN::, *note CO_MAX::, *note CO_SUM::, *note 10016 CO_BROADCAST:: 10017 10018 10019 File: gfortran.info, Node: CO_SUM, Next: COMMAND_ARGUMENT_COUNT, Prev: CO_REDUCE, Up: Intrinsic Procedures 10020 10021 8.67 'CO_SUM' -- Sum of values on the current set of images 10022 =========================================================== 10023 10024 _Description_: 10025 'CO_SUM' sums up the values of each element of A on all images of 10026 the current team. If RESULT_IMAGE is present, the summed-up values 10027 are returned in A on the specified image only and the value of A on 10028 the other images become undefined. If RESULT_IMAGE is not present, 10029 the value is returned on all images. If the execution was 10030 successful and STAT is present, it is assigned the value zero. If 10031 the execution failed, STAT gets assigned a nonzero value and, if 10032 present, ERRMSG gets assigned a value describing the occurred 10033 error. 10034 10035 _Standard_: 10036 Technical Specification (TS) 18508 or later 10037 10038 _Class_: 10039 Collective subroutine 10040 10041 _Syntax_: 10042 'CALL CO_SUM(A [, RESULT_IMAGE, STAT, ERRMSG])' 10043 10044 _Arguments_: 10045 A shall be an integer, real or complex 10046 variable, which has the same type and type 10047 parameters on all images of the team. 10048 RESULT_IMAGE (optional) a scalar integer expression; if 10049 present, it shall have the same value on all 10050 images and refer to an image of the current 10051 team. 10052 STAT (optional) a scalar integer variable 10053 ERRMSG (optional) a scalar character variable 10054 10055 _Example_: 10056 program test 10057 integer :: val 10058 val = this_image () 10059 call co_sum (val, result_image=1) 10060 if (this_image() == 1) then 10061 write(*,*) "The sum is ", val ! prints (n**2 + n)/2, 10062 ! with n = num_images() 10063 end if 10064 end program test 10065 10066 _See also_: 10067 *note CO_MAX::, *note CO_MIN::, *note CO_REDUCE::, *note 10068 CO_BROADCAST:: 10069 10070 10071 File: gfortran.info, Node: COMMAND_ARGUMENT_COUNT, Next: COMPILER_OPTIONS, Prev: CO_SUM, Up: Intrinsic Procedures 10072 10073 8.68 'COMMAND_ARGUMENT_COUNT' -- Get number of command line arguments 10074 ===================================================================== 10075 10076 _Description_: 10077 'COMMAND_ARGUMENT_COUNT' returns the number of arguments passed on 10078 the command line when the containing program was invoked. 10079 10080 _Standard_: 10081 Fortran 2003 and later 10082 10083 _Class_: 10084 Inquiry function 10085 10086 _Syntax_: 10087 'RESULT = COMMAND_ARGUMENT_COUNT()' 10088 10089 _Arguments_: 10090 None 10091 10092 _Return value_: 10093 The return value is an 'INTEGER' of default kind. 10094 10095 _Example_: 10096 program test_command_argument_count 10097 integer :: count 10098 count = command_argument_count() 10099 print *, count 10100 end program test_command_argument_count 10101 10102 _See also_: 10103 *note GET_COMMAND::, *note GET_COMMAND_ARGUMENT:: 10104 10105 10106 File: gfortran.info, Node: COMPILER_OPTIONS, Next: COMPILER_VERSION, Prev: COMMAND_ARGUMENT_COUNT, Up: Intrinsic Procedures 10107 10108 8.69 'COMPILER_OPTIONS' -- Options passed to the compiler 10109 ========================================================= 10110 10111 _Description_: 10112 'COMPILER_OPTIONS' returns a string with the options used for 10113 compiling. 10114 10115 _Standard_: 10116 Fortran 2008 10117 10118 _Class_: 10119 Inquiry function of the module 'ISO_FORTRAN_ENV' 10120 10121 _Syntax_: 10122 'STR = COMPILER_OPTIONS()' 10123 10124 _Arguments_: 10125 None 10126 10127 _Return value_: 10128 The return value is a default-kind string with system-dependent 10129 length. It contains the compiler flags used to compile the file, 10130 which called the 'COMPILER_OPTIONS' intrinsic. 10131 10132 _Example_: 10133 use iso_fortran_env 10134 print '(4a)', 'This file was compiled by ', & 10135 compiler_version(), ' using the options ', & 10136 compiler_options() 10137 end 10138 10139 _See also_: 10140 *note COMPILER_VERSION::, *note ISO_FORTRAN_ENV:: 10141 10142 10143 File: gfortran.info, Node: COMPILER_VERSION, Next: COMPLEX, Prev: COMPILER_OPTIONS, Up: Intrinsic Procedures 10144 10145 8.70 'COMPILER_VERSION' -- Compiler version string 10146 ================================================== 10147 10148 _Description_: 10149 'COMPILER_VERSION' returns a string with the name and the version 10150 of the compiler. 10151 10152 _Standard_: 10153 Fortran 2008 10154 10155 _Class_: 10156 Inquiry function of the module 'ISO_FORTRAN_ENV' 10157 10158 _Syntax_: 10159 'STR = COMPILER_VERSION()' 10160 10161 _Arguments_: 10162 None 10163 10164 _Return value_: 10165 The return value is a default-kind string with system-dependent 10166 length. It contains the name of the compiler and its version 10167 number. 10168 10169 _Example_: 10170 use iso_fortran_env 10171 print '(4a)', 'This file was compiled by ', & 10172 compiler_version(), ' using the options ', & 10173 compiler_options() 10174 end 10175 10176 _See also_: 10177 *note COMPILER_OPTIONS::, *note ISO_FORTRAN_ENV:: 10178 10179 10180 File: gfortran.info, Node: COMPLEX, Next: CONJG, Prev: COMPILER_VERSION, Up: Intrinsic Procedures 10181 10182 8.71 'COMPLEX' -- Complex conversion function 10183 ============================================= 10184 10185 _Description_: 10186 'COMPLEX(X, Y)' returns a complex number where X is converted to 10187 the real component and Y is converted to the imaginary component. 10188 10189 _Standard_: 10190 GNU extension 10191 10192 _Class_: 10193 Elemental function 10194 10195 _Syntax_: 10196 'RESULT = COMPLEX(X, Y)' 10197 10198 _Arguments_: 10199 X The type may be 'INTEGER' or 'REAL'. 10200 Y The type may be 'INTEGER' or 'REAL'. 10201 10202 _Return value_: 10203 If X and Y are both of 'INTEGER' type, then the return value is of 10204 default 'COMPLEX' type. 10205 10206 If X and Y are of 'REAL' type, or one is of 'REAL' type and one is 10207 of 'INTEGER' type, then the return value is of 'COMPLEX' type with 10208 a kind equal to that of the 'REAL' argument with the highest 10209 precision. 10210 10211 _Example_: 10212 program test_complex 10213 integer :: i = 42 10214 real :: x = 3.14 10215 print *, complex(i, x) 10216 end program test_complex 10217 10218 _See also_: 10219 *note CMPLX:: 10220 10221 10222 File: gfortran.info, Node: CONJG, Next: COS, Prev: COMPLEX, Up: Intrinsic Procedures 10223 10224 8.72 'CONJG' -- Complex conjugate function 10225 ========================================== 10226 10227 _Description_: 10228 'CONJG(Z)' returns the conjugate of Z. If Z is '(x, y)' then the 10229 result is '(x, -y)' 10230 10231 _Standard_: 10232 Fortran 77 and later, has an overload that is a GNU extension 10233 10234 _Class_: 10235 Elemental function 10236 10237 _Syntax_: 10238 'Z = CONJG(Z)' 10239 10240 _Arguments_: 10241 Z The type shall be 'COMPLEX'. 10242 10243 _Return value_: 10244 The return value is of type 'COMPLEX'. 10245 10246 _Example_: 10247 program test_conjg 10248 complex :: z = (2.0, 3.0) 10249 complex(8) :: dz = (2.71_8, -3.14_8) 10250 z= conjg(z) 10251 print *, z 10252 dz = dconjg(dz) 10253 print *, dz 10254 end program test_conjg 10255 10256 _Specific names_: 10257 Name Argument Return type Standard 10258 ------------------------------------------------------------------------- 10259 'DCONJG(Z)' 'COMPLEX(8) Z' 'COMPLEX(8)' GNU extension 10260 10261 10262 File: gfortran.info, Node: COS, Next: COSD, Prev: CONJG, Up: Intrinsic Procedures 10263 10264 8.73 'COS' -- Cosine function 10265 ============================= 10266 10267 _Description_: 10268 'COS(X)' computes the cosine of X. 10269 10270 _Standard_: 10271 Fortran 77 and later, has overloads that are GNU extensions 10272 10273 _Class_: 10274 Elemental function 10275 10276 _Syntax_: 10277 'RESULT = COS(X)' 10278 10279 _Arguments_: 10280 X The type shall be 'REAL' or 'COMPLEX'. 10281 10282 _Return value_: 10283 The return value is of the same type and kind as X. The real part 10284 of the result is in radians. If X is of the type 'REAL', the 10285 return value lies in the range -1 \leq \cos (x) \leq 1. 10286 10287 _Example_: 10288 program test_cos 10289 real :: x = 0.0 10290 x = cos(x) 10291 end program test_cos 10292 10293 _Specific names_: 10294 Name Argument Return type Standard 10295 ------------------------------------------------------------------------- 10296 'COS(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 10297 'DCOS(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 10298 'CCOS(X)' 'COMPLEX(4) X' 'COMPLEX(4)' Fortran 77 and later 10299 'ZCOS(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 10300 'CDCOS(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 10301 10302 _See also_: 10303 Inverse function: *note ACOS:: Degrees function: *note COSD:: 10304 10305 10306 File: gfortran.info, Node: COSD, Next: COSH, Prev: COS, Up: Intrinsic Procedures 10307 10308 8.74 'COSD' -- Cosine function, degrees 10309 ======================================= 10310 10311 _Description_: 10312 'COSD(X)' computes the cosine of X in degrees. 10313 10314 This function is for compatibility only and should be avoided in 10315 favor of standard constructs wherever possible. 10316 10317 _Standard_: 10318 GNU extension, enabled with '-fdec-math'. 10319 10320 _Class_: 10321 Elemental function 10322 10323 _Syntax_: 10324 'RESULT = COSD(X)' 10325 10326 _Arguments_: 10327 X The type shall be 'REAL' or 'COMPLEX'. 10328 10329 _Return value_: 10330 The return value is of the same type and kind as X. The real part 10331 of the result is in degrees. If X is of the type 'REAL', the 10332 return value lies in the range -1 \leq \cosd (x) \leq 1. 10333 10334 _Example_: 10335 program test_cosd 10336 real :: x = 0.0 10337 x = cosd(x) 10338 end program test_cosd 10339 10340 _Specific names_: 10341 Name Argument Return type Standard 10342 ------------------------------------------------------------------------- 10343 'COSD(X)' 'REAL(4) X' 'REAL(4)' GNU extension 10344 'DCOSD(X)' 'REAL(8) X' 'REAL(8)' GNU extension 10345 'CCOSD(X)' 'COMPLEX(4) X' 'COMPLEX(4)' GNU extension 10346 'ZCOSD(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 10347 'CDCOSD(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 10348 10349 _See also_: 10350 Inverse function: *note ACOSD:: Radians function: *note COS:: 10351 10352 10353 File: gfortran.info, Node: COSH, Next: COTAN, Prev: COSD, Up: Intrinsic Procedures 10354 10355 8.75 'COSH' -- Hyperbolic cosine function 10356 ========================================= 10357 10358 _Description_: 10359 'COSH(X)' computes the hyperbolic cosine of X. 10360 10361 _Standard_: 10362 Fortran 77 and later, for a complex argument Fortran 2008 or later 10363 10364 _Class_: 10365 Elemental function 10366 10367 _Syntax_: 10368 'X = COSH(X)' 10369 10370 _Arguments_: 10371 X The type shall be 'REAL' or 'COMPLEX'. 10372 10373 _Return value_: 10374 The return value has same type and kind as X. If X is complex, the 10375 imaginary part of the result is in radians. If X is 'REAL', the 10376 return value has a lower bound of one, \cosh (x) \geq 1. 10377 10378 _Example_: 10379 program test_cosh 10380 real(8) :: x = 1.0_8 10381 x = cosh(x) 10382 end program test_cosh 10383 10384 _Specific names_: 10385 Name Argument Return type Standard 10386 ------------------------------------------------------------------------- 10387 'COSH(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 10388 'DCOSH(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 10389 10390 _See also_: 10391 Inverse function: *note ACOSH:: 10392 10393 10394 File: gfortran.info, Node: COTAN, Next: COTAND, Prev: COSH, Up: Intrinsic Procedures 10395 10396 8.76 'COTAN' -- Cotangent function 10397 ================================== 10398 10399 _Description_: 10400 'COTAN(X)' computes the cotangent of X. Equivalent to 'COS(x)' 10401 divided by 'SIN(x)', or '1 / TAN(x)'. 10402 10403 This function is for compatibility only and should be avoided in 10404 favor of standard constructs wherever possible. 10405 10406 _Standard_: 10407 GNU extension, enabled with '-fdec-math'. 10408 10409 _Class_: 10410 Elemental function 10411 10412 _Syntax_: 10413 'RESULT = COTAN(X)' 10414 10415 _Arguments_: 10416 X The type shall be 'REAL' or 'COMPLEX'. 10417 10418 _Return value_: 10419 The return value has same type and kind as X, and its value is in 10420 radians. 10421 10422 _Example_: 10423 program test_cotan 10424 real(8) :: x = 0.165_8 10425 x = cotan(x) 10426 end program test_cotan 10427 10428 _Specific names_: 10429 Name Argument Return type Standard 10430 ------------------------------------------------------------------------- 10431 'COTAN(X)' 'REAL(4) X' 'REAL(4)' GNU extension 10432 'DCOTAN(X)' 'REAL(8) X' 'REAL(8)' GNU extension 10433 10434 _See also_: 10435 Converse function: *note TAN:: Degrees function: *note COTAND:: 10436 10437 10438 File: gfortran.info, Node: COTAND, Next: COUNT, Prev: COTAN, Up: Intrinsic Procedures 10439 10440 8.77 'COTAND' -- Cotangent function, degrees 10441 ============================================ 10442 10443 _Description_: 10444 'COTAND(X)' computes the cotangent of X in degrees. Equivalent to 10445 'COSD(x)' divided by 'SIND(x)', or '1 / TAND(x)'. 10446 10447 _Standard_: 10448 GNU extension, enabled with '-fdec-math'. 10449 10450 This function is for compatibility only and should be avoided in 10451 favor of standard constructs wherever possible. 10452 10453 _Class_: 10454 Elemental function 10455 10456 _Syntax_: 10457 'RESULT = COTAND(X)' 10458 10459 _Arguments_: 10460 X The type shall be 'REAL' or 'COMPLEX'. 10461 10462 _Return value_: 10463 The return value has same type and kind as X, and its value is in 10464 degrees. 10465 10466 _Example_: 10467 program test_cotand 10468 real(8) :: x = 0.165_8 10469 x = cotand(x) 10470 end program test_cotand 10471 10472 _Specific names_: 10473 Name Argument Return type Standard 10474 ------------------------------------------------------------------------- 10475 'COTAND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 10476 'DCOTAND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 10477 10478 _See also_: 10479 Converse function: *note TAND:: Radians function: *note COTAN:: 10480 10481 10482 File: gfortran.info, Node: COUNT, Next: CPU_TIME, Prev: COTAND, Up: Intrinsic Procedures 10483 10484 8.78 'COUNT' -- Count function 10485 ============================== 10486 10487 _Description_: 10488 10489 Counts the number of '.TRUE.' elements in a logical MASK, or, if 10490 the DIM argument is supplied, counts the number of elements along 10491 each row of the array in the DIM direction. If the array has zero 10492 size, or all of the elements of MASK are '.FALSE.', then the result 10493 is '0'. 10494 10495 _Standard_: 10496 Fortran 90 and later, with KIND argument Fortran 2003 and later 10497 10498 _Class_: 10499 Transformational function 10500 10501 _Syntax_: 10502 'RESULT = COUNT(MASK [, DIM, KIND])' 10503 10504 _Arguments_: 10505 MASK The type shall be 'LOGICAL'. 10506 DIM (Optional) The type shall be 'INTEGER'. 10507 KIND (Optional) An 'INTEGER' initialization 10508 expression indicating the kind parameter of the 10509 result. 10510 10511 _Return value_: 10512 The return value is of type 'INTEGER' and of kind KIND. If KIND is 10513 absent, the return value is of default integer kind. If DIM is 10514 present, the result is an array with a rank one less than the rank 10515 of ARRAY, and a size corresponding to the shape of ARRAY with the 10516 DIM dimension removed. 10517 10518 _Example_: 10519 program test_count 10520 integer, dimension(2,3) :: a, b 10521 logical, dimension(2,3) :: mask 10522 a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /)) 10523 b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /)) 10524 print '(3i3)', a(1,:) 10525 print '(3i3)', a(2,:) 10526 print * 10527 print '(3i3)', b(1,:) 10528 print '(3i3)', b(2,:) 10529 print * 10530 mask = a.ne.b 10531 print '(3l3)', mask(1,:) 10532 print '(3l3)', mask(2,:) 10533 print * 10534 print '(3i3)', count(mask) 10535 print * 10536 print '(3i3)', count(mask, 1) 10537 print * 10538 print '(3i3)', count(mask, 2) 10539 end program test_count 10540 10541 10542 File: gfortran.info, Node: CPU_TIME, Next: CSHIFT, Prev: COUNT, Up: Intrinsic Procedures 10543 10544 8.79 'CPU_TIME' -- CPU elapsed time in seconds 10545 ============================================== 10546 10547 _Description_: 10548 Returns a 'REAL' value representing the elapsed CPU time in 10549 seconds. This is useful for testing segments of code to determine 10550 execution time. 10551 10552 If a time source is available, time will be reported with 10553 microsecond resolution. If no time source is available, TIME is 10554 set to '-1.0'. 10555 10556 Note that TIME may contain a, system dependent, arbitrary offset 10557 and may not start with '0.0'. For 'CPU_TIME', the absolute value 10558 is meaningless, only differences between subsequent calls to this 10559 subroutine, as shown in the example below, should be used. 10560 10561 _Standard_: 10562 Fortran 95 and later 10563 10564 _Class_: 10565 Subroutine 10566 10567 _Syntax_: 10568 'CALL CPU_TIME(TIME)' 10569 10570 _Arguments_: 10571 TIME The type shall be 'REAL' with 'INTENT(OUT)'. 10572 10573 _Return value_: 10574 None 10575 10576 _Example_: 10577 program test_cpu_time 10578 real :: start, finish 10579 call cpu_time(start) 10580 ! put code to test here 10581 call cpu_time(finish) 10582 print '("Time = ",f6.3," seconds.")',finish-start 10583 end program test_cpu_time 10584 10585 _See also_: 10586 *note SYSTEM_CLOCK::, *note DATE_AND_TIME:: 10587 10588 10589 File: gfortran.info, Node: CSHIFT, Next: CTIME, Prev: CPU_TIME, Up: Intrinsic Procedures 10590 10591 8.80 'CSHIFT' -- Circular shift elements of an array 10592 ==================================================== 10593 10594 _Description_: 10595 'CSHIFT(ARRAY, SHIFT [, DIM])' performs a circular shift on 10596 elements of ARRAY along the dimension of DIM. If DIM is omitted it 10597 is taken to be '1'. DIM is a scalar of type 'INTEGER' in the range 10598 of 1 \leq DIM \leq n) where n is the rank of ARRAY. If the rank of 10599 ARRAY is one, then all elements of ARRAY are shifted by SHIFT 10600 places. If rank is greater than one, then all complete rank one 10601 sections of ARRAY along the given dimension are shifted. Elements 10602 shifted out one end of each rank one section are shifted back in 10603 the other end. 10604 10605 _Standard_: 10606 Fortran 90 and later 10607 10608 _Class_: 10609 Transformational function 10610 10611 _Syntax_: 10612 'RESULT = CSHIFT(ARRAY, SHIFT [, DIM])' 10613 10614 _Arguments_: 10615 ARRAY Shall be an array of any type. 10616 SHIFT The type shall be 'INTEGER'. 10617 DIM The type shall be 'INTEGER'. 10618 10619 _Return value_: 10620 Returns an array of same type and rank as the ARRAY argument. 10621 10622 _Example_: 10623 program test_cshift 10624 integer, dimension(3,3) :: a 10625 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /)) 10626 print '(3i3)', a(1,:) 10627 print '(3i3)', a(2,:) 10628 print '(3i3)', a(3,:) 10629 a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2) 10630 print * 10631 print '(3i3)', a(1,:) 10632 print '(3i3)', a(2,:) 10633 print '(3i3)', a(3,:) 10634 end program test_cshift 10635 10636 10637 File: gfortran.info, Node: CTIME, Next: DATE_AND_TIME, Prev: CSHIFT, Up: Intrinsic Procedures 10638 10639 8.81 'CTIME' -- Convert a time into a string 10640 ============================================ 10641 10642 _Description_: 10643 'CTIME' converts a system time value, such as returned by *note 10644 TIME8::, to a string. The output will be of the form 'Sat Aug 19 10645 18:13:14 1995'. 10646 10647 This intrinsic is provided in both subroutine and function forms; 10648 however, only one form can be used in any given program unit. 10649 10650 _Standard_: 10651 GNU extension 10652 10653 _Class_: 10654 Subroutine, function 10655 10656 _Syntax_: 10657 'CALL CTIME(TIME, RESULT)'. 10658 'RESULT = CTIME(TIME)'. 10659 10660 _Arguments_: 10661 TIME The type shall be of type 'INTEGER'. 10662 RESULT The type shall be of type 'CHARACTER' and of 10663 default kind. It is an 'INTENT(OUT)' argument. 10664 If the length of this variable is too short for 10665 the time and date string to fit completely, it 10666 will be blank on procedure return. 10667 10668 _Return value_: 10669 The converted date and time as a string. 10670 10671 _Example_: 10672 program test_ctime 10673 integer(8) :: i 10674 character(len=30) :: date 10675 i = time8() 10676 10677 ! Do something, main part of the program 10678 10679 call ctime(i,date) 10680 print *, 'Program was started on ', date 10681 end program test_ctime 10682 10683 _See Also_: 10684 *note DATE_AND_TIME::, *note GMTIME::, *note LTIME::, *note TIME::, 10685 *note TIME8:: 10686 10687 10688 File: gfortran.info, Node: DATE_AND_TIME, Next: DBLE, Prev: CTIME, Up: Intrinsic Procedures 10689 10690 8.82 'DATE_AND_TIME' -- Date and time subroutine 10691 ================================================ 10692 10693 _Description_: 10694 'DATE_AND_TIME(DATE, TIME, ZONE, VALUES)' gets the corresponding 10695 date and time information from the real-time system clock. DATE is 10696 'INTENT(OUT)' and has form ccyymmdd. TIME is 'INTENT(OUT)' and has 10697 form hhmmss.sss. ZONE is 'INTENT(OUT)' and has form (+-)hhmm, 10698 representing the difference with respect to Coordinated Universal 10699 Time (UTC). Unavailable time and date parameters return blanks. 10700 10701 VALUES is 'INTENT(OUT)' and provides the following: 10702 10703 'VALUE(1)': The year 10704 'VALUE(2)': The month 10705 'VALUE(3)': The day of the month 10706 'VALUE(4)': Time difference with UTC in minutes 10707 'VALUE(5)': The hour of the day 10708 'VALUE(6)': The minutes of the hour 10709 'VALUE(7)': The seconds of the minute 10710 'VALUE(8)': The milliseconds of the second 10711 10712 _Standard_: 10713 Fortran 90 and later 10714 10715 _Class_: 10716 Subroutine 10717 10718 _Syntax_: 10719 'CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])' 10720 10721 _Arguments_: 10722 DATE (Optional) The type shall be 'CHARACTER(LEN=8)' 10723 or larger, and of default kind. 10724 TIME (Optional) The type shall be 'CHARACTER(LEN=10)' 10725 or larger, and of default kind. 10726 ZONE (Optional) The type shall be 'CHARACTER(LEN=5)' 10727 or larger, and of default kind. 10728 VALUES (Optional) The type shall be 'INTEGER(8)'. 10729 10730 _Return value_: 10731 None 10732 10733 _Example_: 10734 program test_time_and_date 10735 character(8) :: date 10736 character(10) :: time 10737 character(5) :: zone 10738 integer,dimension(8) :: values 10739 ! using keyword arguments 10740 call date_and_time(date,time,zone,values) 10741 call date_and_time(DATE=date,ZONE=zone) 10742 call date_and_time(TIME=time) 10743 call date_and_time(VALUES=values) 10744 print '(a,2x,a,2x,a)', date, time, zone 10745 print '(8i5)', values 10746 end program test_time_and_date 10747 10748 _See also_: 10749 *note CPU_TIME::, *note SYSTEM_CLOCK:: 10750 10751 10752 File: gfortran.info, Node: DBLE, Next: DCMPLX, Prev: DATE_AND_TIME, Up: Intrinsic Procedures 10753 10754 8.83 'DBLE' -- Double conversion function 10755 ========================================= 10756 10757 _Description_: 10758 'DBLE(A)' Converts A to double precision real type. 10759 10760 _Standard_: 10761 Fortran 77 and later 10762 10763 _Class_: 10764 Elemental function 10765 10766 _Syntax_: 10767 'RESULT = DBLE(A)' 10768 10769 _Arguments_: 10770 A The type shall be 'INTEGER', 'REAL', or 10771 'COMPLEX'. 10772 10773 _Return value_: 10774 The return value is of type double precision real. 10775 10776 _Example_: 10777 program test_dble 10778 real :: x = 2.18 10779 integer :: i = 5 10780 complex :: z = (2.3,1.14) 10781 print *, dble(x), dble(i), dble(z) 10782 end program test_dble 10783 10784 _See also_: 10785 *note REAL:: 10786 10787 10788 File: gfortran.info, Node: DCMPLX, Next: DIGITS, Prev: DBLE, Up: Intrinsic Procedures 10789 10790 8.84 'DCMPLX' -- Double complex conversion function 10791 =================================================== 10792 10793 _Description_: 10794 'DCMPLX(X [,Y])' returns a double complex number where X is 10795 converted to the real component. If Y is present it is converted 10796 to the imaginary component. If Y is not present then the imaginary 10797 component is set to 0.0. If X is complex then Y must not be 10798 present. 10799 10800 _Standard_: 10801 GNU extension 10802 10803 _Class_: 10804 Elemental function 10805 10806 _Syntax_: 10807 'RESULT = DCMPLX(X [, Y])' 10808 10809 _Arguments_: 10810 X The type may be 'INTEGER', 'REAL', or 'COMPLEX'. 10811 Y (Optional if X is not 'COMPLEX'.) May be 10812 'INTEGER' or 'REAL'. 10813 10814 _Return value_: 10815 The return value is of type 'COMPLEX(8)' 10816 10817 _Example_: 10818 program test_dcmplx 10819 integer :: i = 42 10820 real :: x = 3.14 10821 complex :: z 10822 z = cmplx(i, x) 10823 print *, dcmplx(i) 10824 print *, dcmplx(x) 10825 print *, dcmplx(z) 10826 print *, dcmplx(x,i) 10827 end program test_dcmplx 10828 10829 10830 File: gfortran.info, Node: DIGITS, Next: DIM, Prev: DCMPLX, Up: Intrinsic Procedures 10831 10832 8.85 'DIGITS' -- Significant binary digits function 10833 =================================================== 10834 10835 _Description_: 10836 'DIGITS(X)' returns the number of significant binary digits of the 10837 internal model representation of X. For example, on a system using 10838 a 32-bit floating point representation, a default real number would 10839 likely return 24. 10840 10841 _Standard_: 10842 Fortran 90 and later 10843 10844 _Class_: 10845 Inquiry function 10846 10847 _Syntax_: 10848 'RESULT = DIGITS(X)' 10849 10850 _Arguments_: 10851 X The type may be 'INTEGER' or 'REAL'. 10852 10853 _Return value_: 10854 The return value is of type 'INTEGER'. 10855 10856 _Example_: 10857 program test_digits 10858 integer :: i = 12345 10859 real :: x = 3.143 10860 real(8) :: y = 2.33 10861 print *, digits(i) 10862 print *, digits(x) 10863 print *, digits(y) 10864 end program test_digits 10865 10866 10867 File: gfortran.info, Node: DIM, Next: DOT_PRODUCT, Prev: DIGITS, Up: Intrinsic Procedures 10868 10869 8.86 'DIM' -- Positive difference 10870 ================================= 10871 10872 _Description_: 10873 'DIM(X,Y)' returns the difference 'X-Y' if the result is positive; 10874 otherwise returns zero. 10875 10876 _Standard_: 10877 Fortran 77 and later 10878 10879 _Class_: 10880 Elemental function 10881 10882 _Syntax_: 10883 'RESULT = DIM(X, Y)' 10884 10885 _Arguments_: 10886 X The type shall be 'INTEGER' or 'REAL' 10887 Y The type shall be the same type and kind as X. 10888 (As a GNU extension, arguments of different 10889 kinds are permitted.) 10890 10891 _Return value_: 10892 The return value is of type 'INTEGER' or 'REAL'. (As a GNU 10893 extension, kind is the largest kind of the actual arguments.) 10894 10895 _Example_: 10896 program test_dim 10897 integer :: i 10898 real(8) :: x 10899 i = dim(4, 15) 10900 x = dim(4.345_8, 2.111_8) 10901 print *, i 10902 print *, x 10903 end program test_dim 10904 10905 _Specific names_: 10906 Name Argument Return type Standard 10907 ------------------------------------------------------------------------- 10908 'DIM(X,Y)' 'REAL(4) X, Y' 'REAL(4)' Fortran 77 and later 10909 'IDIM(X,Y)' 'INTEGER(4) X, Y' 'INTEGER(4)' Fortran 77 and later 10910 'DDIM(X,Y)' 'REAL(8) X, Y' 'REAL(8)' Fortran 77 and later 10911 10912 10913 File: gfortran.info, Node: DOT_PRODUCT, Next: DPROD, Prev: DIM, Up: Intrinsic Procedures 10914 10915 8.87 'DOT_PRODUCT' -- Dot product function 10916 ========================================== 10917 10918 _Description_: 10919 'DOT_PRODUCT(VECTOR_A, VECTOR_B)' computes the dot product 10920 multiplication of two vectors VECTOR_A and VECTOR_B. The two 10921 vectors may be either numeric or logical and must be arrays of rank 10922 one and of equal size. If the vectors are 'INTEGER' or 'REAL', the 10923 result is 'SUM(VECTOR_A*VECTOR_B)'. If the vectors are 'COMPLEX', 10924 the result is 'SUM(CONJG(VECTOR_A)*VECTOR_B)'. If the vectors are 10925 'LOGICAL', the result is 'ANY(VECTOR_A .AND. VECTOR_B)'. 10926 10927 _Standard_: 10928 Fortran 90 and later 10929 10930 _Class_: 10931 Transformational function 10932 10933 _Syntax_: 10934 'RESULT = DOT_PRODUCT(VECTOR_A, VECTOR_B)' 10935 10936 _Arguments_: 10937 VECTOR_A The type shall be numeric or 'LOGICAL', rank 1. 10938 VECTOR_B The type shall be numeric if VECTOR_A is of 10939 numeric type or 'LOGICAL' if VECTOR_A is of type 10940 'LOGICAL'. VECTOR_B shall be a rank-one array. 10941 10942 _Return value_: 10943 If the arguments are numeric, the return value is a scalar of 10944 numeric type, 'INTEGER', 'REAL', or 'COMPLEX'. If the arguments 10945 are 'LOGICAL', the return value is '.TRUE.' or '.FALSE.'. 10946 10947 _Example_: 10948 program test_dot_prod 10949 integer, dimension(3) :: a, b 10950 a = (/ 1, 2, 3 /) 10951 b = (/ 4, 5, 6 /) 10952 print '(3i3)', a 10953 print * 10954 print '(3i3)', b 10955 print * 10956 print *, dot_product(a,b) 10957 end program test_dot_prod 10958 10959 10960 File: gfortran.info, Node: DPROD, Next: DREAL, Prev: DOT_PRODUCT, Up: Intrinsic Procedures 10961 10962 8.88 'DPROD' -- Double product function 10963 ======================================= 10964 10965 _Description_: 10966 'DPROD(X,Y)' returns the product 'X*Y'. 10967 10968 _Standard_: 10969 Fortran 77 and later 10970 10971 _Class_: 10972 Elemental function 10973 10974 _Syntax_: 10975 'RESULT = DPROD(X, Y)' 10976 10977 _Arguments_: 10978 X The type shall be 'REAL'. 10979 Y The type shall be 'REAL'. 10980 10981 _Return value_: 10982 The return value is of type 'REAL(8)'. 10983 10984 _Example_: 10985 program test_dprod 10986 real :: x = 5.2 10987 real :: y = 2.3 10988 real(8) :: d 10989 d = dprod(x,y) 10990 print *, d 10991 end program test_dprod 10992 10993 _Specific names_: 10994 Name Argument Return type Standard 10995 ------------------------------------------------------------------------- 10996 'DPROD(X,Y)' 'REAL(4) X, Y' 'REAL(8)' Fortran 77 and later 10997 10998 10999 File: gfortran.info, Node: DREAL, Next: DSHIFTL, Prev: DPROD, Up: Intrinsic Procedures 11000 11001 8.89 'DREAL' -- Double real part function 11002 ========================================= 11003 11004 _Description_: 11005 'DREAL(Z)' returns the real part of complex variable Z. 11006 11007 _Standard_: 11008 GNU extension 11009 11010 _Class_: 11011 Elemental function 11012 11013 _Syntax_: 11014 'RESULT = DREAL(A)' 11015 11016 _Arguments_: 11017 A The type shall be 'COMPLEX(8)'. 11018 11019 _Return value_: 11020 The return value is of type 'REAL(8)'. 11021 11022 _Example_: 11023 program test_dreal 11024 complex(8) :: z = (1.3_8,7.2_8) 11025 print *, dreal(z) 11026 end program test_dreal 11027 11028 _See also_: 11029 *note AIMAG:: 11030 11031 11032 File: gfortran.info, Node: DSHIFTL, Next: DSHIFTR, Prev: DREAL, Up: Intrinsic Procedures 11033 11034 8.90 'DSHIFTL' -- Combined left shift 11035 ===================================== 11036 11037 _Description_: 11038 'DSHIFTL(I, J, SHIFT)' combines bits of I and J. The rightmost 11039 SHIFT bits of the result are the leftmost SHIFT bits of J, and the 11040 remaining bits are the rightmost bits of I. 11041 11042 _Standard_: 11043 Fortran 2008 and later 11044 11045 _Class_: 11046 Elemental function 11047 11048 _Syntax_: 11049 'RESULT = DSHIFTL(I, J, SHIFT)' 11050 11051 _Arguments_: 11052 I Shall be of type 'INTEGER' or a BOZ constant. 11053 J Shall be of type 'INTEGER' or a BOZ constant. 11054 If both I and J have integer type, then they 11055 shall have the same kind type parameter. I and 11056 J shall not both be BOZ constants. 11057 SHIFT Shall be of type 'INTEGER'. It shall be 11058 nonnegative. If I is not a BOZ constant, then 11059 SHIFT shall be less than or equal to 11060 'BIT_SIZE(I)'; otherwise, SHIFT shall be less 11061 than or equal to 'BIT_SIZE(J)'. 11062 11063 _Return value_: 11064 If either I or J is a BOZ constant, it is first converted as if by 11065 the intrinsic function 'INT' to an integer type with the kind type 11066 parameter of the other. 11067 11068 _See also_: 11069 *note DSHIFTR:: 11070 11071 11072 File: gfortran.info, Node: DSHIFTR, Next: DTIME, Prev: DSHIFTL, Up: Intrinsic Procedures 11073 11074 8.91 'DSHIFTR' -- Combined right shift 11075 ====================================== 11076 11077 _Description_: 11078 'DSHIFTR(I, J, SHIFT)' combines bits of I and J. The leftmost 11079 SHIFT bits of the result are the rightmost SHIFT bits of I, and the 11080 remaining bits are the leftmost bits of J. 11081 11082 _Standard_: 11083 Fortran 2008 and later 11084 11085 _Class_: 11086 Elemental function 11087 11088 _Syntax_: 11089 'RESULT = DSHIFTR(I, J, SHIFT)' 11090 11091 _Arguments_: 11092 I Shall be of type 'INTEGER' or a BOZ constant. 11093 J Shall be of type 'INTEGER' or a BOZ constant. 11094 If both I and J have integer type, then they 11095 shall have the same kind type parameter. I and 11096 J shall not both be BOZ constants. 11097 SHIFT Shall be of type 'INTEGER'. It shall be 11098 nonnegative. If I is not a BOZ constant, then 11099 SHIFT shall be less than or equal to 11100 'BIT_SIZE(I)'; otherwise, SHIFT shall be less 11101 than or equal to 'BIT_SIZE(J)'. 11102 11103 _Return value_: 11104 If either I or J is a BOZ constant, it is first converted as if by 11105 the intrinsic function 'INT' to an integer type with the kind type 11106 parameter of the other. 11107 11108 _See also_: 11109 *note DSHIFTL:: 11110 11111 11112 File: gfortran.info, Node: DTIME, Next: EOSHIFT, Prev: DSHIFTR, Up: Intrinsic Procedures 11113 11114 8.92 'DTIME' -- Execution time subroutine (or function) 11115 ======================================================= 11116 11117 _Description_: 11118 'DTIME(VALUES, TIME)' initially returns the number of seconds of 11119 runtime since the start of the process's execution in TIME. VALUES 11120 returns the user and system components of this time in 'VALUES(1)' 11121 and 'VALUES(2)' respectively. TIME is equal to 'VALUES(1) + 11122 VALUES(2)'. 11123 11124 Subsequent invocations of 'DTIME' return values accumulated since 11125 the previous invocation. 11126 11127 On some systems, the underlying timings are represented using types 11128 with sufficiently small limits that overflows (wrap around) are 11129 possible, such as 32-bit types. Therefore, the values returned by 11130 this intrinsic might be, or become, negative, or numerically less 11131 than previous values, during a single run of the compiled program. 11132 11133 Please note, that this implementation is thread safe if used within 11134 OpenMP directives, i.e., its state will be consistent while called 11135 from multiple threads. However, if 'DTIME' is called from multiple 11136 threads, the result is still the time since the last invocation. 11137 This may not give the intended results. If possible, use 11138 'CPU_TIME' instead. 11139 11140 This intrinsic is provided in both subroutine and function forms; 11141 however, only one form can be used in any given program unit. 11142 11143 VALUES and TIME are 'INTENT(OUT)' and provide the following: 11144 11145 'VALUES(1)':User time in seconds. 11146 'VALUES(2)':System time in seconds. 11147 'TIME': Run time since start in seconds. 11148 11149 _Standard_: 11150 GNU extension 11151 11152 _Class_: 11153 Subroutine, function 11154 11155 _Syntax_: 11156 'CALL DTIME(VALUES, TIME)'. 11157 'TIME = DTIME(VALUES)', (not recommended). 11158 11159 _Arguments_: 11160 VALUES The type shall be 'REAL(4), DIMENSION(2)'. 11161 TIME The type shall be 'REAL(4)'. 11162 11163 _Return value_: 11164 Elapsed time in seconds since the last invocation or since the 11165 start of program execution if not called before. 11166 11167 _Example_: 11168 program test_dtime 11169 integer(8) :: i, j 11170 real, dimension(2) :: tarray 11171 real :: result 11172 call dtime(tarray, result) 11173 print *, result 11174 print *, tarray(1) 11175 print *, tarray(2) 11176 do i=1,100000000 ! Just a delay 11177 j = i * i - i 11178 end do 11179 call dtime(tarray, result) 11180 print *, result 11181 print *, tarray(1) 11182 print *, tarray(2) 11183 end program test_dtime 11184 11185 _See also_: 11186 *note CPU_TIME:: 11187 11188 11189 File: gfortran.info, Node: EOSHIFT, Next: EPSILON, Prev: DTIME, Up: Intrinsic Procedures 11190 11191 8.93 'EOSHIFT' -- End-off shift elements of an array 11192 ==================================================== 11193 11194 _Description_: 11195 'EOSHIFT(ARRAY, SHIFT[, BOUNDARY, DIM])' performs an end-off shift 11196 on elements of ARRAY along the dimension of DIM. If DIM is omitted 11197 it is taken to be '1'. DIM is a scalar of type 'INTEGER' in the 11198 range of 1 \leq DIM \leq n) where n is the rank of ARRAY. If the 11199 rank of ARRAY is one, then all elements of ARRAY are shifted by 11200 SHIFT places. If rank is greater than one, then all complete rank 11201 one sections of ARRAY along the given dimension are shifted. 11202 Elements shifted out one end of each rank one section are dropped. 11203 If BOUNDARY is present then the corresponding value of from 11204 BOUNDARY is copied back in the other end. If BOUNDARY is not 11205 present then the following are copied in depending on the type of 11206 ARRAY. 11207 11208 _Array _Boundary Value_ 11209 Type_ 11210 Numeric 0 of the type and kind of ARRAY. 11211 Logical '.FALSE.'. 11212 Character(LEN)LEN blanks. 11213 11214 _Standard_: 11215 Fortran 90 and later 11216 11217 _Class_: 11218 Transformational function 11219 11220 _Syntax_: 11221 'RESULT = EOSHIFT(ARRAY, SHIFT [, BOUNDARY, DIM])' 11222 11223 _Arguments_: 11224 ARRAY May be any type, not scalar. 11225 SHIFT The type shall be 'INTEGER'. 11226 BOUNDARY Same type as ARRAY. 11227 DIM The type shall be 'INTEGER'. 11228 11229 _Return value_: 11230 Returns an array of same type and rank as the ARRAY argument. 11231 11232 _Example_: 11233 program test_eoshift 11234 integer, dimension(3,3) :: a 11235 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /)) 11236 print '(3i3)', a(1,:) 11237 print '(3i3)', a(2,:) 11238 print '(3i3)', a(3,:) 11239 a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2) 11240 print * 11241 print '(3i3)', a(1,:) 11242 print '(3i3)', a(2,:) 11243 print '(3i3)', a(3,:) 11244 end program test_eoshift 11245 11246 11247 File: gfortran.info, Node: EPSILON, Next: ERF, Prev: EOSHIFT, Up: Intrinsic Procedures 11248 11249 8.94 'EPSILON' -- Epsilon function 11250 ================================== 11251 11252 _Description_: 11253 'EPSILON(X)' returns the smallest number E of the same kind as X 11254 such that 1 + E > 1. 11255 11256 _Standard_: 11257 Fortran 90 and later 11258 11259 _Class_: 11260 Inquiry function 11261 11262 _Syntax_: 11263 'RESULT = EPSILON(X)' 11264 11265 _Arguments_: 11266 X The type shall be 'REAL'. 11267 11268 _Return value_: 11269 The return value is of same type as the argument. 11270 11271 _Example_: 11272 program test_epsilon 11273 real :: x = 3.143 11274 real(8) :: y = 2.33 11275 print *, EPSILON(x) 11276 print *, EPSILON(y) 11277 end program test_epsilon 11278 11279 11280 File: gfortran.info, Node: ERF, Next: ERFC, Prev: EPSILON, Up: Intrinsic Procedures 11281 11282 8.95 'ERF' -- Error function 11283 ============================ 11284 11285 _Description_: 11286 'ERF(X)' computes the error function of X. 11287 11288 _Standard_: 11289 Fortran 2008 and later 11290 11291 _Class_: 11292 Elemental function 11293 11294 _Syntax_: 11295 'RESULT = ERF(X)' 11296 11297 _Arguments_: 11298 X The type shall be 'REAL'. 11299 11300 _Return value_: 11301 The return value is of type 'REAL', of the same kind as X and lies 11302 in the range -1 \leq erf (x) \leq 1 . 11303 11304 _Example_: 11305 program test_erf 11306 real(8) :: x = 0.17_8 11307 x = erf(x) 11308 end program test_erf 11309 11310 _Specific names_: 11311 Name Argument Return type Standard 11312 ------------------------------------------------------------------------- 11313 'DERF(X)' 'REAL(8) X' 'REAL(8)' GNU extension 11314 11315 11316 File: gfortran.info, Node: ERFC, Next: ERFC_SCALED, Prev: ERF, Up: Intrinsic Procedures 11317 11318 8.96 'ERFC' -- Error function 11319 ============================= 11320 11321 _Description_: 11322 'ERFC(X)' computes the complementary error function of X. 11323 11324 _Standard_: 11325 Fortran 2008 and later 11326 11327 _Class_: 11328 Elemental function 11329 11330 _Syntax_: 11331 'RESULT = ERFC(X)' 11332 11333 _Arguments_: 11334 X The type shall be 'REAL'. 11335 11336 _Return value_: 11337 The return value is of type 'REAL' and of the same kind as X. It 11338 lies in the range 0 \leq erfc (x) \leq 2 . 11339 11340 _Example_: 11341 program test_erfc 11342 real(8) :: x = 0.17_8 11343 x = erfc(x) 11344 end program test_erfc 11345 11346 _Specific names_: 11347 Name Argument Return type Standard 11348 ------------------------------------------------------------------------- 11349 'DERFC(X)' 'REAL(8) X' 'REAL(8)' GNU extension 11350 11351 11352 File: gfortran.info, Node: ERFC_SCALED, Next: ETIME, Prev: ERFC, Up: Intrinsic Procedures 11353 11354 8.97 'ERFC_SCALED' -- Error function 11355 ==================================== 11356 11357 _Description_: 11358 'ERFC_SCALED(X)' computes the exponentially-scaled complementary 11359 error function of X. 11360 11361 _Standard_: 11362 Fortran 2008 and later 11363 11364 _Class_: 11365 Elemental function 11366 11367 _Syntax_: 11368 'RESULT = ERFC_SCALED(X)' 11369 11370 _Arguments_: 11371 X The type shall be 'REAL'. 11372 11373 _Return value_: 11374 The return value is of type 'REAL' and of the same kind as X. 11375 11376 _Example_: 11377 program test_erfc_scaled 11378 real(8) :: x = 0.17_8 11379 x = erfc_scaled(x) 11380 end program test_erfc_scaled 11381 11382 11383 File: gfortran.info, Node: ETIME, Next: EVENT_QUERY, Prev: ERFC_SCALED, Up: Intrinsic Procedures 11384 11385 8.98 'ETIME' -- Execution time subroutine (or function) 11386 ======================================================= 11387 11388 _Description_: 11389 'ETIME(VALUES, TIME)' returns the number of seconds of runtime 11390 since the start of the process's execution in TIME. VALUES returns 11391 the user and system components of this time in 'VALUES(1)' and 11392 'VALUES(2)' respectively. TIME is equal to 'VALUES(1) + 11393 VALUES(2)'. 11394 11395 On some systems, the underlying timings are represented using types 11396 with sufficiently small limits that overflows (wrap around) are 11397 possible, such as 32-bit types. Therefore, the values returned by 11398 this intrinsic might be, or become, negative, or numerically less 11399 than previous values, during a single run of the compiled program. 11400 11401 This intrinsic is provided in both subroutine and function forms; 11402 however, only one form can be used in any given program unit. 11403 11404 VALUES and TIME are 'INTENT(OUT)' and provide the following: 11405 11406 'VALUES(1)':User time in seconds. 11407 'VALUES(2)':System time in seconds. 11408 'TIME': Run time since start in seconds. 11409 11410 _Standard_: 11411 GNU extension 11412 11413 _Class_: 11414 Subroutine, function 11415 11416 _Syntax_: 11417 'CALL ETIME(VALUES, TIME)'. 11418 'TIME = ETIME(VALUES)', (not recommended). 11419 11420 _Arguments_: 11421 VALUES The type shall be 'REAL(4), DIMENSION(2)'. 11422 TIME The type shall be 'REAL(4)'. 11423 11424 _Return value_: 11425 Elapsed time in seconds since the start of program execution. 11426 11427 _Example_: 11428 program test_etime 11429 integer(8) :: i, j 11430 real, dimension(2) :: tarray 11431 real :: result 11432 call ETIME(tarray, result) 11433 print *, result 11434 print *, tarray(1) 11435 print *, tarray(2) 11436 do i=1,100000000 ! Just a delay 11437 j = i * i - i 11438 end do 11439 call ETIME(tarray, result) 11440 print *, result 11441 print *, tarray(1) 11442 print *, tarray(2) 11443 end program test_etime 11444 11445 _See also_: 11446 *note CPU_TIME:: 11447 11448 11449 File: gfortran.info, Node: EVENT_QUERY, Next: EXECUTE_COMMAND_LINE, Prev: ETIME, Up: Intrinsic Procedures 11450 11451 8.99 'EVENT_QUERY' -- Query whether a coarray event has occurred 11452 ================================================================ 11453 11454 _Description_: 11455 'EVENT_QUERY' assignes the number of events to COUNT which have 11456 been posted to the EVENT variable and not yet been removed by 11457 calling 'EVENT WAIT'. When STAT is present and the invocation was 11458 successful, it is assigned the value 0. If it is present and the 11459 invocation has failed, it is assigned a positive value and COUNT is 11460 assigned the value -1. 11461 11462 _Standard_: 11463 TS 18508 or later 11464 11465 _Class_: 11466 subroutine 11467 11468 _Syntax_: 11469 'CALL EVENT_QUERY (EVENT, COUNT [, STAT])' 11470 11471 _Arguments_: 11472 EVENT (intent(IN)) Scalar of type 'EVENT_TYPE', 11473 defined in 'ISO_FORTRAN_ENV'; shall not be 11474 coindexed. 11475 COUNT (intent(out))Scalar integer with at least the 11476 precision of default integer. 11477 STAT (optional) Scalar default-kind integer variable. 11478 11479 _Example_: 11480 program atomic 11481 use iso_fortran_env 11482 implicit none 11483 type(event_type) :: event_value_has_been_set[*] 11484 integer :: cnt 11485 if (this_image() == 1) then 11486 call event_query (event_value_has_been_set, cnt) 11487 if (cnt > 0) write(*,*) "Value has been set" 11488 elseif (this_image() == 2) then 11489 event post (event_value_has_been_set[1]) 11490 end if 11491 end program atomic 11492 11493 11494 File: gfortran.info, Node: EXECUTE_COMMAND_LINE, Next: EXIT, Prev: EVENT_QUERY, Up: Intrinsic Procedures 11495 11496 8.100 'EXECUTE_COMMAND_LINE' -- Execute a shell command 11497 ======================================================= 11498 11499 _Description_: 11500 'EXECUTE_COMMAND_LINE' runs a shell command, synchronously or 11501 asynchronously. 11502 11503 The 'COMMAND' argument is passed to the shell and executed (The 11504 shell is 'sh' on Unix systems, and 'cmd.exe' on Windows.). If 11505 'WAIT' is present and has the value false, the execution of the 11506 command is asynchronous if the system supports it; otherwise, the 11507 command is executed synchronously using the C library's 'system' 11508 call. 11509 11510 The three last arguments allow the user to get status information. 11511 After synchronous execution, 'EXITSTAT' contains the integer exit 11512 code of the command, as returned by 'system'. 'CMDSTAT' is set to 11513 zero if the command line was executed (whatever its exit status 11514 was). 'CMDMSG' is assigned an error message if an error has 11515 occurred. 11516 11517 Note that the 'system' function need not be thread-safe. It is the 11518 responsibility of the user to ensure that 'system' is not called 11519 concurrently. 11520 11521 For asynchronous execution on supported targets, the POSIX 11522 'posix_spawn' or 'fork' functions are used. Also, a signal handler 11523 for the 'SIGCHLD' signal is installed. 11524 11525 _Standard_: 11526 Fortran 2008 and later 11527 11528 _Class_: 11529 Subroutine 11530 11531 _Syntax_: 11532 'CALL EXECUTE_COMMAND_LINE(COMMAND [, WAIT, EXITSTAT, CMDSTAT, 11533 CMDMSG ])' 11534 11535 _Arguments_: 11536 COMMAND Shall be a default 'CHARACTER' scalar. 11537 WAIT (Optional) Shall be a default 'LOGICAL' scalar. 11538 EXITSTAT (Optional) Shall be an 'INTEGER' of the default 11539 kind. 11540 CMDSTAT (Optional) Shall be an 'INTEGER' of the default 11541 kind. 11542 CMDMSG (Optional) Shall be an 'CHARACTER' scalar of the 11543 default kind. 11544 11545 _Example_: 11546 program test_exec 11547 integer :: i 11548 11549 call execute_command_line ("external_prog.exe", exitstat=i) 11550 print *, "Exit status of external_prog.exe was ", i 11551 11552 call execute_command_line ("reindex_files.exe", wait=.false.) 11553 print *, "Now reindexing files in the background" 11554 11555 end program test_exec 11556 11557 _Note_: 11558 11559 Because this intrinsic is implemented in terms of the 'system' 11560 function call, its behavior with respect to signaling is processor 11561 dependent. In particular, on POSIX-compliant systems, the SIGINT 11562 and SIGQUIT signals will be ignored, and the SIGCHLD will be 11563 blocked. As such, if the parent process is terminated, the child 11564 process might not be terminated alongside. 11565 11566 _See also_: 11567 *note SYSTEM:: 11568 11569 11570 File: gfortran.info, Node: EXIT, Next: EXP, Prev: EXECUTE_COMMAND_LINE, Up: Intrinsic Procedures 11571 11572 8.101 'EXIT' -- Exit the program with status. 11573 ============================================= 11574 11575 _Description_: 11576 'EXIT' causes immediate termination of the program with status. If 11577 status is omitted it returns the canonical _success_ for the 11578 system. All Fortran I/O units are closed. 11579 11580 _Standard_: 11581 GNU extension 11582 11583 _Class_: 11584 Subroutine 11585 11586 _Syntax_: 11587 'CALL EXIT([STATUS])' 11588 11589 _Arguments_: 11590 STATUS Shall be an 'INTEGER' of the default kind. 11591 11592 _Return value_: 11593 'STATUS' is passed to the parent process on exit. 11594 11595 _Example_: 11596 program test_exit 11597 integer :: STATUS = 0 11598 print *, 'This program is going to exit.' 11599 call EXIT(STATUS) 11600 end program test_exit 11601 11602 _See also_: 11603 *note ABORT::, *note KILL:: 11604 11605 11606 File: gfortran.info, Node: EXP, Next: EXPONENT, Prev: EXIT, Up: Intrinsic Procedures 11607 11608 8.102 'EXP' -- Exponential function 11609 =================================== 11610 11611 _Description_: 11612 'EXP(X)' computes the base e exponential of X. 11613 11614 _Standard_: 11615 Fortran 77 and later, has overloads that are GNU extensions 11616 11617 _Class_: 11618 Elemental function 11619 11620 _Syntax_: 11621 'RESULT = EXP(X)' 11622 11623 _Arguments_: 11624 X The type shall be 'REAL' or 'COMPLEX'. 11625 11626 _Return value_: 11627 The return value has same type and kind as X. 11628 11629 _Example_: 11630 program test_exp 11631 real :: x = 1.0 11632 x = exp(x) 11633 end program test_exp 11634 11635 _Specific names_: 11636 Name Argument Return type Standard 11637 ------------------------------------------------------------------------- 11638 'EXP(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 11639 'DEXP(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 11640 'CEXP(X)' 'COMPLEX(4) X' 'COMPLEX(4)' Fortran 77 and later 11641 'ZEXP(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 11642 'CDEXP(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 11643 11644 11645 File: gfortran.info, Node: EXPONENT, Next: EXTENDS_TYPE_OF, Prev: EXP, Up: Intrinsic Procedures 11646 11647 8.103 'EXPONENT' -- Exponent function 11648 ===================================== 11649 11650 _Description_: 11651 'EXPONENT(X)' returns the value of the exponent part of X. If X is 11652 zero the value returned is zero. 11653 11654 _Standard_: 11655 Fortran 90 and later 11656 11657 _Class_: 11658 Elemental function 11659 11660 _Syntax_: 11661 'RESULT = EXPONENT(X)' 11662 11663 _Arguments_: 11664 X The type shall be 'REAL'. 11665 11666 _Return value_: 11667 The return value is of type default 'INTEGER'. 11668 11669 _Example_: 11670 program test_exponent 11671 real :: x = 1.0 11672 integer :: i 11673 i = exponent(x) 11674 print *, i 11675 print *, exponent(0.0) 11676 end program test_exponent 11677 11678 11679 File: gfortran.info, Node: EXTENDS_TYPE_OF, Next: FDATE, Prev: EXPONENT, Up: Intrinsic Procedures 11680 11681 8.104 'EXTENDS_TYPE_OF' -- Query dynamic type for extension 11682 =========================================================== 11683 11684 _Description_: 11685 Query dynamic type for extension. 11686 11687 _Standard_: 11688 Fortran 2003 and later 11689 11690 _Class_: 11691 Inquiry function 11692 11693 _Syntax_: 11694 'RESULT = EXTENDS_TYPE_OF(A, MOLD)' 11695 11696 _Arguments_: 11697 A Shall be an object of extensible declared type 11698 or unlimited polymorphic. 11699 MOLD Shall be an object of extensible declared type 11700 or unlimited polymorphic. 11701 11702 _Return value_: 11703 The return value is a scalar of type default logical. It is true 11704 if and only if the dynamic type of A is an extension type of the 11705 dynamic type of MOLD. 11706 11707 _See also_: 11708 *note SAME_TYPE_AS:: 11709 11710 11711 File: gfortran.info, Node: FDATE, Next: FGET, Prev: EXTENDS_TYPE_OF, Up: Intrinsic Procedures 11712 11713 8.105 'FDATE' -- Get the current time as a string 11714 ================================================= 11715 11716 _Description_: 11717 'FDATE(DATE)' returns the current date (using the same format as 11718 *note CTIME::) in DATE. It is equivalent to 'CALL CTIME(DATE, 11719 TIME())'. 11720 11721 This intrinsic is provided in both subroutine and function forms; 11722 however, only one form can be used in any given program unit. 11723 11724 _Standard_: 11725 GNU extension 11726 11727 _Class_: 11728 Subroutine, function 11729 11730 _Syntax_: 11731 'CALL FDATE(DATE)'. 11732 'DATE = FDATE()'. 11733 11734 _Arguments_: 11735 DATE The type shall be of type 'CHARACTER' of the 11736 default kind. It is an 'INTENT(OUT)' argument. 11737 If the length of this variable is too short for 11738 the date and time string to fit completely, it 11739 will be blank on procedure return. 11740 11741 _Return value_: 11742 The current date and time as a string. 11743 11744 _Example_: 11745 program test_fdate 11746 integer(8) :: i, j 11747 character(len=30) :: date 11748 call fdate(date) 11749 print *, 'Program started on ', date 11750 do i = 1, 100000000 ! Just a delay 11751 j = i * i - i 11752 end do 11753 call fdate(date) 11754 print *, 'Program ended on ', date 11755 end program test_fdate 11756 11757 _See also_: 11758 *note DATE_AND_TIME::, *note CTIME:: 11759 11760 11761 File: gfortran.info, Node: FGET, Next: FGETC, Prev: FDATE, Up: Intrinsic Procedures 11762 11763 8.106 'FGET' -- Read a single character in stream mode from stdin 11764 ================================================================= 11765 11766 _Description_: 11767 Read a single character in stream mode from stdin by bypassing 11768 normal formatted output. Stream I/O should not be mixed with 11769 normal record-oriented (formatted or unformatted) I/O on the same 11770 unit; the results are unpredictable. 11771 11772 This intrinsic is provided in both subroutine and function forms; 11773 however, only one form can be used in any given program unit. 11774 11775 Note that the 'FGET' intrinsic is provided for backwards 11776 compatibility with 'g77'. GNU Fortran provides the Fortran 2003 11777 Stream facility. Programmers should consider the use of new stream 11778 IO feature in new code for future portability. See also *note 11779 Fortran 2003 status::. 11780 11781 _Standard_: 11782 GNU extension 11783 11784 _Class_: 11785 Subroutine, function 11786 11787 _Syntax_: 11788 'CALL FGET(C [, STATUS])' 11789 'STATUS = FGET(C)' 11790 11791 _Arguments_: 11792 C The type shall be 'CHARACTER' and of default 11793 kind. 11794 STATUS (Optional) status flag of type 'INTEGER'. 11795 Returns 0 on success, -1 on end-of-file, and a 11796 system specific positive error code otherwise. 11797 11798 _Example_: 11799 PROGRAM test_fget 11800 INTEGER, PARAMETER :: strlen = 100 11801 INTEGER :: status, i = 1 11802 CHARACTER(len=strlen) :: str = "" 11803 11804 WRITE (*,*) 'Enter text:' 11805 DO 11806 CALL fget(str(i:i), status) 11807 if (status /= 0 .OR. i > strlen) exit 11808 i = i + 1 11809 END DO 11810 WRITE (*,*) TRIM(str) 11811 END PROGRAM 11812 11813 _See also_: 11814 *note FGETC::, *note FPUT::, *note FPUTC:: 11815 11816 11817 File: gfortran.info, Node: FGETC, Next: FINDLOC, Prev: FGET, Up: Intrinsic Procedures 11818 11819 8.107 'FGETC' -- Read a single character in stream mode 11820 ======================================================= 11821 11822 _Description_: 11823 Read a single character in stream mode by bypassing normal 11824 formatted output. Stream I/O should not be mixed with normal 11825 record-oriented (formatted or unformatted) I/O on the same unit; 11826 the results are unpredictable. 11827 11828 This intrinsic is provided in both subroutine and function forms; 11829 however, only one form can be used in any given program unit. 11830 11831 Note that the 'FGET' intrinsic is provided for backwards 11832 compatibility with 'g77'. GNU Fortran provides the Fortran 2003 11833 Stream facility. Programmers should consider the use of new stream 11834 IO feature in new code for future portability. See also *note 11835 Fortran 2003 status::. 11836 11837 _Standard_: 11838 GNU extension 11839 11840 _Class_: 11841 Subroutine, function 11842 11843 _Syntax_: 11844 'CALL FGETC(UNIT, C [, STATUS])' 11845 'STATUS = FGETC(UNIT, C)' 11846 11847 _Arguments_: 11848 UNIT The type shall be 'INTEGER'. 11849 C The type shall be 'CHARACTER' and of default 11850 kind. 11851 STATUS (Optional) status flag of type 'INTEGER'. 11852 Returns 0 on success, -1 on end-of-file and a 11853 system specific positive error code otherwise. 11854 11855 _Example_: 11856 PROGRAM test_fgetc 11857 INTEGER :: fd = 42, status 11858 CHARACTER :: c 11859 11860 OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD") 11861 DO 11862 CALL fgetc(fd, c, status) 11863 IF (status /= 0) EXIT 11864 call fput(c) 11865 END DO 11866 CLOSE(UNIT=fd) 11867 END PROGRAM 11868 11869 _See also_: 11870 *note FGET::, *note FPUT::, *note FPUTC:: 11871 11872 11873 File: gfortran.info, Node: FINDLOC, Next: FLOOR, Prev: FGETC, Up: Intrinsic Procedures 11874 11875 8.108 'FINDLOC' -- Search an array for a value 11876 ============================================== 11877 11878 _Description_: 11879 Determines the location of the element in the array with the value 11880 given in the VALUE argument, or, if the DIM argument is supplied, 11881 determines the locations of the elements equal to the VALUE 11882 argument element along each row of the array in the DIM direction. 11883 If MASK is present, only the elements for which MASK is '.TRUE.' 11884 are considered. If more than one element in the array has the 11885 value VALUE, the location returned is that of the first such 11886 element in array element order if the BACK is not present or if it 11887 is '.FALSE.'. If BACK is true, the location returned is that of 11888 the last such element. If the array has zero size, or all of the 11889 elements of MASK are '.FALSE.', then the result is an array of 11890 zeroes. Similarly, if DIM is supplied and all of the elements of 11891 MASK along a given row are zero, the result value for that row is 11892 zero. 11893 11894 _Standard_: 11895 Fortran 2008 and later. 11896 11897 _Class_: 11898 Transformational function 11899 11900 _Syntax_: 11901 'RESULT = FINDLOC(ARRAY, VALUE, DIM [, MASK] [,KIND] 11902 [,BACK])' 11903 'RESULT = FINDLOC(ARRAY, VALUE, [, MASK] [,KIND] 11904 [,BACK])' 11905 11906 _Arguments_: 11907 ARRAY Shall be an array of intrinsic type. 11908 VALUE A scalar of intrinsic type which is in type 11909 conformance with ARRAY. 11910 DIM (Optional) Shall be a scalar of type 'INTEGER', 11911 with a value between one and the rank of ARRAY, 11912 inclusive. It may not be an optional dummy 11913 argument. 11914 MASK (Optional) Shall be of type 'LOGICAL', and 11915 conformable with ARRAY. 11916 KIND (Optional) An 'INTEGER' initialization 11917 expression indicating the kind parameter of the 11918 result. 11919 BACK (Optional) A scalar of type 'LOGICAL'. 11920 11921 _Return value_: 11922 If DIM is absent, the result is a rank-one array with a length 11923 equal to the rank of ARRAY. If DIM is present, the result is an 11924 array with a rank one less than the rank of ARRAY, and a size 11925 corresponding to the size of ARRAY with the DIM dimension removed. 11926 If DIM is present and ARRAY has a rank of one, the result is a 11927 scalar. If the optional argument KIND is present, the result is an 11928 integer of kind KIND, otherwise it is of default kind. 11929 11930 _See also_: 11931 *note MAXLOC::, *note MINLOC:: 11932 11933 11934 File: gfortran.info, Node: FLOOR, Next: FLUSH, Prev: FINDLOC, Up: Intrinsic Procedures 11935 11936 8.109 'FLOOR' -- Integer floor function 11937 ======================================= 11938 11939 _Description_: 11940 'FLOOR(A)' returns the greatest integer less than or equal to X. 11941 11942 _Standard_: 11943 Fortran 95 and later 11944 11945 _Class_: 11946 Elemental function 11947 11948 _Syntax_: 11949 'RESULT = FLOOR(A [, KIND])' 11950 11951 _Arguments_: 11952 A The type shall be 'REAL'. 11953 KIND (Optional) An 'INTEGER' initialization 11954 expression indicating the kind parameter of the 11955 result. 11956 11957 _Return value_: 11958 The return value is of type 'INTEGER(KIND)' if KIND is present and 11959 of default-kind 'INTEGER' otherwise. 11960 11961 _Example_: 11962 program test_floor 11963 real :: x = 63.29 11964 real :: y = -63.59 11965 print *, floor(x) ! returns 63 11966 print *, floor(y) ! returns -64 11967 end program test_floor 11968 11969 _See also_: 11970 *note CEILING::, *note NINT:: 11971 11972 11973 File: gfortran.info, Node: FLUSH, Next: FNUM, Prev: FLOOR, Up: Intrinsic Procedures 11974 11975 8.110 'FLUSH' -- Flush I/O unit(s) 11976 ================================== 11977 11978 _Description_: 11979 Flushes Fortran unit(s) currently open for output. Without the 11980 optional argument, all units are flushed, otherwise just the unit 11981 specified. 11982 11983 _Standard_: 11984 GNU extension 11985 11986 _Class_: 11987 Subroutine 11988 11989 _Syntax_: 11990 'CALL FLUSH(UNIT)' 11991 11992 _Arguments_: 11993 UNIT (Optional) The type shall be 'INTEGER'. 11994 11995 _Note_: 11996 Beginning with the Fortran 2003 standard, there is a 'FLUSH' 11997 statement that should be preferred over the 'FLUSH' intrinsic. 11998 11999 The 'FLUSH' intrinsic and the Fortran 2003 'FLUSH' statement have 12000 identical effect: they flush the runtime library's I/O buffer so 12001 that the data becomes visible to other processes. This does not 12002 guarantee that the data is committed to disk. 12003 12004 On POSIX systems, you can request that all data is transferred to 12005 the storage device by calling the 'fsync' function, with the POSIX 12006 file descriptor of the I/O unit as argument (retrieved with GNU 12007 intrinsic 'FNUM'). The following example shows how: 12008 12009 ! Declare the interface for POSIX fsync function 12010 interface 12011 function fsync (fd) bind(c,name="fsync") 12012 use iso_c_binding, only: c_int 12013 integer(c_int), value :: fd 12014 integer(c_int) :: fsync 12015 end function fsync 12016 end interface 12017 12018 ! Variable declaration 12019 integer :: ret 12020 12021 ! Opening unit 10 12022 open (10,file="foo") 12023 12024 ! ... 12025 ! Perform I/O on unit 10 12026 ! ... 12027 12028 ! Flush and sync 12029 flush(10) 12030 ret = fsync(fnum(10)) 12031 12032 ! Handle possible error 12033 if (ret /= 0) stop "Error calling FSYNC" 12034 12035 12036 File: gfortran.info, Node: FNUM, Next: FPUT, Prev: FLUSH, Up: Intrinsic Procedures 12037 12038 8.111 'FNUM' -- File number function 12039 ==================================== 12040 12041 _Description_: 12042 'FNUM(UNIT)' returns the POSIX file descriptor number corresponding 12043 to the open Fortran I/O unit 'UNIT'. 12044 12045 _Standard_: 12046 GNU extension 12047 12048 _Class_: 12049 Function 12050 12051 _Syntax_: 12052 'RESULT = FNUM(UNIT)' 12053 12054 _Arguments_: 12055 UNIT The type shall be 'INTEGER'. 12056 12057 _Return value_: 12058 The return value is of type 'INTEGER' 12059 12060 _Example_: 12061 program test_fnum 12062 integer :: i 12063 open (unit=10, status = "scratch") 12064 i = fnum(10) 12065 print *, i 12066 close (10) 12067 end program test_fnum 12068 12069 12070 File: gfortran.info, Node: FPUT, Next: FPUTC, Prev: FNUM, Up: Intrinsic Procedures 12071 12072 8.112 'FPUT' -- Write a single character in stream mode to stdout 12073 ================================================================= 12074 12075 _Description_: 12076 Write a single character in stream mode to stdout by bypassing 12077 normal formatted output. Stream I/O should not be mixed with 12078 normal record-oriented (formatted or unformatted) I/O on the same 12079 unit; the results are unpredictable. 12080 12081 This intrinsic is provided in both subroutine and function forms; 12082 however, only one form can be used in any given program unit. 12083 12084 Note that the 'FGET' intrinsic is provided for backwards 12085 compatibility with 'g77'. GNU Fortran provides the Fortran 2003 12086 Stream facility. Programmers should consider the use of new stream 12087 IO feature in new code for future portability. See also *note 12088 Fortran 2003 status::. 12089 12090 _Standard_: 12091 GNU extension 12092 12093 _Class_: 12094 Subroutine, function 12095 12096 _Syntax_: 12097 'CALL FPUT(C [, STATUS])' 12098 'STATUS = FPUT(C)' 12099 12100 _Arguments_: 12101 C The type shall be 'CHARACTER' and of default 12102 kind. 12103 STATUS (Optional) status flag of type 'INTEGER'. 12104 Returns 0 on success, -1 on end-of-file and a 12105 system specific positive error code otherwise. 12106 12107 _Example_: 12108 PROGRAM test_fput 12109 CHARACTER(len=10) :: str = "gfortran" 12110 INTEGER :: i 12111 DO i = 1, len_trim(str) 12112 CALL fput(str(i:i)) 12113 END DO 12114 END PROGRAM 12115 12116 _See also_: 12117 *note FPUTC::, *note FGET::, *note FGETC:: 12118 12119 12120 File: gfortran.info, Node: FPUTC, Next: FRACTION, Prev: FPUT, Up: Intrinsic Procedures 12121 12122 8.113 'FPUTC' -- Write a single character in stream mode 12123 ======================================================== 12124 12125 _Description_: 12126 Write a single character in stream mode by bypassing normal 12127 formatted output. Stream I/O should not be mixed with normal 12128 record-oriented (formatted or unformatted) I/O on the same unit; 12129 the results are unpredictable. 12130 12131 This intrinsic is provided in both subroutine and function forms; 12132 however, only one form can be used in any given program unit. 12133 12134 Note that the 'FGET' intrinsic is provided for backwards 12135 compatibility with 'g77'. GNU Fortran provides the Fortran 2003 12136 Stream facility. Programmers should consider the use of new stream 12137 IO feature in new code for future portability. See also *note 12138 Fortran 2003 status::. 12139 12140 _Standard_: 12141 GNU extension 12142 12143 _Class_: 12144 Subroutine, function 12145 12146 _Syntax_: 12147 'CALL FPUTC(UNIT, C [, STATUS])' 12148 'STATUS = FPUTC(UNIT, C)' 12149 12150 _Arguments_: 12151 UNIT The type shall be 'INTEGER'. 12152 C The type shall be 'CHARACTER' and of default 12153 kind. 12154 STATUS (Optional) status flag of type 'INTEGER'. 12155 Returns 0 on success, -1 on end-of-file and a 12156 system specific positive error code otherwise. 12157 12158 _Example_: 12159 PROGRAM test_fputc 12160 CHARACTER(len=10) :: str = "gfortran" 12161 INTEGER :: fd = 42, i 12162 12163 OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW") 12164 DO i = 1, len_trim(str) 12165 CALL fputc(fd, str(i:i)) 12166 END DO 12167 CLOSE(fd) 12168 END PROGRAM 12169 12170 _See also_: 12171 *note FPUT::, *note FGET::, *note FGETC:: 12172 12173 12174 File: gfortran.info, Node: FRACTION, Next: FREE, Prev: FPUTC, Up: Intrinsic Procedures 12175 12176 8.114 'FRACTION' -- Fractional part of the model representation 12177 =============================================================== 12178 12179 _Description_: 12180 'FRACTION(X)' returns the fractional part of the model 12181 representation of 'X'. 12182 12183 _Standard_: 12184 Fortran 90 and later 12185 12186 _Class_: 12187 Elemental function 12188 12189 _Syntax_: 12190 'Y = FRACTION(X)' 12191 12192 _Arguments_: 12193 X The type of the argument shall be a 'REAL'. 12194 12195 _Return value_: 12196 The return value is of the same type and kind as the argument. The 12197 fractional part of the model representation of 'X' is returned; it 12198 is 'X * RADIX(X)**(-EXPONENT(X))'. 12199 12200 _Example_: 12201 program test_fraction 12202 real :: x 12203 x = 178.1387e-4 12204 print *, fraction(x), x * radix(x)**(-exponent(x)) 12205 end program test_fraction 12206 12207 12208 File: gfortran.info, Node: FREE, Next: FSEEK, Prev: FRACTION, Up: Intrinsic Procedures 12209 12210 8.115 'FREE' -- Frees memory 12211 ============================ 12212 12213 _Description_: 12214 Frees memory previously allocated by 'MALLOC'. The 'FREE' 12215 intrinsic is an extension intended to be used with Cray pointers, 12216 and is provided in GNU Fortran to allow user to compile legacy 12217 code. For new code using Fortran 95 pointers, the memory 12218 de-allocation intrinsic is 'DEALLOCATE'. 12219 12220 _Standard_: 12221 GNU extension 12222 12223 _Class_: 12224 Subroutine 12225 12226 _Syntax_: 12227 'CALL FREE(PTR)' 12228 12229 _Arguments_: 12230 PTR The type shall be 'INTEGER'. It represents the 12231 location of the memory that should be 12232 de-allocated. 12233 12234 _Return value_: 12235 None 12236 12237 _Example_: 12238 See 'MALLOC' for an example. 12239 12240 _See also_: 12241 *note MALLOC:: 12242 12243 12244 File: gfortran.info, Node: FSEEK, Next: FSTAT, Prev: FREE, Up: Intrinsic Procedures 12245 12246 8.116 'FSEEK' -- Low level file positioning subroutine 12247 ====================================================== 12248 12249 _Description_: 12250 Moves UNIT to the specified OFFSET. If WHENCE is set to 0, the 12251 OFFSET is taken as an absolute value 'SEEK_SET', if set to 1, 12252 OFFSET is taken to be relative to the current position 'SEEK_CUR', 12253 and if set to 2 relative to the end of the file 'SEEK_END'. On 12254 error, STATUS is set to a nonzero value. If STATUS the seek fails 12255 silently. 12256 12257 This intrinsic routine is not fully backwards compatible with 12258 'g77'. In 'g77', the 'FSEEK' takes a statement label instead of a 12259 STATUS variable. If FSEEK is used in old code, change 12260 CALL FSEEK(UNIT, OFFSET, WHENCE, *label) 12261 to 12262 INTEGER :: status 12263 CALL FSEEK(UNIT, OFFSET, WHENCE, status) 12264 IF (status /= 0) GOTO label 12265 12266 Please note that GNU Fortran provides the Fortran 2003 Stream 12267 facility. Programmers should consider the use of new stream IO 12268 feature in new code for future portability. See also *note Fortran 12269 2003 status::. 12270 12271 _Standard_: 12272 GNU extension 12273 12274 _Class_: 12275 Subroutine 12276 12277 _Syntax_: 12278 'CALL FSEEK(UNIT, OFFSET, WHENCE[, STATUS])' 12279 12280 _Arguments_: 12281 UNIT Shall be a scalar of type 'INTEGER'. 12282 OFFSET Shall be a scalar of type 'INTEGER'. 12283 WHENCE Shall be a scalar of type 'INTEGER'. Its value 12284 shall be either 0, 1 or 2. 12285 STATUS (Optional) shall be a scalar of type 12286 'INTEGER(4)'. 12287 12288 _Example_: 12289 PROGRAM test_fseek 12290 INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2 12291 INTEGER :: fd, offset, ierr 12292 12293 ierr = 0 12294 offset = 5 12295 fd = 10 12296 12297 OPEN(UNIT=fd, FILE="fseek.test") 12298 CALL FSEEK(fd, offset, SEEK_SET, ierr) ! move to OFFSET 12299 print *, FTELL(fd), ierr 12300 12301 CALL FSEEK(fd, 0, SEEK_END, ierr) ! move to end 12302 print *, FTELL(fd), ierr 12303 12304 CALL FSEEK(fd, 0, SEEK_SET, ierr) ! move to beginning 12305 print *, FTELL(fd), ierr 12306 12307 CLOSE(UNIT=fd) 12308 END PROGRAM 12309 12310 _See also_: 12311 *note FTELL:: 12312 12313 12314 File: gfortran.info, Node: FSTAT, Next: FTELL, Prev: FSEEK, Up: Intrinsic Procedures 12315 12316 8.117 'FSTAT' -- Get file status 12317 ================================ 12318 12319 _Description_: 12320 'FSTAT' is identical to *note STAT::, except that information about 12321 an already opened file is obtained. 12322 12323 The elements in 'VALUES' are the same as described by *note STAT::. 12324 12325 This intrinsic is provided in both subroutine and function forms; 12326 however, only one form can be used in any given program unit. 12327 12328 _Standard_: 12329 GNU extension 12330 12331 _Class_: 12332 Subroutine, function 12333 12334 _Syntax_: 12335 'CALL FSTAT(UNIT, VALUES [, STATUS])' 12336 'STATUS = FSTAT(UNIT, VALUES)' 12337 12338 _Arguments_: 12339 UNIT An open I/O unit number of type 'INTEGER'. 12340 VALUES The type shall be 'INTEGER(4), DIMENSION(13)'. 12341 STATUS (Optional) status flag of type 'INTEGER(4)'. 12342 Returns 0 on success and a system specific error 12343 code otherwise. 12344 12345 _Example_: 12346 See *note STAT:: for an example. 12347 12348 _See also_: 12349 To stat a link: *note LSTAT:: To stat a file: *note STAT:: 12350 12351 12352 File: gfortran.info, Node: FTELL, Next: GAMMA, Prev: FSTAT, Up: Intrinsic Procedures 12353 12354 8.118 'FTELL' -- Current stream position 12355 ======================================== 12356 12357 _Description_: 12358 Retrieves the current position within an open file. 12359 12360 This intrinsic is provided in both subroutine and function forms; 12361 however, only one form can be used in any given program unit. 12362 12363 _Standard_: 12364 GNU extension 12365 12366 _Class_: 12367 Subroutine, function 12368 12369 _Syntax_: 12370 'CALL FTELL(UNIT, OFFSET)' 12371 'OFFSET = FTELL(UNIT)' 12372 12373 _Arguments_: 12374 OFFSET Shall of type 'INTEGER'. 12375 UNIT Shall of type 'INTEGER'. 12376 12377 _Return value_: 12378 In either syntax, OFFSET is set to the current offset of unit 12379 number UNIT, or to -1 if the unit is not currently open. 12380 12381 _Example_: 12382 PROGRAM test_ftell 12383 INTEGER :: i 12384 OPEN(10, FILE="temp.dat") 12385 CALL ftell(10,i) 12386 WRITE(*,*) i 12387 END PROGRAM 12388 12389 _See also_: 12390 *note FSEEK:: 12391 12392 12393 File: gfortran.info, Node: GAMMA, Next: GERROR, Prev: FTELL, Up: Intrinsic Procedures 12394 12395 8.119 'GAMMA' -- Gamma function 12396 =============================== 12397 12398 _Description_: 12399 'GAMMA(X)' computes Gamma (\Gamma) of X. For positive, integer 12400 values of X the Gamma function simplifies to the factorial function 12401 \Gamma(x)=(x-1)!. 12402 12403 _Standard_: 12404 Fortran 2008 and later 12405 12406 _Class_: 12407 Elemental function 12408 12409 _Syntax_: 12410 'X = GAMMA(X)' 12411 12412 _Arguments_: 12413 X Shall be of type 'REAL' and neither zero nor a 12414 negative integer. 12415 12416 _Return value_: 12417 The return value is of type 'REAL' of the same kind as X. 12418 12419 _Example_: 12420 program test_gamma 12421 real :: x = 1.0 12422 x = gamma(x) ! returns 1.0 12423 end program test_gamma 12424 12425 _Specific names_: 12426 Name Argument Return type Standard 12427 ------------------------------------------------------------------------- 12428 'DGAMMA(X)' 'REAL(8) X' 'REAL(8)' GNU extension 12429 12430 _See also_: 12431 Logarithm of the Gamma function: *note LOG_GAMMA:: 12432 12433 12434 File: gfortran.info, Node: GERROR, Next: GETARG, Prev: GAMMA, Up: Intrinsic Procedures 12435 12436 8.120 'GERROR' -- Get last system error message 12437 =============================================== 12438 12439 _Description_: 12440 Returns the system error message corresponding to the last system 12441 error. This resembles the functionality of 'strerror(3)' in C. 12442 12443 _Standard_: 12444 GNU extension 12445 12446 _Class_: 12447 Subroutine 12448 12449 _Syntax_: 12450 'CALL GERROR(RESULT)' 12451 12452 _Arguments_: 12453 RESULT Shall be of type 'CHARACTER' and of default 12454 kind. 12455 12456 _Example_: 12457 PROGRAM test_gerror 12458 CHARACTER(len=100) :: msg 12459 CALL gerror(msg) 12460 WRITE(*,*) msg 12461 END PROGRAM 12462 12463 _See also_: 12464 *note IERRNO::, *note PERROR:: 12465 12466 12467 File: gfortran.info, Node: GETARG, Next: GET_COMMAND, Prev: GERROR, Up: Intrinsic Procedures 12468 12469 8.121 'GETARG' -- Get command line arguments 12470 ============================================ 12471 12472 _Description_: 12473 Retrieve the POS-th argument that was passed on the command line 12474 when the containing program was invoked. 12475 12476 This intrinsic routine is provided for backwards compatibility with 12477 GNU Fortran 77. In new code, programmers should consider the use 12478 of the *note GET_COMMAND_ARGUMENT:: intrinsic defined by the 12479 Fortran 2003 standard. 12480 12481 _Standard_: 12482 GNU extension 12483 12484 _Class_: 12485 Subroutine 12486 12487 _Syntax_: 12488 'CALL GETARG(POS, VALUE)' 12489 12490 _Arguments_: 12491 POS Shall be of type 'INTEGER' and not wider than 12492 the default integer kind; POS \geq 0 12493 VALUE Shall be of type 'CHARACTER' and of default 12494 kind. 12495 12496 _Return value_: 12497 After 'GETARG' returns, the VALUE argument holds the POSth command 12498 line argument. If VALUE cannot hold the argument, it is truncated 12499 to fit the length of VALUE. If there are less than POS arguments 12500 specified at the command line, VALUE will be filled with blanks. 12501 If POS = 0, VALUE is set to the name of the program (on systems 12502 that support this feature). 12503 12504 _Example_: 12505 PROGRAM test_getarg 12506 INTEGER :: i 12507 CHARACTER(len=32) :: arg 12508 12509 DO i = 1, iargc() 12510 CALL getarg(i, arg) 12511 WRITE (*,*) arg 12512 END DO 12513 END PROGRAM 12514 12515 _See also_: 12516 GNU Fortran 77 compatibility function: *note IARGC:: Fortran 2003 12517 functions and subroutines: *note GET_COMMAND::, *note 12518 GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT:: 12519 12520 12521 File: gfortran.info, Node: GET_COMMAND, Next: GET_COMMAND_ARGUMENT, Prev: GETARG, Up: Intrinsic Procedures 12522 12523 8.122 'GET_COMMAND' -- Get the entire command line 12524 ================================================== 12525 12526 _Description_: 12527 Retrieve the entire command line that was used to invoke the 12528 program. 12529 12530 _Standard_: 12531 Fortran 2003 and later 12532 12533 _Class_: 12534 Subroutine 12535 12536 _Syntax_: 12537 'CALL GET_COMMAND([COMMAND, LENGTH, STATUS])' 12538 12539 _Arguments_: 12540 COMMAND (Optional) shall be of type 'CHARACTER' and of 12541 default kind. 12542 LENGTH (Optional) Shall be of type 'INTEGER' and of 12543 default kind. 12544 STATUS (Optional) Shall be of type 'INTEGER' and of 12545 default kind. 12546 12547 _Return value_: 12548 If COMMAND is present, stores the entire command line that was used 12549 to invoke the program in COMMAND. If LENGTH is present, it is 12550 assigned the length of the command line. If STATUS is present, it 12551 is assigned 0 upon success of the command, -1 if COMMAND is too 12552 short to store the command line, or a positive value in case of an 12553 error. 12554 12555 _Example_: 12556 PROGRAM test_get_command 12557 CHARACTER(len=255) :: cmd 12558 CALL get_command(cmd) 12559 WRITE (*,*) TRIM(cmd) 12560 END PROGRAM 12561 12562 _See also_: 12563 *note GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT:: 12564 12565 12566 File: gfortran.info, Node: GET_COMMAND_ARGUMENT, Next: GETCWD, Prev: GET_COMMAND, Up: Intrinsic Procedures 12567 12568 8.123 'GET_COMMAND_ARGUMENT' -- Get command line arguments 12569 ========================================================== 12570 12571 _Description_: 12572 Retrieve the NUMBER-th argument that was passed on the command line 12573 when the containing program was invoked. 12574 12575 _Standard_: 12576 Fortran 2003 and later 12577 12578 _Class_: 12579 Subroutine 12580 12581 _Syntax_: 12582 'CALL GET_COMMAND_ARGUMENT(NUMBER [, VALUE, LENGTH, STATUS])' 12583 12584 _Arguments_: 12585 NUMBER Shall be a scalar of type 'INTEGER' and of 12586 default kind, NUMBER \geq 0 12587 VALUE (Optional) Shall be a scalar of type 'CHARACTER' 12588 and of default kind. 12589 LENGTH (Optional) Shall be a scalar of type 'INTEGER' 12590 and of default kind. 12591 STATUS (Optional) Shall be a scalar of type 'INTEGER' 12592 and of default kind. 12593 12594 _Return value_: 12595 After 'GET_COMMAND_ARGUMENT' returns, the VALUE argument holds the 12596 NUMBER-th command line argument. If VALUE cannot hold the 12597 argument, it is truncated to fit the length of VALUE. If there are 12598 less than NUMBER arguments specified at the command line, VALUE 12599 will be filled with blanks. If NUMBER = 0, VALUE is set to the 12600 name of the program (on systems that support this feature). The 12601 LENGTH argument contains the length of the NUMBER-th command line 12602 argument. If the argument retrieval fails, STATUS is a positive 12603 number; if VALUE contains a truncated command line argument, STATUS 12604 is -1; and otherwise the STATUS is zero. 12605 12606 _Example_: 12607 PROGRAM test_get_command_argument 12608 INTEGER :: i 12609 CHARACTER(len=32) :: arg 12610 12611 i = 0 12612 DO 12613 CALL get_command_argument(i, arg) 12614 IF (LEN_TRIM(arg) == 0) EXIT 12615 12616 WRITE (*,*) TRIM(arg) 12617 i = i+1 12618 END DO 12619 END PROGRAM 12620 12621 _See also_: 12622 *note GET_COMMAND::, *note COMMAND_ARGUMENT_COUNT:: 12623 12624 12625 File: gfortran.info, Node: GETCWD, Next: GETENV, Prev: GET_COMMAND_ARGUMENT, Up: Intrinsic Procedures 12626 12627 8.124 'GETCWD' -- Get current working directory 12628 =============================================== 12629 12630 _Description_: 12631 Get current working directory. 12632 12633 This intrinsic is provided in both subroutine and function forms; 12634 however, only one form can be used in any given program unit. 12635 12636 _Standard_: 12637 GNU extension 12638 12639 _Class_: 12640 Subroutine, function 12641 12642 _Syntax_: 12643 'CALL GETCWD(C [, STATUS])' 12644 'STATUS = GETCWD(C)' 12645 12646 _Arguments_: 12647 C The type shall be 'CHARACTER' and of default 12648 kind. 12649 STATUS (Optional) status flag. Returns 0 on success, a 12650 system specific and nonzero error code 12651 otherwise. 12652 12653 _Example_: 12654 PROGRAM test_getcwd 12655 CHARACTER(len=255) :: cwd 12656 CALL getcwd(cwd) 12657 WRITE(*,*) TRIM(cwd) 12658 END PROGRAM 12659 12660 _See also_: 12661 *note CHDIR:: 12662 12663 12664 File: gfortran.info, Node: GETENV, Next: GET_ENVIRONMENT_VARIABLE, Prev: GETCWD, Up: Intrinsic Procedures 12665 12666 8.125 'GETENV' -- Get an environmental variable 12667 =============================================== 12668 12669 _Description_: 12670 Get the VALUE of the environmental variable NAME. 12671 12672 This intrinsic routine is provided for backwards compatibility with 12673 GNU Fortran 77. In new code, programmers should consider the use 12674 of the *note GET_ENVIRONMENT_VARIABLE:: intrinsic defined by the 12675 Fortran 2003 standard. 12676 12677 Note that 'GETENV' need not be thread-safe. It is the 12678 responsibility of the user to ensure that the environment is not 12679 being updated concurrently with a call to the 'GETENV' intrinsic. 12680 12681 _Standard_: 12682 GNU extension 12683 12684 _Class_: 12685 Subroutine 12686 12687 _Syntax_: 12688 'CALL GETENV(NAME, VALUE)' 12689 12690 _Arguments_: 12691 NAME Shall be of type 'CHARACTER' and of default 12692 kind. 12693 VALUE Shall be of type 'CHARACTER' and of default 12694 kind. 12695 12696 _Return value_: 12697 Stores the value of NAME in VALUE. If VALUE is not large enough to 12698 hold the data, it is truncated. If NAME is not set, VALUE will be 12699 filled with blanks. 12700 12701 _Example_: 12702 PROGRAM test_getenv 12703 CHARACTER(len=255) :: homedir 12704 CALL getenv("HOME", homedir) 12705 WRITE (*,*) TRIM(homedir) 12706 END PROGRAM 12707 12708 _See also_: 12709 *note GET_ENVIRONMENT_VARIABLE:: 12710 12711 12712 File: gfortran.info, Node: GET_ENVIRONMENT_VARIABLE, Next: GETGID, Prev: GETENV, Up: Intrinsic Procedures 12713 12714 8.126 'GET_ENVIRONMENT_VARIABLE' -- Get an environmental variable 12715 ================================================================= 12716 12717 _Description_: 12718 Get the VALUE of the environmental variable NAME. 12719 12720 Note that 'GET_ENVIRONMENT_VARIABLE' need not be thread-safe. It 12721 is the responsibility of the user to ensure that the environment is 12722 not being updated concurrently with a call to the 12723 'GET_ENVIRONMENT_VARIABLE' intrinsic. 12724 12725 _Standard_: 12726 Fortran 2003 and later 12727 12728 _Class_: 12729 Subroutine 12730 12731 _Syntax_: 12732 'CALL GET_ENVIRONMENT_VARIABLE(NAME[, VALUE, LENGTH, STATUS, 12733 TRIM_NAME)' 12734 12735 _Arguments_: 12736 NAME Shall be a scalar of type 'CHARACTER' and of 12737 default kind. 12738 VALUE (Optional) Shall be a scalar of type 'CHARACTER' 12739 and of default kind. 12740 LENGTH (Optional) Shall be a scalar of type 'INTEGER' 12741 and of default kind. 12742 STATUS (Optional) Shall be a scalar of type 'INTEGER' 12743 and of default kind. 12744 TRIM_NAME (Optional) Shall be a scalar of type 'LOGICAL' 12745 and of default kind. 12746 12747 _Return value_: 12748 Stores the value of NAME in VALUE. If VALUE is not large enough to 12749 hold the data, it is truncated. If NAME is not set, VALUE will be 12750 filled with blanks. Argument LENGTH contains the length needed for 12751 storing the environment variable NAME or zero if it is not present. 12752 STATUS is -1 if VALUE is present but too short for the environment 12753 variable; it is 1 if the environment variable does not exist and 2 12754 if the processor does not support environment variables; in all 12755 other cases STATUS is zero. If TRIM_NAME is present with the value 12756 '.FALSE.', the trailing blanks in NAME are significant; otherwise 12757 they are not part of the environment variable name. 12758 12759 _Example_: 12760 PROGRAM test_getenv 12761 CHARACTER(len=255) :: homedir 12762 CALL get_environment_variable("HOME", homedir) 12763 WRITE (*,*) TRIM(homedir) 12764 END PROGRAM 12765 12766 12767 File: gfortran.info, Node: GETGID, Next: GETLOG, Prev: GET_ENVIRONMENT_VARIABLE, Up: Intrinsic Procedures 12768 12769 8.127 'GETGID' -- Group ID function 12770 =================================== 12771 12772 _Description_: 12773 Returns the numerical group ID of the current process. 12774 12775 _Standard_: 12776 GNU extension 12777 12778 _Class_: 12779 Function 12780 12781 _Syntax_: 12782 'RESULT = GETGID()' 12783 12784 _Return value_: 12785 The return value of 'GETGID' is an 'INTEGER' of the default kind. 12786 12787 _Example_: 12788 See 'GETPID' for an example. 12789 12790 _See also_: 12791 *note GETPID::, *note GETUID:: 12792 12793 12794 File: gfortran.info, Node: GETLOG, Next: GETPID, Prev: GETGID, Up: Intrinsic Procedures 12795 12796 8.128 'GETLOG' -- Get login name 12797 ================================ 12798 12799 _Description_: 12800 Gets the username under which the program is running. 12801 12802 _Standard_: 12803 GNU extension 12804 12805 _Class_: 12806 Subroutine 12807 12808 _Syntax_: 12809 'CALL GETLOG(C)' 12810 12811 _Arguments_: 12812 C Shall be of type 'CHARACTER' and of default 12813 kind. 12814 12815 _Return value_: 12816 Stores the current user name in C. (On systems where POSIX 12817 functions 'geteuid' and 'getpwuid' are not available, and the 12818 'getlogin' function is not implemented either, this will return a 12819 blank string.) 12820 12821 _Example_: 12822 PROGRAM TEST_GETLOG 12823 CHARACTER(32) :: login 12824 CALL GETLOG(login) 12825 WRITE(*,*) login 12826 END PROGRAM 12827 12828 _See also_: 12829 *note GETUID:: 12830 12831 12832 File: gfortran.info, Node: GETPID, Next: GETUID, Prev: GETLOG, Up: Intrinsic Procedures 12833 12834 8.129 'GETPID' -- Process ID function 12835 ===================================== 12836 12837 _Description_: 12838 Returns the numerical process identifier of the current process. 12839 12840 _Standard_: 12841 GNU extension 12842 12843 _Class_: 12844 Function 12845 12846 _Syntax_: 12847 'RESULT = GETPID()' 12848 12849 _Return value_: 12850 The return value of 'GETPID' is an 'INTEGER' of the default kind. 12851 12852 _Example_: 12853 program info 12854 print *, "The current process ID is ", getpid() 12855 print *, "Your numerical user ID is ", getuid() 12856 print *, "Your numerical group ID is ", getgid() 12857 end program info 12858 12859 _See also_: 12860 *note GETGID::, *note GETUID:: 12861 12862 12863 File: gfortran.info, Node: GETUID, Next: GMTIME, Prev: GETPID, Up: Intrinsic Procedures 12864 12865 8.130 'GETUID' -- User ID function 12866 ================================== 12867 12868 _Description_: 12869 Returns the numerical user ID of the current process. 12870 12871 _Standard_: 12872 GNU extension 12873 12874 _Class_: 12875 Function 12876 12877 _Syntax_: 12878 'RESULT = GETUID()' 12879 12880 _Return value_: 12881 The return value of 'GETUID' is an 'INTEGER' of the default kind. 12882 12883 _Example_: 12884 See 'GETPID' for an example. 12885 12886 _See also_: 12887 *note GETPID::, *note GETLOG:: 12888 12889 12890 File: gfortran.info, Node: GMTIME, Next: HOSTNM, Prev: GETUID, Up: Intrinsic Procedures 12891 12892 8.131 'GMTIME' -- Convert time to GMT info 12893 ========================================== 12894 12895 _Description_: 12896 Given a system time value TIME (as provided by the *note TIME:: 12897 intrinsic), fills VALUES with values extracted from it appropriate 12898 to the UTC time zone (Universal Coordinated Time, also known in 12899 some countries as GMT, Greenwich Mean Time), using 'gmtime(3)'. 12900 12901 This intrinsic routine is provided for backwards compatibility with 12902 GNU Fortran 77. In new code, programmers should consider the use 12903 of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95 12904 standard. 12905 12906 _Standard_: 12907 GNU extension 12908 12909 _Class_: 12910 Subroutine 12911 12912 _Syntax_: 12913 'CALL GMTIME(TIME, VALUES)' 12914 12915 _Arguments_: 12916 TIME An 'INTEGER' scalar expression corresponding to 12917 a system time, with 'INTENT(IN)'. 12918 VALUES A default 'INTEGER' array with 9 elements, with 12919 'INTENT(OUT)'. 12920 12921 _Return value_: 12922 The elements of VALUES are assigned as follows: 12923 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap 12924 seconds 12925 2. Minutes after the hour, range 0-59 12926 3. Hours past midnight, range 0-23 12927 4. Day of month, range 1-31 12928 5. Number of months since January, range 0-11 12929 6. Years since 1900 12930 7. Number of days since Sunday, range 0-6 12931 8. Days since January 1, range 0-365 12932 9. Daylight savings indicator: positive if daylight savings is in 12933 effect, zero if not, and negative if the information is not 12934 available. 12935 12936 _See also_: 12937 *note DATE_AND_TIME::, *note CTIME::, *note LTIME::, *note TIME::, 12938 *note TIME8:: 12939 12940 12941 File: gfortran.info, Node: HOSTNM, Next: HUGE, Prev: GMTIME, Up: Intrinsic Procedures 12942 12943 8.132 'HOSTNM' -- Get system host name 12944 ====================================== 12945 12946 _Description_: 12947 Retrieves the host name of the system on which the program is 12948 running. 12949 12950 This intrinsic is provided in both subroutine and function forms; 12951 however, only one form can be used in any given program unit. 12952 12953 _Standard_: 12954 GNU extension 12955 12956 _Class_: 12957 Subroutine, function 12958 12959 _Syntax_: 12960 'CALL HOSTNM(C [, STATUS])' 12961 'STATUS = HOSTNM(NAME)' 12962 12963 _Arguments_: 12964 C Shall of type 'CHARACTER' and of default kind. 12965 STATUS (Optional) status flag of type 'INTEGER'. 12966 Returns 0 on success, or a system specific error 12967 code otherwise. 12968 12969 _Return value_: 12970 In either syntax, NAME is set to the current hostname if it can be 12971 obtained, or to a blank string otherwise. 12972 12973 12974 File: gfortran.info, Node: HUGE, Next: HYPOT, Prev: HOSTNM, Up: Intrinsic Procedures 12975 12976 8.133 'HUGE' -- Largest number of a kind 12977 ======================================== 12978 12979 _Description_: 12980 'HUGE(X)' returns the largest number that is not an infinity in the 12981 model of the type of 'X'. 12982 12983 _Standard_: 12984 Fortran 90 and later 12985 12986 _Class_: 12987 Inquiry function 12988 12989 _Syntax_: 12990 'RESULT = HUGE(X)' 12991 12992 _Arguments_: 12993 X Shall be of type 'REAL' or 'INTEGER'. 12994 12995 _Return value_: 12996 The return value is of the same type and kind as X 12997 12998 _Example_: 12999 program test_huge_tiny 13000 print *, huge(0), huge(0.0), huge(0.0d0) 13001 print *, tiny(0.0), tiny(0.0d0) 13002 end program test_huge_tiny 13003 13004 13005 File: gfortran.info, Node: HYPOT, Next: IACHAR, Prev: HUGE, Up: Intrinsic Procedures 13006 13007 8.134 'HYPOT' -- Euclidean distance function 13008 ============================================ 13009 13010 _Description_: 13011 'HYPOT(X,Y)' is the Euclidean distance function. It is equal to 13012 \sqrt{X^2 + Y^2}, without undue underflow or overflow. 13013 13014 _Standard_: 13015 Fortran 2008 and later 13016 13017 _Class_: 13018 Elemental function 13019 13020 _Syntax_: 13021 'RESULT = HYPOT(X, Y)' 13022 13023 _Arguments_: 13024 X The type shall be 'REAL'. 13025 Y The type and kind type parameter shall be the 13026 same as X. 13027 13028 _Return value_: 13029 The return value has the same type and kind type parameter as X. 13030 13031 _Example_: 13032 program test_hypot 13033 real(4) :: x = 1.e0_4, y = 0.5e0_4 13034 x = hypot(x,y) 13035 end program test_hypot 13036 13037 13038 File: gfortran.info, Node: IACHAR, Next: IALL, Prev: HYPOT, Up: Intrinsic Procedures 13039 13040 8.135 'IACHAR' -- Code in ASCII collating sequence 13041 ================================================== 13042 13043 _Description_: 13044 'IACHAR(C)' returns the code for the ASCII character in the first 13045 character position of 'C'. 13046 13047 _Standard_: 13048 Fortran 95 and later, with KIND argument Fortran 2003 and later 13049 13050 _Class_: 13051 Elemental function 13052 13053 _Syntax_: 13054 'RESULT = IACHAR(C [, KIND])' 13055 13056 _Arguments_: 13057 C Shall be a scalar 'CHARACTER', with 'INTENT(IN)' 13058 KIND (Optional) An 'INTEGER' initialization 13059 expression indicating the kind parameter of the 13060 result. 13061 13062 _Return value_: 13063 The return value is of type 'INTEGER' and of kind KIND. If KIND is 13064 absent, the return value is of default integer kind. 13065 13066 _Example_: 13067 program test_iachar 13068 integer i 13069 i = iachar(' ') 13070 end program test_iachar 13071 13072 _Note_: 13073 See *note ICHAR:: for a discussion of converting between numerical 13074 values and formatted string representations. 13075 13076 _See also_: 13077 *note ACHAR::, *note CHAR::, *note ICHAR:: 13078 13079 13080 File: gfortran.info, Node: IALL, Next: IAND, Prev: IACHAR, Up: Intrinsic Procedures 13081 13082 8.136 'IALL' -- Bitwise AND of array elements 13083 ============================================= 13084 13085 _Description_: 13086 Reduces with bitwise AND the elements of ARRAY along dimension DIM 13087 if the corresponding element in MASK is 'TRUE'. 13088 13089 _Standard_: 13090 Fortran 2008 and later 13091 13092 _Class_: 13093 Transformational function 13094 13095 _Syntax_: 13096 'RESULT = IALL(ARRAY[, MASK])' 13097 'RESULT = IALL(ARRAY, DIM[, MASK])' 13098 13099 _Arguments_: 13100 ARRAY Shall be an array of type 'INTEGER' 13101 DIM (Optional) shall be a scalar of type 'INTEGER' 13102 with a value in the range from 1 to n, where n 13103 equals the rank of ARRAY. 13104 MASK (Optional) shall be of type 'LOGICAL' and either 13105 be a scalar or an array of the same shape as 13106 ARRAY. 13107 13108 _Return value_: 13109 The result is of the same type as ARRAY. 13110 13111 If DIM is absent, a scalar with the bitwise ALL of all elements in 13112 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 13113 the rank of ARRAY, and a shape similar to that of ARRAY with 13114 dimension DIM dropped is returned. 13115 13116 _Example_: 13117 PROGRAM test_iall 13118 INTEGER(1) :: a(2) 13119 13120 a(1) = b'00100100' 13121 a(2) = b'01101010' 13122 13123 ! prints 00100000 13124 PRINT '(b8.8)', IALL(a) 13125 END PROGRAM 13126 13127 _See also_: 13128 *note IANY::, *note IPARITY::, *note IAND:: 13129 13130 13131 File: gfortran.info, Node: IAND, Next: IANY, Prev: IALL, Up: Intrinsic Procedures 13132 13133 8.137 'IAND' -- Bitwise logical and 13134 =================================== 13135 13136 _Description_: 13137 Bitwise logical 'AND'. 13138 13139 _Standard_: 13140 Fortran 90 and later, with boz-literal-constant Fortran 2008 and 13141 later, has overloads that are GNU extensions 13142 13143 _Class_: 13144 Elemental function 13145 13146 _Syntax_: 13147 'RESULT = IAND(I, J)' 13148 13149 _Arguments_: 13150 I The type shall be 'INTEGER' or a 13151 boz-literal-constant. 13152 J The type shall be 'INTEGER' with the same kind 13153 type parameter as I or a boz-literal-constant. 13154 I and J shall not both be boz-literal-constants. 13155 13156 _Return value_: 13157 The return type is 'INTEGER' with the kind type parameter of the 13158 arguments. A boz-literal-constant is converted to an 'INTEGER' 13159 with the kind type parameter of the other argument as-if a call to 13160 *note INT:: occurred. 13161 13162 _Example_: 13163 PROGRAM test_iand 13164 INTEGER :: a, b 13165 DATA a / Z'F' /, b / Z'3' / 13166 WRITE (*,*) IAND(a, b) 13167 END PROGRAM 13168 13169 _Specific names_: 13170 Name Argument Return type Standard 13171 ------------------------------------------------------------------------- 13172 'IAND(A)' 'INTEGER A' 'INTEGER' Fortran 90 and later 13173 'BIAND(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 13174 'IIAND(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 13175 'JIAND(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 13176 'KIAND(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 13177 13178 _See also_: 13179 *note IOR::, *note IEOR::, *note IBITS::, *note IBSET::, *note 13180 IBCLR::, *note NOT:: 13181 13182 13183 File: gfortran.info, Node: IANY, Next: IARGC, Prev: IAND, Up: Intrinsic Procedures 13184 13185 8.138 'IANY' -- Bitwise OR of array elements 13186 ============================================ 13187 13188 _Description_: 13189 Reduces with bitwise OR (inclusive or) the elements of ARRAY along 13190 dimension DIM if the corresponding element in MASK is 'TRUE'. 13191 13192 _Standard_: 13193 Fortran 2008 and later 13194 13195 _Class_: 13196 Transformational function 13197 13198 _Syntax_: 13199 'RESULT = IANY(ARRAY[, MASK])' 13200 'RESULT = IANY(ARRAY, DIM[, MASK])' 13201 13202 _Arguments_: 13203 ARRAY Shall be an array of type 'INTEGER' 13204 DIM (Optional) shall be a scalar of type 'INTEGER' 13205 with a value in the range from 1 to n, where n 13206 equals the rank of ARRAY. 13207 MASK (Optional) shall be of type 'LOGICAL' and either 13208 be a scalar or an array of the same shape as 13209 ARRAY. 13210 13211 _Return value_: 13212 The result is of the same type as ARRAY. 13213 13214 If DIM is absent, a scalar with the bitwise OR of all elements in 13215 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 13216 the rank of ARRAY, and a shape similar to that of ARRAY with 13217 dimension DIM dropped is returned. 13218 13219 _Example_: 13220 PROGRAM test_iany 13221 INTEGER(1) :: a(2) 13222 13223 a(1) = b'00100100' 13224 a(2) = b'01101010' 13225 13226 ! prints 01101110 13227 PRINT '(b8.8)', IANY(a) 13228 END PROGRAM 13229 13230 _See also_: 13231 *note IPARITY::, *note IALL::, *note IOR:: 13232 13233 13234 File: gfortran.info, Node: IARGC, Next: IBCLR, Prev: IANY, Up: Intrinsic Procedures 13235 13236 8.139 'IARGC' -- Get the number of command line arguments 13237 ========================================================= 13238 13239 _Description_: 13240 'IARGC' returns the number of arguments passed on the command line 13241 when the containing program was invoked. 13242 13243 This intrinsic routine is provided for backwards compatibility with 13244 GNU Fortran 77. In new code, programmers should consider the use 13245 of the *note COMMAND_ARGUMENT_COUNT:: intrinsic defined by the 13246 Fortran 2003 standard. 13247 13248 _Standard_: 13249 GNU extension 13250 13251 _Class_: 13252 Function 13253 13254 _Syntax_: 13255 'RESULT = IARGC()' 13256 13257 _Arguments_: 13258 None 13259 13260 _Return value_: 13261 The number of command line arguments, type 'INTEGER(4)'. 13262 13263 _Example_: 13264 See *note GETARG:: 13265 13266 _See also_: 13267 GNU Fortran 77 compatibility subroutine: *note GETARG:: Fortran 13268 2003 functions and subroutines: *note GET_COMMAND::, *note 13269 GET_COMMAND_ARGUMENT::, *note COMMAND_ARGUMENT_COUNT:: 13270 13271 13272 File: gfortran.info, Node: IBCLR, Next: IBITS, Prev: IARGC, Up: Intrinsic Procedures 13273 13274 8.140 'IBCLR' -- Clear bit 13275 ========================== 13276 13277 _Description_: 13278 'IBCLR' returns the value of I with the bit at position POS set to 13279 zero. 13280 13281 _Standard_: 13282 Fortran 90 and later, has overloads that are GNU extensions 13283 13284 _Class_: 13285 Elemental function 13286 13287 _Syntax_: 13288 'RESULT = IBCLR(I, POS)' 13289 13290 _Arguments_: 13291 I The type shall be 'INTEGER'. 13292 POS The type shall be 'INTEGER'. 13293 13294 _Return value_: 13295 The return value is of type 'INTEGER' and of the same kind as I. 13296 13297 _Specific names_: 13298 Name Argument Return type Standard 13299 ------------------------------------------------------------------------- 13300 'IBCLR(A)' 'INTEGER A' 'INTEGER' Fortran 90 and later 13301 'BBCLR(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 13302 'IIBCLR(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 13303 'JIBCLR(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 13304 'KIBCLR(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 13305 13306 _See also_: 13307 *note IBITS::, *note IBSET::, *note IAND::, *note IOR::, *note 13308 IEOR::, *note MVBITS:: 13309 13310 13311 File: gfortran.info, Node: IBITS, Next: IBSET, Prev: IBCLR, Up: Intrinsic Procedures 13312 13313 8.141 'IBITS' -- Bit extraction 13314 =============================== 13315 13316 _Description_: 13317 'IBITS' extracts a field of length LEN from I, starting from bit 13318 position POS and extending left for LEN bits. The result is 13319 right-justified and the remaining bits are zeroed. The value of 13320 'POS+LEN' must be less than or equal to the value 'BIT_SIZE(I)'. 13321 13322 _Standard_: 13323 Fortran 90 and later, has overloads that are GNU extensions 13324 13325 _Class_: 13326 Elemental function 13327 13328 _Syntax_: 13329 'RESULT = IBITS(I, POS, LEN)' 13330 13331 _Arguments_: 13332 I The type shall be 'INTEGER'. 13333 POS The type shall be 'INTEGER'. 13334 LEN The type shall be 'INTEGER'. 13335 13336 _Return value_: 13337 The return value is of type 'INTEGER' and of the same kind as I. 13338 13339 _Specific names_: 13340 Name Argument Return type Standard 13341 ------------------------------------------------------------------------- 13342 'IBITS(A)' 'INTEGER A' 'INTEGER' Fortran 90 and later 13343 'BBITS(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 13344 'IIBITS(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 13345 'JIBITS(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 13346 'KIBITS(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 13347 13348 _See also_: 13349 *note BIT_SIZE::, *note IBCLR::, *note IBSET::, *note IAND::, *note 13350 IOR::, *note IEOR:: 13351 13352 13353 File: gfortran.info, Node: IBSET, Next: ICHAR, Prev: IBITS, Up: Intrinsic Procedures 13354 13355 8.142 'IBSET' -- Set bit 13356 ======================== 13357 13358 _Description_: 13359 'IBSET' returns the value of I with the bit at position POS set to 13360 one. 13361 13362 _Standard_: 13363 Fortran 90 and later, has overloads that are GNU extensions 13364 13365 _Class_: 13366 Elemental function 13367 13368 _Syntax_: 13369 'RESULT = IBSET(I, POS)' 13370 13371 _Arguments_: 13372 I The type shall be 'INTEGER'. 13373 POS The type shall be 'INTEGER'. 13374 13375 _Return value_: 13376 The return value is of type 'INTEGER' and of the same kind as I. 13377 13378 _Specific names_: 13379 Name Argument Return type Standard 13380 ------------------------------------------------------------------------- 13381 'IBSET(A)' 'INTEGER A' 'INTEGER' Fortran 90 and later 13382 'BBSET(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 13383 'IIBSET(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 13384 'JIBSET(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 13385 'KIBSET(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 13386 13387 _See also_: 13388 *note IBCLR::, *note IBITS::, *note IAND::, *note IOR::, *note 13389 IEOR::, *note MVBITS:: 13390 13391 13392 File: gfortran.info, Node: ICHAR, Next: IDATE, Prev: IBSET, Up: Intrinsic Procedures 13393 13394 8.143 'ICHAR' -- Character-to-integer conversion function 13395 ========================================================= 13396 13397 _Description_: 13398 'ICHAR(C)' returns the code for the character in the first 13399 character position of 'C' in the system's native character set. 13400 The correspondence between characters and their codes is not 13401 necessarily the same across different GNU Fortran implementations. 13402 13403 _Standard_: 13404 Fortran 77 and later, with KIND argument Fortran 2003 and later 13405 13406 _Class_: 13407 Elemental function 13408 13409 _Syntax_: 13410 'RESULT = ICHAR(C [, KIND])' 13411 13412 _Arguments_: 13413 C Shall be a scalar 'CHARACTER', with 'INTENT(IN)' 13414 KIND (Optional) An 'INTEGER' initialization 13415 expression indicating the kind parameter of the 13416 result. 13417 13418 _Return value_: 13419 The return value is of type 'INTEGER' and of kind KIND. If KIND is 13420 absent, the return value is of default integer kind. 13421 13422 _Example_: 13423 program test_ichar 13424 integer i 13425 i = ichar(' ') 13426 end program test_ichar 13427 13428 _Specific names_: 13429 Name Argument Return type Standard 13430 ------------------------------------------------------------------------- 13431 'ICHAR(C)' 'CHARACTER C' 'INTEGER(4)' Fortran 77 and later 13432 13433 _Note_: 13434 No intrinsic exists to convert between a numeric value and a 13435 formatted character string representation - for instance, given the 13436 'CHARACTER' value ''154'', obtaining an 'INTEGER' or 'REAL' value 13437 with the value 154, or vice versa. Instead, this functionality is 13438 provided by internal-file I/O, as in the following example: 13439 program read_val 13440 integer value 13441 character(len=10) string, string2 13442 string = '154' 13443 13444 ! Convert a string to a numeric value 13445 read (string,'(I10)') value 13446 print *, value 13447 13448 ! Convert a value to a formatted string 13449 write (string2,'(I10)') value 13450 print *, string2 13451 end program read_val 13452 13453 _See also_: 13454 *note ACHAR::, *note CHAR::, *note IACHAR:: 13455 13456 13457 File: gfortran.info, Node: IDATE, Next: IEOR, Prev: ICHAR, Up: Intrinsic Procedures 13458 13459 8.144 'IDATE' -- Get current local time subroutine (day/month/year) 13460 =================================================================== 13461 13462 _Description_: 13463 'IDATE(VALUES)' Fills VALUES with the numerical values at the 13464 current local time. The day (in the range 1-31), month (in the 13465 range 1-12), and year appear in elements 1, 2, and 3 of VALUES, 13466 respectively. The year has four significant digits. 13467 13468 This intrinsic routine is provided for backwards compatibility with 13469 GNU Fortran 77. In new code, programmers should consider the use 13470 of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95 13471 standard. 13472 13473 _Standard_: 13474 GNU extension 13475 13476 _Class_: 13477 Subroutine 13478 13479 _Syntax_: 13480 'CALL IDATE(VALUES)' 13481 13482 _Arguments_: 13483 VALUES The type shall be 'INTEGER, DIMENSION(3)' and 13484 the kind shall be the default integer kind. 13485 13486 _Return value_: 13487 Does not return anything. 13488 13489 _Example_: 13490 program test_idate 13491 integer, dimension(3) :: tarray 13492 call idate(tarray) 13493 print *, tarray(1) 13494 print *, tarray(2) 13495 print *, tarray(3) 13496 end program test_idate 13497 13498 _See also_: 13499 *note DATE_AND_TIME:: 13500 13501 13502 File: gfortran.info, Node: IEOR, Next: IERRNO, Prev: IDATE, Up: Intrinsic Procedures 13503 13504 8.145 'IEOR' -- Bitwise logical exclusive or 13505 ============================================ 13506 13507 _Description_: 13508 'IEOR' returns the bitwise Boolean exclusive-OR of I and J. 13509 13510 _Standard_: 13511 Fortran 90 and later, with boz-literal-constant Fortran 2008 and 13512 later, has overloads that are GNU extensions 13513 13514 _Class_: 13515 Elemental function 13516 13517 _Syntax_: 13518 'RESULT = IEOR(I, J)' 13519 13520 _Arguments_: 13521 I The type shall be 'INTEGER' or a 13522 boz-literal-constant. 13523 J The type shall be 'INTEGER' with the same kind 13524 type parameter as I or a boz-literal-constant. 13525 I and J shall not both be boz-literal-constants. 13526 13527 _Return value_: 13528 The return type is 'INTEGER' with the kind type parameter of the 13529 arguments. A boz-literal-constant is converted to an 'INTEGER' 13530 with the kind type parameter of the other argument as-if a call to 13531 *note INT:: occurred. 13532 13533 _Specific names_: 13534 Name Argument Return type Standard 13535 ------------------------------------------------------------------------- 13536 'IEOR(A)' 'INTEGER A' 'INTEGER' Fortran 90 and later 13537 'BIEOR(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 13538 'IIEOR(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 13539 'JIEOR(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 13540 'KIEOR(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 13541 13542 _See also_: 13543 *note IOR::, *note IAND::, *note IBITS::, *note IBSET::, *note 13544 IBCLR::, *note NOT:: 13545 13546 13547 File: gfortran.info, Node: IERRNO, Next: IMAGE_INDEX, Prev: IEOR, Up: Intrinsic Procedures 13548 13549 8.146 'IERRNO' -- Get the last system error number 13550 ================================================== 13551 13552 _Description_: 13553 Returns the last system error number, as given by the C 'errno' 13554 variable. 13555 13556 _Standard_: 13557 GNU extension 13558 13559 _Class_: 13560 Function 13561 13562 _Syntax_: 13563 'RESULT = IERRNO()' 13564 13565 _Arguments_: 13566 None 13567 13568 _Return value_: 13569 The return value is of type 'INTEGER' and of the default integer 13570 kind. 13571 13572 _See also_: 13573 *note PERROR:: 13574 13575 13576 File: gfortran.info, Node: IMAGE_INDEX, Next: INDEX intrinsic, Prev: IERRNO, Up: Intrinsic Procedures 13577 13578 8.147 'IMAGE_INDEX' -- Function that converts a cosubscript to an image index 13579 ============================================================================= 13580 13581 _Description_: 13582 Returns the image index belonging to a cosubscript. 13583 13584 _Standard_: 13585 Fortran 2008 and later 13586 13587 _Class_: 13588 Inquiry function. 13589 13590 _Syntax_: 13591 'RESULT = IMAGE_INDEX(COARRAY, SUB)' 13592 13593 _Arguments_: 13594 COARRAY Coarray of any type. 13595 SUB default integer rank-1 array of a size equal to 13596 the corank of COARRAY. 13597 13598 _Return value_: 13599 Scalar default integer with the value of the image index which 13600 corresponds to the cosubscripts. For invalid cosubscripts the 13601 result is zero. 13602 13603 _Example_: 13604 INTEGER :: array[2,-1:4,8,*] 13605 ! Writes 28 (or 0 if there are fewer than 28 images) 13606 WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1]) 13607 13608 _See also_: 13609 *note THIS_IMAGE::, *note NUM_IMAGES:: 13610 13611 13612 File: gfortran.info, Node: INDEX intrinsic, Next: INT, Prev: IMAGE_INDEX, Up: Intrinsic Procedures 13613 13614 8.148 'INDEX' -- Position of a substring within a string 13615 ======================================================== 13616 13617 _Description_: 13618 Returns the position of the start of the first occurrence of string 13619 SUBSTRING as a substring in STRING, counting from one. If 13620 SUBSTRING is not present in STRING, zero is returned. If the BACK 13621 argument is present and true, the return value is the start of the 13622 last occurrence rather than the first. 13623 13624 _Standard_: 13625 Fortran 77 and later, with KIND argument Fortran 2003 and later 13626 13627 _Class_: 13628 Elemental function 13629 13630 _Syntax_: 13631 'RESULT = INDEX(STRING, SUBSTRING [, BACK [, KIND]])' 13632 13633 _Arguments_: 13634 STRING Shall be a scalar 'CHARACTER', with 'INTENT(IN)' 13635 SUBSTRING Shall be a scalar 'CHARACTER', with 'INTENT(IN)' 13636 BACK (Optional) Shall be a scalar 'LOGICAL', with 13637 'INTENT(IN)' 13638 KIND (Optional) An 'INTEGER' initialization 13639 expression indicating the kind parameter of the 13640 result. 13641 13642 _Return value_: 13643 The return value is of type 'INTEGER' and of kind KIND. If KIND is 13644 absent, the return value is of default integer kind. 13645 13646 _Specific names_: 13647 Name Argument Return Standard 13648 type 13649 -------------------------------------------------------------------------- 13650 'INDEX(STRING,SUBSTRING)' 'CHARACTER' 'INTEGER(4)' Fortran 77 and later 13651 13652 _See also_: 13653 *note SCAN::, *note VERIFY:: 13654 13655 13656 File: gfortran.info, Node: INT, Next: INT2, Prev: INDEX intrinsic, Up: Intrinsic Procedures 13657 13658 8.149 'INT' -- Convert to integer type 13659 ====================================== 13660 13661 _Description_: 13662 Convert to integer type 13663 13664 _Standard_: 13665 Fortran 77 and later, with boz-literal-constant Fortran 2008 and 13666 later. 13667 13668 _Class_: 13669 Elemental function 13670 13671 _Syntax_: 13672 'RESULT = INT(A [, KIND))' 13673 13674 _Arguments_: 13675 A Shall be of type 'INTEGER', 'REAL', or 'COMPLEX' 13676 or a boz-literal-constant. 13677 KIND (Optional) An 'INTEGER' initialization 13678 expression indicating the kind parameter of the 13679 result. 13680 13681 _Return value_: 13682 These functions return a 'INTEGER' variable or array under the 13683 following rules: 13684 13685 (A) 13686 If A is of type 'INTEGER', 'INT(A) = A' 13687 (B) 13688 If A is of type 'REAL' and |A| < 1, 'INT(A)' equals '0'. If 13689 |A| \geq 1, then 'INT(A)' is the integer whose magnitude is 13690 the largest integer that does not exceed the magnitude of A 13691 and whose sign is the same as the sign of A. 13692 (C) 13693 If A is of type 'COMPLEX', rule B is applied to the real part 13694 of A. 13695 13696 _Example_: 13697 program test_int 13698 integer :: i = 42 13699 complex :: z = (-3.7, 1.0) 13700 print *, int(i) 13701 print *, int(z), int(z,8) 13702 end program 13703 13704 _Specific names_: 13705 Name Argument Return type Standard 13706 ------------------------------------------------------------------------- 13707 'INT(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and later 13708 'IFIX(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and later 13709 'IDINT(A)' 'REAL(8) A' 'INTEGER' Fortran 77 and later 13710 13711 13712 File: gfortran.info, Node: INT2, Next: INT8, Prev: INT, Up: Intrinsic Procedures 13713 13714 8.150 'INT2' -- Convert to 16-bit integer type 13715 ============================================== 13716 13717 _Description_: 13718 Convert to a 'KIND=2' integer type. This is equivalent to the 13719 standard 'INT' intrinsic with an optional argument of 'KIND=2', and 13720 is only included for backwards compatibility. 13721 13722 _Standard_: 13723 GNU extension 13724 13725 _Class_: 13726 Elemental function 13727 13728 _Syntax_: 13729 'RESULT = INT2(A)' 13730 13731 _Arguments_: 13732 A Shall be of type 'INTEGER', 'REAL', or 13733 'COMPLEX'. 13734 13735 _Return value_: 13736 The return value is a 'INTEGER(2)' variable. 13737 13738 _See also_: 13739 *note INT::, *note INT8:: 13740 13741 13742 File: gfortran.info, Node: INT8, Next: IOR, Prev: INT2, Up: Intrinsic Procedures 13743 13744 8.151 'INT8' -- Convert to 64-bit integer type 13745 ============================================== 13746 13747 _Description_: 13748 Convert to a 'KIND=8' integer type. This is equivalent to the 13749 standard 'INT' intrinsic with an optional argument of 'KIND=8', and 13750 is only included for backwards compatibility. 13751 13752 _Standard_: 13753 GNU extension 13754 13755 _Class_: 13756 Elemental function 13757 13758 _Syntax_: 13759 'RESULT = INT8(A)' 13760 13761 _Arguments_: 13762 A Shall be of type 'INTEGER', 'REAL', or 13763 'COMPLEX'. 13764 13765 _Return value_: 13766 The return value is a 'INTEGER(8)' variable. 13767 13768 _See also_: 13769 *note INT::, *note INT2:: 13770 13771 13772 File: gfortran.info, Node: IOR, Next: IPARITY, Prev: INT8, Up: Intrinsic Procedures 13773 13774 8.152 'IOR' -- Bitwise logical or 13775 ================================= 13776 13777 _Description_: 13778 'IOR' returns the bitwise Boolean inclusive-OR of I and J. 13779 13780 _Standard_: 13781 Fortran 90 and later, with boz-literal-constant Fortran 2008 and 13782 later, has overloads that are GNU extensions 13783 13784 _Class_: 13785 Elemental function 13786 13787 _Syntax_: 13788 'RESULT = IOR(I, J)' 13789 13790 _Arguments_: 13791 I The type shall be 'INTEGER' or a 13792 boz-literal-constant. 13793 J The type shall be 'INTEGER' with the same kind 13794 type parameter as I or a boz-literal-constant. 13795 I and J shall not both be boz-literal-constants. 13796 13797 _Return value_: 13798 The return type is 'INTEGER' with the kind type parameter of the 13799 arguments. A boz-literal-constant is converted to an 'INTEGER' 13800 with the kind type parameter of the other argument as-if a call to 13801 *note INT:: occurred. 13802 13803 _Specific names_: 13804 Name Argument Return type Standard 13805 ------------------------------------------------------------------------- 13806 'IOR(A)' 'INTEGER A' 'INTEGER' Fortran 90 and later 13807 'BIOR(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 13808 'IIOR(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 13809 'JIOR(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 13810 'KIOR(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 13811 13812 _See also_: 13813 *note IEOR::, *note IAND::, *note IBITS::, *note IBSET::, *note 13814 IBCLR::, *note NOT:: 13815 13816 13817 File: gfortran.info, Node: IPARITY, Next: IRAND, Prev: IOR, Up: Intrinsic Procedures 13818 13819 8.153 'IPARITY' -- Bitwise XOR of array elements 13820 ================================================ 13821 13822 _Description_: 13823 Reduces with bitwise XOR (exclusive or) the elements of ARRAY along 13824 dimension DIM if the corresponding element in MASK is 'TRUE'. 13825 13826 _Standard_: 13827 Fortran 2008 and later 13828 13829 _Class_: 13830 Transformational function 13831 13832 _Syntax_: 13833 'RESULT = IPARITY(ARRAY[, MASK])' 13834 'RESULT = IPARITY(ARRAY, DIM[, MASK])' 13835 13836 _Arguments_: 13837 ARRAY Shall be an array of type 'INTEGER' 13838 DIM (Optional) shall be a scalar of type 'INTEGER' 13839 with a value in the range from 1 to n, where n 13840 equals the rank of ARRAY. 13841 MASK (Optional) shall be of type 'LOGICAL' and either 13842 be a scalar or an array of the same shape as 13843 ARRAY. 13844 13845 _Return value_: 13846 The result is of the same type as ARRAY. 13847 13848 If DIM is absent, a scalar with the bitwise XOR of all elements in 13849 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 13850 the rank of ARRAY, and a shape similar to that of ARRAY with 13851 dimension DIM dropped is returned. 13852 13853 _Example_: 13854 PROGRAM test_iparity 13855 INTEGER(1) :: a(2) 13856 13857 a(1) = int(b'00100100', 1) 13858 a(2) = int(b'01101010', 1) 13859 13860 ! prints 01001110 13861 PRINT '(b8.8)', IPARITY(a) 13862 END PROGRAM 13863 13864 _See also_: 13865 *note IANY::, *note IALL::, *note IEOR::, *note PARITY:: 13866 13867 13868 File: gfortran.info, Node: IRAND, Next: IS_CONTIGUOUS, Prev: IPARITY, Up: Intrinsic Procedures 13869 13870 8.154 'IRAND' -- Integer pseudo-random number 13871 ============================================= 13872 13873 _Description_: 13874 'IRAND(FLAG)' returns a pseudo-random number from a uniform 13875 distribution between 0 and a system-dependent limit (which is in 13876 most cases 2147483647). If FLAG is 0, the next number in the 13877 current sequence is returned; if FLAG is 1, the generator is 13878 restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is 13879 used as a new seed with 'SRAND'. 13880 13881 This intrinsic routine is provided for backwards compatibility with 13882 GNU Fortran 77. It implements a simple modulo generator as 13883 provided by 'g77'. For new code, one should consider the use of 13884 *note RANDOM_NUMBER:: as it implements a superior algorithm. 13885 13886 _Standard_: 13887 GNU extension 13888 13889 _Class_: 13890 Function 13891 13892 _Syntax_: 13893 'RESULT = IRAND(I)' 13894 13895 _Arguments_: 13896 I Shall be a scalar 'INTEGER' of kind 4. 13897 13898 _Return value_: 13899 The return value is of 'INTEGER(kind=4)' type. 13900 13901 _Example_: 13902 program test_irand 13903 integer,parameter :: seed = 86456 13904 13905 call srand(seed) 13906 print *, irand(), irand(), irand(), irand() 13907 print *, irand(seed), irand(), irand(), irand() 13908 end program test_irand 13909 13910 13911 File: gfortran.info, Node: IS_CONTIGUOUS, Next: IS_IOSTAT_END, Prev: IRAND, Up: Intrinsic Procedures 13912 13913 8.155 'IS_CONTIGUOUS' -- Test whether an array is contiguous 13914 ============================================================ 13915 13916 _Description_: 13917 'IS_CONTIGUOUS' tests whether an array is contiguous. 13918 13919 _Standard_: 13920 Fortran 2008 and later 13921 13922 _Class_: 13923 Inquiry function 13924 13925 _Syntax_: 13926 'RESULT = IS_CONTIGUOUS(ARRAY)' 13927 13928 _Arguments_: 13929 ARRAY Shall be an array of any type. 13930 13931 _Return value_: 13932 Returns a 'LOGICAL' of the default kind, which '.TRUE.' if ARRAY is 13933 contiguous and false otherwise. 13934 13935 _Example_: 13936 program test 13937 integer :: a(10) 13938 a = [1,2,3,4,5,6,7,8,9,10] 13939 call sub (a) ! every element, is contiguous 13940 call sub (a(::2)) ! every other element, is noncontiguous 13941 contains 13942 subroutine sub (x) 13943 integer :: x(:) 13944 if (is_contiguous (x)) then 13945 write (*,*) 'X is contiguous' 13946 else 13947 write (*,*) 'X is not contiguous' 13948 end if 13949 end subroutine sub 13950 end program test 13951 13952 13953 File: gfortran.info, Node: IS_IOSTAT_END, Next: IS_IOSTAT_EOR, Prev: IS_CONTIGUOUS, Up: Intrinsic Procedures 13954 13955 8.156 'IS_IOSTAT_END' -- Test for end-of-file value 13956 =================================================== 13957 13958 _Description_: 13959 'IS_IOSTAT_END' tests whether an variable has the value of the I/O 13960 status "end of file". The function is equivalent to comparing the 13961 variable with the 'IOSTAT_END' parameter of the intrinsic module 13962 'ISO_FORTRAN_ENV'. 13963 13964 _Standard_: 13965 Fortran 2003 and later 13966 13967 _Class_: 13968 Elemental function 13969 13970 _Syntax_: 13971 'RESULT = IS_IOSTAT_END(I)' 13972 13973 _Arguments_: 13974 I Shall be of the type 'INTEGER'. 13975 13976 _Return value_: 13977 Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has 13978 the value which indicates an end of file condition for 'IOSTAT=' 13979 specifiers, and is '.FALSE.' otherwise. 13980 13981 _Example_: 13982 PROGRAM iostat 13983 IMPLICIT NONE 13984 INTEGER :: stat, i 13985 OPEN(88, FILE='test.dat') 13986 READ(88, *, IOSTAT=stat) i 13987 IF(IS_IOSTAT_END(stat)) STOP 'END OF FILE' 13988 END PROGRAM 13989 13990 13991 File: gfortran.info, Node: IS_IOSTAT_EOR, Next: ISATTY, Prev: IS_IOSTAT_END, Up: Intrinsic Procedures 13992 13993 8.157 'IS_IOSTAT_EOR' -- Test for end-of-record value 13994 ===================================================== 13995 13996 _Description_: 13997 'IS_IOSTAT_EOR' tests whether an variable has the value of the I/O 13998 status "end of record". The function is equivalent to comparing 13999 the variable with the 'IOSTAT_EOR' parameter of the intrinsic 14000 module 'ISO_FORTRAN_ENV'. 14001 14002 _Standard_: 14003 Fortran 2003 and later 14004 14005 _Class_: 14006 Elemental function 14007 14008 _Syntax_: 14009 'RESULT = IS_IOSTAT_EOR(I)' 14010 14011 _Arguments_: 14012 I Shall be of the type 'INTEGER'. 14013 14014 _Return value_: 14015 Returns a 'LOGICAL' of the default kind, which '.TRUE.' if I has 14016 the value which indicates an end of file condition for 'IOSTAT=' 14017 specifiers, and is '.FALSE.' otherwise. 14018 14019 _Example_: 14020 PROGRAM iostat 14021 IMPLICIT NONE 14022 INTEGER :: stat, i(50) 14023 OPEN(88, FILE='test.dat', FORM='UNFORMATTED') 14024 READ(88, IOSTAT=stat) i 14025 IF(IS_IOSTAT_EOR(stat)) STOP 'END OF RECORD' 14026 END PROGRAM 14027 14028 14029 File: gfortran.info, Node: ISATTY, Next: ISHFT, Prev: IS_IOSTAT_EOR, Up: Intrinsic Procedures 14030 14031 8.158 'ISATTY' -- Whether a unit is a terminal device. 14032 ====================================================== 14033 14034 _Description_: 14035 Determine whether a unit is connected to a terminal device. 14036 14037 _Standard_: 14038 GNU extension 14039 14040 _Class_: 14041 Function 14042 14043 _Syntax_: 14044 'RESULT = ISATTY(UNIT)' 14045 14046 _Arguments_: 14047 UNIT Shall be a scalar 'INTEGER'. 14048 14049 _Return value_: 14050 Returns '.TRUE.' if the UNIT is connected to a terminal device, 14051 '.FALSE.' otherwise. 14052 14053 _Example_: 14054 PROGRAM test_isatty 14055 INTEGER(kind=1) :: unit 14056 DO unit = 1, 10 14057 write(*,*) isatty(unit=unit) 14058 END DO 14059 END PROGRAM 14060 _See also_: 14061 *note TTYNAM:: 14062 14063 14064 File: gfortran.info, Node: ISHFT, Next: ISHFTC, Prev: ISATTY, Up: Intrinsic Procedures 14065 14066 8.159 'ISHFT' -- Shift bits 14067 =========================== 14068 14069 _Description_: 14070 'ISHFT' returns a value corresponding to I with all of the bits 14071 shifted SHIFT places. A value of SHIFT greater than zero 14072 corresponds to a left shift, a value of zero corresponds to no 14073 shift, and a value less than zero corresponds to a right shift. If 14074 the absolute value of SHIFT is greater than 'BIT_SIZE(I)', the 14075 value is undefined. Bits shifted out from the left end or right 14076 end are lost; zeros are shifted in from the opposite end. 14077 14078 _Standard_: 14079 Fortran 90 and later, has overloads that are GNU extensions 14080 14081 _Class_: 14082 Elemental function 14083 14084 _Syntax_: 14085 'RESULT = ISHFT(I, SHIFT)' 14086 14087 _Arguments_: 14088 I The type shall be 'INTEGER'. 14089 SHIFT The type shall be 'INTEGER'. 14090 14091 _Return value_: 14092 The return value is of type 'INTEGER' and of the same kind as I. 14093 14094 _Specific names_: 14095 Name Argument Return type Standard 14096 ------------------------------------------------------------------------- 14097 'ISHFT(A)' 'INTEGER A' 'INTEGER' Fortran 90 and later 14098 'BSHFT(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 14099 'IISHFT(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 14100 'JISHFT(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 14101 'KISHFT(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 14102 14103 _See also_: 14104 *note ISHFTC:: 14105 14106 14107 File: gfortran.info, Node: ISHFTC, Next: ISNAN, Prev: ISHFT, Up: Intrinsic Procedures 14108 14109 8.160 'ISHFTC' -- Shift bits circularly 14110 ======================================= 14111 14112 _Description_: 14113 'ISHFTC' returns a value corresponding to I with the rightmost SIZE 14114 bits shifted circularly SHIFT places; that is, bits shifted out one 14115 end are shifted into the opposite end. A value of SHIFT greater 14116 than zero corresponds to a left shift, a value of zero corresponds 14117 to no shift, and a value less than zero corresponds to a right 14118 shift. The absolute value of SHIFT must be less than SIZE. If the 14119 SIZE argument is omitted, it is taken to be equivalent to 14120 'BIT_SIZE(I)'. 14121 14122 _Standard_: 14123 Fortran 90 and later, has overloads that are GNU extensions 14124 14125 _Class_: 14126 Elemental function 14127 14128 _Syntax_: 14129 'RESULT = ISHFTC(I, SHIFT [, SIZE])' 14130 14131 _Arguments_: 14132 I The type shall be 'INTEGER'. 14133 SHIFT The type shall be 'INTEGER'. 14134 SIZE (Optional) The type shall be 'INTEGER'; the 14135 value must be greater than zero and less than or 14136 equal to 'BIT_SIZE(I)'. 14137 14138 _Return value_: 14139 The return value is of type 'INTEGER' and of the same kind as I. 14140 14141 _Specific names_: 14142 Name Argument Return type Standard 14143 ------------------------------------------------------------------------- 14144 'ISHFTC(A)' 'INTEGER A' 'INTEGER' Fortran 90 and later 14145 'BSHFTC(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 14146 'IISHFTC(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 14147 'JISHFTC(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 14148 'KISHFTC(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 14149 14150 _See also_: 14151 *note ISHFT:: 14152 14153 14154 File: gfortran.info, Node: ISNAN, Next: ITIME, Prev: ISHFTC, Up: Intrinsic Procedures 14155 14156 8.161 'ISNAN' -- Test for a NaN 14157 =============================== 14158 14159 _Description_: 14160 'ISNAN' tests whether a floating-point value is an IEEE 14161 Not-a-Number (NaN). 14162 _Standard_: 14163 GNU extension 14164 14165 _Class_: 14166 Elemental function 14167 14168 _Syntax_: 14169 'ISNAN(X)' 14170 14171 _Arguments_: 14172 X Variable of the type 'REAL'. 14173 14174 14175 _Return value_: 14176 Returns a default-kind 'LOGICAL'. The returned value is 'TRUE' if 14177 X is a NaN and 'FALSE' otherwise. 14178 14179 _Example_: 14180 program test_nan 14181 implicit none 14182 real :: x 14183 x = -1.0 14184 x = sqrt(x) 14185 if (isnan(x)) stop '"x" is a NaN' 14186 end program test_nan 14187 14188 14189 File: gfortran.info, Node: ITIME, Next: KILL, Prev: ISNAN, Up: Intrinsic Procedures 14190 14191 8.162 'ITIME' -- Get current local time subroutine (hour/minutes/seconds) 14192 ========================================================================= 14193 14194 _Description_: 14195 'ITIME(VALUES)' Fills VALUES with the numerical values at the 14196 current local time. The hour (in the range 1-24), minute (in the 14197 range 1-60), and seconds (in the range 1-60) appear in elements 1, 14198 2, and 3 of VALUES, respectively. 14199 14200 This intrinsic routine is provided for backwards compatibility with 14201 GNU Fortran 77. In new code, programmers should consider the use 14202 of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95 14203 standard. 14204 14205 _Standard_: 14206 GNU extension 14207 14208 _Class_: 14209 Subroutine 14210 14211 _Syntax_: 14212 'CALL ITIME(VALUES)' 14213 14214 _Arguments_: 14215 VALUES The type shall be 'INTEGER, DIMENSION(3)' and 14216 the kind shall be the default integer kind. 14217 14218 _Return value_: 14219 Does not return anything. 14220 14221 _Example_: 14222 program test_itime 14223 integer, dimension(3) :: tarray 14224 call itime(tarray) 14225 print *, tarray(1) 14226 print *, tarray(2) 14227 print *, tarray(3) 14228 end program test_itime 14229 14230 _See also_: 14231 *note DATE_AND_TIME:: 14232 14233 14234 File: gfortran.info, Node: KILL, Next: KIND, Prev: ITIME, Up: Intrinsic Procedures 14235 14236 8.163 'KILL' -- Send a signal to a process 14237 ========================================== 14238 14239 _Description_: 14240 Sends the signal specified by SIG to the process PID. See 14241 'kill(2)'. 14242 14243 This intrinsic is provided in both subroutine and function forms; 14244 however, only one form can be used in any given program unit. 14245 _Standard_: 14246 GNU extension 14247 14248 _Standard_: 14249 GNU extension 14250 14251 _Class_: 14252 Subroutine, function 14253 14254 _Syntax_: 14255 'CALL KILL(PID, SIG [, STATUS])' 14256 'STATUS = KILL(PID, SIG)' 14257 14258 _Arguments_: 14259 PID Shall be a scalar 'INTEGER' with 'INTENT(IN)'. 14260 SIG Shall be a scalar 'INTEGER' with 'INTENT(IN)'. 14261 STATUS [Subroutine](Optional) Shall be a scalar 14262 'INTEGER'. Returns 0 on success; otherwise a 14263 system-specific error code is returned. 14264 STATUS [Function] The kind type parameter is that of 14265 'pid'. Returns 0 on success; otherwise a 14266 system-specific error code is returned. 14267 14268 _See also_: 14269 *note ABORT::, *note EXIT:: 14270 14271 14272 File: gfortran.info, Node: KIND, Next: LBOUND, Prev: KILL, Up: Intrinsic Procedures 14273 14274 8.164 'KIND' -- Kind of an entity 14275 ================================= 14276 14277 _Description_: 14278 'KIND(X)' returns the kind value of the entity X. 14279 14280 _Standard_: 14281 Fortran 95 and later 14282 14283 _Class_: 14284 Inquiry function 14285 14286 _Syntax_: 14287 'K = KIND(X)' 14288 14289 _Arguments_: 14290 X Shall be of type 'LOGICAL', 'INTEGER', 'REAL', 14291 'COMPLEX' or 'CHARACTER'. It may be scalar or 14292 array valued. 14293 14294 _Return value_: 14295 The return value is a scalar of type 'INTEGER' and of the default 14296 integer kind. 14297 14298 _Example_: 14299 program test_kind 14300 integer,parameter :: kc = kind(' ') 14301 integer,parameter :: kl = kind(.true.) 14302 14303 print *, "The default character kind is ", kc 14304 print *, "The default logical kind is ", kl 14305 end program test_kind 14306 14307 14308 File: gfortran.info, Node: LBOUND, Next: LCOBOUND, Prev: KIND, Up: Intrinsic Procedures 14309 14310 8.165 'LBOUND' -- Lower dimension bounds of an array 14311 ==================================================== 14312 14313 _Description_: 14314 Returns the lower bounds of an array, or a single lower bound along 14315 the DIM dimension. 14316 _Standard_: 14317 Fortran 90 and later, with KIND argument Fortran 2003 and later 14318 14319 _Class_: 14320 Inquiry function 14321 14322 _Syntax_: 14323 'RESULT = LBOUND(ARRAY [, DIM [, KIND]])' 14324 14325 _Arguments_: 14326 ARRAY Shall be an array, of any type. 14327 DIM (Optional) Shall be a scalar 'INTEGER'. 14328 KIND (Optional) An 'INTEGER' initialization 14329 expression indicating the kind parameter of the 14330 result. 14331 14332 _Return value_: 14333 The return value is of type 'INTEGER' and of kind KIND. If KIND is 14334 absent, the return value is of default integer kind. If DIM is 14335 absent, the result is an array of the lower bounds of ARRAY. If 14336 DIM is present, the result is a scalar corresponding to the lower 14337 bound of the array along that dimension. If ARRAY is an expression 14338 rather than a whole array or array structure component, or if it 14339 has a zero extent along the relevant dimension, the lower bound is 14340 taken to be 1. 14341 14342 _See also_: 14343 *note UBOUND::, *note LCOBOUND:: 14344 14345 14346 File: gfortran.info, Node: LCOBOUND, Next: LEADZ, Prev: LBOUND, Up: Intrinsic Procedures 14347 14348 8.166 'LCOBOUND' -- Lower codimension bounds of an array 14349 ======================================================== 14350 14351 _Description_: 14352 Returns the lower bounds of a coarray, or a single lower cobound 14353 along the DIM codimension. 14354 _Standard_: 14355 Fortran 2008 and later 14356 14357 _Class_: 14358 Inquiry function 14359 14360 _Syntax_: 14361 'RESULT = LCOBOUND(COARRAY [, DIM [, KIND]])' 14362 14363 _Arguments_: 14364 ARRAY Shall be an coarray, of any type. 14365 DIM (Optional) Shall be a scalar 'INTEGER'. 14366 KIND (Optional) An 'INTEGER' initialization 14367 expression indicating the kind parameter of the 14368 result. 14369 14370 _Return value_: 14371 The return value is of type 'INTEGER' and of kind KIND. If KIND is 14372 absent, the return value is of default integer kind. If DIM is 14373 absent, the result is an array of the lower cobounds of COARRAY. 14374 If DIM is present, the result is a scalar corresponding to the 14375 lower cobound of the array along that codimension. 14376 14377 _See also_: 14378 *note UCOBOUND::, *note LBOUND:: 14379 14380 14381 File: gfortran.info, Node: LEADZ, Next: LEN, Prev: LCOBOUND, Up: Intrinsic Procedures 14382 14383 8.167 'LEADZ' -- Number of leading zero bits of an integer 14384 ========================================================== 14385 14386 _Description_: 14387 'LEADZ' returns the number of leading zero bits of an integer. 14388 14389 _Standard_: 14390 Fortran 2008 and later 14391 14392 _Class_: 14393 Elemental function 14394 14395 _Syntax_: 14396 'RESULT = LEADZ(I)' 14397 14398 _Arguments_: 14399 I Shall be of type 'INTEGER'. 14400 14401 _Return value_: 14402 The type of the return value is the default 'INTEGER'. If all the 14403 bits of 'I' are zero, the result value is 'BIT_SIZE(I)'. 14404 14405 _Example_: 14406 PROGRAM test_leadz 14407 WRITE (*,*) BIT_SIZE(1) ! prints 32 14408 WRITE (*,*) LEADZ(1) ! prints 31 14409 END PROGRAM 14410 14411 _See also_: 14412 *note BIT_SIZE::, *note TRAILZ::, *note POPCNT::, *note POPPAR:: 14413 14414 14415 File: gfortran.info, Node: LEN, Next: LEN_TRIM, Prev: LEADZ, Up: Intrinsic Procedures 14416 14417 8.168 'LEN' -- Length of a character entity 14418 =========================================== 14419 14420 _Description_: 14421 Returns the length of a character string. If STRING is an array, 14422 the length of an element of STRING is returned. Note that STRING 14423 need not be defined when this intrinsic is invoked, since only the 14424 length, not the content, of STRING is needed. 14425 14426 _Standard_: 14427 Fortran 77 and later, with KIND argument Fortran 2003 and later 14428 14429 _Class_: 14430 Inquiry function 14431 14432 _Syntax_: 14433 'L = LEN(STRING [, KIND])' 14434 14435 _Arguments_: 14436 STRING Shall be a scalar or array of type 'CHARACTER', 14437 with 'INTENT(IN)' 14438 KIND (Optional) An 'INTEGER' initialization 14439 expression indicating the kind parameter of the 14440 result. 14441 14442 _Return value_: 14443 The return value is of type 'INTEGER' and of kind KIND. If KIND is 14444 absent, the return value is of default integer kind. 14445 14446 _Specific names_: 14447 Name Argument Return type Standard 14448 ------------------------------------------------------------------------- 14449 'LEN(STRING)' 'CHARACTER' 'INTEGER' Fortran 77 and later 14450 14451 _See also_: 14452 *note LEN_TRIM::, *note ADJUSTL::, *note ADJUSTR:: 14453 14454 14455 File: gfortran.info, Node: LEN_TRIM, Next: LGE, Prev: LEN, Up: Intrinsic Procedures 14456 14457 8.169 'LEN_TRIM' -- Length of a character entity without trailing blank characters 14458 ================================================================================== 14459 14460 _Description_: 14461 Returns the length of a character string, ignoring any trailing 14462 blanks. 14463 14464 _Standard_: 14465 Fortran 90 and later, with KIND argument Fortran 2003 and later 14466 14467 _Class_: 14468 Elemental function 14469 14470 _Syntax_: 14471 'RESULT = LEN_TRIM(STRING [, KIND])' 14472 14473 _Arguments_: 14474 STRING Shall be a scalar of type 'CHARACTER', with 14475 'INTENT(IN)' 14476 KIND (Optional) An 'INTEGER' initialization 14477 expression indicating the kind parameter of the 14478 result. 14479 14480 _Return value_: 14481 The return value is of type 'INTEGER' and of kind KIND. If KIND is 14482 absent, the return value is of default integer kind. 14483 14484 _See also_: 14485 *note LEN::, *note ADJUSTL::, *note ADJUSTR:: 14486 14487 14488 File: gfortran.info, Node: LGE, Next: LGT, Prev: LEN_TRIM, Up: Intrinsic Procedures 14489 14490 8.170 'LGE' -- Lexical greater than or equal 14491 ============================================ 14492 14493 _Description_: 14494 Determines whether one string is lexically greater than or equal to 14495 another string, where the two strings are interpreted as containing 14496 ASCII character codes. If the String A and String B are not the 14497 same length, the shorter is compared as if spaces were appended to 14498 it to form a value that has the same length as the longer. 14499 14500 In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE', 14501 and 'LLT' differ from the corresponding intrinsic operators '.GE.', 14502 '.GT.', '.LE.', and '.LT.', in that the latter use the processor's 14503 character ordering (which is not ASCII on some targets), whereas 14504 the former always use the ASCII ordering. 14505 14506 _Standard_: 14507 Fortran 77 and later 14508 14509 _Class_: 14510 Elemental function 14511 14512 _Syntax_: 14513 'RESULT = LGE(STRING_A, STRING_B)' 14514 14515 _Arguments_: 14516 STRING_A Shall be of default 'CHARACTER' type. 14517 STRING_B Shall be of default 'CHARACTER' type. 14518 14519 _Return value_: 14520 Returns '.TRUE.' if 'STRING_A >= STRING_B', and '.FALSE.' 14521 otherwise, based on the ASCII ordering. 14522 14523 _Specific names_: 14524 Name Argument Return Standard 14525 type 14526 -------------------------------------------------------------------------- 14527 'LGE(STRING_A,STRING_B)' 'CHARACTER' 'LOGICAL' Fortran 77 and later 14528 14529 _See also_: 14530 *note LGT::, *note LLE::, *note LLT:: 14531 14532 14533 File: gfortran.info, Node: LGT, Next: LINK, Prev: LGE, Up: Intrinsic Procedures 14534 14535 8.171 'LGT' -- Lexical greater than 14536 =================================== 14537 14538 _Description_: 14539 Determines whether one string is lexically greater than another 14540 string, where the two strings are interpreted as containing ASCII 14541 character codes. If the String A and String B are not the same 14542 length, the shorter is compared as if spaces were appended to it to 14543 form a value that has the same length as the longer. 14544 14545 In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE', 14546 and 'LLT' differ from the corresponding intrinsic operators '.GE.', 14547 '.GT.', '.LE.', and '.LT.', in that the latter use the processor's 14548 character ordering (which is not ASCII on some targets), whereas 14549 the former always use the ASCII ordering. 14550 14551 _Standard_: 14552 Fortran 77 and later 14553 14554 _Class_: 14555 Elemental function 14556 14557 _Syntax_: 14558 'RESULT = LGT(STRING_A, STRING_B)' 14559 14560 _Arguments_: 14561 STRING_A Shall be of default 'CHARACTER' type. 14562 STRING_B Shall be of default 'CHARACTER' type. 14563 14564 _Return value_: 14565 Returns '.TRUE.' if 'STRING_A > STRING_B', and '.FALSE.' otherwise, 14566 based on the ASCII ordering. 14567 14568 _Specific names_: 14569 Name Argument Return Standard 14570 type 14571 -------------------------------------------------------------------------- 14572 'LGT(STRING_A,STRING_B)' 'CHARACTER' 'LOGICAL' Fortran 77 and later 14573 14574 _See also_: 14575 *note LGE::, *note LLE::, *note LLT:: 14576 14577 14578 File: gfortran.info, Node: LINK, Next: LLE, Prev: LGT, Up: Intrinsic Procedures 14579 14580 8.172 'LINK' -- Create a hard link 14581 ================================== 14582 14583 _Description_: 14584 Makes a (hard) link from file PATH1 to PATH2. A null character 14585 ('CHAR(0)') can be used to mark the end of the names in PATH1 and 14586 PATH2; otherwise, trailing blanks in the file names are ignored. 14587 If the STATUS argument is supplied, it contains 0 on success or a 14588 nonzero error code upon return; see 'link(2)'. 14589 14590 This intrinsic is provided in both subroutine and function forms; 14591 however, only one form can be used in any given program unit. 14592 14593 _Standard_: 14594 GNU extension 14595 14596 _Class_: 14597 Subroutine, function 14598 14599 _Syntax_: 14600 'CALL LINK(PATH1, PATH2 [, STATUS])' 14601 'STATUS = LINK(PATH1, PATH2)' 14602 14603 _Arguments_: 14604 PATH1 Shall be of default 'CHARACTER' type. 14605 PATH2 Shall be of default 'CHARACTER' type. 14606 STATUS (Optional) Shall be of default 'INTEGER' type. 14607 14608 _See also_: 14609 *note SYMLNK::, *note UNLINK:: 14610 14611 14612 File: gfortran.info, Node: LLE, Next: LLT, Prev: LINK, Up: Intrinsic Procedures 14613 14614 8.173 'LLE' -- Lexical less than or equal 14615 ========================================= 14616 14617 _Description_: 14618 Determines whether one string is lexically less than or equal to 14619 another string, where the two strings are interpreted as containing 14620 ASCII character codes. If the String A and String B are not the 14621 same length, the shorter is compared as if spaces were appended to 14622 it to form a value that has the same length as the longer. 14623 14624 In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE', 14625 and 'LLT' differ from the corresponding intrinsic operators '.GE.', 14626 '.GT.', '.LE.', and '.LT.', in that the latter use the processor's 14627 character ordering (which is not ASCII on some targets), whereas 14628 the former always use the ASCII ordering. 14629 14630 _Standard_: 14631 Fortran 77 and later 14632 14633 _Class_: 14634 Elemental function 14635 14636 _Syntax_: 14637 'RESULT = LLE(STRING_A, STRING_B)' 14638 14639 _Arguments_: 14640 STRING_A Shall be of default 'CHARACTER' type. 14641 STRING_B Shall be of default 'CHARACTER' type. 14642 14643 _Return value_: 14644 Returns '.TRUE.' if 'STRING_A <= STRING_B', and '.FALSE.' 14645 otherwise, based on the ASCII ordering. 14646 14647 _Specific names_: 14648 Name Argument Return Standard 14649 type 14650 -------------------------------------------------------------------------- 14651 'LLE(STRING_A,STRING_B)' 'CHARACTER' 'LOGICAL' Fortran 77 and later 14652 14653 _See also_: 14654 *note LGE::, *note LGT::, *note LLT:: 14655 14656 14657 File: gfortran.info, Node: LLT, Next: LNBLNK, Prev: LLE, Up: Intrinsic Procedures 14658 14659 8.174 'LLT' -- Lexical less than 14660 ================================ 14661 14662 _Description_: 14663 Determines whether one string is lexically less than another 14664 string, where the two strings are interpreted as containing ASCII 14665 character codes. If the String A and String B are not the same 14666 length, the shorter is compared as if spaces were appended to it to 14667 form a value that has the same length as the longer. 14668 14669 In general, the lexical comparison intrinsics 'LGE', 'LGT', 'LLE', 14670 and 'LLT' differ from the corresponding intrinsic operators '.GE.', 14671 '.GT.', '.LE.', and '.LT.', in that the latter use the processor's 14672 character ordering (which is not ASCII on some targets), whereas 14673 the former always use the ASCII ordering. 14674 14675 _Standard_: 14676 Fortran 77 and later 14677 14678 _Class_: 14679 Elemental function 14680 14681 _Syntax_: 14682 'RESULT = LLT(STRING_A, STRING_B)' 14683 14684 _Arguments_: 14685 STRING_A Shall be of default 'CHARACTER' type. 14686 STRING_B Shall be of default 'CHARACTER' type. 14687 14688 _Return value_: 14689 Returns '.TRUE.' if 'STRING_A < STRING_B', and '.FALSE.' otherwise, 14690 based on the ASCII ordering. 14691 14692 _Specific names_: 14693 Name Argument Return Standard 14694 type 14695 -------------------------------------------------------------------------- 14696 'LLT(STRING_A,STRING_B)' 'CHARACTER' 'LOGICAL' Fortran 77 and later 14697 14698 _See also_: 14699 *note LGE::, *note LGT::, *note LLE:: 14700 14701 14702 File: gfortran.info, Node: LNBLNK, Next: LOC, Prev: LLT, Up: Intrinsic Procedures 14703 14704 8.175 'LNBLNK' -- Index of the last non-blank character in a string 14705 =================================================================== 14706 14707 _Description_: 14708 Returns the length of a character string, ignoring any trailing 14709 blanks. This is identical to the standard 'LEN_TRIM' intrinsic, 14710 and is only included for backwards compatibility. 14711 14712 _Standard_: 14713 GNU extension 14714 14715 _Class_: 14716 Elemental function 14717 14718 _Syntax_: 14719 'RESULT = LNBLNK(STRING)' 14720 14721 _Arguments_: 14722 STRING Shall be a scalar of type 'CHARACTER', with 14723 'INTENT(IN)' 14724 14725 _Return value_: 14726 The return value is of 'INTEGER(kind=4)' type. 14727 14728 _See also_: 14729 *note INDEX intrinsic::, *note LEN_TRIM:: 14730 14731 14732 File: gfortran.info, Node: LOC, Next: LOG, Prev: LNBLNK, Up: Intrinsic Procedures 14733 14734 8.176 'LOC' -- Returns the address of a variable 14735 ================================================ 14736 14737 _Description_: 14738 'LOC(X)' returns the address of X as an integer. 14739 14740 _Standard_: 14741 GNU extension 14742 14743 _Class_: 14744 Inquiry function 14745 14746 _Syntax_: 14747 'RESULT = LOC(X)' 14748 14749 _Arguments_: 14750 X Variable of any type. 14751 14752 _Return value_: 14753 The return value is of type 'INTEGER', with a 'KIND' corresponding 14754 to the size (in bytes) of a memory address on the target machine. 14755 14756 _Example_: 14757 program test_loc 14758 integer :: i 14759 real :: r 14760 i = loc(r) 14761 print *, i 14762 end program test_loc 14763 14764 14765 File: gfortran.info, Node: LOG, Next: LOG10, Prev: LOC, Up: Intrinsic Procedures 14766 14767 8.177 'LOG' -- Natural logarithm function 14768 ========================================= 14769 14770 _Description_: 14771 'LOG(X)' computes the natural logarithm of X, i.e. the logarithm 14772 to the base e. 14773 14774 _Standard_: 14775 Fortran 77 and later, has GNU extensions 14776 14777 _Class_: 14778 Elemental function 14779 14780 _Syntax_: 14781 'RESULT = LOG(X)' 14782 14783 _Arguments_: 14784 X The type shall be 'REAL' or 'COMPLEX'. 14785 14786 _Return value_: 14787 The return value is of type 'REAL' or 'COMPLEX'. The kind type 14788 parameter is the same as X. If X is 'COMPLEX', the imaginary part 14789 \omega is in the range -\pi < \omega \leq \pi. 14790 14791 _Example_: 14792 program test_log 14793 real(8) :: x = 2.7182818284590451_8 14794 complex :: z = (1.0, 2.0) 14795 x = log(x) ! will yield (approximately) 1 14796 z = log(z) 14797 end program test_log 14798 14799 _Specific names_: 14800 Name Argument Return type Standard 14801 ------------------------------------------------------------------------- 14802 'ALOG(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 or later 14803 'DLOG(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 or later 14804 'CLOG(X)' 'COMPLEX(4) X' 'COMPLEX(4)' Fortran 77 or later 14805 'ZLOG(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 14806 'CDLOG(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 14807 14808 14809 File: gfortran.info, Node: LOG10, Next: LOG_GAMMA, Prev: LOG, Up: Intrinsic Procedures 14810 14811 8.178 'LOG10' -- Base 10 logarithm function 14812 =========================================== 14813 14814 _Description_: 14815 'LOG10(X)' computes the base 10 logarithm of X. 14816 14817 _Standard_: 14818 Fortran 77 and later 14819 14820 _Class_: 14821 Elemental function 14822 14823 _Syntax_: 14824 'RESULT = LOG10(X)' 14825 14826 _Arguments_: 14827 X The type shall be 'REAL'. 14828 14829 _Return value_: 14830 The return value is of type 'REAL' or 'COMPLEX'. The kind type 14831 parameter is the same as X. 14832 14833 _Example_: 14834 program test_log10 14835 real(8) :: x = 10.0_8 14836 x = log10(x) 14837 end program test_log10 14838 14839 _Specific names_: 14840 Name Argument Return type Standard 14841 ------------------------------------------------------------------------- 14842 'ALOG10(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 14843 'DLOG10(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 14844 14845 14846 File: gfortran.info, Node: LOG_GAMMA, Next: LOGICAL, Prev: LOG10, Up: Intrinsic Procedures 14847 14848 8.179 'LOG_GAMMA' -- Logarithm of the Gamma function 14849 ==================================================== 14850 14851 _Description_: 14852 'LOG_GAMMA(X)' computes the natural logarithm of the absolute value 14853 of the Gamma (\Gamma) function. 14854 14855 _Standard_: 14856 Fortran 2008 and later 14857 14858 _Class_: 14859 Elemental function 14860 14861 _Syntax_: 14862 'X = LOG_GAMMA(X)' 14863 14864 _Arguments_: 14865 X Shall be of type 'REAL' and neither zero nor a 14866 negative integer. 14867 14868 _Return value_: 14869 The return value is of type 'REAL' of the same kind as X. 14870 14871 _Example_: 14872 program test_log_gamma 14873 real :: x = 1.0 14874 x = lgamma(x) ! returns 0.0 14875 end program test_log_gamma 14876 14877 _Specific names_: 14878 Name Argument Return type Standard 14879 ------------------------------------------------------------------------- 14880 'LGAMMA(X)' 'REAL(4) X' 'REAL(4)' GNU extension 14881 'ALGAMA(X)' 'REAL(4) X' 'REAL(4)' GNU extension 14882 'DLGAMA(X)' 'REAL(8) X' 'REAL(8)' GNU extension 14883 14884 _See also_: 14885 Gamma function: *note GAMMA:: 14886 14887 14888 File: gfortran.info, Node: LOGICAL, Next: LSHIFT, Prev: LOG_GAMMA, Up: Intrinsic Procedures 14889 14890 8.180 'LOGICAL' -- Convert to logical type 14891 ========================================== 14892 14893 _Description_: 14894 Converts one kind of 'LOGICAL' variable to another. 14895 14896 _Standard_: 14897 Fortran 90 and later 14898 14899 _Class_: 14900 Elemental function 14901 14902 _Syntax_: 14903 'RESULT = LOGICAL(L [, KIND])' 14904 14905 _Arguments_: 14906 L The type shall be 'LOGICAL'. 14907 KIND (Optional) An 'INTEGER' initialization 14908 expression indicating the kind parameter of the 14909 result. 14910 14911 _Return value_: 14912 The return value is a 'LOGICAL' value equal to L, with a kind 14913 corresponding to KIND, or of the default logical kind if KIND is 14914 not given. 14915 14916 _See also_: 14917 *note INT::, *note REAL::, *note CMPLX:: 14918 14919 14920 File: gfortran.info, Node: LSHIFT, Next: LSTAT, Prev: LOGICAL, Up: Intrinsic Procedures 14921 14922 8.181 'LSHIFT' -- Left shift bits 14923 ================================= 14924 14925 _Description_: 14926 'LSHIFT' returns a value corresponding to I with all of the bits 14927 shifted left by SHIFT places. SHIFT shall be nonnegative and less 14928 than or equal to 'BIT_SIZE(I)', otherwise the result value is 14929 undefined. Bits shifted out from the left end are lost; zeros are 14930 shifted in from the opposite end. 14931 14932 This function has been superseded by the 'ISHFT' intrinsic, which 14933 is standard in Fortran 95 and later, and the 'SHIFTL' intrinsic, 14934 which is standard in Fortran 2008 and later. 14935 14936 _Standard_: 14937 GNU extension 14938 14939 _Class_: 14940 Elemental function 14941 14942 _Syntax_: 14943 'RESULT = LSHIFT(I, SHIFT)' 14944 14945 _Arguments_: 14946 I The type shall be 'INTEGER'. 14947 SHIFT The type shall be 'INTEGER'. 14948 14949 _Return value_: 14950 The return value is of type 'INTEGER' and of the same kind as I. 14951 14952 _See also_: 14953 *note ISHFT::, *note ISHFTC::, *note RSHIFT::, *note SHIFTA::, 14954 *note SHIFTL::, *note SHIFTR:: 14955 14956 14957 File: gfortran.info, Node: LSTAT, Next: LTIME, Prev: LSHIFT, Up: Intrinsic Procedures 14958 14959 8.182 'LSTAT' -- Get file status 14960 ================================ 14961 14962 _Description_: 14963 'LSTAT' is identical to *note STAT::, except that if path is a 14964 symbolic link, then the link itself is statted, not the file that 14965 it refers to. 14966 14967 The elements in 'VALUES' are the same as described by *note STAT::. 14968 14969 This intrinsic is provided in both subroutine and function forms; 14970 however, only one form can be used in any given program unit. 14971 14972 _Standard_: 14973 GNU extension 14974 14975 _Class_: 14976 Subroutine, function 14977 14978 _Syntax_: 14979 'CALL LSTAT(NAME, VALUES [, STATUS])' 14980 'STATUS = LSTAT(NAME, VALUES)' 14981 14982 _Arguments_: 14983 NAME The type shall be 'CHARACTER' of the default 14984 kind, a valid path within the file system. 14985 VALUES The type shall be 'INTEGER(4), DIMENSION(13)'. 14986 STATUS (Optional) status flag of type 'INTEGER(4)'. 14987 Returns 0 on success and a system specific error 14988 code otherwise. 14989 14990 _Example_: 14991 See *note STAT:: for an example. 14992 14993 _See also_: 14994 To stat an open file: *note FSTAT:: To stat a file: *note STAT:: 14995 14996 14997 File: gfortran.info, Node: LTIME, Next: MALLOC, Prev: LSTAT, Up: Intrinsic Procedures 14998 14999 8.183 'LTIME' -- Convert time to local time info 15000 ================================================ 15001 15002 _Description_: 15003 Given a system time value TIME (as provided by the *note TIME:: 15004 intrinsic), fills VALUES with values extracted from it appropriate 15005 to the local time zone using 'localtime(3)'. 15006 15007 This intrinsic routine is provided for backwards compatibility with 15008 GNU Fortran 77. In new code, programmers should consider the use 15009 of the *note DATE_AND_TIME:: intrinsic defined by the Fortran 95 15010 standard. 15011 15012 _Standard_: 15013 GNU extension 15014 15015 _Class_: 15016 Subroutine 15017 15018 _Syntax_: 15019 'CALL LTIME(TIME, VALUES)' 15020 15021 _Arguments_: 15022 TIME An 'INTEGER' scalar expression corresponding to 15023 a system time, with 'INTENT(IN)'. 15024 VALUES A default 'INTEGER' array with 9 elements, with 15025 'INTENT(OUT)'. 15026 15027 _Return value_: 15028 The elements of VALUES are assigned as follows: 15029 1. Seconds after the minute, range 0-59 or 0-61 to allow for leap 15030 seconds 15031 2. Minutes after the hour, range 0-59 15032 3. Hours past midnight, range 0-23 15033 4. Day of month, range 1-31 15034 5. Number of months since January, range 0-11 15035 6. Years since 1900 15036 7. Number of days since Sunday, range 0-6 15037 8. Days since January 1, range 0-365 15038 9. Daylight savings indicator: positive if daylight savings is in 15039 effect, zero if not, and negative if the information is not 15040 available. 15041 15042 _See also_: 15043 *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note TIME::, 15044 *note TIME8:: 15045 15046 15047 File: gfortran.info, Node: MALLOC, Next: MASKL, Prev: LTIME, Up: Intrinsic Procedures 15048 15049 8.184 'MALLOC' -- Allocate dynamic memory 15050 ========================================= 15051 15052 _Description_: 15053 'MALLOC(SIZE)' allocates SIZE bytes of dynamic memory and returns 15054 the address of the allocated memory. The 'MALLOC' intrinsic is an 15055 extension intended to be used with Cray pointers, and is provided 15056 in GNU Fortran to allow the user to compile legacy code. For new 15057 code using Fortran 95 pointers, the memory allocation intrinsic is 15058 'ALLOCATE'. 15059 15060 _Standard_: 15061 GNU extension 15062 15063 _Class_: 15064 Function 15065 15066 _Syntax_: 15067 'PTR = MALLOC(SIZE)' 15068 15069 _Arguments_: 15070 SIZE The type shall be 'INTEGER'. 15071 15072 _Return value_: 15073 The return value is of type 'INTEGER(K)', with K such that 15074 variables of type 'INTEGER(K)' have the same size as C pointers 15075 ('sizeof(void *)'). 15076 15077 _Example_: 15078 The following example demonstrates the use of 'MALLOC' and 'FREE' 15079 with Cray pointers. 15080 15081 program test_malloc 15082 implicit none 15083 integer i 15084 real*8 x(*), z 15085 pointer(ptr_x,x) 15086 15087 ptr_x = malloc(20*8) 15088 do i = 1, 20 15089 x(i) = sqrt(1.0d0 / i) 15090 end do 15091 z = 0 15092 do i = 1, 20 15093 z = z + x(i) 15094 print *, z 15095 end do 15096 call free(ptr_x) 15097 end program test_malloc 15098 15099 _See also_: 15100 *note FREE:: 15101 15102 15103 File: gfortran.info, Node: MASKL, Next: MASKR, Prev: MALLOC, Up: Intrinsic Procedures 15104 15105 8.185 'MASKL' -- Left justified mask 15106 ==================================== 15107 15108 _Description_: 15109 'MASKL(I[, KIND])' has its leftmost I bits set to 1, and the 15110 remaining bits set to 0. 15111 15112 _Standard_: 15113 Fortran 2008 and later 15114 15115 _Class_: 15116 Elemental function 15117 15118 _Syntax_: 15119 'RESULT = MASKL(I[, KIND])' 15120 15121 _Arguments_: 15122 I Shall be of type 'INTEGER'. 15123 KIND Shall be a scalar constant expression of type 15124 'INTEGER'. 15125 15126 _Return value_: 15127 The return value is of type 'INTEGER'. If KIND is present, it 15128 specifies the kind value of the return type; otherwise, it is of 15129 the default integer kind. 15130 15131 _See also_: 15132 *note MASKR:: 15133 15134 15135 File: gfortran.info, Node: MASKR, Next: MATMUL, Prev: MASKL, Up: Intrinsic Procedures 15136 15137 8.186 'MASKR' -- Right justified mask 15138 ===================================== 15139 15140 _Description_: 15141 'MASKL(I[, KIND])' has its rightmost I bits set to 1, and the 15142 remaining bits set to 0. 15143 15144 _Standard_: 15145 Fortran 2008 and later 15146 15147 _Class_: 15148 Elemental function 15149 15150 _Syntax_: 15151 'RESULT = MASKR(I[, KIND])' 15152 15153 _Arguments_: 15154 I Shall be of type 'INTEGER'. 15155 KIND Shall be a scalar constant expression of type 15156 'INTEGER'. 15157 15158 _Return value_: 15159 The return value is of type 'INTEGER'. If KIND is present, it 15160 specifies the kind value of the return type; otherwise, it is of 15161 the default integer kind. 15162 15163 _See also_: 15164 *note MASKL:: 15165 15166 15167 File: gfortran.info, Node: MATMUL, Next: MAX, Prev: MASKR, Up: Intrinsic Procedures 15168 15169 8.187 'MATMUL' -- matrix multiplication 15170 ======================================= 15171 15172 _Description_: 15173 Performs a matrix multiplication on numeric or logical arguments. 15174 15175 _Standard_: 15176 Fortran 90 and later 15177 15178 _Class_: 15179 Transformational function 15180 15181 _Syntax_: 15182 'RESULT = MATMUL(MATRIX_A, MATRIX_B)' 15183 15184 _Arguments_: 15185 MATRIX_A An array of 'INTEGER', 'REAL', 'COMPLEX', or 15186 'LOGICAL' type, with a rank of one or two. 15187 MATRIX_B An array of 'INTEGER', 'REAL', or 'COMPLEX' type 15188 if MATRIX_A is of a numeric type; otherwise, an 15189 array of 'LOGICAL' type. The rank shall be one 15190 or two, and the first (or only) dimension of 15191 MATRIX_B shall be equal to the last (or only) 15192 dimension of MATRIX_A. MATRIX_A and MATRIX_B 15193 shall not both be rank one arrays. 15194 15195 _Return value_: 15196 The matrix product of MATRIX_A and MATRIX_B. The type and kind of 15197 the result follow the usual type and kind promotion rules, as for 15198 the '*' or '.AND.' operators. 15199 15200 15201 File: gfortran.info, Node: MAX, Next: MAXEXPONENT, Prev: MATMUL, Up: Intrinsic Procedures 15202 15203 8.188 'MAX' -- Maximum value of an argument list 15204 ================================================ 15205 15206 _Description_: 15207 Returns the argument with the largest (most positive) value. 15208 15209 _Standard_: 15210 Fortran 77 and later 15211 15212 _Class_: 15213 Elemental function 15214 15215 _Syntax_: 15216 'RESULT = MAX(A1, A2 [, A3 [, ...]])' 15217 15218 _Arguments_: 15219 A1 The type shall be 'INTEGER' or 'REAL'. 15220 A2, A3, An expression of the same type and kind as A1. 15221 ... (As a GNU extension, arguments of different 15222 kinds are permitted.) 15223 15224 _Return value_: 15225 The return value corresponds to the maximum value among the 15226 arguments, and has the same type and kind as the first argument. 15227 15228 _Specific names_: 15229 Name Argument Return type Standard 15230 ------------------------------------------------------------------------- 15231 'MAX0(A1)' 'INTEGER(4) A1' 'INTEGER(4)' Fortran 77 and later 15232 'AMAX0(A1)' 'INTEGER(4) A1' 'REAL(MAX(X))' Fortran 77 and later 15233 'MAX1(A1)' 'REAL A1' 'INT(MAX(X))' Fortran 77 and later 15234 'AMAX1(A1)' 'REAL(4) A1' 'REAL(4)' Fortran 77 and later 15235 'DMAX1(A1)' 'REAL(8) A1' 'REAL(8)' Fortran 77 and later 15236 15237 _See also_: 15238 *note MAXLOC:: *note MAXVAL::, *note MIN:: 15239 15240 15241 File: gfortran.info, Node: MAXEXPONENT, Next: MAXLOC, Prev: MAX, Up: Intrinsic Procedures 15242 15243 8.189 'MAXEXPONENT' -- Maximum exponent of a real kind 15244 ====================================================== 15245 15246 _Description_: 15247 'MAXEXPONENT(X)' returns the maximum exponent in the model of the 15248 type of 'X'. 15249 15250 _Standard_: 15251 Fortran 90 and later 15252 15253 _Class_: 15254 Inquiry function 15255 15256 _Syntax_: 15257 'RESULT = MAXEXPONENT(X)' 15258 15259 _Arguments_: 15260 X Shall be of type 'REAL'. 15261 15262 _Return value_: 15263 The return value is of type 'INTEGER' and of the default integer 15264 kind. 15265 15266 _Example_: 15267 program exponents 15268 real(kind=4) :: x 15269 real(kind=8) :: y 15270 15271 print *, minexponent(x), maxexponent(x) 15272 print *, minexponent(y), maxexponent(y) 15273 end program exponents 15274 15275 15276 File: gfortran.info, Node: MAXLOC, Next: MAXVAL, Prev: MAXEXPONENT, Up: Intrinsic Procedures 15277 15278 8.190 'MAXLOC' -- Location of the maximum value within an array 15279 =============================================================== 15280 15281 _Description_: 15282 Determines the location of the element in the array with the 15283 maximum value, or, if the DIM argument is supplied, determines the 15284 locations of the maximum element along each row of the array in the 15285 DIM direction. If MASK is present, only the elements for which 15286 MASK is '.TRUE.' are considered. If more than one element in the 15287 array has the maximum value, the location returned is that of the 15288 first such element in array element order if the BACK is not 15289 present, or is false; if BACK is true, the location returned is 15290 that of the last such element. If the array has zero size, or all 15291 of the elements of MASK are '.FALSE.', then the result is an array 15292 of zeroes. Similarly, if DIM is supplied and all of the elements 15293 of MASK along a given row are zero, the result value for that row 15294 is zero. 15295 15296 _Standard_: 15297 Fortran 95 and later; ARRAY of 'CHARACTER' and the KIND argument 15298 are available in Fortran 2003 and later. The BACK argument is 15299 available in Fortran 2008 and later. 15300 15301 _Class_: 15302 Transformational function 15303 15304 _Syntax_: 15305 'RESULT = MAXLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])' 15306 'RESULT = MAXLOC(ARRAY [, MASK] [,KIND] [,BACK])' 15307 15308 _Arguments_: 15309 ARRAY Shall be an array of type 'INTEGER' or 'REAL'. 15310 DIM (Optional) Shall be a scalar of type 'INTEGER', 15311 with a value between one and the rank of ARRAY, 15312 inclusive. It may not be an optional dummy 15313 argument. 15314 MASK Shall be of type 'LOGICAL', and conformable with 15315 ARRAY. 15316 KIND (Optional) An 'INTEGER' initialization 15317 expression indicating the kind parameter of the 15318 result. 15319 BACK (Optional) A scalar of type 'LOGICAL'. 15320 15321 _Return value_: 15322 If DIM is absent, the result is a rank-one array with a length 15323 equal to the rank of ARRAY. If DIM is present, the result is an 15324 array with a rank one less than the rank of ARRAY, and a size 15325 corresponding to the size of ARRAY with the DIM dimension removed. 15326 If DIM is present and ARRAY has a rank of one, the result is a 15327 scalar. If the optional argument KIND is present, the result is an 15328 integer of kind KIND, otherwise it is of default kind. 15329 15330 _See also_: 15331 *note FINDLOC::, *note MAX::, *note MAXVAL:: 15332 15333 15334 File: gfortran.info, Node: MAXVAL, Next: MCLOCK, Prev: MAXLOC, Up: Intrinsic Procedures 15335 15336 8.191 'MAXVAL' -- Maximum value of an array 15337 =========================================== 15338 15339 _Description_: 15340 Determines the maximum value of the elements in an array value, or, 15341 if the DIM argument is supplied, determines the maximum value along 15342 each row of the array in the DIM direction. If MASK is present, 15343 only the elements for which MASK is '.TRUE.' are considered. If 15344 the array has zero size, or all of the elements of MASK are 15345 '.FALSE.', then the result is '-HUGE(ARRAY)' if ARRAY is numeric, 15346 or a string of nulls if ARRAY is of character type. 15347 15348 _Standard_: 15349 Fortran 90 and later 15350 15351 _Class_: 15352 Transformational function 15353 15354 _Syntax_: 15355 'RESULT = MAXVAL(ARRAY, DIM [, MASK])' 15356 'RESULT = MAXVAL(ARRAY [, MASK])' 15357 15358 _Arguments_: 15359 ARRAY Shall be an array of type 'INTEGER' or 'REAL'. 15360 DIM (Optional) Shall be a scalar of type 'INTEGER', 15361 with a value between one and the rank of ARRAY, 15362 inclusive. It may not be an optional dummy 15363 argument. 15364 MASK (Optional) Shall be of type 'LOGICAL', and 15365 conformable with ARRAY. 15366 15367 _Return value_: 15368 If DIM is absent, or if ARRAY has a rank of one, the result is a 15369 scalar. If DIM is present, the result is an array with a rank one 15370 less than the rank of ARRAY, and a size corresponding to the size 15371 of ARRAY with the DIM dimension removed. In all cases, the result 15372 is of the same type and kind as ARRAY. 15373 15374 _See also_: 15375 *note MAX::, *note MAXLOC:: 15376 15377 15378 File: gfortran.info, Node: MCLOCK, Next: MCLOCK8, Prev: MAXVAL, Up: Intrinsic Procedures 15379 15380 8.192 'MCLOCK' -- Time function 15381 =============================== 15382 15383 _Description_: 15384 Returns the number of clock ticks since the start of the process, 15385 based on the function 'clock(3)' in the C standard library. 15386 15387 This intrinsic is not fully portable, such as to systems with 15388 32-bit 'INTEGER' types but supporting times wider than 32 bits. 15389 Therefore, the values returned by this intrinsic might be, or 15390 become, negative, or numerically less than previous values, during 15391 a single run of the compiled program. 15392 15393 _Standard_: 15394 GNU extension 15395 15396 _Class_: 15397 Function 15398 15399 _Syntax_: 15400 'RESULT = MCLOCK()' 15401 15402 _Return value_: 15403 The return value is a scalar of type 'INTEGER(4)', equal to the 15404 number of clock ticks since the start of the process, or '-1' if 15405 the system does not support 'clock(3)'. 15406 15407 _See also_: 15408 *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note 15409 TIME:: 15410 15411 15412 File: gfortran.info, Node: MCLOCK8, Next: MERGE, Prev: MCLOCK, Up: Intrinsic Procedures 15413 15414 8.193 'MCLOCK8' -- Time function (64-bit) 15415 ========================================= 15416 15417 _Description_: 15418 Returns the number of clock ticks since the start of the process, 15419 based on the function 'clock(3)' in the C standard library. 15420 15421 _Warning:_ this intrinsic does not increase the range of the timing 15422 values over that returned by 'clock(3)'. On a system with a 32-bit 15423 'clock(3)', 'MCLOCK8' will return a 32-bit value, even though it is 15424 converted to a 64-bit 'INTEGER(8)' value. That means overflows of 15425 the 32-bit value can still occur. Therefore, the values returned 15426 by this intrinsic might be or become negative or numerically less 15427 than previous values during a single run of the compiled program. 15428 15429 _Standard_: 15430 GNU extension 15431 15432 _Class_: 15433 Function 15434 15435 _Syntax_: 15436 'RESULT = MCLOCK8()' 15437 15438 _Return value_: 15439 The return value is a scalar of type 'INTEGER(8)', equal to the 15440 number of clock ticks since the start of the process, or '-1' if 15441 the system does not support 'clock(3)'. 15442 15443 _See also_: 15444 *note CTIME::, *note GMTIME::, *note LTIME::, *note MCLOCK::, *note 15445 TIME8:: 15446 15447 15448 File: gfortran.info, Node: MERGE, Next: MERGE_BITS, Prev: MCLOCK8, Up: Intrinsic Procedures 15449 15450 8.194 'MERGE' -- Merge variables 15451 ================================ 15452 15453 _Description_: 15454 Select values from two arrays according to a logical mask. The 15455 result is equal to TSOURCE if MASK is '.TRUE.', or equal to FSOURCE 15456 if it is '.FALSE.'. 15457 15458 _Standard_: 15459 Fortran 90 and later 15460 15461 _Class_: 15462 Elemental function 15463 15464 _Syntax_: 15465 'RESULT = MERGE(TSOURCE, FSOURCE, MASK)' 15466 15467 _Arguments_: 15468 TSOURCE May be of any type. 15469 FSOURCE Shall be of the same type and type parameters as 15470 TSOURCE. 15471 MASK Shall be of type 'LOGICAL'. 15472 15473 _Return value_: 15474 The result is of the same type and type parameters as TSOURCE. 15475 15476 15477 File: gfortran.info, Node: MERGE_BITS, Next: MIN, Prev: MERGE, Up: Intrinsic Procedures 15478 15479 8.195 'MERGE_BITS' -- Merge of bits under mask 15480 ============================================== 15481 15482 _Description_: 15483 'MERGE_BITS(I, J, MASK)' merges the bits of I and J as determined 15484 by the mask. The i-th bit of the result is equal to the i-th bit 15485 of I if the i-th bit of MASK is 1; it is equal to the i-th bit of J 15486 otherwise. 15487 15488 _Standard_: 15489 Fortran 2008 and later 15490 15491 _Class_: 15492 Elemental function 15493 15494 _Syntax_: 15495 'RESULT = MERGE_BITS(I, J, MASK)' 15496 15497 _Arguments_: 15498 I Shall be of type 'INTEGER' or a 15499 boz-literal-constant. 15500 J Shall be of type 'INTEGER' with the same kind 15501 type parameter as I or a boz-literal-constant. 15502 I and J shall not both be boz-literal-constants. 15503 MASK Shall be of type 'INTEGER' or a 15504 boz-literal-constant and of the same kind as I. 15505 15506 _Return value_: 15507 The result is of the same type and kind as I. 15508 15509 15510 File: gfortran.info, Node: MIN, Next: MINEXPONENT, Prev: MERGE_BITS, Up: Intrinsic Procedures 15511 15512 8.196 'MIN' -- Minimum value of an argument list 15513 ================================================ 15514 15515 _Description_: 15516 Returns the argument with the smallest (most negative) value. 15517 15518 _Standard_: 15519 Fortran 77 and later 15520 15521 _Class_: 15522 Elemental function 15523 15524 _Syntax_: 15525 'RESULT = MIN(A1, A2 [, A3, ...])' 15526 15527 _Arguments_: 15528 A1 The type shall be 'INTEGER' or 'REAL'. 15529 A2, A3, An expression of the same type and kind as A1. 15530 ... (As a GNU extension, arguments of different 15531 kinds are permitted.) 15532 15533 _Return value_: 15534 The return value corresponds to the minimum value among the 15535 arguments, and has the same type and kind as the first argument. 15536 15537 _Specific names_: 15538 Name Argument Return type Standard 15539 ------------------------------------------------------------------------- 15540 'MIN0(A1)' 'INTEGER(4) A1' 'INTEGER(4)' Fortran 77 and later 15541 'AMIN0(A1)' 'INTEGER(4) A1' 'REAL(4)' Fortran 77 and later 15542 'MIN1(A1)' 'REAL A1' 'INTEGER(4)' Fortran 77 and later 15543 'AMIN1(A1)' 'REAL(4) A1' 'REAL(4)' Fortran 77 and later 15544 'DMIN1(A1)' 'REAL(8) A1' 'REAL(8)' Fortran 77 and later 15545 15546 _See also_: 15547 *note MAX::, *note MINLOC::, *note MINVAL:: 15548 15549 15550 File: gfortran.info, Node: MINEXPONENT, Next: MINLOC, Prev: MIN, Up: Intrinsic Procedures 15551 15552 8.197 'MINEXPONENT' -- Minimum exponent of a real kind 15553 ====================================================== 15554 15555 _Description_: 15556 'MINEXPONENT(X)' returns the minimum exponent in the model of the 15557 type of 'X'. 15558 15559 _Standard_: 15560 Fortran 90 and later 15561 15562 _Class_: 15563 Inquiry function 15564 15565 _Syntax_: 15566 'RESULT = MINEXPONENT(X)' 15567 15568 _Arguments_: 15569 X Shall be of type 'REAL'. 15570 15571 _Return value_: 15572 The return value is of type 'INTEGER' and of the default integer 15573 kind. 15574 15575 _Example_: 15576 See 'MAXEXPONENT' for an example. 15577 15578 15579 File: gfortran.info, Node: MINLOC, Next: MINVAL, Prev: MINEXPONENT, Up: Intrinsic Procedures 15580 15581 8.198 'MINLOC' -- Location of the minimum value within an array 15582 =============================================================== 15583 15584 _Description_: 15585 Determines the location of the element in the array with the 15586 minimum value, or, if the DIM argument is supplied, determines the 15587 locations of the minimum element along each row of the array in the 15588 DIM direction. If MASK is present, only the elements for which 15589 MASK is '.TRUE.' are considered. If more than one element in the 15590 array has the minimum value, the location returned is that of the 15591 first such element in array element order if the BACK is not 15592 present, or is false; if BACK is true, the location returned is 15593 that of the last such element. If the array has zero size, or all 15594 of the elements of MASK are '.FALSE.', then the result is an array 15595 of zeroes. Similarly, if DIM is supplied and all of the elements 15596 of MASK along a given row are zero, the result value for that row 15597 is zero. 15598 15599 _Standard_: 15600 Fortran 90 and later; ARRAY of 'CHARACTER' and the KIND argument 15601 are available in Fortran 2003 and later. The BACK argument is 15602 available in Fortran 2008 and later. 15603 15604 _Class_: 15605 Transformational function 15606 15607 _Syntax_: 15608 'RESULT = MINLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])' 15609 'RESULT = MINLOC(ARRAY [, MASK], [,KIND] [,BACK])' 15610 15611 _Arguments_: 15612 ARRAY Shall be an array of type 'INTEGER', 'REAL' or 15613 'CHARACTER'. 15614 DIM (Optional) Shall be a scalar of type 'INTEGER', 15615 with a value between one and the rank of ARRAY, 15616 inclusive. It may not be an optional dummy 15617 argument. 15618 MASK Shall be of type 'LOGICAL', and conformable with 15619 ARRAY. 15620 KIND (Optional) An 'INTEGER' initialization 15621 expression indicating the kind parameter of the 15622 result. 15623 BACK (Optional) A scalar of type 'LOGICAL'. 15624 15625 _Return value_: 15626 If DIM is absent, the result is a rank-one array with a length 15627 equal to the rank of ARRAY. If DIM is present, the result is an 15628 array with a rank one less than the rank of ARRAY, and a size 15629 corresponding to the size of ARRAY with the DIM dimension removed. 15630 If DIM is present and ARRAY has a rank of one, the result is a 15631 scalar. If the optional argument KIND is present, the result is an 15632 integer of kind KIND, otherwise it is of default kind. 15633 15634 _See also_: 15635 *note FINDLOC::, *note MIN::, *note MINVAL:: 15636 15637 15638 File: gfortran.info, Node: MINVAL, Next: MOD, Prev: MINLOC, Up: Intrinsic Procedures 15639 15640 8.199 'MINVAL' -- Minimum value of an array 15641 =========================================== 15642 15643 _Description_: 15644 Determines the minimum value of the elements in an array value, or, 15645 if the DIM argument is supplied, determines the minimum value along 15646 each row of the array in the DIM direction. If MASK is present, 15647 only the elements for which MASK is '.TRUE.' are considered. If 15648 the array has zero size, or all of the elements of MASK are 15649 '.FALSE.', then the result is 'HUGE(ARRAY)' if ARRAY is numeric, or 15650 a string of 'CHAR(255)' characters if ARRAY is of character type. 15651 15652 _Standard_: 15653 Fortran 90 and later 15654 15655 _Class_: 15656 Transformational function 15657 15658 _Syntax_: 15659 'RESULT = MINVAL(ARRAY, DIM [, MASK])' 15660 'RESULT = MINVAL(ARRAY [, MASK])' 15661 15662 _Arguments_: 15663 ARRAY Shall be an array of type 'INTEGER' or 'REAL'. 15664 DIM (Optional) Shall be a scalar of type 'INTEGER', 15665 with a value between one and the rank of ARRAY, 15666 inclusive. It may not be an optional dummy 15667 argument. 15668 MASK Shall be of type 'LOGICAL', and conformable with 15669 ARRAY. 15670 15671 _Return value_: 15672 If DIM is absent, or if ARRAY has a rank of one, the result is a 15673 scalar. If DIM is present, the result is an array with a rank one 15674 less than the rank of ARRAY, and a size corresponding to the size 15675 of ARRAY with the DIM dimension removed. In all cases, the result 15676 is of the same type and kind as ARRAY. 15677 15678 _See also_: 15679 *note MIN::, *note MINLOC:: 15680 15681 15682 File: gfortran.info, Node: MOD, Next: MODULO, Prev: MINVAL, Up: Intrinsic Procedures 15683 15684 8.200 'MOD' -- Remainder function 15685 ================================= 15686 15687 _Description_: 15688 'MOD(A,P)' computes the remainder of the division of A by P. 15689 15690 _Standard_: 15691 Fortran 77 and later, has overloads that are GNU extensions 15692 15693 _Class_: 15694 Elemental function 15695 15696 _Syntax_: 15697 'RESULT = MOD(A, P)' 15698 15699 _Arguments_: 15700 A Shall be a scalar of type 'INTEGER' or 'REAL'. 15701 P Shall be a scalar of the same type and kind as A 15702 and not equal to zero. (As a GNU extension, 15703 arguments of different kinds are permitted.) 15704 15705 _Return value_: 15706 The return value is the result of 'A - (INT(A/P) * P)'. The type 15707 and kind of the return value is the same as that of the arguments. 15708 The returned value has the same sign as A and a magnitude less than 15709 the magnitude of P. (As a GNU extension, kind is the largest kind 15710 of the actual arguments.) 15711 15712 _Example_: 15713 program test_mod 15714 print *, mod(17,3) 15715 print *, mod(17.5,5.5) 15716 print *, mod(17.5d0,5.5) 15717 print *, mod(17.5,5.5d0) 15718 15719 print *, mod(-17,3) 15720 print *, mod(-17.5,5.5) 15721 print *, mod(-17.5d0,5.5) 15722 print *, mod(-17.5,5.5d0) 15723 15724 print *, mod(17,-3) 15725 print *, mod(17.5,-5.5) 15726 print *, mod(17.5d0,-5.5) 15727 print *, mod(17.5,-5.5d0) 15728 end program test_mod 15729 15730 _Specific names_: 15731 Name Arguments Return type Standard 15732 ------------------------------------------------------------------------ 15733 'MOD(A,P)' 'INTEGER A,P' 'INTEGER' Fortran 77 and later 15734 'AMOD(A,P)' 'REAL(4) A,P' 'REAL(4)' Fortran 77 and later 15735 'DMOD(A,P)' 'REAL(8) A,P' 'REAL(8)' Fortran 77 and later 15736 'BMOD(A,P)' 'INTEGER(1) A,P' 'INTEGER(1)' GNU extension 15737 'IMOD(A,P)' 'INTEGER(2) A,P' 'INTEGER(2)' GNU extension 15738 'JMOD(A,P)' 'INTEGER(4) A,P' 'INTEGER(4)' GNU extension 15739 'KMOD(A,P)' 'INTEGER(8) A,P' 'INTEGER(8)' GNU extension 15740 15741 _See also_: 15742 *note MODULO:: 15743 15744 15745 File: gfortran.info, Node: MODULO, Next: MOVE_ALLOC, Prev: MOD, Up: Intrinsic Procedures 15746 15747 8.201 'MODULO' -- Modulo function 15748 ================================= 15749 15750 _Description_: 15751 'MODULO(A,P)' computes the A modulo P. 15752 15753 _Standard_: 15754 Fortran 95 and later 15755 15756 _Class_: 15757 Elemental function 15758 15759 _Syntax_: 15760 'RESULT = MODULO(A, P)' 15761 15762 _Arguments_: 15763 A Shall be a scalar of type 'INTEGER' or 'REAL'. 15764 P Shall be a scalar of the same type and kind as 15765 A. It shall not be zero. (As a GNU extension, 15766 arguments of different kinds are permitted.) 15767 15768 _Return value_: 15769 The type and kind of the result are those of the arguments. (As a 15770 GNU extension, kind is the largest kind of the actual arguments.) 15771 If A and P are of type 'INTEGER': 15772 'MODULO(A,P)' has the value R such that 'A=Q*P+R', where Q is 15773 an integer and R is between 0 (inclusive) and P (exclusive). 15774 If A and P are of type 'REAL': 15775 'MODULO(A,P)' has the value of 'A - FLOOR (A / P) * P'. 15776 The returned value has the same sign as P and a magnitude less than 15777 the magnitude of P. 15778 15779 _Example_: 15780 program test_modulo 15781 print *, modulo(17,3) 15782 print *, modulo(17.5,5.5) 15783 15784 print *, modulo(-17,3) 15785 print *, modulo(-17.5,5.5) 15786 15787 print *, modulo(17,-3) 15788 print *, modulo(17.5,-5.5) 15789 end program 15790 15791 _See also_: 15792 *note MOD:: 15793 15794 15795 File: gfortran.info, Node: MOVE_ALLOC, Next: MVBITS, Prev: MODULO, Up: Intrinsic Procedures 15796 15797 8.202 'MOVE_ALLOC' -- Move allocation from one object to another 15798 ================================================================ 15799 15800 _Description_: 15801 'MOVE_ALLOC(FROM, TO)' moves the allocation from FROM to TO. FROM 15802 will become deallocated in the process. 15803 15804 _Standard_: 15805 Fortran 2003 and later 15806 15807 _Class_: 15808 Pure subroutine 15809 15810 _Syntax_: 15811 'CALL MOVE_ALLOC(FROM, TO)' 15812 15813 _Arguments_: 15814 FROM 'ALLOCATABLE', 'INTENT(INOUT)', may be of any 15815 type and kind. 15816 TO 'ALLOCATABLE', 'INTENT(OUT)', shall be of the 15817 same type, kind and rank as FROM. 15818 15819 _Return value_: 15820 None 15821 15822 _Example_: 15823 program test_move_alloc 15824 integer, allocatable :: a(:), b(:) 15825 15826 allocate(a(3)) 15827 a = [ 1, 2, 3 ] 15828 call move_alloc(a, b) 15829 print *, allocated(a), allocated(b) 15830 print *, b 15831 end program test_move_alloc 15832 15833 15834 File: gfortran.info, Node: MVBITS, Next: NEAREST, Prev: MOVE_ALLOC, Up: Intrinsic Procedures 15835 15836 8.203 'MVBITS' -- Move bits from one integer to another 15837 ======================================================= 15838 15839 _Description_: 15840 Moves LEN bits from positions FROMPOS through 'FROMPOS+LEN-1' of 15841 FROM to positions TOPOS through 'TOPOS+LEN-1' of TO. The portion 15842 of argument TO not affected by the movement of bits is unchanged. 15843 The values of 'FROMPOS+LEN-1' and 'TOPOS+LEN-1' must be less than 15844 'BIT_SIZE(FROM)'. 15845 15846 _Standard_: 15847 Fortran 90 and later, has overloads that are GNU extensions 15848 15849 _Class_: 15850 Elemental subroutine 15851 15852 _Syntax_: 15853 'CALL MVBITS(FROM, FROMPOS, LEN, TO, TOPOS)' 15854 15855 _Arguments_: 15856 FROM The type shall be 'INTEGER'. 15857 FROMPOS The type shall be 'INTEGER'. 15858 LEN The type shall be 'INTEGER'. 15859 TO The type shall be 'INTEGER', of the same kind as 15860 FROM. 15861 TOPOS The type shall be 'INTEGER'. 15862 15863 _Specific names_: 15864 Name Argument Return type Standard 15865 ------------------------------------------------------------------------- 15866 'MVBITS(A)' 'INTEGER A' 'INTEGER' Fortran 90 and later 15867 'BMVBITS(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 15868 'IMVBITS(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 15869 'JMVBITS(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 15870 'KMVBITS(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 15871 15872 _See also_: 15873 *note IBCLR::, *note IBSET::, *note IBITS::, *note IAND::, *note 15874 IOR::, *note IEOR:: 15875 15876 15877 File: gfortran.info, Node: NEAREST, Next: NEW_LINE, Prev: MVBITS, Up: Intrinsic Procedures 15878 15879 8.204 'NEAREST' -- Nearest representable number 15880 =============================================== 15881 15882 _Description_: 15883 'NEAREST(X, S)' returns the processor-representable number nearest 15884 to 'X' in the direction indicated by the sign of 'S'. 15885 15886 _Standard_: 15887 Fortran 90 and later 15888 15889 _Class_: 15890 Elemental function 15891 15892 _Syntax_: 15893 'RESULT = NEAREST(X, S)' 15894 15895 _Arguments_: 15896 X Shall be of type 'REAL'. 15897 S Shall be of type 'REAL' and not equal to zero. 15898 15899 _Return value_: 15900 The return value is of the same type as 'X'. If 'S' is positive, 15901 'NEAREST' returns the processor-representable number greater than 15902 'X' and nearest to it. If 'S' is negative, 'NEAREST' returns the 15903 processor-representable number smaller than 'X' and nearest to it. 15904 15905 _Example_: 15906 program test_nearest 15907 real :: x, y 15908 x = nearest(42.0, 1.0) 15909 y = nearest(42.0, -1.0) 15910 write (*,"(3(G20.15))") x, y, x - y 15911 end program test_nearest 15912 15913 15914 File: gfortran.info, Node: NEW_LINE, Next: NINT, Prev: NEAREST, Up: Intrinsic Procedures 15915 15916 8.205 'NEW_LINE' -- New line character 15917 ====================================== 15918 15919 _Description_: 15920 'NEW_LINE(C)' returns the new-line character. 15921 15922 _Standard_: 15923 Fortran 2003 and later 15924 15925 _Class_: 15926 Inquiry function 15927 15928 _Syntax_: 15929 'RESULT = NEW_LINE(C)' 15930 15931 _Arguments_: 15932 C The argument shall be a scalar or array of the 15933 type 'CHARACTER'. 15934 15935 _Return value_: 15936 Returns a CHARACTER scalar of length one with the new-line 15937 character of the same kind as parameter C. 15938 15939 _Example_: 15940 program newline 15941 implicit none 15942 write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.' 15943 end program newline 15944 15945 15946 File: gfortran.info, Node: NINT, Next: NORM2, Prev: NEW_LINE, Up: Intrinsic Procedures 15947 15948 8.206 'NINT' -- Nearest whole number 15949 ==================================== 15950 15951 _Description_: 15952 'NINT(A)' rounds its argument to the nearest whole number. 15953 15954 _Standard_: 15955 Fortran 77 and later, with KIND argument Fortran 90 and later 15956 15957 _Class_: 15958 Elemental function 15959 15960 _Syntax_: 15961 'RESULT = NINT(A [, KIND])' 15962 15963 _Arguments_: 15964 A The type of the argument shall be 'REAL'. 15965 KIND (Optional) An 'INTEGER' initialization 15966 expression indicating the kind parameter of the 15967 result. 15968 15969 _Return value_: 15970 Returns A with the fractional portion of its magnitude eliminated 15971 by rounding to the nearest whole number and with its sign 15972 preserved, converted to an 'INTEGER' of the default kind. 15973 15974 _Example_: 15975 program test_nint 15976 real(4) x4 15977 real(8) x8 15978 x4 = 1.234E0_4 15979 x8 = 4.321_8 15980 print *, nint(x4), idnint(x8) 15981 end program test_nint 15982 15983 _Specific names_: 15984 Name Argument Return Type Standard 15985 ------------------------------------------------------------------------- 15986 'NINT(A)' 'REAL(4) A' 'INTEGER' Fortran 77 and later 15987 'IDNINT(A)' 'REAL(8) A' 'INTEGER' Fortran 77 and later 15988 15989 _See also_: 15990 *note CEILING::, *note FLOOR:: 15991 15992 15993 File: gfortran.info, Node: NORM2, Next: NOT, Prev: NINT, Up: Intrinsic Procedures 15994 15995 8.207 'NORM2' -- Euclidean vector norms 15996 ======================================= 15997 15998 _Description_: 15999 Calculates the Euclidean vector norm (L_2 norm) of ARRAY along 16000 dimension DIM. 16001 16002 _Standard_: 16003 Fortran 2008 and later 16004 16005 _Class_: 16006 Transformational function 16007 16008 _Syntax_: 16009 'RESULT = NORM2(ARRAY[, DIM])' 16010 16011 _Arguments_: 16012 ARRAY Shall be an array of type 'REAL' 16013 DIM (Optional) shall be a scalar of type 'INTEGER' 16014 with a value in the range from 1 to n, where n 16015 equals the rank of ARRAY. 16016 16017 _Return value_: 16018 The result is of the same type as ARRAY. 16019 16020 If DIM is absent, a scalar with the square root of the sum of all 16021 elements in ARRAY squared is returned. Otherwise, an array of rank 16022 n-1, where n equals the rank of ARRAY, and a shape similar to that 16023 of ARRAY with dimension DIM dropped is returned. 16024 16025 _Example_: 16026 PROGRAM test_sum 16027 REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ] 16028 print *, NORM2(x) ! = sqrt(55.) ~ 7.416 16029 END PROGRAM 16030 16031 16032 File: gfortran.info, Node: NOT, Next: NULL, Prev: NORM2, Up: Intrinsic Procedures 16033 16034 8.208 'NOT' -- Logical negation 16035 =============================== 16036 16037 _Description_: 16038 'NOT' returns the bitwise Boolean inverse of I. 16039 16040 _Standard_: 16041 Fortran 90 and later, has overloads that are GNU extensions 16042 16043 _Class_: 16044 Elemental function 16045 16046 _Syntax_: 16047 'RESULT = NOT(I)' 16048 16049 _Arguments_: 16050 I The type shall be 'INTEGER'. 16051 16052 _Return value_: 16053 The return type is 'INTEGER', of the same kind as the argument. 16054 16055 _Specific names_: 16056 Name Argument Return type Standard 16057 ------------------------------------------------------------------------- 16058 'NOT(A)' 'INTEGER A' 'INTEGER' Fortran 95 and later 16059 'BNOT(A)' 'INTEGER(1) A' 'INTEGER(1)' GNU extension 16060 'INOT(A)' 'INTEGER(2) A' 'INTEGER(2)' GNU extension 16061 'JNOT(A)' 'INTEGER(4) A' 'INTEGER(4)' GNU extension 16062 'KNOT(A)' 'INTEGER(8) A' 'INTEGER(8)' GNU extension 16063 16064 _See also_: 16065 *note IAND::, *note IEOR::, *note IOR::, *note IBITS::, *note 16066 IBSET::, *note IBCLR:: 16067 16068 16069 File: gfortran.info, Node: NULL, Next: NUM_IMAGES, Prev: NOT, Up: Intrinsic Procedures 16070 16071 8.209 'NULL' -- Function that returns an disassociated pointer 16072 ============================================================== 16073 16074 _Description_: 16075 Returns a disassociated pointer. 16076 16077 If MOLD is present, a disassociated pointer of the same type is 16078 returned, otherwise the type is determined by context. 16079 16080 In Fortran 95, MOLD is optional. Please note that Fortran 2003 16081 includes cases where it is required. 16082 16083 _Standard_: 16084 Fortran 95 and later 16085 16086 _Class_: 16087 Transformational function 16088 16089 _Syntax_: 16090 'PTR => NULL([MOLD])' 16091 16092 _Arguments_: 16093 MOLD (Optional) shall be a pointer of any association 16094 status and of any type. 16095 16096 _Return value_: 16097 A disassociated pointer. 16098 16099 _Example_: 16100 REAL, POINTER, DIMENSION(:) :: VEC => NULL () 16101 16102 _See also_: 16103 *note ASSOCIATED:: 16104 16105 16106 File: gfortran.info, Node: NUM_IMAGES, Next: OR, Prev: NULL, Up: Intrinsic Procedures 16107 16108 8.210 'NUM_IMAGES' -- Function that returns the number of images 16109 ================================================================ 16110 16111 _Description_: 16112 Returns the number of images. 16113 16114 _Standard_: 16115 Fortran 2008 and later. With DISTANCE or FAILED argument, 16116 Technical Specification (TS) 18508 or later 16117 16118 _Class_: 16119 Transformational function 16120 16121 _Syntax_: 16122 'RESULT = NUM_IMAGES(DISTANCE, FAILED)' 16123 16124 _Arguments_: 16125 DISTANCE (optional, intent(in)) Nonnegative scalar 16126 integer 16127 FAILED (optional, intent(in)) Scalar logical expression 16128 16129 _Return value_: 16130 Scalar default-kind integer. If DISTANCE is not present or has 16131 value 0, the number of images in the current team is returned. For 16132 values smaller or equal distance to the initial team, it returns 16133 the number of images index on the ancestor team which has a 16134 distance of DISTANCE from the invoking team. If DISTANCE is larger 16135 than the distance to the initial team, the number of images of the 16136 initial team is returned. If FAILED is not present the total 16137 number of images is returned; if it has the value '.TRUE.', the 16138 number of failed images is returned, otherwise, the number of 16139 images which do have not the failed status. 16140 16141 _Example_: 16142 INTEGER :: value[*] 16143 INTEGER :: i 16144 value = THIS_IMAGE() 16145 SYNC ALL 16146 IF (THIS_IMAGE() == 1) THEN 16147 DO i = 1, NUM_IMAGES() 16148 WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i] 16149 END DO 16150 END IF 16151 16152 _See also_: 16153 *note THIS_IMAGE::, *note IMAGE_INDEX:: 16154 16155 16156 File: gfortran.info, Node: OR, Next: PACK, Prev: NUM_IMAGES, Up: Intrinsic Procedures 16157 16158 8.211 'OR' -- Bitwise logical OR 16159 ================================ 16160 16161 _Description_: 16162 Bitwise logical 'OR'. 16163 16164 This intrinsic routine is provided for backwards compatibility with 16165 GNU Fortran 77. For integer arguments, programmers should consider 16166 the use of the *note IOR:: intrinsic defined by the Fortran 16167 standard. 16168 16169 _Standard_: 16170 GNU extension 16171 16172 _Class_: 16173 Function 16174 16175 _Syntax_: 16176 'RESULT = OR(I, J)' 16177 16178 _Arguments_: 16179 I The type shall be either a scalar 'INTEGER' type 16180 or a scalar 'LOGICAL' type or a 16181 boz-literal-constant. 16182 J The type shall be the same as the type of I or a 16183 boz-literal-constant. I and J shall not both be 16184 boz-literal-constants. If either I and J is a 16185 boz-literal-constant, then the other argument 16186 must be a scalar 'INTEGER'. 16187 16188 _Return value_: 16189 The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'. 16190 If the kind type parameters differ, then the smaller kind type is 16191 implicitly converted to larger kind, and the return has the larger 16192 kind. A boz-literal-constant is converted to an 'INTEGER' with the 16193 kind type parameter of the other argument as-if a call to *note 16194 INT:: occurred. 16195 16196 _Example_: 16197 PROGRAM test_or 16198 LOGICAL :: T = .TRUE., F = .FALSE. 16199 INTEGER :: a, b 16200 DATA a / Z'F' /, b / Z'3' / 16201 16202 WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F) 16203 WRITE (*,*) OR(a, b) 16204 END PROGRAM 16205 16206 _See also_: 16207 Fortran 95 elemental function: *note IOR:: 16208 16209 16210 File: gfortran.info, Node: PACK, Next: PARITY, Prev: OR, Up: Intrinsic Procedures 16211 16212 8.212 'PACK' -- Pack an array into an array of rank one 16213 ======================================================= 16214 16215 _Description_: 16216 Stores the elements of ARRAY in an array of rank one. 16217 16218 The beginning of the resulting array is made up of elements whose 16219 MASK equals 'TRUE'. Afterwards, positions are filled with elements 16220 taken from VECTOR. 16221 16222 _Standard_: 16223 Fortran 90 and later 16224 16225 _Class_: 16226 Transformational function 16227 16228 _Syntax_: 16229 'RESULT = PACK(ARRAY, MASK[,VECTOR])' 16230 16231 _Arguments_: 16232 ARRAY Shall be an array of any type. 16233 MASK Shall be an array of type 'LOGICAL' and of the 16234 same size as ARRAY. Alternatively, it may be a 16235 'LOGICAL' scalar. 16236 VECTOR (Optional) shall be an array of the same type as 16237 ARRAY and of rank one. If present, the number 16238 of elements in VECTOR shall be equal to or 16239 greater than the number of true elements in 16240 MASK. If MASK is scalar, the number of elements 16241 in VECTOR shall be equal to or greater than the 16242 number of elements in ARRAY. 16243 16244 _Return value_: 16245 The result is an array of rank one and the same type as that of 16246 ARRAY. If VECTOR is present, the result size is that of VECTOR, 16247 the number of 'TRUE' values in MASK otherwise. 16248 16249 _Example_: 16250 Gathering nonzero elements from an array: 16251 PROGRAM test_pack_1 16252 INTEGER :: m(6) 16253 m = (/ 1, 0, 0, 0, 5, 0 /) 16254 WRITE(*, FMT="(6(I0, ' '))") pack(m, m /= 0) ! "1 5" 16255 END PROGRAM 16256 16257 Gathering nonzero elements from an array and appending elements 16258 from VECTOR: 16259 PROGRAM test_pack_2 16260 INTEGER :: m(4) 16261 m = (/ 1, 0, 0, 2 /) 16262 ! The following results in "1 2 3 4" 16263 WRITE(*, FMT="(4(I0, ' '))") pack(m, m /= 0, (/ 0, 0, 3, 4 /)) 16264 END PROGRAM 16265 16266 _See also_: 16267 *note UNPACK:: 16268 16269 16270 File: gfortran.info, Node: PARITY, Next: PERROR, Prev: PACK, Up: Intrinsic Procedures 16271 16272 8.213 'PARITY' -- Reduction with exclusive OR 16273 ============================================= 16274 16275 _Description_: 16276 Calculates the parity, i.e. the reduction using '.XOR.', of MASK 16277 along dimension DIM. 16278 16279 _Standard_: 16280 Fortran 2008 and later 16281 16282 _Class_: 16283 Transformational function 16284 16285 _Syntax_: 16286 'RESULT = PARITY(MASK[, DIM])' 16287 16288 _Arguments_: 16289 MASK Shall be an array of type 'LOGICAL' 16290 DIM (Optional) shall be a scalar of type 'INTEGER' 16291 with a value in the range from 1 to n, where n 16292 equals the rank of MASK. 16293 16294 _Return value_: 16295 The result is of the same type as MASK. 16296 16297 If DIM is absent, a scalar with the parity of all elements in MASK 16298 is returned, i.e. true if an odd number of elements is '.true.' 16299 and false otherwise. If DIM is present, an array of rank n-1, 16300 where n equals the rank of ARRAY, and a shape similar to that of 16301 MASK with dimension DIM dropped is returned. 16302 16303 _Example_: 16304 PROGRAM test_sum 16305 LOGICAL :: x(2) = [ .true., .false. ] 16306 print *, PARITY(x) ! prints "T" (true). 16307 END PROGRAM 16308 16309 16310 File: gfortran.info, Node: PERROR, Next: POPCNT, Prev: PARITY, Up: Intrinsic Procedures 16311 16312 8.214 'PERROR' -- Print system error message 16313 ============================================ 16314 16315 _Description_: 16316 Prints (on the C 'stderr' stream) a newline-terminated error 16317 message corresponding to the last system error. This is prefixed 16318 by STRING, a colon and a space. See 'perror(3)'. 16319 16320 _Standard_: 16321 GNU extension 16322 16323 _Class_: 16324 Subroutine 16325 16326 _Syntax_: 16327 'CALL PERROR(STRING)' 16328 16329 _Arguments_: 16330 STRING A scalar of type 'CHARACTER' and of the default 16331 kind. 16332 16333 _See also_: 16334 *note IERRNO:: 16335 16336 16337 File: gfortran.info, Node: POPCNT, Next: POPPAR, Prev: PERROR, Up: Intrinsic Procedures 16338 16339 8.215 'POPCNT' -- Number of bits set 16340 ==================================== 16341 16342 _Description_: 16343 'POPCNT(I)' returns the number of bits set ('1' bits) in the binary 16344 representation of 'I'. 16345 16346 _Standard_: 16347 Fortran 2008 and later 16348 16349 _Class_: 16350 Elemental function 16351 16352 _Syntax_: 16353 'RESULT = POPCNT(I)' 16354 16355 _Arguments_: 16356 I Shall be of type 'INTEGER'. 16357 16358 _Return value_: 16359 The return value is of type 'INTEGER' and of the default integer 16360 kind. 16361 16362 _Example_: 16363 program test_population 16364 print *, popcnt(127), poppar(127) 16365 print *, popcnt(huge(0_4)), poppar(huge(0_4)) 16366 print *, popcnt(huge(0_8)), poppar(huge(0_8)) 16367 end program test_population 16368 _See also_: 16369 *note POPPAR::, *note LEADZ::, *note TRAILZ:: 16370 16371 16372 File: gfortran.info, Node: POPPAR, Next: PRECISION, Prev: POPCNT, Up: Intrinsic Procedures 16373 16374 8.216 'POPPAR' -- Parity of the number of bits set 16375 ================================================== 16376 16377 _Description_: 16378 'POPPAR(I)' returns parity of the integer 'I', i.e. the parity of 16379 the number of bits set ('1' bits) in the binary representation of 16380 'I'. It is equal to 0 if 'I' has an even number of bits set, and 1 16381 for an odd number of '1' bits. 16382 16383 _Standard_: 16384 Fortran 2008 and later 16385 16386 _Class_: 16387 Elemental function 16388 16389 _Syntax_: 16390 'RESULT = POPPAR(I)' 16391 16392 _Arguments_: 16393 I Shall be of type 'INTEGER'. 16394 16395 _Return value_: 16396 The return value is of type 'INTEGER' and of the default integer 16397 kind. 16398 16399 _Example_: 16400 program test_population 16401 print *, popcnt(127), poppar(127) 16402 print *, popcnt(huge(0_4)), poppar(huge(0_4)) 16403 print *, popcnt(huge(0_8)), poppar(huge(0_8)) 16404 end program test_population 16405 _See also_: 16406 *note POPCNT::, *note LEADZ::, *note TRAILZ:: 16407 16408 16409 File: gfortran.info, Node: PRECISION, Next: PRESENT, Prev: POPPAR, Up: Intrinsic Procedures 16410 16411 8.217 'PRECISION' -- Decimal precision of a real kind 16412 ===================================================== 16413 16414 _Description_: 16415 'PRECISION(X)' returns the decimal precision in the model of the 16416 type of 'X'. 16417 16418 _Standard_: 16419 Fortran 90 and later 16420 16421 _Class_: 16422 Inquiry function 16423 16424 _Syntax_: 16425 'RESULT = PRECISION(X)' 16426 16427 _Arguments_: 16428 X Shall be of type 'REAL' or 'COMPLEX'. It may be 16429 scalar or valued. 16430 16431 _Return value_: 16432 The return value is of type 'INTEGER' and of the default integer 16433 kind. 16434 16435 _Example_: 16436 program prec_and_range 16437 real(kind=4) :: x(2) 16438 complex(kind=8) :: y 16439 16440 print *, precision(x), range(x) 16441 print *, precision(y), range(y) 16442 end program prec_and_range 16443 _See also_: 16444 *note SELECTED_REAL_KIND::, *note RANGE:: 16445 16446 16447 File: gfortran.info, Node: PRESENT, Next: PRODUCT, Prev: PRECISION, Up: Intrinsic Procedures 16448 16449 8.218 'PRESENT' -- Determine whether an optional dummy argument is specified 16450 ============================================================================ 16451 16452 _Description_: 16453 Determines whether an optional dummy argument is present. 16454 16455 _Standard_: 16456 Fortran 90 and later 16457 16458 _Class_: 16459 Inquiry function 16460 16461 _Syntax_: 16462 'RESULT = PRESENT(A)' 16463 16464 _Arguments_: 16465 A May be of any type and may be a pointer, scalar 16466 or array value, or a dummy procedure. It shall 16467 be the name of an optional dummy argument 16468 accessible within the current subroutine or 16469 function. 16470 16471 _Return value_: 16472 Returns either 'TRUE' if the optional argument A is present, or 16473 'FALSE' otherwise. 16474 16475 _Example_: 16476 PROGRAM test_present 16477 WRITE(*,*) f(), f(42) ! "F T" 16478 CONTAINS 16479 LOGICAL FUNCTION f(x) 16480 INTEGER, INTENT(IN), OPTIONAL :: x 16481 f = PRESENT(x) 16482 END FUNCTION 16483 END PROGRAM 16484 16485 16486 File: gfortran.info, Node: PRODUCT, Next: RADIX, Prev: PRESENT, Up: Intrinsic Procedures 16487 16488 8.219 'PRODUCT' -- Product of array elements 16489 ============================================ 16490 16491 _Description_: 16492 Multiplies the elements of ARRAY along dimension DIM if the 16493 corresponding element in MASK is 'TRUE'. 16494 16495 _Standard_: 16496 Fortran 90 and later 16497 16498 _Class_: 16499 Transformational function 16500 16501 _Syntax_: 16502 'RESULT = PRODUCT(ARRAY[, MASK])' 16503 'RESULT = PRODUCT(ARRAY, DIM[, MASK])' 16504 16505 _Arguments_: 16506 ARRAY Shall be an array of type 'INTEGER', 'REAL' or 16507 'COMPLEX'. 16508 DIM (Optional) shall be a scalar of type 'INTEGER' 16509 with a value in the range from 1 to n, where n 16510 equals the rank of ARRAY. 16511 MASK (Optional) shall be of type 'LOGICAL' and either 16512 be a scalar or an array of the same shape as 16513 ARRAY. 16514 16515 _Return value_: 16516 The result is of the same type as ARRAY. 16517 16518 If DIM is absent, a scalar with the product of all elements in 16519 ARRAY is returned. Otherwise, an array of rank n-1, where n equals 16520 the rank of ARRAY, and a shape similar to that of ARRAY with 16521 dimension DIM dropped is returned. 16522 16523 _Example_: 16524 PROGRAM test_product 16525 INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /) 16526 print *, PRODUCT(x) ! all elements, product = 120 16527 print *, PRODUCT(x, MASK=MOD(x, 2)==1) ! odd elements, product = 15 16528 END PROGRAM 16529 16530 _See also_: 16531 *note SUM:: 16532 16533 16534 File: gfortran.info, Node: RADIX, Next: RAN, Prev: PRODUCT, Up: Intrinsic Procedures 16535 16536 8.220 'RADIX' -- Base of a model number 16537 ======================================= 16538 16539 _Description_: 16540 'RADIX(X)' returns the base of the model representing the entity X. 16541 16542 _Standard_: 16543 Fortran 90 and later 16544 16545 _Class_: 16546 Inquiry function 16547 16548 _Syntax_: 16549 'RESULT = RADIX(X)' 16550 16551 _Arguments_: 16552 X Shall be of type 'INTEGER' or 'REAL' 16553 16554 _Return value_: 16555 The return value is a scalar of type 'INTEGER' and of the default 16556 integer kind. 16557 16558 _Example_: 16559 program test_radix 16560 print *, "The radix for the default integer kind is", radix(0) 16561 print *, "The radix for the default real kind is", radix(0.0) 16562 end program test_radix 16563 _See also_: 16564 *note SELECTED_REAL_KIND:: 16565 16566 16567 File: gfortran.info, Node: RAN, Next: RAND, Prev: RADIX, Up: Intrinsic Procedures 16568 16569 8.221 'RAN' -- Real pseudo-random number 16570 ======================================== 16571 16572 _Description_: 16573 For compatibility with HP FORTRAN 77/iX, the 'RAN' intrinsic is 16574 provided as an alias for 'RAND'. See *note RAND:: for complete 16575 documentation. 16576 16577 _Standard_: 16578 GNU extension 16579 16580 _Class_: 16581 Function 16582 16583 _See also_: 16584 *note RAND::, *note RANDOM_NUMBER:: 16585 16586 16587 File: gfortran.info, Node: RAND, Next: RANDOM_INIT, Prev: RAN, Up: Intrinsic Procedures 16588 16589 8.222 'RAND' -- Real pseudo-random number 16590 ========================================= 16591 16592 _Description_: 16593 'RAND(FLAG)' returns a pseudo-random number from a uniform 16594 distribution between 0 and 1. If FLAG is 0, the next number in the 16595 current sequence is returned; if FLAG is 1, the generator is 16596 restarted by 'CALL SRAND(0)'; if FLAG has any other value, it is 16597 used as a new seed with 'SRAND'. 16598 16599 This intrinsic routine is provided for backwards compatibility with 16600 GNU Fortran 77. It implements a simple modulo generator as 16601 provided by 'g77'. For new code, one should consider the use of 16602 *note RANDOM_NUMBER:: as it implements a superior algorithm. 16603 16604 _Standard_: 16605 GNU extension 16606 16607 _Class_: 16608 Function 16609 16610 _Syntax_: 16611 'RESULT = RAND(I)' 16612 16613 _Arguments_: 16614 I Shall be a scalar 'INTEGER' of kind 4. 16615 16616 _Return value_: 16617 The return value is of 'REAL' type and the default kind. 16618 16619 _Example_: 16620 program test_rand 16621 integer,parameter :: seed = 86456 16622 16623 call srand(seed) 16624 print *, rand(), rand(), rand(), rand() 16625 print *, rand(seed), rand(), rand(), rand() 16626 end program test_rand 16627 16628 _See also_: 16629 *note SRAND::, *note RANDOM_NUMBER:: 16630 16631 16632 File: gfortran.info, Node: RANDOM_INIT, Next: RANDOM_NUMBER, Prev: RAND, Up: Intrinsic Procedures 16633 16634 8.223 'RANDOM_INIT' -- Initialize a pseudo-random number generator 16635 ================================================================== 16636 16637 _Description_: 16638 Initializes the state of the pseudorandom number generator used by 16639 'RANDOM_NUMBER'. 16640 16641 _Standard_: 16642 Fortran 2018 16643 16644 _Class_: 16645 Subroutine 16646 16647 _Syntax_: 16648 'CALL RANDOM_INIT(REPEATABLE, IMAGE_DISTINCT)' 16649 16650 _Arguments_: 16651 REPEATABLE Shall be a scalar with a 'LOGICAL' type, and it 16652 is 'INTENT(IN)'. If it is '.true.', the seed is 16653 set to a processor-dependent value that is the 16654 same each time 'RANDOM_INIT' is called from the 16655 same image. The term "same image" means a 16656 single instance of program execution. The 16657 sequence of random numbers is different for 16658 repeated execution of the program. If it is 16659 '.false.', the seed is set to a 16660 processor-dependent value. 16661 IMAGE_DISTINCT Shall be a scalar with a 'LOGICAL' type, and it 16662 is 'INTENT(IN)'. If it is '.true.', the seed is 16663 set to a processor-dependent value that is 16664 distinct from th seed set by a call to 16665 'RANDOM_INIT' in another image. If it is 16666 '.false.', the seed is set to a value that does 16667 depend which image called 'RANDOM_INIT'. 16668 16669 _Example_: 16670 program test_random_seed 16671 implicit none 16672 real x(3), y(3) 16673 call random_init(.true., .true.) 16674 call random_number(x) 16675 call random_init(.true., .true.) 16676 call random_number(y) 16677 ! x and y are the same sequence 16678 if (any(x /= y)) call abort 16679 end program test_random_seed 16680 16681 _See also_: 16682 *note RANDOM_NUMBER::, *note RANDOM_SEED:: 16683 16684 16685 File: gfortran.info, Node: RANDOM_NUMBER, Next: RANDOM_SEED, Prev: RANDOM_INIT, Up: Intrinsic Procedures 16686 16687 8.224 'RANDOM_NUMBER' -- Pseudo-random number 16688 ============================================= 16689 16690 _Description_: 16691 Returns a single pseudorandom number or an array of pseudorandom 16692 numbers from the uniform distribution over the range 0 \leq x < 1. 16693 16694 The runtime-library implements the xoshiro256** pseudorandom number 16695 generator (PRNG). This generator has a period of 2^{256} - 1, and 16696 when using multiple threads up to 2^{128} threads can each generate 16697 2^{128} random numbers before any aliasing occurs. 16698 16699 Note that in a multi-threaded program (e.g. using OpenMP 16700 directives), each thread will have its own random number state. 16701 For details of the seeding procedure, see the documentation for the 16702 'RANDOM_SEED' intrinsic. 16703 16704 _Standard_: 16705 Fortran 90 and later 16706 16707 _Class_: 16708 Subroutine 16709 16710 _Syntax_: 16711 'CALL RANDOM_NUMBER(HARVEST)' 16712 16713 _Arguments_: 16714 HARVEST Shall be a scalar or an array of type 'REAL'. 16715 16716 _Example_: 16717 program test_random_number 16718 REAL :: r(5,5) 16719 CALL RANDOM_NUMBER(r) 16720 end program 16721 16722 _See also_: 16723 *note RANDOM_SEED::, *note RANDOM_INIT:: 16724 16725 16726 File: gfortran.info, Node: RANDOM_SEED, Next: RANGE, Prev: RANDOM_NUMBER, Up: Intrinsic Procedures 16727 16728 8.225 'RANDOM_SEED' -- Initialize a pseudo-random number sequence 16729 ================================================================= 16730 16731 _Description_: 16732 Restarts or queries the state of the pseudorandom number generator 16733 used by 'RANDOM_NUMBER'. 16734 16735 If 'RANDOM_SEED' is called without arguments, it is seeded with 16736 random data retrieved from the operating system. 16737 16738 As an extension to the Fortran standard, the GFortran 16739 'RANDOM_NUMBER' supports multiple threads. Each thread in a 16740 multi-threaded program has its own seed. When 'RANDOM_SEED' is 16741 called either without arguments or with the PUT argument, the given 16742 seed is copied into a master seed as well as the seed of the 16743 current thread. When a new thread uses 'RANDOM_NUMBER' for the 16744 first time, the seed is copied from the master seed, and forwarded 16745 N * 2^{128} steps to guarantee that the random stream does not 16746 alias any other stream in the system, where N is the number of 16747 threads that have used 'RANDOM_NUMBER' so far during the program 16748 execution. 16749 16750 _Standard_: 16751 Fortran 90 and later 16752 16753 _Class_: 16754 Subroutine 16755 16756 _Syntax_: 16757 'CALL RANDOM_SEED([SIZE, PUT, GET])' 16758 16759 _Arguments_: 16760 SIZE (Optional) Shall be a scalar and of type default 16761 'INTEGER', with 'INTENT(OUT)'. It specifies the 16762 minimum size of the arrays used with the PUT and 16763 GET arguments. 16764 PUT (Optional) Shall be an array of type default 16765 'INTEGER' and rank one. It is 'INTENT(IN)' and 16766 the size of the array must be larger than or 16767 equal to the number returned by the SIZE 16768 argument. 16769 GET (Optional) Shall be an array of type default 16770 'INTEGER' and rank one. It is 'INTENT(OUT)' and 16771 the size of the array must be larger than or 16772 equal to the number returned by the SIZE 16773 argument. 16774 16775 _Example_: 16776 program test_random_seed 16777 implicit none 16778 integer, allocatable :: seed(:) 16779 integer :: n 16780 16781 call random_seed(size = n) 16782 allocate(seed(n)) 16783 call random_seed(get=seed) 16784 write (*, *) seed 16785 end program test_random_seed 16786 16787 _See also_: 16788 *note RANDOM_NUMBER::, *note RANDOM_INIT:: 16789 16790 16791 File: gfortran.info, Node: RANGE, Next: RANK, Prev: RANDOM_SEED, Up: Intrinsic Procedures 16792 16793 8.226 'RANGE' -- Decimal exponent range 16794 ======================================= 16795 16796 _Description_: 16797 'RANGE(X)' returns the decimal exponent range in the model of the 16798 type of 'X'. 16799 16800 _Standard_: 16801 Fortran 90 and later 16802 16803 _Class_: 16804 Inquiry function 16805 16806 _Syntax_: 16807 'RESULT = RANGE(X)' 16808 16809 _Arguments_: 16810 X Shall be of type 'INTEGER', 'REAL' or 'COMPLEX'. 16811 16812 _Return value_: 16813 The return value is of type 'INTEGER' and of the default integer 16814 kind. 16815 16816 _Example_: 16817 See 'PRECISION' for an example. 16818 _See also_: 16819 *note SELECTED_REAL_KIND::, *note PRECISION:: 16820 16821 16822 File: gfortran.info, Node: RANK, Next: REAL, Prev: RANGE, Up: Intrinsic Procedures 16823 16824 8.227 'RANK' -- Rank of a data object 16825 ===================================== 16826 16827 _Description_: 16828 'RANK(A)' returns the rank of a scalar or array data object. 16829 16830 _Standard_: 16831 Technical Specification (TS) 29113 16832 16833 _Class_: 16834 Inquiry function 16835 16836 _Syntax_: 16837 'RESULT = RANK(A)' 16838 16839 _Arguments_: 16840 A can be of any type 16841 16842 _Return value_: 16843 The return value is of type 'INTEGER' and of the default integer 16844 kind. For arrays, their rank is returned; for scalars zero is 16845 returned. 16846 16847 _Example_: 16848 program test_rank 16849 integer :: a 16850 real, allocatable :: b(:,:) 16851 16852 print *, rank(a), rank(b) ! Prints: 0 2 16853 end program test_rank 16854 16855 16856 File: gfortran.info, Node: REAL, Next: RENAME, Prev: RANK, Up: Intrinsic Procedures 16857 16858 8.228 'REAL' -- Convert to real type 16859 ==================================== 16860 16861 _Description_: 16862 'REAL(A [, KIND])' converts its argument A to a real type. The 16863 'REALPART' function is provided for compatibility with 'g77', and 16864 its use is strongly discouraged. 16865 16866 _Standard_: 16867 Fortran 77 and later, with KIND argument Fortran 90 and later, has 16868 GNU extensions 16869 16870 _Class_: 16871 Elemental function 16872 16873 _Syntax_: 16874 'RESULT = REAL(A [, KIND])' 16875 'RESULT = REALPART(Z)' 16876 16877 _Arguments_: 16878 A Shall be 'INTEGER', 'REAL', or 'COMPLEX'. 16879 KIND (Optional) An 'INTEGER' initialization 16880 expression indicating the kind parameter of the 16881 result. 16882 16883 _Return value_: 16884 These functions return a 'REAL' variable or array under the 16885 following rules: 16886 16887 (A) 16888 'REAL(A)' is converted to a default real type if A is an 16889 integer or real variable. 16890 (B) 16891 'REAL(A)' is converted to a real type with the kind type 16892 parameter of A if A is a complex variable. 16893 (C) 16894 'REAL(A, KIND)' is converted to a real type with kind type 16895 parameter KIND if A is a complex, integer, or real variable. 16896 16897 _Example_: 16898 program test_real 16899 complex :: x = (1.0, 2.0) 16900 print *, real(x), real(x,8), realpart(x) 16901 end program test_real 16902 16903 _Specific names_: 16904 Name Argument Return type Standard 16905 ------------------------------------------------------------------------- 16906 'FLOAT(A)' 'INTEGER(4)' 'REAL(4)' Fortran 77 and later 16907 'DFLOAT(A)' 'INTEGER(4)' 'REAL(8)' GNU extension 16908 'FLOATI(A)' 'INTEGER(2)' 'REAL(4)' GNU extension (-fdec) 16909 'FLOATJ(A)' 'INTEGER(4)' 'REAL(4)' GNU extension (-fdec) 16910 'FLOATK(A)' 'INTEGER(8)' 'REAL(4)' GNU extension (-fdec) 16911 'SNGL(A)' 'REAL(8)' 'REAL(4)' Fortran 77 and later 16912 16913 _See also_: 16914 *note DBLE:: 16915 16916 16917 File: gfortran.info, Node: RENAME, Next: REPEAT, Prev: REAL, Up: Intrinsic Procedures 16918 16919 8.229 'RENAME' -- Rename a file 16920 =============================== 16921 16922 _Description_: 16923 Renames a file from file PATH1 to PATH2. A null character 16924 ('CHAR(0)') can be used to mark the end of the names in PATH1 and 16925 PATH2; otherwise, trailing blanks in the file names are ignored. 16926 If the STATUS argument is supplied, it contains 0 on success or a 16927 nonzero error code upon return; see 'rename(2)'. 16928 16929 This intrinsic is provided in both subroutine and function forms; 16930 however, only one form can be used in any given program unit. 16931 16932 _Standard_: 16933 GNU extension 16934 16935 _Class_: 16936 Subroutine, function 16937 16938 _Syntax_: 16939 'CALL RENAME(PATH1, PATH2 [, STATUS])' 16940 'STATUS = RENAME(PATH1, PATH2)' 16941 16942 _Arguments_: 16943 PATH1 Shall be of default 'CHARACTER' type. 16944 PATH2 Shall be of default 'CHARACTER' type. 16945 STATUS (Optional) Shall be of default 'INTEGER' type. 16946 16947 _See also_: 16948 *note LINK:: 16949 16950 16951 File: gfortran.info, Node: REPEAT, Next: RESHAPE, Prev: RENAME, Up: Intrinsic Procedures 16952 16953 8.230 'REPEAT' -- Repeated string concatenation 16954 =============================================== 16955 16956 _Description_: 16957 Concatenates NCOPIES copies of a string. 16958 16959 _Standard_: 16960 Fortran 90 and later 16961 16962 _Class_: 16963 Transformational function 16964 16965 _Syntax_: 16966 'RESULT = REPEAT(STRING, NCOPIES)' 16967 16968 _Arguments_: 16969 STRING Shall be scalar and of type 'CHARACTER'. 16970 NCOPIES Shall be scalar and of type 'INTEGER'. 16971 16972 _Return value_: 16973 A new scalar of type 'CHARACTER' built up from NCOPIES copies of 16974 STRING. 16975 16976 _Example_: 16977 program test_repeat 16978 write(*,*) repeat("x", 5) ! "xxxxx" 16979 end program 16980 16981 16982 File: gfortran.info, Node: RESHAPE, Next: RRSPACING, Prev: REPEAT, Up: Intrinsic Procedures 16983 16984 8.231 'RESHAPE' -- Function to reshape an array 16985 =============================================== 16986 16987 _Description_: 16988 Reshapes SOURCE to correspond to SHAPE. If necessary, the new 16989 array may be padded with elements from PAD or permuted as defined 16990 by ORDER. 16991 16992 _Standard_: 16993 Fortran 90 and later 16994 16995 _Class_: 16996 Transformational function 16997 16998 _Syntax_: 16999 'RESULT = RESHAPE(SOURCE, SHAPE[, PAD, ORDER])' 17000 17001 _Arguments_: 17002 SOURCE Shall be an array of any type. 17003 SHAPE Shall be of type 'INTEGER' and an array of rank 17004 one. Its values must be positive or zero. 17005 PAD (Optional) shall be an array of the same type as 17006 SOURCE. 17007 ORDER (Optional) shall be of type 'INTEGER' and an 17008 array of the same shape as SHAPE. Its values 17009 shall be a permutation of the numbers from 1 to 17010 n, where n is the size of SHAPE. If ORDER is 17011 absent, the natural ordering shall be assumed. 17012 17013 _Return value_: 17014 The result is an array of shape SHAPE with the same type as SOURCE. 17015 17016 _Example_: 17017 PROGRAM test_reshape 17018 INTEGER, DIMENSION(4) :: x 17019 WRITE(*,*) SHAPE(x) ! prints "4" 17020 WRITE(*,*) SHAPE(RESHAPE(x, (/2, 2/))) ! prints "2 2" 17021 END PROGRAM 17022 17023 _See also_: 17024 *note SHAPE:: 17025 17026 17027 File: gfortran.info, Node: RRSPACING, Next: RSHIFT, Prev: RESHAPE, Up: Intrinsic Procedures 17028 17029 8.232 'RRSPACING' -- Reciprocal of the relative spacing 17030 ======================================================= 17031 17032 _Description_: 17033 'RRSPACING(X)' returns the reciprocal of the relative spacing of 17034 model numbers near X. 17035 17036 _Standard_: 17037 Fortran 90 and later 17038 17039 _Class_: 17040 Elemental function 17041 17042 _Syntax_: 17043 'RESULT = RRSPACING(X)' 17044 17045 _Arguments_: 17046 X Shall be of type 'REAL'. 17047 17048 _Return value_: 17049 The return value is of the same type and kind as X. The value 17050 returned is equal to 'ABS(FRACTION(X)) * 17051 FLOAT(RADIX(X))**DIGITS(X)'. 17052 17053 _See also_: 17054 *note SPACING:: 17055 17056 17057 File: gfortran.info, Node: RSHIFT, Next: SAME_TYPE_AS, Prev: RRSPACING, Up: Intrinsic Procedures 17058 17059 8.233 'RSHIFT' -- Right shift bits 17060 ================================== 17061 17062 _Description_: 17063 'RSHIFT' returns a value corresponding to I with all of the bits 17064 shifted right by SHIFT places. SHIFT shall be nonnegative and less 17065 than or equal to 'BIT_SIZE(I)', otherwise the result value is 17066 undefined. Bits shifted out from the right end are lost. The fill 17067 is arithmetic: the bits shifted in from the left end are equal to 17068 the leftmost bit, which in two's complement representation is the 17069 sign bit. 17070 17071 This function has been superseded by the 'SHIFTA' intrinsic, which 17072 is standard in Fortran 2008 and later. 17073 17074 _Standard_: 17075 GNU extension 17076 17077 _Class_: 17078 Elemental function 17079 17080 _Syntax_: 17081 'RESULT = RSHIFT(I, SHIFT)' 17082 17083 _Arguments_: 17084 I The type shall be 'INTEGER'. 17085 SHIFT The type shall be 'INTEGER'. 17086 17087 _Return value_: 17088 The return value is of type 'INTEGER' and of the same kind as I. 17089 17090 _See also_: 17091 *note ISHFT::, *note ISHFTC::, *note LSHIFT::, *note SHIFTA::, 17092 *note SHIFTR::, *note SHIFTL:: 17093 17094 17095 File: gfortran.info, Node: SAME_TYPE_AS, Next: SCALE, Prev: RSHIFT, Up: Intrinsic Procedures 17096 17097 8.234 'SAME_TYPE_AS' -- Query dynamic types for equality 17098 ======================================================== 17099 17100 _Description_: 17101 Query dynamic types for equality. 17102 17103 _Standard_: 17104 Fortran 2003 and later 17105 17106 _Class_: 17107 Inquiry function 17108 17109 _Syntax_: 17110 'RESULT = SAME_TYPE_AS(A, B)' 17111 17112 _Arguments_: 17113 A Shall be an object of extensible declared type 17114 or unlimited polymorphic. 17115 B Shall be an object of extensible declared type 17116 or unlimited polymorphic. 17117 17118 _Return value_: 17119 The return value is a scalar of type default logical. It is true 17120 if and only if the dynamic type of A is the same as the dynamic 17121 type of B. 17122 17123 _See also_: 17124 *note EXTENDS_TYPE_OF:: 17125 17126 17127 File: gfortran.info, Node: SCALE, Next: SCAN, Prev: SAME_TYPE_AS, Up: Intrinsic Procedures 17128 17129 8.235 'SCALE' -- Scale a real value 17130 =================================== 17131 17132 _Description_: 17133 'SCALE(X,I)' returns 'X * RADIX(X)**I'. 17134 17135 _Standard_: 17136 Fortran 90 and later 17137 17138 _Class_: 17139 Elemental function 17140 17141 _Syntax_: 17142 'RESULT = SCALE(X, I)' 17143 17144 _Arguments_: 17145 X The type of the argument shall be a 'REAL'. 17146 I The type of the argument shall be a 'INTEGER'. 17147 17148 _Return value_: 17149 The return value is of the same type and kind as X. Its value is 17150 'X * RADIX(X)**I'. 17151 17152 _Example_: 17153 program test_scale 17154 real :: x = 178.1387e-4 17155 integer :: i = 5 17156 print *, scale(x,i), x*radix(x)**i 17157 end program test_scale 17158 17159 17160 File: gfortran.info, Node: SCAN, Next: SECNDS, Prev: SCALE, Up: Intrinsic Procedures 17161 17162 8.236 'SCAN' -- Scan a string for the presence of a set of characters 17163 ===================================================================== 17164 17165 _Description_: 17166 Scans a STRING for any of the characters in a SET of characters. 17167 17168 If BACK is either absent or equals 'FALSE', this function returns 17169 the position of the leftmost character of STRING that is in SET. 17170 If BACK equals 'TRUE', the rightmost position is returned. If no 17171 character of SET is found in STRING, the result is zero. 17172 17173 _Standard_: 17174 Fortran 90 and later, with KIND argument Fortran 2003 and later 17175 17176 _Class_: 17177 Elemental function 17178 17179 _Syntax_: 17180 'RESULT = SCAN(STRING, SET[, BACK [, KIND]])' 17181 17182 _Arguments_: 17183 STRING Shall be of type 'CHARACTER'. 17184 SET Shall be of type 'CHARACTER'. 17185 BACK (Optional) shall be of type 'LOGICAL'. 17186 KIND (Optional) An 'INTEGER' initialization 17187 expression indicating the kind parameter of the 17188 result. 17189 17190 _Return value_: 17191 The return value is of type 'INTEGER' and of kind KIND. If KIND is 17192 absent, the return value is of default integer kind. 17193 17194 _Example_: 17195 PROGRAM test_scan 17196 WRITE(*,*) SCAN("FORTRAN", "AO") ! 2, found 'O' 17197 WRITE(*,*) SCAN("FORTRAN", "AO", .TRUE.) ! 6, found 'A' 17198 WRITE(*,*) SCAN("FORTRAN", "C++") ! 0, found none 17199 END PROGRAM 17200 17201 _See also_: 17202 *note INDEX intrinsic::, *note VERIFY:: 17203 17204 17205 File: gfortran.info, Node: SECNDS, Next: SECOND, Prev: SCAN, Up: Intrinsic Procedures 17206 17207 8.237 'SECNDS' -- Time function 17208 =============================== 17209 17210 _Description_: 17211 'SECNDS(X)' gets the time in seconds from the real-time system 17212 clock. X is a reference time, also in seconds. If this is zero, 17213 the time in seconds from midnight is returned. This function is 17214 non-standard and its use is discouraged. 17215 17216 _Standard_: 17217 GNU extension 17218 17219 _Class_: 17220 Function 17221 17222 _Syntax_: 17223 'RESULT = SECNDS (X)' 17224 17225 _Arguments_: 17226 T Shall be of type 'REAL(4)'. 17227 X Shall be of type 'REAL(4)'. 17228 17229 _Return value_: 17230 None 17231 17232 _Example_: 17233 program test_secnds 17234 integer :: i 17235 real(4) :: t1, t2 17236 print *, secnds (0.0) ! seconds since midnight 17237 t1 = secnds (0.0) ! reference time 17238 do i = 1, 10000000 ! do something 17239 end do 17240 t2 = secnds (t1) ! elapsed time 17241 print *, "Something took ", t2, " seconds." 17242 end program test_secnds 17243 17244 17245 File: gfortran.info, Node: SECOND, Next: SELECTED_CHAR_KIND, Prev: SECNDS, Up: Intrinsic Procedures 17246 17247 8.238 'SECOND' -- CPU time function 17248 =================================== 17249 17250 _Description_: 17251 Returns a 'REAL(4)' value representing the elapsed CPU time in 17252 seconds. This provides the same functionality as the standard 17253 'CPU_TIME' intrinsic, and is only included for backwards 17254 compatibility. 17255 17256 This intrinsic is provided in both subroutine and function forms; 17257 however, only one form can be used in any given program unit. 17258 17259 _Standard_: 17260 GNU extension 17261 17262 _Class_: 17263 Subroutine, function 17264 17265 _Syntax_: 17266 'CALL SECOND(TIME)' 17267 'TIME = SECOND()' 17268 17269 _Arguments_: 17270 TIME Shall be of type 'REAL(4)'. 17271 17272 _Return value_: 17273 In either syntax, TIME is set to the process's current runtime in 17274 seconds. 17275 17276 _See also_: 17277 *note CPU_TIME:: 17278 17279 17280 File: gfortran.info, Node: SELECTED_CHAR_KIND, Next: SELECTED_INT_KIND, Prev: SECOND, Up: Intrinsic Procedures 17281 17282 8.239 'SELECTED_CHAR_KIND' -- Choose character kind 17283 =================================================== 17284 17285 _Description_: 17286 17287 'SELECTED_CHAR_KIND(NAME)' returns the kind value for the character 17288 set named NAME, if a character set with such a name is supported, 17289 or -1 otherwise. Currently, supported character sets include 17290 "ASCII" and "DEFAULT", which are equivalent, and "ISO_10646" 17291 (Universal Character Set, UCS-4) which is commonly known as 17292 Unicode. 17293 17294 _Standard_: 17295 Fortran 2003 and later 17296 17297 _Class_: 17298 Transformational function 17299 17300 _Syntax_: 17301 'RESULT = SELECTED_CHAR_KIND(NAME)' 17302 17303 _Arguments_: 17304 NAME Shall be a scalar and of the default character 17305 type. 17306 17307 _Example_: 17308 program character_kind 17309 use iso_fortran_env 17310 implicit none 17311 integer, parameter :: ascii = selected_char_kind ("ascii") 17312 integer, parameter :: ucs4 = selected_char_kind ('ISO_10646') 17313 17314 character(kind=ascii, len=26) :: alphabet 17315 character(kind=ucs4, len=30) :: hello_world 17316 17317 alphabet = ascii_"abcdefghijklmnopqrstuvwxyz" 17318 hello_world = ucs4_'Hello World and Ni Hao -- ' & 17319 // char (int (z'4F60'), ucs4) & 17320 // char (int (z'597D'), ucs4) 17321 17322 write (*,*) alphabet 17323 17324 open (output_unit, encoding='UTF-8') 17325 write (*,*) trim (hello_world) 17326 end program character_kind 17327 17328 17329 File: gfortran.info, Node: SELECTED_INT_KIND, Next: SELECTED_REAL_KIND, Prev: SELECTED_CHAR_KIND, Up: Intrinsic Procedures 17330 17331 8.240 'SELECTED_INT_KIND' -- Choose integer kind 17332 ================================================ 17333 17334 _Description_: 17335 'SELECTED_INT_KIND(R)' return the kind value of the smallest 17336 integer type that can represent all values ranging from -10^R 17337 (exclusive) to 10^R (exclusive). If there is no integer kind that 17338 accommodates this range, 'SELECTED_INT_KIND' returns -1. 17339 17340 _Standard_: 17341 Fortran 90 and later 17342 17343 _Class_: 17344 Transformational function 17345 17346 _Syntax_: 17347 'RESULT = SELECTED_INT_KIND(R)' 17348 17349 _Arguments_: 17350 R Shall be a scalar and of type 'INTEGER'. 17351 17352 _Example_: 17353 program large_integers 17354 integer,parameter :: k5 = selected_int_kind(5) 17355 integer,parameter :: k15 = selected_int_kind(15) 17356 integer(kind=k5) :: i5 17357 integer(kind=k15) :: i15 17358 17359 print *, huge(i5), huge(i15) 17360 17361 ! The following inequalities are always true 17362 print *, huge(i5) >= 10_k5**5-1 17363 print *, huge(i15) >= 10_k15**15-1 17364 end program large_integers 17365 17366 17367 File: gfortran.info, Node: SELECTED_REAL_KIND, Next: SET_EXPONENT, Prev: SELECTED_INT_KIND, Up: Intrinsic Procedures 17368 17369 8.241 'SELECTED_REAL_KIND' -- Choose real kind 17370 ============================================== 17371 17372 _Description_: 17373 'SELECTED_REAL_KIND(P,R)' returns the kind value of a real data 17374 type with decimal precision of at least 'P' digits, exponent range 17375 of at least 'R', and with a radix of 'RADIX'. 17376 17377 _Standard_: 17378 Fortran 90 and later, with 'RADIX' Fortran 2008 or later 17379 17380 _Class_: 17381 Transformational function 17382 17383 _Syntax_: 17384 'RESULT = SELECTED_REAL_KIND([P, R, RADIX])' 17385 17386 _Arguments_: 17387 P (Optional) shall be a scalar and of type 17388 'INTEGER'. 17389 R (Optional) shall be a scalar and of type 17390 'INTEGER'. 17391 RADIX (Optional) shall be a scalar and of type 17392 'INTEGER'. 17393 Before Fortran 2008, at least one of the arguments R or P shall be 17394 present; since Fortran 2008, they are assumed to be zero if absent. 17395 17396 _Return value_: 17397 17398 'SELECTED_REAL_KIND' returns the value of the kind type parameter 17399 of a real data type with decimal precision of at least 'P' digits, 17400 a decimal exponent range of at least 'R', and with the requested 17401 'RADIX'. If the 'RADIX' parameter is absent, real kinds with any 17402 radix can be returned. If more than one real data type meet the 17403 criteria, the kind of the data type with the smallest decimal 17404 precision is returned. If no real data type matches the criteria, 17405 the result is 17406 -1 if the processor does not support a real data type with a 17407 precision greater than or equal to 'P', but the 'R' and 17408 'RADIX' requirements can be fulfilled 17409 -2 if the processor does not support a real type with an exponent 17410 range greater than or equal to 'R', but 'P' and 'RADIX' are 17411 fulfillable 17412 -3 if 'RADIX' but not 'P' and 'R' requirements 17413 are fulfillable 17414 -4 if 'RADIX' and either 'P' or 'R' requirements 17415 are fulfillable 17416 -5 if there is no real type with the given 'RADIX' 17417 17418 _Example_: 17419 program real_kinds 17420 integer,parameter :: p6 = selected_real_kind(6) 17421 integer,parameter :: p10r100 = selected_real_kind(10,100) 17422 integer,parameter :: r400 = selected_real_kind(r=400) 17423 real(kind=p6) :: x 17424 real(kind=p10r100) :: y 17425 real(kind=r400) :: z 17426 17427 print *, precision(x), range(x) 17428 print *, precision(y), range(y) 17429 print *, precision(z), range(z) 17430 end program real_kinds 17431 _See also_: 17432 *note PRECISION::, *note RANGE::, *note RADIX:: 17433 17434 17435 File: gfortran.info, Node: SET_EXPONENT, Next: SHAPE, Prev: SELECTED_REAL_KIND, Up: Intrinsic Procedures 17436 17437 8.242 'SET_EXPONENT' -- Set the exponent of the model 17438 ===================================================== 17439 17440 _Description_: 17441 'SET_EXPONENT(X, I)' returns the real number whose fractional part 17442 is that of X and whose exponent part is I. 17443 17444 _Standard_: 17445 Fortran 90 and later 17446 17447 _Class_: 17448 Elemental function 17449 17450 _Syntax_: 17451 'RESULT = SET_EXPONENT(X, I)' 17452 17453 _Arguments_: 17454 X Shall be of type 'REAL'. 17455 I Shall be of type 'INTEGER'. 17456 17457 _Return value_: 17458 The return value is of the same type and kind as X. The real 17459 number whose fractional part is that of X and whose exponent part 17460 if I is returned; it is 'FRACTION(X) * RADIX(X)**I'. 17461 17462 _Example_: 17463 PROGRAM test_setexp 17464 REAL :: x = 178.1387e-4 17465 INTEGER :: i = 17 17466 PRINT *, SET_EXPONENT(x, i), FRACTION(x) * RADIX(x)**i 17467 END PROGRAM 17468 17469 17470 File: gfortran.info, Node: SHAPE, Next: SHIFTA, Prev: SET_EXPONENT, Up: Intrinsic Procedures 17471 17472 8.243 'SHAPE' -- Determine the shape of an array 17473 ================================================ 17474 17475 _Description_: 17476 Determines the shape of an array. 17477 17478 _Standard_: 17479 Fortran 90 and later, with KIND argument Fortran 2003 and later 17480 17481 _Class_: 17482 Inquiry function 17483 17484 _Syntax_: 17485 'RESULT = SHAPE(SOURCE [, KIND])' 17486 17487 _Arguments_: 17488 SOURCE Shall be an array or scalar of any type. If 17489 SOURCE is a pointer it must be associated and 17490 allocatable arrays must be allocated. 17491 KIND (Optional) An 'INTEGER' initialization 17492 expression indicating the kind parameter of the 17493 result. 17494 17495 _Return value_: 17496 An 'INTEGER' array of rank one with as many elements as SOURCE has 17497 dimensions. The elements of the resulting array correspond to the 17498 extend of SOURCE along the respective dimensions. If SOURCE is a 17499 scalar, the result is the rank one array of size zero. If KIND is 17500 absent, the return value has the default integer kind otherwise the 17501 specified kind. 17502 17503 _Example_: 17504 PROGRAM test_shape 17505 INTEGER, DIMENSION(-1:1, -1:2) :: A 17506 WRITE(*,*) SHAPE(A) ! (/ 3, 4 /) 17507 WRITE(*,*) SIZE(SHAPE(42)) ! (/ /) 17508 END PROGRAM 17509 17510 _See also_: 17511 *note RESHAPE::, *note SIZE:: 17512 17513 17514 File: gfortran.info, Node: SHIFTA, Next: SHIFTL, Prev: SHAPE, Up: Intrinsic Procedures 17515 17516 8.244 'SHIFTA' -- Right shift with fill 17517 ======================================= 17518 17519 _Description_: 17520 'SHIFTA' returns a value corresponding to I with all of the bits 17521 shifted right by SHIFT places. SHIFT that be nonnegative and less 17522 than or equal to 'BIT_SIZE(I)', otherwise the result value is 17523 undefined. Bits shifted out from the right end are lost. The fill 17524 is arithmetic: the bits shifted in from the left end are equal to 17525 the leftmost bit, which in two's complement representation is the 17526 sign bit. 17527 17528 _Standard_: 17529 Fortran 2008 and later 17530 17531 _Class_: 17532 Elemental function 17533 17534 _Syntax_: 17535 'RESULT = SHIFTA(I, SHIFT)' 17536 17537 _Arguments_: 17538 I The type shall be 'INTEGER'. 17539 SHIFT The type shall be 'INTEGER'. 17540 17541 _Return value_: 17542 The return value is of type 'INTEGER' and of the same kind as I. 17543 17544 _See also_: 17545 *note SHIFTL::, *note SHIFTR:: 17546 17547 17548 File: gfortran.info, Node: SHIFTL, Next: SHIFTR, Prev: SHIFTA, Up: Intrinsic Procedures 17549 17550 8.245 'SHIFTL' -- Left shift 17551 ============================ 17552 17553 _Description_: 17554 'SHIFTL' returns a value corresponding to I with all of the bits 17555 shifted left by SHIFT places. SHIFT shall be nonnegative and less 17556 than or equal to 'BIT_SIZE(I)', otherwise the result value is 17557 undefined. Bits shifted out from the left end are lost, and bits 17558 shifted in from the right end are set to 0. 17559 17560 _Standard_: 17561 Fortran 2008 and later 17562 17563 _Class_: 17564 Elemental function 17565 17566 _Syntax_: 17567 'RESULT = SHIFTL(I, SHIFT)' 17568 17569 _Arguments_: 17570 I The type shall be 'INTEGER'. 17571 SHIFT The type shall be 'INTEGER'. 17572 17573 _Return value_: 17574 The return value is of type 'INTEGER' and of the same kind as I. 17575 17576 _See also_: 17577 *note SHIFTA::, *note SHIFTR:: 17578 17579 17580 File: gfortran.info, Node: SHIFTR, Next: SIGN, Prev: SHIFTL, Up: Intrinsic Procedures 17581 17582 8.246 'SHIFTR' -- Right shift 17583 ============================= 17584 17585 _Description_: 17586 'SHIFTR' returns a value corresponding to I with all of the bits 17587 shifted right by SHIFT places. SHIFT shall be nonnegative and less 17588 than or equal to 'BIT_SIZE(I)', otherwise the result value is 17589 undefined. Bits shifted out from the right end are lost, and bits 17590 shifted in from the left end are set to 0. 17591 17592 _Standard_: 17593 Fortran 2008 and later 17594 17595 _Class_: 17596 Elemental function 17597 17598 _Syntax_: 17599 'RESULT = SHIFTR(I, SHIFT)' 17600 17601 _Arguments_: 17602 I The type shall be 'INTEGER'. 17603 SHIFT The type shall be 'INTEGER'. 17604 17605 _Return value_: 17606 The return value is of type 'INTEGER' and of the same kind as I. 17607 17608 _See also_: 17609 *note SHIFTA::, *note SHIFTL:: 17610 17611 17612 File: gfortran.info, Node: SIGN, Next: SIGNAL, Prev: SHIFTR, Up: Intrinsic Procedures 17613 17614 8.247 'SIGN' -- Sign copying function 17615 ===================================== 17616 17617 _Description_: 17618 'SIGN(A,B)' returns the value of A with the sign of B. 17619 17620 _Standard_: 17621 Fortran 77 and later 17622 17623 _Class_: 17624 Elemental function 17625 17626 _Syntax_: 17627 'RESULT = SIGN(A, B)' 17628 17629 _Arguments_: 17630 A Shall be of type 'INTEGER' or 'REAL' 17631 B Shall be of the same type and kind as A. 17632 17633 _Return value_: 17634 The kind of the return value is that of A and B. If B \ge 0 then 17635 the result is 'ABS(A)', else it is '-ABS(A)'. 17636 17637 _Example_: 17638 program test_sign 17639 print *, sign(-12,1) 17640 print *, sign(-12,0) 17641 print *, sign(-12,-1) 17642 17643 print *, sign(-12.,1.) 17644 print *, sign(-12.,0.) 17645 print *, sign(-12.,-1.) 17646 end program test_sign 17647 17648 _Specific names_: 17649 Name Arguments Return type Standard 17650 ------------------------------------------------------------------------- 17651 'SIGN(A,B)' 'REAL(4) A, B' 'REAL(4)' Fortran 77 and later 17652 'ISIGN(A,B)' 'INTEGER(4) A, B' 'INTEGER(4)' Fortran 77 and later 17653 'DSIGN(A,B)' 'REAL(8) A, B' 'REAL(8)' Fortran 77 and later 17654 17655 17656 File: gfortran.info, Node: SIGNAL, Next: SIN, Prev: SIGN, Up: Intrinsic Procedures 17657 17658 8.248 'SIGNAL' -- Signal handling subroutine (or function) 17659 ========================================================== 17660 17661 _Description_: 17662 'SIGNAL(NUMBER, HANDLER [, STATUS])' causes external subroutine 17663 HANDLER to be executed with a single integer argument when signal 17664 NUMBER occurs. If HANDLER is an integer, it can be used to turn 17665 off handling of signal NUMBER or revert to its default action. See 17666 'signal(2)'. 17667 17668 If 'SIGNAL' is called as a subroutine and the STATUS argument is 17669 supplied, it is set to the value returned by 'signal(2)'. 17670 17671 _Standard_: 17672 GNU extension 17673 17674 _Class_: 17675 Subroutine, function 17676 17677 _Syntax_: 17678 'CALL SIGNAL(NUMBER, HANDLER [, STATUS])' 17679 'STATUS = SIGNAL(NUMBER, HANDLER)' 17680 17681 _Arguments_: 17682 NUMBER Shall be a scalar integer, with 'INTENT(IN)' 17683 HANDLER Signal handler ('INTEGER FUNCTION' or 17684 'SUBROUTINE') or dummy/global 'INTEGER' scalar. 17685 'INTEGER'. It is 'INTENT(IN)'. 17686 STATUS (Optional) STATUS shall be a scalar integer. It 17687 has 'INTENT(OUT)'. 17688 17689 _Return value_: 17690 The 'SIGNAL' function returns the value returned by 'signal(2)'. 17691 17692 _Example_: 17693 program test_signal 17694 intrinsic signal 17695 external handler_print 17696 17697 call signal (12, handler_print) 17698 call signal (10, 1) 17699 17700 call sleep (30) 17701 end program test_signal 17702 17703 17704 File: gfortran.info, Node: SIN, Next: SIND, Prev: SIGNAL, Up: Intrinsic Procedures 17705 17706 8.249 'SIN' -- Sine function 17707 ============================ 17708 17709 _Description_: 17710 'SIN(X)' computes the sine of X. 17711 17712 _Standard_: 17713 Fortran 77 and later 17714 17715 _Class_: 17716 Elemental function 17717 17718 _Syntax_: 17719 'RESULT = SIN(X)' 17720 17721 _Arguments_: 17722 X The type shall be 'REAL' or 'COMPLEX'. 17723 17724 _Return value_: 17725 The return value has same type and kind as X. 17726 17727 _Example_: 17728 program test_sin 17729 real :: x = 0.0 17730 x = sin(x) 17731 end program test_sin 17732 17733 _Specific names_: 17734 Name Argument Return type Standard 17735 ------------------------------------------------------------------------- 17736 'SIN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 17737 'DSIN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 17738 'CSIN(X)' 'COMPLEX(4) X' 'COMPLEX(4)' Fortran 77 and later 17739 'ZSIN(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 17740 'CDSIN(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 17741 17742 _See also_: 17743 Inverse function: *note ASIN:: Degrees function: *note SIND:: 17744 17745 17746 File: gfortran.info, Node: SIND, Next: SINH, Prev: SIN, Up: Intrinsic Procedures 17747 17748 8.250 'SIND' -- Sine function, degrees 17749 ====================================== 17750 17751 _Description_: 17752 'SIND(X)' computes the sine of X in degrees. 17753 17754 This function is for compatibility only and should be avoided in 17755 favor of standard constructs wherever possible. 17756 17757 _Standard_: 17758 GNU extension, enabled with '-fdec-math'. 17759 17760 _Class_: 17761 Elemental function 17762 17763 _Syntax_: 17764 'RESULT = SIND(X)' 17765 17766 _Arguments_: 17767 X The type shall be 'REAL' or 'COMPLEX'. 17768 17769 _Return value_: 17770 The return value has same type and kind as X, and its value is in 17771 degrees. 17772 17773 _Example_: 17774 program test_sind 17775 real :: x = 0.0 17776 x = sind(x) 17777 end program test_sind 17778 17779 _Specific names_: 17780 Name Argument Return type Standard 17781 ------------------------------------------------------------------------- 17782 'SIND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 17783 'DSIND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 17784 'CSIND(X)' 'COMPLEX(4) X' 'COMPLEX(4)' GNU extension 17785 'ZSIND(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 17786 'CDSIND(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 17787 17788 _See also_: 17789 Inverse function: *note ASIND:: Radians function: *note SIN:: 17790 17791 17792 File: gfortran.info, Node: SINH, Next: SIZE, Prev: SIND, Up: Intrinsic Procedures 17793 17794 8.251 'SINH' -- Hyperbolic sine function 17795 ======================================== 17796 17797 _Description_: 17798 'SINH(X)' computes the hyperbolic sine of X. 17799 17800 _Standard_: 17801 Fortran 90 and later, for a complex argument Fortran 2008 or later, 17802 has a GNU extension 17803 17804 _Class_: 17805 Elemental function 17806 17807 _Syntax_: 17808 'RESULT = SINH(X)' 17809 17810 _Arguments_: 17811 X The type shall be 'REAL' or 'COMPLEX'. 17812 17813 _Return value_: 17814 The return value has same type and kind as X. 17815 17816 _Example_: 17817 program test_sinh 17818 real(8) :: x = - 1.0_8 17819 x = sinh(x) 17820 end program test_sinh 17821 17822 _Specific names_: 17823 Name Argument Return type Standard 17824 ------------------------------------------------------------------------- 17825 'DSINH(X)' 'REAL(8) X' 'REAL(8)' Fortran 90 and later 17826 17827 _See also_: 17828 *note ASINH:: 17829 17830 17831 File: gfortran.info, Node: SIZE, Next: SIZEOF, Prev: SINH, Up: Intrinsic Procedures 17832 17833 8.252 'SIZE' -- Determine the size of an array 17834 ============================================== 17835 17836 _Description_: 17837 Determine the extent of ARRAY along a specified dimension DIM, or 17838 the total number of elements in ARRAY if DIM is absent. 17839 17840 _Standard_: 17841 Fortran 90 and later, with KIND argument Fortran 2003 and later 17842 17843 _Class_: 17844 Inquiry function 17845 17846 _Syntax_: 17847 'RESULT = SIZE(ARRAY[, DIM [, KIND]])' 17848 17849 _Arguments_: 17850 ARRAY Shall be an array of any type. If ARRAY is a 17851 pointer it must be associated and allocatable 17852 arrays must be allocated. 17853 DIM (Optional) shall be a scalar of type 'INTEGER' 17854 and its value shall be in the range from 1 to n, 17855 where n equals the rank of ARRAY. 17856 KIND (Optional) An 'INTEGER' initialization 17857 expression indicating the kind parameter of the 17858 result. 17859 17860 _Return value_: 17861 The return value is of type 'INTEGER' and of kind KIND. If KIND is 17862 absent, the return value is of default integer kind. 17863 17864 _Example_: 17865 PROGRAM test_size 17866 WRITE(*,*) SIZE((/ 1, 2 /)) ! 2 17867 END PROGRAM 17868 17869 _See also_: 17870 *note SHAPE::, *note RESHAPE:: 17871 17872 17873 File: gfortran.info, Node: SIZEOF, Next: SLEEP, Prev: SIZE, Up: Intrinsic Procedures 17874 17875 8.253 'SIZEOF' -- Size in bytes of an expression 17876 ================================================ 17877 17878 _Description_: 17879 'SIZEOF(X)' calculates the number of bytes of storage the 17880 expression 'X' occupies. 17881 17882 _Standard_: 17883 GNU extension 17884 17885 _Class_: 17886 Inquiry function 17887 17888 _Syntax_: 17889 'N = SIZEOF(X)' 17890 17891 _Arguments_: 17892 X The argument shall be of any type, rank or 17893 shape. 17894 17895 _Return value_: 17896 The return value is of type integer and of the system-dependent 17897 kind C_SIZE_T (from the ISO_C_BINDING module). Its value is the 17898 number of bytes occupied by the argument. If the argument has the 17899 'POINTER' attribute, the number of bytes of the storage area 17900 pointed to is returned. If the argument is of a derived type with 17901 'POINTER' or 'ALLOCATABLE' components, the return value does not 17902 account for the sizes of the data pointed to by these components. 17903 If the argument is polymorphic, the size according to the dynamic 17904 type is returned. The argument may not be a procedure or procedure 17905 pointer. Note that the code assumes for arrays that those are 17906 contiguous; for contiguous arrays, it returns the storage or an 17907 array element multiplied by the size of the array. 17908 17909 _Example_: 17910 integer :: i 17911 real :: r, s(5) 17912 print *, (sizeof(s)/sizeof(r) == 5) 17913 end 17914 The example will print '.TRUE.' unless you are using a platform 17915 where default 'REAL' variables are unusually padded. 17916 17917 _See also_: 17918 *note C_SIZEOF::, *note STORAGE_SIZE:: 17919 17920 17921 File: gfortran.info, Node: SLEEP, Next: SPACING, Prev: SIZEOF, Up: Intrinsic Procedures 17922 17923 8.254 'SLEEP' -- Sleep for the specified number of seconds 17924 ========================================================== 17925 17926 _Description_: 17927 Calling this subroutine causes the process to pause for SECONDS 17928 seconds. 17929 17930 _Standard_: 17931 GNU extension 17932 17933 _Class_: 17934 Subroutine 17935 17936 _Syntax_: 17937 'CALL SLEEP(SECONDS)' 17938 17939 _Arguments_: 17940 SECONDS The type shall be of default 'INTEGER'. 17941 17942 _Example_: 17943 program test_sleep 17944 call sleep(5) 17945 end 17946 17947 17948 File: gfortran.info, Node: SPACING, Next: SPREAD, Prev: SLEEP, Up: Intrinsic Procedures 17949 17950 8.255 'SPACING' -- Smallest distance between two numbers of a given type 17951 ======================================================================== 17952 17953 _Description_: 17954 Determines the distance between the argument X and the nearest 17955 adjacent number of the same type. 17956 17957 _Standard_: 17958 Fortran 90 and later 17959 17960 _Class_: 17961 Elemental function 17962 17963 _Syntax_: 17964 'RESULT = SPACING(X)' 17965 17966 _Arguments_: 17967 X Shall be of type 'REAL'. 17968 17969 _Return value_: 17970 The result is of the same type as the input argument X. 17971 17972 _Example_: 17973 PROGRAM test_spacing 17974 INTEGER, PARAMETER :: SGL = SELECTED_REAL_KIND(p=6, r=37) 17975 INTEGER, PARAMETER :: DBL = SELECTED_REAL_KIND(p=13, r=200) 17976 17977 WRITE(*,*) spacing(1.0_SGL) ! "1.1920929E-07" on i686 17978 WRITE(*,*) spacing(1.0_DBL) ! "2.220446049250313E-016" on i686 17979 END PROGRAM 17980 17981 _See also_: 17982 *note RRSPACING:: 17983 17984 17985 File: gfortran.info, Node: SPREAD, Next: SQRT, Prev: SPACING, Up: Intrinsic Procedures 17986 17987 8.256 'SPREAD' -- Add a dimension to an array 17988 ============================================= 17989 17990 _Description_: 17991 Replicates a SOURCE array NCOPIES times along a specified dimension 17992 DIM. 17993 17994 _Standard_: 17995 Fortran 90 and later 17996 17997 _Class_: 17998 Transformational function 17999 18000 _Syntax_: 18001 'RESULT = SPREAD(SOURCE, DIM, NCOPIES)' 18002 18003 _Arguments_: 18004 SOURCE Shall be a scalar or an array of any type and a 18005 rank less than seven. 18006 DIM Shall be a scalar of type 'INTEGER' with a value 18007 in the range from 1 to n+1, where n equals the 18008 rank of SOURCE. 18009 NCOPIES Shall be a scalar of type 'INTEGER'. 18010 18011 _Return value_: 18012 The result is an array of the same type as SOURCE and has rank n+1 18013 where n equals the rank of SOURCE. 18014 18015 _Example_: 18016 PROGRAM test_spread 18017 INTEGER :: a = 1, b(2) = (/ 1, 2 /) 18018 WRITE(*,*) SPREAD(A, 1, 2) ! "1 1" 18019 WRITE(*,*) SPREAD(B, 1, 2) ! "1 1 2 2" 18020 END PROGRAM 18021 18022 _See also_: 18023 *note UNPACK:: 18024 18025 18026 File: gfortran.info, Node: SQRT, Next: SRAND, Prev: SPREAD, Up: Intrinsic Procedures 18027 18028 8.257 'SQRT' -- Square-root function 18029 ==================================== 18030 18031 _Description_: 18032 'SQRT(X)' computes the square root of X. 18033 18034 _Standard_: 18035 Fortran 77 and later 18036 18037 _Class_: 18038 Elemental function 18039 18040 _Syntax_: 18041 'RESULT = SQRT(X)' 18042 18043 _Arguments_: 18044 X The type shall be 'REAL' or 'COMPLEX'. 18045 18046 _Return value_: 18047 The return value is of type 'REAL' or 'COMPLEX'. The kind type 18048 parameter is the same as X. 18049 18050 _Example_: 18051 program test_sqrt 18052 real(8) :: x = 2.0_8 18053 complex :: z = (1.0, 2.0) 18054 x = sqrt(x) 18055 z = sqrt(z) 18056 end program test_sqrt 18057 18058 _Specific names_: 18059 Name Argument Return type Standard 18060 ------------------------------------------------------------------------- 18061 'SQRT(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 18062 'DSQRT(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 18063 'CSQRT(X)' 'COMPLEX(4) X' 'COMPLEX(4)' Fortran 77 and later 18064 'ZSQRT(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 18065 'CDSQRT(X)' 'COMPLEX(8) X' 'COMPLEX(8)' GNU extension 18066 18067 18068 File: gfortran.info, Node: SRAND, Next: STAT, Prev: SQRT, Up: Intrinsic Procedures 18069 18070 8.258 'SRAND' -- Reinitialize the random number generator 18071 ========================================================= 18072 18073 _Description_: 18074 'SRAND' reinitializes the pseudo-random number generator called by 18075 'RAND' and 'IRAND'. The new seed used by the generator is 18076 specified by the required argument SEED. 18077 18078 _Standard_: 18079 GNU extension 18080 18081 _Class_: 18082 Subroutine 18083 18084 _Syntax_: 18085 'CALL SRAND(SEED)' 18086 18087 _Arguments_: 18088 SEED Shall be a scalar 'INTEGER(kind=4)'. 18089 18090 _Return value_: 18091 Does not return anything. 18092 18093 _Example_: 18094 See 'RAND' and 'IRAND' for examples. 18095 18096 _Notes_: 18097 The Fortran standard specifies the intrinsic subroutines 18098 'RANDOM_SEED' to initialize the pseudo-random number generator and 18099 'RANDOM_NUMBER' to generate pseudo-random numbers. These 18100 subroutines should be used in new codes. 18101 18102 Please note that in GNU Fortran, these two sets of intrinsics 18103 ('RAND', 'IRAND' and 'SRAND' on the one hand, 'RANDOM_NUMBER' and 18104 'RANDOM_SEED' on the other hand) access two independent 18105 pseudo-random number generators. 18106 18107 _See also_: 18108 *note RAND::, *note RANDOM_SEED::, *note RANDOM_NUMBER:: 18109 18110 18111 File: gfortran.info, Node: STAT, Next: STORAGE_SIZE, Prev: SRAND, Up: Intrinsic Procedures 18112 18113 8.259 'STAT' -- Get file status 18114 =============================== 18115 18116 _Description_: 18117 This function returns information about a file. No permissions are 18118 required on the file itself, but execute (search) permission is 18119 required on all of the directories in path that lead to the file. 18120 18121 The elements that are obtained and stored in the array 'VALUES': 18122 'VALUES(1)' Device ID 18123 'VALUES(2)' Inode number 18124 'VALUES(3)' File mode 18125 'VALUES(4)' Number of links 18126 'VALUES(5)' Owner's uid 18127 'VALUES(6)' Owner's gid 18128 'VALUES(7)' ID of device containing directory entry for file 18129 (0 if not available) 18130 'VALUES(8)' File size (bytes) 18131 'VALUES(9)' Last access time 18132 'VALUES(10)'Last modification time 18133 'VALUES(11)'Last file status change time 18134 'VALUES(12)'Preferred I/O block size (-1 if not available) 18135 'VALUES(13)'Number of blocks allocated (-1 if not available) 18136 18137 Not all these elements are relevant on all systems. If an element 18138 is not relevant, it is returned as 0. 18139 18140 This intrinsic is provided in both subroutine and function forms; 18141 however, only one form can be used in any given program unit. 18142 18143 _Standard_: 18144 GNU extension 18145 18146 _Class_: 18147 Subroutine, function 18148 18149 _Syntax_: 18150 'CALL STAT(NAME, VALUES [, STATUS])' 18151 'STATUS = STAT(NAME, VALUES)' 18152 18153 _Arguments_: 18154 NAME The type shall be 'CHARACTER', of the default 18155 kind and a valid path within the file system. 18156 VALUES The type shall be 'INTEGER(4), DIMENSION(13)'. 18157 STATUS (Optional) status flag of type 'INTEGER(4)'. 18158 Returns 0 on success and a system specific error 18159 code otherwise. 18160 18161 _Example_: 18162 PROGRAM test_stat 18163 INTEGER, DIMENSION(13) :: buff 18164 INTEGER :: status 18165 18166 CALL STAT("/etc/passwd", buff, status) 18167 18168 IF (status == 0) THEN 18169 WRITE (*, FMT="('Device ID:', T30, I19)") buff(1) 18170 WRITE (*, FMT="('Inode number:', T30, I19)") buff(2) 18171 WRITE (*, FMT="('File mode (octal):', T30, O19)") buff(3) 18172 WRITE (*, FMT="('Number of links:', T30, I19)") buff(4) 18173 WRITE (*, FMT="('Owner''s uid:', T30, I19)") buff(5) 18174 WRITE (*, FMT="('Owner''s gid:', T30, I19)") buff(6) 18175 WRITE (*, FMT="('Device where located:', T30, I19)") buff(7) 18176 WRITE (*, FMT="('File size:', T30, I19)") buff(8) 18177 WRITE (*, FMT="('Last access time:', T30, A19)") CTIME(buff(9)) 18178 WRITE (*, FMT="('Last modification time', T30, A19)") CTIME(buff(10)) 18179 WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11)) 18180 WRITE (*, FMT="('Preferred block size:', T30, I19)") buff(12) 18181 WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13) 18182 END IF 18183 END PROGRAM 18184 18185 _See also_: 18186 To stat an open file: *note FSTAT:: To stat a link: *note LSTAT:: 18187 18188 18189 File: gfortran.info, Node: STORAGE_SIZE, Next: SUM, Prev: STAT, Up: Intrinsic Procedures 18190 18191 8.260 'STORAGE_SIZE' -- Storage size in bits 18192 ============================================ 18193 18194 _Description_: 18195 Returns the storage size of argument A in bits. 18196 _Standard_: 18197 Fortran 2008 and later 18198 _Class_: 18199 Inquiry function 18200 _Syntax_: 18201 'RESULT = STORAGE_SIZE(A [, KIND])' 18202 18203 _Arguments_: 18204 A Shall be a scalar or array of any type. 18205 KIND (Optional) shall be a scalar integer constant 18206 expression. 18207 18208 _Return Value_: 18209 The result is a scalar integer with the kind type parameter 18210 specified by KIND (or default integer type if KIND is missing). 18211 The result value is the size expressed in bits for an element of an 18212 array that has the dynamic type and type parameters of A. 18213 18214 _See also_: 18215 *note C_SIZEOF::, *note SIZEOF:: 18216 18217 18218 File: gfortran.info, Node: SUM, Next: SYMLNK, Prev: STORAGE_SIZE, Up: Intrinsic Procedures 18219 18220 8.261 'SUM' -- Sum of array elements 18221 ==================================== 18222 18223 _Description_: 18224 Adds the elements of ARRAY along dimension DIM if the corresponding 18225 element in MASK is 'TRUE'. 18226 18227 _Standard_: 18228 Fortran 90 and later 18229 18230 _Class_: 18231 Transformational function 18232 18233 _Syntax_: 18234 'RESULT = SUM(ARRAY[, MASK])' 18235 'RESULT = SUM(ARRAY, DIM[, MASK])' 18236 18237 _Arguments_: 18238 ARRAY Shall be an array of type 'INTEGER', 'REAL' or 18239 'COMPLEX'. 18240 DIM (Optional) shall be a scalar of type 'INTEGER' 18241 with a value in the range from 1 to n, where n 18242 equals the rank of ARRAY. 18243 MASK (Optional) shall be of type 'LOGICAL' and either 18244 be a scalar or an array of the same shape as 18245 ARRAY. 18246 18247 _Return value_: 18248 The result is of the same type as ARRAY. 18249 18250 If DIM is absent, a scalar with the sum of all elements in ARRAY is 18251 returned. Otherwise, an array of rank n-1, where n equals the rank 18252 of ARRAY, and a shape similar to that of ARRAY with dimension DIM 18253 dropped is returned. 18254 18255 _Example_: 18256 PROGRAM test_sum 18257 INTEGER :: x(5) = (/ 1, 2, 3, 4 ,5 /) 18258 print *, SUM(x) ! all elements, sum = 15 18259 print *, SUM(x, MASK=MOD(x, 2)==1) ! odd elements, sum = 9 18260 END PROGRAM 18261 18262 _See also_: 18263 *note PRODUCT:: 18264 18265 18266 File: gfortran.info, Node: SYMLNK, Next: SYSTEM, Prev: SUM, Up: Intrinsic Procedures 18267 18268 8.262 'SYMLNK' -- Create a symbolic link 18269 ======================================== 18270 18271 _Description_: 18272 Makes a symbolic link from file PATH1 to PATH2. A null character 18273 ('CHAR(0)') can be used to mark the end of the names in PATH1 and 18274 PATH2; otherwise, trailing blanks in the file names are ignored. 18275 If the STATUS argument is supplied, it contains 0 on success or a 18276 nonzero error code upon return; see 'symlink(2)'. If the system 18277 does not supply 'symlink(2)', 'ENOSYS' is returned. 18278 18279 This intrinsic is provided in both subroutine and function forms; 18280 however, only one form can be used in any given program unit. 18281 18282 _Standard_: 18283 GNU extension 18284 18285 _Class_: 18286 Subroutine, function 18287 18288 _Syntax_: 18289 'CALL SYMLNK(PATH1, PATH2 [, STATUS])' 18290 'STATUS = SYMLNK(PATH1, PATH2)' 18291 18292 _Arguments_: 18293 PATH1 Shall be of default 'CHARACTER' type. 18294 PATH2 Shall be of default 'CHARACTER' type. 18295 STATUS (Optional) Shall be of default 'INTEGER' type. 18296 18297 _See also_: 18298 *note LINK::, *note UNLINK:: 18299 18300 18301 File: gfortran.info, Node: SYSTEM, Next: SYSTEM_CLOCK, Prev: SYMLNK, Up: Intrinsic Procedures 18302 18303 8.263 'SYSTEM' -- Execute a shell command 18304 ========================================= 18305 18306 _Description_: 18307 Passes the command COMMAND to a shell (see 'system(3)'). If 18308 argument STATUS is present, it contains the value returned by 18309 'system(3)', which is presumably 0 if the shell command succeeded. 18310 Note that which shell is used to invoke the command is 18311 system-dependent and environment-dependent. 18312 18313 This intrinsic is provided in both subroutine and function forms; 18314 however, only one form can be used in any given program unit. 18315 18316 Note that the 'system' function need not be thread-safe. It is the 18317 responsibility of the user to ensure that 'system' is not called 18318 concurrently. 18319 18320 _Standard_: 18321 GNU extension 18322 18323 _Class_: 18324 Subroutine, function 18325 18326 _Syntax_: 18327 'CALL SYSTEM(COMMAND [, STATUS])' 18328 'STATUS = SYSTEM(COMMAND)' 18329 18330 _Arguments_: 18331 COMMAND Shall be of default 'CHARACTER' type. 18332 STATUS (Optional) Shall be of default 'INTEGER' type. 18333 18334 _See also_: 18335 *note EXECUTE_COMMAND_LINE::, which is part of the Fortran 2008 18336 standard and should considered in new code for future portability. 18337 18338 18339 File: gfortran.info, Node: SYSTEM_CLOCK, Next: TAN, Prev: SYSTEM, Up: Intrinsic Procedures 18340 18341 8.264 'SYSTEM_CLOCK' -- Time function 18342 ===================================== 18343 18344 _Description_: 18345 Determines the COUNT of a processor clock since an unspecified time 18346 in the past modulo COUNT_MAX, COUNT_RATE determines the number of 18347 clock ticks per second. If the platform supports a monotonic 18348 clock, that clock is used and can, depending on the platform clock 18349 implementation, provide up to nanosecond resolution. If a 18350 monotonic clock is not available, the implementation falls back to 18351 a realtime clock. 18352 18353 COUNT_RATE is system dependent and can vary depending on the kind 18354 of the arguments. For KIND=4 arguments (and smaller integer 18355 kinds), COUNT represents milliseconds, while for KIND=8 arguments 18356 (and larger integer kinds), COUNT typically represents micro- or 18357 nanoseconds depending on resolution of the underlying platform 18358 clock. COUNT_MAX usually equals 'HUGE(COUNT_MAX)'. Note that the 18359 millisecond resolution of the KIND=4 version implies that the COUNT 18360 will wrap around in roughly 25 days. In order to avoid issues with 18361 the wrap around and for more precise timing, please use the KIND=8 18362 version. 18363 18364 If there is no clock, or querying the clock fails, COUNT is set to 18365 '-HUGE(COUNT)', and COUNT_RATE and COUNT_MAX are set to zero. 18366 18367 When running on a platform using the GNU C library (glibc) version 18368 2.16 or older, or a derivative thereof, the high resolution 18369 monotonic clock is available only when linking with the RT library. 18370 This can be done explicitly by adding the '-lrt' flag when linking 18371 the application, but is also done implicitly when using OpenMP. 18372 18373 On the Windows platform, the version with KIND=4 arguments uses the 18374 'GetTickCount' function, whereas the KIND=8 version uses 18375 'QueryPerformanceCounter' and 'QueryPerformanceCounterFrequency'. 18376 For more information, and potential caveats, please see the 18377 platform documentation. 18378 18379 _Standard_: 18380 Fortran 90 and later 18381 18382 _Class_: 18383 Subroutine 18384 18385 _Syntax_: 18386 'CALL SYSTEM_CLOCK([COUNT, COUNT_RATE, COUNT_MAX])' 18387 18388 _Arguments_: 18389 COUNT (Optional) shall be a scalar of type 18390 'INTEGER' with 'INTENT(OUT)'. 18391 COUNT_RATE (Optional) shall be a scalar of type 18392 'INTEGER' or 'REAL', with 'INTENT(OUT)'. 18393 COUNT_MAX (Optional) shall be a scalar of type 18394 'INTEGER' with 'INTENT(OUT)'. 18395 18396 _Example_: 18397 PROGRAM test_system_clock 18398 INTEGER :: count, count_rate, count_max 18399 CALL SYSTEM_CLOCK(count, count_rate, count_max) 18400 WRITE(*,*) count, count_rate, count_max 18401 END PROGRAM 18402 18403 _See also_: 18404 *note DATE_AND_TIME::, *note CPU_TIME:: 18405 18406 18407 File: gfortran.info, Node: TAN, Next: TAND, Prev: SYSTEM_CLOCK, Up: Intrinsic Procedures 18408 18409 8.265 'TAN' -- Tangent function 18410 =============================== 18411 18412 _Description_: 18413 'TAN(X)' computes the tangent of X. 18414 18415 _Standard_: 18416 Fortran 77 and later, for a complex argument Fortran 2008 or later 18417 18418 _Class_: 18419 Elemental function 18420 18421 _Syntax_: 18422 'RESULT = TAN(X)' 18423 18424 _Arguments_: 18425 X The type shall be 'REAL' or 'COMPLEX'. 18426 18427 _Return value_: 18428 The return value has same type and kind as X, and its value is in 18429 radians. 18430 18431 _Example_: 18432 program test_tan 18433 real(8) :: x = 0.165_8 18434 x = tan(x) 18435 end program test_tan 18436 18437 _Specific names_: 18438 Name Argument Return type Standard 18439 ------------------------------------------------------------------------- 18440 'TAN(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 18441 'DTAN(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 18442 18443 _See also_: 18444 Inverse function: *note ATAN:: Degrees function: *note TAND:: 18445 18446 18447 File: gfortran.info, Node: TAND, Next: TANH, Prev: TAN, Up: Intrinsic Procedures 18448 18449 8.266 'TAND' -- Tangent function, degrees 18450 ========================================= 18451 18452 _Description_: 18453 'TAND(X)' computes the tangent of X in degrees. 18454 18455 This function is for compatibility only and should be avoided in 18456 favor of standard constructs wherever possible. 18457 18458 _Standard_: 18459 GNU extension, enabled with '-fdec-math'. 18460 18461 _Class_: 18462 Elemental function 18463 18464 _Syntax_: 18465 'RESULT = TAND(X)' 18466 18467 _Arguments_: 18468 X The type shall be 'REAL' or 'COMPLEX'. 18469 18470 _Return value_: 18471 The return value has same type and kind as X, and its value is in 18472 degrees. 18473 18474 _Example_: 18475 program test_tand 18476 real(8) :: x = 0.165_8 18477 x = tand(x) 18478 end program test_tand 18479 18480 _Specific names_: 18481 Name Argument Return type Standard 18482 ------------------------------------------------------------------------- 18483 'TAND(X)' 'REAL(4) X' 'REAL(4)' GNU extension 18484 'DTAND(X)' 'REAL(8) X' 'REAL(8)' GNU extension 18485 18486 _See also_: 18487 Inverse function: *note ATAND:: Radians function: *note TAN:: 18488 18489 18490 File: gfortran.info, Node: TANH, Next: THIS_IMAGE, Prev: TAND, Up: Intrinsic Procedures 18491 18492 8.267 'TANH' -- Hyperbolic tangent function 18493 =========================================== 18494 18495 _Description_: 18496 'TANH(X)' computes the hyperbolic tangent of X. 18497 18498 _Standard_: 18499 Fortran 77 and later, for a complex argument Fortran 2008 or later 18500 18501 _Class_: 18502 Elemental function 18503 18504 _Syntax_: 18505 'X = TANH(X)' 18506 18507 _Arguments_: 18508 X The type shall be 'REAL' or 'COMPLEX'. 18509 18510 _Return value_: 18511 The return value has same type and kind as X. If X is complex, the 18512 imaginary part of the result is in radians. If X is 'REAL', the 18513 return value lies in the range - 1 \leq tanh(x) \leq 1 . 18514 18515 _Example_: 18516 program test_tanh 18517 real(8) :: x = 2.1_8 18518 x = tanh(x) 18519 end program test_tanh 18520 18521 _Specific names_: 18522 Name Argument Return type Standard 18523 ------------------------------------------------------------------------- 18524 'TANH(X)' 'REAL(4) X' 'REAL(4)' Fortran 77 and later 18525 'DTANH(X)' 'REAL(8) X' 'REAL(8)' Fortran 77 and later 18526 18527 _See also_: 18528 *note ATANH:: 18529 18530 18531 File: gfortran.info, Node: THIS_IMAGE, Next: TIME, Prev: TANH, Up: Intrinsic Procedures 18532 18533 8.268 'THIS_IMAGE' -- Function that returns the cosubscript index of this image 18534 =============================================================================== 18535 18536 _Description_: 18537 Returns the cosubscript for this image. 18538 18539 _Standard_: 18540 Fortran 2008 and later. With DISTANCE argument, Technical 18541 Specification (TS) 18508 or later 18542 18543 _Class_: 18544 Transformational function 18545 18546 _Syntax_: 18547 'RESULT = THIS_IMAGE()' 18548 'RESULT = THIS_IMAGE(DISTANCE)' 18549 'RESULT = THIS_IMAGE(COARRAY [, DIM])' 18550 18551 _Arguments_: 18552 DISTANCE (optional, intent(in)) Nonnegative scalar 18553 integer (not permitted together with COARRAY). 18554 COARRAY Coarray of any type (optional; if DIM present, 18555 required). 18556 DIM default integer scalar (optional). If present, 18557 DIM shall be between one and the corank of 18558 COARRAY. 18559 18560 _Return value_: 18561 Default integer. If COARRAY is not present, it is scalar; if 18562 DISTANCE is not present or has value 0, its value is the image 18563 index on the invoking image for the current team, for values 18564 smaller or equal distance to the initial team, it returns the image 18565 index on the ancestor team which has a distance of DISTANCE from 18566 the invoking team. If DISTANCE is larger than the distance to the 18567 initial team, the image index of the initial team is returned. 18568 Otherwise when the COARRAY is present, if DIM is not present, a 18569 rank-1 array with corank elements is returned, containing the 18570 cosubscripts for COARRAY specifying the invoking image. If DIM is 18571 present, a scalar is returned, with the value of the DIM element of 18572 'THIS_IMAGE(COARRAY)'. 18573 18574 _Example_: 18575 INTEGER :: value[*] 18576 INTEGER :: i 18577 value = THIS_IMAGE() 18578 SYNC ALL 18579 IF (THIS_IMAGE() == 1) THEN 18580 DO i = 1, NUM_IMAGES() 18581 WRITE(*,'(2(a,i0))') 'value[', i, '] is ', value[i] 18582 END DO 18583 END IF 18584 18585 ! Check whether the current image is the initial image 18586 IF (THIS_IMAGE(HUGE(1)) /= THIS_IMAGE()) 18587 error stop "something is rotten here" 18588 18589 _See also_: 18590 *note NUM_IMAGES::, *note IMAGE_INDEX:: 18591 18592 18593 File: gfortran.info, Node: TIME, Next: TIME8, Prev: THIS_IMAGE, Up: Intrinsic Procedures 18594 18595 8.269 'TIME' -- Time function 18596 ============================= 18597 18598 _Description_: 18599 Returns the current time encoded as an integer (in the manner of 18600 the function 'time(3)' in the C standard library). This value is 18601 suitable for passing to *note CTIME::, *note GMTIME::, and *note 18602 LTIME::. 18603 18604 This intrinsic is not fully portable, such as to systems with 18605 32-bit 'INTEGER' types but supporting times wider than 32 bits. 18606 Therefore, the values returned by this intrinsic might be, or 18607 become, negative, or numerically less than previous values, during 18608 a single run of the compiled program. 18609 18610 See *note TIME8::, for information on a similar intrinsic that 18611 might be portable to more GNU Fortran implementations, though to 18612 fewer Fortran compilers. 18613 18614 _Standard_: 18615 GNU extension 18616 18617 _Class_: 18618 Function 18619 18620 _Syntax_: 18621 'RESULT = TIME()' 18622 18623 _Return value_: 18624 The return value is a scalar of type 'INTEGER(4)'. 18625 18626 _See also_: 18627 *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note 18628 LTIME::, *note MCLOCK::, *note TIME8:: 18629 18630 18631 File: gfortran.info, Node: TIME8, Next: TINY, Prev: TIME, Up: Intrinsic Procedures 18632 18633 8.270 'TIME8' -- Time function (64-bit) 18634 ======================================= 18635 18636 _Description_: 18637 Returns the current time encoded as an integer (in the manner of 18638 the function 'time(3)' in the C standard library). This value is 18639 suitable for passing to *note CTIME::, *note GMTIME::, and *note 18640 LTIME::. 18641 18642 _Warning:_ this intrinsic does not increase the range of the timing 18643 values over that returned by 'time(3)'. On a system with a 32-bit 18644 'time(3)', 'TIME8' will return a 32-bit value, even though it is 18645 converted to a 64-bit 'INTEGER(8)' value. That means overflows of 18646 the 32-bit value can still occur. Therefore, the values returned 18647 by this intrinsic might be or become negative or numerically less 18648 than previous values during a single run of the compiled program. 18649 18650 _Standard_: 18651 GNU extension 18652 18653 _Class_: 18654 Function 18655 18656 _Syntax_: 18657 'RESULT = TIME8()' 18658 18659 _Return value_: 18660 The return value is a scalar of type 'INTEGER(8)'. 18661 18662 _See also_: 18663 *note DATE_AND_TIME::, *note CTIME::, *note GMTIME::, *note 18664 LTIME::, *note MCLOCK8::, *note TIME:: 18665 18666 18667 File: gfortran.info, Node: TINY, Next: TRAILZ, Prev: TIME8, Up: Intrinsic Procedures 18668 18669 8.271 'TINY' -- Smallest positive number of a real kind 18670 ======================================================= 18671 18672 _Description_: 18673 'TINY(X)' returns the smallest positive (non zero) number in the 18674 model of the type of 'X'. 18675 18676 _Standard_: 18677 Fortran 90 and later 18678 18679 _Class_: 18680 Inquiry function 18681 18682 _Syntax_: 18683 'RESULT = TINY(X)' 18684 18685 _Arguments_: 18686 X Shall be of type 'REAL'. 18687 18688 _Return value_: 18689 The return value is of the same type and kind as X 18690 18691 _Example_: 18692 See 'HUGE' for an example. 18693 18694 18695 File: gfortran.info, Node: TRAILZ, Next: TRANSFER, Prev: TINY, Up: Intrinsic Procedures 18696 18697 8.272 'TRAILZ' -- Number of trailing zero bits of an integer 18698 ============================================================ 18699 18700 _Description_: 18701 'TRAILZ' returns the number of trailing zero bits of an integer. 18702 18703 _Standard_: 18704 Fortran 2008 and later 18705 18706 _Class_: 18707 Elemental function 18708 18709 _Syntax_: 18710 'RESULT = TRAILZ(I)' 18711 18712 _Arguments_: 18713 I Shall be of type 'INTEGER'. 18714 18715 _Return value_: 18716 The type of the return value is the default 'INTEGER'. If all the 18717 bits of 'I' are zero, the result value is 'BIT_SIZE(I)'. 18718 18719 _Example_: 18720 PROGRAM test_trailz 18721 WRITE (*,*) TRAILZ(8) ! prints 3 18722 END PROGRAM 18723 18724 _See also_: 18725 *note BIT_SIZE::, *note LEADZ::, *note POPPAR::, *note POPCNT:: 18726 18727 18728 File: gfortran.info, Node: TRANSFER, Next: TRANSPOSE, Prev: TRAILZ, Up: Intrinsic Procedures 18729 18730 8.273 'TRANSFER' -- Transfer bit patterns 18731 ========================================= 18732 18733 _Description_: 18734 Interprets the bitwise representation of SOURCE in memory as if it 18735 is the representation of a variable or array of the same type and 18736 type parameters as MOLD. 18737 18738 This is approximately equivalent to the C concept of _casting_ one 18739 type to another. 18740 18741 _Standard_: 18742 Fortran 90 and later 18743 18744 _Class_: 18745 Transformational function 18746 18747 _Syntax_: 18748 'RESULT = TRANSFER(SOURCE, MOLD[, SIZE])' 18749 18750 _Arguments_: 18751 SOURCE Shall be a scalar or an array of any type. 18752 MOLD Shall be a scalar or an array of any type. 18753 SIZE (Optional) shall be a scalar of type 'INTEGER'. 18754 18755 _Return value_: 18756 The result has the same type as MOLD, with the bit level 18757 representation of SOURCE. If SIZE is present, the result is a 18758 one-dimensional array of length SIZE. If SIZE is absent but MOLD 18759 is an array (of any size or shape), the result is a one- 18760 dimensional array of the minimum length needed to contain the 18761 entirety of the bitwise representation of SOURCE. If SIZE is 18762 absent and MOLD is a scalar, the result is a scalar. 18763 18764 If the bitwise representation of the result is longer than that of 18765 SOURCE, then the leading bits of the result correspond to those of 18766 SOURCE and any trailing bits are filled arbitrarily. 18767 18768 When the resulting bit representation does not correspond to a 18769 valid representation of a variable of the same type as MOLD, the 18770 results are undefined, and subsequent operations on the result 18771 cannot be guaranteed to produce sensible behavior. For example, it 18772 is possible to create 'LOGICAL' variables for which 'VAR' and 18773 '.NOT.VAR' both appear to be true. 18774 18775 _Example_: 18776 PROGRAM test_transfer 18777 integer :: x = 2143289344 18778 print *, transfer(x, 1.0) ! prints "NaN" on i686 18779 END PROGRAM 18780 18781 18782 File: gfortran.info, Node: TRANSPOSE, Next: TRIM, Prev: TRANSFER, Up: Intrinsic Procedures 18783 18784 8.274 'TRANSPOSE' -- Transpose an array of rank two 18785 =================================================== 18786 18787 _Description_: 18788 Transpose an array of rank two. Element (i, j) of the result has 18789 the value 'MATRIX(j, i)', for all i, j. 18790 18791 _Standard_: 18792 Fortran 90 and later 18793 18794 _Class_: 18795 Transformational function 18796 18797 _Syntax_: 18798 'RESULT = TRANSPOSE(MATRIX)' 18799 18800 _Arguments_: 18801 MATRIX Shall be an array of any type and have a rank of 18802 two. 18803 18804 _Return value_: 18805 The result has the same type as MATRIX, and has shape '(/ m, n /)' 18806 if MATRIX has shape '(/ n, m /)'. 18807 18808 18809 File: gfortran.info, Node: TRIM, Next: TTYNAM, Prev: TRANSPOSE, Up: Intrinsic Procedures 18810 18811 8.275 'TRIM' -- Remove trailing blank characters of a string 18812 ============================================================ 18813 18814 _Description_: 18815 Removes trailing blank characters of a string. 18816 18817 _Standard_: 18818 Fortran 90 and later 18819 18820 _Class_: 18821 Transformational function 18822 18823 _Syntax_: 18824 'RESULT = TRIM(STRING)' 18825 18826 _Arguments_: 18827 STRING Shall be a scalar of type 'CHARACTER'. 18828 18829 _Return value_: 18830 A scalar of type 'CHARACTER' which length is that of STRING less 18831 the number of trailing blanks. 18832 18833 _Example_: 18834 PROGRAM test_trim 18835 CHARACTER(len=10), PARAMETER :: s = "GFORTRAN " 18836 WRITE(*,*) LEN(s), LEN(TRIM(s)) ! "10 8", with/without trailing blanks 18837 END PROGRAM 18838 18839 _See also_: 18840 *note ADJUSTL::, *note ADJUSTR:: 18841 18842 18843 File: gfortran.info, Node: TTYNAM, Next: UBOUND, Prev: TRIM, Up: Intrinsic Procedures 18844 18845 8.276 'TTYNAM' -- Get the name of a terminal device. 18846 ==================================================== 18847 18848 _Description_: 18849 Get the name of a terminal device. For more information, see 18850 'ttyname(3)'. 18851 18852 This intrinsic is provided in both subroutine and function forms; 18853 however, only one form can be used in any given program unit. 18854 18855 _Standard_: 18856 GNU extension 18857 18858 _Class_: 18859 Subroutine, function 18860 18861 _Syntax_: 18862 'CALL TTYNAM(UNIT, NAME)' 18863 'NAME = TTYNAM(UNIT)' 18864 18865 _Arguments_: 18866 UNIT Shall be a scalar 'INTEGER'. 18867 NAME Shall be of type 'CHARACTER'. 18868 18869 _Example_: 18870 PROGRAM test_ttynam 18871 INTEGER :: unit 18872 DO unit = 1, 10 18873 IF (isatty(unit=unit)) write(*,*) ttynam(unit) 18874 END DO 18875 END PROGRAM 18876 18877 _See also_: 18878 *note ISATTY:: 18879 18880 18881 File: gfortran.info, Node: UBOUND, Next: UCOBOUND, Prev: TTYNAM, Up: Intrinsic Procedures 18882 18883 8.277 'UBOUND' -- Upper dimension bounds of an array 18884 ==================================================== 18885 18886 _Description_: 18887 Returns the upper bounds of an array, or a single upper bound along 18888 the DIM dimension. 18889 _Standard_: 18890 Fortran 90 and later, with KIND argument Fortran 2003 and later 18891 18892 _Class_: 18893 Inquiry function 18894 18895 _Syntax_: 18896 'RESULT = UBOUND(ARRAY [, DIM [, KIND]])' 18897 18898 _Arguments_: 18899 ARRAY Shall be an array, of any type. 18900 DIM (Optional) Shall be a scalar 'INTEGER'. 18901 KIND (Optional) An 'INTEGER' initialization 18902 expression indicating the kind parameter of the 18903 result. 18904 18905 _Return value_: 18906 The return value is of type 'INTEGER' and of kind KIND. If KIND is 18907 absent, the return value is of default integer kind. If DIM is 18908 absent, the result is an array of the upper bounds of ARRAY. If 18909 DIM is present, the result is a scalar corresponding to the upper 18910 bound of the array along that dimension. If ARRAY is an expression 18911 rather than a whole array or array structure component, or if it 18912 has a zero extent along the relevant dimension, the upper bound is 18913 taken to be the number of elements along the relevant dimension. 18914 18915 _See also_: 18916 *note LBOUND::, *note LCOBOUND:: 18917 18918 18919 File: gfortran.info, Node: UCOBOUND, Next: UMASK, Prev: UBOUND, Up: Intrinsic Procedures 18920 18921 8.278 'UCOBOUND' -- Upper codimension bounds of an array 18922 ======================================================== 18923 18924 _Description_: 18925 Returns the upper cobounds of a coarray, or a single upper cobound 18926 along the DIM codimension. 18927 _Standard_: 18928 Fortran 2008 and later 18929 18930 _Class_: 18931 Inquiry function 18932 18933 _Syntax_: 18934 'RESULT = UCOBOUND(COARRAY [, DIM [, KIND]])' 18935 18936 _Arguments_: 18937 ARRAY Shall be an coarray, of any type. 18938 DIM (Optional) Shall be a scalar 'INTEGER'. 18939 KIND (Optional) An 'INTEGER' initialization 18940 expression indicating the kind parameter of the 18941 result. 18942 18943 _Return value_: 18944 The return value is of type 'INTEGER' and of kind KIND. If KIND is 18945 absent, the return value is of default integer kind. If DIM is 18946 absent, the result is an array of the lower cobounds of COARRAY. 18947 If DIM is present, the result is a scalar corresponding to the 18948 lower cobound of the array along that codimension. 18949 18950 _See also_: 18951 *note LCOBOUND::, *note LBOUND:: 18952 18953 18954 File: gfortran.info, Node: UMASK, Next: UNLINK, Prev: UCOBOUND, Up: Intrinsic Procedures 18955 18956 8.279 'UMASK' -- Set the file creation mask 18957 =========================================== 18958 18959 _Description_: 18960 Sets the file creation mask to MASK. If called as a function, it 18961 returns the old value. If called as a subroutine and argument OLD 18962 if it is supplied, it is set to the old value. See 'umask(2)'. 18963 18964 _Standard_: 18965 GNU extension 18966 18967 _Class_: 18968 Subroutine, function 18969 18970 _Syntax_: 18971 'CALL UMASK(MASK [, OLD])' 18972 'OLD = UMASK(MASK)' 18973 18974 _Arguments_: 18975 MASK Shall be a scalar of type 'INTEGER'. 18976 OLD (Optional) Shall be a scalar of type 'INTEGER'. 18977 18978 18979 File: gfortran.info, Node: UNLINK, Next: UNPACK, Prev: UMASK, Up: Intrinsic Procedures 18980 18981 8.280 'UNLINK' -- Remove a file from the file system 18982 ==================================================== 18983 18984 _Description_: 18985 Unlinks the file PATH. A null character ('CHAR(0)') can be used to 18986 mark the end of the name in PATH; otherwise, trailing blanks in the 18987 file name are ignored. If the STATUS argument is supplied, it 18988 contains 0 on success or a nonzero error code upon return; see 18989 'unlink(2)'. 18990 18991 This intrinsic is provided in both subroutine and function forms; 18992 however, only one form can be used in any given program unit. 18993 18994 _Standard_: 18995 GNU extension 18996 18997 _Class_: 18998 Subroutine, function 18999 19000 _Syntax_: 19001 'CALL UNLINK(PATH [, STATUS])' 19002 'STATUS = UNLINK(PATH)' 19003 19004 _Arguments_: 19005 PATH Shall be of default 'CHARACTER' type. 19006 STATUS (Optional) Shall be of default 'INTEGER' type. 19007 19008 _See also_: 19009 *note LINK::, *note SYMLNK:: 19010 19011 19012 File: gfortran.info, Node: UNPACK, Next: VERIFY, Prev: UNLINK, Up: Intrinsic Procedures 19013 19014 8.281 'UNPACK' -- Unpack an array of rank one into an array 19015 =========================================================== 19016 19017 _Description_: 19018 Store the elements of VECTOR in an array of higher rank. 19019 19020 _Standard_: 19021 Fortran 90 and later 19022 19023 _Class_: 19024 Transformational function 19025 19026 _Syntax_: 19027 'RESULT = UNPACK(VECTOR, MASK, FIELD)' 19028 19029 _Arguments_: 19030 VECTOR Shall be an array of any type and rank one. It 19031 shall have at least as many elements as MASK has 19032 'TRUE' values. 19033 MASK Shall be an array of type 'LOGICAL'. 19034 FIELD Shall be of the same type as VECTOR and have the 19035 same shape as MASK. 19036 19037 _Return value_: 19038 The resulting array corresponds to FIELD with 'TRUE' elements of 19039 MASK replaced by values from VECTOR in array element order. 19040 19041 _Example_: 19042 PROGRAM test_unpack 19043 integer :: vector(2) = (/1,1/) 19044 logical :: mask(4) = (/ .TRUE., .FALSE., .FALSE., .TRUE. /) 19045 integer :: field(2,2) = 0, unity(2,2) 19046 19047 ! result: unity matrix 19048 unity = unpack(vector, reshape(mask, (/2,2/)), field) 19049 END PROGRAM 19050 19051 _See also_: 19052 *note PACK::, *note SPREAD:: 19053 19054 19055 File: gfortran.info, Node: VERIFY, Next: XOR, Prev: UNPACK, Up: Intrinsic Procedures 19056 19057 8.282 'VERIFY' -- Scan a string for characters not a given set 19058 ============================================================== 19059 19060 _Description_: 19061 Verifies that all the characters in STRING belong to the set of 19062 characters in SET. 19063 19064 If BACK is either absent or equals 'FALSE', this function returns 19065 the position of the leftmost character of STRING that is not in 19066 SET. If BACK equals 'TRUE', the rightmost position is returned. 19067 If all characters of STRING are found in SET, the result is zero. 19068 19069 _Standard_: 19070 Fortran 90 and later, with KIND argument Fortran 2003 and later 19071 19072 _Class_: 19073 Elemental function 19074 19075 _Syntax_: 19076 'RESULT = VERIFY(STRING, SET[, BACK [, KIND]])' 19077 19078 _Arguments_: 19079 STRING Shall be of type 'CHARACTER'. 19080 SET Shall be of type 'CHARACTER'. 19081 BACK (Optional) shall be of type 'LOGICAL'. 19082 KIND (Optional) An 'INTEGER' initialization 19083 expression indicating the kind parameter of the 19084 result. 19085 19086 _Return value_: 19087 The return value is of type 'INTEGER' and of kind KIND. If KIND is 19088 absent, the return value is of default integer kind. 19089 19090 _Example_: 19091 PROGRAM test_verify 19092 WRITE(*,*) VERIFY("FORTRAN", "AO") ! 1, found 'F' 19093 WRITE(*,*) VERIFY("FORTRAN", "FOO") ! 3, found 'R' 19094 WRITE(*,*) VERIFY("FORTRAN", "C++") ! 1, found 'F' 19095 WRITE(*,*) VERIFY("FORTRAN", "C++", .TRUE.) ! 7, found 'N' 19096 WRITE(*,*) VERIFY("FORTRAN", "FORTRAN") ! 0' found none 19097 END PROGRAM 19098 19099 _See also_: 19100 *note SCAN::, *note INDEX intrinsic:: 19101 19102 19103 File: gfortran.info, Node: XOR, Prev: VERIFY, Up: Intrinsic Procedures 19104 19105 8.283 'XOR' -- Bitwise logical exclusive OR 19106 =========================================== 19107 19108 _Description_: 19109 Bitwise logical exclusive or. 19110 19111 This intrinsic routine is provided for backwards compatibility with 19112 GNU Fortran 77. For integer arguments, programmers should consider 19113 the use of the *note IEOR:: intrinsic and for logical arguments the 19114 '.NEQV.' operator, which are both defined by the Fortran standard. 19115 19116 _Standard_: 19117 GNU extension 19118 19119 _Class_: 19120 Function 19121 19122 _Syntax_: 19123 'RESULT = XOR(I, J)' 19124 19125 _Arguments_: 19126 I The type shall be either a scalar 'INTEGER' type 19127 or a scalar 'LOGICAL' type or a 19128 boz-literal-constant. 19129 J The type shall be the same as the type of I or a 19130 boz-literal-constant. I and J shall not both be 19131 boz-literal-constants. If either I and J is a 19132 boz-literal-constant, then the other argument 19133 must be a scalar 'INTEGER'. 19134 19135 _Return value_: 19136 The return type is either a scalar 'INTEGER' or a scalar 'LOGICAL'. 19137 If the kind type parameters differ, then the smaller kind type is 19138 implicitly converted to larger kind, and the return has the larger 19139 kind. A boz-literal-constant is converted to an 'INTEGER' with the 19140 kind type parameter of the other argument as-if a call to *note 19141 INT:: occurred. 19142 19143 _Example_: 19144 PROGRAM test_xor 19145 LOGICAL :: T = .TRUE., F = .FALSE. 19146 INTEGER :: a, b 19147 DATA a / Z'F' /, b / Z'3' / 19148 19149 WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F) 19150 WRITE (*,*) XOR(a, b) 19151 END PROGRAM 19152 19153 _See also_: 19154 Fortran 95 elemental function: *note IEOR:: 19155 19156 19157 File: gfortran.info, Node: Intrinsic Modules, Next: Contributing, Prev: Intrinsic Procedures, Up: Top 19158 19159 9 Intrinsic Modules 19160 ******************* 19161 19162 * Menu: 19163 19164 * ISO_FORTRAN_ENV:: 19165 * ISO_C_BINDING:: 19166 * IEEE modules:: 19167 * OpenMP Modules OMP_LIB and OMP_LIB_KINDS:: 19168 * OpenACC Module OPENACC:: 19169 19170 19171 File: gfortran.info, Node: ISO_FORTRAN_ENV, Next: ISO_C_BINDING, Up: Intrinsic Modules 19172 19173 9.1 'ISO_FORTRAN_ENV' 19174 ===================== 19175 19176 _Standard_: 19177 Fortran 2003 and later, except when otherwise noted 19178 19179 The 'ISO_FORTRAN_ENV' module provides the following scalar 19180 default-integer named constants: 19181 19182 'ATOMIC_INT_KIND': 19183 Default-kind integer constant to be used as kind parameter when 19184 defining integer variables used in atomic operations. (Fortran 19185 2008 or later.) 19186 19187 'ATOMIC_LOGICAL_KIND': 19188 Default-kind integer constant to be used as kind parameter when 19189 defining logical variables used in atomic operations. (Fortran 19190 2008 or later.) 19191 19192 'CHARACTER_KINDS': 19193 Default-kind integer constant array of rank one containing the 19194 supported kind parameters of the 'CHARACTER' type. (Fortran 2008 19195 or later.) 19196 19197 'CHARACTER_STORAGE_SIZE': 19198 Size in bits of the character storage unit. 19199 19200 'ERROR_UNIT': 19201 Identifies the preconnected unit used for error reporting. 19202 19203 'FILE_STORAGE_SIZE': 19204 Size in bits of the file-storage unit. 19205 19206 'INPUT_UNIT': 19207 Identifies the preconnected unit identified by the asterisk ('*') 19208 in 'READ' statement. 19209 19210 'INT8', 'INT16', 'INT32', 'INT64': 19211 Kind type parameters to specify an INTEGER type with a storage size 19212 of 16, 32, and 64 bits. It is negative if a target platform does 19213 not support the particular kind. (Fortran 2008 or later.) 19214 19215 'INTEGER_KINDS': 19216 Default-kind integer constant array of rank one containing the 19217 supported kind parameters of the 'INTEGER' type. (Fortran 2008 or 19218 later.) 19219 19220 'IOSTAT_END': 19221 The value assigned to the variable passed to the 'IOSTAT=' 19222 specifier of an input/output statement if an end-of-file condition 19223 occurred. 19224 19225 'IOSTAT_EOR': 19226 The value assigned to the variable passed to the 'IOSTAT=' 19227 specifier of an input/output statement if an end-of-record 19228 condition occurred. 19229 19230 'IOSTAT_INQUIRE_INTERNAL_UNIT': 19231 Scalar default-integer constant, used by 'INQUIRE' for the 19232 'IOSTAT=' specifier to denote an that a unit number identifies an 19233 internal unit. (Fortran 2008 or later.) 19234 19235 'NUMERIC_STORAGE_SIZE': 19236 The size in bits of the numeric storage unit. 19237 19238 'LOGICAL_KINDS': 19239 Default-kind integer constant array of rank one containing the 19240 supported kind parameters of the 'LOGICAL' type. (Fortran 2008 or 19241 later.) 19242 19243 'OUTPUT_UNIT': 19244 Identifies the preconnected unit identified by the asterisk ('*') 19245 in 'WRITE' statement. 19246 19247 'REAL32', 'REAL64', 'REAL128': 19248 Kind type parameters to specify a REAL type with a storage size of 19249 32, 64, and 128 bits. It is negative if a target platform does not 19250 support the particular kind. (Fortran 2008 or later.) 19251 19252 'REAL_KINDS': 19253 Default-kind integer constant array of rank one containing the 19254 supported kind parameters of the 'REAL' type. (Fortran 2008 or 19255 later.) 19256 19257 'STAT_LOCKED': 19258 Scalar default-integer constant used as STAT= return value by 19259 'LOCK' to denote that the lock variable is locked by the executing 19260 image. (Fortran 2008 or later.) 19261 19262 'STAT_LOCKED_OTHER_IMAGE': 19263 Scalar default-integer constant used as STAT= return value by 19264 'UNLOCK' to denote that the lock variable is locked by another 19265 image. (Fortran 2008 or later.) 19266 19267 'STAT_STOPPED_IMAGE': 19268 Positive, scalar default-integer constant used as STAT= return 19269 value if the argument in the statement requires synchronisation 19270 with an image, which has initiated the termination of the 19271 execution. (Fortran 2008 or later.) 19272 19273 'STAT_FAILED_IMAGE': 19274 Positive, scalar default-integer constant used as STAT= return 19275 value if the argument in the statement requires communication with 19276 an image, which has is in the failed state. (TS 18508 or later.) 19277 19278 'STAT_UNLOCKED': 19279 Scalar default-integer constant used as STAT= return value by 19280 'UNLOCK' to denote that the lock variable is unlocked. (Fortran 19281 2008 or later.) 19282 19283 The module provides the following derived type: 19284 19285 'LOCK_TYPE': 19286 Derived type with private components to be use with the 'LOCK' and 19287 'UNLOCK' statement. A variable of its type has to be always 19288 declared as coarray and may not appear in a variable-definition 19289 context. (Fortran 2008 or later.) 19290 19291 The module also provides the following intrinsic procedures: *note 19292 COMPILER_OPTIONS:: and *note COMPILER_VERSION::. 19293 19294 19295 File: gfortran.info, Node: ISO_C_BINDING, Next: IEEE modules, Prev: ISO_FORTRAN_ENV, Up: Intrinsic Modules 19296 19297 9.2 'ISO_C_BINDING' 19298 =================== 19299 19300 _Standard_: 19301 Fortran 2003 and later, GNU extensions 19302 19303 The following intrinsic procedures are provided by the module; their 19304 definition can be found in the section Intrinsic Procedures of this 19305 manual. 19306 19307 'C_ASSOCIATED' 19308 'C_F_POINTER' 19309 'C_F_PROCPOINTER' 19310 'C_FUNLOC' 19311 'C_LOC' 19312 'C_SIZEOF' 19313 19314 The 'ISO_C_BINDING' module provides the following named constants of 19315 type default integer, which can be used as KIND type parameters. 19316 19317 In addition to the integer named constants required by the Fortran 19318 2003 standard and 'C_PTRDIFF_T' of TS 29113, GNU Fortran provides as an 19319 extension named constants for the 128-bit integer types supported by the 19320 C compiler: 'C_INT128_T, C_INT_LEAST128_T, C_INT_FAST128_T'. 19321 Furthermore, if '_Float128' is supported in C, the named constants 19322 'C_FLOAT128' and 'C_FLOAT128_COMPLEX' are defined. 19323 19324 Fortran Type Named constant C type Extension 19325 ---------------------------------------------------------------------------- 19326 'INTEGER' 'C_INT' 'int' 19327 'INTEGER' 'C_SHORT' 'short int' 19328 'INTEGER' 'C_LONG' 'long int' 19329 'INTEGER' 'C_LONG_LONG' 'long long int' 19330 'INTEGER' 'C_SIGNED_CHAR' 'signed 19331 char'/'unsigned char' 19332 'INTEGER' 'C_SIZE_T' 'size_t' 19333 'INTEGER' 'C_INT8_T' 'int8_t' 19334 'INTEGER' 'C_INT16_T' 'int16_t' 19335 'INTEGER' 'C_INT32_T' 'int32_t' 19336 'INTEGER' 'C_INT64_T' 'int64_t' 19337 'INTEGER' 'C_INT128_T' 'int128_t' Ext. 19338 'INTEGER' 'C_INT_LEAST8_T' 'int_least8_t' 19339 'INTEGER' 'C_INT_LEAST16_T' 'int_least16_t' 19340 'INTEGER' 'C_INT_LEAST32_T' 'int_least32_t' 19341 'INTEGER' 'C_INT_LEAST64_T' 'int_least64_t' 19342 'INTEGER' 'C_INT_LEAST128_T' 'int_least128_t' Ext. 19343 'INTEGER' 'C_INT_FAST8_T' 'int_fast8_t' 19344 'INTEGER' 'C_INT_FAST16_T' 'int_fast16_t' 19345 'INTEGER' 'C_INT_FAST32_T' 'int_fast32_t' 19346 'INTEGER' 'C_INT_FAST64_T' 'int_fast64_t' 19347 'INTEGER' 'C_INT_FAST128_T' 'int_fast128_t' Ext. 19348 'INTEGER' 'C_INTMAX_T' 'intmax_t' 19349 'INTEGER' 'C_INTPTR_T' 'intptr_t' 19350 'INTEGER' 'C_PTRDIFF_T' 'ptrdiff_t' TS 29113 19351 'REAL' 'C_FLOAT' 'float' 19352 'REAL' 'C_DOUBLE' 'double' 19353 'REAL' 'C_LONG_DOUBLE' 'long double' 19354 'REAL' 'C_FLOAT128' '_Float128' Ext. 19355 'COMPLEX' 'C_FLOAT_COMPLEX' 'float _Complex' 19356 'COMPLEX' 'C_DOUBLE_COMPLEX' 'double _Complex' 19357 'COMPLEX' 'C_LONG_DOUBLE_COMPLEX' 'long double _Complex' 19358 'COMPLEX' 'C_FLOAT128_COMPLEX' '_Float128 _Complex' Ext. 19359 'LOGICAL' 'C_BOOL' '_Bool' 19360 'CHARACTER' 'C_CHAR' 'char' 19361 19362 Additionally, the following parameters of type 19363 'CHARACTER(KIND=C_CHAR)' are defined. 19364 19365 Name C definition Value 19366 ------------------------------------------------------------ 19367 'C_NULL_CHAR' null character ''\0'' 19368 'C_ALERT' alert ''\a'' 19369 'C_BACKSPACE' backspace ''\b'' 19370 'C_FORM_FEED' form feed ''\f'' 19371 'C_NEW_LINE' new line ''\n'' 19372 'C_CARRIAGE_RETURN'carriage return ''\r'' 19373 'C_HORIZONTAL_TAB'horizontal tab ''\t'' 19374 'C_VERTICAL_TAB'vertical tab ''\v'' 19375 19376 Moreover, the following two named constants are defined: 19377 19378 Name Type 19379 -------------------------------------------------------------------------- 19380 'C_NULL_PTR' 'C_PTR' 19381 'C_NULL_FUNPTR''C_FUNPTR' 19382 19383 Both are equivalent to the value 'NULL' in C. 19384 19385 19386 File: gfortran.info, Node: IEEE modules, Next: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Prev: ISO_C_BINDING, Up: Intrinsic Modules 19387 19388 9.3 IEEE modules: 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES' 19389 =========================================================================== 19390 19391 _Standard_: 19392 Fortran 2003 and later 19393 19394 The 'IEEE_EXCEPTIONS', 'IEEE_ARITHMETIC', and 'IEEE_FEATURES' 19395 intrinsic modules provide support for exceptions and IEEE arithmetic, as 19396 defined in Fortran 2003 and later standards, and the IEC 60559:1989 19397 standard (_Binary floating-point arithmetic for microprocessor 19398 systems_). These modules are only provided on the following supported 19399 platforms: 19400 19401 * i386 and x86_64 processors 19402 * platforms which use the GNU C Library (glibc) 19403 * platforms with support for SysV/386 routines for floating point 19404 interface (including Solaris and BSDs) 19405 * platforms with the AIX OS 19406 19407 For full compliance with the Fortran standards, code using the 19408 'IEEE_EXCEPTIONS' or 'IEEE_ARITHMETIC' modules should be compiled with 19409 the following options: '-fno-unsafe-math-optimizations -frounding-math 19410 -fsignaling-nans'. 19411 19412 19413 File: gfortran.info, Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Next: OpenACC Module OPENACC, Prev: IEEE modules, Up: Intrinsic Modules 19414 19415 9.4 OpenMP Modules 'OMP_LIB' and 'OMP_LIB_KINDS' 19416 ================================================ 19417 19418 _Standard_: 19419 OpenMP Application Program Interface v4.5, OpenMP Application 19420 Program Interface v5.0 (partially supported) and OpenMP Application 19421 Program Interface v5.1 (partially supported). 19422 19423 The OpenMP Fortran runtime library routines are provided both in a 19424 form of two Fortran modules, named 'OMP_LIB' and 'OMP_LIB_KINDS', and in 19425 a form of a Fortran 'include' file named 'omp_lib.h'. The procedures 19426 provided by 'OMP_LIB' can be found in the *note Introduction: 19427 (libgomp)Top. manual, the named constants defined in the modules are 19428 listed below. 19429 19430 For details refer to the actual OpenMP Application Program Interface 19431 v4.5 (https://www.openmp.org/wp-content/uploads/openmp-4.5.pdf) and 19432 OpenMP Application Program Interface v5.0 19433 (https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5.0.pdf). 19434 19435 'OMP_LIB_KINDS' provides the following scalar default-integer named 19436 constants: 19437 19438 'omp_allocator_handle_kind' 19439 'omp_alloctrait_key_kind' 19440 'omp_alloctrait_val_kind' 19441 'omp_depend_kind' 19442 'omp_lock_kind' 19443 'omp_lock_hint_kind' 19444 'omp_nest_lock_kind' 19445 'omp_pause_resource_kind' 19446 'omp_memspace_handle_kind' 19447 'omp_proc_bind_kind' 19448 'omp_sched_kind' 19449 'omp_sync_hint_kind' 19450 19451 'OMP_LIB' provides the scalar default-integer named constant 19452 'openmp_version' with a value of the form YYYYMM, where 'yyyy' is the 19453 year and MM the month of the OpenMP version; for OpenMP v4.5 the value 19454 is '201511'. 19455 19456 The following derived type: 19457 19458 'omp_alloctrait' 19459 19460 The following scalar integer named constants of the kind 19461 'omp_sched_kind': 19462 19463 'omp_sched_static' 19464 'omp_sched_dynamic' 19465 'omp_sched_guided' 19466 'omp_sched_auto' 19467 19468 And the following scalar integer named constants of the kind 19469 'omp_proc_bind_kind': 19470 19471 'omp_proc_bind_false' 19472 'omp_proc_bind_true' 19473 'omp_proc_bind_primary' 19474 'omp_proc_bind_master' 19475 'omp_proc_bind_close' 19476 'omp_proc_bind_spread' 19477 19478 The following scalar integer named constants are of the kind 19479 'omp_lock_hint_kind': 19480 19481 'omp_lock_hint_none' 19482 'omp_lock_hint_uncontended' 19483 'omp_lock_hint_contended' 19484 'omp_lock_hint_nonspeculative' 19485 'omp_lock_hint_speculative' 19486 'omp_sync_hint_none' 19487 'omp_sync_hint_uncontended' 19488 'omp_sync_hint_contended' 19489 'omp_sync_hint_nonspeculative' 19490 'omp_sync_hint_speculative' 19491 19492 And the following two scalar integer named constants are of the kind 19493 'omp_pause_resource_kind': 19494 19495 'omp_pause_soft' 19496 'omp_pause_hard' 19497 19498 The following scalar integer named constants are of the kind 19499 'omp_alloctrait_key_kind': 19500 19501 'omp_atk_sync_hint' 19502 'omp_atk_alignment' 19503 'omp_atk_access' 19504 'omp_atk_pool_size' 19505 'omp_atk_fallback' 19506 'omp_atk_fb_data' 19507 'omp_atk_pinned' 19508 'omp_atk_partition' 19509 19510 The following scalar integer named constants are of the kind 19511 'omp_alloctrait_val_kind': 19512 19513 'omp_alloctrait_key_kind': 19514 'omp_atv_default' 19515 'omp_atv_false' 19516 'omp_atv_true' 19517 'omp_atv_contended' 19518 'omp_atv_uncontended' 19519 'omp_atv_serialized' 19520 'omp_atv_sequential' 19521 'omp_atv_private' 19522 'omp_atv_all' 19523 'omp_atv_thread' 19524 'omp_atv_pteam' 19525 'omp_atv_cgroup' 19526 'omp_atv_default_mem_fb' 19527 'omp_atv_null_fb' 19528 'omp_atv_abort_fb' 19529 'omp_atv_allocator_fb' 19530 'omp_atv_environment' 19531 'omp_atv_nearest' 19532 'omp_atv_blocked' 19533 19534 The following scalar integer named constants are of the kind 19535 'omp_allocator_handle_kind': 19536 19537 'omp_null_allocator' 19538 'omp_default_mem_alloc' 19539 'omp_large_cap_mem_alloc' 19540 'omp_const_mem_alloc' 19541 'omp_high_bw_mem_alloc' 19542 'omp_low_lat_mem_alloc' 19543 'omp_cgroup_mem_alloc' 19544 'omp_pteam_mem_alloc' 19545 'omp_thread_mem_alloc' 19546 19547 The following scalar integer named constants are of the kind 19548 'omp_memspace_handle_kind': 19549 19550 'omp_default_mem_space' 19551 'omp_large_cap_mem_space' 19552 'omp_const_mem_space' 19553 'omp_high_bw_mem_space' 19554 'omp_low_lat_mem_space' 19555 19556 19557 File: gfortran.info, Node: OpenACC Module OPENACC, Prev: OpenMP Modules OMP_LIB and OMP_LIB_KINDS, Up: Intrinsic Modules 19558 19559 9.5 OpenACC Module 'OPENACC' 19560 ============================ 19561 19562 _Standard_: 19563 OpenACC Application Programming Interface v2.6 19564 19565 The OpenACC Fortran runtime library routines are provided both in a 19566 form of a Fortran 90 module, named 'OPENACC', and in form of a Fortran 19567 'include' file named 'openacc_lib.h'. The procedures provided by 19568 'OPENACC' can be found in the *note Introduction: (libgomp)Top. manual, 19569 the named constants defined in the modules are listed below. 19570 19571 For details refer to the actual OpenACC Application Programming 19572 Interface v2.6 (https://www.openacc.org/). 19573 19574 'OPENACC' provides the scalar default-integer named constant 19575 'openacc_version' with a value of the form YYYYMM, where 'yyyy' is the 19576 year and MM the month of the OpenACC version; for OpenACC v2.6 the value 19577 is '201711'. 19578 19579 19580 File: gfortran.info, Node: Contributing, Next: Copying, Prev: Intrinsic Modules, Up: Top 19581 19582 Contributing 19583 ************ 19584 19585 Free software is only possible if people contribute to efforts to create 19586 it. We're always in need of more people helping out with ideas and 19587 comments, writing documentation and contributing code. 19588 19589 If you want to contribute to GNU Fortran, have a look at the long 19590 lists of projects you can take on. Some of these projects are small, 19591 some of them are large; some are completely orthogonal to the rest of 19592 what is happening on GNU Fortran, but others are "mainstream" projects 19593 in need of enthusiastic hackers. All of these projects are important! 19594 We will eventually get around to the things here, but they are also 19595 things doable by someone who is willing and able. 19596 19597 * Menu: 19598 19599 * Contributors:: 19600 * Projects:: 19601 19602 19603 File: gfortran.info, Node: Contributors, Next: Projects, Up: Contributing 19604 19605 Contributors to GNU Fortran 19606 =========================== 19607 19608 Most of the parser was hand-crafted by _Andy Vaught_, who is also the 19609 initiator of the whole project. Thanks Andy! Most of the interface 19610 with GCC was written by _Paul Brook_. 19611 19612 The following individuals have contributed code and/or ideas and 19613 significant help to the GNU Fortran project (in alphabetical order): 19614 19615 - Janne Blomqvist 19616 - Steven Bosscher 19617 - Paul Brook 19618 - Tobias Burnus 19619 - Franc,ois-Xavier Coudert 19620 - Bud Davis 19621 - Jerry DeLisle 19622 - Erik Edelmann 19623 - Bernhard Fischer 19624 - Daniel Franke 19625 - Richard Guenther 19626 - Richard Henderson 19627 - Katherine Holcomb 19628 - Jakub Jelinek 19629 - Niels Kristian Bech Jensen 19630 - Steven Johnson 19631 - Steven G. Kargl 19632 - Thomas Koenig 19633 - Asher Langton 19634 - H. J. Lu 19635 - Toon Moene 19636 - Brooks Moses 19637 - Andrew Pinski 19638 - Tim Prince 19639 - Christopher D. Rickett 19640 - Richard Sandiford 19641 - Tobias Schlu"ter 19642 - Roger Sayle 19643 - Paul Thomas 19644 - Andy Vaught 19645 - Feng Wang 19646 - Janus Weil 19647 - Daniel Kraft 19648 19649 The following people have contributed bug reports, smaller or larger 19650 patches, and much needed feedback and encouragement for the GNU Fortran 19651 project: 19652 19653 - Bill Clodius 19654 - Dominique d'Humie`res 19655 - Kate Hedstrom 19656 - Erik Schnetter 19657 - Gerhard Steinmetz 19658 - Joost VandeVondele 19659 19660 Many other individuals have helped debug, test and improve the GNU 19661 Fortran compiler over the past few years, and we welcome you to do the 19662 same! If you already have done so, and you would like to see your name 19663 listed in the list above, please contact us. 19664 19665 19666 File: gfortran.info, Node: Projects, Prev: Contributors, Up: Contributing 19667 19668 Projects 19669 ======== 19670 19671 _Help build the test suite_ 19672 Solicit more code for donation to the test suite: the more 19673 extensive the testsuite, the smaller the risk of breaking things in 19674 the future! We can keep code private on request. 19675 19676 _Bug hunting/squishing_ 19677 Find bugs and write more test cases! Test cases are especially 19678 very welcome, because it allows us to concentrate on fixing bugs 19679 instead of isolating them. Going through the bugzilla database at 19680 <https://gcc.gnu.org/bugzilla/> to reduce testcases posted there 19681 and add more information (for example, for which version does the 19682 testcase work, for which versions does it fail?) is also very 19683 helpful. 19684 19685 _Missing features_ 19686 For a larger project, consider working on the missing features 19687 required for Fortran language standards compliance (*note 19688 Standards::), or contributing to the implementation of extensions 19689 such as OpenMP (*note OpenMP::) or OpenACC (*note OpenACC::) that 19690 are under active development. Again, contributing test cases for 19691 these features is useful too! 19692 19693 19694 File: gfortran.info, Node: Copying, Next: GNU Free Documentation License, Prev: Contributing, Up: Top 19695 19696 GNU General Public License 19697 ************************** 19698 19699 Version 3, 29 June 2007 19700 19701 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> 19702 19703 Everyone is permitted to copy and distribute verbatim copies of this 19704 license document, but changing it is not allowed. 19705 19706 Preamble 19707 ======== 19708 19709 The GNU General Public License is a free, copyleft license for software 19710 and other kinds of works. 19711 19712 The licenses for most software and other practical works are designed 19713 to take away your freedom to share and change the works. By contrast, 19714 the GNU General Public License is intended to guarantee your freedom to 19715 share and change all versions of a program-to make sure it remains free 19716 software for all its users. We, the Free Software Foundation, use the 19717 GNU General Public License for most of our software; it applies also to 19718 any other work released this way by its authors. You can apply it to 19719 your programs, too. 19720 19721 When we speak of free software, we are referring to freedom, not 19722 price. Our General Public Licenses are designed to make sure that you 19723 have the freedom to distribute copies of free software (and charge for 19724 them if you wish), that you receive source code or can get it if you 19725 want it, that you can change the software or use pieces of it in new 19726 free programs, and that you know you can do these things. 19727 19728 To protect your rights, we need to prevent others from denying you 19729 these rights or asking you to surrender the rights. Therefore, you have 19730 certain responsibilities if you distribute copies of the software, or if 19731 you modify it: responsibilities to respect the freedom of others. 19732 19733 For example, if you distribute copies of such a program, whether 19734 gratis or for a fee, you must pass on to the recipients the same 19735 freedoms that you received. You must make sure that they, too, receive 19736 or can get the source code. And you must show them these terms so they 19737 know their rights. 19738 19739 Developers that use the GNU GPL protect your rights with two steps: 19740 (1) assert copyright on the software, and (2) offer you this License 19741 giving you legal permission to copy, distribute and/or modify it. 19742 19743 For the developers' and authors' protection, the GPL clearly explains 19744 that there is no warranty for this free software. For both users' and 19745 authors' sake, the GPL requires that modified versions be marked as 19746 changed, so that their problems will not be attributed erroneously to 19747 authors of previous versions. 19748 19749 Some devices are designed to deny users access to install or run 19750 modified versions of the software inside them, although the manufacturer 19751 can do so. This is fundamentally incompatible with the aim of 19752 protecting users' freedom to change the software. The systematic 19753 pattern of such abuse occurs in the area of products for individuals to 19754 use, which is precisely where it is most unacceptable. Therefore, we 19755 have designed this version of the GPL to prohibit the practice for those 19756 products. If such problems arise substantially in other domains, we 19757 stand ready to extend this provision to those domains in future versions 19758 of the GPL, as needed to protect the freedom of users. 19759 19760 Finally, every program is threatened constantly by software patents. 19761 States should not allow patents to restrict development and use of 19762 software on general-purpose computers, but in those that do, we wish to 19763 avoid the special danger that patents applied to a free program could 19764 make it effectively proprietary. To prevent this, the GPL assures that 19765 patents cannot be used to render the program non-free. 19766 19767 The precise terms and conditions for copying, distribution and 19768 modification follow. 19769 19770 TERMS AND CONDITIONS 19771 ==================== 19772 19773 0. Definitions. 19774 19775 "This License" refers to version 3 of the GNU General Public 19776 License. 19777 19778 "Copyright" also means copyright-like laws that apply to other 19779 kinds of works, such as semiconductor masks. 19780 19781 "The Program" refers to any copyrightable work licensed under this 19782 License. Each licensee is addressed as "you". "Licensees" and 19783 "recipients" may be individuals or organizations. 19784 19785 To "modify" a work means to copy from or adapt all or part of the 19786 work in a fashion requiring copyright permission, other than the 19787 making of an exact copy. The resulting work is called a "modified 19788 version" of the earlier work or a work "based on" the earlier work. 19789 19790 A "covered work" means either the unmodified Program or a work 19791 based on the Program. 19792 19793 To "propagate" a work means to do anything with it that, without 19794 permission, would make you directly or secondarily liable for 19795 infringement under applicable copyright law, except executing it on 19796 a computer or modifying a private copy. Propagation includes 19797 copying, distribution (with or without modification), making 19798 available to the public, and in some countries other activities as 19799 well. 19800 19801 To "convey" a work means any kind of propagation that enables other 19802 parties to make or receive copies. Mere interaction with a user 19803 through a computer network, with no transfer of a copy, is not 19804 conveying. 19805 19806 An interactive user interface displays "Appropriate Legal Notices" 19807 to the extent that it includes a convenient and prominently visible 19808 feature that (1) displays an appropriate copyright notice, and (2) 19809 tells the user that there is no warranty for the work (except to 19810 the extent that warranties are provided), that licensees may convey 19811 the work under this License, and how to view a copy of this 19812 License. If the interface presents a list of user commands or 19813 options, such as a menu, a prominent item in the list meets this 19814 criterion. 19815 19816 1. Source Code. 19817 19818 The "source code" for a work means the preferred form of the work 19819 for making modifications to it. "Object code" means any non-source 19820 form of a work. 19821 19822 A "Standard Interface" means an interface that either is an 19823 official standard defined by a recognized standards body, or, in 19824 the case of interfaces specified for a particular programming 19825 language, one that is widely used among developers working in that 19826 language. 19827 19828 The "System Libraries" of an executable work include anything, 19829 other than the work as a whole, that (a) is included in the normal 19830 form of packaging a Major Component, but which is not part of that 19831 Major Component, and (b) serves only to enable use of the work with 19832 that Major Component, or to implement a Standard Interface for 19833 which an implementation is available to the public in source code 19834 form. A "Major Component", in this context, means a major 19835 essential component (kernel, window system, and so on) of the 19836 specific operating system (if any) on which the executable work 19837 runs, or a compiler used to produce the work, or an object code 19838 interpreter used to run it. 19839 19840 The "Corresponding Source" for a work in object code form means all 19841 the source code needed to generate, install, and (for an executable 19842 work) run the object code and to modify the work, including scripts 19843 to control those activities. However, it does not include the 19844 work's System Libraries, or general-purpose tools or generally 19845 available free programs which are used unmodified in performing 19846 those activities but which are not part of the work. For example, 19847 Corresponding Source includes interface definition files associated 19848 with source files for the work, and the source code for shared 19849 libraries and dynamically linked subprograms that the work is 19850 specifically designed to require, such as by intimate data 19851 communication or control flow between those subprograms and other 19852 parts of the work. 19853 19854 The Corresponding Source need not include anything that users can 19855 regenerate automatically from other parts of the Corresponding 19856 Source. 19857 19858 The Corresponding Source for a work in source code form is that 19859 same work. 19860 19861 2. Basic Permissions. 19862 19863 All rights granted under this License are granted for the term of 19864 copyright on the Program, and are irrevocable provided the stated 19865 conditions are met. This License explicitly affirms your unlimited 19866 permission to run the unmodified Program. The output from running 19867 a covered work is covered by this License only if the output, given 19868 its content, constitutes a covered work. This License acknowledges 19869 your rights of fair use or other equivalent, as provided by 19870 copyright law. 19871 19872 You may make, run and propagate covered works that you do not 19873 convey, without conditions so long as your license otherwise 19874 remains in force. You may convey covered works to others for the 19875 sole purpose of having them make modifications exclusively for you, 19876 or provide you with facilities for running those works, provided 19877 that you comply with the terms of this License in conveying all 19878 material for which you do not control copyright. Those thus making 19879 or running the covered works for you must do so exclusively on your 19880 behalf, under your direction and control, on terms that prohibit 19881 them from making any copies of your copyrighted material outside 19882 their relationship with you. 19883 19884 Conveying under any other circumstances is permitted solely under 19885 the conditions stated below. Sublicensing is not allowed; section 19886 10 makes it unnecessary. 19887 19888 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 19889 19890 No covered work shall be deemed part of an effective technological 19891 measure under any applicable law fulfilling obligations under 19892 article 11 of the WIPO copyright treaty adopted on 20 December 19893 1996, or similar laws prohibiting or restricting circumvention of 19894 such measures. 19895 19896 When you convey a covered work, you waive any legal power to forbid 19897 circumvention of technological measures to the extent such 19898 circumvention is effected by exercising rights under this License 19899 with respect to the covered work, and you disclaim any intention to 19900 limit operation or modification of the work as a means of 19901 enforcing, against the work's users, your or third parties' legal 19902 rights to forbid circumvention of technological measures. 19903 19904 4. Conveying Verbatim Copies. 19905 19906 You may convey verbatim copies of the Program's source code as you 19907 receive it, in any medium, provided that you conspicuously and 19908 appropriately publish on each copy an appropriate copyright notice; 19909 keep intact all notices stating that this License and any 19910 non-permissive terms added in accord with section 7 apply to the 19911 code; keep intact all notices of the absence of any warranty; and 19912 give all recipients a copy of this License along with the Program. 19913 19914 You may charge any price or no price for each copy that you convey, 19915 and you may offer support or warranty protection for a fee. 19916 19917 5. Conveying Modified Source Versions. 19918 19919 You may convey a work based on the Program, or the modifications to 19920 produce it from the Program, in the form of source code under the 19921 terms of section 4, provided that you also meet all of these 19922 conditions: 19923 19924 a. The work must carry prominent notices stating that you 19925 modified it, and giving a relevant date. 19926 19927 b. The work must carry prominent notices stating that it is 19928 released under this License and any conditions added under 19929 section 7. This requirement modifies the requirement in 19930 section 4 to "keep intact all notices". 19931 19932 c. You must license the entire work, as a whole, under this 19933 License to anyone who comes into possession of a copy. This 19934 License will therefore apply, along with any applicable 19935 section 7 additional terms, to the whole of the work, and all 19936 its parts, regardless of how they are packaged. This License 19937 gives no permission to license the work in any other way, but 19938 it does not invalidate such permission if you have separately 19939 received it. 19940 19941 d. If the work has interactive user interfaces, each must display 19942 Appropriate Legal Notices; however, if the Program has 19943 interactive interfaces that do not display Appropriate Legal 19944 Notices, your work need not make them do so. 19945 19946 A compilation of a covered work with other separate and independent 19947 works, which are not by their nature extensions of the covered 19948 work, and which are not combined with it such as to form a larger 19949 program, in or on a volume of a storage or distribution medium, is 19950 called an "aggregate" if the compilation and its resulting 19951 copyright are not used to limit the access or legal rights of the 19952 compilation's users beyond what the individual works permit. 19953 Inclusion of a covered work in an aggregate does not cause this 19954 License to apply to the other parts of the aggregate. 19955 19956 6. Conveying Non-Source Forms. 19957 19958 You may convey a covered work in object code form under the terms 19959 of sections 4 and 5, provided that you also convey the 19960 machine-readable Corresponding Source under the terms of this 19961 License, in one of these ways: 19962 19963 a. Convey the object code in, or embodied in, a physical product 19964 (including a physical distribution medium), accompanied by the 19965 Corresponding Source fixed on a durable physical medium 19966 customarily used for software interchange. 19967 19968 b. Convey the object code in, or embodied in, a physical product 19969 (including a physical distribution medium), accompanied by a 19970 written offer, valid for at least three years and valid for as 19971 long as you offer spare parts or customer support for that 19972 product model, to give anyone who possesses the object code 19973 either (1) a copy of the Corresponding Source for all the 19974 software in the product that is covered by this License, on a 19975 durable physical medium customarily used for software 19976 interchange, for a price no more than your reasonable cost of 19977 physically performing this conveying of source, or (2) access 19978 to copy the Corresponding Source from a network server at no 19979 charge. 19980 19981 c. Convey individual copies of the object code with a copy of the 19982 written offer to provide the Corresponding Source. This 19983 alternative is allowed only occasionally and noncommercially, 19984 and only if you received the object code with such an offer, 19985 in accord with subsection 6b. 19986 19987 d. Convey the object code by offering access from a designated 19988 place (gratis or for a charge), and offer equivalent access to 19989 the Corresponding Source in the same way through the same 19990 place at no further charge. You need not require recipients 19991 to copy the Corresponding Source along with the object code. 19992 If the place to copy the object code is a network server, the 19993 Corresponding Source may be on a different server (operated by 19994 you or a third party) that supports equivalent copying 19995 facilities, provided you maintain clear directions next to the 19996 object code saying where to find the Corresponding Source. 19997 Regardless of what server hosts the Corresponding Source, you 19998 remain obligated to ensure that it is available for as long as 19999 needed to satisfy these requirements. 20000 20001 e. Convey the object code using peer-to-peer transmission, 20002 provided you inform other peers where the object code and 20003 Corresponding Source of the work are being offered to the 20004 general public at no charge under subsection 6d. 20005 20006 A separable portion of the object code, whose source code is 20007 excluded from the Corresponding Source as a System Library, need 20008 not be included in conveying the object code work. 20009 20010 A "User Product" is either (1) a "consumer product", which means 20011 any tangible personal property which is normally used for personal, 20012 family, or household purposes, or (2) anything designed or sold for 20013 incorporation into a dwelling. In determining whether a product is 20014 a consumer product, doubtful cases shall be resolved in favor of 20015 coverage. For a particular product received by a particular user, 20016 "normally used" refers to a typical or common use of that class of 20017 product, regardless of the status of the particular user or of the 20018 way in which the particular user actually uses, or expects or is 20019 expected to use, the product. A product is a consumer product 20020 regardless of whether the product has substantial commercial, 20021 industrial or non-consumer uses, unless such uses represent the 20022 only significant mode of use of the product. 20023 20024 "Installation Information" for a User Product means any methods, 20025 procedures, authorization keys, or other information required to 20026 install and execute modified versions of a covered work in that 20027 User Product from a modified version of its Corresponding Source. 20028 The information must suffice to ensure that the continued 20029 functioning of the modified object code is in no case prevented or 20030 interfered with solely because modification has been made. 20031 20032 If you convey an object code work under this section in, or with, 20033 or specifically for use in, a User Product, and the conveying 20034 occurs as part of a transaction in which the right of possession 20035 and use of the User Product is transferred to the recipient in 20036 perpetuity or for a fixed term (regardless of how the transaction 20037 is characterized), the Corresponding Source conveyed under this 20038 section must be accompanied by the Installation Information. But 20039 this requirement does not apply if neither you nor any third party 20040 retains the ability to install modified object code on the User 20041 Product (for example, the work has been installed in ROM). 20042 20043 The requirement to provide Installation Information does not 20044 include a requirement to continue to provide support service, 20045 warranty, or updates for a work that has been modified or installed 20046 by the recipient, or for the User Product in which it has been 20047 modified or installed. Access to a network may be denied when the 20048 modification itself materially and adversely affects the operation 20049 of the network or violates the rules and protocols for 20050 communication across the network. 20051 20052 Corresponding Source conveyed, and Installation Information 20053 provided, in accord with this section must be in a format that is 20054 publicly documented (and with an implementation available to the 20055 public in source code form), and must require no special password 20056 or key for unpacking, reading or copying. 20057 20058 7. Additional Terms. 20059 20060 "Additional permissions" are terms that supplement the terms of 20061 this License by making exceptions from one or more of its 20062 conditions. Additional permissions that are applicable to the 20063 entire Program shall be treated as though they were included in 20064 this License, to the extent that they are valid under applicable 20065 law. If additional permissions apply only to part of the Program, 20066 that part may be used separately under those permissions, but the 20067 entire Program remains governed by this License without regard to 20068 the additional permissions. 20069 20070 When you convey a copy of a covered work, you may at your option 20071 remove any additional permissions from that copy, or from any part 20072 of it. (Additional permissions may be written to require their own 20073 removal in certain cases when you modify the work.) You may place 20074 additional permissions on material, added by you to a covered work, 20075 for which you have or can give appropriate copyright permission. 20076 20077 Notwithstanding any other provision of this License, for material 20078 you add to a covered work, you may (if authorized by the copyright 20079 holders of that material) supplement the terms of this License with 20080 terms: 20081 20082 a. Disclaiming warranty or limiting liability differently from 20083 the terms of sections 15 and 16 of this License; or 20084 20085 b. Requiring preservation of specified reasonable legal notices 20086 or author attributions in that material or in the Appropriate 20087 Legal Notices displayed by works containing it; or 20088 20089 c. Prohibiting misrepresentation of the origin of that material, 20090 or requiring that modified versions of such material be marked 20091 in reasonable ways as different from the original version; or 20092 20093 d. Limiting the use for publicity purposes of names of licensors 20094 or authors of the material; or 20095 20096 e. Declining to grant rights under trademark law for use of some 20097 trade names, trademarks, or service marks; or 20098 20099 f. Requiring indemnification of licensors and authors of that 20100 material by anyone who conveys the material (or modified 20101 versions of it) with contractual assumptions of liability to 20102 the recipient, for any liability that these contractual 20103 assumptions directly impose on those licensors and authors. 20104 20105 All other non-permissive additional terms are considered "further 20106 restrictions" within the meaning of section 10. If the Program as 20107 you received it, or any part of it, contains a notice stating that 20108 it is governed by this License along with a term that is a further 20109 restriction, you may remove that term. If a license document 20110 contains a further restriction but permits relicensing or conveying 20111 under this License, you may add to a covered work material governed 20112 by the terms of that license document, provided that the further 20113 restriction does not survive such relicensing or conveying. 20114 20115 If you add terms to a covered work in accord with this section, you 20116 must place, in the relevant source files, a statement of the 20117 additional terms that apply to those files, or a notice indicating 20118 where to find the applicable terms. 20119 20120 Additional terms, permissive or non-permissive, may be stated in 20121 the form of a separately written license, or stated as exceptions; 20122 the above requirements apply either way. 20123 20124 8. Termination. 20125 20126 You may not propagate or modify a covered work except as expressly 20127 provided under this License. Any attempt otherwise to propagate or 20128 modify it is void, and will automatically terminate your rights 20129 under this License (including any patent licenses granted under the 20130 third paragraph of section 11). 20131 20132 However, if you cease all violation of this License, then your 20133 license from a particular copyright holder is reinstated (a) 20134 provisionally, unless and until the copyright holder explicitly and 20135 finally terminates your license, and (b) permanently, if the 20136 copyright holder fails to notify you of the violation by some 20137 reasonable means prior to 60 days after the cessation. 20138 20139 Moreover, your license from a particular copyright holder is 20140 reinstated permanently if the copyright holder notifies you of the 20141 violation by some reasonable means, this is the first time you have 20142 received notice of violation of this License (for any work) from 20143 that copyright holder, and you cure the violation prior to 30 days 20144 after your receipt of the notice. 20145 20146 Termination of your rights under this section does not terminate 20147 the licenses of parties who have received copies or rights from you 20148 under this License. If your rights have been terminated and not 20149 permanently reinstated, you do not qualify to receive new licenses 20150 for the same material under section 10. 20151 20152 9. Acceptance Not Required for Having Copies. 20153 20154 You are not required to accept this License in order to receive or 20155 run a copy of the Program. Ancillary propagation of a covered work 20156 occurring solely as a consequence of using peer-to-peer 20157 transmission to receive a copy likewise does not require 20158 acceptance. However, nothing other than this License grants you 20159 permission to propagate or modify any covered work. These actions 20160 infringe copyright if you do not accept this License. Therefore, 20161 by modifying or propagating a covered work, you indicate your 20162 acceptance of this License to do so. 20163 20164 10. Automatic Licensing of Downstream Recipients. 20165 20166 Each time you convey a covered work, the recipient automatically 20167 receives a license from the original licensors, to run, modify and 20168 propagate that work, subject to this License. You are not 20169 responsible for enforcing compliance by third parties with this 20170 License. 20171 20172 An "entity transaction" is a transaction transferring control of an 20173 organization, or substantially all assets of one, or subdividing an 20174 organization, or merging organizations. If propagation of a 20175 covered work results from an entity transaction, each party to that 20176 transaction who receives a copy of the work also receives whatever 20177 licenses to the work the party's predecessor in interest had or 20178 could give under the previous paragraph, plus a right to possession 20179 of the Corresponding Source of the work from the predecessor in 20180 interest, if the predecessor has it or can get it with reasonable 20181 efforts. 20182 20183 You may not impose any further restrictions on the exercise of the 20184 rights granted or affirmed under this License. For example, you 20185 may not impose a license fee, royalty, or other charge for exercise 20186 of rights granted under this License, and you may not initiate 20187 litigation (including a cross-claim or counterclaim in a lawsuit) 20188 alleging that any patent claim is infringed by making, using, 20189 selling, offering for sale, or importing the Program or any portion 20190 of it. 20191 20192 11. Patents. 20193 20194 A "contributor" is a copyright holder who authorizes use under this 20195 License of the Program or a work on which the Program is based. 20196 The work thus licensed is called the contributor's "contributor 20197 version". 20198 20199 A contributor's "essential patent claims" are all patent claims 20200 owned or controlled by the contributor, whether already acquired or 20201 hereafter acquired, that would be infringed by some manner, 20202 permitted by this License, of making, using, or selling its 20203 contributor version, but do not include claims that would be 20204 infringed only as a consequence of further modification of the 20205 contributor version. For purposes of this definition, "control" 20206 includes the right to grant patent sublicenses in a manner 20207 consistent with the requirements of this License. 20208 20209 Each contributor grants you a non-exclusive, worldwide, 20210 royalty-free patent license under the contributor's essential 20211 patent claims, to make, use, sell, offer for sale, import and 20212 otherwise run, modify and propagate the contents of its contributor 20213 version. 20214 20215 In the following three paragraphs, a "patent license" is any 20216 express agreement or commitment, however denominated, not to 20217 enforce a patent (such as an express permission to practice a 20218 patent or covenant not to sue for patent infringement). To "grant" 20219 such a patent license to a party means to make such an agreement or 20220 commitment not to enforce a patent against the party. 20221 20222 If you convey a covered work, knowingly relying on a patent 20223 license, and the Corresponding Source of the work is not available 20224 for anyone to copy, free of charge and under the terms of this 20225 License, through a publicly available network server or other 20226 readily accessible means, then you must either (1) cause the 20227 Corresponding Source to be so available, or (2) arrange to deprive 20228 yourself of the benefit of the patent license for this particular 20229 work, or (3) arrange, in a manner consistent with the requirements 20230 of this License, to extend the patent license to downstream 20231 recipients. "Knowingly relying" means you have actual knowledge 20232 that, but for the patent license, your conveying the covered work 20233 in a country, or your recipient's use of the covered work in a 20234 country, would infringe one or more identifiable patents in that 20235 country that you have reason to believe are valid. 20236 20237 If, pursuant to or in connection with a single transaction or 20238 arrangement, you convey, or propagate by procuring conveyance of, a 20239 covered work, and grant a patent license to some of the parties 20240 receiving the covered work authorizing them to use, propagate, 20241 modify or convey a specific copy of the covered work, then the 20242 patent license you grant is automatically extended to all 20243 recipients of the covered work and works based on it. 20244 20245 A patent license is "discriminatory" if it does not include within 20246 the scope of its coverage, prohibits the exercise of, or is 20247 conditioned on the non-exercise of one or more of the rights that 20248 are specifically granted under this License. You may not convey a 20249 covered work if you are a party to an arrangement with a third 20250 party that is in the business of distributing software, under which 20251 you make payment to the third party based on the extent of your 20252 activity of conveying the work, and under which the third party 20253 grants, to any of the parties who would receive the covered work 20254 from you, a discriminatory patent license (a) in connection with 20255 copies of the covered work conveyed by you (or copies made from 20256 those copies), or (b) primarily for and in connection with specific 20257 products or compilations that contain the covered work, unless you 20258 entered into that arrangement, or that patent license was granted, 20259 prior to 28 March 2007. 20260 20261 Nothing in this License shall be construed as excluding or limiting 20262 any implied license or other defenses to infringement that may 20263 otherwise be available to you under applicable patent law. 20264 20265 12. No Surrender of Others' Freedom. 20266 20267 If conditions are imposed on you (whether by court order, agreement 20268 or otherwise) that contradict the conditions of this License, they 20269 do not excuse you from the conditions of this License. If you 20270 cannot convey a covered work so as to satisfy simultaneously your 20271 obligations under this License and any other pertinent obligations, 20272 then as a consequence you may not convey it at all. For example, 20273 if you agree to terms that obligate you to collect a royalty for 20274 further conveying from those to whom you convey the Program, the 20275 only way you could satisfy both those terms and this License would 20276 be to refrain entirely from conveying the Program. 20277 20278 13. Use with the GNU Affero General Public License. 20279 20280 Notwithstanding any other provision of this License, you have 20281 permission to link or combine any covered work with a work licensed 20282 under version 3 of the GNU Affero General Public License into a 20283 single combined work, and to convey the resulting work. The terms 20284 of this License will continue to apply to the part which is the 20285 covered work, but the special requirements of the GNU Affero 20286 General Public License, section 13, concerning interaction through 20287 a network will apply to the combination as such. 20288 20289 14. Revised Versions of this License. 20290 20291 The Free Software Foundation may publish revised and/or new 20292 versions of the GNU General Public License from time to time. Such 20293 new versions will be similar in spirit to the present version, but 20294 may differ in detail to address new problems or concerns. 20295 20296 Each version is given a distinguishing version number. If the 20297 Program specifies that a certain numbered version of the GNU 20298 General Public License "or any later version" applies to it, you 20299 have the option of following the terms and conditions either of 20300 that numbered version or of any later version published by the Free 20301 Software Foundation. If the Program does not specify a version 20302 number of the GNU General Public License, you may choose any 20303 version ever published by the Free Software Foundation. 20304 20305 If the Program specifies that a proxy can decide which future 20306 versions of the GNU General Public License can be used, that 20307 proxy's public statement of acceptance of a version permanently 20308 authorizes you to choose that version for the Program. 20309 20310 Later license versions may give you additional or different 20311 permissions. However, no additional obligations are imposed on any 20312 author or copyright holder as a result of your choosing to follow a 20313 later version. 20314 20315 15. Disclaimer of Warranty. 20316 20317 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 20318 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE 20319 COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" 20320 WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, 20321 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20322 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE 20323 RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. 20324 SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL 20325 NECESSARY SERVICING, REPAIR OR CORRECTION. 20326 20327 16. Limitation of Liability. 20328 20329 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 20330 WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES 20331 AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR 20332 DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 20333 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE 20334 THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA 20335 BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 20336 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 20337 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF 20338 THE POSSIBILITY OF SUCH DAMAGES. 20339 20340 17. Interpretation of Sections 15 and 16. 20341 20342 If the disclaimer of warranty and limitation of liability provided 20343 above cannot be given local legal effect according to their terms, 20344 reviewing courts shall apply local law that most closely 20345 approximates an absolute waiver of all civil liability in 20346 connection with the Program, unless a warranty or assumption of 20347 liability accompanies a copy of the Program in return for a fee. 20348 20349 END OF TERMS AND CONDITIONS 20350 =========================== 20351 20352 How to Apply These Terms to Your New Programs 20353 ============================================= 20354 20355 If you develop a new program, and you want it to be of the greatest 20356 possible use to the public, the best way to achieve this is to make it 20357 free software which everyone can redistribute and change under these 20358 terms. 20359 20360 To do so, attach the following notices to the program. It is safest 20361 to attach them to the start of each source file to most effectively 20362 state the exclusion of warranty; and each file should have at least the 20363 "copyright" line and a pointer to where the full notice is found. 20364 20365 ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. 20366 Copyright (C) YEAR NAME OF AUTHOR 20367 20368 This program is free software: you can redistribute it and/or modify 20369 it under the terms of the GNU General Public License as published by 20370 the Free Software Foundation, either version 3 of the License, or (at 20371 your option) any later version. 20372 20373 This program is distributed in the hope that it will be useful, but 20374 WITHOUT ANY WARRANTY; without even the implied warranty of 20375 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20376 General Public License for more details. 20377 20378 You should have received a copy of the GNU General Public License 20379 along with this program. If not, see <https://www.gnu.org/licenses/>. 20380 20381 Also add information on how to contact you by electronic and paper 20382 mail. 20383 20384 If the program does terminal interaction, make it output a short 20385 notice like this when it starts in an interactive mode: 20386 20387 PROGRAM Copyright (C) YEAR NAME OF AUTHOR 20388 This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. 20389 This is free software, and you are welcome to redistribute it 20390 under certain conditions; type 'show c' for details. 20391 20392 The hypothetical commands 'show w' and 'show c' should show the 20393 appropriate parts of the General Public License. Of course, your 20394 program's commands might be different; for a GUI interface, you would 20395 use an "about box". 20396 20397 You should also get your employer (if you work as a programmer) or 20398 school, if any, to sign a "copyright disclaimer" for the program, if 20399 necessary. For more information on this, and how to apply and follow 20400 the GNU GPL, see <https://www.gnu.org/licenses/>. 20401 20402 The GNU General Public License does not permit incorporating your 20403 program into proprietary programs. If your program is a subroutine 20404 library, you may consider it more useful to permit linking proprietary 20405 applications with the library. If this is what you want to do, use the 20406 GNU Lesser General Public License instead of this License. But first, 20407 please read <https://www.gnu.org/licenses/why-not-lgpl.html>. 20408 20409 20410 File: gfortran.info, Node: GNU Free Documentation License, Next: Funding, Prev: Copying, Up: Top 20411 20412 GNU Free Documentation License 20413 ****************************** 20414 20415 Version 1.3, 3 November 2008 20416 20417 Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 20418 <https://fsf.org/> 20419 20420 Everyone is permitted to copy and distribute verbatim copies 20421 of this license document, but changing it is not allowed. 20422 20423 0. PREAMBLE 20424 20425 The purpose of this License is to make a manual, textbook, or other 20426 functional and useful document "free" in the sense of freedom: to 20427 assure everyone the effective freedom to copy and redistribute it, 20428 with or without modifying it, either commercially or 20429 noncommercially. Secondarily, this License preserves for the 20430 author and publisher a way to get credit for their work, while not 20431 being considered responsible for modifications made by others. 20432 20433 This License is a kind of "copyleft", which means that derivative 20434 works of the document must themselves be free in the same sense. 20435 It complements the GNU General Public License, which is a copyleft 20436 license designed for free software. 20437 20438 We have designed this License in order to use it for manuals for 20439 free software, because free software needs free documentation: a 20440 free program should come with manuals providing the same freedoms 20441 that the software does. But this License is not limited to 20442 software manuals; it can be used for any textual work, regardless 20443 of subject matter or whether it is published as a printed book. We 20444 recommend this License principally for works whose purpose is 20445 instruction or reference. 20446 20447 1. APPLICABILITY AND DEFINITIONS 20448 20449 This License applies to any manual or other work, in any medium, 20450 that contains a notice placed by the copyright holder saying it can 20451 be distributed under the terms of this License. Such a notice 20452 grants a world-wide, royalty-free license, unlimited in duration, 20453 to use that work under the conditions stated herein. The 20454 "Document", below, refers to any such manual or work. Any member 20455 of the public is a licensee, and is addressed as "you". You accept 20456 the license if you copy, modify or distribute the work in a way 20457 requiring permission under copyright law. 20458 20459 A "Modified Version" of the Document means any work containing the 20460 Document or a portion of it, either copied verbatim, or with 20461 modifications and/or translated into another language. 20462 20463 A "Secondary Section" is a named appendix or a front-matter section 20464 of the Document that deals exclusively with the relationship of the 20465 publishers or authors of the Document to the Document's overall 20466 subject (or to related matters) and contains nothing that could 20467 fall directly within that overall subject. (Thus, if the Document 20468 is in part a textbook of mathematics, a Secondary Section may not 20469 explain any mathematics.) The relationship could be a matter of 20470 historical connection with the subject or with related matters, or 20471 of legal, commercial, philosophical, ethical or political position 20472 regarding them. 20473 20474 The "Invariant Sections" are certain Secondary Sections whose 20475 titles are designated, as being those of Invariant Sections, in the 20476 notice that says that the Document is released under this License. 20477 If a section does not fit the above definition of Secondary then it 20478 is not allowed to be designated as Invariant. The Document may 20479 contain zero Invariant Sections. If the Document does not identify 20480 any Invariant Sections then there are none. 20481 20482 The "Cover Texts" are certain short passages of text that are 20483 listed, as Front-Cover Texts or Back-Cover Texts, in the notice 20484 that says that the Document is released under this License. A 20485 Front-Cover Text may be at most 5 words, and a Back-Cover Text may 20486 be at most 25 words. 20487 20488 A "Transparent" copy of the Document means a machine-readable copy, 20489 represented in a format whose specification is available to the 20490 general public, that is suitable for revising the document 20491 straightforwardly with generic text editors or (for images composed 20492 of pixels) generic paint programs or (for drawings) some widely 20493 available drawing editor, and that is suitable for input to text 20494 formatters or for automatic translation to a variety of formats 20495 suitable for input to text formatters. A copy made in an otherwise 20496 Transparent file format whose markup, or absence of markup, has 20497 been arranged to thwart or discourage subsequent modification by 20498 readers is not Transparent. An image format is not Transparent if 20499 used for any substantial amount of text. A copy that is not 20500 "Transparent" is called "Opaque". 20501 20502 Examples of suitable formats for Transparent copies include plain 20503 ASCII without markup, Texinfo input format, LaTeX input format, 20504 SGML or XML using a publicly available DTD, and standard-conforming 20505 simple HTML, PostScript or PDF designed for human modification. 20506 Examples of transparent image formats include PNG, XCF and JPG. 20507 Opaque formats include proprietary formats that can be read and 20508 edited only by proprietary word processors, SGML or XML for which 20509 the DTD and/or processing tools are not generally available, and 20510 the machine-generated HTML, PostScript or PDF produced by some word 20511 processors for output purposes only. 20512 20513 The "Title Page" means, for a printed book, the title page itself, 20514 plus such following pages as are needed to hold, legibly, the 20515 material this License requires to appear in the title page. For 20516 works in formats which do not have any title page as such, "Title 20517 Page" means the text near the most prominent appearance of the 20518 work's title, preceding the beginning of the body of the text. 20519 20520 The "publisher" means any person or entity that distributes copies 20521 of the Document to the public. 20522 20523 A section "Entitled XYZ" means a named subunit of the Document 20524 whose title either is precisely XYZ or contains XYZ in parentheses 20525 following text that translates XYZ in another language. (Here XYZ 20526 stands for a specific section name mentioned below, such as 20527 "Acknowledgements", "Dedications", "Endorsements", or "History".) 20528 To "Preserve the Title" of such a section when you modify the 20529 Document means that it remains a section "Entitled XYZ" according 20530 to this definition. 20531 20532 The Document may include Warranty Disclaimers next to the notice 20533 which states that this License applies to the Document. These 20534 Warranty Disclaimers are considered to be included by reference in 20535 this License, but only as regards disclaiming warranties: any other 20536 implication that these Warranty Disclaimers may have is void and 20537 has no effect on the meaning of this License. 20538 20539 2. VERBATIM COPYING 20540 20541 You may copy and distribute the Document in any medium, either 20542 commercially or noncommercially, provided that this License, the 20543 copyright notices, and the license notice saying this License 20544 applies to the Document are reproduced in all copies, and that you 20545 add no other conditions whatsoever to those of this License. You 20546 may not use technical measures to obstruct or control the reading 20547 or further copying of the copies you make or distribute. However, 20548 you may accept compensation in exchange for copies. If you 20549 distribute a large enough number of copies you must also follow the 20550 conditions in section 3. 20551 20552 You may also lend copies, under the same conditions stated above, 20553 and you may publicly display copies. 20554 20555 3. COPYING IN QUANTITY 20556 20557 If you publish printed copies (or copies in media that commonly 20558 have printed covers) of the Document, numbering more than 100, and 20559 the Document's license notice requires Cover Texts, you must 20560 enclose the copies in covers that carry, clearly and legibly, all 20561 these Cover Texts: Front-Cover Texts on the front cover, and 20562 Back-Cover Texts on the back cover. Both covers must also clearly 20563 and legibly identify you as the publisher of these copies. The 20564 front cover must present the full title with all words of the title 20565 equally prominent and visible. You may add other material on the 20566 covers in addition. Copying with changes limited to the covers, as 20567 long as they preserve the title of the Document and satisfy these 20568 conditions, can be treated as verbatim copying in other respects. 20569 20570 If the required texts for either cover are too voluminous to fit 20571 legibly, you should put the first ones listed (as many as fit 20572 reasonably) on the actual cover, and continue the rest onto 20573 adjacent pages. 20574 20575 If you publish or distribute Opaque copies of the Document 20576 numbering more than 100, you must either include a machine-readable 20577 Transparent copy along with each Opaque copy, or state in or with 20578 each Opaque copy a computer-network location from which the general 20579 network-using public has access to download using public-standard 20580 network protocols a complete Transparent copy of the Document, free 20581 of added material. If you use the latter option, you must take 20582 reasonably prudent steps, when you begin distribution of Opaque 20583 copies in quantity, to ensure that this Transparent copy will 20584 remain thus accessible at the stated location until at least one 20585 year after the last time you distribute an Opaque copy (directly or 20586 through your agents or retailers) of that edition to the public. 20587 20588 It is requested, but not required, that you contact the authors of 20589 the Document well before redistributing any large number of copies, 20590 to give them a chance to provide you with an updated version of the 20591 Document. 20592 20593 4. MODIFICATIONS 20594 20595 You may copy and distribute a Modified Version of the Document 20596 under the conditions of sections 2 and 3 above, provided that you 20597 release the Modified Version under precisely this License, with the 20598 Modified Version filling the role of the Document, thus licensing 20599 distribution and modification of the Modified Version to whoever 20600 possesses a copy of it. In addition, you must do these things in 20601 the Modified Version: 20602 20603 A. Use in the Title Page (and on the covers, if any) a title 20604 distinct from that of the Document, and from those of previous 20605 versions (which should, if there were any, be listed in the 20606 History section of the Document). You may use the same title 20607 as a previous version if the original publisher of that 20608 version gives permission. 20609 20610 B. List on the Title Page, as authors, one or more persons or 20611 entities responsible for authorship of the modifications in 20612 the Modified Version, together with at least five of the 20613 principal authors of the Document (all of its principal 20614 authors, if it has fewer than five), unless they release you 20615 from this requirement. 20616 20617 C. State on the Title page the name of the publisher of the 20618 Modified Version, as the publisher. 20619 20620 D. Preserve all the copyright notices of the Document. 20621 20622 E. Add an appropriate copyright notice for your modifications 20623 adjacent to the other copyright notices. 20624 20625 F. Include, immediately after the copyright notices, a license 20626 notice giving the public permission to use the Modified 20627 Version under the terms of this License, in the form shown in 20628 the Addendum below. 20629 20630 G. Preserve in that license notice the full lists of Invariant 20631 Sections and required Cover Texts given in the Document's 20632 license notice. 20633 20634 H. Include an unaltered copy of this License. 20635 20636 I. Preserve the section Entitled "History", Preserve its Title, 20637 and add to it an item stating at least the title, year, new 20638 authors, and publisher of the Modified Version as given on the 20639 Title Page. If there is no section Entitled "History" in the 20640 Document, create one stating the title, year, authors, and 20641 publisher of the Document as given on its Title Page, then add 20642 an item describing the Modified Version as stated in the 20643 previous sentence. 20644 20645 J. Preserve the network location, if any, given in the Document 20646 for public access to a Transparent copy of the Document, and 20647 likewise the network locations given in the Document for 20648 previous versions it was based on. These may be placed in the 20649 "History" section. You may omit a network location for a work 20650 that was published at least four years before the Document 20651 itself, or if the original publisher of the version it refers 20652 to gives permission. 20653 20654 K. For any section Entitled "Acknowledgements" or "Dedications", 20655 Preserve the Title of the section, and preserve in the section 20656 all the substance and tone of each of the contributor 20657 acknowledgements and/or dedications given therein. 20658 20659 L. Preserve all the Invariant Sections of the Document, unaltered 20660 in their text and in their titles. Section numbers or the 20661 equivalent are not considered part of the section titles. 20662 20663 M. Delete any section Entitled "Endorsements". Such a section 20664 may not be included in the Modified Version. 20665 20666 N. Do not retitle any existing section to be Entitled 20667 "Endorsements" or to conflict in title with any Invariant 20668 Section. 20669 20670 O. Preserve any Warranty Disclaimers. 20671 20672 If the Modified Version includes new front-matter sections or 20673 appendices that qualify as Secondary Sections and contain no 20674 material copied from the Document, you may at your option designate 20675 some or all of these sections as invariant. To do this, add their 20676 titles to the list of Invariant Sections in the Modified Version's 20677 license notice. These titles must be distinct from any other 20678 section titles. 20679 20680 You may add a section Entitled "Endorsements", provided it contains 20681 nothing but endorsements of your Modified Version by various 20682 parties--for example, statements of peer review or that the text 20683 has been approved by an organization as the authoritative 20684 definition of a standard. 20685 20686 You may add a passage of up to five words as a Front-Cover Text, 20687 and a passage of up to 25 words as a Back-Cover Text, to the end of 20688 the list of Cover Texts in the Modified Version. Only one passage 20689 of Front-Cover Text and one of Back-Cover Text may be added by (or 20690 through arrangements made by) any one entity. If the Document 20691 already includes a cover text for the same cover, previously added 20692 by you or by arrangement made by the same entity you are acting on 20693 behalf of, you may not add another; but you may replace the old 20694 one, on explicit permission from the previous publisher that added 20695 the old one. 20696 20697 The author(s) and publisher(s) of the Document do not by this 20698 License give permission to use their names for publicity for or to 20699 assert or imply endorsement of any Modified Version. 20700 20701 5. COMBINING DOCUMENTS 20702 20703 You may combine the Document with other documents released under 20704 this License, under the terms defined in section 4 above for 20705 modified versions, provided that you include in the combination all 20706 of the Invariant Sections of all of the original documents, 20707 unmodified, and list them all as Invariant Sections of your 20708 combined work in its license notice, and that you preserve all 20709 their Warranty Disclaimers. 20710 20711 The combined work need only contain one copy of this License, and 20712 multiple identical Invariant Sections may be replaced with a single 20713 copy. If there are multiple Invariant Sections with the same name 20714 but different contents, make the title of each such section unique 20715 by adding at the end of it, in parentheses, the name of the 20716 original author or publisher of that section if known, or else a 20717 unique number. Make the same adjustment to the section titles in 20718 the list of Invariant Sections in the license notice of the 20719 combined work. 20720 20721 In the combination, you must combine any sections Entitled 20722 "History" in the various original documents, forming one section 20723 Entitled "History"; likewise combine any sections Entitled 20724 "Acknowledgements", and any sections Entitled "Dedications". You 20725 must delete all sections Entitled "Endorsements." 20726 20727 6. COLLECTIONS OF DOCUMENTS 20728 20729 You may make a collection consisting of the Document and other 20730 documents released under this License, and replace the individual 20731 copies of this License in the various documents with a single copy 20732 that is included in the collection, provided that you follow the 20733 rules of this License for verbatim copying of each of the documents 20734 in all other respects. 20735 20736 You may extract a single document from such a collection, and 20737 distribute it individually under this License, provided you insert 20738 a copy of this License into the extracted document, and follow this 20739 License in all other respects regarding verbatim copying of that 20740 document. 20741 20742 7. AGGREGATION WITH INDEPENDENT WORKS 20743 20744 A compilation of the Document or its derivatives with other 20745 separate and independent documents or works, in or on a volume of a 20746 storage or distribution medium, is called an "aggregate" if the 20747 copyright resulting from the compilation is not used to limit the 20748 legal rights of the compilation's users beyond what the individual 20749 works permit. When the Document is included in an aggregate, this 20750 License does not apply to the other works in the aggregate which 20751 are not themselves derivative works of the Document. 20752 20753 If the Cover Text requirement of section 3 is applicable to these 20754 copies of the Document, then if the Document is less than one half 20755 of the entire aggregate, the Document's Cover Texts may be placed 20756 on covers that bracket the Document within the aggregate, or the 20757 electronic equivalent of covers if the Document is in electronic 20758 form. Otherwise they must appear on printed covers that bracket 20759 the whole aggregate. 20760 20761 8. TRANSLATION 20762 20763 Translation is considered a kind of modification, so you may 20764 distribute translations of the Document under the terms of section 20765 4. Replacing Invariant Sections with translations requires special 20766 permission from their copyright holders, but you may include 20767 translations of some or all Invariant Sections in addition to the 20768 original versions of these Invariant Sections. You may include a 20769 translation of this License, and all the license notices in the 20770 Document, and any Warranty Disclaimers, provided that you also 20771 include the original English version of this License and the 20772 original versions of those notices and disclaimers. In case of a 20773 disagreement between the translation and the original version of 20774 this License or a notice or disclaimer, the original version will 20775 prevail. 20776 20777 If a section in the Document is Entitled "Acknowledgements", 20778 "Dedications", or "History", the requirement (section 4) to 20779 Preserve its Title (section 1) will typically require changing the 20780 actual title. 20781 20782 9. TERMINATION 20783 20784 You may not copy, modify, sublicense, or distribute the Document 20785 except as expressly provided under this License. Any attempt 20786 otherwise to copy, modify, sublicense, or distribute it is void, 20787 and will automatically terminate your rights under this License. 20788 20789 However, if you cease all violation of this License, then your 20790 license from a particular copyright holder is reinstated (a) 20791 provisionally, unless and until the copyright holder explicitly and 20792 finally terminates your license, and (b) permanently, if the 20793 copyright holder fails to notify you of the violation by some 20794 reasonable means prior to 60 days after the cessation. 20795 20796 Moreover, your license from a particular copyright holder is 20797 reinstated permanently if the copyright holder notifies you of the 20798 violation by some reasonable means, this is the first time you have 20799 received notice of violation of this License (for any work) from 20800 that copyright holder, and you cure the violation prior to 30 days 20801 after your receipt of the notice. 20802 20803 Termination of your rights under this section does not terminate 20804 the licenses of parties who have received copies or rights from you 20805 under this License. If your rights have been terminated and not 20806 permanently reinstated, receipt of a copy of some or all of the 20807 same material does not give you any rights to use it. 20808 20809 10. FUTURE REVISIONS OF THIS LICENSE 20810 20811 The Free Software Foundation may publish new, revised versions of 20812 the GNU Free Documentation License from time to time. Such new 20813 versions will be similar in spirit to the present version, but may 20814 differ in detail to address new problems or concerns. See 20815 <https://www.gnu.org/copyleft/>. 20816 20817 Each version of the License is given a distinguishing version 20818 number. If the Document specifies that a particular numbered 20819 version of this License "or any later version" applies to it, you 20820 have the option of following the terms and conditions either of 20821 that specified version or of any later version that has been 20822 published (not as a draft) by the Free Software Foundation. If the 20823 Document does not specify a version number of this License, you may 20824 choose any version ever published (not as a draft) by the Free 20825 Software Foundation. If the Document specifies that a proxy can 20826 decide which future versions of this License can be used, that 20827 proxy's public statement of acceptance of a version permanently 20828 authorizes you to choose that version for the Document. 20829 20830 11. RELICENSING 20831 20832 "Massive Multiauthor Collaboration Site" (or "MMC Site") means any 20833 World Wide Web server that publishes copyrightable works and also 20834 provides prominent facilities for anybody to edit those works. A 20835 public wiki that anybody can edit is an example of such a server. 20836 A "Massive Multiauthor Collaboration" (or "MMC") contained in the 20837 site means any set of copyrightable works thus published on the MMC 20838 site. 20839 20840 "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 20841 license published by Creative Commons Corporation, a not-for-profit 20842 corporation with a principal place of business in San Francisco, 20843 California, as well as future copyleft versions of that license 20844 published by that same organization. 20845 20846 "Incorporate" means to publish or republish a Document, in whole or 20847 in part, as part of another Document. 20848 20849 An MMC is "eligible for relicensing" if it is licensed under this 20850 License, and if all works that were first published under this 20851 License somewhere other than this MMC, and subsequently 20852 incorporated in whole or in part into the MMC, (1) had no cover 20853 texts or invariant sections, and (2) were thus incorporated prior 20854 to November 1, 2008. 20855 20856 The operator of an MMC Site may republish an MMC contained in the 20857 site under CC-BY-SA on the same site at any time before August 1, 20858 2009, provided the MMC is eligible for relicensing. 20859 20860 ADDENDUM: How to use this License for your documents 20861 ==================================================== 20862 20863 To use this License in a document you have written, include a copy of 20864 the License in the document and put the following copyright and license 20865 notices just after the title page: 20866 20867 Copyright (C) YEAR YOUR NAME. 20868 Permission is granted to copy, distribute and/or modify this document 20869 under the terms of the GNU Free Documentation License, Version 1.3 20870 or any later version published by the Free Software Foundation; 20871 with no Invariant Sections, no Front-Cover Texts, and no Back-Cover 20872 Texts. A copy of the license is included in the section entitled ``GNU 20873 Free Documentation License''. 20874 20875 If you have Invariant Sections, Front-Cover Texts and Back-Cover 20876 Texts, replace the "with...Texts." line with this: 20877 20878 with the Invariant Sections being LIST THEIR TITLES, with 20879 the Front-Cover Texts being LIST, and with the Back-Cover Texts 20880 being LIST. 20881 20882 If you have Invariant Sections without Cover Texts, or some other 20883 combination of the three, merge those two alternatives to suit the 20884 situation. 20885 20886 If your document contains nontrivial examples of program code, we 20887 recommend releasing these examples in parallel under your choice of free 20888 software license, such as the GNU General Public License, to permit 20889 their use in free software. 20890 20891 20892 File: gfortran.info, Node: Funding, Next: Option Index, Prev: GNU Free Documentation License, Up: Top 20893 20894 Funding Free Software 20895 ********************* 20896 20897 If you want to have more free software a few years from now, it makes 20898 sense for you to help encourage people to contribute funds for its 20899 development. The most effective approach known is to encourage 20900 commercial redistributors to donate. 20901 20902 Users of free software systems can boost the pace of development by 20903 encouraging for-a-fee distributors to donate part of their selling price 20904 to free software developers--the Free Software Foundation, and others. 20905 20906 The way to convince distributors to do this is to demand it and 20907 expect it from them. So when you compare distributors, judge them 20908 partly by how much they give to free software development. Show 20909 distributors they must compete to be the one who gives the most. 20910 20911 To make this approach work, you must insist on numbers that you can 20912 compare, such as, "We will donate ten dollars to the Frobnitz project 20913 for each disk sold." Don't be satisfied with a vague promise, such as 20914 "A portion of the profits are donated," since it doesn't give a basis 20915 for comparison. 20916 20917 Even a precise fraction "of the profits from this disk" is not very 20918 meaningful, since creative accounting and unrelated business decisions 20919 can greatly alter what fraction of the sales price counts as profit. If 20920 the price you pay is $50, ten percent of the profit is probably less 20921 than a dollar; it might be a few cents, or nothing at all. 20922 20923 Some redistributors do development work themselves. This is useful 20924 too; but to keep everyone honest, you need to inquire how much they do, 20925 and what kind. Some kinds of development make much more long-term 20926 difference than others. For example, maintaining a separate version of 20927 a program contributes very little; maintaining the standard version of a 20928 program for the whole community contributes much. Easy new ports 20929 contribute little, since someone else would surely do them; difficult 20930 ports such as adding a new CPU to the GNU Compiler Collection contribute 20931 more; major new features or packages contribute the most. 20932 20933 By establishing the idea that supporting further development is "the 20934 proper thing to do" when distributing free software for a fee, we can 20935 assure a steady flow of resources into making more free software. 20936 20937 Copyright (C) 1994 Free Software Foundation, Inc. 20938 Verbatim copying and redistribution of this section is permitted 20939 without royalty; alteration is not permitted. 20940 20941 20942 File: gfortran.info, Node: Option Index, Next: Keyword Index, Prev: Funding, Up: Top 20943 20944 Option Index 20945 ************ 20946 20947 'gfortran''s command line options are indexed here without any initial 20948 '-' or '--'. Where an option has both positive and negative forms (such 20949 as -foption and -fno-option), relevant entries in the manual are indexed 20950 under the most appropriate form; it may sometimes be useful to look up 20951 both forms. 20952 20953 [index] 20954 * Menu: 20955 20956 * A-PREDICATE=ANSWER: Preprocessing Options. 20957 (line 151) 20958 * allow-invalid-boz: Fortran Dialect Options. 20959 (line 39) 20960 * APREDICATE=ANSWER: Preprocessing Options. 20961 (line 145) 20962 * backslash: Fortran Dialect Options. 20963 (line 111) 20964 * C: Preprocessing Options. 20965 (line 154) 20966 * c-prototypes: Interoperability Options. 20967 (line 7) 20968 * c-prototypes-external: Interoperability Options. 20969 (line 25) 20970 * CC: Preprocessing Options. 20971 (line 169) 20972 * cpp: Preprocessing Options. 20973 (line 44) 20974 * dD: Preprocessing Options. 20975 (line 67) 20976 * dI: Preprocessing Options. 20977 (line 83) 20978 * dM: Preprocessing Options. 20979 (line 58) 20980 * dN: Preprocessing Options. 20981 (line 73) 20982 * DNAME: Preprocessing Options. 20983 (line 183) 20984 * DNAME=DEFINITION: Preprocessing Options. 20985 (line 186) 20986 * dU: Preprocessing Options. 20987 (line 76) 20988 * faggressive-function-elimination: Code Gen Options. (line 435) 20989 * falign-commons: Code Gen Options. (line 408) 20990 * fall-intrinsics: Fortran Dialect Options. 20991 (line 17) 20992 * fallow-argument-mismatch: Fortran Dialect Options. 20993 (line 26) 20994 * fblas-matmul-limit: Code Gen Options. (line 337) 20995 * fbounds-check: Code Gen Options. (line 205) 20996 * fcheck: Code Gen Options. (line 144) 20997 * fcheck-array-temporaries: Code Gen Options. (line 239) 20998 * fcoarray: Code Gen Options. (line 130) 20999 * fconvert=CONVERSION: Runtime Options. (line 10) 21000 * fcray-pointer: Fortran Dialect Options. 21001 (line 166) 21002 * fd-lines-as-code: Fortran Dialect Options. 21003 (line 46) 21004 * fd-lines-as-comments: Fortran Dialect Options. 21005 (line 46) 21006 * fdebug-aux-vars: Debugging Options. (line 33) 21007 * fdec: Fortran Dialect Options. 21008 (line 53) 21009 * fdec-blank-format-item: Fortran Dialect Options. 21010 (line 101) 21011 * fdec-char-conversions: Fortran Dialect Options. 21012 (line 68) 21013 * fdec-format-defaults: Fortran Dialect Options. 21014 (line 97) 21015 * fdec-include: Fortran Dialect Options. 21016 (line 92) 21017 * fdec-intrinsic-ints: Fortran Dialect Options. 21018 (line 78) 21019 * fdec-math: Fortran Dialect Options. 21020 (line 83) 21021 * fdec-static: Fortran Dialect Options. 21022 (line 88) 21023 * fdec-structure: Fortran Dialect Options. 21024 (line 72) 21025 * fdefault-double-8: Fortran Dialect Options. 21026 (line 233) 21027 * fdefault-integer-8: Fortran Dialect Options. 21028 (line 197) 21029 * fdefault-real-10: Fortran Dialect Options. 21030 (line 213) 21031 * fdefault-real-16: Fortran Dialect Options. 21032 (line 223) 21033 * fdefault-real-8: Fortran Dialect Options. 21034 (line 203) 21035 * fdollar-ok: Fortran Dialect Options. 21036 (line 105) 21037 * fdump-fortran-global: Debugging Options. (line 41) 21038 * fdump-fortran-optimized: Debugging Options. (line 18) 21039 * fdump-fortran-original: Debugging Options. (line 10) 21040 * fdump-parse-tree: Debugging Options. (line 25) 21041 * fexternal-blas: Code Gen Options. (line 329) 21042 * ff2c: Code Gen Options. (line 28) 21043 * ffixed-form: Fortran Dialect Options. 21044 (line 11) 21045 * ffixed-line-length-N: Fortran Dialect Options. 21046 (line 128) 21047 * ffpe-summary=LIST: Debugging Options. (line 81) 21048 * ffpe-trap=LIST: Debugging Options. (line 48) 21049 * ffree-form: Fortran Dialect Options. 21050 (line 11) 21051 * ffree-line-length-N: Fortran Dialect Options. 21052 (line 150) 21053 * fimplicit-none: Fortran Dialect Options. 21054 (line 161) 21055 * finit-character: Code Gen Options. (line 372) 21056 * finit-derived: Code Gen Options. (line 372) 21057 * finit-integer: Code Gen Options. (line 372) 21058 * finit-local-zero: Code Gen Options. (line 372) 21059 * finit-logical: Code Gen Options. (line 372) 21060 * finit-real: Code Gen Options. (line 372) 21061 * finline-arg-packing: Code Gen Options. (line 304) 21062 * finline-matmul-limit: Code Gen Options. (line 348) 21063 * finteger-4-integer-8: Fortran Dialect Options. 21064 (line 241) 21065 * fintrinsic-modules-path DIR: Directory Options. (line 36) 21066 * fmax-array-constructor: Code Gen Options. (line 242) 21067 * fmax-errors=N: Error and Warning Options. 21068 (line 27) 21069 * fmax-identifier-length=N: Fortran Dialect Options. 21070 (line 157) 21071 * fmax-stack-var-size: Code Gen Options. (line 260) 21072 * fmax-subrecord-length=LENGTH: Runtime Options. (line 37) 21073 * fmodule-private: Fortran Dialect Options. 21074 (line 123) 21075 * fno-automatic: Code Gen Options. (line 15) 21076 * fno-backtrace: Debugging Options. (line 94) 21077 * fno-protect-parens: Code Gen Options. (line 420) 21078 * fno-underscoring: Code Gen Options. (line 57) 21079 * fopenacc: Fortran Dialect Options. 21080 (line 170) 21081 * fopenmp: Fortran Dialect Options. 21082 (line 177) 21083 * fpack-derived: Code Gen Options. (line 282) 21084 * fpad-source: Fortran Dialect Options. 21085 (line 142) 21086 * fpp: Preprocessing Options. 21087 (line 44) 21088 * frange-check: Fortran Dialect Options. 21089 (line 185) 21090 * freal-4-real-10: Fortran Dialect Options. 21091 (line 256) 21092 * freal-4-real-16: Fortran Dialect Options. 21093 (line 256) 21094 * freal-4-real-8: Fortran Dialect Options. 21095 (line 256) 21096 * freal-8-real-10: Fortran Dialect Options. 21097 (line 256) 21098 * freal-8-real-16: Fortran Dialect Options. 21099 (line 256) 21100 * freal-8-real-4: Fortran Dialect Options. 21101 (line 256) 21102 * frealloc-lhs: Code Gen Options. (line 429) 21103 * frecord-marker=LENGTH: Runtime Options. (line 29) 21104 * frecursive: Code Gen Options. (line 362) 21105 * frepack-arrays: Code Gen Options. (line 288) 21106 * frontend-loop-interchange: Code Gen Options. (line 456) 21107 * frontend-optimize: Code Gen Options. (line 443) 21108 * fsecond-underscore: Code Gen Options. (line 113) 21109 * fshort-enums: Code Gen Options. (line 298) 21110 * fsign-zero: Runtime Options. (line 42) 21111 * fstack-arrays: Code Gen Options. (line 274) 21112 * fsyntax-only: Error and Warning Options. 21113 (line 33) 21114 * ftest-forall-temp: Fortran Dialect Options. 21115 (line 298) 21116 * fworking-directory: Preprocessing Options. 21117 (line 87) 21118 * H: Preprocessing Options. 21119 (line 206) 21120 * IDIR: Directory Options. (line 14) 21121 * idirafter DIR: Preprocessing Options. 21122 (line 101) 21123 * imultilib DIR: Preprocessing Options. 21124 (line 108) 21125 * iprefix PREFIX: Preprocessing Options. 21126 (line 112) 21127 * iquote DIR: Preprocessing Options. 21128 (line 121) 21129 * isysroot DIR: Preprocessing Options. 21130 (line 117) 21131 * isystem DIR: Preprocessing Options. 21132 (line 128) 21133 * JDIR: Directory Options. (line 29) 21134 * MDIR: Directory Options. (line 29) 21135 * nostdinc: Preprocessing Options. 21136 (line 136) 21137 * P: Preprocessing Options. 21138 (line 211) 21139 * pedantic: Error and Warning Options. 21140 (line 39) 21141 * pedantic-errors: Error and Warning Options. 21142 (line 58) 21143 * static-libgfortran: Link Options. (line 11) 21144 * std=STD option: Fortran Dialect Options. 21145 (line 279) 21146 * tail-call-workaround: Code Gen Options. (line 209) 21147 * UNAME: Preprocessing Options. 21148 (line 217) 21149 * undef: Preprocessing Options. 21150 (line 141) 21151 * Waliasing: Error and Warning Options. 21152 (line 71) 21153 * Walign-commons: Error and Warning Options. 21154 (line 228) 21155 * Wall: Error and Warning Options. 21156 (line 62) 21157 * Wampersand: Error and Warning Options. 21158 (line 88) 21159 * Warray-temporaries: Error and Warning Options. 21160 (line 96) 21161 * Wc-binding-type: Error and Warning Options. 21162 (line 101) 21163 * Wcharacter-truncation: Error and Warning Options. 21164 (line 108) 21165 * Wcompare-reals: Error and Warning Options. 21166 (line 256) 21167 * Wconversion: Error and Warning Options. 21168 (line 117) 21169 * Wconversion-extra: Error and Warning Options. 21170 (line 121) 21171 * Wdo-subscript: Error and Warning Options. 21172 (line 268) 21173 * Werror: Error and Warning Options. 21174 (line 280) 21175 * Wextra: Error and Warning Options. 21176 (line 125) 21177 * Wfrontend-loop-interchange: Error and Warning Options. 21178 (line 130) 21179 * Wfunction-elimination: Error and Warning Options. 21180 (line 234) 21181 * Wimplicit-interface: Error and Warning Options. 21182 (line 134) 21183 * Wimplicit-procedure: Error and Warning Options. 21184 (line 140) 21185 * Winteger-division: Error and Warning Options. 21186 (line 144) 21187 * Wintrinsic-shadow: Error and Warning Options. 21188 (line 206) 21189 * Wintrinsics-std: Error and Warning Options. 21190 (line 148) 21191 * Wline-truncation: Error and Warning Options. 21192 (line 111) 21193 * Woverwrite-recursive: Error and Warning Options. 21194 (line 155) 21195 * Wpedantic: Error and Warning Options. 21196 (line 39) 21197 * Wreal-q-constant: Error and Warning Options. 21198 (line 162) 21199 * Wrealloc-lhs: Error and Warning Options. 21200 (line 239) 21201 * Wrealloc-lhs-all: Error and Warning Options. 21202 (line 251) 21203 * Wsurprising: Error and Warning Options. 21204 (line 166) 21205 * Wtabs: Error and Warning Options. 21206 (line 188) 21207 * Wtargt-lifetime: Error and Warning Options. 21208 (line 260) 21209 * Wundefined-do-loop: Error and Warning Options. 21210 (line 196) 21211 * Wunderflow: Error and Warning Options. 21212 (line 201) 21213 * Wunused-dummy-argument: Error and Warning Options. 21214 (line 217) 21215 * Wunused-parameter: Error and Warning Options. 21216 (line 221) 21217 * Wuse-without-only: Error and Warning Options. 21218 (line 213) 21219 * Wzerotrip: Error and Warning Options. 21220 (line 264) 21221 21222 21223 File: gfortran.info, Node: Keyword Index, Prev: Option Index, Up: Top 21224 21225 Keyword Index 21226 ************* 21227 21228 [index] 21229 * Menu: 21230 21231 * $: Fortran Dialect Options. 21232 (line 105) 21233 * %LOC: Argument list functions. 21234 (line 6) 21235 * %REF: Argument list functions. 21236 (line 6) 21237 * %VAL: Argument list functions. 21238 (line 6) 21239 * &: Error and Warning Options. 21240 (line 88) 21241 * _gfortran_set_args: _gfortran_set_args. (line 6) 21242 * _gfortran_set_convert: _gfortran_set_convert. 21243 (line 6) 21244 * _gfortran_set_fpe: _gfortran_set_fpe. (line 6) 21245 * _gfortran_set_max_subrecord_length: _gfortran_set_max_subrecord_length. 21246 (line 6) 21247 * _gfortran_set_options: _gfortran_set_options. 21248 (line 6) 21249 * _gfortran_set_record_marker: _gfortran_set_record_marker. 21250 (line 6) 21251 * ABORT: ABORT. (line 6) 21252 * ABS: ABS. (line 6) 21253 * absolute value: ABS. (line 6) 21254 * ACCESS: ACCESS. (line 6) 21255 * ACHAR: ACHAR. (line 6) 21256 * ACOS: ACOS. (line 6) 21257 * ACOSD: ACOSD. (line 6) 21258 * ACOSH: ACOSH. (line 6) 21259 * adjust string: ADJUSTL. (line 6) 21260 * adjust string <1>: ADJUSTR. (line 6) 21261 * ADJUSTL: ADJUSTL. (line 6) 21262 * ADJUSTR: ADJUSTR. (line 6) 21263 * AIMAG: AIMAG. (line 6) 21264 * AINT: AINT. (line 6) 21265 * ALARM: ALARM. (line 6) 21266 * ALGAMA: LOG_GAMMA. (line 6) 21267 * aliasing: Error and Warning Options. 21268 (line 71) 21269 * alignment of COMMON blocks: Error and Warning Options. 21270 (line 228) 21271 * alignment of COMMON blocks <1>: Code Gen Options. (line 408) 21272 * ALL: ALL. (line 6) 21273 * all warnings: Error and Warning Options. 21274 (line 62) 21275 * ALLOCATED: ALLOCATED. (line 6) 21276 * allocation, moving: MOVE_ALLOC. (line 6) 21277 * allocation, status: ALLOCATED. (line 6) 21278 * ALOG: LOG. (line 6) 21279 * ALOG10: LOG10. (line 6) 21280 * AMAX0: MAX. (line 6) 21281 * AMAX1: MAX. (line 6) 21282 * AMIN0: MIN. (line 6) 21283 * AMIN1: MIN. (line 6) 21284 * AMOD: MOD. (line 6) 21285 * AND: AND. (line 6) 21286 * ANINT: ANINT. (line 6) 21287 * ANY: ANY. (line 6) 21288 * area hyperbolic cosine: ACOSH. (line 6) 21289 * area hyperbolic sine: ASINH. (line 6) 21290 * area hyperbolic tangent: ATANH. (line 6) 21291 * argument list functions: Argument list functions. 21292 (line 6) 21293 * arguments, to program: COMMAND_ARGUMENT_COUNT. 21294 (line 6) 21295 * arguments, to program <1>: GETARG. (line 6) 21296 * arguments, to program <2>: GET_COMMAND. (line 6) 21297 * arguments, to program <3>: GET_COMMAND_ARGUMENT. 21298 (line 6) 21299 * arguments, to program <4>: IARGC. (line 6) 21300 * array descriptor: Further Interoperability of Fortran with C. 21301 (line 6) 21302 * array, add elements: SUM. (line 6) 21303 * array, AND: IALL. (line 6) 21304 * array, apply condition: ALL. (line 6) 21305 * array, apply condition <1>: ANY. (line 6) 21306 * array, bounds checking: Code Gen Options. (line 144) 21307 * array, change dimensions: RESHAPE. (line 6) 21308 * array, combine arrays: MERGE. (line 6) 21309 * array, condition testing: ALL. (line 6) 21310 * array, condition testing <1>: ANY. (line 6) 21311 * array, conditionally add elements: SUM. (line 6) 21312 * array, conditionally count elements: COUNT. (line 6) 21313 * array, conditionally multiply elements: PRODUCT. (line 6) 21314 * array, contiguity: IS_CONTIGUOUS. (line 6) 21315 * array, count elements: SIZE. (line 6) 21316 * array, duplicate dimensions: SPREAD. (line 6) 21317 * array, duplicate elements: SPREAD. (line 6) 21318 * array, element counting: COUNT. (line 6) 21319 * array, gather elements: PACK. (line 6) 21320 * array, increase dimension: SPREAD. (line 6) 21321 * array, increase dimension <1>: UNPACK. (line 6) 21322 * array, indices of type real: Real array indices. (line 6) 21323 * array, location of maximum element: MAXLOC. (line 6) 21324 * array, location of minimum element: MINLOC. (line 6) 21325 * array, lower bound: LBOUND. (line 6) 21326 * array, maximum value: MAXVAL. (line 6) 21327 * array, merge arrays: MERGE. (line 6) 21328 * array, minimum value: MINVAL. (line 6) 21329 * array, multiply elements: PRODUCT. (line 6) 21330 * array, number of elements: COUNT. (line 6) 21331 * array, number of elements <1>: SIZE. (line 6) 21332 * array, OR: IANY. (line 6) 21333 * array, packing: PACK. (line 6) 21334 * array, parity: IPARITY. (line 6) 21335 * array, permutation: CSHIFT. (line 6) 21336 * array, product: PRODUCT. (line 6) 21337 * array, reduce dimension: PACK. (line 6) 21338 * array, rotate: CSHIFT. (line 6) 21339 * array, scatter elements: UNPACK. (line 6) 21340 * array, shape: SHAPE. (line 6) 21341 * array, shift: EOSHIFT. (line 6) 21342 * array, shift circularly: CSHIFT. (line 6) 21343 * array, size: SIZE. (line 6) 21344 * array, sum: SUM. (line 6) 21345 * array, transmogrify: RESHAPE. (line 6) 21346 * array, transpose: TRANSPOSE. (line 6) 21347 * array, unpacking: UNPACK. (line 6) 21348 * array, upper bound: UBOUND. (line 6) 21349 * array, XOR: IPARITY. (line 6) 21350 * ASCII collating sequence: ACHAR. (line 6) 21351 * ASCII collating sequence <1>: IACHAR. (line 6) 21352 * ASIN: ASIN. (line 6) 21353 * ASIND: ASIND. (line 6) 21354 * ASINH: ASINH. (line 6) 21355 * ASSOCIATED: ASSOCIATED. (line 6) 21356 * association status: ASSOCIATED. (line 6) 21357 * association status, C pointer: C_ASSOCIATED. (line 6) 21358 * assumed-rank: Further Interoperability of Fortran with C. 21359 (line 6) 21360 * assumed-type: Further Interoperability of Fortran with C. 21361 (line 6) 21362 * asynchronous I/O: Asynchronous I/O. (line 6) 21363 * ATAN: ATAN. (line 6) 21364 * ATAN2: ATAN2. (line 6) 21365 * ATAN2D: ATAN2D. (line 6) 21366 * ATAND: ATAND. (line 6) 21367 * ATANH: ATANH. (line 6) 21368 * Atomic subroutine, add: ATOMIC_ADD. (line 6) 21369 * Atomic subroutine, ADD with fetch: ATOMIC_FETCH_ADD. (line 6) 21370 * Atomic subroutine, AND: ATOMIC_AND. (line 6) 21371 * Atomic subroutine, AND with fetch: ATOMIC_FETCH_AND. (line 6) 21372 * Atomic subroutine, compare and swap: ATOMIC_CAS. (line 6) 21373 * Atomic subroutine, define: ATOMIC_DEFINE. (line 6) 21374 * Atomic subroutine, OR: ATOMIC_OR. (line 6) 21375 * Atomic subroutine, OR with fetch: ATOMIC_FETCH_OR. (line 6) 21376 * Atomic subroutine, reference: ATOMIC_REF. (line 6) 21377 * Atomic subroutine, XOR: ATOMIC_XOR. (line 6) 21378 * Atomic subroutine, XOR with fetch: ATOMIC_FETCH_XOR. (line 6) 21379 * ATOMIC_ADD: ATOMIC_ADD. (line 6) 21380 * ATOMIC_AND: ATOMIC_AND. (line 6) 21381 * ATOMIC_DEFINE: ATOMIC_CAS. (line 6) 21382 * ATOMIC_DEFINE <1>: ATOMIC_DEFINE. (line 6) 21383 * ATOMIC_FETCH_ADD: ATOMIC_FETCH_ADD. (line 6) 21384 * ATOMIC_FETCH_AND: ATOMIC_FETCH_AND. (line 6) 21385 * ATOMIC_FETCH_OR: ATOMIC_FETCH_OR. (line 6) 21386 * ATOMIC_FETCH_XOR: ATOMIC_FETCH_XOR. (line 6) 21387 * ATOMIC_OR: ATOMIC_OR. (line 6) 21388 * ATOMIC_REF: ATOMIC_REF. (line 6) 21389 * ATOMIC_XOR: ATOMIC_XOR. (line 6) 21390 * Authors: Contributors. (line 6) 21391 * AUTOMATIC: AUTOMATIC and STATIC attributes. 21392 (line 6) 21393 * BABS: ABS. (line 6) 21394 * backslash: Fortran Dialect Options. 21395 (line 111) 21396 * BACKSPACE: Read/Write after EOF marker. 21397 (line 6) 21398 * BACKTRACE: BACKTRACE. (line 6) 21399 * backtrace: Debugging Options. (line 94) 21400 * backtrace <1>: BACKTRACE. (line 6) 21401 * base 10 logarithm function: LOG10. (line 6) 21402 * BBCLR: IBCLR. (line 6) 21403 * BBITS: IBITS. (line 6) 21404 * BBSET: IBSET. (line 6) 21405 * BBTEST: BTEST. (line 6) 21406 * BESJ0: BESSEL_J0. (line 6) 21407 * BESJ1: BESSEL_J1. (line 6) 21408 * BESJN: BESSEL_JN. (line 6) 21409 * Bessel function, first kind: BESSEL_J0. (line 6) 21410 * Bessel function, first kind <1>: BESSEL_J1. (line 6) 21411 * Bessel function, first kind <2>: BESSEL_JN. (line 6) 21412 * Bessel function, second kind: BESSEL_Y0. (line 6) 21413 * Bessel function, second kind <1>: BESSEL_Y1. (line 6) 21414 * Bessel function, second kind <2>: BESSEL_YN. (line 6) 21415 * BESSEL_J0: BESSEL_J0. (line 6) 21416 * BESSEL_J1: BESSEL_J1. (line 6) 21417 * BESSEL_JN: BESSEL_JN. (line 6) 21418 * BESSEL_Y0: BESSEL_Y0. (line 6) 21419 * BESSEL_Y1: BESSEL_Y1. (line 6) 21420 * BESSEL_YN: BESSEL_YN. (line 6) 21421 * BESY0: BESSEL_Y0. (line 6) 21422 * BESY1: BESSEL_Y1. (line 6) 21423 * BESYN: BESSEL_YN. (line 6) 21424 * BGE: BGE. (line 6) 21425 * BGT: BGT. (line 6) 21426 * BIAND: IAND. (line 6) 21427 * BIEOR: IEOR. (line 6) 21428 * binary representation: POPCNT. (line 6) 21429 * binary representation <1>: POPPAR. (line 6) 21430 * BIOR: IOR. (line 6) 21431 * bit intrinsics checking: Code Gen Options. (line 144) 21432 * BITEST: BTEST. (line 6) 21433 * bits set: POPCNT. (line 6) 21434 * bits, AND of array elements: IALL. (line 6) 21435 * bits, clear: IBCLR. (line 6) 21436 * bits, extract: IBITS. (line 6) 21437 * bits, get: IBITS. (line 6) 21438 * bits, merge: MERGE_BITS. (line 6) 21439 * bits, move: MVBITS. (line 6) 21440 * bits, move <1>: TRANSFER. (line 6) 21441 * bits, negate: NOT. (line 6) 21442 * bits, number of: BIT_SIZE. (line 6) 21443 * bits, OR of array elements: IANY. (line 6) 21444 * bits, set: IBSET. (line 6) 21445 * bits, shift: ISHFT. (line 6) 21446 * bits, shift circular: ISHFTC. (line 6) 21447 * bits, shift left: LSHIFT. (line 6) 21448 * bits, shift left <1>: SHIFTL. (line 6) 21449 * bits, shift right: RSHIFT. (line 6) 21450 * bits, shift right <1>: SHIFTA. (line 6) 21451 * bits, shift right <2>: SHIFTR. (line 6) 21452 * bits, testing: BTEST. (line 6) 21453 * bits, unset: IBCLR. (line 6) 21454 * bits, XOR of array elements: IPARITY. (line 6) 21455 * bitwise comparison: BGE. (line 6) 21456 * bitwise comparison <1>: BGT. (line 6) 21457 * bitwise comparison <2>: BLE. (line 6) 21458 * bitwise comparison <3>: BLT. (line 6) 21459 * bitwise logical and: AND. (line 6) 21460 * bitwise logical and <1>: IAND. (line 6) 21461 * bitwise logical exclusive or: IEOR. (line 6) 21462 * bitwise logical exclusive or <1>: XOR. (line 6) 21463 * bitwise logical not: NOT. (line 6) 21464 * bitwise logical or: IOR. (line 6) 21465 * bitwise logical or <1>: OR. (line 6) 21466 * BIT_SIZE: BIT_SIZE. (line 6) 21467 * BJTEST: BTEST. (line 6) 21468 * BKTEST: BTEST. (line 6) 21469 * BLE: BLE. (line 6) 21470 * BLT: BLT. (line 6) 21471 * BMOD: MOD. (line 6) 21472 * BMVBITS: MVBITS. (line 6) 21473 * BNOT: NOT. (line 6) 21474 * bounds checking: Code Gen Options. (line 144) 21475 * BOZ literal constants: BOZ literal constants. 21476 (line 6) 21477 * BSHFT: ISHFT. (line 6) 21478 * BSHFTC: ISHFTC. (line 6) 21479 * BTEST: BTEST. (line 6) 21480 * C derived type and struct interoperability: Derived Types and struct. 21481 (line 6) 21482 * C interoperability: Interoperability with C. 21483 (line 6) 21484 * C intrinsic type interoperability: Intrinsic Types. (line 6) 21485 * C pointers: Working with C Pointers. 21486 (line 6) 21487 * C procedure interoperability: Interoperable Subroutines and Functions. 21488 (line 6) 21489 * C variable interoperability: Interoperable Global Variables. 21490 (line 6) 21491 * CABS: ABS. (line 6) 21492 * calling convention: Code Gen Options. (line 28) 21493 * CARRIAGECONTROL: Extended I/O specifiers. 21494 (line 6) 21495 * CCOS: COS. (line 6) 21496 * CCOSD: COSD. (line 6) 21497 * CDABS: ABS. (line 6) 21498 * CDCOS: COS. (line 6) 21499 * CDCOSD: COSD. (line 6) 21500 * CDEXP: EXP. (line 6) 21501 * CDLOG: LOG. (line 6) 21502 * CDSIN: SIN. (line 6) 21503 * CDSIND: SIND. (line 6) 21504 * CDSQRT: SQRT. (line 6) 21505 * CEILING: CEILING. (line 6) 21506 * ceiling: ANINT. (line 6) 21507 * ceiling <1>: CEILING. (line 6) 21508 * CEXP: EXP. (line 6) 21509 * CHAR: CHAR. (line 6) 21510 * character kind: SELECTED_CHAR_KIND. (line 6) 21511 * character set: Fortran Dialect Options. 21512 (line 105) 21513 * CHDIR: CHDIR. (line 6) 21514 * checking array temporaries: Code Gen Options. (line 144) 21515 * checking subscripts: Code Gen Options. (line 144) 21516 * CHMOD: CHMOD. (line 6) 21517 * clock ticks: MCLOCK. (line 6) 21518 * clock ticks <1>: MCLOCK8. (line 6) 21519 * clock ticks <2>: SYSTEM_CLOCK. (line 6) 21520 * CLOG: LOG. (line 6) 21521 * CMPLX: CMPLX. (line 6) 21522 * coarray, IMAGE_INDEX: IMAGE_INDEX. (line 6) 21523 * coarray, lower bound: LCOBOUND. (line 6) 21524 * coarray, NUM_IMAGES: NUM_IMAGES. (line 6) 21525 * coarray, THIS_IMAGE: THIS_IMAGE. (line 6) 21526 * coarray, upper bound: UCOBOUND. (line 6) 21527 * Coarray, _gfortran_caf_atomic_cas: _gfortran_caf_atomic_cas. 21528 (line 6) 21529 * Coarray, _gfortran_caf_atomic_define: _gfortran_caf_atomic_define. 21530 (line 6) 21531 * Coarray, _gfortran_caf_atomic_op: _gfortran_caf_atomic_op. 21532 (line 6) 21533 * Coarray, _gfortran_caf_atomic_ref: _gfortran_caf_atomic_ref. 21534 (line 6) 21535 * Coarray, _gfortran_caf_co_broadcast: _gfortran_caf_co_broadcast. 21536 (line 6) 21537 * Coarray, _gfortran_caf_co_max: _gfortran_caf_co_max. 21538 (line 6) 21539 * Coarray, _gfortran_caf_co_min: _gfortran_caf_co_min. 21540 (line 6) 21541 * Coarray, _gfortran_caf_co_reduce: _gfortran_caf_co_reduce. 21542 (line 6) 21543 * Coarray, _gfortran_caf_co_sum: _gfortran_caf_co_sum. 21544 (line 6) 21545 * Coarray, _gfortran_caf_deregister: _gfortran_caf_deregister. 21546 (line 6) 21547 * Coarray, _gfortran_caf_error_stop: _gfortran_caf_error_stop. 21548 (line 6) 21549 * Coarray, _gfortran_caf_error_stop_str: _gfortran_caf_error_stop_str. 21550 (line 6) 21551 * Coarray, _gfortran_caf_event_post: _gfortran_caf_event_post. 21552 (line 6) 21553 * Coarray, _gfortran_caf_event_query: _gfortran_caf_event_query. 21554 (line 6) 21555 * Coarray, _gfortran_caf_event_wait: _gfortran_caf_event_wait. 21556 (line 6) 21557 * Coarray, _gfortran_caf_failed_images: _gfortran_caf_failed_images. 21558 (line 6) 21559 * Coarray, _gfortran_caf_fail_image: _gfortran_caf_fail_image. 21560 (line 6) 21561 * Coarray, _gfortran_caf_finish: _gfortran_caf_finish. 21562 (line 6) 21563 * Coarray, _gfortran_caf_get: _gfortran_caf_get. (line 6) 21564 * Coarray, _gfortran_caf_get_by_ref: _gfortran_caf_get_by_ref. 21565 (line 6) 21566 * Coarray, _gfortran_caf_image_status: _gfortran_caf_image_status. 21567 (line 6) 21568 * Coarray, _gfortran_caf_init: _gfortran_caf_init. (line 6) 21569 * Coarray, _gfortran_caf_is_present: _gfortran_caf_is_present. 21570 (line 6) 21571 * Coarray, _gfortran_caf_lock: _gfortran_caf_lock. (line 6) 21572 * Coarray, _gfortran_caf_num_images: _gfortran_caf_num_images. 21573 (line 6) 21574 * Coarray, _gfortran_caf_register: _gfortran_caf_register. 21575 (line 6) 21576 * Coarray, _gfortran_caf_send: _gfortran_caf_send. (line 6) 21577 * Coarray, _gfortran_caf_sendget: _gfortran_caf_sendget. 21578 (line 6) 21579 * Coarray, _gfortran_caf_sendget_by_ref: _gfortran_caf_sendget_by_ref. 21580 (line 6) 21581 * Coarray, _gfortran_caf_send_by_ref: _gfortran_caf_send_by_ref. 21582 (line 6) 21583 * Coarray, _gfortran_caf_stopped_images: _gfortran_caf_stopped_images. 21584 (line 6) 21585 * Coarray, _gfortran_caf_sync_all: _gfortran_caf_sync_all. 21586 (line 6) 21587 * Coarray, _gfortran_caf_sync_images: _gfortran_caf_sync_images. 21588 (line 6) 21589 * Coarray, _gfortran_caf_sync_memory: _gfortran_caf_sync_memory. 21590 (line 6) 21591 * Coarray, _gfortran_caf_this_image: _gfortran_caf_this_image. 21592 (line 6) 21593 * Coarray, _gfortran_caf_unlock: _gfortran_caf_unlock. 21594 (line 6) 21595 * coarrays: Code Gen Options. (line 130) 21596 * Coarrays: Coarray Programming. (line 6) 21597 * code generation, conventions: Code Gen Options. (line 6) 21598 * collating sequence, ASCII: ACHAR. (line 6) 21599 * collating sequence, ASCII <1>: IACHAR. (line 6) 21600 * Collectives, generic reduction: CO_REDUCE. (line 6) 21601 * Collectives, maximal value: CO_MAX. (line 6) 21602 * Collectives, minimal value: CO_MIN. (line 6) 21603 * Collectives, sum of values: CO_SUM. (line 6) 21604 * Collectives, value broadcasting: CO_BROADCAST. (line 6) 21605 * command line: EXECUTE_COMMAND_LINE. 21606 (line 6) 21607 * command options: Invoking GNU Fortran. 21608 (line 6) 21609 * command-line arguments: COMMAND_ARGUMENT_COUNT. 21610 (line 6) 21611 * command-line arguments <1>: GETARG. (line 6) 21612 * command-line arguments <2>: GET_COMMAND. (line 6) 21613 * command-line arguments <3>: GET_COMMAND_ARGUMENT. 21614 (line 6) 21615 * command-line arguments <4>: IARGC. (line 6) 21616 * command-line arguments, number of: COMMAND_ARGUMENT_COUNT. 21617 (line 6) 21618 * command-line arguments, number of <1>: IARGC. (line 6) 21619 * COMMAND_ARGUMENT_COUNT: COMMAND_ARGUMENT_COUNT. 21620 (line 6) 21621 * COMMON: Volatile COMMON blocks. 21622 (line 6) 21623 * compiler flags inquiry function: COMPILER_OPTIONS. (line 6) 21624 * compiler, name and version: COMPILER_VERSION. (line 6) 21625 * COMPILER_OPTIONS: COMPILER_OPTIONS. (line 6) 21626 * COMPILER_VERSION: COMPILER_VERSION. (line 6) 21627 * COMPLEX: COMPLEX. (line 6) 21628 * complex conjugate: CONJG. (line 6) 21629 * Complex function: Alternate complex function syntax. 21630 (line 6) 21631 * complex numbers, conversion to: CMPLX. (line 6) 21632 * complex numbers, conversion to <1>: COMPLEX. (line 6) 21633 * complex numbers, conversion to <2>: DCMPLX. (line 6) 21634 * complex numbers, imaginary part: AIMAG. (line 6) 21635 * complex numbers, real part: DREAL. (line 6) 21636 * complex numbers, real part <1>: REAL. (line 6) 21637 * conditional compilation: Fortran 95 status. (line 6) 21638 * Conditional compilation: Preprocessing Options. 21639 (line 6) 21640 * CONJG: CONJG. (line 6) 21641 * consistency, durability: Data consistency and durability. 21642 (line 6) 21643 * Contributing: Contributing. (line 6) 21644 * Contributors: Contributors. (line 6) 21645 * conversion: Error and Warning Options. 21646 (line 117) 21647 * conversion <1>: Error and Warning Options. 21648 (line 121) 21649 * conversion, to character: Character conversion. 21650 (line 6) 21651 * conversion, to character <1>: CHAR. (line 6) 21652 * conversion, to complex: CMPLX. (line 6) 21653 * conversion, to complex <1>: COMPLEX. (line 6) 21654 * conversion, to complex <2>: DCMPLX. (line 6) 21655 * conversion, to integer: Implicitly convert LOGICAL and INTEGER values. 21656 (line 6) 21657 * conversion, to integer <1>: IACHAR. (line 6) 21658 * conversion, to integer <2>: ICHAR. (line 6) 21659 * conversion, to integer <3>: INT. (line 6) 21660 * conversion, to integer <4>: INT2. (line 6) 21661 * conversion, to integer <5>: INT8. (line 6) 21662 * conversion, to logical: Implicitly convert LOGICAL and INTEGER values. 21663 (line 6) 21664 * conversion, to logical <1>: LOGICAL. (line 6) 21665 * conversion, to real: DBLE. (line 6) 21666 * conversion, to real <1>: REAL. (line 6) 21667 * conversion, to string: CTIME. (line 6) 21668 * CONVERT specifier: CONVERT specifier. (line 6) 21669 * core, dump: ABORT. (line 6) 21670 * COS: COS. (line 6) 21671 * COSD: COSD. (line 6) 21672 * COSH: COSH. (line 6) 21673 * cosine: COS. (line 6) 21674 * cosine, degrees: COSD. (line 6) 21675 * cosine, hyperbolic: COSH. (line 6) 21676 * cosine, hyperbolic, inverse: ACOSH. (line 6) 21677 * cosine, inverse: ACOS. (line 6) 21678 * cosine, inverse, degrees: ACOSD. (line 6) 21679 * COTAN: COTAN. (line 6) 21680 * COTAND: COTAND. (line 6) 21681 * cotangent: COTAN. (line 6) 21682 * cotangent, degrees: COTAND. (line 6) 21683 * COUNT: COUNT. (line 6) 21684 * CO_BROADCAST: CO_BROADCAST. (line 6) 21685 * CO_MAX: CO_MAX. (line 6) 21686 * CO_MIN: CO_MIN. (line 6) 21687 * CO_REDUCE: CO_REDUCE. (line 6) 21688 * CO_SUM: CO_SUM. (line 6) 21689 * CPP: Preprocessing Options. 21690 (line 6) 21691 * CPU_TIME: CPU_TIME. (line 6) 21692 * Credits: Contributors. (line 6) 21693 * CSHIFT: CSHIFT. (line 6) 21694 * CSIN: SIN. (line 6) 21695 * CSIND: SIND. (line 6) 21696 * CSQRT: SQRT. (line 6) 21697 * CTIME: CTIME. (line 6) 21698 * current date: DATE_AND_TIME. (line 6) 21699 * current date <1>: FDATE. (line 6) 21700 * current date <2>: IDATE. (line 6) 21701 * current time: DATE_AND_TIME. (line 6) 21702 * current time <1>: FDATE. (line 6) 21703 * current time <2>: ITIME. (line 6) 21704 * current time <3>: TIME. (line 6) 21705 * current time <4>: TIME8. (line 6) 21706 * C_ASSOCIATED: C_ASSOCIATED. (line 6) 21707 * C_FUNLOC: C_FUNLOC. (line 6) 21708 * C_F_POINTER: C_F_POINTER. (line 6) 21709 * C_F_PROCPOINTER: C_F_PROCPOINTER. (line 6) 21710 * C_LOC: C_LOC. (line 6) 21711 * C_SIZEOF: C_SIZEOF. (line 6) 21712 * DABS: ABS. (line 6) 21713 * DACOS: ACOS. (line 6) 21714 * DACOSD: ACOSD. (line 6) 21715 * DACOSH: ACOSH. (line 6) 21716 * DASIN: ASIN. (line 6) 21717 * DASIND: ASIND. (line 6) 21718 * DASINH: ASINH. (line 6) 21719 * DATAN: ATAN. (line 6) 21720 * DATAN2: ATAN2. (line 6) 21721 * DATAN2D: ATAN2D. (line 6) 21722 * DATAND: ATAND. (line 6) 21723 * DATANH: ATANH. (line 6) 21724 * date, current: DATE_AND_TIME. (line 6) 21725 * date, current <1>: FDATE. (line 6) 21726 * date, current <2>: IDATE. (line 6) 21727 * DATE_AND_TIME: DATE_AND_TIME. (line 6) 21728 * DBESJ0: BESSEL_J0. (line 6) 21729 * DBESJ1: BESSEL_J1. (line 6) 21730 * DBESJN: BESSEL_JN. (line 6) 21731 * DBESY0: BESSEL_Y0. (line 6) 21732 * DBESY1: BESSEL_Y1. (line 6) 21733 * DBESYN: BESSEL_YN. (line 6) 21734 * DBLE: DBLE. (line 6) 21735 * DCMPLX: DCMPLX. (line 6) 21736 * DCONJG: CONJG. (line 6) 21737 * DCOS: COS. (line 6) 21738 * DCOSD: COSD. (line 6) 21739 * DCOSH: COSH. (line 6) 21740 * DCOTAN: COTAN. (line 6) 21741 * DCOTAND: COTAND. (line 6) 21742 * DDIM: DIM. (line 6) 21743 * debugging information options: Debugging Options. (line 6) 21744 * debugging, preprocessor: Preprocessing Options. 21745 (line 58) 21746 * debugging, preprocessor <1>: Preprocessing Options. 21747 (line 67) 21748 * debugging, preprocessor <2>: Preprocessing Options. 21749 (line 73) 21750 * debugging, preprocessor <3>: Preprocessing Options. 21751 (line 76) 21752 * debugging, preprocessor <4>: Preprocessing Options. 21753 (line 83) 21754 * DECODE: ENCODE and DECODE statements. 21755 (line 6) 21756 * delayed execution: ALARM. (line 6) 21757 * delayed execution <1>: SLEEP. (line 6) 21758 * derived type interoperability with C: Derived Types and struct. 21759 (line 6) 21760 * DEXP: EXP. (line 6) 21761 * DFLOAT: REAL. (line 6) 21762 * DGAMMA: GAMMA. (line 6) 21763 * dialect options: Fortran Dialect Options. 21764 (line 6) 21765 * DIGITS: DIGITS. (line 6) 21766 * DIM: DIM. (line 6) 21767 * DIMAG: AIMAG. (line 6) 21768 * DINT: AINT. (line 6) 21769 * directive, INCLUDE: Directory Options. (line 6) 21770 * directory, options: Directory Options. (line 6) 21771 * directory, search paths for inclusion: Directory Options. (line 14) 21772 * division, modulo: MODULO. (line 6) 21773 * division, remainder: MOD. (line 6) 21774 * DLGAMA: LOG_GAMMA. (line 6) 21775 * DLOG: LOG. (line 6) 21776 * DLOG10: LOG10. (line 6) 21777 * DMAX1: MAX. (line 6) 21778 * DMIN1: MIN. (line 6) 21779 * DMOD: MOD. (line 6) 21780 * DNINT: ANINT. (line 6) 21781 * dope vector: Further Interoperability of Fortran with C. 21782 (line 6) 21783 * dot product: DOT_PRODUCT. (line 6) 21784 * DOT_PRODUCT: DOT_PRODUCT. (line 6) 21785 * DPROD: DPROD. (line 6) 21786 * DREAL: DREAL. (line 6) 21787 * DSHIFTL: DSHIFTL. (line 6) 21788 * DSHIFTR: DSHIFTR. (line 6) 21789 * DSIGN: SIGN. (line 6) 21790 * DSIN: SIN. (line 6) 21791 * DSIND: SIND. (line 6) 21792 * DSINH: SINH. (line 6) 21793 * DSQRT: SQRT. (line 6) 21794 * DTAN: TAN. (line 6) 21795 * DTAND: TAND. (line 6) 21796 * DTANH: TANH. (line 6) 21797 * DTIME: DTIME. (line 6) 21798 * dummy argument, unused: Error and Warning Options. 21799 (line 217) 21800 * elapsed time: DTIME. (line 6) 21801 * elapsed time <1>: SECNDS. (line 6) 21802 * elapsed time <2>: SECOND. (line 6) 21803 * Elimination of functions with identical argument lists: Code Gen Options. 21804 (line 435) 21805 * ENCODE: ENCODE and DECODE statements. 21806 (line 6) 21807 * environment variable: Environment Variables. 21808 (line 6) 21809 * environment variable <1>: Runtime. (line 6) 21810 * environment variable <2>: GETENV. (line 6) 21811 * environment variable <3>: GET_ENVIRONMENT_VARIABLE. 21812 (line 6) 21813 * EOF: Read/Write after EOF marker. 21814 (line 6) 21815 * EOSHIFT: EOSHIFT. (line 6) 21816 * EPSILON: EPSILON. (line 6) 21817 * ERF: ERF. (line 6) 21818 * ERFC: ERFC. (line 6) 21819 * ERFC_SCALED: ERFC_SCALED. (line 6) 21820 * error function: ERF. (line 6) 21821 * error function, complementary: ERFC. (line 6) 21822 * error function, complementary, exponentially-scaled: ERFC_SCALED. 21823 (line 6) 21824 * errors, limiting: Error and Warning Options. 21825 (line 27) 21826 * escape characters: Fortran Dialect Options. 21827 (line 111) 21828 * ETIME: ETIME. (line 6) 21829 * Euclidean distance: HYPOT. (line 6) 21830 * Euclidean vector norm: NORM2. (line 6) 21831 * Events, EVENT_QUERY: EVENT_QUERY. (line 6) 21832 * EVENT_QUERY: EVENT_QUERY. (line 6) 21833 * EXECUTE_COMMAND_LINE: EXECUTE_COMMAND_LINE. 21834 (line 6) 21835 * EXIT: EXIT. (line 6) 21836 * EXP: EXP. (line 6) 21837 * EXPONENT: EXPONENT. (line 6) 21838 * exponent: Default exponents. (line 6) 21839 * exponential function: EXP. (line 6) 21840 * exponential function, inverse: LOG. (line 6) 21841 * exponential function, inverse <1>: LOG10. (line 6) 21842 * expression size: C_SIZEOF. (line 6) 21843 * expression size <1>: SIZEOF. (line 6) 21844 * EXTENDS_TYPE_OF: EXTENDS_TYPE_OF. (line 6) 21845 * extensions: Extensions. (line 6) 21846 * extensions, implemented: Extensions implemented in GNU Fortran. 21847 (line 6) 21848 * extensions, not implemented: Extensions not implemented in GNU Fortran. 21849 (line 6) 21850 * extra warnings: Error and Warning Options. 21851 (line 125) 21852 * f2c calling convention: Code Gen Options. (line 28) 21853 * f2c calling convention <1>: Code Gen Options. (line 113) 21854 * Factorial function: GAMMA. (line 6) 21855 * FDATE: FDATE. (line 6) 21856 * FDL, GNU Free Documentation License: GNU Free Documentation License. 21857 (line 6) 21858 * FGET: FGET. (line 6) 21859 * FGETC: FGETC. (line 6) 21860 * file format, fixed: Fortran Dialect Options. 21861 (line 11) 21862 * file format, fixed <1>: Fortran Dialect Options. 21863 (line 128) 21864 * file format, free: Fortran Dialect Options. 21865 (line 11) 21866 * file format, free <1>: Fortran Dialect Options. 21867 (line 150) 21868 * file operation, file number: FNUM. (line 6) 21869 * file operation, flush: FLUSH. (line 6) 21870 * file operation, position: FSEEK. (line 6) 21871 * file operation, position <1>: FTELL. (line 6) 21872 * file operation, read character: FGET. (line 6) 21873 * file operation, read character <1>: FGETC. (line 6) 21874 * file operation, seek: FSEEK. (line 6) 21875 * file operation, write character: FPUT. (line 6) 21876 * file operation, write character <1>: FPUTC. (line 6) 21877 * file system, access mode: ACCESS. (line 6) 21878 * file system, change access mode: CHMOD. (line 6) 21879 * file system, create link: LINK. (line 6) 21880 * file system, create link <1>: SYMLNK. (line 6) 21881 * file system, file creation mask: UMASK. (line 6) 21882 * file system, file status: FSTAT. (line 6) 21883 * file system, file status <1>: LSTAT. (line 6) 21884 * file system, file status <2>: STAT. (line 6) 21885 * file system, hard link: LINK. (line 6) 21886 * file system, remove file: UNLINK. (line 6) 21887 * file system, rename file: RENAME. (line 6) 21888 * file system, soft link: SYMLNK. (line 6) 21889 * file, symbolic link: File operations on symbolic links. 21890 (line 6) 21891 * file, unformatted sequential: File format of unformatted sequential files. 21892 (line 6) 21893 * FINDLOC: FINDLOC. (line 6) 21894 * findloc: FINDLOC. (line 6) 21895 * flags inquiry function: COMPILER_OPTIONS. (line 6) 21896 * FLOAT: REAL. (line 6) 21897 * FLOATI: REAL. (line 6) 21898 * floating point, exponent: EXPONENT. (line 6) 21899 * floating point, fraction: FRACTION. (line 6) 21900 * floating point, nearest different: NEAREST. (line 6) 21901 * floating point, relative spacing: RRSPACING. (line 6) 21902 * floating point, relative spacing <1>: SPACING. (line 6) 21903 * floating point, scale: SCALE. (line 6) 21904 * floating point, set exponent: SET_EXPONENT. (line 6) 21905 * FLOATJ: REAL. (line 6) 21906 * FLOATK: REAL. (line 6) 21907 * FLOOR: FLOOR. (line 6) 21908 * floor: AINT. (line 6) 21909 * floor <1>: FLOOR. (line 6) 21910 * FLUSH: FLUSH. (line 6) 21911 * FNUM: FNUM. (line 6) 21912 * form feed whitespace: Form feed as whitespace. 21913 (line 6) 21914 * FORMAT: Variable FORMAT expressions. 21915 (line 6) 21916 * FPP: Preprocessing Options. 21917 (line 6) 21918 * FPUT: FPUT. (line 6) 21919 * FPUTC: FPUTC. (line 6) 21920 * FRACTION: FRACTION. (line 6) 21921 * FREE: FREE. (line 6) 21922 * Front-end optimization: Code Gen Options. (line 443) 21923 * FSEEK: FSEEK. (line 6) 21924 * FSTAT: FSTAT. (line 6) 21925 * FTELL: FTELL. (line 6) 21926 * function elimination: Error and Warning Options. 21927 (line 234) 21928 * function interoperability with C: Interoperable Subroutines and Functions. 21929 (line 6) 21930 * Further Interoperability of Fortran with C: Further Interoperability of Fortran with C. 21931 (line 6) 21932 * g77 calling convention: Code Gen Options. (line 28) 21933 * g77 calling convention <1>: Code Gen Options. (line 113) 21934 * GAMMA: GAMMA. (line 6) 21935 * Gamma function: GAMMA. (line 6) 21936 * Gamma function, logarithm of: LOG_GAMMA. (line 6) 21937 * GCC: GNU Fortran and GCC. (line 6) 21938 * Generating C prototypes from external procedures: Interoperability Options. 21939 (line 25) 21940 * Generating C prototypes from Fortran BIND(C) enteties: Interoperability Options. 21941 (line 7) 21942 * GERROR: GERROR. (line 6) 21943 * GETARG: GETARG. (line 6) 21944 * GETCWD: GETCWD. (line 6) 21945 * GETENV: GETENV. (line 6) 21946 * GETGID: GETGID. (line 6) 21947 * GETLOG: GETLOG. (line 6) 21948 * GETPID: GETPID. (line 6) 21949 * GETUID: GETUID. (line 6) 21950 * GET_COMMAND: GET_COMMAND. (line 6) 21951 * GET_COMMAND_ARGUMENT: GET_COMMAND_ARGUMENT. 21952 (line 6) 21953 * GET_ENVIRONMENT_VARIABLE: GET_ENVIRONMENT_VARIABLE. 21954 (line 6) 21955 * GMTIME: GMTIME. (line 6) 21956 * GNU Compiler Collection: GNU Fortran and GCC. (line 6) 21957 * GNU Fortran command options: Invoking GNU Fortran. 21958 (line 6) 21959 * Hollerith constants: Hollerith constants support. 21960 (line 6) 21961 * HOSTNM: HOSTNM. (line 6) 21962 * HUGE: HUGE. (line 6) 21963 * hyperbolic cosine: COSH. (line 6) 21964 * hyperbolic function, cosine: COSH. (line 6) 21965 * hyperbolic function, cosine, inverse: ACOSH. (line 6) 21966 * hyperbolic function, sine: SINH. (line 6) 21967 * hyperbolic function, sine, inverse: ASINH. (line 6) 21968 * hyperbolic function, tangent: TANH. (line 6) 21969 * hyperbolic function, tangent, inverse: ATANH. (line 6) 21970 * hyperbolic sine: SINH. (line 6) 21971 * hyperbolic tangent: TANH. (line 6) 21972 * HYPOT: HYPOT. (line 6) 21973 * I/O item lists: I/O item lists. (line 6) 21974 * I/O specifiers: Extended I/O specifiers. 21975 (line 6) 21976 * IABS: ABS. (line 6) 21977 * IACHAR: IACHAR. (line 6) 21978 * IALL: IALL. (line 6) 21979 * IAND: IAND. (line 6) 21980 * IANY: IANY. (line 6) 21981 * IARGC: IARGC. (line 6) 21982 * IBCLR: IBCLR. (line 6) 21983 * IBITS: IBITS. (line 6) 21984 * IBSET: IBSET. (line 6) 21985 * ICHAR: ICHAR. (line 6) 21986 * IDATE: IDATE. (line 6) 21987 * IDIM: DIM. (line 6) 21988 * IDINT: INT. (line 6) 21989 * IDNINT: NINT. (line 6) 21990 * IEEE, ISNAN: ISNAN. (line 6) 21991 * IEOR: IEOR. (line 6) 21992 * IERRNO: IERRNO. (line 6) 21993 * IFIX: INT. (line 6) 21994 * IIABS: ABS. (line 6) 21995 * IIAND: IAND. (line 6) 21996 * IIBCLR: IBCLR. (line 6) 21997 * IIBITS: IBITS. (line 6) 21998 * IIBSET: IBSET. (line 6) 21999 * IIEOR: IEOR. (line 6) 22000 * IIOR: IOR. (line 6) 22001 * IISHFT: ISHFT. (line 6) 22002 * IISHFTC: ISHFTC. (line 6) 22003 * IMAG: AIMAG. (line 6) 22004 * images, cosubscript to image index conversion: IMAGE_INDEX. (line 6) 22005 * images, index of this image: THIS_IMAGE. (line 6) 22006 * images, number of: NUM_IMAGES. (line 6) 22007 * IMAGE_INDEX: IMAGE_INDEX. (line 6) 22008 * IMAGPART: AIMAG. (line 6) 22009 * IMOD: MOD. (line 6) 22010 * IMVBITS: MVBITS. (line 6) 22011 * INCLUDE directive: Directory Options. (line 6) 22012 * inclusion, directory search paths for: Directory Options. (line 14) 22013 * INDEX: INDEX intrinsic. (line 6) 22014 * INOT: NOT. (line 6) 22015 * input/output, asynchronous: Asynchronous I/O. (line 6) 22016 * INT: INT. (line 6) 22017 * INT2: INT2. (line 6) 22018 * INT8: INT8. (line 6) 22019 * integer kind: SELECTED_INT_KIND. (line 6) 22020 * Interoperability: Mixed-Language Programming. 22021 (line 6) 22022 * interoperability with C: Interoperability with C. 22023 (line 6) 22024 * interoperability, derived type and struct: Derived Types and struct. 22025 (line 6) 22026 * interoperability, intrinsic type: Intrinsic Types. (line 6) 22027 * interoperability, subroutine and function: Interoperable Subroutines and Functions. 22028 (line 6) 22029 * interoperability, variable: Interoperable Global Variables. 22030 (line 6) 22031 * intrinsic: Error and Warning Options. 22032 (line 206) 22033 * intrinsic <1>: Error and Warning Options. 22034 (line 213) 22035 * intrinsic Modules: Intrinsic Modules. (line 6) 22036 * intrinsic procedures: Intrinsic Procedures. 22037 (line 6) 22038 * intrinsic type interoperability with C: Intrinsic Types. (line 6) 22039 * intrinsics, integer: Type variants for integer intrinsics. 22040 (line 6) 22041 * intrinsics, math: Extended math intrinsics. 22042 (line 6) 22043 * intrinsics, trigonometric functions: Extended math intrinsics. 22044 (line 6) 22045 * Introduction: Top. (line 6) 22046 * inverse hyperbolic cosine: ACOSH. (line 6) 22047 * inverse hyperbolic sine: ASINH. (line 6) 22048 * inverse hyperbolic tangent: ATANH. (line 6) 22049 * IOR: IOR. (line 6) 22050 * IOSTAT, end of file: IS_IOSTAT_END. (line 6) 22051 * IOSTAT, end of record: IS_IOSTAT_EOR. (line 6) 22052 * IPARITY: IPARITY. (line 6) 22053 * IRAND: IRAND. (line 6) 22054 * ISATTY: ISATTY. (line 6) 22055 * ISHFT: ISHFT. (line 6) 22056 * ISHFTC: ISHFTC. (line 6) 22057 * ISIGN: SIGN. (line 6) 22058 * ISNAN: ISNAN. (line 6) 22059 * IS_IOSTAT_END: IS_IOSTAT_END. (line 6) 22060 * IS_IOSTAT_EOR: IS_CONTIGUOUS. (line 6) 22061 * IS_IOSTAT_EOR <1>: IS_IOSTAT_EOR. (line 6) 22062 * ITIME: ITIME. (line 6) 22063 * JIABS: ABS. (line 6) 22064 * JIAND: IAND. (line 6) 22065 * JIBCLR: IBCLR. (line 6) 22066 * JIBITS: IBITS. (line 6) 22067 * JIBSET: IBSET. (line 6) 22068 * JIEOR: IEOR. (line 6) 22069 * JIOR: IOR. (line 6) 22070 * JISHFT: ISHFT. (line 6) 22071 * JISHFTC: ISHFTC. (line 6) 22072 * JMOD: MOD. (line 6) 22073 * JMVBITS: MVBITS. (line 6) 22074 * JNOT: NOT. (line 6) 22075 * KIABS: ABS. (line 6) 22076 * KIAND: IAND. (line 6) 22077 * KIBCLR: IBCLR. (line 6) 22078 * KIBITS: IBITS. (line 6) 22079 * KIBSET: IBSET. (line 6) 22080 * KIEOR: IEOR. (line 6) 22081 * KILL: KILL. (line 6) 22082 * kind: KIND Type Parameters. 22083 (line 6) 22084 * KIND: KIND. (line 6) 22085 * kind <1>: KIND. (line 6) 22086 * kind, character: SELECTED_CHAR_KIND. (line 6) 22087 * kind, integer: SELECTED_INT_KIND. (line 6) 22088 * kind, old-style: Old-style kind specifications. 22089 (line 6) 22090 * kind, real: SELECTED_REAL_KIND. (line 6) 22091 * KIOR: IOR. (line 6) 22092 * KISHFT: ISHFT. (line 6) 22093 * KISHFTC: ISHFTC. (line 6) 22094 * KMOD: MOD. (line 6) 22095 * KMVBITS: MVBITS. (line 6) 22096 * KNOT: NOT. (line 6) 22097 * L2 vector norm: NORM2. (line 6) 22098 * language, dialect options: Fortran Dialect Options. 22099 (line 6) 22100 * LBOUND: LBOUND. (line 6) 22101 * LCOBOUND: LCOBOUND. (line 6) 22102 * LEADZ: LEADZ. (line 6) 22103 * left shift, combined: DSHIFTL. (line 6) 22104 * LEN: LEN. (line 6) 22105 * LEN_TRIM: LEN_TRIM. (line 6) 22106 * lexical comparison of strings: LGE. (line 6) 22107 * lexical comparison of strings <1>: LGT. (line 6) 22108 * lexical comparison of strings <2>: LLE. (line 6) 22109 * lexical comparison of strings <3>: LLT. (line 6) 22110 * LGAMMA: LOG_GAMMA. (line 6) 22111 * LGE: LGE. (line 6) 22112 * LGT: LGT. (line 6) 22113 * libf2c calling convention: Code Gen Options. (line 28) 22114 * libf2c calling convention <1>: Code Gen Options. (line 113) 22115 * libgfortran initialization, set_args: _gfortran_set_args. (line 6) 22116 * libgfortran initialization, set_convert: _gfortran_set_convert. 22117 (line 6) 22118 * libgfortran initialization, set_fpe: _gfortran_set_fpe. (line 6) 22119 * libgfortran initialization, set_max_subrecord_length: _gfortran_set_max_subrecord_length. 22120 (line 6) 22121 * libgfortran initialization, set_options: _gfortran_set_options. 22122 (line 6) 22123 * libgfortran initialization, set_record_marker: _gfortran_set_record_marker. 22124 (line 6) 22125 * limits, largest number: HUGE. (line 6) 22126 * limits, smallest number: TINY. (line 6) 22127 * LINK: LINK. (line 6) 22128 * linking, static: Link Options. (line 6) 22129 * LLE: LLE. (line 6) 22130 * LLT: LLT. (line 6) 22131 * LNBLNK: LNBLNK. (line 6) 22132 * LOC: %LOC as an rvalue. (line 6) 22133 * LOC <1>: LOC. (line 6) 22134 * location of a variable in memory: LOC. (line 6) 22135 * LOG: LOG. (line 6) 22136 * LOG10: LOG10. (line 6) 22137 * logarithm function: LOG. (line 6) 22138 * logarithm function with base 10: LOG10. (line 6) 22139 * logarithm function, inverse: EXP. (line 6) 22140 * LOGICAL: LOGICAL. (line 6) 22141 * logical and, bitwise: AND. (line 6) 22142 * logical and, bitwise <1>: IAND. (line 6) 22143 * logical exclusive or, bitwise: IEOR. (line 6) 22144 * logical exclusive or, bitwise <1>: XOR. (line 6) 22145 * logical not, bitwise: NOT. (line 6) 22146 * logical or, bitwise: IOR. (line 6) 22147 * logical or, bitwise <1>: OR. (line 6) 22148 * logical, bitwise: Bitwise logical operators. 22149 (line 6) 22150 * logical, variable representation: Internal representation of LOGICAL variables. 22151 (line 6) 22152 * login name: GETLOG. (line 6) 22153 * LOG_GAMMA: LOG_GAMMA. (line 6) 22154 * loop interchange, Fortran: Code Gen Options. (line 456) 22155 * loop interchange, warning: Error and Warning Options. 22156 (line 130) 22157 * LSHIFT: LSHIFT. (line 6) 22158 * LSTAT: LSTAT. (line 6) 22159 * LTIME: LTIME. (line 6) 22160 * MALLOC: MALLOC. (line 6) 22161 * MAP: UNION and MAP. (line 6) 22162 * mask, left justified: MASKL. (line 6) 22163 * mask, right justified: MASKR. (line 6) 22164 * MASKL: MASKL. (line 6) 22165 * MASKR: MASKR. (line 6) 22166 * MATMUL: MATMUL. (line 6) 22167 * matrix multiplication: MATMUL. (line 6) 22168 * matrix, transpose: TRANSPOSE. (line 6) 22169 * MAX: MAX. (line 6) 22170 * MAX, MIN, NaN: MAX and MIN intrinsics with REAL NaN arguments. 22171 (line 6) 22172 * MAX0: MAX. (line 6) 22173 * MAX1: MAX. (line 6) 22174 * MAXEXPONENT: MAXEXPONENT. (line 6) 22175 * maximum value: MAX. (line 6) 22176 * maximum value <1>: MAXVAL. (line 6) 22177 * MAXLOC: MAXLOC. (line 6) 22178 * MAXVAL: MAXVAL. (line 6) 22179 * MCLOCK: MCLOCK. (line 6) 22180 * MCLOCK8: MCLOCK8. (line 6) 22181 * memory checking: Code Gen Options. (line 144) 22182 * MERGE: MERGE. (line 6) 22183 * MERGE_BITS: MERGE_BITS. (line 6) 22184 * messages, error: Error and Warning Options. 22185 (line 6) 22186 * messages, warning: Error and Warning Options. 22187 (line 6) 22188 * MIN: MIN. (line 6) 22189 * MIN0: MIN. (line 6) 22190 * MIN1: MIN. (line 6) 22191 * MINEXPONENT: MINEXPONENT. (line 6) 22192 * minimum value: MIN. (line 6) 22193 * minimum value <1>: MINVAL. (line 6) 22194 * MINLOC: MINLOC. (line 6) 22195 * MINVAL: MINVAL. (line 6) 22196 * Mixed-language programming: Mixed-Language Programming. 22197 (line 6) 22198 * MOD: MOD. (line 6) 22199 * model representation, base: RADIX. (line 6) 22200 * model representation, epsilon: EPSILON. (line 6) 22201 * model representation, largest number: HUGE. (line 6) 22202 * model representation, maximum exponent: MAXEXPONENT. (line 6) 22203 * model representation, minimum exponent: MINEXPONENT. (line 6) 22204 * model representation, precision: PRECISION. (line 6) 22205 * model representation, radix: RADIX. (line 6) 22206 * model representation, range: RANGE. (line 6) 22207 * model representation, significant digits: DIGITS. (line 6) 22208 * model representation, smallest number: TINY. (line 6) 22209 * module entities: Fortran Dialect Options. 22210 (line 123) 22211 * module search path: Directory Options. (line 14) 22212 * module search path <1>: Directory Options. (line 29) 22213 * module search path <2>: Directory Options. (line 36) 22214 * MODULO: MODULO. (line 6) 22215 * modulo: MODULO. (line 6) 22216 * MOVE_ALLOC: MOVE_ALLOC. (line 6) 22217 * moving allocation: MOVE_ALLOC. (line 6) 22218 * multiply array elements: PRODUCT. (line 6) 22219 * MVBITS: MVBITS. (line 6) 22220 * NAME: OPEN( ... NAME=). (line 6) 22221 * Namelist: Extensions to namelist. 22222 (line 6) 22223 * natural logarithm function: LOG. (line 6) 22224 * NEAREST: NEAREST. (line 6) 22225 * newline: NEW_LINE. (line 6) 22226 * NEW_LINE: NEW_LINE. (line 6) 22227 * NINT: NINT. (line 6) 22228 * norm, Euclidean: NORM2. (line 6) 22229 * NORM2: NORM2. (line 6) 22230 * NOSHARED: Extended I/O specifiers. 22231 (line 6) 22232 * NOT: NOT. (line 6) 22233 * NULL: NULL. (line 6) 22234 * NUM_IMAGES: NUM_IMAGES. (line 6) 22235 * open, action: Files opened without an explicit ACTION= specifier. 22236 (line 6) 22237 * OpenACC: Fortran Dialect Options. 22238 (line 170) 22239 * OpenACC <1>: OpenACC. (line 6) 22240 * OpenMP: Fortran Dialect Options. 22241 (line 177) 22242 * OpenMP <1>: OpenMP. (line 6) 22243 * operators, unary: Unary operators. (line 6) 22244 * operators, xor: .XOR. operator. (line 6) 22245 * options inquiry function: COMPILER_OPTIONS. (line 6) 22246 * options, code generation: Code Gen Options. (line 6) 22247 * options, debugging: Debugging Options. (line 6) 22248 * options, dialect: Fortran Dialect Options. 22249 (line 6) 22250 * options, directory search: Directory Options. (line 6) 22251 * options, errors: Error and Warning Options. 22252 (line 6) 22253 * options, Fortran dialect: Fortran Dialect Options. 22254 (line 11) 22255 * options, gfortran command: Invoking GNU Fortran. 22256 (line 6) 22257 * options, linking: Link Options. (line 6) 22258 * options, negative forms: Invoking GNU Fortran. 22259 (line 13) 22260 * options, preprocessor: Preprocessing Options. 22261 (line 6) 22262 * options, real kind type promotion: Fortran Dialect Options. 22263 (line 256) 22264 * options, run-time: Code Gen Options. (line 6) 22265 * options, runtime: Runtime Options. (line 6) 22266 * options, warnings: Error and Warning Options. 22267 (line 6) 22268 * OR: OR. (line 6) 22269 * output, newline: NEW_LINE. (line 6) 22270 * PACK: PACK. (line 6) 22271 * PARAMETER: Legacy PARAMETER statements. 22272 (line 6) 22273 * PARITY: PARITY. (line 6) 22274 * Parity: PARITY. (line 6) 22275 * parity: POPPAR. (line 6) 22276 * paths, search: Directory Options. (line 14) 22277 * paths, search <1>: Directory Options. (line 29) 22278 * paths, search <2>: Directory Options. (line 36) 22279 * PERROR: PERROR. (line 6) 22280 * pointer checking: Code Gen Options. (line 144) 22281 * pointer, C address of pointers: C_F_PROCPOINTER. (line 6) 22282 * pointer, C address of procedures: C_FUNLOC. (line 6) 22283 * pointer, C association status: C_ASSOCIATED. (line 6) 22284 * pointer, convert C to Fortran: C_F_POINTER. (line 6) 22285 * pointer, Cray: Cray pointers. (line 6) 22286 * pointer, cray: FREE. (line 6) 22287 * pointer, cray <1>: MALLOC. (line 6) 22288 * pointer, disassociated: NULL. (line 6) 22289 * pointer, status: ASSOCIATED. (line 6) 22290 * pointer, status <1>: NULL. (line 6) 22291 * pointers, C: Working with C Pointers. 22292 (line 6) 22293 * POPCNT: POPCNT. (line 6) 22294 * POPPAR: POPPAR. (line 6) 22295 * positive difference: DIM. (line 6) 22296 * PRECISION: PRECISION. (line 6) 22297 * Preprocessing: Preprocessing Options. 22298 (line 6) 22299 * preprocessing, assertion: Preprocessing Options. 22300 (line 145) 22301 * preprocessing, assertion <1>: Preprocessing Options. 22302 (line 151) 22303 * preprocessing, define macros: Preprocessing Options. 22304 (line 183) 22305 * preprocessing, define macros <1>: Preprocessing Options. 22306 (line 186) 22307 * preprocessing, include path: Preprocessing Options. 22308 (line 101) 22309 * preprocessing, include path <1>: Preprocessing Options. 22310 (line 108) 22311 * preprocessing, include path <2>: Preprocessing Options. 22312 (line 112) 22313 * preprocessing, include path <3>: Preprocessing Options. 22314 (line 117) 22315 * preprocessing, include path <4>: Preprocessing Options. 22316 (line 121) 22317 * preprocessing, include path <5>: Preprocessing Options. 22318 (line 128) 22319 * preprocessing, keep comments: Preprocessing Options. 22320 (line 154) 22321 * preprocessing, keep comments <1>: Preprocessing Options. 22322 (line 169) 22323 * preprocessing, no linemarkers: Preprocessing Options. 22324 (line 211) 22325 * preprocessing, undefine macros: Preprocessing Options. 22326 (line 217) 22327 * preprocessor: Preprocessing Options. 22328 (line 6) 22329 * preprocessor, debugging: Preprocessing Options. 22330 (line 58) 22331 * preprocessor, debugging <1>: Preprocessing Options. 22332 (line 67) 22333 * preprocessor, debugging <2>: Preprocessing Options. 22334 (line 73) 22335 * preprocessor, debugging <3>: Preprocessing Options. 22336 (line 76) 22337 * preprocessor, debugging <4>: Preprocessing Options. 22338 (line 83) 22339 * preprocessor, disable: Preprocessing Options. 22340 (line 44) 22341 * preprocessor, enable: Preprocessing Options. 22342 (line 44) 22343 * preprocessor, include file handling: Preprocessing Options. 22344 (line 6) 22345 * preprocessor, working directory: Preprocessing Options. 22346 (line 87) 22347 * PRESENT: PRESENT. (line 6) 22348 * private: Fortran Dialect Options. 22349 (line 123) 22350 * procedure interoperability with C: Interoperable Subroutines and Functions. 22351 (line 6) 22352 * procedure pointer, convert C to Fortran: C_LOC. (line 6) 22353 * process ID: GETPID. (line 6) 22354 * PRODUCT: PRODUCT. (line 6) 22355 * product, double-precision: DPROD. (line 6) 22356 * product, matrix: MATMUL. (line 6) 22357 * product, vector: DOT_PRODUCT. (line 6) 22358 * program termination: EXIT. (line 6) 22359 * program termination, with core dump: ABORT. (line 6) 22360 * Q edit descriptor: Q edit descriptor. (line 6) 22361 * Q exponent-letter: Q exponent-letter. (line 6) 22362 * RADIX: RADIX. (line 6) 22363 * radix, real: SELECTED_REAL_KIND. (line 6) 22364 * RAN: RAN. (line 6) 22365 * RAND: RAND. (line 6) 22366 * random number generation: IRAND. (line 6) 22367 * random number generation <1>: RAN. (line 6) 22368 * random number generation <2>: RAND. (line 6) 22369 * random number generation <3>: RANDOM_NUMBER. (line 6) 22370 * random number generation, initialization: RANDOM_INIT. (line 6) 22371 * random number generation, seeding: RANDOM_SEED. (line 6) 22372 * random number generation, seeding <1>: SRAND. (line 6) 22373 * RANDOM_INIT: RANDOM_INIT. (line 6) 22374 * RANDOM_NUMBER: RANDOM_NUMBER. (line 6) 22375 * RANDOM_SEED: RANDOM_SEED. (line 6) 22376 * RANGE: RANGE. (line 6) 22377 * range checking: Code Gen Options. (line 144) 22378 * RANK: RANK. (line 6) 22379 * rank: RANK. (line 6) 22380 * re-association of parenthesized expressions: Code Gen Options. 22381 (line 420) 22382 * read character, stream mode: FGET. (line 6) 22383 * read character, stream mode <1>: FGETC. (line 6) 22384 * READONLY: Extended I/O specifiers. 22385 (line 6) 22386 * REAL: REAL. (line 6) 22387 * real kind: SELECTED_REAL_KIND. (line 6) 22388 * real number, exponent: EXPONENT. (line 6) 22389 * real number, fraction: FRACTION. (line 6) 22390 * real number, nearest different: NEAREST. (line 6) 22391 * real number, relative spacing: RRSPACING. (line 6) 22392 * real number, relative spacing <1>: SPACING. (line 6) 22393 * real number, scale: SCALE. (line 6) 22394 * real number, set exponent: SET_EXPONENT. (line 6) 22395 * Reallocate the LHS in assignments: Code Gen Options. (line 429) 22396 * Reallocate the LHS in assignments, notification: Error and Warning Options. 22397 (line 239) 22398 * REALPART: REAL. (line 6) 22399 * RECORD: STRUCTURE and RECORD. 22400 (line 6) 22401 * record marker: File format of unformatted sequential files. 22402 (line 6) 22403 * Reduction, XOR: PARITY. (line 6) 22404 * remainder: MOD. (line 6) 22405 * RENAME: RENAME. (line 6) 22406 * repacking arrays: Code Gen Options. (line 288) 22407 * REPEAT: REPEAT. (line 6) 22408 * RESHAPE: RESHAPE. (line 6) 22409 * REWIND: Read/Write after EOF marker. 22410 (line 6) 22411 * right shift, combined: DSHIFTR. (line 6) 22412 * root: SQRT. (line 6) 22413 * rounding, ceiling: ANINT. (line 6) 22414 * rounding, ceiling <1>: CEILING. (line 6) 22415 * rounding, floor: AINT. (line 6) 22416 * rounding, floor <1>: FLOOR. (line 6) 22417 * rounding, nearest whole number: NINT. (line 6) 22418 * RRSPACING: RRSPACING. (line 6) 22419 * RSHIFT: RSHIFT. (line 6) 22420 * run-time checking: Code Gen Options. (line 144) 22421 * SAME_TYPE_AS: SAME_TYPE_AS. (line 6) 22422 * SAVE statement: Code Gen Options. (line 15) 22423 * SCALE: SCALE. (line 6) 22424 * SCAN: SCAN. (line 6) 22425 * search path: Directory Options. (line 6) 22426 * search paths, for included files: Directory Options. (line 14) 22427 * SECNDS: SECNDS. (line 6) 22428 * SECOND: SECOND. (line 6) 22429 * seeding a random number generator: RANDOM_SEED. (line 6) 22430 * seeding a random number generator <1>: SRAND. (line 6) 22431 * SELECTED_CHAR_KIND: SELECTED_CHAR_KIND. (line 6) 22432 * SELECTED_INT_KIND: SELECTED_INT_KIND. (line 6) 22433 * SELECTED_REAL_KIND: SELECTED_REAL_KIND. (line 6) 22434 * sequential, unformatted: File format of unformatted sequential files. 22435 (line 6) 22436 * SET_EXPONENT: SET_EXPONENT. (line 6) 22437 * SHAPE: SHAPE. (line 6) 22438 * SHARE: Extended I/O specifiers. 22439 (line 6) 22440 * SHARED: Extended I/O specifiers. 22441 (line 6) 22442 * shift, left: DSHIFTL. (line 6) 22443 * shift, left <1>: SHIFTL. (line 6) 22444 * shift, right: DSHIFTR. (line 6) 22445 * shift, right <1>: SHIFTR. (line 6) 22446 * shift, right with fill: SHIFTA. (line 6) 22447 * SHIFTA: SHIFTA. (line 6) 22448 * SHIFTL: SHIFTL. (line 6) 22449 * SHIFTR: SHIFTR. (line 6) 22450 * SIGN: SIGN. (line 6) 22451 * sign copying: SIGN. (line 6) 22452 * SIGNAL: SIGNAL. (line 6) 22453 * SIN: SIN. (line 6) 22454 * SIND: SIND. (line 6) 22455 * sine: SIN. (line 6) 22456 * sine, degrees: SIND. (line 6) 22457 * sine, hyperbolic: SINH. (line 6) 22458 * sine, hyperbolic, inverse: ASINH. (line 6) 22459 * sine, inverse: ASIN. (line 6) 22460 * sine, inverse, degrees: ASIND. (line 6) 22461 * SINH: SINH. (line 6) 22462 * SIZE: SIZE. (line 6) 22463 * size of a variable, in bits: BIT_SIZE. (line 6) 22464 * size of an expression: C_SIZEOF. (line 6) 22465 * size of an expression <1>: SIZEOF. (line 6) 22466 * SIZEOF: SIZEOF. (line 6) 22467 * SLEEP: SLEEP. (line 6) 22468 * SNGL: REAL. (line 6) 22469 * SPACING: SPACING. (line 6) 22470 * SPREAD: SPREAD. (line 6) 22471 * SQRT: SQRT. (line 6) 22472 * square-root: SQRT. (line 6) 22473 * SRAND: SRAND. (line 6) 22474 * Standards: Standards. (line 6) 22475 * STAT: STAT. (line 6) 22476 * statement, SAVE: Code Gen Options. (line 15) 22477 * STATIC: AUTOMATIC and STATIC attributes. 22478 (line 6) 22479 * storage size: STORAGE_SIZE. (line 6) 22480 * STORAGE_SIZE: STORAGE_SIZE. (line 6) 22481 * stream mode, read character: FGET. (line 6) 22482 * stream mode, read character <1>: FGETC. (line 6) 22483 * stream mode, write character: FPUT. (line 6) 22484 * stream mode, write character <1>: FPUTC. (line 6) 22485 * string, adjust left: ADJUSTL. (line 6) 22486 * string, adjust right: ADJUSTR. (line 6) 22487 * string, comparison: LGE. (line 6) 22488 * string, comparison <1>: LGT. (line 6) 22489 * string, comparison <2>: LLE. (line 6) 22490 * string, comparison <3>: LLT. (line 6) 22491 * string, concatenate: REPEAT. (line 6) 22492 * string, find missing set: VERIFY. (line 6) 22493 * string, find non-blank character: LNBLNK. (line 6) 22494 * string, find subset: SCAN. (line 6) 22495 * string, find substring: INDEX intrinsic. (line 6) 22496 * string, length: LEN. (line 6) 22497 * string, length, without trailing whitespace: LEN_TRIM. (line 6) 22498 * string, remove trailing whitespace: TRIM. (line 6) 22499 * string, repeat: REPEAT. (line 6) 22500 * strings, varying length: Fortran 95 status. (line 6) 22501 * STRUCTURE: STRUCTURE and RECORD. 22502 (line 6) 22503 * structure packing: Code Gen Options. (line 282) 22504 * subrecord: File format of unformatted sequential files. 22505 (line 6) 22506 * subroutine interoperability with C: Interoperable Subroutines and Functions. 22507 (line 6) 22508 * subscript checking: Code Gen Options. (line 144) 22509 * substring position: INDEX intrinsic. (line 6) 22510 * SUM: SUM. (line 6) 22511 * sum array elements: SUM. (line 6) 22512 * suppressing warnings: Error and Warning Options. 22513 (line 6) 22514 * symbol names: Fortran Dialect Options. 22515 (line 105) 22516 * symbol names, transforming: Code Gen Options. (line 57) 22517 * symbol names, transforming <1>: Code Gen Options. (line 113) 22518 * symbol names, underscores: Code Gen Options. (line 57) 22519 * symbol names, underscores <1>: Code Gen Options. (line 113) 22520 * SYMLNK: SYMLNK. (line 6) 22521 * syntax checking: Error and Warning Options. 22522 (line 33) 22523 * SYSTEM: SYSTEM. (line 6) 22524 * system, error handling: GERROR. (line 6) 22525 * system, error handling <1>: IERRNO. (line 6) 22526 * system, error handling <2>: PERROR. (line 6) 22527 * system, group ID: GETGID. (line 6) 22528 * system, host name: HOSTNM. (line 6) 22529 * system, login name: GETLOG. (line 6) 22530 * system, process ID: GETPID. (line 6) 22531 * system, signal handling: SIGNAL. (line 6) 22532 * system, system call: EXECUTE_COMMAND_LINE. 22533 (line 6) 22534 * system, system call <1>: SYSTEM. (line 6) 22535 * system, terminal: ISATTY. (line 6) 22536 * system, terminal <1>: TTYNAM. (line 6) 22537 * system, user ID: GETUID. (line 6) 22538 * system, working directory: CHDIR. (line 6) 22539 * system, working directory <1>: GETCWD. (line 6) 22540 * SYSTEM_CLOCK: SYSTEM_CLOCK. (line 6) 22541 * tabulators: Error and Warning Options. 22542 (line 188) 22543 * TAN: TAN. (line 6) 22544 * TAND: TAND. (line 6) 22545 * tangent: TAN. (line 6) 22546 * tangent, degrees: TAND. (line 6) 22547 * tangent, hyperbolic: TANH. (line 6) 22548 * tangent, hyperbolic, inverse: ATANH. (line 6) 22549 * tangent, inverse: ATAN. (line 6) 22550 * tangent, inverse <1>: ATAN2. (line 6) 22551 * tangent, inverse, degrees: ATAND. (line 6) 22552 * tangent, inverse, degrees <1>: ATAN2D. (line 6) 22553 * TANH: TANH. (line 6) 22554 * terminate program: EXIT. (line 6) 22555 * terminate program, with core dump: ABORT. (line 6) 22556 * THIS_IMAGE: THIS_IMAGE. (line 6) 22557 * thread-safety, threads: Thread-safety of the runtime library. 22558 (line 6) 22559 * TIME: TIME. (line 6) 22560 * time, clock ticks: MCLOCK. (line 6) 22561 * time, clock ticks <1>: MCLOCK8. (line 6) 22562 * time, clock ticks <2>: SYSTEM_CLOCK. (line 6) 22563 * time, conversion to GMT info: GMTIME. (line 6) 22564 * time, conversion to local time info: LTIME. (line 6) 22565 * time, conversion to string: CTIME. (line 6) 22566 * time, current: DATE_AND_TIME. (line 6) 22567 * time, current <1>: FDATE. (line 6) 22568 * time, current <2>: ITIME. (line 6) 22569 * time, current <3>: TIME. (line 6) 22570 * time, current <4>: TIME8. (line 6) 22571 * time, elapsed: CPU_TIME. (line 6) 22572 * time, elapsed <1>: DTIME. (line 6) 22573 * time, elapsed <2>: ETIME. (line 6) 22574 * time, elapsed <3>: SECNDS. (line 6) 22575 * time, elapsed <4>: SECOND. (line 6) 22576 * TIME8: TIME8. (line 6) 22577 * TINY: TINY. (line 6) 22578 * trace: Debugging Options. (line 94) 22579 * TRAILZ: TRAILZ. (line 6) 22580 * TRANSFER: TRANSFER. (line 6) 22581 * transforming symbol names: Code Gen Options. (line 57) 22582 * transforming symbol names <1>: Code Gen Options. (line 113) 22583 * TRANSPOSE: TRANSPOSE. (line 6) 22584 * transpose: TRANSPOSE. (line 6) 22585 * trigonometric function, cosine: COS. (line 6) 22586 * trigonometric function, cosine, degrees: COSD. (line 6) 22587 * trigonometric function, cosine, inverse: ACOS. (line 6) 22588 * trigonometric function, cosine, inverse, degrees: ACOSD. (line 6) 22589 * trigonometric function, cotangent: COTAN. (line 6) 22590 * trigonometric function, cotangent, degrees: COTAND. (line 6) 22591 * trigonometric function, sine: SIN. (line 6) 22592 * trigonometric function, sine, degrees: SIND. (line 6) 22593 * trigonometric function, sine, inverse: ASIN. (line 6) 22594 * trigonometric function, sine, inverse, degrees: ASIND. (line 6) 22595 * trigonometric function, tangent: TAN. (line 6) 22596 * trigonometric function, tangent, degrees: TAND. (line 6) 22597 * trigonometric function, tangent, inverse: ATAN. (line 6) 22598 * trigonometric function, tangent, inverse <1>: ATAN2. (line 6) 22599 * trigonometric function, tangent, inverse, degrees: ATAND. (line 6) 22600 * trigonometric function, tangent, inverse, degrees <1>: ATAN2D. 22601 (line 6) 22602 * TRIM: TRIM. (line 6) 22603 * TS 29113: Further Interoperability of Fortran with C. 22604 (line 6) 22605 * TTYNAM: TTYNAM. (line 6) 22606 * type alias print: TYPE as an alias for PRINT. 22607 (line 6) 22608 * type cast: TRANSFER. (line 6) 22609 * UBOUND: UBOUND. (line 6) 22610 * UCOBOUND: UCOBOUND. (line 6) 22611 * UMASK: UMASK. (line 6) 22612 * underflow: Error and Warning Options. 22613 (line 201) 22614 * underscore: Code Gen Options. (line 57) 22615 * underscore <1>: Code Gen Options. (line 113) 22616 * unformatted sequential: File format of unformatted sequential files. 22617 (line 6) 22618 * UNION: UNION and MAP. (line 6) 22619 * UNLINK: UNLINK. (line 6) 22620 * UNPACK: UNPACK. (line 6) 22621 * unused dummy argument: Error and Warning Options. 22622 (line 217) 22623 * unused parameter: Error and Warning Options. 22624 (line 221) 22625 * user id: GETUID. (line 6) 22626 * variable attributes: AUTOMATIC and STATIC attributes. 22627 (line 6) 22628 * variable interoperability with C: Interoperable Global Variables. 22629 (line 6) 22630 * Varying length strings: Fortran 95 status. (line 6) 22631 * vector product: DOT_PRODUCT. (line 6) 22632 * VERIFY: VERIFY. (line 6) 22633 * version of the compiler: COMPILER_VERSION. (line 6) 22634 * VOLATILE: Volatile COMMON blocks. 22635 (line 6) 22636 * warning, C binding type: Error and Warning Options. 22637 (line 101) 22638 * warnings, aliasing: Error and Warning Options. 22639 (line 71) 22640 * warnings, alignment of COMMON blocks: Error and Warning Options. 22641 (line 228) 22642 * warnings, all: Error and Warning Options. 22643 (line 62) 22644 * warnings, ampersand: Error and Warning Options. 22645 (line 88) 22646 * warnings, array temporaries: Error and Warning Options. 22647 (line 96) 22648 * warnings, character truncation: Error and Warning Options. 22649 (line 108) 22650 * warnings, conversion: Error and Warning Options. 22651 (line 117) 22652 * warnings, conversion <1>: Error and Warning Options. 22653 (line 121) 22654 * warnings, division of integers: Error and Warning Options. 22655 (line 144) 22656 * warnings, extra: Error and Warning Options. 22657 (line 125) 22658 * warnings, function elimination: Error and Warning Options. 22659 (line 234) 22660 * warnings, implicit interface: Error and Warning Options. 22661 (line 134) 22662 * warnings, implicit procedure: Error and Warning Options. 22663 (line 140) 22664 * warnings, integer division: Error and Warning Options. 22665 (line 144) 22666 * warnings, intrinsic: Error and Warning Options. 22667 (line 206) 22668 * warnings, intrinsics of other standards: Error and Warning Options. 22669 (line 148) 22670 * warnings, line truncation: Error and Warning Options. 22671 (line 111) 22672 * warnings, loop interchange: Error and Warning Options. 22673 (line 130) 22674 * warnings, non-standard intrinsics: Error and Warning Options. 22675 (line 148) 22676 * warnings, overwrite recursive: Error and Warning Options. 22677 (line 155) 22678 * warnings, q exponent-letter: Error and Warning Options. 22679 (line 162) 22680 * warnings, suppressing: Error and Warning Options. 22681 (line 6) 22682 * warnings, suspicious code: Error and Warning Options. 22683 (line 166) 22684 * warnings, tabs: Error and Warning Options. 22685 (line 188) 22686 * warnings, to errors: Error and Warning Options. 22687 (line 280) 22688 * warnings, undefined do loop: Error and Warning Options. 22689 (line 196) 22690 * warnings, underflow: Error and Warning Options. 22691 (line 201) 22692 * warnings, unused dummy argument: Error and Warning Options. 22693 (line 217) 22694 * warnings, unused parameter: Error and Warning Options. 22695 (line 221) 22696 * warnings, use statements: Error and Warning Options. 22697 (line 213) 22698 * write character, stream mode: FPUT. (line 6) 22699 * write character, stream mode <1>: FPUTC. (line 6) 22700 * XOR: XOR. (line 6) 22701 * XOR reduction: PARITY. (line 6) 22702 * ZABS: ABS. (line 6) 22703 * ZCOS: COS. (line 6) 22704 * ZCOSD: COSD. (line 6) 22705 * zero bits: LEADZ. (line 6) 22706 * zero bits <1>: TRAILZ. (line 6) 22707 * ZEXP: EXP. (line 6) 22708 * ZLOG: LOG. (line 6) 22709 * ZSIN: SIN. (line 6) 22710 * ZSIND: SIND. (line 6) 22711 * ZSQRT: SQRT. (line 6) 22712 22713 22714 22715 Tag Table: 22716 Node: Top1950 22717 Node: Introduction3270 22718 Node: About GNU Fortran3617 22719 Node: GNU Fortran and GCC8606 22720 Node: Standards10683 22721 Node: Fortran 95 status12483 22722 Node: Fortran 2003 status13491 22723 Node: Fortran 2008 status13941 22724 Node: Fortran 2018 status14599 22725 Node: Invoking GNU Fortran16202 22726 Node: Option Summary18036 22727 Node: Fortran Dialect Options22230 22728 Node: Preprocessing Options36969 22729 Node: Error and Warning Options46967 22730 Node: Debugging Options58897 22731 Node: Directory Options64100 22732 Node: Link Options65535 22733 Node: Runtime Options66161 22734 Node: Code Gen Options68417 22735 Node: Interoperability Options89538 22736 Node: Environment Variables91613 22737 Node: Runtime92226 22738 Node: TMPDIR93397 22739 Node: GFORTRAN_STDIN_UNIT94067 22740 Node: GFORTRAN_STDOUT_UNIT94449 22741 Node: GFORTRAN_STDERR_UNIT94850 22742 Node: GFORTRAN_UNBUFFERED_ALL95252 22743 Node: GFORTRAN_UNBUFFERED_PRECONNECTED95783 22744 Node: GFORTRAN_SHOW_LOCUS96427 22745 Node: GFORTRAN_OPTIONAL_PLUS96923 22746 Node: GFORTRAN_LIST_SEPARATOR97401 22747 Node: GFORTRAN_CONVERT_UNIT98009 22748 Node: GFORTRAN_ERROR_BACKTRACE101294 22749 Node: GFORTRAN_FORMATTED_BUFFER_SIZE101890 22750 Node: GFORTRAN_UNFORMATTED_BUFFER_SIZE102338 22751 Node: Compiler Characteristics102767 22752 Node: KIND Type Parameters103533 22753 Node: Internal representation of LOGICAL variables104961 22754 Node: Evaluation of logical expressions105818 22755 Node: MAX and MIN intrinsics with REAL NaN arguments106669 22756 Node: Thread-safety of the runtime library107490 22757 Node: Data consistency and durability109895 22758 Node: Files opened without an explicit ACTION= specifier113008 22759 Node: File operations on symbolic links113699 22760 Node: File format of unformatted sequential files114819 22761 Node: Asynchronous I/O117193 22762 Node: Extensions117893 22763 Node: Extensions implemented in GNU Fortran118498 22764 Node: Old-style kind specifications120472 22765 Node: Old-style variable initialization121574 22766 Node: Extensions to namelist122886 22767 Node: X format descriptor without count field125189 22768 Node: Commas in FORMAT specifications125716 22769 Node: Missing period in FORMAT specifications126467 22770 Node: Default widths for F, G and I format descriptors127063 22771 Node: I/O item lists127768 22772 Node: Q exponent-letter128162 22773 Node: BOZ literal constants128760 22774 Node: Real array indices130337 22775 Node: Unary operators130636 22776 Node: Implicitly convert LOGICAL and INTEGER values131050 22777 Node: Hollerith constants support132009 22778 Node: Character conversion134233 22779 Node: Cray pointers135127 22780 Node: CONVERT specifier140628 22781 Node: OpenMP142943 22782 Node: OpenACC145202 22783 Node: Argument list functions146343 22784 Node: Read/Write after EOF marker147986 22785 Node: STRUCTURE and RECORD148589 22786 Node: UNION and MAP153676 22787 Node: Type variants for integer intrinsics156644 22788 Node: AUTOMATIC and STATIC attributes158539 22789 Node: Extended math intrinsics160073 22790 Node: Form feed as whitespace161869 22791 Node: TYPE as an alias for PRINT162415 22792 Node: %LOC as an rvalue162880 22793 Node: .XOR. operator163527 22794 Node: Bitwise logical operators163927 22795 Node: Extended I/O specifiers165428 22796 Node: Legacy PARAMETER statements169148 22797 Node: Default exponents169753 22798 Node: Extensions not implemented in GNU Fortran170105 22799 Node: ENCODE and DECODE statements171072 22800 Node: Variable FORMAT expressions172403 22801 Node: Alternate complex function syntax173508 22802 Node: Volatile COMMON blocks174058 22803 Node: OPEN( ... NAME=)174560 22804 Node: Q edit descriptor174988 22805 Node: Mixed-Language Programming175940 22806 Node: Interoperability with C177173 22807 Node: Intrinsic Types178508 22808 Node: Derived Types and struct179529 22809 Node: Interoperable Global Variables180871 22810 Node: Interoperable Subroutines and Functions182146 22811 Node: Working with C Pointers185637 22812 Node: Further Interoperability of Fortran with C190302 22813 Node: GNU Fortran Compiler Directives191646 22814 Node: ATTRIBUTES directive192022 22815 Node: UNROLL directive195393 22816 Node: BUILTIN directive195926 22817 Node: IVDEP directive196768 22818 Node: VECTOR directive197587 22819 Node: NOVECTOR directive197985 22820 Node: Non-Fortran Main Program198370 22821 Node: _gfortran_set_args200558 22822 Node: _gfortran_set_options201496 22823 Node: _gfortran_set_convert205164 22824 Node: _gfortran_set_record_marker206032 22825 Node: _gfortran_set_fpe206842 22826 Node: _gfortran_set_max_subrecord_length208040 22827 Node: Naming and argument-passing conventions208963 22828 Node: Naming conventions209682 22829 Node: Argument passing conventions211154 22830 Node: Coarray Programming216458 22831 Node: Type and enum ABI Documentation216705 22832 Node: caf_token_t217003 22833 Node: caf_register_t217239 22834 Node: caf_deregister_t218450 22835 Node: caf_reference_t218952 22836 Node: caf_team_t223277 22837 Node: Function ABI Documentation223576 22838 Node: _gfortran_caf_init226026 22839 Node: _gfortran_caf_finish227452 22840 Node: _gfortran_caf_this_image228391 22841 Node: _gfortran_caf_num_images229146 22842 Node: _gfortran_caf_image_status230257 22843 Node: _gfortran_caf_failed_images231377 22844 Node: _gfortran_caf_stopped_images232547 22845 Node: _gfortran_caf_register233720 22846 Node: _gfortran_caf_deregister237901 22847 Node: _gfortran_caf_is_present239507 22848 Node: _gfortran_caf_send240586 22849 Node: _gfortran_caf_get243776 22850 Node: _gfortran_caf_sendget246857 22851 Node: _gfortran_caf_send_by_ref250768 22852 Node: _gfortran_caf_get_by_ref254377 22853 Node: _gfortran_caf_sendget_by_ref257896 22854 Node: _gfortran_caf_lock262192 22855 Node: _gfortran_caf_unlock263981 22856 Node: _gfortran_caf_event_post265462 22857 Node: _gfortran_caf_event_wait266911 22858 Node: _gfortran_caf_event_query269018 22859 Node: _gfortran_caf_sync_all270349 22860 Node: _gfortran_caf_sync_images271277 22861 Node: _gfortran_caf_sync_memory272812 22862 Node: _gfortran_caf_error_stop273804 22863 Node: _gfortran_caf_error_stop_str274408 22864 Node: _gfortran_caf_fail_image275113 22865 Node: _gfortran_caf_atomic_define275649 22866 Node: _gfortran_caf_atomic_ref276964 22867 Node: _gfortran_caf_atomic_cas278268 22868 Node: _gfortran_caf_atomic_op280029 22869 Node: _gfortran_caf_co_broadcast282131 22870 Node: _gfortran_caf_co_max283236 22871 Node: _gfortran_caf_co_min284862 22872 Node: _gfortran_caf_co_sum286482 22873 Node: _gfortran_caf_co_reduce288022 22874 Node: Intrinsic Procedures290666 22875 Node: Introduction to Intrinsics307871 22876 Node: ABORT310065 22877 Node: ABS310810 22878 Node: ACCESS312534 22879 Node: ACHAR314435 22880 Node: ACOS315639 22881 Node: ACOSD316913 22882 Node: ACOSH318313 22883 Node: ADJUSTL319394 22884 Node: ADJUSTR320336 22885 Node: AIMAG321286 22886 Node: AINT322736 22887 Node: ALARM324330 22888 Node: ALL325962 22889 Node: ALLOCATED327886 22890 Node: AND329025 22891 Node: ANINT330760 22892 Node: ANY332245 22893 Node: ASIN334171 22894 Node: ASIND335434 22895 Node: ASINH336820 22896 Node: ASSOCIATED337911 22897 Node: ATAN340922 22898 Node: ATAND342383 22899 Node: ATAN2343974 22900 Node: ATAN2D345828 22901 Node: ATANH347854 22902 Node: ATOMIC_ADD348945 22903 Node: ATOMIC_AND350479 22904 Node: ATOMIC_CAS352067 22905 Node: ATOMIC_DEFINE353926 22906 Node: ATOMIC_FETCH_ADD355645 22907 Node: ATOMIC_FETCH_AND357447 22908 Node: ATOMIC_FETCH_OR359237 22909 Node: ATOMIC_FETCH_XOR361014 22910 Node: ATOMIC_OR362797 22911 Node: ATOMIC_REF364382 22912 Node: ATOMIC_XOR366278 22913 Node: BACKTRACE367863 22914 Node: BESSEL_J0368443 22915 Node: BESSEL_J1369544 22916 Node: BESSEL_JN370646 22917 Node: BESSEL_Y0372551 22918 Node: BESSEL_Y1373591 22919 Node: BESSEL_YN374631 22920 Node: BGE376547 22921 Node: BGT377239 22922 Node: BIT_SIZE377889 22923 Node: BLE378711 22924 Node: BLT379393 22925 Node: BTEST380031 22926 Node: C_ASSOCIATED381476 22927 Node: C_F_POINTER382687 22928 Node: C_F_PROCPOINTER384122 22929 Node: C_FUNLOC385629 22930 Node: C_LOC387000 22931 Node: C_SIZEOF388279 22932 Node: CEILING389687 22933 Node: CHAR390695 22934 Node: CHDIR391999 22935 Node: CHMOD393173 22936 Node: CMPLX395088 22937 Node: CO_BROADCAST396531 22938 Node: CO_MAX398343 22939 Node: CO_MIN400241 22940 Node: CO_REDUCE402125 22941 Node: CO_SUM405691 22942 Node: COMMAND_ARGUMENT_COUNT407662 22943 Node: COMPILER_OPTIONS408579 22944 Node: COMPILER_VERSION409604 22945 Node: COMPLEX410567 22946 Node: CONJG411706 22947 Node: COS412762 22948 Node: COSD414118 22949 Node: COSH415595 22950 Node: COTAN416766 22951 Node: COTAND417993 22952 Node: COUNT419260 22953 Node: CPU_TIME421285 22954 Node: CSHIFT422642 22955 Node: CTIME424302 22956 Node: DATE_AND_TIME425810 22957 Node: DBLE428026 22958 Node: DCMPLX428821 22959 Node: DIGITS430003 22960 Node: DIM430970 22961 Node: DOT_PRODUCT432378 22962 Node: DPROD434021 22963 Node: DREAL434983 22964 Node: DSHIFTL435649 22965 Node: DSHIFTR436982 22966 Node: DTIME438316 22967 Node: EOSHIFT441022 22968 Node: EPSILON443095 22969 Node: ERF443822 22970 Node: ERFC444688 22971 Node: ERFC_SCALED445583 22972 Node: ETIME446276 22973 Node: EVENT_QUERY448446 22974 Node: EXECUTE_COMMAND_LINE450035 22975 Node: EXIT452815 22976 Node: EXP453693 22977 Node: EXPONENT454847 22978 Node: EXTENDS_TYPE_OF455611 22979 Node: FDATE456469 22980 Node: FGET457955 22981 Node: FGETC459782 22982 Node: FINDLOC461592 22983 Node: FLOOR464186 22984 Node: FLUSH465177 22985 Node: FNUM467056 22986 Node: FPUT467781 22987 Node: FPUTC469415 22988 Node: FRACTION471196 22989 Node: FREE472100 22990 Node: FSEEK472943 22991 Node: FSTAT475249 22992 Node: FTELL476335 22993 Node: GAMMA477317 22994 Node: GERROR478392 22995 Node: GETARG479140 22996 Node: GET_COMMAND480864 22997 Node: GET_COMMAND_ARGUMENT482238 22998 Node: GETCWD484285 22999 Node: GETENV485265 23000 Node: GET_ENVIRONMENT_VARIABLE486697 23001 Node: GETGID488860 23002 Node: GETLOG489397 23003 Node: GETPID490255 23004 Node: GETUID490985 23005 Node: GMTIME491501 23006 Node: HOSTNM493261 23007 Node: HUGE494182 23008 Node: HYPOT494904 23009 Node: IACHAR495730 23010 Node: IALL496898 23011 Node: IAND498383 23012 Node: IANY500120 23013 Node: IARGC501614 23014 Node: IBCLR502633 23015 Node: IBITS503836 23016 Node: IBSET505295 23017 Node: ICHAR506493 23018 Node: IDATE508698 23019 Node: IEOR509998 23020 Node: IERRNO511628 23021 Node: IMAGE_INDEX512176 23022 Node: INDEX intrinsic513198 23023 Node: INT514814 23024 Node: INT2516596 23025 Node: INT8517297 23026 Node: IOR517998 23027 Node: IPARITY519604 23028 Node: IRAND521152 23029 Node: IS_CONTIGUOUS522511 23030 Node: IS_IOSTAT_END523677 23031 Node: IS_IOSTAT_EOR524784 23032 Node: ISATTY525913 23033 Node: ISHFT526696 23034 Node: ISHFTC528220 23035 Node: ISNAN529982 23036 Node: ITIME530749 23037 Node: KILL532047 23038 Node: KIND533183 23039 Node: LBOUND534081 23040 Node: LCOBOUND535419 23041 Node: LEADZ536554 23042 Node: LEN537415 23043 Node: LEN_TRIM538746 23044 Node: LGE539734 23045 Node: LGT541337 23046 Node: LINK542905 23047 Node: LLE543944 23048 Node: LLT545534 23049 Node: LNBLNK547095 23050 Node: LOC547873 23051 Node: LOG548605 23052 Node: LOG10550041 23053 Node: LOG_GAMMA551019 23054 Node: LOGICAL552212 23055 Node: LSHIFT553026 23056 Node: LSTAT554138 23057 Node: LTIME555337 23058 Node: MALLOC557019 23059 Node: MASKL558481 23060 Node: MASKR559248 23061 Node: MATMUL560018 23062 Node: MAX561178 23063 Node: MAXEXPONENT562560 23064 Node: MAXLOC563377 23065 Node: MAXVAL565985 23066 Node: MCLOCK567627 23067 Node: MCLOCK8568650 23068 Node: MERGE569880 23069 Node: MERGE_BITS570632 23070 Node: MIN571671 23071 Node: MINEXPONENT573056 23072 Node: MINLOC573687 23073 Node: MINVAL576326 23074 Node: MOD577970 23075 Node: MODULO580155 23076 Node: MOVE_ALLOC581620 23077 Node: MVBITS582653 23078 Node: NEAREST584260 23079 Node: NEW_LINE585360 23080 Node: NINT586133 23081 Node: NORM2587542 23082 Node: NOT588681 23083 Node: NULL589806 23084 Node: NUM_IMAGES590714 23085 Node: OR592415 23086 Node: PACK594138 23087 Node: PARITY596182 23088 Node: PERROR597403 23089 Node: POPCNT598028 23090 Node: POPPAR598899 23091 Node: PRECISION599952 23092 Node: PRESENT600884 23093 Node: PRODUCT601996 23094 Node: RADIX603530 23095 Node: RAN604341 23096 Node: RAND604797 23097 Node: RANDOM_INIT606130 23098 Node: RANDOM_NUMBER608201 23099 Node: RANDOM_SEED609453 23100 Node: RANGE611923 23101 Node: RANK612603 23102 Node: REAL613384 23103 Node: RENAME615463 23104 Node: REPEAT616485 23105 Node: RESHAPE617213 23106 Node: RRSPACING618680 23107 Node: RSHIFT619373 23108 Node: SAME_TYPE_AS620541 23109 Node: SCALE621373 23110 Node: SCAN622154 23111 Node: SECNDS623712 23112 Node: SECOND624804 23113 Node: SELECTED_CHAR_KIND625680 23114 Node: SELECTED_INT_KIND627275 23115 Node: SELECTED_REAL_KIND628452 23116 Node: SET_EXPONENT631128 23117 Node: SHAPE632115 23118 Node: SHIFTA633539 23119 Node: SHIFTL634530 23120 Node: SHIFTR635390 23121 Node: SIGN636251 23122 Node: SIGNAL637542 23123 Node: SIN639048 23124 Node: SIND640213 23125 Node: SINH641570 23126 Node: SIZE642523 23127 Node: SIZEOF643842 23128 Node: SLEEP645497 23129 Node: SPACING646058 23130 Node: SPREAD647072 23131 Node: SQRT648223 23132 Node: SRAND649456 23133 Node: STAT650690 23134 Node: STORAGE_SIZE653857 23135 Node: SUM654736 23136 Node: SYMLNK656228 23137 Node: SYSTEM657363 23138 Node: SYSTEM_CLOCK658618 23139 Node: TAN661466 23140 Node: TAND662525 23141 Node: TANH663697 23142 Node: THIS_IMAGE664860 23143 Node: TIME667160 23144 Node: TIME8668331 23145 Node: TINY669530 23146 Node: TRAILZ670131 23147 Node: TRANSFER670949 23148 Node: TRANSPOSE672985 23149 Node: TRIM673675 23150 Node: TTYNAM674533 23151 Node: UBOUND675451 23152 Node: UCOBOUND676841 23153 Node: UMASK677978 23154 Node: UNLINK678660 23155 Node: UNPACK679640 23156 Node: VERIFY680935 23157 Node: XOR682664 23158 Node: Intrinsic Modules684474 23159 Node: ISO_FORTRAN_ENV684761 23160 Node: ISO_C_BINDING689162 23161 Node: IEEE modules693107 23162 Node: OpenMP Modules OMP_LIB and OMP_LIB_KINDS694248 23163 Node: OpenACC Module OPENACC698054 23164 Node: Contributing698980 23165 Node: Contributors699810 23166 Node: Projects701464 23167 Node: Copying702642 23168 Node: GNU Free Documentation License740190 23169 Node: Funding765316 23170 Node: Option Index767842 23171 Node: Keyword Index786903 23172 23173 End Tag Table 23174