2 Copyright (C) 2005, 2006
3 Free Software Foundation, Inc.
4 This is part of the GNU Fortran manual.
5 For copying conditions, see the file gfortran.texi.
7 Permission is granted to copy, distribute and/or modify this document
8 under the terms of the GNU Free Documentation License, Version 1.2 or
9 any later version published by the Free Software Foundation; with the
10 Invariant Sections being ``GNU General Public License'' and ``Funding
11 Free Software'', the Front-Cover texts being (a) (see below), and with
12 the Back-Cover Texts being (b) (see below). A copy of the license is
13 included in the gfdl(7) man page.
16 Some basic guidelines for editing this document:
18 (1) The intrinsic procedures are to be listed in alphabetical order.
19 (2) The generic name is to be use.
20 (3) The specific names are included in the function index and in a
21 table at the end of the node (See ABS entry).
22 (4) Try to maintain the same style for each entry.
28 \gdef\acos{\mathop{\rm acos}\nolimits}
29 \gdef\asin{\mathop{\rm asin}\nolimits}
30 \gdef\atan{\mathop{\rm atan}\nolimits}
31 \gdef\acosh{\mathop{\rm acosh}\nolimits}
32 \gdef\asinh{\mathop{\rm asinh}\nolimits}
33 \gdef\atanh{\mathop{\rm atanh}\nolimits}
37 @node Intrinsic Procedures
38 @chapter Intrinsic Procedures
39 @cindex Intrinsic Procedures
41 This portion of the document is incomplete and undergoing massive expansion
42 and editing. All contributions and corrections are strongly encouraged.
44 Implemented intrinsics are fully functional and available to the user to apply.
45 Some intrinsics have documentation yet to be completed as indicated by 'documentation pending'.
48 * Introduction: Introduction
49 * @code{ABORT}: ABORT, Abort the program
50 * @code{ABS}: ABS, Absolute value
51 * @code{ACCESS}: ACCESS, Checks file access method
52 * @code{ACHAR}: ACHAR, Character in @acronym{ASCII} collating sequence
53 * @code{ACOS}: ACOS, Arccosine function
54 * @code{ACOSH}: ACOSH, Hyperbolic arccosine function
55 * @code{ADJUSTL}: ADJUSTL, Left adjust a string
56 * @code{ADJUSTR}: ADJUSTR, Right adjust a string
57 * @code{AIMAG}: AIMAG, Imaginary part of complex number
58 * @code{AINT}: AINT, Truncate to a whole number
59 * @code{ALARM}: ALARM, Set an alarm clock
60 * @code{ALL}: ALL, Determine if all values are true
61 * @code{ALLOCATED}: ALLOCATED, Status of allocatable entity
62 * @code{AND}: AND, Bitwise logical AND
63 * @code{ANINT}: ANINT, Nearest whole number
64 * @code{ANY}: ANY, Determine if any values are true
65 * @code{ASIN}: ASIN, Arcsine function
66 * @code{ASINH}: ASINH, Hyperbolic arcsine function
67 * @code{ASSOCIATED}: ASSOCIATED, Status of a pointer or pointer/target pair
68 * @code{ATAN}: ATAN, Arctangent function
69 * @code{ATAN2}: ATAN2, Arctangent function
70 * @code{ATANH}: ATANH, Hyperbolic arctangent function
71 * @code{BESJ0}: BESJ0, Bessel function of the first kind of order 0
72 * @code{BESJ1}: BESJ1, Bessel function of the first kind of order 1
73 * @code{BESJN}: BESJN, Bessel function of the first kind
74 * @code{BESY0}: BESY0, Bessel function of the second kind of order 0
75 * @code{BESY1}: BESY1, Bessel function of the second kind of order 1
76 * @code{BESYN}: BESYN, Bessel function of the second kind
77 * @code{BIT_SIZE}: BIT_SIZE, Bit size inquiry function
78 * @code{BTEST}: BTEST, Bit test function
79 * @code{CEILING}: CEILING, Integer ceiling function
80 * @code{CHAR}: CHAR, Integer-to-character conversion function
81 * @code{CHDIR}: CHDIR, Change working directory
82 * @code{CHMOD}: CHMOD, Change access permissions of files
83 * @code{CMPLX}: CMPLX, Complex conversion function
84 * @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT, Command line argument count
85 * @code{CONJG}: CONJG, Complex conjugate function
86 * @code{COS}: COS, Cosine function
87 * @code{COSH}: COSH, Hyperbolic cosine function
88 * @code{COUNT}: COUNT, Count occurrences of TRUE in an array
89 * @code{CPU_TIME}: CPU_TIME, CPU time subroutine
90 * @code{CSHIFT}: CSHIFT, Circular array shift function
91 * @code{CTIME}: CTIME, Subroutine (or function) to convert a time into a string
92 * @code{DATE_AND_TIME}: DATE_AND_TIME, Date and time subroutine
93 * @code{DBLE}: DBLE, Double precision conversion function
94 * @code{DCMPLX}: DCMPLX, Double complex conversion function
95 * @code{DFLOAT}: DFLOAT, Double precision conversion function
96 * @code{DIGITS}: DIGITS, Significant digits function
97 * @code{DIM}: DIM, Dim function
98 * @code{DOT_PRODUCT}: DOT_PRODUCT, Dot product function
99 * @code{DPROD}: DPROD, Double product function
100 * @code{DREAL}: DREAL, Double real part function
101 * @code{DTIME}: DTIME, Execution time subroutine (or function)
102 * @code{EOSHIFT}: EOSHIFT, End-off shift function
103 * @code{EPSILON}: EPSILON, Epsilon function
104 * @code{ERF}: ERF, Error function
105 * @code{ERFC}: ERFC, Complementary error function
106 * @code{ETIME}: ETIME, Execution time subroutine (or function)
107 * @code{EXIT}: EXIT, Exit the program with status.
108 * @code{EXP}: EXP, Exponential function
109 * @code{EXPONENT}: EXPONENT, Exponent function
110 * @code{FDATE}: FDATE, Subroutine (or function) to get the current time as a string
111 * @code{FGET}: FGET, Read a single character in stream mode from stdin
112 * @code{FGETC}: FGETC, Read a single character in stream mode
113 * @code{FLOAT}: FLOAT, Convert integer to default real
114 * @code{FLOOR}: FLOOR, Integer floor function
115 * @code{FLUSH}: FLUSH, Flush I/O unit(s)
116 * @code{FNUM}: FNUM, File number function
117 * @code{FPUT}: FPUT, Write a single character in stream mode to stdout
118 * @code{FPUTC}: FPUTC, Write a single character in stream mode
119 * @code{FRACTION}: FRACTION, Fractional part of the model representation
120 * @code{FREE}: FREE, Memory de-allocation subroutine
121 * @code{FSEEK}: FSEEK, Low level file positioning subroutine
122 * @code{FSTAT}: FSTAT, Get file status
123 * @code{FTELL}: FTELL, Current stream position
124 * @code{GETARG}: GETARG, Get command line arguments
125 * @code{GET_COMMAND}: GET_COMMAND, Subroutine to retrieve the entire command line
126 * @code{GET_COMMAND_ARGUMENT}: GET_COMMAND_ARGUMENT, Subroutine to retrieve a command argument
127 * @code{GETCWD}: GETCWD, Get current working directory
128 * @code{GETENV}: GETENV, Get an environmental variable
129 * @code{GET_ENVIRONMENT_VARIABLE}: GET_ENVIRONMENT_VARIABLE, Get an environmental variable
130 * @code{GETGID}: GETGID, Group ID function
131 * @code{GETLOG}: GETLOG, Get login name
132 * @code{GETPID}: GETPID, Process ID function
133 * @code{GETUID}: GETUID, User ID function
134 * @code{GMTIME}: GMTIME, Convert time to GMT info
135 * @code{HOSTNM}: HOSTNM, Get system host name
136 * @code{HUGE}: HUGE, Largest number of a kind
137 * @code{IACHAR}: IACHAR, Code in @acronym{ASCII} collating sequence
138 * @code{IAND}: IAND, Bitwise logical and
139 * @code{IARGC}: IARGC, Get number of command line arguments
140 * @code{IBCLR}: IBCLR, Clear bit
141 * @code{IBITS}: IBITS, Bit extraction
142 * @code{IBSET}: IBSET, Set bit
143 * @code{ICHAR}: ICHAR, Character-to-integer conversion function
144 * @code{IDATE}: IDATE, Current local time (day/month/year)
145 * @code{IEOR}: IEOR, Bitwise logical exclusive or
146 * @code{IERRNO}: IERRNO, Function to get the last system error number
147 * @code{INDEX}: INDEX, Position of a substring within a string
148 * @code{INT}: INT, Convert to integer type
149 * @code{IOR}: IOR, Bitwise logical or
150 * @code{IRAND}: IRAND, Integer pseudo-random number
151 * @code{ISHFT}: ISHFT, Shift bits
152 * @code{ISHFTC}: ISHFTC, Shift bits circularly
153 * @code{ITIME}: ITIME, Current local time (hour/minutes/seconds)
154 * @code{KILL}: KILL, Send a signal to a process
155 * @code{KIND}: KIND, Kind of an entity
156 * @code{LBOUND}: LBOUND, Lower dimension bounds of an array
157 * @code{LEN}: LEN, Length of a character entity
158 * @code{LEN_TRIM}: LEN_TRIM, Length of a character entity without trailing blank characters
159 * @code{LGE}: LGE, Lexical greater than or equal
160 * @code{LGT}: LGT, Lexical greater than
161 * @code{LINK}: LINK, Create a hard link
162 * @code{LLE}: LLE, Lexical less than or equal
163 * @code{LLT}: LLT, Lexical less than
164 * @code{LNBLNK}: LNBLNK, Index of the last non-blank character in a string
165 * @code{LOC}: LOC, Returns the address of a variable
166 * @code{LOG}: LOG, Logarithm function
167 * @code{LOG10}: LOG10, Base 10 logarithm function
168 * @code{LOGICAL}: LOGICAL, Convert to logical type
169 * @code{LSHIFT}: LSHIFT, Left shift bits
170 * @code{LTIME}: LTIME, Convert time to local time info
171 * @code{MALLOC}: MALLOC, Dynamic memory allocation function
172 * @code{MATMUL}: MATMUL, matrix multiplication
173 * @code{MAX}: MAX, Maximum value of an argument list
174 * @code{MAXEXPONENT}: MAXEXPONENT, Maximum exponent of a real kind
175 * @code{MAXLOC}: MAXLOC, Location of the maximum value within an array
176 * @code{MAXVAL}: MAXVAL, Maximum value of an array
177 * @code{MERGE}: MERGE, Merge arrays
178 * @code{MIN}: MIN, Minimum value of an argument list
179 * @code{MINEXPONENT}: MINEXPONENT, Minimum exponent of a real kind
180 * @code{MINLOC}: MINLOC, Location of the minimum value within an array
181 * @code{MINVAL}: MINVAL, Minimum value of an array
182 * @code{MOD}: MOD, Remainder function
183 * @code{MODULO}: MODULO, Modulo function
184 * @code{MOVE_ALLOC}: MOVE_ALLOC, Move allocation from one object to another
185 * @code{MVBITS}: MVBITS, Move bits from one integer to another
186 * @code{NEAREST}: NEAREST, Nearest representable number
187 * @code{NEW_LINE}: NEW_LINE, New line character
188 * @code{NINT}: NINT, Nearest whole number
189 * @code{NOT}: NOT, Logical negation
190 * @code{NULL}: NULL, Function that returns an disassociated pointer
191 * @code{OR}: OR, Bitwise logical OR
192 * @code{PACK}: PACK, Pack an array into an array of rank one
193 * @code{PERROR}: PERROR, Print system error message
194 * @code{PRECISION}: PRECISION, Decimal precision of a real kind
195 * @code{PRESENT}: PRESENT, Determine whether an optional argument is specified
196 * @code{PRODUCT}: PRODUCT, Product of array elements
197 * @code{RADIX}: RADIX, Base of a data model
198 * @code{RANDOM_NUMBER}: RANDOM_NUMBER, Pseudo-random number
199 * @code{RANDOM_SEED}: RANDOM_SEED, Initialize a pseudo-random number sequence
200 * @code{RAND}: RAND, Real pseudo-random number
201 * @code{RANGE}: RANGE, Decimal exponent range of a real kind
202 * @code{RAN}: RAN, Real pseudo-random number
203 * @code{REAL}: REAL, Convert to real type
204 * @code{RENAME}: RENAME, Rename a file
205 * @code{REPEAT}: REPEAT, Repeated string concatenation
206 * @code{RESHAPE}: RESHAPE, Function to reshape an array
207 * @code{RRSPACING}: RRSPACING, Reciprocal of the relative spacing
208 * @code{RSHIFT}: RSHIFT, Right shift bits
209 * @code{SCALE}: SCALE, Scale a real value
210 * @code{SCAN}: SCAN, Scan a string for the presence of a set of characters
211 * @code{SECNDS}: SECNDS, Time function
212 @comment * @code{SECOND}: SECOND, (?)
213 @comment * @code{SECONDS}: SECONDS, (?)
214 * @code{SELECTED_INT_KIND}: SELECTED_INT_KIND, Choose integer kind
215 * @code{SELECTED_REAL_KIND}: SELECTED_REAL_KIND, Choose real kind
216 * @code{SET_EXPONENT}: SET_EXPONENT, Set the exponent of the model
217 * @code{SHAPE}: SHAPE, Determine the shape of an array
218 * @code{SIGN}: SIGN, Sign copying function
219 * @code{SIGNAL}: SIGNAL, Signal handling subroutine (or function)
220 * @code{SIN}: SIN, Sine function
221 * @code{SINH}: SINH, Hyperbolic sine function
222 * @code{SIZE}: SIZE, Function to determine the size of an array
223 * @code{SNGL}: SNGL, Convert double precision real to default real
224 * @code{SPACING}: SPACING, Smallest distance between two numbers of a given type
225 * @code{SPREAD}: SPREAD, Add a dimension to an array
226 * @code{SQRT}: SQRT, Square-root function
227 * @code{SRAND}: SRAND, Reinitialize the random number generator
228 * @code{STAT}: STAT, Get file status
229 * @code{SUM}: SUM, Sum of array elements
230 * @code{SYMLNK}: SYMLNK, Create a symbolic link
231 * @code{SYSTEM}: SYSTEM, Execute a shell command
232 * @code{SYSTEM_CLOCK}: SYSTEM_CLOCK, Time function
233 * @code{TAN}: TAN, Tangent function
234 * @code{TANH}: TANH, Hyperbolic tangent function
235 * @code{TIME}: TIME, Time function
236 * @code{TINY}: TINY, Smallest positive number of a real kind
237 * @code{TRANSFER}: TRANSFER, Transfer bit patterns
238 * @code{TRANSPOSE}: TRANSPOSE, Transpose an array of rank two
239 * @code{TRIM}: TRIM, Function to remove trailing blank characters of a string
240 * @code{UBOUND}: UBOUND, Upper dimension bounds of an array
241 * @code{UMASK}: UMASK, Set the file creation mask
242 * @code{UNLINK}: UNLINK, Remove a file from the file system
243 * @code{UNMASK}: UNMASK, (?)
244 * @code{UNPACK}: UNPACK, Unpack an array of rank one into an array
245 * @code{VERIFY}: VERIFY, Scan a string for the absence of a set of characters
246 * @code{XOR}: XOR, Bitwise logical exclusive or
250 @section Introduction to intrinsic procedures
252 GNU Fortran provides a rich set of intrinsic procedures that includes all
253 the intrinsic procedures required by the Fortran 95 standard, a set of
254 intrinsic procedures for backwards compatibility with Gnu Fortran 77
255 (i.e., @command{g77}), and a small selection of intrinsic procedures
256 from the Fortran 2003 standard. Any description here, which conflicts with a
257 description in either the Fortran 95 standard or the Fortran 2003 standard,
258 is unintentional and the standard(s) should be considered authoritative.
260 The enumeration of the @code{KIND} type parameter is processor defined in
261 the Fortran 95 standard. GNU Fortran defines the default integer type and
262 default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)},
263 respectively. The standard mandates that both data types shall have
264 another kind, which have more precision. On typical target architectures
265 supported by @command{gfortran}, this kind type parameter is @code{KIND=8}.
266 Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
267 In the description of generic intrinsic procedures, the kind type parameter
268 will be specified by @code{KIND=*}, and in the description of specific
269 names for an intrinsic procedure the kind type parameter will be explicitly
270 given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}). Finally, for
271 brevity the optional @code{KIND=} syntax will be omitted.
273 Many of the intrinsics procedures take one or more optional arguments.
274 This document follows the convention used in the Fortran 95 standard,
275 and denotes such arguments by square brackets.
277 GNU Fortran offers the @option{-std=f95} and @option{-std=gnu} options,
278 which can be used to restrict the set of intrinsic procedures to a
279 given standard. By default, @command{gfortran} sets the @option{-std=gnu}
280 option, and so all intrinsic procedures described here are accepted. There
281 is one caveat. For a select group of intrinsic procedures, @command{g77}
282 implemented both a function and a subroutine. Both classes
283 have been implemented in @command{gfortran} for backwards compatibility
284 with @command{g77}. It is noted here that these functions and subroutines
285 cannot be intermixed in a given subprogram. In the descriptions that follow,
286 the applicable option(s) is noted.
291 @section @code{ABORT} --- Abort the program
292 @findex @code{ABORT} intrinsic
296 @item @emph{Description}:
297 @code{ABORT} causes immediate termination of the program. On operating
298 systems that support a core dump, @code{ABORT} will produce a core dump,
299 which is suitable for debugging purposes.
301 @item @emph{Standard}:
305 non-elemental subroutine
310 @item @emph{Return value}:
313 @item @emph{Example}:
316 integer :: i = 1, j = 2
317 if (i /= j) call abort
318 end program test_abort
321 @item @emph{See also}:
322 @ref{EXIT}, @ref{KILL}
329 @section @code{ABS} --- Absolute value
330 @findex @code{ABS} intrinsic
331 @findex @code{CABS} intrinsic
332 @findex @code{DABS} intrinsic
333 @findex @code{IABS} intrinsic
334 @findex @code{ZABS} intrinsic
335 @findex @code{CDABS} intrinsic
336 @cindex absolute value
339 @item @emph{Description}:
340 @code{ABS(X)} computes the absolute value of @code{X}.
342 @item @emph{Standard}:
343 F77 and later, has overloads that are GNU extensions
351 @item @emph{Arguments}:
352 @multitable @columnfractions .15 .80
353 @item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)},
354 @code{REAL(*)}, or @code{COMPLEX(*)}.
357 @item @emph{Return value}:
358 The return value is of the same type and
359 kind as the argument except the return value is @code{REAL(*)} for a
360 @code{COMPLEX(*)} argument.
362 @item @emph{Example}:
367 complex :: z = (-1.e0,0.e0)
374 @item @emph{Specific names}:
375 @multitable @columnfractions .20 .20 .20 .40
376 @item Name @tab Argument @tab Return type @tab Standard
377 @item @code{CABS(Z)} @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)} @tab F77 and later
378 @item @code{DABS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
379 @item @code{IABS(I)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab F77 and later
380 @item @code{ZABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension
381 @item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension
387 @section @code{ACCESS} --- Checks file access method
388 @findex @code{ACCESS}
389 @cindex file system functions
391 Not yet implemented in GNU Fortran.
394 @item @emph{Description}:
396 @item @emph{Standard}:
401 @item @emph{Arguments}:
402 @item @emph{Return value}:
403 @item @emph{Example}:
404 @item @emph{Specific names}:
405 @item @emph{See also}:
406 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
412 @section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence
413 @findex @code{ACHAR} intrinsic
414 @cindex @acronym{ASCII} collating sequence
417 @item @emph{Description}:
418 @code{ACHAR(I)} returns the character located at position @code{I}
419 in the @acronym{ASCII} collating sequence.
421 @item @emph{Standard}:
430 @item @emph{Arguments}:
431 @multitable @columnfractions .15 .80
432 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
435 @item @emph{Return value}:
436 The return value is of type @code{CHARACTER} with a length of one. The
437 kind type parameter is the same as @code{KIND('A')}.
439 @item @emph{Example}:
444 end program test_achar
451 @section @code{ACOS} --- Arccosine function
452 @findex @code{ACOS} intrinsic
453 @findex @code{DACOS} intrinsic
454 @cindex trigonometric functions (inverse)
457 @item @emph{Description}:
458 @code{ACOS(X)} computes the arccosine of @var{X} (inverse of @code{COS(X)}).
460 @item @emph{Standard}:
469 @item @emph{Arguments}:
470 @multitable @columnfractions .15 .80
471 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
475 @item @emph{Return value}:
476 The return value is of type @code{REAL(*)} and it lies in the
477 range @math{ 0 \leq \acos(x) \leq \pi}. The kind type parameter
478 is the same as @var{X}.
480 @item @emph{Example}:
483 real(8) :: x = 0.866_8
485 end program test_acos
488 @item @emph{Specific names}:
489 @multitable @columnfractions .20 .20 .20 .40
490 @item Name @tab Argument @tab Return type @tab Standard
491 @item @code{DACOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
494 @item @emph{See also}:
495 Inverse function: @ref{COS}
501 @section @code{ACOSH} --- Hyperbolic arccosine function
502 @findex @code{ACOSH} intrinsic
503 @cindex hyperbolic arccosine
504 @cindex hyperbolic cosine (inverse)
507 @item @emph{Description}:
508 @code{ACOSH(X)} computes the area hyperbolic cosine of @var{X} (inverse of @code{COSH(X)}).
510 @item @emph{Standard}:
519 @item @emph{Arguments}:
520 @multitable @columnfractions .15 .80
521 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
522 greater or equal to one.
525 @item @emph{Return value}:
526 The return value is of type @code{REAL(*)} and it lies in the
527 range @math{0 \leq \acosh (x) \leq \infty}.
529 @item @emph{Example}:
532 REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /)
537 @item @emph{See also}:
538 Inverse function: @ref{COSH}
544 @section @code{ADJUSTL} --- Left adjust a string
545 @findex @code{ADJUSTL} intrinsic
546 @cindex adjust string
549 @item @emph{Description}:
550 @code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.
551 Spaces are inserted at the end of the string as needed.
553 @item @emph{Standard}:
560 @code{STR = ADJUSTL(STR)}
562 @item @emph{Arguments}:
563 @multitable @columnfractions .15 .80
564 @item @var{STR} @tab The type shall be @code{CHARACTER}.
567 @item @emph{Return value}:
568 The return value is of type @code{CHARACTER} where leading spaces
569 are removed and the same number of spaces are inserted on the end
572 @item @emph{Example}:
575 character(len=20) :: str = ' gfortran'
578 end program test_adjustl
585 @section @code{ADJUSTR} --- Right adjust a string
586 @findex @code{ADJUSTR} intrinsic
587 @cindex adjust string
590 @item @emph{Description}:
591 @code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.
592 Spaces are inserted at the start of the string as needed.
594 @item @emph{Standard}:
601 @code{STR = ADJUSTR(STR)}
603 @item @emph{Arguments}:
604 @multitable @columnfractions .15 .80
605 @item @var{STR} @tab The type shall be @code{CHARACTER}.
608 @item @emph{Return value}:
609 The return value is of type @code{CHARACTER} where trailing spaces
610 are removed and the same number of spaces are inserted at the start
613 @item @emph{Example}:
616 character(len=20) :: str = 'gfortran'
619 end program test_adjustr
626 @section @code{AIMAG} --- Imaginary part of complex number
627 @findex @code{AIMAG} intrinsic
628 @findex @code{DIMAG} intrinsic
629 @findex @code{IMAG} intrinsic
630 @findex @code{IMAGPART} intrinsic
631 @cindex Imaginary part
634 @item @emph{Description}:
635 @code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.
636 The @code{IMAG(Z)} and @code{IMAGPART(Z)} intrinsic functions are provided
637 for compatibility with @command{g77}, and their use in new code is
638 strongly discouraged.
640 @item @emph{Standard}:
641 F77 and later, has overloads that are GNU extensions
649 @item @emph{Arguments}:
650 @multitable @columnfractions .15 .80
651 @item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.
654 @item @emph{Return value}:
655 The return value is of type real with the
656 kind type parameter of the argument.
658 @item @emph{Example}:
663 z4 = cmplx(1.e0_4, 0.e0_4)
664 z8 = cmplx(0.e0_8, 1.e0_8)
665 print *, aimag(z4), dimag(z8)
666 end program test_aimag
669 @item @emph{Specific names}:
670 @multitable @columnfractions .20 .20 .20 .40
671 @item Name @tab Argument @tab Return type @tab Standard
672 @item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab GNU extension
673 @item @code{IMAG(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab GNU extension
674 @item @code{IMAGPART(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab GNU extension
681 @section @code{AINT} --- Truncate to a whole number
682 @findex @code{AINT} intrinsic
683 @findex @code{DINT} intrinsic
687 @item @emph{Description}:
688 @code{AINT(X [, KIND])} truncates its argument to a whole number.
690 @item @emph{Standard}:
698 @code{X = AINT(X, KIND)}
700 @item @emph{Arguments}:
701 @multitable @columnfractions .15 .80
702 @item @var{X} @tab The type of the argument shall be @code{REAL(*)}.
703 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
704 initialization expression.
707 @item @emph{Return value}:
708 The return value is of type real with the kind type parameter of the
709 argument if the optional @var{KIND} is absent; otherwise, the kind
710 type parameter will be given by @var{KIND}. If the magnitude of
711 @var{X} is less than one, then @code{AINT(X)} returns zero. If the
712 magnitude is equal to or greater than one, then it returns the largest
713 whole number that does not exceed its magnitude. The sign is the same
714 as the sign of @var{X}.
716 @item @emph{Example}:
723 print *, aint(x4), dint(x8)
725 end program test_aint
728 @item @emph{Specific names}:
729 @multitable @columnfractions .20 .20 .20 .40
730 @item Name @tab Argument @tab Return type @tab Standard
731 @item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
738 @section @code{ALARM} --- Execute a routine after a given delay
739 @findex @code{ALARM} intrinsic
742 @item @emph{Description}:
743 @code{ALARM(SECONDS, HANDLER [, STATUS])} causes external subroutine @var{HANDLER}
744 to be executed after a delay of @var{SECONDS} by using @code{alarm(1)} to
745 set up a signal and @code{signal(2)} to catch it. If @var{STATUS} is
746 supplied, it will be returned with the number of seconds remaining until
747 any previously scheduled alarm was due to be delivered, or zero if there
748 was no previously scheduled alarm.
750 @item @emph{Standard}:
757 @code{CALL ALARM(SECONDS, HANDLER)}
758 @code{CALL ALARM(SECONDS, HANDLER, STATUS)}
760 @item @emph{Arguments}:
761 @multitable @columnfractions .15 .80
762 @item @var{SECONDS} @tab The type of the argument shall be a scalar
763 @code{INTEGER}. It is @code{INTENT(IN)}.
764 @item @var{HANDLER} @tab Signal handler (@code{INTEGER FUNCTION} or
765 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
766 @code{INTEGER}. It is @code{INTENT(IN)}.
767 @item @var{STATUS} @tab (Optional) @var{STATUS} shall be a scalar
768 @code{INTEGER} variable. It is @code{INTENT(OUT)}.
771 @item @emph{Example}:
774 external handler_print
776 call alarm (3, handler_print, i)
779 end program test_alarm
781 This will cause the external routine @var{handler_print} to be called
788 @section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true
789 @findex @code{ALL} intrinsic
793 @item @emph{Description}:
794 @code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}
795 in the array along dimension @var{DIM}.
797 @item @emph{Standard}:
801 transformational function
805 @code{L = ALL(MASK, DIM)}
807 @item @emph{Arguments}:
808 @multitable @columnfractions .15 .80
809 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
810 it shall not be scalar.
811 @item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer
812 with a value that lies between one and the rank of @var{MASK}.
815 @item @emph{Return value}:
816 @code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
817 the kind type parameter is the same as the kind type parameter of
818 @var{MASK}. If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns
819 an array with the rank of @var{MASK} minus 1. The shape is determined from
820 the shape of @var{MASK} where the @var{DIM} dimension is elided.
824 @code{ALL(MASK)} is true if all elements of @var{MASK} are true.
825 It also is true if @var{MASK} has zero size; otherwise, it is false.
827 If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent
828 to @code{ALL(MASK)}. If the rank is greater than one, then @code{ALL(MASK,DIM)}
829 is determined by applying @code{ALL} to the array sections.
832 @item @emph{Example}:
836 l = all((/.true., .true., .true./))
841 integer a(2,3), b(2,3)
845 print *, all(a .eq. b, 1)
846 print *, all(a .eq. b, 2)
847 end subroutine section
855 @section @code{ALLOCATED} --- Status of an allocatable entity
856 @findex @code{ALLOCATED} intrinsic
857 @cindex allocation status
860 @item @emph{Description}:
861 @code{ALLOCATED(X)} checks the status of whether @var{X} is allocated.
863 @item @emph{Standard}:
870 @code{L = ALLOCATED(X)}
872 @item @emph{Arguments}:
873 @multitable @columnfractions .15 .80
874 @item @var{X} @tab The argument shall be an @code{ALLOCATABLE} array.
877 @item @emph{Return value}:
878 The return value is a scalar @code{LOGICAL} with the default logical
879 kind type parameter. If @var{X} is allocated, @code{ALLOCATED(X)}
880 is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.}
882 @item @emph{Example}:
884 program test_allocated
886 real(4), allocatable :: x(:)
887 if (allocated(x) .eqv. .false.) allocate(x(i))
888 end program test_allocated
894 @section @code{AND} --- Bitwise logical AND
895 @findex @code{AND} intrinsic
896 @cindex bit operations
899 @item @emph{Description}:
900 Bitwise logical @code{AND}.
902 This intrinsic routine is provided for backwards compatibility with
903 GNU Fortran 77. For integer arguments, programmers should consider
904 the use of the @ref{IAND} intrinsic defined by the Fortran standard.
906 @item @emph{Standard}:
910 Non-elemental function
913 @code{RESULT = AND(X, Y)}
915 @item @emph{Arguments}:
916 @multitable @columnfractions .15 .80
917 @item @var{X} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
918 @item @var{Y} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
921 @item @emph{Return value}:
922 The return type is either @code{INTEGER(*)} or @code{LOGICAL} after
923 cross-promotion of the arguments.
925 @item @emph{Example}:
928 LOGICAL :: T = .TRUE., F = ..FALSE.
930 DATA a / Z'F' /, b / Z'3' /
932 WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
933 WRITE (*,*) AND(a, b)
937 @item @emph{See also}:
938 F95 elemental function: @ref{IAND}
944 @section @code{ANINT} --- Nearest whole number
945 @findex @code{ANINT} intrinsic
946 @findex @code{DNINT} intrinsic
950 @item @emph{Description}:
951 @code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.
953 @item @emph{Standard}:
961 @code{X = ANINT(X, KIND)}
963 @item @emph{Arguments}:
964 @multitable @columnfractions .15 .80
965 @item @var{X} @tab The type of the argument shall be @code{REAL(*)}.
966 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
967 initialization expression.
970 @item @emph{Return value}:
971 The return value is of type real with the kind type parameter of the
972 argument if the optional @var{KIND} is absent; otherwise, the kind
973 type parameter will be given by @var{KIND}. If @var{X} is greater than
974 zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}. If @var{X} is
975 less than or equal to zero, then it returns @code{AINT(X-0.5)}.
977 @item @emph{Example}:
984 print *, anint(x4), dnint(x8)
986 end program test_anint
989 @item @emph{Specific names}:
990 @multitable @columnfractions .20 .20 .20 .40
991 @item Name @tab Argument @tab Return type @tab Standard
992 @item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
999 @section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true
1000 @findex @code{ANY} intrinsic
1004 @item @emph{Description}:
1005 @code{ANY(MASK [, DIM])} determines if any of the values in the logical array
1006 @var{MASK} along dimension @var{DIM} are @code{.TRUE.}.
1008 @item @emph{Standard}:
1012 transformational function
1014 @item @emph{Syntax}:
1015 @code{L = ANY(MASK)}
1016 @code{L = ANY(MASK, DIM)}
1018 @item @emph{Arguments}:
1019 @multitable @columnfractions .15 .80
1020 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
1021 it shall not be scalar.
1022 @item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer
1023 with a value that lies between one and the rank of @var{MASK}.
1026 @item @emph{Return value}:
1027 @code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
1028 the kind type parameter is the same as the kind type parameter of
1029 @var{MASK}. If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns
1030 an array with the rank of @var{MASK} minus 1. The shape is determined from
1031 the shape of @var{MASK} where the @var{DIM} dimension is elided.
1035 @code{ANY(MASK)} is true if any element of @var{MASK} is true;
1036 otherwise, it is false. It also is false if @var{MASK} has zero size.
1038 If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent
1039 to @code{ANY(MASK)}. If the rank is greater than one, then @code{ANY(MASK,DIM)}
1040 is determined by applying @code{ANY} to the array sections.
1043 @item @emph{Example}:
1047 l = any((/.true., .true., .true./))
1052 integer a(2,3), b(2,3)
1056 print *, any(a .eq. b, 1)
1057 print *, any(a .eq. b, 2)
1058 end subroutine section
1059 end program test_any
1066 @section @code{ASIN} --- Arcsine function
1067 @findex @code{ASIN} intrinsic
1068 @findex @code{DASIN} intrinsic
1069 @cindex trigonometric functions (inverse)
1072 @item @emph{Description}:
1073 @code{ASIN(X)} computes the arcsine of its @var{X} (inverse of @code{SIN(X)}).
1075 @item @emph{Standard}:
1081 @item @emph{Syntax}:
1084 @item @emph{Arguments}:
1085 @multitable @columnfractions .15 .80
1086 @item @var{X} @tab The type shall be @code{REAL(*)}, and a magnitude that is
1090 @item @emph{Return value}:
1091 The return value is of type @code{REAL(*)} and it lies in the
1092 range @math{-\pi / 2 \leq \asin (x) \leq \pi / 2}. The kind type
1093 parameter is the same as @var{X}.
1095 @item @emph{Example}:
1098 real(8) :: x = 0.866_8
1100 end program test_asin
1103 @item @emph{Specific names}:
1104 @multitable @columnfractions .20 .20 .20 .40
1105 @item Name @tab Argument @tab Return type @tab Standard
1106 @item @code{DASIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
1109 @item @emph{See also}:
1110 Inverse function: @ref{SIN}
1116 @section @code{ASINH} --- Hyperbolic arcsine function
1117 @findex @code{ASINH} intrinsic
1118 @cindex hyperbolic arcsine
1119 @cindex hyperbolic sine (inverse)
1122 @item @emph{Description}:
1123 @code{ASINH(X)} computes the area hyperbolic sine of @var{X} (inverse of @code{SINH(X)}).
1125 @item @emph{Standard}:
1131 @item @emph{Syntax}:
1134 @item @emph{Arguments}:
1135 @multitable @columnfractions .15 .80
1136 @item @var{X} @tab The type shall be @code{REAL(*)}, with @var{X} a real number.
1139 @item @emph{Return value}:
1140 The return value is of type @code{REAL(*)} and it lies in the
1141 range @math{-\infty \leq \asinh (x) \leq \infty}.
1143 @item @emph{Example}:
1146 REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
1147 WRITE (*,*) ASINH(x)
1151 @item @emph{See also}:
1152 Inverse function: @ref{SINH}
1158 @section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair
1159 @findex @code{ASSOCIATED} intrinsic
1160 @cindex pointer status
1163 @item @emph{Description}:
1164 @code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR}
1165 or if @var{PTR} is associated with the target @var{TGT}.
1167 @item @emph{Standard}:
1173 @item @emph{Syntax}:
1174 @code{L = ASSOCIATED(PTR)}
1175 @code{L = ASSOCIATED(PTR [, TGT])}
1177 @item @emph{Arguments}:
1178 @multitable @columnfractions .15 .80
1179 @item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute and
1180 it can be of any type.
1181 @item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} or
1182 a @code{TARGET}. It must have the same type, kind type parameter, and
1183 array rank as @var{PTR}.
1185 The status of neither @var{PTR} nor @var{TGT} can be undefined.
1187 @item @emph{Return value}:
1188 @code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}.
1189 There are several cases:
1191 @item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)}
1192 is true if @var{PTR} is associated with a target; otherwise, it returns false.
1193 @item (B) If @var{TGT} is present and a scalar target, the result is true if
1195 is not a 0 sized storage sequence and the target associated with @var{PTR}
1196 occupies the same storage units. If @var{PTR} is disassociated, then the
1198 @item (C) If @var{TGT} is present and an array target, the result is true if
1199 @var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, are
1200 arrays whose elements are not 0 sized storage sequences, and @var{TGT} and
1201 @var{PTR} occupy the same storage units in array element order.
1202 As in case(B), the result is false, if @var{PTR} is disassociated.
1203 @item (D) If @var{TGT} is present and an scalar pointer, the result is true if
1204 target associated with @var{PTR} and the target associated with @var{TGT}
1205 are not 0 sized storage sequences and occupy the same storage units.
1206 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
1207 @item (E) If @var{TGT} is present and an array pointer, the result is true if
1208 target associated with @var{PTR} and the target associated with @var{TGT}
1209 have the same shape, are not 0 sized arrays, are arrays whose elements are
1210 not 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the same
1211 storage units in array element order.
1212 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
1215 @item @emph{Example}:
1217 program test_associated
1219 real, target :: tgt(2) = (/1., 2./)
1220 real, pointer :: ptr(:)
1222 if (associated(ptr) .eqv. .false.) call abort
1223 if (associated(ptr,tgt) .eqv. .false.) call abort
1224 end program test_associated
1227 @item @emph{See also}:
1234 @section @code{ATAN} --- Arctangent function
1235 @findex @code{ATAN} intrinsic
1236 @findex @code{DATAN} intrinsic
1237 @cindex trigonometric functions (inverse)
1240 @item @emph{Description}:
1241 @code{ATAN(X)} computes the arctangent of @var{X}.
1243 @item @emph{Standard}:
1249 @item @emph{Syntax}:
1252 @item @emph{Arguments}:
1253 @multitable @columnfractions .15 .80
1254 @item @var{X} @tab The type shall be @code{REAL(*)}.
1257 @item @emph{Return value}:
1258 The return value is of type @code{REAL(*)} and it lies in the
1259 range @math{ - \pi / 2 \leq \atan (x) \leq \pi / 2}.
1261 @item @emph{Example}:
1264 real(8) :: x = 2.866_8
1266 end program test_atan
1269 @item @emph{Specific names}:
1270 @multitable @columnfractions .20 .20 .20 .40
1271 @item Name @tab Argument @tab Return type @tab Standard
1272 @item @code{DATAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
1275 @item @emph{See also}:
1276 Inverse function: @ref{TAN}
1283 @section @code{ATAN2} --- Arctangent function
1284 @findex @code{ATAN2} intrinsic
1285 @findex @code{DATAN2} intrinsic
1286 @cindex trigonometric functions (inverse)
1289 @item @emph{Description}:
1290 @code{ATAN2(Y,X)} computes the arctangent of the complex number @math{X + i Y}.
1292 @item @emph{Standard}:
1298 @item @emph{Syntax}:
1299 @code{X = ATAN2(Y,X)}
1301 @item @emph{Arguments}:
1302 @multitable @columnfractions .15 .80
1303 @item @var{Y} @tab The type shall be @code{REAL(*)}.
1304 @item @var{X} @tab The type and kind type parameter shall be the same as @var{Y}.
1305 If @var{Y} is zero, then @var{X} must be nonzero.
1308 @item @emph{Return value}:
1309 The return value has the same type and kind type parameter as @var{Y}.
1310 It is the principal value of the complex number @math{X + i Y}. If
1311 @var{X} is nonzero, then it lies in the range @math{-\pi \le \atan (x) \leq \pi}.
1312 The sign is positive if @var{Y} is positive. If @var{Y} is zero, then
1313 the return value is zero if @var{X} is positive and @math{\pi} if @var{X}
1314 is negative. Finally, if @var{X} is zero, then the magnitude of the result
1317 @item @emph{Example}:
1320 real(4) :: x = 1.e0_4, y = 0.5e0_4
1322 end program test_atan2
1325 @item @emph{Specific names}:
1326 @multitable @columnfractions .20 .20 .20 .40
1327 @item Name @tab Argument @tab Return type @tab Standard
1328 @item @code{DATAN2(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
1335 @section @code{ATANH} --- Hyperbolic arctangent function
1336 @findex @code{ASINH} intrinsic
1337 @cindex hyperbolic arctangent
1338 @cindex hyperbolic tangent (inverse)
1341 @item @emph{Description}:
1342 @code{ATANH(X)} computes the area hyperbolic sine of @var{X} (inverse of @code{TANH(X)}).
1344 @item @emph{Standard}:
1350 @item @emph{Syntax}:
1353 @item @emph{Arguments}:
1354 @multitable @columnfractions .15 .80
1355 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is less than or equal to one.
1358 @item @emph{Return value}:
1359 The return value is of type @code{REAL(*)} and it lies in the
1360 range @math{-\infty \leq \atanh(x) \leq \infty}.
1362 @item @emph{Example}:
1365 REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
1366 WRITE (*,*) ATANH(x)
1370 @item @emph{See also}:
1371 Inverse function: @ref{TANH}
1378 @section @code{BESJ0} --- Bessel function of the first kind of order 0
1379 @findex @code{BESJ0} intrinsic
1380 @findex @code{DBESJ0} intrinsic
1384 @item @emph{Description}:
1385 @code{BESJ0(X)} computes the Bessel function of the first kind of order 0
1388 @item @emph{Standard}:
1394 @item @emph{Syntax}:
1397 @item @emph{Arguments}:
1398 @multitable @columnfractions .15 .80
1399 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1402 @item @emph{Return value}:
1403 The return value is of type @code{REAL(*)} and it lies in the
1404 range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
1406 @item @emph{Example}:
1409 real(8) :: x = 0.0_8
1411 end program test_besj0
1414 @item @emph{Specific names}:
1415 @multitable @columnfractions .20 .20 .20 .40
1416 @item Name @tab Argument @tab Return type @tab Standard
1417 @item @code{DBESJ0(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab GNU extension
1424 @section @code{BESJ1} --- Bessel function of the first kind of order 1
1425 @findex @code{BESJ1} intrinsic
1426 @findex @code{DBESJ1} intrinsic
1430 @item @emph{Description}:
1431 @code{BESJ1(X)} computes the Bessel function of the first kind of order 1
1434 @item @emph{Standard}:
1440 @item @emph{Syntax}:
1443 @item @emph{Arguments}:
1444 @multitable @columnfractions .15 .80
1445 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1448 @item @emph{Return value}:
1449 The return value is of type @code{REAL(*)} and it lies in the
1450 range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
1452 @item @emph{Example}:
1455 real(8) :: x = 1.0_8
1457 end program test_besj1
1460 @item @emph{Specific names}:
1461 @multitable @columnfractions .20 .20 .20 .40
1462 @item Name @tab Argument @tab Return type @tab Standard
1463 @item @code{DBESJ1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab GNU extension
1470 @section @code{BESJN} --- Bessel function of the first kind
1471 @findex @code{BESJN} intrinsic
1472 @findex @code{DBESJN} intrinsic
1476 @item @emph{Description}:
1477 @code{BESJN(N, X)} computes the Bessel function of the first kind of order
1480 @item @emph{Standard}:
1486 @item @emph{Syntax}:
1487 @code{Y = BESJN(N, X)}
1489 @item @emph{Arguments}:
1490 @multitable @columnfractions .15 .80
1491 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1492 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1495 @item @emph{Return value}:
1496 The return value is a scalar of type @code{REAL(*)}.
1498 @item @emph{Example}:
1501 real(8) :: x = 1.0_8
1503 end program test_besjn
1506 @item @emph{Specific names}:
1507 @multitable @columnfractions .20 .20 .20 .40
1508 @item Name @tab Argument @tab Return type @tab Standard
1509 @item @code{DBESJN(X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)} @tab GNU extension
1510 @item @tab @code{REAL(8) X} @tab @tab
1517 @section @code{BESY0} --- Bessel function of the second kind of order 0
1518 @findex @code{BESY0} intrinsic
1519 @findex @code{DBESY0} intrinsic
1523 @item @emph{Description}:
1524 @code{BESY0(X)} computes the Bessel function of the second kind of order 0
1527 @item @emph{Standard}:
1533 @item @emph{Syntax}:
1536 @item @emph{Arguments}:
1537 @multitable @columnfractions .15 .80
1538 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1541 @item @emph{Return value}:
1542 The return value is a scalar of type @code{REAL(*)}.
1544 @item @emph{Example}:
1547 real(8) :: x = 0.0_8
1549 end program test_besy0
1552 @item @emph{Specific names}:
1553 @multitable @columnfractions .20 .20 .20 .40
1554 @item Name @tab Argument @tab Return type @tab Standard
1555 @item @code{DBESY0(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab GNU extension
1562 @section @code{BESY1} --- Bessel function of the second kind of order 1
1563 @findex @code{BESY1} intrinsic
1564 @findex @code{DBESY1} intrinsic
1568 @item @emph{Description}:
1569 @code{BESY1(X)} computes the Bessel function of the second kind of order 1
1572 @item @emph{Standard}:
1578 @item @emph{Syntax}:
1581 @item @emph{Arguments}:
1582 @multitable @columnfractions .15 .80
1583 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1586 @item @emph{Return value}:
1587 The return value is a scalar of type @code{REAL(*)}.
1589 @item @emph{Example}:
1592 real(8) :: x = 1.0_8
1594 end program test_besy1
1597 @item @emph{Specific names}:
1598 @multitable @columnfractions .20 .20 .20 .40
1599 @item Name @tab Argument @tab Return type @tab Standard
1600 @item @code{DBESY1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab GNU extension
1607 @section @code{BESYN} --- Bessel function of the second kind
1608 @findex @code{BESYN} intrinsic
1609 @findex @code{DBESYN} intrinsic
1613 @item @emph{Description}:
1614 @code{BESYN(N, X)} computes the Bessel function of the second kind of order
1617 @item @emph{Standard}:
1623 @item @emph{Syntax}:
1624 @code{Y = BESYN(N, X)}
1626 @item @emph{Arguments}:
1627 @multitable @columnfractions .15 .80
1628 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1629 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1632 @item @emph{Return value}:
1633 The return value is a scalar of type @code{REAL(*)}.
1635 @item @emph{Example}:
1638 real(8) :: x = 1.0_8
1640 end program test_besyn
1643 @item @emph{Specific names}:
1644 @multitable @columnfractions .20 .20 .20 .40
1645 @item Name @tab Argument @tab Return type @tab Standard
1646 @item @code{DBESYN(N,X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)} @tab GNU extension
1647 @item @tab @code{REAL(8) X} @tab @tab
1654 @section @code{BIT_SIZE} --- Bit size inquiry function
1655 @findex @code{BIT_SIZE} intrinsic
1659 @item @emph{Description}:
1660 @code{BIT_SIZE(I)} returns the number of bits (integer precision plus sign bit)
1661 represented by the type of @var{I}.
1663 @item @emph{Standard}:
1669 @item @emph{Syntax}:
1670 @code{I = BIT_SIZE(I)}
1672 @item @emph{Arguments}:
1673 @multitable @columnfractions .15 .80
1674 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1677 @item @emph{Return value}:
1678 The return value is of type @code{INTEGER(*)}
1680 @item @emph{Example}:
1682 program test_bit_size
1687 end program test_bit_size
1694 @section @code{BTEST} --- Bit test function
1695 @findex @code{BTEST} intrinsic
1699 @item @emph{Description}:
1700 @code{BTEST(I,POS)} returns logical @code{.TRUE.} if the bit at @var{POS}
1703 @item @emph{Standard}:
1709 @item @emph{Syntax}:
1710 @code{I = BTEST(I,POS)}
1712 @item @emph{Arguments}:
1713 @multitable @columnfractions .15 .80
1714 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1715 @item @var{POS} @tab The type shall be @code{INTEGER(*)}.
1718 @item @emph{Return value}:
1719 The return value is of type @code{LOGICAL}
1721 @item @emph{Example}:
1724 integer :: i = 32768 + 1024 + 64
1728 bool = btest(i, pos)
1731 end program test_btest
1738 @section @code{CEILING} --- Integer ceiling function
1739 @findex @code{CEILING} intrinsic
1743 @item @emph{Description}:
1744 @code{CEILING(X)} returns the least integer greater than or equal to @var{X}.
1746 @item @emph{Standard}:
1752 @item @emph{Syntax}:
1753 @code{I = CEILING(X[,KIND])}
1755 @item @emph{Arguments}:
1756 @multitable @columnfractions .15 .80
1757 @item @var{X} @tab The type shall be @code{REAL(*)}.
1758 @item @var{KIND} @tab (Optional) scalar integer initialization expression.
1761 @item @emph{Return value}:
1762 The return value is of type @code{INTEGER(KIND)}
1764 @item @emph{Example}:
1766 program test_ceiling
1769 print *, ceiling(x) ! returns 64
1770 print *, ceiling(y) ! returns -63
1771 end program test_ceiling
1774 @item @emph{See also}:
1775 @ref{FLOOR}, @ref{NINT}
1782 @section @code{CHAR} --- Character conversion function
1783 @findex @code{CHAR} intrinsic
1784 @cindex conversion function (character)
1787 @item @emph{Description}:
1788 @code{CHAR(I,[KIND])} returns the character represented by the integer @var{I}.
1790 @item @emph{Standard}:
1796 @item @emph{Syntax}:
1797 @code{C = CHAR(I[,KIND])}
1799 @item @emph{Arguments}:
1800 @multitable @columnfractions .15 .80
1801 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1802 @item @var{KIND} @tab Optional scaler integer initialization expression.
1805 @item @emph{Return value}:
1806 The return value is of type @code{CHARACTER(1)}
1808 @item @emph{Example}:
1814 print *, i, c ! returns 'J'
1815 end program test_char
1818 @item @emph{See also}:
1819 @ref{ACHAR}, @ref{ICHAR}, @ref{IACHAR}
1825 @section @code{CHDIR} --- Change working directory
1826 @findex @code{CHDIR} intrinsic
1827 @cindex file system functions
1830 @item @emph{Description}:
1831 Change current working directory to a specified @var{PATH}.
1833 @item @emph{Standard}:
1837 Non-elemental subroutine
1839 @item @emph{Syntax}:
1840 @code{CALL chdir(PATH[,STATUS])}
1842 @item @emph{Arguments}:
1843 @multitable @columnfractions .15 .80
1844 @item @var{PATH} @tab The type shall be @code{CHARACTER(*)} and shall specify a valid path within the file system.
1845 @item @var{STATUS} @tab (Optional) status flag. Returns 0 on success,
1846 a system specific and non-zero error code otherwise.
1849 @item @emph{Example}:
1852 CHARACTER(len=255) :: path
1854 WRITE(*,*) TRIM(path)
1857 WRITE(*,*) TRIM(path)
1861 @item @emph{See also}:
1868 @section @code{CHMOD} --- Change access permissions of files
1869 @findex @code{CHMOD}
1870 @cindex file system functions
1872 Not yet implemented in GNU Fortran.
1875 @item @emph{Description}:
1877 @item @emph{Standard}:
1883 @item @emph{Syntax}:
1884 @item @emph{Arguments}:
1885 @item @emph{Return value}:
1886 @item @emph{Example}:
1887 @item @emph{Specific names}:
1888 @item @emph{See also}:
1889 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
1895 @section @code{CMPLX} --- Complex conversion function
1896 @findex @code{CMPLX} intrinsic
1900 @item @emph{Description}:
1901 @code{CMPLX(X[,Y[,KIND]])} returns a complex number where @var{X} is converted to
1902 the real component. If @var{Y} is present it is converted to the imaginary
1903 component. If @var{Y} is not present then the imaginary component is set to
1904 0.0. If @var{X} is complex then @var{Y} must not be present.
1906 @item @emph{Standard}:
1912 @item @emph{Syntax}:
1913 @code{C = CMPLX(X[,Y[,KIND]])}
1915 @item @emph{Arguments}:
1916 @multitable @columnfractions .15 .80
1917 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1918 @item @var{Y} @tab Optional, allowed if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}.
1919 @item @var{KIND} @tab Optional scaler integer initialization expression.
1922 @item @emph{Return value}:
1923 The return value is of type @code{COMPLEX(*)}
1925 @item @emph{Example}:
1932 print *, z, cmplx(x)
1933 end program test_cmplx
1939 @node COMMAND_ARGUMENT_COUNT
1940 @section @code{COMMAND_ARGUMENT_COUNT} --- Argument count function
1941 @findex @code{COMMAND_ARGUMENT_COUNT} intrinsic
1942 @cindex command argument count
1945 @item @emph{Description}:
1946 @code{COMMAND_ARGUMENT_COUNT()} returns the number of arguments passed on the
1947 command line when the containing program was invoked.
1949 @item @emph{Standard}:
1955 @item @emph{Syntax}:
1956 @code{I = COMMAND_ARGUMENT_COUNT()}
1958 @item @emph{Arguments}:
1959 @multitable @columnfractions .15 .80
1963 @item @emph{Return value}:
1964 The return value is of type @code{INTEGER(4)}
1966 @item @emph{Example}:
1968 program test_command_argument_count
1970 count = command_argument_count()
1972 end program test_command_argument_count
1979 @section @code{CONJG} --- Complex conjugate function
1980 @findex @code{CONJG} intrinsic
1981 @findex @code{DCONJG} intrinsic
1982 @cindex complex conjugate
1984 @item @emph{Description}:
1985 @code{CONJG(Z)} returns the conjugate of @var{Z}. If @var{Z} is @code{(x, y)}
1986 then the result is @code{(x, -y)}
1988 @item @emph{Standard}:
1989 F77 and later, has overloads that are GNU extensions
1994 @item @emph{Syntax}:
1997 @item @emph{Arguments}:
1998 @multitable @columnfractions .15 .80
1999 @item @var{Z} @tab The type shall be @code{COMPLEX(*)}.
2002 @item @emph{Return value}:
2003 The return value is of type @code{COMPLEX(*)}.
2005 @item @emph{Example}:
2008 complex :: z = (2.0, 3.0)
2009 complex(8) :: dz = (2.71_8, -3.14_8)
2014 end program test_conjg
2017 @item @emph{Specific names}:
2018 @multitable @columnfractions .20 .20 .20 .40
2019 @item Name @tab Argument @tab Return type @tab Standard
2020 @item @code{DCONJG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension
2027 @section @code{COS} --- Cosine function
2028 @findex @code{COS} intrinsic
2029 @findex @code{DCOS} intrinsic
2030 @findex @code{ZCOS} intrinsic
2031 @findex @code{CDCOS} intrinsic
2032 @cindex trigonometric functions
2035 @item @emph{Description}:
2036 @code{COS(X)} computes the cosine of @var{X}.
2038 @item @emph{Standard}:
2039 F77 and later, has overloads that are GNU extensions
2044 @item @emph{Syntax}:
2047 @item @emph{Arguments}:
2048 @multitable @columnfractions .15 .80
2049 @item @var{X} @tab The type shall be @code{REAL(*)} or
2053 @item @emph{Return value}:
2054 The return value is of type @code{REAL(*)} and it lies in the
2055 range @math{ -1 \leq \cos (x) \leq 1}. The kind type
2056 parameter is the same as @var{X}.
2058 @item @emph{Example}:
2063 end program test_cos
2066 @item @emph{Specific names}:
2067 @multitable @columnfractions .20 .20 .20 .40
2068 @item Name @tab Argument @tab Return type @tab Standard
2069 @item @code{DCOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
2070 @item @code{CCOS(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab F77 and later
2071 @item @code{ZCOS(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
2072 @item @code{CDCOS(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
2075 @item @emph{See also}:
2076 Inverse function: @ref{ACOS}
2083 @section @code{COSH} --- Hyperbolic cosine function
2084 @findex @code{COSH} intrinsic
2085 @findex @code{DCOSH} intrinsic
2086 @cindex hyperbolic cosine
2089 @item @emph{Description}:
2090 @code{COSH(X)} computes the hyperbolic cosine of @var{X}.
2092 @item @emph{Standard}:
2098 @item @emph{Syntax}:
2101 @item @emph{Arguments}:
2102 @multitable @columnfractions .15 .80
2103 @item @var{X} @tab The type shall be @code{REAL(*)}.
2106 @item @emph{Return value}:
2107 The return value is of type @code{REAL(*)} and it is positive
2108 (@math{ \cosh (x) \geq 0 }.
2110 @item @emph{Example}:
2113 real(8) :: x = 1.0_8
2115 end program test_cosh
2118 @item @emph{Specific names}:
2119 @multitable @columnfractions .20 .20 .20 .40
2120 @item Name @tab Argument @tab Return type @tab Standard
2121 @item @code{DCOSH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
2124 @item @emph{See also}:
2125 Inverse function: @ref{ACOSH}
2132 @section @code{COUNT} --- Count function
2133 @findex @code{COUNT} intrinsic
2137 @item @emph{Description}:
2138 @code{COUNT(MASK[,DIM])} counts the number of @code{.TRUE.} elements of
2139 @var{MASK} along the dimension of @var{DIM}. If @var{DIM} is omitted it is
2140 taken to be @code{1}. @var{DIM} is a scaler of type @code{INTEGER} in the
2141 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{MASK}.
2143 @item @emph{Standard}:
2147 transformational function
2149 @item @emph{Syntax}:
2150 @code{I = COUNT(MASK[,DIM])}
2152 @item @emph{Arguments}:
2153 @multitable @columnfractions .15 .80
2154 @item @var{MASK} @tab The type shall be @code{LOGICAL}.
2155 @item @var{DIM} @tab The type shall be @code{INTEGER}.
2158 @item @emph{Return value}:
2159 The return value is of type @code{INTEGER} with rank equal to that of
2162 @item @emph{Example}:
2165 integer, dimension(2,3) :: a, b
2166 logical, dimension(2,3) :: mask
2167 a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
2168 b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
2169 print '(3i3)', a(1,:)
2170 print '(3i3)', a(2,:)
2172 print '(3i3)', b(1,:)
2173 print '(3i3)', b(2,:)
2176 print '(3l3)', mask(1,:)
2177 print '(3l3)', mask(2,:)
2179 print '(3i3)', count(mask)
2181 print '(3i3)', count(mask, 1)
2183 print '(3i3)', count(mask, 2)
2184 end program test_count
2191 @section @code{CPU_TIME} --- CPU elapsed time in seconds
2192 @findex @code{CPU_TIME} intrinsic
2196 @item @emph{Description}:
2197 Returns a @code{REAL} value representing the elapsed CPU time in seconds. This
2198 is useful for testing segments of code to determine execution time.
2200 @item @emph{Standard}:
2206 @item @emph{Syntax}:
2209 @item @emph{Arguments}:
2210 @multitable @columnfractions .15 .80
2211 @item @var{X} @tab The type shall be @code{REAL} with @code{INTENT(OUT)}.
2214 @item @emph{Return value}:
2217 @item @emph{Example}:
2219 program test_cpu_time
2220 real :: start, finish
2221 call cpu_time(start)
2222 ! put code to test here
2223 call cpu_time(finish)
2224 print '("Time = ",f6.3," seconds.")',finish-start
2225 end program test_cpu_time
2232 @section @code{CSHIFT} --- Circular shift function
2233 @findex @code{CSHIFT} intrinsic
2234 @cindex bit manipulation
2237 @item @emph{Description}:
2238 @code{CSHIFT(ARRAY, SHIFT[,DIM])} performs a circular shift on elements of
2239 @var{ARRAY} along the dimension of @var{DIM}. If @var{DIM} is omitted it is
2240 taken to be @code{1}. @var{DIM} is a scaler of type @code{INTEGER} in the
2241 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{ARRAY}.
2242 If the rank of @var{ARRAY} is one, then all elements of @var{ARRAY} are shifted
2243 by @var{SHIFT} places. If rank is greater than one, then all complete rank one
2244 sections of @var{ARRAY} along the given dimension are shifted. Elements
2245 shifted out one end of each rank one section are shifted back in the other end.
2247 @item @emph{Standard}:
2251 transformational function
2253 @item @emph{Syntax}:
2254 @code{A = CSHIFT(A, SHIFT[,DIM])}
2256 @item @emph{Arguments}:
2257 @multitable @columnfractions .15 .80
2258 @item @var{ARRAY} @tab May be any type, not scaler.
2259 @item @var{SHIFT} @tab The type shall be @code{INTEGER}.
2260 @item @var{DIM} @tab The type shall be @code{INTEGER}.
2263 @item @emph{Return value}:
2264 Returns an array of same type and rank as the @var{ARRAY} argument.
2266 @item @emph{Example}:
2269 integer, dimension(3,3) :: a
2270 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2271 print '(3i3)', a(1,:)
2272 print '(3i3)', a(2,:)
2273 print '(3i3)', a(3,:)
2274 a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
2276 print '(3i3)', a(1,:)
2277 print '(3i3)', a(2,:)
2278 print '(3i3)', a(3,:)
2279 end program test_cshift
2285 @section @code{CTIME} --- Convert a time into a string
2286 @findex @code{CTIME} intrinsic
2287 @cindex ctime subroutine
2290 @item @emph{Description}:
2291 @code{CTIME(T,S)} converts @var{T}, a system time value, such as returned
2292 by @code{TIME8()}, to a string of the form @samp{Sat Aug 19 18:13:14
2293 1995}, and returns that string into @var{S}.
2295 If @code{CTIME} is invoked as a function, it can not be invoked as a
2296 subroutine, and vice versa.
2298 @var{T} is an @code{INTENT(IN)} @code{INTEGER(KIND=8)} variable.
2299 @var{S} is an @code{INTENT(OUT)} @code{CHARACTER} variable.
2301 @item @emph{Standard}:
2307 @item @emph{Syntax}:
2308 @multitable @columnfractions .80
2309 @item @code{CALL CTIME(T,S)}.
2310 @item @code{S = CTIME(T)}, (not recommended).
2313 @item @emph{Arguments}:
2314 @multitable @columnfractions .15 .80
2315 @item @var{S}@tab The type shall be of type @code{CHARACTER}.
2316 @item @var{T}@tab The type shall be of type @code{INTEGER(KIND=8)}.
2319 @item @emph{Return value}:
2320 The converted date and time as a string.
2322 @item @emph{Example}:
2326 character(len=30) :: date
2329 ! Do something, main part of the program
2332 print *, 'Program was started on ', date
2333 end program test_ctime
2338 @section @code{DATE_AND_TIME} --- Date and time subroutine
2339 @findex @code{DATE_AND_TIME} intrinsic
2340 @cindex DATE_AND_TIME
2343 @item @emph{Description}:
2344 @code{DATE_AND_TIME(DATE, TIME, ZONE, VALUES)} gets the corresponding date and
2345 time information from the real-time system clock. @var{DATE} is
2346 @code{INTENT(OUT)} and has form ccyymmdd. @var{TIME} is @code{INTENT(OUT)} and
2347 has form hhmmss.sss. @var{ZONE} is @code{INTENT(OUT)} and has form (+-)hhmm,
2348 representing the difference with respect to Coordinated Universal Time (UTC).
2349 Unavailable time and date parameters return blanks.
2351 @var{VALUES} is @code{INTENT(OUT)} and provides the following:
2353 @multitable @columnfractions .15 .30 .60
2354 @item @tab @code{VALUE(1)}: @tab The year
2355 @item @tab @code{VALUE(2)}: @tab The month
2356 @item @tab @code{VALUE(3)}: @tab The day of the month
2357 @item @tab @code{VALUE(4)}: @tab Time difference with UTC in minutes
2358 @item @tab @code{VALUE(5)}: @tab The hour of the day
2359 @item @tab @code{VALUE(6)}: @tab The minutes of the hour
2360 @item @tab @code{VALUE(7)}: @tab The seconds of the minute
2361 @item @tab @code{VALUE(8)}: @tab The milliseconds of the second
2364 @item @emph{Standard}:
2370 @item @emph{Syntax}:
2371 @code{CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])}
2373 @item @emph{Arguments}:
2374 @multitable @columnfractions .15 .80
2375 @item @var{DATE} @tab (Optional) The type shall be @code{CHARACTER(8)} or larger.
2376 @item @var{TIME} @tab (Optional) The type shall be @code{CHARACTER(10)} or larger.
2377 @item @var{ZONE} @tab (Optional) The type shall be @code{CHARACTER(5)} or larger.
2378 @item @var{VALUES}@tab (Optional) The type shall be @code{INTEGER(8)}.
2381 @item @emph{Return value}:
2384 @item @emph{Example}:
2386 program test_time_and_date
2387 character(8) :: date
2388 character(10) :: time
2389 character(5) :: zone
2390 integer,dimension(8) :: values
2391 ! using keyword arguments
2392 call date_and_time(date,time,zone,values)
2393 call date_and_time(DATE=date,ZONE=zone)
2394 call date_and_time(TIME=time)
2395 call date_and_time(VALUES=values)
2396 print '(a,2x,a,2x,a)', date, time, zone
2397 print '(8i5))', values
2398 end program test_time_and_date
2405 @section @code{DBLE} --- Double conversion function
2406 @findex @code{DBLE} intrinsic
2407 @cindex double conversion
2410 @item @emph{Description}:
2411 @code{DBLE(X)} Converts @var{X} to double precision real type.
2413 @item @emph{Standard}:
2419 @item @emph{Syntax}:
2422 @item @emph{Arguments}:
2423 @multitable @columnfractions .15 .80
2424 @item @var{X} @tab The type shall be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
2427 @item @emph{Return value}:
2428 The return value is of type double precision real.
2430 @item @emph{Example}:
2435 complex :: z = (2.3,1.14)
2436 print *, dble(x), dble(i), dble(z)
2437 end program test_dble
2440 @item @emph{See also}:
2441 @ref{DFLOAT}, @ref{FLOAT}, @ref{REAL}
2447 @section @code{DCMPLX} --- Double complex conversion function
2448 @findex @code{DCMPLX} intrinsic
2452 @item @emph{Description}:
2453 @code{DCMPLX(X [,Y])} returns a double complex number where @var{X} is
2454 converted to the real component. If @var{Y} is present it is converted to the
2455 imaginary component. If @var{Y} is not present then the imaginary component is
2456 set to 0.0. If @var{X} is complex then @var{Y} must not be present.
2458 @item @emph{Standard}:
2464 @item @emph{Syntax}:
2465 @code{C = DCMPLX(X)}
2466 @code{C = DCMPLX(X,Y)}
2468 @item @emph{Arguments}:
2469 @multitable @columnfractions .15 .80
2470 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
2471 @item @var{Y} @tab Optional if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}.
2474 @item @emph{Return value}:
2475 The return value is of type @code{COMPLEX(8)}
2477 @item @emph{Example}:
2487 print *, dcmplx(x,i)
2488 end program test_dcmplx
2495 @section @code{DFLOAT} --- Double conversion function
2496 @findex @code{DFLOAT} intrinsic
2497 @cindex double float conversion
2500 @item @emph{Description}:
2501 @code{DFLOAT(X)} Converts @var{X} to double precision real type.
2503 @item @emph{Standard}:
2509 @item @emph{Syntax}:
2510 @code{X = DFLOAT(X)}
2512 @item @emph{Arguments}:
2513 @multitable @columnfractions .15 .80
2514 @item @var{X} @tab The type shall be @code{INTEGER(*)}.
2517 @item @emph{Return value}:
2518 The return value is of type double precision real.
2520 @item @emph{Example}:
2525 end program test_dfloat
2528 @item @emph{See also}:
2529 @ref{DBLE}, @ref{FLOAT}, @ref{REAL}
2535 @section @code{DIGITS} --- Significant digits function
2536 @findex @code{DIGITS} intrinsic
2537 @cindex digits, significant
2540 @item @emph{Description}:
2541 @code{DIGITS(X)} returns the number of significant digits of the internal model
2542 representation of @var{X}. For example, on a system using a 32-bit
2543 floating point representation, a default real number would likely return 24.
2545 @item @emph{Standard}:
2551 @item @emph{Syntax}:
2552 @code{C = DIGITS(X)}
2554 @item @emph{Arguments}:
2555 @multitable @columnfractions .15 .80
2556 @item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
2559 @item @emph{Return value}:
2560 The return value is of type @code{INTEGER}.
2562 @item @emph{Example}:
2565 integer :: i = 12345
2571 end program test_digits
2578 @section @code{DIM} --- Dim function
2579 @findex @code{DIM} intrinsic
2580 @findex @code{IDIM} intrinsic
2581 @findex @code{DDIM} intrinsic
2585 @item @emph{Description}:
2586 @code{DIM(X,Y)} returns the difference @code{X-Y} if the result is positive;
2587 otherwise returns zero.
2589 @item @emph{Standard}:
2595 @item @emph{Syntax}:
2598 @item @emph{Arguments}:
2599 @multitable @columnfractions .15 .80
2600 @item @var{X} @tab The type shall be @code{INTEGER(*)} or @code{REAL(*)}
2601 @item @var{Y} @tab The type shall be the same type and kind as @var{X}.
2604 @item @emph{Return value}:
2605 The return value is of type @code{INTEGER(*)} or @code{REAL(*)}.
2607 @item @emph{Example}:
2613 x = dim(4.345_8, 2.111_8)
2616 end program test_dim
2619 @item @emph{Specific names}:
2620 @multitable @columnfractions .20 .20 .20 .40
2621 @item Name @tab Argument @tab Return type @tab Standard
2622 @item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X,Y} @tab @code{INTEGER(4)} @tab F77 and later
2623 @item @code{DDIM(X,Y)} @tab @code{REAL(8) X,Y} @tab @code{REAL(8)} @tab F77 and later
2630 @section @code{DOT_PRODUCT} --- Dot product function
2631 @findex @code{DOT_PRODUCT} intrinsic
2635 @item @emph{Description}:
2636 @code{DOT_PRODUCT(X,Y)} computes the dot product multiplication of two vectors
2637 @var{X} and @var{Y}. The two vectors may be either numeric or logical
2638 and must be arrays of rank one and of equal size. If the vectors are
2639 @code{INTEGER(*)} or @code{REAL(*)}, the result is @code{SUM(X*Y)}. If the
2640 vectors are @code{COMPLEX(*)}, the result is @code{SUM(CONJG(X)*Y)}. If the
2641 vectors are @code{LOGICAL}, the result is @code{ANY(X.AND.Y)}.
2643 @item @emph{Standard}:
2647 transformational function
2649 @item @emph{Syntax}:
2650 @code{S = DOT_PRODUCT(X,Y)}
2652 @item @emph{Arguments}:
2653 @multitable @columnfractions .15 .80
2654 @item @var{X} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2655 @item @var{Y} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2658 @item @emph{Return value}:
2659 If the arguments are numeric, the return value is a scaler of numeric type,
2660 @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}. If the arguments are
2661 @code{LOGICAL}, the return value is @code{.TRUE.} or @code{.FALSE.}.
2663 @item @emph{Example}:
2665 program test_dot_prod
2666 integer, dimension(3) :: a, b
2673 print *, dot_product(a,b)
2674 end program test_dot_prod
2681 @section @code{DPROD} --- Double product function
2682 @findex @code{DPROD} intrinsic
2683 @cindex Double product
2686 @item @emph{Description}:
2687 @code{DPROD(X,Y)} returns the product @code{X*Y}.
2689 @item @emph{Standard}:
2695 @item @emph{Syntax}:
2696 @code{D = DPROD(X,Y)}
2698 @item @emph{Arguments}:
2699 @multitable @columnfractions .15 .80
2700 @item @var{X} @tab The type shall be @code{REAL}.
2701 @item @var{Y} @tab The type shall be @code{REAL}.
2704 @item @emph{Return value}:
2705 The return value is of type @code{REAL(8)}.
2707 @item @emph{Example}:
2716 end program test_dprod
2723 @section @code{DREAL} --- Double real part function
2724 @findex @code{DREAL} intrinsic
2725 @cindex Double real part
2728 @item @emph{Description}:
2729 @code{DREAL(Z)} returns the real part of complex variable @var{Z}.
2731 @item @emph{Standard}:
2737 @item @emph{Syntax}:
2740 @item @emph{Arguments}:
2741 @multitable @columnfractions .15 .80
2742 @item @var{Z} @tab The type shall be @code{COMPLEX(8)}.
2745 @item @emph{Return value}:
2746 The return value is of type @code{REAL(8)}.
2748 @item @emph{Example}:
2751 complex(8) :: z = (1.3_8,7.2_8)
2753 end program test_dreal
2756 @item @emph{See also}:
2764 @section @code{DTIME} --- Execution time subroutine (or function)
2765 @findex @code{DTIME} intrinsic
2766 @cindex dtime subroutine
2769 @item @emph{Description}:
2770 @code{DTIME(TARRAY, RESULT)} initially returns the number of seconds of runtime
2771 since the start of the process's execution in @var{RESULT}. @var{TARRAY}
2772 returns the user and system components of this time in @code{TARRAY(1)} and
2773 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) +
2776 Subsequent invocations of @code{DTIME} return values accumulated since the
2777 previous invocation.
2779 On some systems, the underlying timings are represented using types with
2780 sufficiently small limits that overflows (wrap around) are possible, such as
2781 32-bit types. Therefore, the values returned by this intrinsic might be, or
2782 become, negative, or numerically less than previous values, during a single
2783 run of the compiled program.
2785 If @code{DTIME} is invoked as a function, it can not be invoked as a
2786 subroutine, and vice versa.
2788 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2790 @multitable @columnfractions .15 .30 .60
2791 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2792 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2793 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2796 @item @emph{Standard}:
2802 @item @emph{Syntax}:
2803 @multitable @columnfractions .80
2804 @item @code{CALL DTIME(TARRAY, RESULT)}.
2805 @item @code{RESULT = DTIME(TARRAY)}, (not recommended).
2808 @item @emph{Arguments}:
2809 @multitable @columnfractions .15 .80
2810 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2811 @item @var{RESULT}@tab The type shall be @code{REAL}.
2814 @item @emph{Return value}:
2815 Elapsed time in seconds since the start of program execution.
2817 @item @emph{Example}:
2821 real, dimension(2) :: tarray
2823 call dtime(tarray, result)
2827 do i=1,100000000 ! Just a delay
2830 call dtime(tarray, result)
2834 end program test_dtime
2841 @section @code{EOSHIFT} --- End-off shift function
2842 @findex @code{EOSHIFT} intrinsic
2843 @cindex bit manipulation
2846 @item @emph{Description}:
2847 @code{EOSHIFT(ARRAY, SHIFT[,BOUNDARY, DIM])} performs an end-off shift on
2848 elements of @var{ARRAY} along the dimension of @var{DIM}. If @var{DIM} is
2849 omitted it is taken to be @code{1}. @var{DIM} is a scaler of type
2850 @code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is the
2851 rank of @var{ARRAY}. If the rank of @var{ARRAY} is one, then all elements of
2852 @var{ARRAY} are shifted by @var{SHIFT} places. If rank is greater than one,
2853 then all complete rank one sections of @var{ARRAY} along the given dimension are
2854 shifted. Elements shifted out one end of each rank one section are dropped. If
2855 @var{BOUNDARY} is present then the corresponding value of from @var{BOUNDARY}
2856 is copied back in the other end. If @var{BOUNDARY} is not present then the
2857 following are copied in depending on the type of @var{ARRAY}.
2859 @multitable @columnfractions .15 .80
2860 @item @emph{Array Type} @tab @emph{Boundary Value}
2861 @item Numeric @tab 0 of the type and kind of @var{ARRAY}.
2862 @item Logical @tab @code{.FALSE.}.
2863 @item Character(@var{len}) @tab @var{len} blanks.
2866 @item @emph{Standard}:
2870 transformational function
2872 @item @emph{Syntax}:
2873 @code{A = EOSHIFT(A, SHIFT[,BOUNDARY, DIM])}
2875 @item @emph{Arguments}:
2876 @multitable @columnfractions .15 .80
2877 @item @var{ARRAY} @tab May be any type, not scaler.
2878 @item @var{SHIFT} @tab The type shall be @code{INTEGER}.
2879 @item @var{BOUNDARY} @tab Same type as @var{ARRAY}.
2880 @item @var{DIM} @tab The type shall be @code{INTEGER}.
2883 @item @emph{Return value}:
2884 Returns an array of same type and rank as the @var{ARRAY} argument.
2886 @item @emph{Example}:
2888 program test_eoshift
2889 integer, dimension(3,3) :: a
2890 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2891 print '(3i3)', a(1,:)
2892 print '(3i3)', a(2,:)
2893 print '(3i3)', a(3,:)
2894 a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
2896 print '(3i3)', a(1,:)
2897 print '(3i3)', a(2,:)
2898 print '(3i3)', a(3,:)
2899 end program test_eoshift
2906 @section @code{EPSILON} --- Epsilon function
2907 @findex @code{EPSILON} intrinsic
2908 @cindex epsilon, significant
2911 @item @emph{Description}:
2912 @code{EPSILON(X)} returns a nearly negligible number relative to @code{1}.
2914 @item @emph{Standard}:
2920 @item @emph{Syntax}:
2921 @code{C = EPSILON(X)}
2923 @item @emph{Arguments}:
2924 @multitable @columnfractions .15 .80
2925 @item @var{X} @tab The type shall be @code{REAL(*)}.
2928 @item @emph{Return value}:
2929 The return value is of same type as the argument.
2931 @item @emph{Example}:
2933 program test_epsilon
2938 end program test_epsilon
2945 @section @code{ERF} --- Error function
2946 @findex @code{ERF} intrinsic
2947 @cindex error function
2950 @item @emph{Description}:
2951 @code{ERF(X)} computes the error function of @var{X}.
2953 @item @emph{Standard}:
2959 @item @emph{Syntax}:
2962 @item @emph{Arguments}:
2963 @multitable @columnfractions .15 .80
2964 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
2967 @item @emph{Return value}:
2968 The return value is a scalar of type @code{REAL(*)} and it is positive
2969 (@math{ - 1 \leq erf (x) \leq 1 }.
2971 @item @emph{Example}:
2974 real(8) :: x = 0.17_8
2976 end program test_erf
2979 @item @emph{Specific names}:
2980 @multitable @columnfractions .20 .20 .20 .40
2981 @item Name @tab Argument @tab Return type @tab Standard
2982 @item @code{DERF(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab GNU extension
2989 @section @code{ERFC} --- Error function
2990 @findex @code{ERFC} intrinsic
2991 @cindex error function
2994 @item @emph{Description}:
2995 @code{ERFC(X)} computes the complementary error function of @var{X}.
2997 @item @emph{Standard}:
3003 @item @emph{Syntax}:
3006 @item @emph{Arguments}:
3007 @multitable @columnfractions .15 .80
3008 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
3011 @item @emph{Return value}:
3012 The return value is a scalar of type @code{REAL(*)} and it is positive
3013 (@math{ 0 \leq erfc (x) \leq 2 }.
3015 @item @emph{Example}:
3018 real(8) :: x = 0.17_8
3020 end program test_erfc
3023 @item @emph{Specific names}:
3024 @multitable @columnfractions .20 .20 .20 .40
3025 @item Name @tab Argument @tab Return type @tab Standard
3026 @item @code{DERFC(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab GNU extension
3033 @section @code{ETIME} --- Execution time subroutine (or function)
3034 @findex @code{ETIME} intrinsic
3035 @cindex time functions
3038 @item @emph{Description}:
3039 @code{ETIME(TARRAY, RESULT)} returns the number of seconds of runtime
3040 since the start of the process's execution in @var{RESULT}. @var{TARRAY}
3041 returns the user and system components of this time in @code{TARRAY(1)} and
3042 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
3044 On some systems, the underlying timings are represented using types with
3045 sufficiently small limits that overflows (wrap around) are possible, such as
3046 32-bit types. Therefore, the values returned by this intrinsic might be, or
3047 become, negative, or numerically less than previous values, during a single
3048 run of the compiled program.
3050 If @code{ETIME} is invoked as a function, it can not be invoked as a
3051 subroutine, and vice versa.
3053 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
3055 @multitable @columnfractions .15 .30 .60
3056 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
3057 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
3058 @item @tab @code{RESULT}: @tab Run time since start in seconds.
3061 @item @emph{Standard}:
3067 @item @emph{Syntax}:
3068 @multitable @columnfractions .8
3069 @item @code{CALL ETIME(TARRAY, RESULT)}.
3070 @item @code{RESULT = ETIME(TARRAY)}, (not recommended).
3073 @item @emph{Arguments}:
3074 @multitable @columnfractions .15 .80
3075 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
3076 @item @var{RESULT}@tab The type shall be @code{REAL}.
3079 @item @emph{Return value}:
3080 Elapsed time in seconds since the start of program execution.
3082 @item @emph{Example}:
3086 real, dimension(2) :: tarray
3088 call ETIME(tarray, result)
3092 do i=1,100000000 ! Just a delay
3095 call ETIME(tarray, result)
3099 end program test_etime
3102 @item @emph{See also}:
3110 @section @code{EXIT} --- Exit the program with status.
3115 @item @emph{Description}:
3116 @code{EXIT} causes immediate termination of the program with status. If status
3117 is omitted it returns the canonical @emph{success} for the system. All Fortran
3118 I/O units are closed.
3120 @item @emph{Standard}:
3126 @item @emph{Syntax}:
3127 @code{CALL EXIT([STATUS])}
3129 @item @emph{Arguments}:
3130 @multitable @columnfractions .15 .80
3131 @item @var{STATUS} @tab The type of the argument shall be @code{INTEGER(*)}.
3134 @item @emph{Return value}:
3135 @code{STATUS} is passed to the parent process on exit.
3137 @item @emph{Example}:
3140 integer :: STATUS = 0
3141 print *, 'This program is going to exit.'
3143 end program test_exit
3146 @item @emph{See also}:
3147 @ref{ABORT}, @ref{KILL}
3153 @section @code{EXP} --- Exponential function
3154 @findex @code{EXP} intrinsic
3155 @findex @code{DEXP} intrinsic
3156 @findex @code{ZEXP} intrinsic
3157 @findex @code{CDEXP} intrinsic
3161 @item @emph{Description}:
3162 @code{EXP(X)} computes the base @math{e} exponential of @var{X}.
3164 @item @emph{Standard}:
3165 F77 and later, has overloads that are GNU extensions
3170 @item @emph{Syntax}:
3173 @item @emph{Arguments}:
3174 @multitable @columnfractions .15 .80
3175 @item @var{X} @tab The type shall be @code{REAL(*)} or
3179 @item @emph{Return value}:
3180 The return value has same type and kind as @var{X}.
3182 @item @emph{Example}:
3187 end program test_exp
3190 @item @emph{Specific names}:
3191 @multitable @columnfractions .20 .20 .20 .40
3192 @item Name @tab Argument @tab Return type @tab Standard
3193 @item @code{DEXP(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
3194 @item @code{CEXP(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab F77 and later
3195 @item @code{ZEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
3196 @item @code{CDEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
3203 @section @code{EXPONENT} --- Exponent function
3204 @findex @code{EXPONENT} intrinsic
3205 @cindex exponent function
3208 @item @emph{Description}:
3209 @code{EXPONENT(X)} returns the value of the exponent part of @var{X}. If @var{X}
3210 is zero the value returned is zero.
3212 @item @emph{Standard}:
3218 @item @emph{Syntax}:
3219 @code{I = EXPONENT(X)}
3221 @item @emph{Arguments}:
3222 @multitable @columnfractions .15 .80
3223 @item @var{X} @tab The type shall be @code{REAL(*)}.
3226 @item @emph{Return value}:
3227 The return value is of type default @code{INTEGER}.
3229 @item @emph{Example}:
3231 program test_exponent
3236 print *, exponent(0.0)
3237 end program test_exponent
3243 @section @code{FDATE} --- Get the current time as a string
3244 @findex @code{FDATE} intrinsic
3245 @cindex fdate subroutine
3248 @item @emph{Description}:
3249 @code{FDATE(DATE)} returns the current date (using the same format as
3250 @code{CTIME}) in @var{DATE}. It is equivalent to @code{CALL CTIME(DATE,
3253 If @code{FDATE} is invoked as a function, it can not be invoked as a
3254 subroutine, and vice versa.
3256 @var{DATE} is an @code{INTENT(OUT)} @code{CHARACTER} variable.
3258 @item @emph{Standard}:
3264 @item @emph{Syntax}:
3265 @multitable @columnfractions .80
3266 @item @code{CALL FDATE(DATE)}.
3267 @item @code{DATE = FDATE()}, (not recommended).
3270 @item @emph{Arguments}:
3271 @multitable @columnfractions .15 .80
3272 @item @var{DATE}@tab The type shall be of type @code{CHARACTER}.
3275 @item @emph{Return value}:
3276 The current date and time as a string.
3278 @item @emph{Example}:
3282 character(len=30) :: date
3284 print *, 'Program started on ', date
3285 do i = 1, 100000000 ! Just a delay
3289 print *, 'Program ended on ', date
3290 end program test_fdate
3296 @section @code{FLOAT} --- Convert integer to default real
3297 @findex @code{FLOAT} intrinsic
3298 @cindex conversion function (float)
3301 @item @emph{Description}:
3302 @code{FLOAT(I)} converts the integer @var{I} to a default real value.
3304 @item @emph{Standard}:
3310 @item @emph{Syntax}:
3313 @item @emph{Arguments}:
3314 @multitable @columnfractions .15 .80
3315 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
3318 @item @emph{Return value}:
3319 The return value is of type default @code{REAL}
3321 @item @emph{Example}:
3325 if (float(i) /= 1.) call abort
3326 end program test_float
3329 @item @emph{See also}:
3330 @ref{DBLE}, @ref{DFLOAT}, @ref{REAL}
3336 @section @code{FGET} --- Read a single character in stream mode from stdin
3337 @findex @code{FGET} intrinsic
3338 @cindex file operations
3339 @cindex stream operations
3342 @item @emph{Description}:
3343 Read a single character in stream mode from stdin by bypassing normal
3344 formatted output. Stream I/O should not be mixed with normal record-oriented
3345 (formatted or unformatted) I/O on the same unit; the results are unpredictable.
3347 This intrinsic routine is provided for backwards compatibility with
3348 @command{g77}. GNU Fortran provides the Fortran 2003 Stream facility.
3349 Programmers should consider the use of new stream IO feature in new code
3350 for future portability. See also @ref{Fortran 2003 status}.
3352 @item @emph{Standard}:
3356 Non-elemental subroutine
3358 @item @emph{Syntax}:
3359 @code{CALL fget(C[,STATUS])}
3361 @item @emph{Arguments}:
3362 @multitable @columnfractions .15 .80
3363 @item @var{C} @tab The type shall be @code{CHARACTER}.
3364 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
3365 -1 on end-of-file and a system specific positive error code otherwise.
3368 @item @emph{Example}:
3371 INTEGER, PARAMETER :: strlen = 100
3372 INTEGER :: status, i = 1
3373 CHARACTER(len=strlen) :: str = ""
3375 WRITE (*,*) 'Enter text:'
3377 CALL fget(str(i:i), status)
3378 if (status /= 0 .OR. i > strlen) exit
3381 WRITE (*,*) TRIM(str)
3385 @item @emph{See also}:
3386 @ref{FGETC}, @ref{FPUT}, @ref{FPUTC}
3391 @section @code{FGETC} --- Read a single character in stream mode
3392 @findex @code{FGETC} intrinsic
3393 @cindex file operations
3394 @cindex stream operations
3397 @item @emph{Description}:
3398 Read a single character in stream mode by bypassing normal formatted output.
3399 Stream I/O should not be mixed with normal record-oriented (formatted or
3400 unformatted) I/O on the same unit; the results are unpredictable.
3402 This intrinsic routine is provided for backwards compatibility with
3403 @command{g77}. GNU Fortran provides the Fortran 2003 Stream facility.
3404 Programmers should consider the use of new stream IO feature in new code
3405 for future portability. See also @ref{Fortran 2003 status}.
3407 @item @emph{Standard}:
3411 Non-elemental subroutine
3413 @item @emph{Syntax}:
3414 @code{CALL fgetc(UNIT,C[,STATUS])}
3416 @item @emph{Arguments}:
3417 @multitable @columnfractions .15 .80
3418 @item @var{UNIT} @tab The type shall be @code{INTEGER}.
3419 @item @var{C} @tab The type shall be @code{CHARACTER}.
3420 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
3421 -1 on end-of-file and a system specific positive error code otherwise.
3424 @item @emph{Example}:
3427 INTEGER :: fd = 42, status
3430 OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD")
3432 CALL fgetc(fd, c, status)
3433 IF (status /= 0) EXIT
3440 @item @emph{See also}:
3441 @ref{FGET}, @ref{FPUT}, @ref{FPUTC}
3447 @section @code{FLOOR} --- Integer floor function
3448 @findex @code{FLOOR} intrinsic
3452 @item @emph{Description}:
3453 @code{FLOOR(X)} returns the greatest integer less than or equal to @var{X}.
3455 @item @emph{Standard}:
3461 @item @emph{Syntax}:
3462 @code{I = FLOOR(X[,KIND])}
3464 @item @emph{Arguments}:
3465 @multitable @columnfractions .15 .80
3466 @item @var{X} @tab The type shall be @code{REAL(*)}.
3467 @item @var{KIND} @tab Optional scaler integer initialization expression.
3470 @item @emph{Return value}:
3471 The return value is of type @code{INTEGER(KIND)}
3473 @item @emph{Example}:
3478 print *, floor(x) ! returns 63
3479 print *, floor(y) ! returns -64
3480 end program test_floor
3483 @item @emph{See also}:
3484 @ref{CEILING}, @ref{NINT}
3491 @section @code{FLUSH} --- Flush I/O unit(s)
3492 @findex @code{FLUSH}
3496 @item @emph{Description}:
3497 Flushes Fortran unit(s) currently open for output. Without the optional
3498 argument, all units are flushed, otherwise just the unit specified.
3500 @item @emph{Standard}:
3504 non-elemental subroutine
3506 @item @emph{Syntax}:
3507 @code{CALL FLUSH(UNIT)}
3509 @item @emph{Arguments}:
3510 @multitable @columnfractions .15 .80
3511 @item @var{UNIT} @tab (Optional) The type shall be @code{INTEGER}.
3515 Beginning with the Fortran 2003 standard, there is a @code{FLUSH}
3516 statement that should be preferred over the @code{FLUSH} intrinsic.
3523 @section @code{FNUM} --- File number function
3524 @findex @code{FNUM} intrinsic
3528 @item @emph{Description}:
3529 @code{FNUM(UNIT)} returns the POSIX file descriptor number corresponding to the
3530 open Fortran I/O unit @code{UNIT}.
3532 @item @emph{Standard}:
3536 non-elemental function
3538 @item @emph{Syntax}:
3539 @code{I = FNUM(UNIT)}
3541 @item @emph{Arguments}:
3542 @multitable @columnfractions .15 .80
3543 @item @var{UNIT} @tab The type shall be @code{INTEGER}.
3546 @item @emph{Return value}:
3547 The return value is of type @code{INTEGER}
3549 @item @emph{Example}:
3553 open (unit=10, status = "scratch")
3557 end program test_fnum
3564 @section @code{FPUT} --- Write a single character in stream mode to stdout
3565 @findex @code{FPUT} intrinsic
3566 @cindex file operations
3567 @cindex stream operations
3570 @item @emph{Description}:
3571 Write a single character in stream mode to stdout by bypassing normal
3572 formatted output. Stream I/O should not be mixed with normal record-oriented
3573 (formatted or unformatted) I/O on the same unit; the results are unpredictable.
3575 This intrinsic routine is provided for backwards compatibility with
3576 @command{g77}. GNU Fortran provides the Fortran 2003 Stream facility.
3577 Programmers should consider the use of new stream IO feature in new code
3578 for future portability. See also @ref{Fortran 2003 status}.
3580 @item @emph{Standard}:
3584 Non-elemental subroutine
3586 @item @emph{Syntax}:
3587 @code{CALL fput(C[,STATUS])}
3589 @item @emph{Arguments}:
3590 @multitable @columnfractions .15 .80
3591 @item @var{C} @tab The type shall be @code{CHARACTER}.
3592 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
3593 -1 on end-of-file and a system specific positive error code otherwise.
3596 @item @emph{Example}:
3599 CHARACTER(len=*) :: str = "gfortran"
3601 DO i = 1, len_trim(str)
3607 @item @emph{See also}:
3608 @ref{FPUTC}, @ref{FGET}, @ref{FGETC}
3614 @section @code{FPUTC} --- Write a single character in stream mode
3615 @findex @code{FPUTC} intrinsic
3616 @cindex file operations
3617 @cindex stream operations
3620 @item @emph{Description}:
3621 Write a single character in stream mode by bypassing normal formatted
3622 output. Stream I/O should not be mixed with normal record-oriented
3623 (formatted or unformatted) I/O on the same unit; the results are unpredictable.
3625 This intrinsic routine is provided for backwards compatibility with
3626 @command{g77}. GNU Fortran provides the Fortran 2003 Stream facility.
3627 Programmers should consider the use of new stream IO feature in new code
3628 for future portability. See also @ref{Fortran 2003 status}.
3630 @item @emph{Standard}:
3634 Non-elemental subroutine
3636 @item @emph{Syntax}:
3637 @code{CALL fputc(UNIT,C[,STATUS])}
3639 @item @emph{Arguments}:
3640 @multitable @columnfractions .15 .80
3641 @item @var{UNIT} @tab The type shall be @code{INTEGER}.
3642 @item @var{C} @tab The type shall be @code{CHARACTER}.
3643 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
3644 -1 on end-of-file and a system specific positive error code otherwise.
3647 @item @emph{Example}:
3650 CHARACTER(len=*) :: str = "gfortran"
3651 INTEGER :: fd = 42, i
3653 OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
3654 DO i = 1, len_trim(str)
3655 CALL fputc(fd, str(i:i))
3661 @item @emph{See also}:
3662 @ref{FPUT}, @ref{FGET}, @ref{FGETC}
3668 @section @code{FRACTION} --- Fractional part of the model representation
3669 @findex @code{FRACTION} intrinsic
3670 @cindex fractional part
3673 @item @emph{Description}:
3674 @code{FRACTION(X)} returns the fractional part of the model
3675 representation of @code{X}.
3677 @item @emph{Standard}:
3683 @item @emph{Syntax}:
3684 @code{Y = FRACTION(X)}
3686 @item @emph{Arguments}:
3687 @multitable @columnfractions .15 .80
3688 @item @var{X} @tab The type of the argument shall be a @code{REAL}.
3691 @item @emph{Return value}:
3692 The return value is of the same type and kind as the argument.
3693 The fractional part of the model representation of @code{X} is returned;
3694 it is @code{X * RADIX(X)**(-EXPONENT(X))}.
3696 @item @emph{Example}:
3698 program test_fraction
3701 print *, fraction(x), x * radix(x)**(-exponent(x))
3702 end program test_fraction
3710 @section @code{FREE} --- Frees memory
3711 @findex @code{FREE} intrinsic
3715 @item @emph{Description}:
3716 Frees memory previously allocated by @code{MALLOC()}. The @code{FREE}
3717 intrinsic is an extension intended to be used with Cray pointers, and is
3718 provided in GNU Fortran to allow user to compile legacy code. For
3719 new code using Fortran 95 pointers, the memory de-allocation intrinsic is
3722 @item @emph{Standard}:
3728 @item @emph{Syntax}:
3731 @item @emph{Arguments}:
3732 @multitable @columnfractions .15 .80
3733 @item @var{PTR} @tab The type shall be @code{INTEGER}. It represents the
3734 location of the memory that should be de-allocated.
3737 @item @emph{Return value}:
3740 @item @emph{Example}:
3741 See @code{MALLOC} for an example.
3743 @item @emph{See also}:
3751 @section @code{FSTAT} --- Get file status
3752 @findex @code{FSTAT} intrinsic
3753 @cindex undocumented intrinsic
3755 Intrinsic implemented, documentation pending.
3758 @item @emph{Description}:
3761 @item @emph{Standard}:
3763 @item @emph{Syntax}:
3764 @item @emph{Arguments}:
3765 @item @emph{Return value}:
3766 @item @emph{Example}:
3767 @item @emph{Specific names}:
3768 @item @emph{See also}:
3774 @section @code{FSEEK} --- Low level file positioning subroutine
3775 @findex @code{FSEEK}
3776 @cindex file system functions
3778 Not yet implemented in GNU Fortran.
3781 @item @emph{Description}:
3783 @item @emph{Standard}:
3789 @item @emph{Syntax}:
3790 @item @emph{Arguments}:
3791 @item @emph{Return value}:
3792 @item @emph{Example}:
3793 @item @emph{Specific names}:
3794 @item @emph{See also}:
3795 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
3802 @section @code{FTELL} --- Current stream position
3803 @findex @code{FTELL} intrinsic
3804 @cindex undocumented intrinsic
3806 Intrinsic implemented, documentation pending.
3809 @item @emph{Description}:
3810 @item @emph{Standard}:
3814 @item @emph{Syntax}:
3815 @item @emph{Arguments}:
3816 @item @emph{Return value}:
3817 @item @emph{Example}:
3818 @item @emph{Specific names}:
3819 @item @emph{See also}:
3825 @section @code{GETARG} --- Get command line arguments
3826 @findex @code{GETARG} intrinsic
3827 @cindex undocumented intrinsic
3829 Intrinsic implemented, documentation pending.
3832 @item @emph{Description}:
3833 @item @emph{Standard}:
3837 @item @emph{Syntax}:
3838 @item @emph{Arguments}:
3839 @item @emph{Return value}:
3840 @item @emph{Example}:
3841 @item @emph{Specific names}:
3843 @item @emph{See also}:
3844 @ref{IARGC}, @ref{GET_COMMAND}, @ref{GET_COMMAND_ARGUMENT}
3850 @section @code{GET_COMMAND} --- Subroutine to retrieve the entire command line
3851 @findex @code{GET_COMMAND} intrinsic
3852 @cindex undocumented intrinsic
3854 Intrinsic implemented, documentation pending.
3857 @item @emph{Description}:
3858 @item @emph{Standard}:
3862 @item @emph{Syntax}:
3863 @item @emph{Arguments}:
3864 @item @emph{Return value}:
3865 @item @emph{Example}:
3866 @item @emph{Specific names}:
3867 @item @emph{See also}:
3872 @node GET_COMMAND_ARGUMENT
3873 @section @code{GET_COMMAND_ARGUMENT} --- Subroutine to retrieve a command argument
3874 @findex @code{GET_COMMAND_ARGUMENT} intrinsic
3875 @cindex undocumented intrinsic
3877 Intrinsic implemented, documentation pending.
3880 @item @emph{Description}:
3881 @item @emph{Standard}:
3885 @item @emph{Syntax}:
3886 @item @emph{Arguments}:
3887 @item @emph{Return value}:
3888 @item @emph{Example}:
3889 @item @emph{Specific names}:
3890 @item @emph{See also}:
3891 @ref{COMMAND_ARGUMENT_COUNT}
3897 @section @code{GETCWD} --- Get current working directory
3898 @findex @code{GETCWD} intrinsic
3899 @cindex file system functions
3902 @item @emph{Description}:
3903 Get current working directory.
3905 @item @emph{Standard}:
3909 Non-elemental subroutine.
3911 @item @emph{Syntax}:
3912 @code{CALL getcwd(CWD[,STATUS])}
3914 @item @emph{Arguments}:
3915 @multitable @columnfractions .15 .80
3916 @item @var{CWD} @tab The type shall be @code{CHARACTER(*)}.
3917 @item @var{STATUS} @tab (Optional) status flag. Returns 0 on success,
3918 a system specific and non-zero error code otherwise.
3921 @item @emph{Example}:
3924 CHARACTER(len=255) :: cwd
3926 WRITE(*,*) TRIM(cwd)
3930 @item @emph{See also}:
3937 @section @code{GETENV} --- Get an environmental variable
3938 @findex @code{GETENV} intrinsic
3939 @cindex undocumented intrinsic
3941 Intrinsic implemented, documentation pending.
3944 @item @emph{Description}:
3945 @item @emph{Standard}:
3949 @item @emph{Syntax}:
3950 @item @emph{Arguments}:
3951 @item @emph{Return value}:
3952 @item @emph{Example}:
3953 @item @emph{Specific names}:
3954 @item @emph{See also}:
3955 @ref{GET_ENVIRONMENT_VARIABLE}
3960 @node GET_ENVIRONMENT_VARIABLE
3961 @section @code{GET_ENVIRONMENT_VARIABLE} --- Get an environmental variable
3962 @findex @code{GET_ENVIRONMENT_VARIABLE} intrinsic
3963 @cindex undocumented intrinsic
3965 Intrinsic implemented, documentation pending.
3968 @item @emph{Description}:
3969 @item @emph{Standard}:
3975 @item @emph{Syntax}:
3976 @item @emph{Arguments}:
3977 @item @emph{Return value}:
3978 @item @emph{Example}:
3979 @item @emph{Specific names}:
3980 @item @emph{See also}:
3986 @section @code{GETGID} --- Group ID function
3987 @findex @code{GETGID} intrinsic
3991 @item @emph{Description}:
3992 Returns the numerical group ID of the current process.
3994 @item @emph{Standard}:
4000 @item @emph{Syntax}:
4003 @item @emph{Return value}:
4004 The return value of @code{GETGID} is an @code{INTEGER} of the default
4008 @item @emph{Example}:
4009 See @code{GETPID} for an example.
4011 @item @emph{See also}:
4018 @section @code{GETLOG} --- Get login name
4019 @findex @code{GETLOG} intrinsic
4020 @cindex undocumented intrinsic
4022 Intrinsic implemented, documentation pending.
4025 @item @emph{Description}:
4026 @item @emph{Standard}:
4032 @item @emph{Syntax}:
4033 @item @emph{Arguments}:
4034 @item @emph{Return value}:
4035 @item @emph{Example}:
4036 @item @emph{Specific names}:
4037 @item @emph{See also}:
4044 @section @code{GETPID} --- Process ID function
4045 @findex @code{GETPID} intrinsic
4049 @item @emph{Description}:
4050 Returns the numerical process identifier of the current process.
4052 @item @emph{Standard}:
4058 @item @emph{Syntax}:
4061 @item @emph{Return value}:
4062 The return value of @code{GETPID} is an @code{INTEGER} of the default
4066 @item @emph{Example}:
4069 print *, "The current process ID is ", getpid()
4070 print *, "Your numerical user ID is ", getuid()
4071 print *, "Your numerical group ID is ", getgid()
4080 @section @code{GETUID} --- User ID function
4081 @findex @code{GETUID} intrinsic
4085 @item @emph{Description}:
4086 Returns the numerical user ID of the current process.
4088 @item @emph{Standard}:
4094 @item @emph{Syntax}:
4097 @item @emph{Return value}:
4098 The return value of @code{GETUID} is an @code{INTEGER} of the default
4102 @item @emph{Example}:
4103 See @code{GETPID} for an example.
4105 @item @emph{See also}:
4112 @section @code{GMTIME} --- Convert time to GMT info
4113 @findex @code{GMTIME}
4114 @cindex time function
4116 Not yet implemented in GNU Fortran.
4119 @item @emph{Description}:
4121 @item @emph{Standard}:
4127 @item @emph{Syntax}:
4128 @item @emph{Arguments}:
4129 @item @emph{Return value}:
4130 @item @emph{Example}:
4131 @item @emph{Specific names}:
4132 @item @emph{See also}:
4133 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
4140 @section @code{HOSTNM} --- Get system host name
4141 @findex @code{HOSTNM} intrinsic
4142 @cindex undocumented intrinsic
4144 Intrinsic implemented, documentation pending.
4147 @item @emph{Description}:
4148 @item @emph{Standard}:
4152 @item @emph{Syntax}:
4153 @item @emph{Arguments}:
4154 @item @emph{Return value}:
4155 @item @emph{Example}:
4156 @item @emph{Specific names}:
4157 @item @emph{See also}:
4163 @section @code{HUGE} --- Largest number of a kind
4164 @findex @code{HUGE} intrinsic
4168 @item @emph{Description}:
4169 @code{HUGE(X)} returns the largest number that is not an infinity in
4170 the model of the type of @code{X}.
4172 @item @emph{Standard}:
4178 @item @emph{Syntax}:
4181 @item @emph{Arguments}:
4182 @multitable @columnfractions .15 .80
4183 @item @var{X} @tab shall be of type @code{REAL} or @code{INTEGER}.
4186 @item @emph{Return value}:
4187 The return value is of the same type and kind as @var{X}
4189 @item @emph{Example}:
4191 program test_huge_tiny
4192 print *, huge(0), huge(0.0), huge(0.0d0)
4193 print *, tiny(0.0), tiny(0.0d0)
4194 end program test_huge_tiny
4201 @section @code{IACHAR} --- Code in @acronym{ASCII} collating sequence
4202 @findex @code{IACHAR} intrinsic
4203 @cindex @acronym{ASCII} collating sequence
4204 @cindex conversion function (character)
4207 @item @emph{Description}:
4208 @code{IACHAR(C)} returns the code for the @acronym{ASCII} character
4209 in the first character position of @code{C}.
4211 @item @emph{Standard}:
4217 @item @emph{Syntax}:
4218 @code{I = IACHAR(C)}
4220 @item @emph{Arguments}:
4221 @multitable @columnfractions .15 .80
4222 @item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)}
4225 @item @emph{Return value}:
4226 The return value is of type @code{INTEGER} and of the default integer
4229 @item @emph{Example}:
4234 end program test_iachar
4237 @item @emph{See also}:
4238 @ref{CHAR},@ref{ICHAR}
4244 @section @code{IAND} --- Bitwise logical and
4245 @findex @code{IAND} intrinsic
4246 @cindex bit operations
4248 Intrinsic implemented, documentation pending.
4251 @item @emph{Description}:
4252 @item @emph{Standard}:
4258 @item @emph{Syntax}:
4259 @item @emph{Arguments}:
4260 @item @emph{Return value}:
4261 @item @emph{Example}:
4262 @item @emph{Specific names}:
4264 @item @emph{See also}:
4265 @ref{IOR}, @ref{IEOR}, @ref{IBITS}, @ref{IBSET}, @ref{IBCLR},
4272 @section @code{IARGC} --- Get number of command line arguments
4273 @findex @code{IARGC} intrinsic
4274 @cindex undocumented intrinsic
4276 Intrinsic implemented, documentation pending.
4279 @item @emph{Description}:
4280 @item @emph{Standard}:
4284 @item @emph{Syntax}:
4285 @item @emph{Arguments}:
4286 @item @emph{Return value}:
4287 @item @emph{Example}:
4288 @item @emph{Specific names}:
4289 @item @emph{See also}:
4290 @ref{GETARG}, @ref{GET_COMMAND}, @ref{COMMAND_ARGUMENT_COUNT}, @ref{GET_COMMAND_ARGUMENT}
4298 @section @code{IBCLR} --- Clear bit
4299 @findex @code{IBCLR} intrinsic
4300 @cindex bit operations
4302 Intrinsic implemented, documentation pending.
4305 @item @emph{Description}:
4306 @item @emph{Standard}:
4312 @item @emph{Syntax}:
4313 @item @emph{Arguments}:
4314 @item @emph{Return value}:
4315 @item @emph{Example}:
4316 @item @emph{Specific names}:
4318 @item @emph{See also}:
4319 @ref{IBITS}, @ref{IBSET}, @ref{IAND}, @ref{IOR}, @ref{IEOR}
4326 @section @code{IBITS} --- Bit extraction
4327 @findex @code{IBITS} intrinsic
4328 @cindex bit operations
4330 Intrinsic implemented, documentation pending.
4333 @item @emph{Description}:
4334 @item @emph{Standard}:
4340 @item @emph{Syntax}:
4341 @item @emph{Arguments}:
4342 @item @emph{Return value}:
4343 @item @emph{Example}:
4344 @item @emph{Specific names}:
4345 @item @emph{See also}:
4346 @ref{IBCLR}, @ref{IBSET}, @ref{IAND}, @ref{IOR}, @ref{IEOR}
4354 @section @code{IBSET} --- Set bit
4355 @findex @code{IBSET} intrinsic
4356 @cindex bit operations
4358 Intrinsic implemented, documentation pending.
4361 @item @emph{Description}:
4362 @item @emph{Standard}:
4368 @item @emph{Syntax}:
4369 @item @emph{Arguments}:
4370 @item @emph{Return value}:
4371 @item @emph{Example}:
4372 @item @emph{Specific names}:
4374 @item @emph{See also}:
4375 @ref{IBCLR}, @ref{IBITS}, @ref{IAND}, @ref{IOR}, @ref{IEOR}
4382 @section @code{ICHAR} --- Character-to-integer conversion function
4383 @findex @code{ICHAR} intrinsic
4384 @cindex conversion function (character)
4387 @item @emph{Description}:
4388 @code{ICHAR(C)} returns the code for the character in the first character
4389 position of @code{C} in the system's native character set.
4390 The correspondence between characters and their codes is not necessarily
4391 the same across different GNU Fortran implementations.
4393 @item @emph{Standard}:
4399 @item @emph{Syntax}:
4402 @item @emph{Arguments}:
4403 @multitable @columnfractions .15 .80
4404 @item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)}
4407 @item @emph{Return value}:
4408 The return value is of type @code{INTEGER} and of the default integer
4411 @item @emph{Example}:
4416 end program test_ichar
4420 No intrinsic exists to convert a printable character string to a numerical
4421 value. For example, there is no intrinsic that, given the @code{CHARACTER}
4422 value 154, returns an @code{INTEGER} or @code{REAL} value with the
4425 Instead, you can use internal-file I/O to do this kind of conversion. For
4430 character(len=10) string
4433 read (string,'(I10)') value
4435 end program read_val
4440 @section @code{IDATE} --- Get current local time subroutine (day/month/year)
4441 @findex @code{IDATE} intrinsic
4444 @item @emph{Description}:
4445 @code{IDATE(TARRAY)} Fills @var{TARRAY} with the numerical values at the
4446 current local time. The day (in the range 1-31), month (in the range 1-12),
4447 and year appear in elements 1, 2, and 3 of @var{TARRAY}, respectively.
4448 The year has four significant digits.
4450 @item @emph{Standard}:
4456 @item @emph{Syntax}:
4457 @code{CALL IDATE(TARRAY)}
4459 @item @emph{Arguments}:
4460 @multitable @columnfractions .15 .80
4461 @item @var{TARRAY} @tab The type shall be @code{INTEGER, DIMENSION(3)} and
4462 the kind shall be the default integer kind.
4465 @item @emph{Return value}:
4468 @item @emph{Example}:
4471 integer, dimension(3) :: tarray
4476 end program test_idate
4483 @section @code{IEOR} --- Bitwise logical exclusive or
4484 @findex @code{IEOR} intrinsic
4485 @cindex bit operations
4487 Intrinsic implemented, documentation pending.
4490 @item @emph{Description}:
4491 @item @emph{Standard}:
4497 @item @emph{Syntax}:
4498 @item @emph{Arguments}:
4499 @item @emph{Return value}:
4500 @item @emph{Example}:
4501 @item @emph{Specific names}:
4503 @item @emph{See also}:
4504 @ref{IOR}, @ref{IAND}, @ref{IBITS}, @ref{IBSET}, @ref{IBCLR},
4511 @section @code{IERRNO} --- Get the last system error number
4512 @findex @code{IERRNO} intrinsic
4513 @cindex undocumented intrinsic
4515 Intrinsic implemented, documentation pending.
4518 @item @emph{Description}:
4519 @item @emph{Standard}:
4523 @item @emph{Syntax}:
4524 @item @emph{Arguments}:
4525 @item @emph{Return value}:
4526 @item @emph{Example}:
4528 @item @emph{See also}:
4536 @section @code{INDEX} --- Position of a substring within a string
4537 @findex @code{INDEX} intrinsic
4538 @cindex undocumented intrinsic
4540 Intrinsic implemented, documentation pending.
4543 @item @emph{Description}:
4544 @item @emph{Standard}:
4550 @item @emph{Syntax}:
4551 @item @emph{Arguments}:
4552 @item @emph{Return value}:
4553 @item @emph{Example}:
4554 @item @emph{Specific names}:
4555 @item @emph{See also}:
4562 @section @code{INT} --- Convert to integer type
4563 @findex @code{INT} intrinsic
4564 @findex @code{IFIX} intrinsic
4565 @findex @code{IDINT} intrinsic
4566 @cindex conversion function (integer)
4569 @item @emph{Description}:
4570 Convert to integer type
4572 @item @emph{Standard}:
4578 @item @emph{Syntax}:
4579 @multitable @columnfractions .30 .80
4580 @item @code{X = INT(X)}
4581 @item @code{X = INT(X, KIND)}
4584 @item @emph{Arguments}:
4585 @multitable @columnfractions .15 .80
4586 @item @var{X} @tab shall be of type @code{INTEGER(*)}, @code{REAL(*)} or @code{COMPLEX(*)}
4587 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer.
4590 @item @emph{Return value}:
4591 These functions return a @code{INTEGER(*)} variable or array under
4592 the following rules:
4596 If @var{X} is of type @code{INTEGER(*)}, @code{INT(X) = X}
4598 If @var{X} is of type @code{REAL(*)} and @math{|X| < 1} @code{INT(X)} equals @var{0}.
4599 If @math{|X| \geq 1}, then @code{INT(X)} equals the largest integer that does not exceed
4600 the range of @var{X} and whose sign is the same as the sign of @var{X}.
4602 If @var{X} is of type @code{COMPLEX(*)}, rule B is applied to the real part of X.
4605 @item @emph{Example}:
4609 complex :: z = (-3.7, 1.0)
4611 print *, int(z), int(z,8)
4615 @item @emph{Specific names}:
4616 @multitable @columnfractions .20 .20 .20 .40
4617 @item Name @tab Argument @tab Return type @tab Standard
4618 @item @code{IFIX(X)} @tab @code{REAL(4) X} @tab @code{INTEGER} @tab F77 and later
4619 @item @code{IDINT(X)} @tab @code{REAL(8) X} @tab @code{INTEGER} @tab F77 and later
4622 @comment @item @emph{See also}:
4629 @section @code{IOR} --- Bitwise logical or
4630 @findex @code{IOR} intrinsic
4631 @cindex bit operations
4633 Intrinsic implemented, documentation pending.
4636 @item @emph{Description}:
4637 @item @emph{Standard}:
4643 @item @emph{Syntax}:
4644 @item @emph{Arguments}:
4645 @item @emph{Return value}:
4646 @item @emph{Example}:
4647 @item @emph{Specific names}:
4649 @item @emph{See also}:
4650 @ref{IEOR}, @ref{IAND}, @ref{IBITS}, @ref{IBSET}, @ref{IBCLR},
4657 @section @code{IRAND} --- Integer pseudo-random number
4658 @findex @code{IRAND} intrinsic
4659 @cindex random number
4662 @item @emph{Description}:
4663 @code{IRAND(FLAG)} returns a pseudo-random number from a uniform
4664 distribution between 0 and a system-dependent limit (which is in most
4665 cases 2147483647). If @var{FLAG} is 0, the next number
4666 in the current sequence is returned; if @var{FLAG} is 1, the generator
4667 is restarted by @code{CALL SRAND(0)}; if @var{FLAG} has any other value,
4668 it is used as a new seed with @code{SRAND}.
4670 @item @emph{Standard}:
4674 non-elemental function
4676 @item @emph{Syntax}:
4677 @code{I = IRAND(FLAG)}
4679 @item @emph{Arguments}:
4680 @multitable @columnfractions .15 .80
4681 @item @var{FLAG} @tab shall be a scalar @code{INTEGER} of kind 4.
4684 @item @emph{Return value}:
4685 The return value is of @code{INTEGER(kind=4)} type.
4687 @item @emph{Example}:
4690 integer,parameter :: seed = 86456
4693 print *, irand(), irand(), irand(), irand()
4694 print *, irand(seed), irand(), irand(), irand()
4695 end program test_irand
4703 @section @code{ISHFT} --- Shift bits
4704 @findex @code{ISHFT} intrinsic
4705 @cindex bit manipulation
4707 Intrinsic implemented, documentation pending.
4710 @item @emph{Description}:
4711 @item @emph{Standard}:
4717 @item @emph{Syntax}:
4718 @item @emph{Arguments}:
4719 @item @emph{Return value}:
4720 @item @emph{Example}:
4721 @item @emph{Specific names}:
4723 @item @emph{See also}:
4731 @section @code{ISHFTC} --- Shift bits circularly
4732 @findex @code{ISHFTC} intrinsic
4733 @cindex bit manipulation
4735 Intrinsic implemented, documentation pending.
4738 @item @emph{Description}:
4739 @item @emph{Standard}:
4745 @item @emph{Syntax}:
4746 @item @emph{Arguments}:
4747 @item @emph{Return value}:
4748 @item @emph{Example}:
4749 @item @emph{Specific names}:
4751 @item @emph{See also}:
4758 @section @code{ITIME} --- Get current local time subroutine (hour/minutes/seconds)
4759 @findex @code{ITIME} intrinsic
4762 @item @emph{Description}:
4763 @code{IDATE(TARRAY)} Fills @var{TARRAY} with the numerical values at the
4764 current local time. The hour (in the range 1-24), minute (in the range 1-60),
4765 and seconds (in the range 1-60) appear in elements 1, 2, and 3 of @var{TARRAY},
4768 @item @emph{Standard}:
4774 @item @emph{Syntax}:
4775 @code{CALL ITIME(TARRAY)}
4777 @item @emph{Arguments}:
4778 @multitable @columnfractions .15 .80
4779 @item @var{TARRAY} @tab The type shall be @code{INTEGER, DIMENSION(3)}
4780 and the kind shall be the default integer kind.
4783 @item @emph{Return value}:
4787 @item @emph{Example}:
4790 integer, dimension(3) :: tarray
4795 end program test_itime
4802 @section @code{KILL} --- Send a signal to a process
4803 @findex @code{KILL} intrinsic
4804 @cindex undocumented intrinsic
4806 Intrinsic implemented, documentation pending.
4809 @item @emph{Description}:
4810 @item @emph{Standard}:
4816 @item @emph{Syntax}:
4817 @item @emph{Arguments}:
4818 @item @emph{Return value}:
4819 @item @emph{Example}:
4820 @item @emph{Specific names}:
4822 @item @emph{See also}:
4823 @ref{ABORT}, @ref{EXIT}
4829 @section @code{KIND} --- Kind of an entity
4830 @findex @code{KIND} intrinsic
4833 @item @emph{Description}:
4834 @code{KIND(X)} returns the kind value of the entity @var{X}.
4836 @item @emph{Standard}:
4842 @item @emph{Syntax}:
4845 @item @emph{Arguments}:
4846 @multitable @columnfractions .15 .80
4847 @item @var{X} @tab Shall be of type @code{LOGICAL}, @code{INTEGER},
4848 @code{REAL}, @code{COMPLEX} or @code{CHARACTER}.
4851 @item @emph{Return value}:
4852 The return value is a scalar of type @code{INTEGER} and of the default
4855 @item @emph{Example}:
4858 integer,parameter :: kc = kind(' ')
4859 integer,parameter :: kl = kind(.true.)
4861 print *, "The default character kind is ", kc
4862 print *, "The default logical kind is ", kl
4863 end program test_kind
4871 @section @code{LBOUND} --- Lower dimension bounds of an array
4872 @findex @code{LBOUND} intrinsic
4873 @cindex undocumented intrinsic
4875 Intrinsic implemented, documentation pending.
4878 @item @emph{Description}:
4879 @item @emph{Standard}:
4885 @item @emph{Syntax}:
4886 @item @emph{Arguments}:
4887 @item @emph{Return value}:
4888 @item @emph{Example}:
4889 @item @emph{See also}:
4897 @section @code{LEN} --- Length of a character entity
4898 @findex @code{LEN} intrinsic
4899 @cindex undocumented intrinsic
4901 Intrinsic implemented, documentation pending.
4904 @item @emph{Description}:
4905 @item @emph{Standard}:
4911 @item @emph{Syntax}:
4912 @item @emph{Arguments}:
4913 @item @emph{Return value}:
4914 @item @emph{Example}:
4915 @item @emph{Specific names}:
4917 @item @emph{See also}:
4918 @ref{LEN_TRIM}, @ref{ADJUSTL}, @ref{ADJUSTR}
4925 @section @code{LEN_TRIM} --- Length of a character entity without trailing blank characters
4926 @findex @code{LEN_TRIM} intrinsic
4927 @cindex undocumented intrinsic
4929 Intrinsic implemented, documentation pending.
4932 @item @emph{Description}:
4933 @item @emph{Standard}:
4939 @item @emph{Syntax}:
4940 @item @emph{Arguments}:
4941 @item @emph{Return value}:
4942 @item @emph{Example}:
4944 @item @emph{See also}:
4945 @ref{LEN}, @ref{ADJUSTL}, @ref{ADJUSTR}
4952 @section @code{LGE} --- Lexical greater than or equal
4953 @findex @code{LGE} intrinsic
4954 @cindex comparison (lexical)
4956 Intrinsic implemented, documentation pending.
4959 @item @emph{Description}:
4960 @item @emph{Standard}:
4966 @item @emph{Syntax}:
4967 @item @emph{Arguments}:
4968 @item @emph{Return value}:
4969 @item @emph{Example}:
4971 @item @emph{See also}:
4972 @ref{LGT}, @ref{LLE}, @ref{LLT}
4979 @section @code{LGT} --- Lexical greater than
4980 @findex @code{LGT} intrinsic
4981 @cindex comparison (lexical)
4983 Intrinsic implemented, documentation pending.
4986 @item @emph{Description}:
4987 @item @emph{Standard}:
4993 @item @emph{Syntax}:
4994 @item @emph{Arguments}:
4995 @item @emph{Return value}:
4996 @item @emph{Example}:
4998 @item @emph{See also}:
4999 @ref{LGE}, @ref{LLE}, @ref{LLT}
5006 @section @code{LINK} --- Create a hard link
5007 @findex @code{LINK} intrinsic
5008 @cindex file system operations
5010 Intrinsic implemented, documentation pending.
5013 @item @emph{Description}:
5014 @item @emph{Standard}:
5020 @item @emph{Syntax}:
5021 @item @emph{Arguments}:
5022 @item @emph{Return value}:
5023 @item @emph{Example}:
5024 @item @emph{Specific names}:
5026 @item @emph{See also}:
5034 @section @code{LLE} --- Lexical less than or equal
5035 @findex @code{LLE} intrinsic
5036 @cindex comparison (lexical)
5038 Intrinsic implemented, documentation pending.
5041 @item @emph{Description}:
5042 @item @emph{Standard}:
5048 @item @emph{Syntax}:
5049 @item @emph{Arguments}:
5050 @item @emph{Return value}:
5051 @item @emph{Example}:
5053 @item @emph{See also}:
5054 @ref{LGE}, @ref{LGT}, @ref{LLT}
5061 @section @code{LLT} --- Lexical less than
5062 @findex @code{LLT} intrinsic
5063 @cindex comparison (lexical)
5065 Intrinsic implemented, documentation pending.
5068 @item @emph{Description}:
5069 @item @emph{Standard}:
5075 @item @emph{Syntax}:
5076 @item @emph{Arguments}:
5077 @item @emph{Return value}:
5078 @item @emph{Example}:
5080 @item @emph{See also}:
5081 @ref{LGE}, @ref{LGT}, @ref{LLE}
5088 @section @code{LNBLNK} --- Index of the last non-blank character in a string
5089 @findex @code{LNBLNK} intrinsic
5090 @cindex undocumented intrinsic
5092 Intrinsic implemented, documentation pending.
5095 @item @emph{Description}:
5096 @item @emph{Standard}:
5100 @item @emph{Syntax}:
5101 @item @emph{Arguments}:
5102 @item @emph{Return value}:
5103 @item @emph{Example}:
5104 @item @emph{Specific names}:
5106 @item @emph{See also}:
5114 @section @code{LOC} --- Returns the address of a variable
5115 @findex @code{LOC} intrinsic
5119 @item @emph{Description}:
5120 @code{LOC(X)} returns the address of @var{X} as an integer.
5122 @item @emph{Standard}:
5128 @item @emph{Syntax}:
5131 @item @emph{Arguments}:
5132 @multitable @columnfractions .15 .80
5133 @item @var{X} @tab Variable of any type.
5136 @item @emph{Return value}:
5137 The return value is of type @code{INTEGER(n)}, where @code{n} is the
5138 size (in bytes) of a memory address on the target machine.
5140 @item @emph{Example}:
5147 end program test_loc
5152 @section @code{LOG} --- Logarithm function
5153 @findex @code{LOG} intrinsic
5154 @findex @code{ALOG} intrinsic
5155 @findex @code{DLOG} intrinsic
5156 @findex @code{CLOG} intrinsic
5157 @findex @code{ZLOG} intrinsic
5158 @findex @code{CDLOG} intrinsic
5162 @item @emph{Description}:
5163 @code{LOG(X)} computes the logarithm of @var{X}.
5165 @item @emph{Standard}:
5171 @item @emph{Syntax}:
5174 @item @emph{Arguments}:
5175 @multitable @columnfractions .15 .80
5176 @item @var{X} @tab The type shall be @code{REAL(*)} or
5180 @item @emph{Return value}:
5181 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
5182 The kind type parameter is the same as @var{X}.
5184 @item @emph{Example}:
5187 real(8) :: x = 1.0_8
5188 complex :: z = (1.0, 2.0)
5191 end program test_log
5194 @item @emph{Specific names}:
5195 @multitable @columnfractions .20 .20 .20 .40
5196 @item Name @tab Argument @tab Return type @tab Standard
5197 @item @code{ALOG(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f95, gnu
5198 @item @code{DLOG(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
5199 @item @code{CLOG(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
5200 @item @code{ZLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
5201 @item @code{CDLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
5208 @section @code{LOG10} --- Base 10 logarithm function
5209 @findex @code{LOG10} intrinsic
5210 @findex @code{ALOG10} intrinsic
5211 @findex @code{DLOG10} intrinsic
5215 @item @emph{Description}:
5216 @code{LOG10(X)} computes the base 10 logarithm of @var{X}.
5218 @item @emph{Standard}:
5224 @item @emph{Syntax}:
5227 @item @emph{Arguments}:
5228 @multitable @columnfractions .15 .80
5229 @item @var{X} @tab The type shall be @code{REAL(*)} or
5233 @item @emph{Return value}:
5234 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
5235 The kind type parameter is the same as @var{X}.
5237 @item @emph{Example}:
5240 real(8) :: x = 10.0_8
5242 end program test_log10
5245 @item @emph{Specific names}:
5246 @multitable @columnfractions .20 .20 .20 .40
5247 @item Name @tab Argument @tab Return type @tab Standard
5248 @item @code{ALOG10(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab F95 and later
5249 @item @code{DLOG10(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F95 and later
5255 @section @code{LOGICAL} --- Convert to logical type
5256 @findex @code{LOGICAL} intrinsic
5257 @cindex conversion function (logical)
5259 Intrinsic implemented, documentation pending.
5262 @item @emph{Description}:
5263 @item @emph{Standard}:
5269 @item @emph{Syntax}:
5270 @item @emph{Arguments}:
5271 @item @emph{Return value}:
5272 @item @emph{Example}:
5273 @item @emph{Specific names}:
5274 @item @emph{See also}:
5281 @section @code{LSHIFT} --- Left shift bits
5282 @findex @code{LSHIFT}
5283 @cindex bit manipulation
5285 Not yet implemented in GNU Fortran.
5288 @item @emph{Description}:
5290 @item @emph{Standard}:
5296 @item @emph{Syntax}:
5297 @item @emph{Arguments}:
5298 @item @emph{Return value}:
5299 @item @emph{Example}:
5300 @item @emph{Specific names}:
5301 @item @emph{See also}:
5302 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
5309 @section @code{LTIME} --- Convert time to local time info
5310 @findex @code{LTIME}
5311 @cindex time function
5313 Not yet implemented in GNU Fortran.
5316 @item @emph{Description}:
5318 @item @emph{Standard}:
5324 @item @emph{Syntax}:
5325 @item @emph{Arguments}:
5326 @item @emph{Return value}:
5327 @item @emph{Example}:
5328 @item @emph{Specific names}:
5329 @item @emph{See also}:
5330 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
5337 @section @code{MALLOC} --- Allocate dynamic memory
5338 @findex @code{MALLOC} intrinsic
5342 @item @emph{Description}:
5343 @code{MALLOC(SIZE)} allocates @var{SIZE} bytes of dynamic memory and
5344 returns the address of the allocated memory. The @code{MALLOC} intrinsic
5345 is an extension intended to be used with Cray pointers, and is provided
5346 in GNU Fortran to allow the user to compile legacy code. For new code
5347 using Fortran 95 pointers, the memory allocation intrinsic is
5350 @item @emph{Standard}:
5354 non-elemental function
5356 @item @emph{Syntax}:
5357 @code{PTR = MALLOC(SIZE)}
5359 @item @emph{Arguments}:
5360 @multitable @columnfractions .15 .80
5361 @item @var{SIZE} @tab The type shall be @code{INTEGER(*)}.
5364 @item @emph{Return value}:
5365 The return value is of type @code{INTEGER(K)}, with @var{K} such that
5366 variables of type @code{INTEGER(K)} have the same size as
5367 C pointers (@code{sizeof(void *)}).
5369 @item @emph{Example}:
5370 The following example demonstrates the use of @code{MALLOC} and
5371 @code{FREE} with Cray pointers. This example is intended to run on
5372 32-bit systems, where the default integer kind is suitable to store
5373 pointers; on 64-bit systems, ptr_x would need to be declared as
5374 @code{integer(kind=8)}.
5383 ptr_x = malloc(20*8)
5385 x(i) = sqrt(1.0d0 / i)
5393 end program test_malloc
5396 @item @emph{See also}:
5402 @section @code{MATMUL} --- matrix multiplication
5403 @findex @code{MATMUL} intrinsic
5404 @cindex matrix operations
5406 Intrinsic implemented, documentation pending.
5409 @item @emph{Description}:
5410 @item @emph{Standard}:
5414 Transformational function
5416 @item @emph{Syntax}:
5417 @item @emph{Arguments}:
5418 @item @emph{Return value}:
5419 @item @emph{Example}:
5420 @item @emph{See also}:
5425 @section @code{MAX} --- Maximum value of an argument list
5426 @findex @code{MAX} intrinsic
5427 @cindex undocumented intrinsic
5429 Intrinsic implemented, documentation pending.
5432 @item @emph{Description}:
5433 @item @emph{Standard}:
5439 @item @emph{Syntax}:
5440 @item @emph{Arguments}:
5441 @item @emph{Return value}:
5442 @item @emph{Example}:
5444 @item @emph{Specific names}:
5445 @multitable @columnfractions .20 .20 .20 .40
5446 @item Name @tab Argument @tab Return type @tab Standard
5447 @item @code{MAX0(I)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab F77 and later
5448 @item @code{AMAX0(I)} @tab @code{INTEGER(4) I} @tab @code{REAL(MAX(X))} @tab F77 and later
5449 @item @code{MAX1(X)} @tab @code{REAL(*) X} @tab @code{INT(MAX(X))} @tab F77 and later
5450 @item @code{AMAX1(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab F77 and later
5451 @item @code{DMAX1(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
5454 @item @emph{See also}:
5455 @ref{MAXLOC} @ref{MAXVAL}
5460 @section @code{MAXEXPONENT} --- Maximum exponent of a real kind
5461 @findex @code{MAXEXPONENT} intrinsic
5465 @item @emph{Description}:
5466 @code{MAXEXPONENT(X)} returns the maximum exponent in the model of the
5469 @item @emph{Standard}:
5475 @item @emph{Syntax}:
5476 @code{I = MAXEXPONENT(X)}
5478 @item @emph{Arguments}:
5479 @multitable @columnfractions .15 .80
5480 @item @var{X} @tab shall be of type @code{REAL}.
5483 @item @emph{Return value}:
5484 The return value is of type @code{INTEGER} and of the default integer
5487 @item @emph{Example}:
5493 print *, minexponent(x), maxexponent(x)
5494 print *, minexponent(y), maxexponent(y)
5495 end program exponents
5501 @section @code{MAXLOC} --- Location of the maximum value within an array
5502 @findex @code{MAXLOC} intrinsic
5503 @cindex undocumented intrinsic
5505 Intrinsic implemented, documentation pending.
5508 @item @emph{Description}:
5509 @item @emph{Standard}:
5513 Transformational function
5515 @item @emph{Syntax}:
5516 @item @emph{Arguments}:
5517 @item @emph{Return value}:
5518 @item @emph{Example}:
5519 @item @emph{See also}:
5520 @ref{MAX}, @ref{MAXVAL}
5526 @section @code{MAXVAL} --- Maximum value of an array
5527 @findex @code{MAXVAL} intrinsic
5528 @cindex undocumented intrinsic
5530 Intrinsic implemented, documentation pending.
5533 @item @emph{Description}:
5534 @item @emph{Standard}:
5538 Transformational function
5540 @item @emph{Syntax}:
5541 @item @emph{Arguments}:
5542 @item @emph{Return value}:
5543 @item @emph{Example}:
5544 @item @emph{Specific names}:
5546 @item @emph{See also}:
5547 @ref{MAX}, @ref{MAXLOC}
5554 @section @code{MERGE} --- Merge arrays
5555 @findex @code{MERGE} intrinsic
5556 @cindex undocumented intrinsic
5558 Intrinsic implemented, documentation pending.
5561 @item @emph{Description}:
5562 @item @emph{Standard}:
5568 @item @emph{Syntax}:
5569 @item @emph{Arguments}:
5570 @item @emph{Return value}:
5571 @item @emph{Example}:
5572 @item @emph{Specific names}:
5573 @item @emph{See also}:
5578 @section @code{MIN} --- Minimum value of an argument list
5579 @findex @code{MIN} intrinsic
5580 @cindex undocumented intrinsic
5582 Intrinsic implemented, documentation pending.
5585 @item @emph{Description}:
5586 @item @emph{Standard}:
5592 @item @emph{Syntax}:
5593 @item @emph{Arguments}:
5594 @item @emph{Return value}:
5595 @item @emph{Example}:
5597 @item @emph{Specific names}:
5598 @multitable @columnfractions .20 .20 .20 .40
5599 @item Name @tab Argument @tab Return type @tab Standard
5600 @item @code{MIN0(I)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab F77 and later
5601 @item @code{AMIN0(I)} @tab @code{INTEGER(4) I} @tab @code{REAL(MIN(X))} @tab F77 and later
5602 @item @code{MIN1(X)} @tab @code{REAL(*) X} @tab @code{INT(MIN(X))} @tab F77 and later
5603 @item @code{AMIN1(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab F77 and later
5604 @item @code{DMIN1(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
5607 @item @emph{See also}:
5608 @ref{MINLOC}, @ref{MINVAL}
5612 @section @code{MINEXPONENT} --- Minimum exponent of a real kind
5613 @findex @code{MINEXPONENT} intrinsic
5617 @item @emph{Description}:
5618 @code{MINEXPONENT(X)} returns the minimum exponent in the model of the
5621 @item @emph{Standard}:
5627 @item @emph{Syntax}:
5628 @code{I = MINEXPONENT(X)}
5630 @item @emph{Arguments}:
5631 @multitable @columnfractions .15 .80
5632 @item @var{X} @tab shall be of type @code{REAL}.
5635 @item @emph{Return value}:
5636 The return value is of type @code{INTEGER} and of the default integer
5639 @item @emph{Example}:
5640 See @code{MAXEXPONENT} for an example.
5645 @section @code{MINLOC} --- Location of the minimum value within an array
5646 @findex @code{MINLOC} intrinsic
5647 @cindex undocumented intrinsic
5649 Intrinsic implemented, documentation pending.
5652 @item @emph{Description}:
5653 @item @emph{Standard}:
5657 Transformational function
5659 @item @emph{Syntax}:
5660 @item @emph{Arguments}:
5661 @item @emph{Return value}:
5662 @item @emph{Example}:
5664 @item @emph{See also}:
5665 @ref{MIN}, @ref{MINVAL}
5671 @section @code{MINVAL} --- Minimum value of an array
5672 @findex @code{MINVAL} intrinsic
5673 @cindex undocumented intrinsic
5675 Intrinsic implemented, documentation pending.
5678 @item @emph{Description}:
5679 @item @emph{Standard}:
5683 Transformational function
5685 @item @emph{Syntax}:
5686 @item @emph{Arguments}:
5687 @item @emph{Return value}:
5688 @item @emph{Example}:
5690 @item @emph{See also}:
5691 @ref{MIN}, @ref{MINLOC}
5698 @section @code{MOD} --- Remainder function
5699 @findex @code{MOD} intrinsic
5700 @findex @code{AMOD} intrinsic
5701 @findex @code{DMOD} intrinsic
5705 @item @emph{Description}:
5706 @code{MOD(A,P)} computes the remainder of the division of A by P. It is
5707 calculated as @code{A - (INT(A/P) * P)}.
5709 @item @emph{Standard}:
5715 @item @emph{Syntax}:
5718 @item @emph{Arguments}:
5719 @multitable @columnfractions .15 .80
5720 @item @var{A} @tab shall be a scalar of type @code{INTEGER} or @code{REAL}
5721 @item @var{P} @tab shall be a scalar of the same type as @var{A} and not
5725 @item @emph{Return value}:
5726 The kind of the return value is the result of cross-promoting
5727 the kinds of the arguments.
5729 @item @emph{Example}:
5733 print *, mod(17.5,5.5)
5734 print *, mod(17.5d0,5.5)
5735 print *, mod(17.5,5.5d0)
5738 print *, mod(-17.5,5.5)
5739 print *, mod(-17.5d0,5.5)
5740 print *, mod(-17.5,5.5d0)
5743 print *, mod(17.5,-5.5)
5744 print *, mod(17.5d0,-5.5)
5745 print *, mod(17.5,-5.5d0)
5746 end program test_mod
5749 @item @emph{Specific names}:
5750 @multitable @columnfractions .20 .20 .20 .40
5751 @item Name @tab Arguments @tab Return type @tab Standard
5752 @item @code{AMOD(A,P)} @tab @code{REAL(4)} @tab @code{REAL(4)} @tab F95 and later
5753 @item @code{DMOD(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab F95 and later
5760 @section @code{MODULO} --- Modulo function
5761 @findex @code{MODULO} intrinsic
5765 @item @emph{Description}:
5766 @code{MODULO(A,P)} computes the @var{A} modulo @var{P}.
5768 @item @emph{Standard}:
5774 @item @emph{Syntax}:
5775 @code{X = MODULO(A,P)}
5777 @item @emph{Arguments}:
5778 @multitable @columnfractions .15 .80
5779 @item @var{A} @tab shall be a scalar of type @code{INTEGER} or @code{REAL}
5780 @item @var{P} @tab shall be a scalar of the same type and kind as @var{A}
5783 @item @emph{Return value}:
5784 The type and kind of the result are those of the arguments.
5786 @item If @var{A} and @var{P} are of type @code{INTEGER}:
5787 @code{MODULO(A,P)} has the value @var{R} such that @code{A=Q*P+R}, where
5788 @var{Q} is an integer and @var{R} is between 0 (inclusive) and @var{P}
5790 @item If @var{A} and @var{P} are of type @code{REAL}:
5791 @code{MODULO(A,P)} has the value of @code{A - FLOOR (A / P) * P}.
5793 In all cases, if @var{P} is zero the result is processor-dependent.
5795 @item @emph{Example}:
5798 print *, modulo(17,3)
5799 print *, modulo(17.5,5.5)
5801 print *, modulo(-17,3)
5802 print *, modulo(-17.5,5.5)
5804 print *, modulo(17,-3)
5805 print *, modulo(17.5,-5.5)
5806 end program test_mod
5814 @section @code{MVBITS} --- Move bits from one integer to another
5815 @findex @code{MVBITS} intrinsic
5816 @cindex bit operations
5818 Intrinsic implemented, documentation pending.
5821 @item @emph{Description}:
5822 @item @emph{Standard}:
5826 Elemental subroutine
5828 @item @emph{Syntax}:
5829 @item @emph{Arguments}:
5830 @item @emph{Return value}:
5831 @item @emph{Example}:
5832 @item @emph{See also}:
5839 @section @code{MOVE_ALLOC} --- Move allocation from one object to another
5840 @findex @code{MOVE_ALLOC} intrinsic
5844 @item @emph{Description}:
5845 @code{MOVE_ALLOC(SRC, DEST)} moves the allocation from @var{SRC} to
5846 @var{DEST}. @var{SRC} will become deallocated in the process.
5848 @item @emph{Option}:
5854 @item @emph{Syntax}:
5855 @code{CALL MOVE_ALLOC(SRC, DEST)}
5857 @item @emph{Arguments}:
5858 @multitable @columnfractions .15 .80
5859 @item @var{SRC} @tab @code{ALLOCATABLE}, @code{INTENT(INOUT)}, may be of any type and kind.
5860 @item @var{DEST} @tab @code{ALLOCATABLE}, @code{INTENT(OUT)}, shall be of the same type, kind and rank as @var{SRC}
5863 @item @emph{Return value}:
5866 @item @emph{Example}:
5868 program test_move_alloc
5869 integer, allocatable :: a(:), b(:)
5873 call move_alloc(a, b)
5874 print *, allocated(a), allocated(b)
5876 end program test_move_alloc
5883 @section @code{NEAREST} --- Nearest representable number
5884 @findex @code{NEAREST} intrinsic
5885 @cindex processor-representable number
5888 @item @emph{Description}:
5889 @code{NEAREST(X, S)} returns the processor-representable number nearest
5890 to @code{X} in the direction indicated by the sign of @code{S}.
5892 @item @emph{Standard}:
5898 @item @emph{Syntax}:
5899 @code{Y = NEAREST(X, S)}
5901 @item @emph{Arguments}:
5902 @multitable @columnfractions .15 .80
5903 @item @var{X} @tab shall be of type @code{REAL}.
5904 @item @var{S} @tab (Optional) shall be of type @code{REAL} and
5908 @item @emph{Return value}:
5909 The return value is of the same type as @code{X}. If @code{S} is
5910 positive, @code{NEAREST} returns the processor-representable number
5911 greater than @code{X} and nearest to it. If @code{S} is negative,
5912 @code{NEAREST} returns the processor-representable number smaller than
5913 @code{X} and nearest to it.
5915 @item @emph{Example}:
5917 program test_nearest
5919 x = nearest(42.0, 1.0)
5920 y = nearest(42.0, -1.0)
5921 write (*,"(3(G20.15))") x, y, x - y
5922 end program test_nearest
5929 @section @code{NEW_LINE} --- New line character
5930 @findex @code{NEW_LINE} intrinsic
5931 @findex @code{NEW_LINE} intrinsic
5934 @item @emph{Description}:
5935 @code{NEW_LINE(C)} returns the new-line character
5937 @item @emph{Standard}:
5943 @item @emph{Syntax}:
5944 @code{C = NEW_LINE(C)}
5946 @item @emph{Arguments}:
5947 @multitable @columnfractions .15 .80
5948 @item @var{C} @tab The argument shall be a scalar or array of the
5949 type @code{CHARACTER}.
5952 @item @emph{Return value}:
5953 Returns a @var{CHARACTER} scalar of length one with the new-line character of
5954 the same kind as parameter @var{C}.
5956 @item @emph{Example}:
5960 write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'
5968 @section @code{NINT} --- Nearest whole number
5969 @findex @code{NINT} intrinsic
5970 @findex @code{IDNINT} intrinsic
5971 @cindex whole number
5974 @item @emph{Description}:
5975 @code{NINT(X)} rounds its argument to the nearest whole number.
5977 @item @emph{Standard}:
5983 @item @emph{Syntax}:
5986 @item @emph{Arguments}:
5987 @multitable @columnfractions .15 .80
5988 @item @var{X} @tab The type of the argument shall be @code{REAL}.
5991 @item @emph{Return value}:
5992 Returns @var{A} with the fractional portion of its magnitude eliminated by
5993 rounding to the nearest whole number and with its sign preserved,
5994 converted to an @code{INTEGER} of the default kind.
5996 @item @emph{Example}:
6003 print *, nint(x4), idnint(x8)
6004 end program test_nint
6007 @item @emph{Specific names}:
6008 @multitable @columnfractions .33 .33 .33
6009 @item Name @tab Argument @tab Standard
6010 @item @code{IDNINT(X)} @tab @code{REAL(8)} @tab F95 and later
6013 @item @emph{See also}:
6014 @ref{CEILING}, @ref{FLOOR}
6020 @section @code{NOT} --- Logical negation
6021 @findex @code{NOT} intrinsic
6022 @cindex logical operations
6024 Intrinsic implemented, documentation pending.
6027 @item @emph{Description}:
6028 @item @emph{Standard}:
6034 @item @emph{Syntax}:
6035 @item @emph{Arguments}:
6036 @item @emph{Return value}:
6037 @item @emph{Example}:
6038 @item @emph{See also}:
6045 @section @code{NULL} --- Function that returns an disassociated pointer
6046 @findex @code{NULL} intrinsic
6047 @cindex undocumented intrinsic
6049 Intrinsic implemented, documentation pending.
6052 @item @emph{Description}:
6053 @item @emph{Standard}:
6057 Transformational function
6059 @item @emph{Syntax}:
6060 @item @emph{Arguments}:
6061 @item @emph{Return value}:
6062 @item @emph{Example}:
6063 @item @emph{See also}:
6071 @section @code{OR} --- Bitwise logical OR
6072 @findex @code{OR} intrinsic
6073 @cindex bit operations
6076 @item @emph{Description}:
6077 Bitwise logical @code{OR}.
6079 This intrinsic routine is provided for backwards compatibility with
6080 GNU Fortran 77. For integer arguments, programmers should consider
6081 the use of the @ref{IOR} intrinsic defined by the Fortran standard.
6083 @item @emph{Standard}:
6087 Non-elemental function
6089 @item @emph{Syntax}:
6090 @code{RESULT = OR(X, Y)}
6092 @item @emph{Arguments}:
6093 @multitable @columnfractions .15 .80
6094 @item @var{X} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
6095 @item @var{Y} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
6098 @item @emph{Return value}:
6099 The return type is either @code{INTEGER(*)} or @code{LOGICAL}
6100 after cross-promotion of the arguments.
6102 @item @emph{Example}:
6105 LOGICAL :: T = .TRUE., F = ..FALSE.
6107 DATA a / Z'F' /, b / Z'3' /
6109 WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F)
6110 WRITE (*,*) OR(a, b)
6114 @item @emph{See also}:
6115 F95 elemental function: @ref{IOR}
6122 @section @code{PACK} --- Pack an array into an array of rank one
6123 @findex @code{PACK} intrinsic
6124 @cindex undocumented intrinsic
6126 Intrinsic implemented, documentation pending.
6129 @item @emph{Description}:
6130 @item @emph{Standard}:
6134 Transformational function
6136 @item @emph{Syntax}:
6137 @item @emph{Arguments}:
6138 @item @emph{Return value}:
6139 @item @emph{Example}:
6140 @item @emph{Specific names}:
6141 @item @emph{See also}:
6149 @section @code{PERROR} --- Print system error message
6150 @findex @code{PERROR} intrinsic
6151 @cindex undocumented intrinsic
6153 Intrinsic implemented, documentation pending.
6156 @item @emph{Description}:
6157 @item @emph{Standard}:
6163 @item @emph{Syntax}:
6164 @item @emph{Arguments}:
6165 @item @emph{Return value}:
6166 @item @emph{Example}:
6167 @item @emph{Specific names}:
6168 @item @emph{See also}:
6176 @section @code{PRECISION} --- Decimal precision of a real kind
6177 @findex @code{PRECISION} intrinsic
6181 @item @emph{Description}:
6182 @code{PRECISION(X)} returns the decimal precision in the model of the
6185 @item @emph{Standard}:
6191 @item @emph{Syntax}:
6192 @code{I = PRECISION(X)}
6194 @item @emph{Arguments}:
6195 @multitable @columnfractions .15 .80
6196 @item @var{X} @tab shall be of type @code{REAL} or @code{COMPLEX}.
6199 @item @emph{Return value}:
6200 The return value is of type @code{INTEGER} and of the default integer
6203 @item @emph{Example}:
6205 program prec_and_range
6206 real(kind=4) :: x(2)
6207 complex(kind=8) :: y
6209 print *, precision(x), range(x)
6210 print *, precision(y), range(y)
6211 end program prec_and_range
6218 @section @code{PRESENT} --- Determine whether an optional argument is specified
6219 @findex @code{PRESENT} intrinsic
6220 @cindex undocumented intrinsic
6222 Intrinsic implemented, documentation pending.
6225 @item @emph{Description}:
6226 @item @emph{Standard}:
6232 @item @emph{Syntax}:
6233 @item @emph{Arguments}:
6234 @item @emph{Return value}:
6235 @item @emph{Example}:
6236 @item @emph{See also}:
6243 @section @code{PRODUCT} --- Product of array elements
6244 @findex @code{PRODUCT} intrinsic
6245 @cindex undocumented intrinsic
6247 Intrinsic implemented, documentation pending.
6250 @item @emph{Description}:
6251 @item @emph{Standard}:
6255 Transformational function
6257 @item @emph{Syntax}:
6258 @item @emph{Arguments}:
6259 @item @emph{Return value}:
6260 @item @emph{Example}:
6261 @item @emph{Specific names}:
6262 @item @emph{See also}:
6270 @section @code{RADIX} --- Base of a model number
6271 @findex @code{RADIX} intrinsic
6275 @item @emph{Description}:
6276 @code{RADIX(X)} returns the base of the model representing the entity @var{X}.
6278 @item @emph{Standard}:
6284 @item @emph{Syntax}:
6287 @item @emph{Arguments}:
6288 @multitable @columnfractions .15 .80
6289 @item @var{X} @tab Shall be of type @code{INTEGER} or @code{REAL}
6292 @item @emph{Return value}:
6293 The return value is a scalar of type @code{INTEGER} and of the default
6296 @item @emph{Example}:
6299 print *, "The radix for the default integer kind is", radix(0)
6300 print *, "The radix for the default real kind is", radix(0.0)
6301 end program test_radix
6309 @section @code{RANDOM_NUMBER} --- Pseudo-random number
6310 @findex @code{RANDOM_NUMBER} intrinsic
6311 @cindex random numbers
6313 Intrinsic implemented, documentation pending.
6316 @item @emph{Description}:
6317 @item @emph{Standard}:
6321 Elemental subroutine
6323 @item @emph{Syntax}:
6324 @item @emph{Arguments}:
6325 @item @emph{Return value}:
6326 @item @emph{Example}:
6327 @item @emph{See also}:
6335 @section @code{RANDOM_SEED} --- Initialize a pseudo-random number sequence
6336 @findex @code{RANDOM_SEED} intrinsic
6337 @cindex random numbers
6339 Intrinsic implemented, documentation pending.
6342 @item @emph{Description}:
6343 @item @emph{Standard}:
6349 @item @emph{Syntax}:
6350 @item @emph{Arguments}:
6351 @item @emph{Return value}:
6352 @item @emph{Example}:
6353 @item @emph{See also}:
6361 @section @code{RAND} --- Real pseudo-random number
6362 @findex @code{RAND} intrinsic
6363 @findex @code{RAN} intrinsic
6364 @cindex random number
6367 @item @emph{Description}:
6368 @code{RAND(FLAG)} returns a pseudo-random number from a uniform
6369 distribution between 0 and 1. If @var{FLAG} is 0, the next number
6370 in the current sequence is returned; if @var{FLAG} is 1, the generator
6371 is restarted by @code{CALL SRAND(0)}; if @var{FLAG} has any other value,
6372 it is used as a new seed with @code{SRAND}.
6374 @item @emph{Standard}:
6378 non-elemental function
6380 @item @emph{Syntax}:
6381 @code{X = RAND(FLAG)}
6383 @item @emph{Arguments}:
6384 @multitable @columnfractions .15 .80
6385 @item @var{FLAG} @tab shall be a scalar @code{INTEGER} of kind 4.
6388 @item @emph{Return value}:
6389 The return value is of @code{REAL} type and the default kind.
6391 @item @emph{Example}:
6394 integer,parameter :: seed = 86456
6397 print *, rand(), rand(), rand(), rand()
6398 print *, rand(seed), rand(), rand(), rand()
6399 end program test_rand
6403 For compatibility with HP FORTRAN 77/iX, the @code{RAN} intrinsic is
6404 provided as an alias for @code{RAND}.
6406 @item @emph{See also}:
6407 @ref{SRAND}, @ref{RANDOM_NUMBER}
6414 @section @code{RANGE} --- Decimal exponent range of a real kind
6415 @findex @code{RANGE} intrinsic
6419 @item @emph{Description}:
6420 @code{RANGE(X)} returns the decimal exponent range in the model of the
6423 @item @emph{Standard}:
6429 @item @emph{Syntax}:
6432 @item @emph{Arguments}:
6433 @multitable @columnfractions .15 .80
6434 @item @var{X} @tab shall be of type @code{REAL} or @code{COMPLEX}.
6437 @item @emph{Return value}:
6438 The return value is of type @code{INTEGER} and of the default integer
6441 @item @emph{Example}:
6442 See @code{PRECISION} for an example.
6448 @section @code{RAN} --- Real pseudo-random number
6449 @findex @code{RAN} intrinsic
6450 @cindex random number
6453 @item @emph{Standard}:
6456 @item @emph{See also}:
6457 @ref{RAND}, @ref{RANDOM_NUMBER}
6463 @section @code{REAL} --- Convert to real type
6464 @findex @code{REAL} intrinsic
6465 @findex @code{REALPART} intrinsic
6469 @item @emph{Description}:
6470 @code{REAL(X [, KIND])} converts its argument @var{X} to a real type. The
6471 @code{REALPART(X)} function is provided for compatibility with @command{g77},
6472 and its use is strongly discouraged.
6474 @item @emph{Standard}:
6480 @item @emph{Syntax}:
6481 @multitable @columnfractions .30 .80
6482 @item @code{X = REAL(X)}
6483 @item @code{X = REAL(X, KIND)}
6484 @item @code{X = REALPART(Z)}
6487 @item @emph{Arguments}:
6488 @multitable @columnfractions .15 .80
6489 @item @var{X} @tab shall be @code{INTEGER(*)}, @code{REAL(*)}, or
6491 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer.
6494 @item @emph{Return value}:
6495 These functions return a @code{REAL(*)} variable or array under
6496 the following rules:
6500 @code{REAL(X)} is converted to a default real type if @var{X} is an
6501 integer or real variable.
6503 @code{REAL(X)} is converted to a real type with the kind type parameter
6504 of @var{X} if @var{X} is a complex variable.
6506 @code{REAL(X, KIND)} is converted to a real type with kind type
6507 parameter @var{KIND} if @var{X} is a complex, integer, or real
6511 @item @emph{Example}:
6514 complex :: x = (1.0, 2.0)
6515 print *, real(x), real(x,8), realpart(x)
6516 end program test_real
6519 @item @emph{See also}:
6520 @ref{DBLE}, @ref{DFLOAT}, @ref{FLOAT}
6526 @section @code{RENAME} --- Rename a file
6527 @findex @code{RENAME} intrinsic
6528 @cindex file system operations
6530 Intrinsic implemented, documentation pending.
6533 @item @emph{Description}:
6534 @item @emph{Standard}:
6540 @item @emph{Syntax}:
6541 @item @emph{Arguments}:
6542 @item @emph{Return value}:
6543 @item @emph{Example}:
6544 @item @emph{See also}:
6551 @section @code{REPEAT} --- Repeated string concatenation
6552 @findex @code{REPEAT} intrinsic
6553 @cindex string manipulation
6555 Intrinsic implemented, documentation pending.
6558 @item @emph{Description}:
6559 @item @emph{Standard}:
6563 Transformational function
6565 @item @emph{Syntax}:
6566 @item @emph{Arguments}:
6567 @item @emph{Return value}:
6568 @item @emph{Example}:
6569 @item @emph{See also}:
6576 @section @code{RESHAPE} --- Function to reshape an array
6577 @findex @code{RESHAPE} intrinsic
6578 @cindex array manipulation
6580 Intrinsic implemented, documentation pending.
6583 @item @emph{Description}:
6584 @item @emph{Standard}:
6588 Transformational function
6590 @item @emph{Syntax}:
6591 @item @emph{Arguments}:
6592 @item @emph{Return value}:
6593 @item @emph{Example}:
6594 @item @emph{See also}:
6601 @section @code{RRSPACING} --- Reciprocal of the relative spacing
6602 @findex @code{RRSPACING} intrinsic
6605 @item @emph{Description}:
6606 @code{RRSPACING(X)} returns the reciprocal of the relative spacing of
6607 model numbers near @var{X}.
6609 @item @emph{Standard}:
6615 @item @emph{Syntax}:
6616 @code{Y = RRSPACING(X)}
6618 @item @emph{Arguments}:
6619 @multitable @columnfractions .15 .80
6620 @item @var{X} @tab shall be of type @code{REAL}.
6623 @item @emph{Return value}:
6624 The return value is of the same type and kind as @var{X}.
6625 The value returned is equal to
6626 @code{ABS(FRACTION(X)) * FLOAT(RADIX(X))**DIGITS(X)}.
6633 @section @code{RSHIFT} --- Right shift bits
6634 @findex @code{RSHIFT}
6635 @cindex bit manipulation
6637 Not yet implemented in GNU Fortran.
6640 @item @emph{Description}:
6642 @item @emph{Standard}:
6648 @item @emph{Syntax}:
6649 @item @emph{Arguments}:
6650 @item @emph{Return value}:
6651 @item @emph{Example}:
6652 @item @emph{See also}:
6653 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
6660 @section @code{SCALE} --- Scale a real value
6661 @findex @code{SCALE} intrinsic
6664 @item @emph{Description}:
6665 @code{SCALE(X,I)} returns @code{X * RADIX(X)**I}.
6667 @item @emph{Standard}:
6673 @item @emph{Syntax}:
6674 @code{Y = SCALE(X, I)}
6676 @item @emph{Arguments}:
6677 @multitable @columnfractions .15 .80
6678 @item @var{X} @tab The type of the argument shall be a @code{REAL}.
6679 @item @var{I} @tab The type of the argument shall be a @code{INTEGER}.
6682 @item @emph{Return value}:
6683 The return value is of the same type and kind as @var{X}.
6684 Its value is @code{X * RADIX(X)**I}.
6686 @item @emph{Example}:
6689 real :: x = 178.1387e-4
6691 print *, scale(x,i), x*radix(x)**i
6692 end program test_scale
6699 @section @code{SCAN} --- Scan a string for the presence of a set of characters
6700 @findex @code{SCAN} intrinsic
6701 @cindex string manipulation
6703 Intrinsic implemented, documentation pending.
6706 @item @emph{Description}:
6707 @item @emph{Standard}:
6713 @item @emph{Syntax}:
6714 @item @emph{Arguments}:
6715 @item @emph{Return value}:
6716 @item @emph{Example}:
6717 @item @emph{See also}:
6724 @section @code{SECNDS} --- Time function
6725 @findex @code{SECNDS} intrinsic
6729 @item @emph{Description}:
6730 @code{SECNDS(X)} gets the time in seconds from the real-time system clock.
6731 @var{X} is a reference time, also in seconds. If this is zero, the time in
6732 seconds from midnight is returned. This function is non-standard and its
6735 @item @emph{Standard}:
6741 @item @emph{Syntax}:
6742 @code{T = SECNDS (X)}
6744 @item @emph{Arguments}:
6745 @multitable @columnfractions .15 .80
6746 @item Name @tab Type
6747 @item @var{T} @tab REAL(4)
6748 @item @var{X} @tab REAL(4)
6751 @item @emph{Return value}:
6754 @item @emph{Example}:
6758 print *, secnds (0.0) ! seconds since midnight
6759 t1 = secnds (0.0) ! reference time
6760 do i = 1, 10000000 ! do something
6762 t2 = secnds (t1) ! elapsed time
6763 print *, "Something took ", t2, " seconds."
6764 end program test_secnds
6770 @node SELECTED_INT_KIND
6771 @section @code{SELECTED_INT_KIND} --- Choose integer kind
6772 @findex @code{SELECTED_INT_KIND} intrinsic
6773 @cindex integer kind
6776 @item @emph{Description}:
6777 @code{SELECTED_INT_KIND(I)} return the kind value of the smallest integer
6778 type that can represent all values ranging from @math{-10^I} (exclusive)
6779 to @math{10^I} (exclusive). If there is no integer kind that accommodates
6780 this range, @code{SELECTED_INT_KIND} returns @math{-1}.
6782 @item @emph{Standard}:
6786 Transformational function
6788 @item @emph{Syntax}:
6789 @multitable @columnfractions .30 .80
6790 @item @code{J = SELECTED_INT_KIND(I)}
6793 @item @emph{Arguments}:
6794 @multitable @columnfractions .15 .80
6795 @item @var{I} @tab shall be a scalar and of type @code{INTEGER}.
6798 @item @emph{Example}:
6800 program large_integers
6801 integer,parameter :: k5 = selected_int_kind(5)
6802 integer,parameter :: k15 = selected_int_kind(15)
6803 integer(kind=k5) :: i5
6804 integer(kind=k15) :: i15
6806 print *, huge(i5), huge(i15)
6808 ! The following inequalities are always true
6809 print *, huge(i5) >= 10_k5**5-1
6810 print *, huge(i15) >= 10_k15**15-1
6811 end program large_integers
6817 @node SELECTED_REAL_KIND
6818 @section @code{SELECTED_REAL_KIND} --- Choose real kind
6819 @findex @code{SELECTED_REAL_KIND} intrinsic
6823 @item @emph{Description}:
6824 @code{SELECTED_REAL_KIND(P,R)} return the kind value of a real data type
6825 with decimal precision greater of at least @code{P} digits and exponent
6826 range greater at least @code{R}.
6828 @item @emph{Standard}:
6832 Transformational function
6834 @item @emph{Syntax}:
6835 @multitable @columnfractions .30 .80
6836 @item @code{I = SELECTED_REAL_KIND(P,R)}
6839 @item @emph{Arguments}:
6840 @multitable @columnfractions .15 .80
6841 @item @var{P} @tab (Optional) shall be a scalar and of type @code{INTEGER}.
6842 @item @var{R} @tab (Optional) shall be a scalar and of type @code{INTEGER}.
6844 At least one argument shall be present.
6846 @item @emph{Return value}:
6848 @code{SELECTED_REAL_KIND} returns the value of the kind type parameter of
6849 a real data type with decimal precision of at least @code{P} digits and a
6850 decimal exponent range of at least @code{R}. If more than one real data
6851 type meet the criteria, the kind of the data type with the smallest
6852 decimal precision is returned. If no real data type matches the criteria,
6855 @item -1 if the processor does not support a real data type with a
6856 precision greater than or equal to @code{P}
6857 @item -2 if the processor does not support a real type with an exponent
6858 range greater than or equal to @code{R}
6859 @item -3 if neither is supported.
6862 @item @emph{Example}:
6865 integer,parameter :: p6 = selected_real_kind(6)
6866 integer,parameter :: p10r100 = selected_real_kind(10,100)
6867 integer,parameter :: r400 = selected_real_kind(r=400)
6869 real(kind=p10r100) :: y
6870 real(kind=r400) :: z
6872 print *, precision(x), range(x)
6873 print *, precision(y), range(y)
6874 print *, precision(z), range(z)
6875 end program real_kinds
6882 @section @code{SET_EXPONENT} --- Set the exponent of the model
6883 @findex @code{SET_EXPONENT} intrinsic
6887 @item @emph{Description}:
6888 @code{SET_EXPONENT(X, I)} returns the real number whose fractional part
6889 is that that of @var{X} and whose exponent part if @var{I}.
6891 @item @emph{Standard}:
6897 @item @emph{Syntax}:
6898 @code{Y = SET_EXPONENT(X, I)}
6900 @item @emph{Arguments}:
6901 @multitable @columnfractions .15 .80
6902 @item @var{X} @tab shall be of type @code{REAL}.
6903 @item @var{I} @tab shall be of type @code{INTEGER}.
6906 @item @emph{Return value}:
6907 The return value is of the same type and kind as @var{X}.
6908 The real number whose fractional part
6909 is that that of @var{X} and whose exponent part if @var{I} is returned;
6910 it is @code{FRACTION(X) * RADIX(X)**I}.
6912 @item @emph{Example}:
6915 real :: x = 178.1387e-4
6917 print *, set_exponent(x), fraction(x) * radix(x)**i
6918 end program test_setexp
6926 @section @code{SHAPE} --- Determine the shape of an array
6927 @findex @code{SHAPE} intrinsic
6928 @cindex array manipulation
6930 Intrinsic implemented, documentation pending.
6933 @item @emph{Description}:
6934 @item @emph{Standard}:
6940 @item @emph{Syntax}:
6941 @item @emph{Arguments}:
6942 @item @emph{Return value}:
6943 @item @emph{Example}:
6944 @item @emph{See also}:
6952 @section @code{SIGN} --- Sign copying function
6953 @findex @code{SIGN} intrinsic
6954 @findex @code{ISIGN} intrinsic
6955 @findex @code{DSIGN} intrinsic
6956 @cindex sign copying
6959 @item @emph{Description}:
6960 @code{SIGN(A,B)} returns the value of @var{A} with the sign of @var{B}.
6962 @item @emph{Standard}:
6968 @item @emph{Syntax}:
6969 @code{X = SIGN(A,B)}
6971 @item @emph{Arguments}:
6972 @multitable @columnfractions .15 .80
6973 @item @var{A} @tab shall be a scalar of type @code{INTEGER} or @code{REAL}
6974 @item @var{B} @tab shall be a scalar of the same type and kind as @var{A}
6977 @item @emph{Return value}:
6978 The kind of the return value is that of @var{A} and @var{B}.
6979 If @math{B\ge 0} then the result is @code{ABS(A)}, else
6980 it is @code{-ABS(A)}.
6982 @item @emph{Example}:
6985 print *, sign(-12,1)
6986 print *, sign(-12,0)
6987 print *, sign(-12,-1)
6989 print *, sign(-12.,1.)
6990 print *, sign(-12.,0.)
6991 print *, sign(-12.,-1.)
6992 end program test_sign
6995 @item @emph{Specific names}:
6996 @multitable @columnfractions .20 .20 .20 .40
6997 @item Name @tab Arguments @tab Return type @tab Standard
6998 @item @code{ISIGN(A,P)} @tab @code{INTEGER(4)} @tab @code{INTEGER(4)} @tab f95, gnu
6999 @item @code{DSIGN(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab f95, gnu
7006 @section @code{SIGNAL} --- Signal handling subroutine (or function)
7007 @findex @code{SIGNAL} intrinsic
7008 @cindex SIGNAL subroutine
7011 @item @emph{Description}:
7012 @code{SIGNAL(NUMBER, HANDLER [, STATUS])} causes external subroutine
7013 @var{HANDLER} to be executed with a single integer argument when signal
7014 @var{NUMBER} occurs. If @var{HANDLER} is an integer, it can be used to
7015 turn off handling of signal @var{NUMBER} or revert to its default
7016 action. See @code{signal(2)}.
7018 If @code{SIGNAL} is called as a subroutine and the @var{STATUS} argument
7019 is supplied, it is set to the value returned by @code{signal(2)}.
7021 @item @emph{Standard}:
7025 subroutine, non-elemental function
7027 @item @emph{Syntax}:
7028 @multitable @columnfractions .30 .80
7029 @item @code{CALL ALARM(NUMBER, HANDLER)}
7030 @item @code{CALL ALARM(NUMBER, HANDLER, STATUS)}
7031 @item @code{STATUS = ALARM(NUMBER, HANDLER)}
7034 @item @emph{Arguments}:
7035 @multitable @columnfractions .15 .80
7036 @item @var{NUMBER} @tab shall be a scalar integer, with @code{INTENT(IN)}
7037 @item @var{HANDLER}@tab Signal handler (@code{INTEGER FUNCTION} or
7038 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
7039 @code{INTEGER}. It is @code{INTENT(IN)}.
7040 @item @var{STATUS} @tab (Optional) @var{STATUS} shall be a scalar
7041 integer. It has @code{INTENT(OUT)}.
7044 @item @emph{Return value}:
7045 The @code{SIGNAL} functions returns the value returned by @code{signal(2)}.
7047 @item @emph{Example}:
7051 external handler_print
7053 call signal (12, handler_print)
7057 end program test_signal
7065 @section @code{SIN} --- Sine function
7066 @findex @code{SIN} intrinsic
7067 @findex @code{DSIN} intrinsic
7068 @findex @code{ZSIN} intrinsic
7069 @findex @code{CDSIN} intrinsic
7070 @cindex trigonometric functions
7073 @item @emph{Description}:
7074 @code{SIN(X)} computes the sine of @var{X}.
7076 @item @emph{Standard}:
7082 @item @emph{Syntax}:
7085 @item @emph{Arguments}:
7086 @multitable @columnfractions .15 .80
7087 @item @var{X} @tab The type shall be @code{REAL(*)} or
7091 @item @emph{Return value}:
7092 The return value has same type and kind as @var{X}.
7094 @item @emph{Example}:
7099 end program test_sin
7102 @item @emph{Specific names}:
7103 @multitable @columnfractions .20 .20 .20 .40
7104 @item Name @tab Argument @tab Return type @tab Standard
7105 @item @code{DSIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
7106 @item @code{CSIN(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
7107 @item @code{ZSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
7108 @item @code{CDSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
7111 @item @emph{See also}:
7118 @section @code{SINH} --- Hyperbolic sine function
7119 @findex @code{SINH} intrinsic
7120 @findex @code{DSINH} intrinsic
7121 @cindex hyperbolic sine
7124 @item @emph{Description}:
7125 @code{SINH(X)} computes the hyperbolic sine of @var{X}.
7127 @item @emph{Standard}:
7133 @item @emph{Syntax}:
7136 @item @emph{Arguments}:
7137 @multitable @columnfractions .15 .80
7138 @item @var{X} @tab The type shall be @code{REAL(*)}.
7141 @item @emph{Return value}:
7142 The return value is of type @code{REAL(*)}.
7144 @item @emph{Example}:
7147 real(8) :: x = - 1.0_8
7149 end program test_sinh
7152 @item @emph{Specific names}:
7153 @multitable @columnfractions .20 .20 .20 .40
7154 @item Name @tab Argument @tab Return type @tab Standard
7155 @item @code{DSINH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F95 and later
7158 @item @emph{See also}:
7165 @section @code{SIZE} --- Determine the size of an array
7166 @findex @code{SIZE} intrinsic
7167 @cindex array manipulation
7169 Intrinsic implemented, documentation pending.
7172 @item @emph{Description}:
7173 @item @emph{Standard}:
7179 @item @emph{Syntax}:
7180 @item @emph{Arguments}:
7181 @item @emph{Return value}:
7182 @item @emph{Example}:
7183 @item @emph{See also}:
7189 @section @code{SNGL} --- Convert double precision real to default real
7190 @findex @code{SNGL} intrinsic
7191 @cindex conversion function (real)
7194 @item @emph{Description}:
7195 @code{SNGL(A)} converts the double precision real @var{A}
7196 to a default real value. This is an archaic form of @code{REAL}
7197 that is specific to one type for @var{A}.
7199 @item @emph{Standard}:
7205 @item @emph{Syntax}:
7208 @item @emph{Arguments}:
7209 @multitable @columnfractions .15 .80
7210 @item @var{A} @tab The type shall be a double precision @code{REAL}.
7213 @item @emph{Return value}:
7214 The return value is of type default @code{REAL}.
7216 @item @emph{See also}:
7223 @section @code{SPACING} --- Smallest distance between two numbers of a given type
7224 @findex @code{SPACING} intrinsic
7225 @cindex undocumented intrinsic
7227 Intrinsic implemented, documentation pending.
7230 @item @emph{Description}:
7231 @item @emph{Standard}:
7237 @item @emph{Syntax}:
7238 @item @emph{Arguments}:
7239 @item @emph{Return value}:
7240 @item @emph{Example}:
7241 @item @emph{See also}:
7248 @section @code{SPREAD} --- Add a dimension to an array
7249 @findex @code{SPREAD} intrinsic
7250 @cindex array manipulation
7252 Intrinsic implemented, documentation pending.
7255 @item @emph{Description}:
7256 @item @emph{Standard}:
7260 Transformational function
7262 @item @emph{Syntax}:
7263 @item @emph{Arguments}:
7264 @item @emph{Return value}:
7265 @item @emph{Example}:
7266 @item @emph{See also}:
7273 @section @code{SQRT} --- Square-root function
7274 @findex @code{SQRT} intrinsic
7275 @findex @code{DSQRT} intrinsic
7276 @findex @code{CSQRT} intrinsic
7277 @findex @code{ZSQRT} intrinsic
7278 @findex @code{CDSQRT} intrinsic
7282 @item @emph{Description}:
7283 @code{SQRT(X)} computes the square root of @var{X}.
7285 @item @emph{Standard}:
7291 @item @emph{Syntax}:
7294 @item @emph{Arguments}:
7295 @multitable @columnfractions .15 .80
7296 @item @var{X} @tab The type shall be @code{REAL(*)} or
7300 @item @emph{Return value}:
7301 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
7302 The kind type parameter is the same as @var{X}.
7304 @item @emph{Example}:
7307 real(8) :: x = 2.0_8
7308 complex :: z = (1.0, 2.0)
7311 end program test_sqrt
7314 @item @emph{Specific names}:
7315 @multitable @columnfractions .20 .20 .20 .40
7316 @item Name @tab Argument @tab Return type @tab Standard
7317 @item @code{DSQRT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F95 and later
7318 @item @code{CSQRT(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab F95 and later
7319 @item @code{ZSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
7320 @item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
7327 @section @code{SRAND} --- Reinitialize the random number generator
7328 @findex @code{SRAND} intrinsic
7329 @cindex random number
7332 @item @emph{Description}:
7333 @code{SRAND} reinitializes the pseudo-random number generator
7334 called by @code{RAND} and @code{IRAND}. The new seed used by the
7335 generator is specified by the required argument @var{SEED}.
7337 @item @emph{Standard}:
7341 non-elemental subroutine
7343 @item @emph{Syntax}:
7344 @code{CALL SRAND(SEED)}
7346 @item @emph{Arguments}:
7347 @multitable @columnfractions .15 .80
7348 @item @var{SEED} @tab shall be a scalar @code{INTEGER(kind=4)}.
7351 @item @emph{Return value}:
7354 @item @emph{Example}:
7355 See @code{RAND} and @code{IRAND} for examples.
7358 The Fortran 2003 standard specifies the intrinsic @code{RANDOM_SEED} to
7359 initialize the pseudo-random numbers generator and @code{RANDOM_NUMBER}
7360 to generate pseudo-random numbers. Please note that in
7361 GNU Fortran, these two sets of intrinsics (@code{RAND},
7362 @code{IRAND} and @code{SRAND} on the one hand, @code{RANDOM_NUMBER} and
7363 @code{RANDOM_SEED} on the other hand) access two independent
7364 pseudo-random number generators.
7366 @item @emph{See also}:
7367 @ref{RAND}, @ref{RANDOM_SEED}, @ref{RANDOM_NUMBER}
7373 @section @code{STAT} --- Get file status
7374 @findex @code{STAT} intrinsic
7375 @cindex file system operations
7377 Intrinsic implemented, documentation pending.
7380 @item @emph{Description}:
7381 @item @emph{Standard}:
7385 @item @emph{Syntax}:
7386 @item @emph{Arguments}:
7387 @item @emph{Return value}:
7388 @item @emph{Example}:
7389 @item @emph{See also}:
7397 @section @code{SUM} --- Sum of array elements
7398 @findex @code{SUM} intrinsic
7399 @cindex array manipulation
7401 Intrinsic implemented, documentation pending.
7404 @item @emph{Description}:
7405 @item @emph{Standard}:
7409 Transformational function
7411 @item @emph{Syntax}:
7412 @item @emph{Arguments}:
7413 @item @emph{Return value}:
7414 @item @emph{Example}:
7415 @item @emph{See also}:
7423 @section @code{SYMLNK} --- Create a symbolic link
7424 @findex @code{SYMLNK} intrinsic
7425 @cindex file system operations
7427 Intrinsic implemented, documentation pending.
7430 @item @emph{Description}:
7431 @item @emph{Standard}:
7435 @item @emph{Syntax}:
7436 @item @emph{Arguments}:
7437 @item @emph{Return value}:
7438 @item @emph{Example}:
7439 @item @emph{See also}:
7446 @section @code{SYSTEM} --- Execute a shell command
7447 @findex @code{SYSTEM} intrinsic
7448 @cindex undocumented intrinsic
7450 Intrinsic implemented, documentation pending.
7453 @item @emph{Description}:
7454 @item @emph{Standard}:
7460 @item @emph{Syntax}:
7461 @item @emph{Arguments}:
7462 @item @emph{Return value}:
7463 @item @emph{Example}:
7464 @item @emph{See also}:
7471 @section @code{SYSTEM_CLOCK} --- Time function
7472 @findex @code{SYSTEM_CLOCK} intrinsic
7473 @cindex time functions
7475 Intrinsic implemented, documentation pending.
7478 @item @emph{Description}:
7479 @item @emph{Standard}:
7485 @item @emph{Syntax}:
7486 @item @emph{Arguments}:
7487 @item @emph{Return value}:
7488 @item @emph{Example}:
7489 @item @emph{See also}:
7495 @section @code{TAN} --- Tangent function
7496 @findex @code{TAN} intrinsic
7497 @findex @code{DTAN} intrinsic
7498 @cindex trigonometric functions
7501 @item @emph{Description}:
7502 @code{TAN(X)} computes the tangent of @var{X}.
7504 @item @emph{Standard}:
7510 @item @emph{Syntax}:
7513 @item @emph{Arguments}:
7514 @multitable @columnfractions .15 .80
7515 @item @var{X} @tab The type shall be @code{REAL(*)}.
7518 @item @emph{Return value}:
7519 The return value is of type @code{REAL(*)}. The kind type parameter is
7520 the same as @var{X}.
7522 @item @emph{Example}:
7525 real(8) :: x = 0.165_8
7527 end program test_tan
7530 @item @emph{Specific names}:
7531 @multitable @columnfractions .20 .20 .20 .40
7532 @item Name @tab Argument @tab Return type @tab Standard
7533 @item @code{DTAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F95 and later
7536 @item @emph{See also}:
7543 @section @code{TANH} --- Hyperbolic tangent function
7544 @findex @code{TANH} intrinsic
7545 @findex @code{DTANH} intrinsic
7546 @cindex hyperbolic tangent
7549 @item @emph{Description}:
7550 @code{TANH(X)} computes the hyperbolic tangent of @var{X}.
7552 @item @emph{Standard}:
7558 @item @emph{Syntax}:
7561 @item @emph{Arguments}:
7562 @multitable @columnfractions .15 .80
7563 @item @var{X} @tab The type shall be @code{REAL(*)}.
7566 @item @emph{Return value}:
7567 The return value is of type @code{REAL(*)} and lies in the range
7568 @math{ - 1 \leq tanh(x) \leq 1 }.
7570 @item @emph{Example}:
7573 real(8) :: x = 2.1_8
7575 end program test_tanh
7578 @item @emph{Specific names}:
7579 @multitable @columnfractions .20 .20 .20 .40
7580 @item Name @tab Argument @tab Return type @tab Standard
7581 @item @code{DTANH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F95 and later
7584 @item @emph{See also}:
7591 @section @code{TIME} --- Time function
7592 @findex @code{TIME} intrinsic
7593 @cindex time functions
7595 Intrinsic implemented, documentation pending.
7598 @item @emph{Description}:
7599 @item @emph{Standard}:
7603 Non-elemental function
7605 @item @emph{Syntax}:
7606 @item @emph{Arguments}:
7607 @item @emph{Return value}:
7608 @item @emph{Example}:
7609 @item @emph{See also}:
7615 @section @code{TINY} --- Smallest positive number of a real kind
7616 @findex @code{TINY} intrinsic
7620 @item @emph{Description}:
7621 @code{TINY(X)} returns the smallest positive (non zero) number
7622 in the model of the type of @code{X}.
7624 @item @emph{Standard}:
7630 @item @emph{Syntax}:
7633 @item @emph{Arguments}:
7634 @multitable @columnfractions .15 .80
7635 @item @var{X} @tab shall be of type @code{REAL}.
7638 @item @emph{Return value}:
7639 The return value is of the same type and kind as @var{X}
7641 @item @emph{Example}:
7642 See @code{HUGE} for an example.
7648 @section @code{TRANSFER} --- Transfer bit patterns
7649 @findex @code{TRANSFER} intrinsic
7650 @cindex bit manipulation
7652 Intrinsic implemented, documentation pending.
7655 @item @emph{Description}:
7656 @item @emph{Standard}:
7660 Transformational function
7662 @item @emph{Syntax}:
7663 @item @emph{Arguments}:
7664 @item @emph{Return value}:
7665 @item @emph{Example}:
7666 @item @emph{See also}:
7673 @section @code{TRANSPOSE} --- Transpose an array of rank two
7674 @findex @code{TRANSPOSE} intrinsic
7675 @cindex matrix manipulation
7677 Intrinsic implemented, documentation pending.
7680 @item @emph{Description}:
7681 @item @emph{Standard}:
7685 Transformational function
7687 @item @emph{Syntax}:
7688 @item @emph{Arguments}:
7689 @item @emph{Return value}:
7690 @item @emph{Example}:
7691 @item @emph{See also}:
7698 @section @code{TRIM} --- Function to remove trailing blank characters of a string
7699 @findex @code{TRIM} intrinsic
7700 @cindex string manipulation
7702 Intrinsic implemented, documentation pending.
7705 @item @emph{Description}:
7706 @item @emph{Standard}:
7710 Transformational function
7712 @item @emph{Syntax}:
7713 @item @emph{Arguments}:
7714 @item @emph{Return value}:
7715 @item @emph{Example}:
7716 @item @emph{See also}:
7723 @section @code{UBOUND} --- Upper dimension bounds of an array
7724 @findex @code{UBOUND} intrinsic
7725 @cindex undocumented intrinsic
7727 Intrinsic implemented, documentation pending.
7730 @item @emph{Description}:
7732 @item @emph{Standard}:
7738 @item @emph{Syntax}:
7739 @item @emph{Arguments}:
7740 @item @emph{Return value}:
7741 @item @emph{Example}:
7742 @item @emph{Specific names}:
7744 @item @emph{See also}:
7752 @section @code{UMASK} --- Set the file creation mask
7753 @findex @code{UMASK} intrinsic
7754 @cindex file system operations
7756 Intrinsic implemented, documentation pending.
7759 @item @emph{Description}:
7760 @item @emph{Standard}:
7766 @item @emph{Syntax}:
7767 @item @emph{Arguments}:
7768 @item @emph{Return value}:
7769 @item @emph{Example}:
7770 @item @emph{Specific names}:
7771 @item @emph{See also}:
7778 @section @code{UNLINK} --- Remove a file from the file system
7779 @findex @code{UNLINK} intrinsic
7780 @cindex file system operations
7782 Intrinsic implemented, documentation pending.
7785 @item @emph{Description}:
7786 @item @emph{Standard}:
7792 @item @emph{Syntax}:
7793 @item @emph{Arguments}:
7794 @item @emph{Return value}:
7795 @item @emph{Example}:
7797 @item @emph{See also}:
7805 @section @code{UNMASK} --- (?)
7806 @findex @code{UNMASK} intrinsic
7807 @cindex undocumented intrinsic
7809 Intrinsic implemented, documentation pending.
7812 @item @emph{Description}:
7813 @item @emph{Standard}:
7815 @item @emph{Syntax}:
7816 @item @emph{Arguments}:
7817 @item @emph{Return value}:
7818 @item @emph{Example}:
7819 @item @emph{Specific names}:
7820 @item @emph{See also}:
7827 @section @code{UNPACK} --- Unpack an array of rank one into an array
7828 @findex @code{UNPACK} intrinsic
7829 @cindex array manipulation
7831 Intrinsic implemented, documentation pending.
7834 @item @emph{Description}:
7835 @item @emph{Standard}:
7839 Transformational function
7841 @item @emph{Syntax}:
7842 @item @emph{Arguments}:
7843 @item @emph{Return value}:
7844 @item @emph{Example}:
7846 @item @emph{See also}:
7854 @section @code{VERIFY} --- Scan a string for the absence of a set of characters
7855 @findex @code{VERIFY} intrinsic
7856 @cindex string manipulation
7858 Intrinsic implemented, documentation pending.
7861 @item @emph{Description}:
7862 @item @emph{Standard}:
7868 @item @emph{Syntax}:
7869 @item @emph{Arguments}:
7870 @item @emph{Return value}:
7871 @item @emph{Example}:
7872 @item @emph{Specific names}:
7873 @item @emph{See also}:
7878 @section @code{XOR} --- Bitwise logical exclusive OR
7879 @findex @code{XOR} intrinsic
7880 @cindex bit operations
7883 @item @emph{Description}:
7884 Bitwise logical exclusive or.
7886 This intrinsic routine is provided for backwards compatibility with
7887 GNU Fortran 77. For integer arguments, programmers should consider
7888 the use of the @ref{IEOR} intrinsic defined by the Fortran standard.
7890 @item @emph{Standard}:
7894 Non-elemental function
7896 @item @emph{Syntax}:
7897 @code{RESULT = XOR(X, Y)}
7899 @item @emph{Arguments}:
7900 @multitable @columnfractions .15 .80
7901 @item @var{X} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
7902 @item @var{Y} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
7905 @item @emph{Return value}:
7906 The return type is either @code{INTEGER(*)} or @code{LOGICAL}
7907 after cross-promotion of the arguments.
7909 @item @emph{Example}:
7912 LOGICAL :: T = .TRUE., F = .FALSE.
7914 DATA a / Z,'F' /, b / Z'3' /
7916 WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F)
7917 WRITE (*,*) XOR(a, b)
7921 @item @emph{See also}:
7922 F95 elemental function: @ref{IEOR}