* intrinsic.texi: Various minor cleanups.
[official-gcc.git] / gcc / fortran / intrinsic.texi
blob2e0194e6b971e3b8c96cbb47dd5ba82a5f06d41d
1 @ignore
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.
25 @end ignore
27 @tex
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}
34 @end tex
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'.
47 @comment Missing intrinsics (double check with #19292)
48 @comment  - MClock
49 @comment  - Short
51 @menu
52 * Introduction:         Introduction
53 * @code{ABORT}:         ABORT,     Abort the program     
54 * @code{ABS}:           ABS,       Absolute value     
55 * @code{ACCESS}:        ACCESS,    Checks file access modes
56 * @code{ACHAR}:         ACHAR,     Character in @acronym{ASCII} collating sequence
57 * @code{ACOS}:          ACOS,      Arccosine function
58 * @code{ACOSH}:         ACOSH,     Hyperbolic arccosine function
59 * @code{ADJUSTL}:       ADJUSTL,   Left adjust a string
60 * @code{ADJUSTR}:       ADJUSTR,   Right adjust a string
61 * @code{AIMAG}:         AIMAG,     Imaginary part of complex number
62 * @code{AINT}:          AINT,      Truncate to a whole number
63 * @code{ALARM}:         ALARM,     Set an alarm clock
64 * @code{ALL}:           ALL,       Determine if all values are true
65 * @code{ALLOCATED}:     ALLOCATED, Status of allocatable entity
66 * @code{AND}:           AND,       Bitwise logical AND
67 * @code{ANINT}:         ANINT,     Nearest whole number
68 * @code{ANY}:           ANY,       Determine if any values are true
69 * @code{ASIN}:          ASIN,      Arcsine function
70 * @code{ASINH}:         ASINH,     Hyperbolic arcsine function
71 * @code{ASSOCIATED}:    ASSOCIATED, Status of a pointer or pointer/target pair
72 * @code{ATAN}:          ATAN,      Arctangent function
73 * @code{ATAN2}:         ATAN2,     Arctangent function
74 * @code{ATANH}:         ATANH,     Hyperbolic arctangent function
75 * @code{BESJ0}:         BESJ0,     Bessel function of the first kind of order 0
76 * @code{BESJ1}:         BESJ1,     Bessel function of the first kind of order 1
77 * @code{BESJN}:         BESJN,     Bessel function of the first kind
78 * @code{BESY0}:         BESY0,     Bessel function of the second kind of order 0
79 * @code{BESY1}:         BESY1,     Bessel function of the second kind of order 1
80 * @code{BESYN}:         BESYN,     Bessel function of the second kind
81 * @code{BIT_SIZE}:      BIT_SIZE,  Bit size inquiry function
82 * @code{BTEST}:         BTEST,     Bit test function
83 * @code{CEILING}:       CEILING,   Integer ceiling function
84 * @code{CHAR}:          CHAR,      Integer-to-character conversion function
85 * @code{CHDIR}:         CHDIR,     Change working directory
86 * @code{CHMOD}:         CHMOD,     Change access permissions of files
87 * @code{CMPLX}:         CMPLX,     Complex conversion function
88 * @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT, Get number of command line arguments
89 * @code{CONJG}:         CONJG,     Complex conjugate function
90 * @code{COS}:           COS,       Cosine function
91 * @code{COSH}:          COSH,      Hyperbolic cosine function
92 * @code{COUNT}:         COUNT,     Count occurrences of TRUE in an array
93 * @code{CPU_TIME}:      CPU_TIME,  CPU time subroutine
94 * @code{CSHIFT}:        CSHIFT,    Circular array shift function
95 * @code{CTIME}:         CTIME,     Subroutine (or function) to convert a time into a string
96 * @code{DATE_AND_TIME}: DATE_AND_TIME, Date and time subroutine
97 * @code{DBLE}:          DBLE,      Double precision conversion function
98 * @code{DCMPLX}:        DCMPLX,    Double complex conversion function
99 * @code{DFLOAT}:        DFLOAT,    Double precision conversion function
100 * @code{DIGITS}:        DIGITS,    Significant digits function
101 * @code{DIM}:           DIM,       Dim function
102 * @code{DOT_PRODUCT}:   DOT_PRODUCT, Dot product function
103 * @code{DPROD}:         DPROD,     Double product function
104 * @code{DREAL}:         DREAL,     Double real part function
105 * @code{DTIME}:         DTIME,     Execution time subroutine (or function)
106 * @code{EOSHIFT}:       EOSHIFT,   End-off shift function
107 * @code{EPSILON}:       EPSILON,   Epsilon function
108 * @code{ERF}:           ERF,       Error function
109 * @code{ERFC}:          ERFC,      Complementary error function
110 * @code{ETIME}:         ETIME,     Execution time subroutine (or function)
111 * @code{EXIT}:          EXIT,      Exit the program with status.
112 * @code{EXP}:           EXP,       Exponential function
113 * @code{EXPONENT}:      EXPONENT,  Exponent function
114 * @code{FDATE}:         FDATE,     Subroutine (or function) to get the current time as a string
115 * @code{FGET}:          FGET,      Read a single character in stream mode from stdin
116 * @code{FGETC}:         FGETC,     Read a single character in stream mode
117 * @code{FLOAT}:         FLOAT,     Convert integer to default real
118 * @code{FLOOR}:         FLOOR,     Integer floor function
119 * @code{FLUSH}:         FLUSH,     Flush I/O unit(s)
120 * @code{FNUM}:          FNUM,      File number function
121 * @code{FPUT}:          FPUT,      Write a single character in stream mode to stdout
122 * @code{FPUTC}:         FPUTC,     Write a single character in stream mode
123 * @code{FRACTION}:      FRACTION,  Fractional part of the model representation
124 * @code{FREE}:          FREE,      Memory de-allocation subroutine
125 * @code{FSEEK}:         FSEEK,     Low level file positioning subroutine
126 * @code{FSTAT}:         FSTAT,     Get file status
127 * @code{FTELL}:         FTELL,     Current stream position
128 * @code{GETARG}:        GETARG,    Get command line arguments
129 * @code{GET_COMMAND}:   GET_COMMAND, Get the entire command line
130 * @code{GET_COMMAND_ARGUMENT}: GET_COMMAND_ARGUMENT, Get command line arguments
131 * @code{GETCWD}:        GETCWD,    Get current working directory
132 * @code{GETENV}:        GETENV,    Get an environmental variable
133 * @code{GET_ENVIRONMENT_VARIABLE}: GET_ENVIRONMENT_VARIABLE, Get an environmental variable
134 * @code{GETGID}:        GETGID,    Group ID function
135 * @code{GETLOG}:        GETLOG,    Get login name
136 * @code{GETPID}:        GETPID,    Process ID function
137 * @code{GETUID}:        GETUID,    User ID function
138 * @code{GMTIME}:        GMTIME,    Convert time to GMT info
139 * @code{HOSTNM}:        HOSTNM,    Get system host name
140 * @code{HUGE}:          HUGE,      Largest number of a kind
141 * @code{IACHAR}:        IACHAR,    Code in @acronym{ASCII} collating sequence
142 * @code{IAND}:          IAND,      Bitwise logical and
143 * @code{IARGC}:         IARGC,     Get the number of command line arguments
144 * @code{IBCLR}:         IBCLR,     Clear bit
145 * @code{IBITS}:         IBITS,     Bit extraction
146 * @code{IBSET}:         IBSET,     Set bit
147 * @code{ICHAR}:         ICHAR,     Character-to-integer conversion function
148 * @code{IDATE}:         IDATE,     Current local time (day/month/year)
149 * @code{IEOR}:          IEOR,      Bitwise logical exclusive or
150 * @code{IERRNO}:        IERRNO,    Function to get the last system error number
151 * @code{INDEX}:         INDEX,     Position of a substring within a string
152 * @code{INT}:           INT,       Convert to integer type
153 * @code{IOR}:           IOR,       Bitwise logical or
154 * @code{IRAND}:         IRAND,     Integer pseudo-random number
155 * @code{ISHFT}:         ISHFT,     Shift bits
156 * @code{ISHFTC}:        ISHFTC,    Shift bits circularly
157 * @code{ITIME}:         ITIME,     Current local time (hour/minutes/seconds)
158 * @code{KILL}:          KILL,      Send a signal to a process
159 * @code{KIND}:          KIND,      Kind of an entity
160 * @code{LBOUND}:        LBOUND,    Lower dimension bounds of an array
161 * @code{LEN}:           LEN,       Length of a character entity
162 * @code{LEN_TRIM}:      LEN_TRIM,  Length of a character entity without trailing blank characters
163 * @code{LGE}:           LGE,       Lexical greater than or equal
164 * @code{LGT}:           LGT,       Lexical greater than
165 * @code{LINK}:          LINK,      Create a hard link
166 * @code{LLE}:           LLE,       Lexical less than or equal
167 * @code{LLT}:           LLT,       Lexical less than
168 * @code{LNBLNK}:        LNBLNK,    Index of the last non-blank character in a string
169 * @code{LOC}:           LOC,       Returns the address of a variable
170 * @code{LOG}:           LOG,       Logarithm function
171 * @code{LOG10}:         LOG10,     Base 10 logarithm function 
172 * @code{LOGICAL}:       LOGICAL,   Convert to logical type
173 * @code{LSHIFT}:        LSHIFT,    Left shift bits
174 * @code{LSTAT}:         LSTAT,     Get file status
175 * @code{LTIME}:         LTIME,     Convert time to local time info
176 * @code{MALLOC}:        MALLOC,    Dynamic memory allocation function
177 * @code{MATMUL}:        MATMUL,    matrix multiplication
178 * @code{MAX}:           MAX,       Maximum value of an argument list
179 * @code{MAXEXPONENT}:   MAXEXPONENT, Maximum exponent of a real kind
180 * @code{MAXLOC}:        MAXLOC,    Location of the maximum value within an array
181 * @code{MAXVAL}:        MAXVAL,    Maximum value of an array
182 * @code{MERGE}:         MERGE,     Merge arrays
183 * @code{MIN}:           MIN,       Minimum value of an argument list
184 * @code{MINEXPONENT}:   MINEXPONENT, Minimum exponent of a real kind
185 * @code{MINLOC}:        MINLOC,    Location of the minimum value within an array
186 * @code{MINVAL}:        MINVAL,    Minimum value of an array
187 * @code{MOD}:           MOD,       Remainder function
188 * @code{MODULO}:        MODULO,    Modulo function
189 * @code{MOVE_ALLOC}:    MOVE_ALLOC, Move allocation from one object to another
190 * @code{MVBITS}:        MVBITS,    Move bits from one integer to another
191 * @code{NEAREST}:       NEAREST,   Nearest representable number
192 * @code{NEW_LINE}:      NEW_LINE,  New line character
193 * @code{NINT}:          NINT,      Nearest whole number
194 * @code{NOT}:           NOT,       Logical negation
195 * @code{NULL}:          NULL,      Function that returns an disassociated pointer
196 * @code{OR}:            OR,        Bitwise logical OR
197 * @code{PACK}:          PACK,      Pack an array into an array of rank one
198 * @code{PERROR}:        PERROR,    Print system error message
199 * @code{PRECISION}:     PRECISION, Decimal precision of a real kind
200 * @code{PRESENT}:       PRESENT,   Determine whether an optional argument is specified
201 * @code{PRODUCT}:       PRODUCT,   Product of array elements
202 * @code{RADIX}:         RADIX,     Base of a data model
203 * @code{RANDOM_NUMBER}: RANDOM_NUMBER, Pseudo-random number
204 * @code{RANDOM_SEED}:   RANDOM_SEED, Initialize a pseudo-random number sequence
205 * @code{RAND}:          RAND,      Real pseudo-random number
206 * @code{RANGE}:         RANGE,     Decimal exponent range of a real kind
207 * @code{RAN}:           RAN,       Real pseudo-random number
208 * @code{REAL}:          REAL,      Convert to real type 
209 * @code{RENAME}:        RENAME,    Rename a file
210 * @code{REPEAT}:        REPEAT,    Repeated string concatenation
211 * @code{RESHAPE}:       RESHAPE,   Function to reshape an array
212 * @code{RRSPACING}:     RRSPACING, Reciprocal of the relative spacing
213 * @code{RSHIFT}:        RSHIFT,    Right shift bits
214 * @code{SCALE}:         SCALE,     Scale a real value
215 * @code{SCAN}:          SCAN,      Scan a string for the presence of a set of characters
216 * @code{SECNDS}:        SECNDS,    Time function
217 @comment * @code{SECOND}:        SECOND,    (?)
218 @comment * @code{SECONDS}:       SECONDS,   (?)
219 * @code{SELECTED_INT_KIND}: SELECTED_INT_KIND,  Choose integer kind
220 * @code{SELECTED_REAL_KIND}: SELECTED_REAL_KIND,  Choose real kind
221 * @code{SET_EXPONENT}:  SET_EXPONENT, Set the exponent of the model
222 * @code{SHAPE}:         SHAPE,     Determine the shape of an array
223 * @code{SIGN}:          SIGN,      Sign copying function
224 * @code{SIGNAL}:        SIGNAL,    Signal handling subroutine (or function)
225 * @code{SIN}:           SIN,       Sine function
226 * @code{SINH}:          SINH,      Hyperbolic sine function
227 * @code{SIZE}:          SIZE,      Function to determine the size of an array
228 * @code{SNGL}:          SNGL,      Convert double precision real to default real
229 * @code{SPACING}:       SPACING,   Smallest distance between two numbers of a given type
230 * @code{SPREAD}:        SPREAD,    Add a dimension to an array 
231 * @code{SQRT}:          SQRT,      Square-root function
232 * @code{SRAND}:         SRAND,     Reinitialize the random number generator
233 * @code{STAT}:          STAT,      Get file status
234 * @code{SUM}:           SUM,       Sum of array elements
235 * @code{SYMLNK}:        SYMLNK,    Create a symbolic link
236 * @code{SYSTEM}:        SYSTEM,    Execute a shell command
237 * @code{SYSTEM_CLOCK}:  SYSTEM_CLOCK, Time function
238 * @code{TAN}:           TAN,       Tangent function
239 * @code{TANH}:          TANH,      Hyperbolic tangent function
240 * @code{TIME}:          TIME,      Time function
241 * @code{TINY}:          TINY,      Smallest positive number of a real kind
242 * @code{TRANSFER}:      TRANSFER,  Transfer bit patterns
243 * @code{TRANSPOSE}:     TRANSPOSE, Transpose an array of rank two
244 * @code{TRIM}:          TRIM,      Function to remove trailing blank characters of a string
245 * @code{UBOUND}:        UBOUND,    Upper dimension bounds of an array
246 * @code{UMASK}:         UMASK,     Set the file creation mask
247 * @code{UNLINK}:        UNLINK,    Remove a file from the file system
248 * @code{UNMASK}:        UNMASK,    (?)
249 * @code{UNPACK}:        UNPACK,    Unpack an array of rank one into an array
250 * @code{VERIFY}:        VERIFY,    Scan a string for the absence of a set of characters
251 * @code{XOR}:           XOR,       Bitwise logical exclusive or
252 @end menu
254 @node Introduction
255 @section Introduction to intrinsic procedures
257 GNU Fortran provides a rich set of intrinsic procedures that includes all
258 the intrinsic procedures required by the Fortran 95 standard, a set of
259 intrinsic procedures for backwards compatibility with Gnu Fortran 77
260 (i.e., @command{g77}), and a small selection of intrinsic procedures
261 from the Fortran 2003 standard.  Any description here, which conflicts with a 
262 description in either the Fortran 95 standard or the Fortran 2003 standard,
263 is unintentional and the standard(s) should be considered authoritative.
265 The enumeration of the @code{KIND} type parameter is processor defined in
266 the Fortran 95 standard.  GNU Fortran defines the default integer type and
267 default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)},
268 respectively.  The standard mandates that both data types shall have
269 another kind, which have more precision.  On typical target architectures
270 supported by @command{gfortran}, this kind type parameter is @code{KIND=8}.
271 Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
272 In the description of generic intrinsic procedures, the kind type parameter
273 will be specified by @code{KIND=*}, and in the description of specific
274 names for an intrinsic procedure the kind type parameter will be explicitly
275 given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}).  Finally, for
276 brevity the optional @code{KIND=} syntax will be omitted.
278 Many of the intrinsic procedures take one or more optional arguments.
279 This document follows the convention used in the Fortran 95 standard,
280 and denotes such arguments by square brackets.
282 GNU Fortran offers the @option{-std=f95} and @option{-std=gnu} options,
283 which can be used to restrict the set of intrinsic procedures to a 
284 given standard.  By default, @command{gfortran} sets the @option{-std=gnu}
285 option, and so all intrinsic procedures described here are accepted.  There
286 is one caveat.  For a select group of intrinsic procedures, @command{g77}
287 implemented both a function and a subroutine.  Both classes 
288 have been implemented in @command{gfortran} for backwards compatibility
289 with @command{g77}.  It is noted here that these functions and subroutines
290 cannot be intermixed in a given subprogram.  In the descriptions that follow,
291 the applicable option(s) is noted.
294 @node ABORT
295 @section @code{ABORT} --- Abort the program  
296 @findex @code{ABORT} intrinsic
297 @cindex abort
299 @table @asis
300 @item @emph{Description}:
301 @code{ABORT} causes immediate termination of the program.  On operating
302 systems that support a core dump, @code{ABORT} will produce a core dump,
303 which is suitable for debugging purposes.
305 @item @emph{Standard}:
306 GNU extension
308 @item @emph{Class}:
309 non-elemental subroutine
311 @item @emph{Syntax}:
312 @code{CALL ABORT}
314 @item @emph{Return value}:
315 Does not return.
317 @item @emph{Example}:
318 @smallexample
319 program test_abort
320   integer :: i = 1, j = 2
321   if (i /= j) call abort
322 end program test_abort
323 @end smallexample
325 @item @emph{See also}:
326 @ref{EXIT}, @ref{KILL}
328 @end table
331 @node ABS
332 @section @code{ABS} --- Absolute value  
333 @findex @code{ABS} intrinsic
334 @findex @code{CABS} intrinsic
335 @findex @code{DABS} intrinsic
336 @findex @code{IABS} intrinsic
337 @findex @code{ZABS} intrinsic
338 @findex @code{CDABS} intrinsic
339 @cindex absolute value
341 @table @asis
342 @item @emph{Description}:
343 @code{ABS(X)} computes the absolute value of @code{X}.
345 @item @emph{Standard}:
346 F77 and later, has overloads that are GNU extensions
348 @item @emph{Class}:
349 Elemental function
351 @item @emph{Syntax}:
352 @code{X = ABS(X)}
354 @item @emph{Arguments}:
355 @multitable @columnfractions .15 .80
356 @item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)},
357 @code{REAL(*)}, or @code{COMPLEX(*)}.
358 @end multitable
360 @item @emph{Return value}:
361 The return value is of the same type and
362 kind as the argument except the return value is @code{REAL(*)} for a
363 @code{COMPLEX(*)} argument.
365 @item @emph{Example}:
366 @smallexample
367 program test_abs
368   integer :: i = -1
369   real :: x = -1.e0
370   complex :: z = (-1.e0,0.e0)
371   i = abs(i)
372   x = abs(x)
373   x = abs(z)
374 end program test_abs
375 @end smallexample
377 @item @emph{Specific names}:
378 @multitable @columnfractions .20 .20 .20 .40
379 @item Name            @tab Argument            @tab Return type       @tab Standard
380 @item @code{CABS(Z)}  @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)}    @tab F77 and later
381 @item @code{DABS(X)}  @tab @code{REAL(8)    X} @tab @code{REAL(8)}    @tab F77 and later
382 @item @code{IABS(I)}  @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab F77 and later
383 @item @code{ZABS(Z)}  @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension
384 @item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension
385 @end multitable
386 @end table
389 @node ACCESS
390 @section @code{ACCESS} --- Checks file access modes
391 @findex @code{ACCESS} 
392 @cindex file system functions
394 @table @asis
395 @item @emph{Description}:
396 @code{ACCESS(NAME, MODE)} checks whether the file @var{NAME} 
397 exists, is readable, writable or executable. Except for the
398 executable check, @code{ACCESS} can be replaced by
399 Fortran 95's @code{INQUIRE}.
401 @item @emph{Standard}:
402 GNU extension
404 @item @emph{Class}:
405 Inquiry function
407 @item @emph{Syntax}:
408 @code{I = ACCESS(NAME, MODE)}
410 @item @emph{Arguments}:
411 @multitable @columnfractions .15 .80
412 @item @var{NAME} @tab Scalar @code{CHARACTER} with the file name.
413 Tailing blank are ignored unless the character @code{achar(0)} is
414 present, then all characters up to and excluding @code{achar(0)} are
415 used as file name.
416 @item @var{MODE} @tab Scalar @code{CHARACTER} with the file access mode,
417 may be any concatenation of @code{"r"} (readable), @code{"w"} (writable)
418 and @code{"x"} (executable), or @code{" "} to check for existence.
419 @end multitable
421 @item @emph{Return value}:
422 Returns a scalar @code{INTEGER}, which is @code{0} if the file is
423 accessable in the given mode; otherwise or if an invalid argument
424 has been given for @code{MODE} the value @code{1} is returned.
426 @item @emph{Example}:
427 @smallexample
428 program access_test
429   implicit none
430   character(len=*), parameter :: file  = 'test.dat'
431   character(len=*), parameter :: file2 = 'test.dat  '//achar(0)
432   if(access(file,' ') == 0) print *, trim(file),' is exists'
433   if(access(file,'r') == 0) print *, trim(file),' is readable'
434   if(access(file,'w') == 0) print *, trim(file),' is writable'
435   if(access(file,'x') == 0) print *, trim(file),' is executable'
436   if(access(file2,'rwx') == 0) &
437     print *, trim(file2),' is readable, writable and executable'
438 end program access_test
439 @end smallexample
440 @item @emph{Specific names}:
441 @item @emph{See also}:
443 @end table
446 @node ACHAR
447 @section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence 
448 @findex @code{ACHAR} intrinsic
449 @cindex @acronym{ASCII} collating sequence
451 @table @asis
452 @item @emph{Description}:
453 @code{ACHAR(I)} returns the character located at position @code{I}
454 in the @acronym{ASCII} collating sequence.
456 @item @emph{Standard}:
457 F77 and later
459 @item @emph{Class}:
460 Elemental function
462 @item @emph{Syntax}:
463 @code{C = ACHAR(I)}
465 @item @emph{Arguments}:
466 @multitable @columnfractions .15 .80
467 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
468 @end multitable
470 @item @emph{Return value}:
471 The return value is of type @code{CHARACTER} with a length of one.  The
472 kind type parameter is the same as  @code{KIND('A')}.
474 @item @emph{Example}:
475 @smallexample
476 program test_achar
477   character c
478   c = achar(32)
479 end program test_achar
480 @end smallexample
481 @end table
485 @node ACOS
486 @section @code{ACOS} --- Arccosine function 
487 @findex @code{ACOS} intrinsic
488 @findex @code{DACOS} intrinsic
489 @cindex trigonometric functions (inverse)
491 @table @asis
492 @item @emph{Description}:
493 @code{ACOS(X)} computes the arccosine of @var{X} (inverse of @code{COS(X)}).
495 @item @emph{Standard}:
496 F77 and later
498 @item @emph{Class}:
499 Elemental function
501 @item @emph{Syntax}:
502 @code{X = ACOS(X)}
504 @item @emph{Arguments}:
505 @multitable @columnfractions .15 .80
506 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
507 less than one.
508 @end multitable
510 @item @emph{Return value}:
511 The return value is of type @code{REAL(*)} and it lies in the
512 range @math{ 0 \leq \acos(x) \leq \pi}. The kind type parameter 
513 is the same as @var{X}.
515 @item @emph{Example}:
516 @smallexample
517 program test_acos
518   real(8) :: x = 0.866_8
519   x = acos(x)
520 end program test_acos
521 @end smallexample
523 @item @emph{Specific names}:
524 @multitable @columnfractions .20 .20 .20 .40
525 @item Name            @tab Argument          @tab Return type       @tab Standard
526 @item @code{DACOS(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F77 and later
527 @end multitable
529 @item @emph{See also}:
530 Inverse function: @ref{COS}
532 @end table
535 @node ACOSH
536 @section @code{ACOSH} --- Hyperbolic arccosine function
537 @findex @code{ACOSH} intrinsic
538 @cindex hyperbolic arccosine
539 @cindex hyperbolic cosine (inverse)
541 @table @asis
542 @item @emph{Description}:
543 @code{ACOSH(X)} computes the area hyperbolic cosine of @var{X} (inverse of @code{COSH(X)}).
545 @item @emph{Standard}:
546 GNU extension
548 @item @emph{Class}:
549 Elemental function
551 @item @emph{Syntax}:
552 @code{X = ACOSH(X)}
554 @item @emph{Arguments}:
555 @multitable @columnfractions .15 .80
556 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
557 greater or equal to one.
558 @end multitable
560 @item @emph{Return value}:
561 The return value is of type @code{REAL(*)} and it lies in the
562 range @math{0 \leq \acosh (x) \leq \infty}.
564 @item @emph{Example}:
565 @smallexample
566 PROGRAM test_acosh
567   REAL(8), DIMENSION(3) :: x = (/ 1.0, 2.0, 3.0 /)
568   WRITE (*,*) ACOSH(x)
569 END PROGRAM
570 @end smallexample
572 @item @emph{See also}:
573 Inverse function: @ref{COSH}
574 @end table
578 @node ADJUSTL
579 @section @code{ADJUSTL} --- Left adjust a string 
580 @findex @code{ADJUSTL} intrinsic
581 @cindex adjust string
583 @table @asis
584 @item @emph{Description}:
585 @code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.
586 Spaces are inserted at the end of the string as needed.
588 @item @emph{Standard}:
589 F95 and later
591 @item @emph{Class}:
592 Elemental function
594 @item @emph{Syntax}:
595 @code{STR = ADJUSTL(STR)}
597 @item @emph{Arguments}:
598 @multitable @columnfractions .15 .80
599 @item @var{STR} @tab The type shall be @code{CHARACTER}.
600 @end multitable
602 @item @emph{Return value}:
603 The return value is of type @code{CHARACTER} where leading spaces 
604 are removed and the same number of spaces are inserted on the end
605 of @var{STR}.
607 @item @emph{Example}:
608 @smallexample
609 program test_adjustl
610   character(len=20) :: str = '   gfortran'
611   str = adjustl(str)
612   print *, str
613 end program test_adjustl
614 @end smallexample
615 @end table
619 @node ADJUSTR
620 @section @code{ADJUSTR} --- Right adjust a string 
621 @findex @code{ADJUSTR} intrinsic
622 @cindex adjust string
624 @table @asis
625 @item @emph{Description}:
626 @code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.
627 Spaces are inserted at the start of the string as needed.
629 @item @emph{Standard}:
630 F95 and later
632 @item @emph{Class}:
633 Elemental function
635 @item @emph{Syntax}:
636 @code{STR = ADJUSTR(STR)}
638 @item @emph{Arguments}:
639 @multitable @columnfractions .15 .80
640 @item @var{STR} @tab The type shall be @code{CHARACTER}.
641 @end multitable
643 @item @emph{Return value}:
644 The return value is of type @code{CHARACTER} where trailing spaces 
645 are removed and the same number of spaces are inserted at the start
646 of @var{STR}.
648 @item @emph{Example}:
649 @smallexample
650 program test_adjustr
651   character(len=20) :: str = 'gfortran'
652   str = adjustr(str)
653   print *, str
654 end program test_adjustr
655 @end smallexample
656 @end table
660 @node AIMAG
661 @section @code{AIMAG} --- Imaginary part of complex number  
662 @findex @code{AIMAG} intrinsic
663 @findex @code{DIMAG} intrinsic
664 @findex @code{IMAG} intrinsic
665 @findex @code{IMAGPART} intrinsic
666 @cindex Imaginary part
668 @table @asis
669 @item @emph{Description}:
670 @code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.
671 The @code{IMAG(Z)} and @code{IMAGPART(Z)} intrinsic functions are provided
672 for compatibility with @command{g77}, and their use in new code is 
673 strongly discouraged.
675 @item @emph{Standard}:
676 F77 and later, has overloads that are GNU extensions
678 @item @emph{Class}:
679 Elemental function
681 @item @emph{Syntax}:
682 @code{X = AIMAG(Z)}
684 @item @emph{Arguments}:
685 @multitable @columnfractions .15 .80
686 @item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.
687 @end multitable
689 @item @emph{Return value}:
690 The return value is of type real with the
691 kind type parameter of the argument.
693 @item @emph{Example}:
694 @smallexample
695 program test_aimag
696   complex(4) z4
697   complex(8) z8
698   z4 = cmplx(1.e0_4, 0.e0_4)
699   z8 = cmplx(0.e0_8, 1.e0_8)
700   print *, aimag(z4), dimag(z8)
701 end program test_aimag
702 @end smallexample
704 @item @emph{Specific names}:
705 @multitable @columnfractions .20 .20 .20 .40
706 @item Name            @tab Argument            @tab Return type       @tab Standard
707 @item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)}    @tab GNU extension
708 @item @code{IMAG(Z)}  @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)}    @tab GNU extension
709 @item @code{IMAGPART(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab GNU extension
710 @end multitable
711 @end table
715 @node AINT
716 @section @code{AINT} --- Truncate to a whole number
717 @findex @code{AINT} intrinsic
718 @findex @code{DINT} intrinsic
719 @cindex whole number
721 @table @asis
722 @item @emph{Description}:
723 @code{AINT(X [, KIND])} truncates its argument to a whole number.
725 @item @emph{Standard}:
726 F77 and later
728 @item @emph{Class}:
729 Elemental function
731 @item @emph{Syntax}:
732 @code{X = AINT(X [, KIND])} 
734 @item @emph{Arguments}:
735 @multitable @columnfractions .15 .80
736 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
737 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
738 initialization expression.
739 @end multitable
741 @item @emph{Return value}:
742 The return value is of type real with the kind type parameter of the
743 argument if the optional @var{KIND} is absent; otherwise, the kind
744 type parameter will be given by @var{KIND}.  If the magnitude of 
745 @var{X} is less than one, then @code{AINT(X)} returns zero.  If the
746 magnitude is equal to or greater than one, then it returns the largest
747 whole number that does not exceed its magnitude.  The sign is the same
748 as the sign of @var{X}. 
750 @item @emph{Example}:
751 @smallexample
752 program test_aint
753   real(4) x4
754   real(8) x8
755   x4 = 1.234E0_4
756   x8 = 4.321_8
757   print *, aint(x4), dint(x8)
758   x8 = aint(x4,8)
759 end program test_aint
760 @end smallexample
762 @item @emph{Specific names}:
763 @multitable @columnfractions .20 .20 .20 .40
764 @item Name           @tab Argument         @tab Return type      @tab Standard
765 @item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab F77 and later
766 @end multitable
767 @end table
771 @node ALARM
772 @section @code{ALARM} --- Execute a routine after a given delay
773 @findex @code{ALARM} intrinsic
775 @table @asis
776 @item @emph{Description}:
777 @code{ALARM(SECONDS, HANDLER [, STATUS])} causes external subroutine @var{HANDLER}
778 to be executed after a delay of @var{SECONDS} by using @code{alarm(1)} to
779 set up a signal and @code{signal(2)} to catch it. If @var{STATUS} is
780 supplied, it will be returned with the number of seconds remaining until
781 any previously scheduled alarm was due to be delivered, or zero if there
782 was no previously scheduled alarm.
784 @item @emph{Standard}:
785 GNU extension
787 @item @emph{Class}:
788 Subroutine
790 @item @emph{Syntax}:
791 @code{CALL ALARM(SECONDS, HANDLER [, STATUS])}
793 @item @emph{Arguments}:
794 @multitable @columnfractions .15 .80
795 @item @var{SECONDS} @tab The type of the argument shall be a scalar
796 @code{INTEGER}. It is @code{INTENT(IN)}.
797 @item @var{HANDLER} @tab Signal handler (@code{INTEGER FUNCTION} or
798 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
799 @code{INTEGER}. It is @code{INTENT(IN)}.
800 @item @var{STATUS}  @tab (Optional) @var{STATUS} shall be a scalar
801 @code{INTEGER} variable. It is @code{INTENT(OUT)}.
802 @end multitable
804 @item @emph{Example}:
805 @smallexample
806 program test_alarm
807   external handler_print
808   integer i
809   call alarm (3, handler_print, i)
810   print *, i
811   call sleep(10)
812 end program test_alarm
813 @end smallexample
814 This will cause the external routine @var{handler_print} to be called
815 after 3 seconds.
816 @end table
820 @node ALL
821 @section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true 
822 @findex @code{ALL} intrinsic
823 @cindex true values
825 @table @asis
826 @item @emph{Description}:
827 @code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}
828 in the array along dimension @var{DIM}.
830 @item @emph{Standard}:
831 F95 and later
833 @item @emph{Class}:
834 transformational function
836 @item @emph{Syntax}:
837 @code{L = ALL(MASK [, DIM])}
839 @item @emph{Arguments}:
840 @multitable @columnfractions .15 .80
841 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
842 it shall not be scalar.
843 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
844 with a value that lies between one and the rank of @var{MASK}.
845 @end multitable
847 @item @emph{Return value}:
848 @code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
849 the kind type parameter is the same as the kind type parameter of
850 @var{MASK}.  If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns
851 an array with the rank of @var{MASK} minus 1.  The shape is determined from
852 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
854 @table @asis
855 @item (A)
856 @code{ALL(MASK)} is true if all elements of @var{MASK} are true.
857 It also is true if @var{MASK} has zero size; otherwise, it is false.
858 @item (B)
859 If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent
860 to @code{ALL(MASK)}.  If the rank is greater than one, then @code{ALL(MASK,DIM)}
861 is determined by applying @code{ALL} to the array sections.
862 @end table
864 @item @emph{Example}:
865 @smallexample
866 program test_all
867   logical l
868   l = all((/.true., .true., .true./))
869   print *, l
870   call section
871   contains
872     subroutine section
873       integer a(2,3), b(2,3)
874       a = 1
875       b = 1
876       b(2,2) = 2
877       print *, all(a .eq. b, 1)
878       print *, all(a .eq. b, 2)
879     end subroutine section
880 end program test_all
881 @end smallexample
882 @end table
886 @node ALLOCATED
887 @section @code{ALLOCATED} --- Status of an allocatable entity
888 @findex @code{ALLOCATED} intrinsic
889 @cindex allocation status
891 @table @asis
892 @item @emph{Description}:
893 @code{ALLOCATED(X)} checks the status of whether @var{X} is allocated.
895 @item @emph{Standard}:
896 F95 and later
898 @item @emph{Class}:
899 Inquiry function
901 @item @emph{Syntax}:
902 @code{L = ALLOCATED(X)}
904 @item @emph{Arguments}:
905 @multitable @columnfractions .15 .80
906 @item @var{X}    @tab The argument shall be an @code{ALLOCATABLE} array.
907 @end multitable
909 @item @emph{Return value}:
910 The return value is a scalar @code{LOGICAL} with the default logical
911 kind type parameter.  If @var{X} is allocated, @code{ALLOCATED(X)}
912 is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.} 
914 @item @emph{Example}:
915 @smallexample
916 program test_allocated
917   integer :: i = 4
918   real(4), allocatable :: x(:)
919   if (allocated(x) .eqv. .false.) allocate(x(i))
920 end program test_allocated
921 @end smallexample
922 @end table
925 @node AND
926 @section @code{AND} --- Bitwise logical AND
927 @findex @code{AND} intrinsic
928 @cindex bit operations
930 @table @asis
931 @item @emph{Description}:
932 Bitwise logical @code{AND}.
934 This intrinsic routine is provided for backwards compatibility with 
935 GNU Fortran 77.  For integer arguments, programmers should consider
936 the use of the @ref{IAND} intrinsic defined by the Fortran standard.
938 @item @emph{Standard}:
939 GNU extension
941 @item @emph{Class}:
942 Non-elemental function
944 @item @emph{Syntax}:
945 @code{RESULT = AND(X, Y)}
947 @item @emph{Arguments}:
948 @multitable @columnfractions .15 .80
949 @item @var{X} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
950 @item @var{Y} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
951 @end multitable
953 @item @emph{Return value}:
954 The return type is either @code{INTEGER(*)} or @code{LOGICAL} after
955 cross-promotion of the arguments. 
957 @item @emph{Example}:
958 @smallexample
959 PROGRAM test_and
960   LOGICAL :: T = .TRUE., F = ..FALSE.
961   INTEGER :: a, b
962   DATA a / Z'F' /, b / Z'3' /
964   WRITE (*,*) AND(T, T), AND(T, F), AND(F, T), AND(F, F)
965   WRITE (*,*) AND(a, b)
966 END PROGRAM
967 @end smallexample
969 @item @emph{See also}:
970 F95 elemental function: @ref{IAND}
971 @end table
975 @node ANINT
976 @section @code{ANINT} --- Nearest whole number
977 @findex @code{ANINT} intrinsic
978 @findex @code{DNINT} intrinsic
979 @cindex whole number
981 @table @asis
982 @item @emph{Description}:
983 @code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.
985 @item @emph{Standard}:
986 F77 and later
988 @item @emph{Class}:
989 Elemental function
991 @item @emph{Syntax}:
992 @code{X = ANINT(X)}
993 @code{X = ANINT(X, KIND)}
995 @item @emph{Arguments}:
996 @multitable @columnfractions .15 .80
997 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
998 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
999 initialization expression.
1000 @end multitable
1002 @item @emph{Return value}:
1003 The return value is of type real with the kind type parameter of the
1004 argument if the optional @var{KIND} is absent; otherwise, the kind
1005 type parameter will be given by @var{KIND}.  If @var{X} is greater than
1006 zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}.  If @var{X} is
1007 less than or equal to zero, then it returns @code{AINT(X-0.5)}.
1009 @item @emph{Example}:
1010 @smallexample
1011 program test_anint
1012   real(4) x4
1013   real(8) x8
1014   x4 = 1.234E0_4
1015   x8 = 4.321_8
1016   print *, anint(x4), dnint(x8)
1017   x8 = anint(x4,8)
1018 end program test_anint
1019 @end smallexample
1021 @item @emph{Specific names}:
1022 @multitable @columnfractions .20 .20 .20 .40
1023 @item Name            @tab Argument         @tab Return type      @tab Standard
1024 @item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab F77 and later
1025 @end multitable
1026 @end table
1030 @node ANY
1031 @section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true 
1032 @findex @code{ANY} intrinsic
1033 @cindex true values
1035 @table @asis
1036 @item @emph{Description}:
1037 @code{ANY(MASK [, DIM])} determines if any of the values in the logical array
1038 @var{MASK} along dimension @var{DIM} are @code{.TRUE.}.
1040 @item @emph{Standard}:
1041 F95 and later
1043 @item @emph{Class}:
1044 transformational function
1046 @item @emph{Syntax}:
1047 @code{L = ANY(MASK)} 
1048 @code{L = ANY(MASK, DIM)}
1050 @item @emph{Arguments}:
1051 @multitable @columnfractions .15 .80
1052 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
1053 it shall not be scalar.
1054 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
1055 with a value that lies between one and the rank of @var{MASK}.
1056 @end multitable
1058 @item @emph{Return value}:
1059 @code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
1060 the kind type parameter is the same as the kind type parameter of
1061 @var{MASK}.  If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns
1062 an array with the rank of @var{MASK} minus 1.  The shape is determined from
1063 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
1065 @table @asis
1066 @item (A)
1067 @code{ANY(MASK)} is true if any element of @var{MASK} is true;
1068 otherwise, it is false.  It also is false if @var{MASK} has zero size.
1069 @item (B)
1070 If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent
1071 to @code{ANY(MASK)}.  If the rank is greater than one, then @code{ANY(MASK,DIM)}
1072 is determined by applying @code{ANY} to the array sections.
1073 @end table
1075 @item @emph{Example}:
1076 @smallexample
1077 program test_any
1078   logical l
1079   l = any((/.true., .true., .true./))
1080   print *, l
1081   call section
1082   contains
1083     subroutine section
1084       integer a(2,3), b(2,3)
1085       a = 1
1086       b = 1
1087       b(2,2) = 2
1088       print *, any(a .eq. b, 1)
1089       print *, any(a .eq. b, 2)
1090     end subroutine section
1091 end program test_any
1092 @end smallexample
1093 @end table
1097 @node ASIN
1098 @section @code{ASIN} --- Arcsine function 
1099 @findex @code{ASIN} intrinsic
1100 @findex @code{DASIN} intrinsic
1101 @cindex trigonometric functions (inverse)
1103 @table @asis
1104 @item @emph{Description}:
1105 @code{ASIN(X)} computes the arcsine of its @var{X} (inverse of @code{SIN(X)}).
1107 @item @emph{Standard}:
1108 F77 and later
1110 @item @emph{Class}:
1111 Elemental function
1113 @item @emph{Syntax}:
1114 @code{X = ASIN(X)}
1116 @item @emph{Arguments}:
1117 @multitable @columnfractions .15 .80
1118 @item @var{X} @tab The type shall be @code{REAL(*)}, and a magnitude that is
1119 less than one.
1120 @end multitable
1122 @item @emph{Return value}:
1123 The return value is of type @code{REAL(*)} and it lies in the
1124 range @math{-\pi / 2 \leq \asin (x) \leq \pi / 2}.  The kind type
1125 parameter is the same as @var{X}.
1127 @item @emph{Example}:
1128 @smallexample
1129 program test_asin
1130   real(8) :: x = 0.866_8
1131   x = asin(x)
1132 end program test_asin
1133 @end smallexample
1135 @item @emph{Specific names}:
1136 @multitable @columnfractions .20 .20 .20 .40
1137 @item Name            @tab Argument          @tab Return type       @tab Standard
1138 @item @code{DASIN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F77 and later
1139 @end multitable
1141 @item @emph{See also}:
1142 Inverse function: @ref{SIN}
1144 @end table
1147 @node ASINH
1148 @section @code{ASINH} --- Hyperbolic arcsine function
1149 @findex @code{ASINH} intrinsic
1150 @cindex hyperbolic arcsine
1151 @cindex hyperbolic sine (inverse)
1153 @table @asis
1154 @item @emph{Description}:
1155 @code{ASINH(X)} computes the area hyperbolic sine of @var{X} (inverse of @code{SINH(X)}).
1157 @item @emph{Standard}:
1158 GNU extension
1160 @item @emph{Class}:
1161 Elemental function
1163 @item @emph{Syntax}:
1164 @code{X = ASINH(X)}
1166 @item @emph{Arguments}:
1167 @multitable @columnfractions .15 .80
1168 @item @var{X} @tab The type shall be @code{REAL(*)}, with @var{X} a real number.
1169 @end multitable
1171 @item @emph{Return value}:
1172 The return value is of type @code{REAL(*)} and it lies in the
1173 range @math{-\infty \leq \asinh (x) \leq \infty}.
1175 @item @emph{Example}:
1176 @smallexample
1177 PROGRAM test_asinh
1178   REAL(8), DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
1179   WRITE (*,*) ASINH(x)
1180 END PROGRAM
1181 @end smallexample
1183 @item @emph{See also}:
1184 Inverse function: @ref{SINH}
1185 @end table
1189 @node ASSOCIATED
1190 @section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair 
1191 @findex @code{ASSOCIATED} intrinsic
1192 @cindex pointer status
1194 @table @asis
1195 @item @emph{Description}:
1196 @code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR}
1197 or if @var{PTR} is associated with the target @var{TGT}.
1199 @item @emph{Standard}:
1200 F95 and later
1202 @item @emph{Class}:
1203 Inquiry function
1205 @item @emph{Syntax}:
1206 @code{L = ASSOCIATED(PTR)} 
1207 @code{L = ASSOCIATED(PTR [, TGT])}
1209 @item @emph{Arguments}:
1210 @multitable @columnfractions .15 .80
1211 @item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute and
1212 it can be of any type.
1213 @item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} or
1214 a @code{TARGET}.  It must have the same type, kind type parameter, and
1215 array rank as @var{PTR}.
1216 @end multitable
1217 The status of neither @var{PTR} nor @var{TGT} can be undefined.
1219 @item @emph{Return value}:
1220 @code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}.
1221 There are several cases:
1222 @table @asis
1223 @item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)}
1224 is true if @var{PTR} is associated with a target; otherwise, it returns false.
1225 @item (B) If @var{TGT} is present and a scalar target, the result is true if
1226 @var{TGT}
1227 is not a 0 sized storage sequence and the target associated with @var{PTR}
1228 occupies the same storage units.  If @var{PTR} is disassociated, then the 
1229 result is false.
1230 @item (C) If @var{TGT} is present and an array target, the result is true if
1231 @var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, are
1232 arrays whose elements are not 0 sized storage sequences, and @var{TGT} and
1233 @var{PTR} occupy the same storage units in array element order.
1234 As in case(B), the result is false, if @var{PTR} is disassociated.
1235 @item (D) If @var{TGT} is present and an scalar pointer, the result is true if
1236 target associated with @var{PTR} and the target associated with @var{TGT}
1237 are not 0 sized storage sequences and occupy the same storage units.
1238 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
1239 @item (E) If @var{TGT} is present and an array pointer, the result is true if
1240 target associated with @var{PTR} and the target associated with @var{TGT}
1241 have the same shape, are not 0 sized arrays, are arrays whose elements are
1242 not 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the same
1243 storage units in array element order.
1244 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
1245 @end table
1247 @item @emph{Example}:
1248 @smallexample
1249 program test_associated
1250    implicit none
1251    real, target  :: tgt(2) = (/1., 2./)
1252    real, pointer :: ptr(:)
1253    ptr => tgt
1254    if (associated(ptr)     .eqv. .false.) call abort
1255    if (associated(ptr,tgt) .eqv. .false.) call abort
1256 end program test_associated
1257 @end smallexample
1259 @item @emph{See also}:
1260 @ref{NULL}
1261 @end table
1265 @node ATAN
1266 @section @code{ATAN} --- Arctangent function 
1267 @findex @code{ATAN} intrinsic
1268 @findex @code{DATAN} intrinsic
1269 @cindex trigonometric functions (inverse)
1271 @table @asis
1272 @item @emph{Description}:
1273 @code{ATAN(X)} computes the arctangent of @var{X}.
1275 @item @emph{Standard}:
1276 F77 and later
1278 @item @emph{Class}:
1279 Elemental function
1281 @item @emph{Syntax}:
1282 @code{X = ATAN(X)}
1284 @item @emph{Arguments}:
1285 @multitable @columnfractions .15 .80
1286 @item @var{X} @tab The type shall be @code{REAL(*)}.
1287 @end multitable
1289 @item @emph{Return value}:
1290 The return value is of type @code{REAL(*)} and it lies in the
1291 range @math{ - \pi / 2 \leq \atan (x) \leq \pi / 2}.
1293 @item @emph{Example}:
1294 @smallexample
1295 program test_atan
1296   real(8) :: x = 2.866_8
1297   x = atan(x)
1298 end program test_atan
1299 @end smallexample
1301 @item @emph{Specific names}:
1302 @multitable @columnfractions .20 .20 .20 .40
1303 @item Name            @tab Argument          @tab Return type       @tab Standard
1304 @item @code{DATAN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F77 and later
1305 @end multitable
1307 @item @emph{See also}:
1308 Inverse function: @ref{TAN}
1310 @end table
1314 @node ATAN2
1315 @section @code{ATAN2} --- Arctangent function 
1316 @findex @code{ATAN2} intrinsic
1317 @findex @code{DATAN2} intrinsic
1318 @cindex trigonometric functions (inverse)
1320 @table @asis
1321 @item @emph{Description}:
1322 @code{ATAN2(Y,X)} computes the arctangent of the complex number @math{X + i Y}.
1324 @item @emph{Standard}:
1325 F77 and later
1327 @item @emph{Class}:
1328 Elemental function
1330 @item @emph{Syntax}:
1331 @code{X = ATAN2(Y,X)}
1333 @item @emph{Arguments}:
1334 @multitable @columnfractions .15 .80
1335 @item @var{Y} @tab The type shall be @code{REAL(*)}.
1336 @item @var{X} @tab The type and kind type parameter shall be the same as @var{Y}.
1337 If @var{Y} is zero, then @var{X} must be nonzero.
1338 @end multitable
1340 @item @emph{Return value}:
1341 The return value has the same type and kind type parameter as @var{Y}.
1342 It is the principal value of the complex number @math{X + i Y}.  If
1343 @var{X} is nonzero, then it lies in the range @math{-\pi \le \atan (x) \leq \pi}.
1344 The sign is positive if @var{Y} is positive.  If @var{Y} is zero, then
1345 the return value is zero if @var{X} is positive and @math{\pi} if @var{X}
1346 is negative.  Finally, if @var{X} is zero, then the magnitude of the result
1347 is @math{\pi/2}.
1349 @item @emph{Example}:
1350 @smallexample
1351 program test_atan2
1352   real(4) :: x = 1.e0_4, y = 0.5e0_4
1353   x = atan2(y,x)
1354 end program test_atan2
1355 @end smallexample
1357 @item @emph{Specific names}:
1358 @multitable @columnfractions .20 .20 .20 .40
1359 @item Name            @tab Argument          @tab Return type    @tab Standard
1360 @item @code{DATAN2(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
1361 @end multitable
1362 @end table
1366 @node ATANH
1367 @section @code{ATANH} --- Hyperbolic arctangent function
1368 @findex @code{ASINH} intrinsic
1369 @cindex hyperbolic arctangent
1370 @cindex hyperbolic tangent (inverse)
1372 @table @asis
1373 @item @emph{Description}:
1374 @code{ATANH(X)} computes the area hyperbolic sine of @var{X} (inverse of @code{TANH(X)}).
1376 @item @emph{Standard}:
1377 GNU extension
1379 @item @emph{Class}:
1380 Elemental function
1382 @item @emph{Syntax}:
1383 @code{X = ATANH(X)}
1385 @item @emph{Arguments}:
1386 @multitable @columnfractions .15 .80
1387 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is less than or equal to one.
1388 @end multitable
1390 @item @emph{Return value}:
1391 The return value is of type @code{REAL(*)} and it lies in the
1392 range @math{-\infty \leq \atanh(x) \leq \infty}.
1394 @item @emph{Example}:
1395 @smallexample
1396 PROGRAM test_atanh
1397   REAL, DIMENSION(3) :: x = (/ -1.0, 0.0, 1.0 /)
1398   WRITE (*,*) ATANH(x)
1399 END PROGRAM
1400 @end smallexample
1402 @item @emph{See also}:
1403 Inverse function: @ref{TANH}
1404 @end table
1409 @node BESJ0
1410 @section @code{BESJ0} --- Bessel function of the first kind of order 0
1411 @findex @code{BESJ0} intrinsic
1412 @findex @code{DBESJ0} intrinsic
1413 @cindex Bessel
1415 @table @asis
1416 @item @emph{Description}:
1417 @code{BESJ0(X)} computes the Bessel function of the first kind of order 0
1418 of @var{X}.
1420 @item @emph{Standard}:
1421 GNU extension
1423 @item @emph{Class}:
1424 Elemental function
1426 @item @emph{Syntax}:
1427 @code{X = BESJ0(X)}
1429 @item @emph{Arguments}:
1430 @multitable @columnfractions .15 .80
1431 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1432 @end multitable
1434 @item @emph{Return value}:
1435 The return value is of type @code{REAL(*)} and it lies in the
1436 range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
1438 @item @emph{Example}:
1439 @smallexample
1440 program test_besj0
1441   real(8) :: x = 0.0_8
1442   x = besj0(x)
1443 end program test_besj0
1444 @end smallexample
1446 @item @emph{Specific names}:
1447 @multitable @columnfractions .20 .20 .20 .40
1448 @item Name            @tab Argument          @tab Return type       @tab Standard
1449 @item @code{DBESJ0(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}   @tab GNU extension
1450 @end multitable
1451 @end table
1455 @node BESJ1
1456 @section @code{BESJ1} --- Bessel function of the first kind of order 1
1457 @findex @code{BESJ1} intrinsic
1458 @findex @code{DBESJ1} intrinsic
1459 @cindex Bessel
1461 @table @asis
1462 @item @emph{Description}:
1463 @code{BESJ1(X)} computes the Bessel function of the first kind of order 1
1464 of @var{X}.
1466 @item @emph{Standard}:
1467 GNU extension
1469 @item @emph{Class}:
1470 Elemental function
1472 @item @emph{Syntax}:
1473 @code{X = BESJ1(X)}
1475 @item @emph{Arguments}:
1476 @multitable @columnfractions .15 .80
1477 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1478 @end multitable
1480 @item @emph{Return value}:
1481 The return value is of type @code{REAL(*)} and it lies in the
1482 range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
1484 @item @emph{Example}:
1485 @smallexample
1486 program test_besj1
1487   real(8) :: x = 1.0_8
1488   x = besj1(x)
1489 end program test_besj1
1490 @end smallexample
1492 @item @emph{Specific names}:
1493 @multitable @columnfractions .20 .20 .20 .40
1494 @item Name            @tab Argument          @tab Return type       @tab Standard
1495 @item @code{DBESJ1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
1496 @end multitable
1497 @end table
1501 @node BESJN
1502 @section @code{BESJN} --- Bessel function of the first kind
1503 @findex @code{BESJN} intrinsic
1504 @findex @code{DBESJN} intrinsic
1505 @cindex Bessel
1507 @table @asis
1508 @item @emph{Description}:
1509 @code{BESJN(N, X)} computes the Bessel function of the first kind of order
1510 @var{N} of @var{X}.
1512 @item @emph{Standard}:
1513 GNU extension
1515 @item @emph{Class}:
1516 Elemental function
1518 @item @emph{Syntax}:
1519 @code{Y = BESJN(N, X)}
1521 @item @emph{Arguments}:
1522 @multitable @columnfractions .15 .80
1523 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1524 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1525 @end multitable
1527 @item @emph{Return value}:
1528 The return value is a scalar of type @code{REAL(*)}.
1530 @item @emph{Example}:
1531 @smallexample
1532 program test_besjn
1533   real(8) :: x = 1.0_8
1534   x = besjn(5,x)
1535 end program test_besjn
1536 @end smallexample
1538 @item @emph{Specific names}:
1539 @multitable @columnfractions .20 .20 .20 .40
1540 @item Name             @tab Argument            @tab Return type       @tab Standard
1541 @item @code{DBESJN(X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}    @tab GNU extension
1542 @item                  @tab @code{REAL(8) X}    @tab                   @tab
1543 @end multitable
1544 @end table
1548 @node BESY0
1549 @section @code{BESY0} --- Bessel function of the second kind of order 0
1550 @findex @code{BESY0} intrinsic
1551 @findex @code{DBESY0} intrinsic
1552 @cindex Bessel
1554 @table @asis
1555 @item @emph{Description}:
1556 @code{BESY0(X)} computes the Bessel function of the second kind of order 0
1557 of @var{X}.
1559 @item @emph{Standard}:
1560 GNU extension
1562 @item @emph{Class}:
1563 Elemental function
1565 @item @emph{Syntax}:
1566 @code{X = BESY0(X)}
1568 @item @emph{Arguments}:
1569 @multitable @columnfractions .15 .80
1570 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1571 @end multitable
1573 @item @emph{Return value}:
1574 The return value is a scalar of type @code{REAL(*)}.
1576 @item @emph{Example}:
1577 @smallexample
1578 program test_besy0
1579   real(8) :: x = 0.0_8
1580   x = besy0(x)
1581 end program test_besy0
1582 @end smallexample
1584 @item @emph{Specific names}:
1585 @multitable @columnfractions .20 .20 .20 .40
1586 @item Name            @tab Argument          @tab Return type       @tab Standard
1587 @item @code{DBESY0(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
1588 @end multitable
1589 @end table
1593 @node BESY1
1594 @section @code{BESY1} --- Bessel function of the second kind of order 1
1595 @findex @code{BESY1} intrinsic
1596 @findex @code{DBESY1} intrinsic
1597 @cindex Bessel
1599 @table @asis
1600 @item @emph{Description}:
1601 @code{BESY1(X)} computes the Bessel function of the second kind of order 1
1602 of @var{X}.
1604 @item @emph{Standard}:
1605 GNU extension
1607 @item @emph{Class}:
1608 Elemental function
1610 @item @emph{Syntax}:
1611 @code{X = BESY1(X)}
1613 @item @emph{Arguments}:
1614 @multitable @columnfractions .15 .80
1615 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1616 @end multitable
1618 @item @emph{Return value}:
1619 The return value is a scalar of type @code{REAL(*)}.
1621 @item @emph{Example}:
1622 @smallexample
1623 program test_besy1
1624   real(8) :: x = 1.0_8
1625   x = besy1(x)
1626 end program test_besy1
1627 @end smallexample
1629 @item @emph{Specific names}:
1630 @multitable @columnfractions .20 .20 .20 .40
1631 @item Name            @tab Argument          @tab Return type       @tab Standard
1632 @item @code{DBESY1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
1633 @end multitable
1634 @end table
1638 @node BESYN
1639 @section @code{BESYN} --- Bessel function of the second kind
1640 @findex @code{BESYN} intrinsic
1641 @findex @code{DBESYN} intrinsic
1642 @cindex Bessel
1644 @table @asis
1645 @item @emph{Description}:
1646 @code{BESYN(N, X)} computes the Bessel function of the second kind of order
1647 @var{N} of @var{X}.
1649 @item @emph{Standard}:
1650 GNU extension
1652 @item @emph{Class}:
1653 Elemental function
1655 @item @emph{Syntax}:
1656 @code{Y = BESYN(N, X)}
1658 @item @emph{Arguments}:
1659 @multitable @columnfractions .15 .80
1660 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1661 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1662 @end multitable
1664 @item @emph{Return value}:
1665 The return value is a scalar of type @code{REAL(*)}.
1667 @item @emph{Example}:
1668 @smallexample
1669 program test_besyn
1670   real(8) :: x = 1.0_8
1671   x = besyn(5,x)
1672 end program test_besyn
1673 @end smallexample
1675 @item @emph{Specific names}:
1676 @multitable @columnfractions .20 .20 .20 .40
1677 @item Name               @tab Argument            @tab Return type     @tab Standard
1678 @item @code{DBESYN(N,X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}  @tab GNU extension
1679 @item                    @tab @code{REAL(8)    X} @tab                 @tab 
1680 @end multitable
1681 @end table
1685 @node BIT_SIZE
1686 @section @code{BIT_SIZE} --- Bit size inquiry function
1687 @findex @code{BIT_SIZE} intrinsic
1688 @cindex bit_size
1690 @table @asis
1691 @item @emph{Description}:
1692 @code{BIT_SIZE(I)} returns the number of bits (integer precision plus sign bit)
1693 represented by the type of @var{I}.
1695 @item @emph{Standard}:
1696 F95 and later
1698 @item @emph{Class}:
1699 Inquiry function
1701 @item @emph{Syntax}:
1702 @code{I = BIT_SIZE(I)}
1704 @item @emph{Arguments}:
1705 @multitable @columnfractions .15 .80
1706 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1707 @end multitable
1709 @item @emph{Return value}:
1710 The return value is of type @code{INTEGER(*)}
1712 @item @emph{Example}:
1713 @smallexample
1714 program test_bit_size
1715     integer :: i = 123
1716     integer :: size
1717     size = bit_size(i)
1718     print *, size
1719 end program test_bit_size
1720 @end smallexample
1721 @end table
1725 @node BTEST
1726 @section @code{BTEST} --- Bit test function
1727 @findex @code{BTEST} intrinsic
1728 @cindex bit operations
1730 @table @asis
1731 @item @emph{Description}:
1732 @code{BTEST(I,POS)} returns logical @code{.TRUE.} if the bit at @var{POS}
1733 in @var{I} is set.
1735 @item @emph{Standard}:
1736 F95 and later
1738 @item @emph{Class}:
1739 Elemental function
1741 @item @emph{Syntax}:
1742 @code{I = BTEST(I,POS)}
1744 @item @emph{Arguments}:
1745 @multitable @columnfractions .15 .80
1746 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1747 @item @var{POS} @tab The type shall be @code{INTEGER(*)}.
1748 @end multitable
1750 @item @emph{Return value}:
1751 The return value is of type @code{LOGICAL}
1753 @item @emph{Example}:
1754 @smallexample
1755 program test_btest
1756     integer :: i = 32768 + 1024 + 64
1757     integer :: pos
1758     logical :: bool
1759     do pos=0,16
1760         bool = btest(i, pos) 
1761         print *, pos, bool
1762     end do
1763 end program test_btest
1764 @end smallexample
1765 @end table
1769 @node CEILING
1770 @section @code{CEILING} --- Integer ceiling function
1771 @findex @code{CEILING} intrinsic
1772 @cindex CEILING
1774 @table @asis
1775 @item @emph{Description}:
1776 @code{CEILING(X)} returns the least integer greater than or equal to @var{X}.
1778 @item @emph{Standard}:
1779 F95 and later
1781 @item @emph{Class}:
1782 Elemental function
1784 @item @emph{Syntax}:
1785 @code{I = CEILING(X[,KIND])}
1787 @item @emph{Arguments}:
1788 @multitable @columnfractions .15 .80
1789 @item @var{X} @tab The type shall be @code{REAL(*)}.
1790 @item @var{KIND} @tab (Optional) scalar integer initialization expression.
1791 @end multitable
1793 @item @emph{Return value}:
1794 The return value is of type @code{INTEGER(KIND)}
1796 @item @emph{Example}:
1797 @smallexample
1798 program test_ceiling
1799     real :: x = 63.29
1800     real :: y = -63.59
1801     print *, ceiling(x) ! returns 64
1802     print *, ceiling(y) ! returns -63
1803 end program test_ceiling
1804 @end smallexample
1806 @item @emph{See also}:
1807 @ref{FLOOR}, @ref{NINT}
1809 @end table
1813 @node CHAR
1814 @section @code{CHAR} --- Character conversion function
1815 @findex @code{CHAR} intrinsic
1816 @cindex conversion function (character)
1818 @table @asis
1819 @item @emph{Description}:
1820 @code{CHAR(I,[KIND])} returns the character represented by the integer @var{I}.
1822 @item @emph{Standard}:
1823 F77 and later
1825 @item @emph{Class}:
1826 Elemental function
1828 @item @emph{Syntax}:
1829 @code{C = CHAR(I[,KIND])}
1831 @item @emph{Arguments}:
1832 @multitable @columnfractions .15 .80
1833 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1834 @item @var{KIND} @tab Optional scaler integer initialization expression.
1835 @end multitable
1837 @item @emph{Return value}:
1838 The return value is of type @code{CHARACTER(1)}
1840 @item @emph{Example}:
1841 @smallexample
1842 program test_char
1843     integer :: i = 74
1844     character(1) :: c
1845     c = char(i)
1846     print *, i, c ! returns 'J'
1847 end program test_char
1848 @end smallexample
1850 @item @emph{See also}:
1851 @ref{ACHAR}, @ref{ICHAR}, @ref{IACHAR}
1853 @end table
1856 @node CHDIR
1857 @section @code{CHDIR} --- Change working directory
1858 @findex @code{CHDIR} intrinsic
1859 @cindex file system functions
1861 @table @asis
1862 @item @emph{Description}:
1863 Change current working directory to a specified @var{PATH}.
1865 @item @emph{Standard}:
1866 GNU extension
1868 @item @emph{Class}:
1869 Non-elemental subroutine
1871 @item @emph{Syntax}:
1872 @code{CALL chdir(PATH[,STATUS])}
1874 @item @emph{Arguments}:
1875 @multitable @columnfractions .15 .80
1876 @item @var{PATH}   @tab The type shall be @code{CHARACTER(*)} and shall specify a valid path within the file system.
1877 @item @var{STATUS} @tab (Optional) status flag. Returns 0 on success, 
1878                         a system specific and non-zero error code otherwise.
1879 @end multitable
1881 @item @emph{Example}:
1882 @smallexample
1883 PROGRAM test_chdir
1884   CHARACTER(len=255) :: path
1885   CALL getcwd(path)
1886   WRITE(*,*) TRIM(path)
1887   CALL chdir("/tmp")
1888   CALL getcwd(path)
1889   WRITE(*,*) TRIM(path)
1890 END PROGRAM
1891 @end smallexample
1893 @item @emph{See also}:
1894 @ref{GETCWD}
1895 @end table
1899 @node CHMOD
1900 @section @code{CHMOD} --- Change access permissions of files
1901 @findex @code{CHMOD} 
1902 @cindex file system functions
1904 @table @asis
1905 @item @emph{Description}:
1906 @code{CHMOD} changes the permissions of a file. This function invokes
1907 @code{/bin/chmod} and might therefore not work on all platforms.
1909 This intrinsic is provided in both subroutine and function forms; however,
1910 only one form can be used in any given program unit.
1912 @item @emph{Standard}:
1913 GNU extension
1915 @item @emph{Class}:
1916 Subroutine, non-elemental function
1918 @item @emph{Syntax}:
1919 @multitable @columnfractions .80
1920 @item @code{CALL CHMOD(NAME, MODE[, STATUS])}
1921 @item @code{STATUS = CHMOD(NAME, MODE)}
1922 @end multitable
1924 @item @emph{Arguments}:
1925 @multitable @columnfractions .15 .80
1926 @item @var{NAME} @tab Scalar @code{CHARACTER} with the file name.
1927 Trailing blanks are ignored unless the character @code{achar(0)} is
1928 present, then all characters up to and excluding @code{achar(0)} are
1929 used as the file name.
1931 @item @var{MODE} @tab Scalar @code{CHARACTER} giving the file permission.
1932 @var{MODE} uses the same syntax as the @var{MODE} argument of
1933 @code{/bin/chmod}.
1935 @item @var{STATUS} @tab (optional) scalar @code{INTEGER}, which is
1936 @code{0} on success and non-zero otherwise.
1937 @end multitable
1939 @item @emph{Return value}:
1940 In either syntax, @var{STATUS} is set to @code{0} on success and non-zero
1941 otherwise.
1943 @item @emph{Example}:
1944 @code{CHMOD} as subroutine
1945 @smallexample
1946 program chmod_test
1947   implicit none
1948   integer :: status
1949   call chmod('test.dat','u+x',status)
1950   print *, 'Status: ', status
1951 end program chmod_test
1952 @end smallexample
1953 @code{CHMOD} as non-elemental function:
1954 @smallexample
1955 program chmod_test
1956   implicit none
1957   integer :: status
1958   status = chmod('test.dat','u+x')
1959   print *, 'Status: ', status
1960 end program chmod_test
1961 @end smallexample
1962 @item @emph{Specific names}:
1963 @item @emph{See also}:
1965 @end table
1968 @node CMPLX
1969 @section @code{CMPLX} --- Complex conversion function
1970 @findex @code{CMPLX} intrinsic
1971 @cindex CMPLX
1973 @table @asis
1974 @item @emph{Description}:
1975 @code{CMPLX(X[,Y[,KIND]])} returns a complex number where @var{X} is converted to
1976 the real component.  If @var{Y} is present it is converted to the imaginary
1977 component.  If @var{Y} is not present then the imaginary component is set to
1978 0.0.  If @var{X} is complex then @var{Y} must not be present.
1980 @item @emph{Standard}:
1981 F77 and later
1983 @item @emph{Class}:
1984 Elemental function
1986 @item @emph{Syntax}:
1987 @code{C = CMPLX(X[,Y[,KIND]])}
1989 @item @emph{Arguments}:
1990 @multitable @columnfractions .15 .80
1991 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1992 @item @var{Y} @tab Optional, allowed if @var{X} is not @code{COMPLEX(*)}.  May be @code{INTEGER(*)} or @code{REAL(*)}. 
1993 @item @var{KIND} @tab Optional scaler integer initialization expression.
1994 @end multitable
1996 @item @emph{Return value}:
1997 The return value is of type @code{COMPLEX(*)}
1999 @item @emph{Example}:
2000 @smallexample
2001 program test_cmplx
2002     integer :: i = 42
2003     real :: x = 3.14
2004     complex :: z
2005     z = cmplx(i, x)
2006     print *, z, cmplx(x)
2007 end program test_cmplx
2008 @end smallexample
2009 @end table
2013 @node COMMAND_ARGUMENT_COUNT
2014 @section @code{COMMAND_ARGUMENT_COUNT} --- Get number of command line arguments
2015 @findex @code{COMMAND_ARGUMENT_COUNT} intrinsic
2016 @cindex command line arguments
2017 @cindex getopt
2019 @table @asis
2020 @item @emph{Description}:
2021 @code{COMMAND_ARGUMENT_COUNT()} returns the number of arguments passed on the
2022 command line when the containing program was invoked.
2024 @item @emph{Standard}:
2025 F2003
2027 @item @emph{Class}:
2028 Inquiry function
2030 @item @emph{Syntax}:
2031 @code{I = COMMAND_ARGUMENT_COUNT()}
2033 @item @emph{Arguments}:
2034 @multitable @columnfractions .15 .80
2035 @item None
2036 @end multitable
2038 @item @emph{Return value}:
2039 The return value is of type @code{INTEGER(4)}
2041 @item @emph{Example}:
2042 @smallexample
2043 program test_command_argument_count
2044     integer :: count
2045     count = command_argument_count()
2046     print *, count
2047 end program test_command_argument_count
2048 @end smallexample
2050 @item @emph{See also}:
2051 @ref{GET_COMMAND}, @ref{GET_COMMAND_ARGUMENT}
2052 @end table
2054 @node CONJG
2055 @section @code{CONJG} --- Complex conjugate function 
2056 @findex @code{CONJG} intrinsic
2057 @findex @code{DCONJG} intrinsic
2058 @cindex complex conjugate
2059 @table @asis
2060 @item @emph{Description}:
2061 @code{CONJG(Z)} returns the conjugate of @var{Z}.  If @var{Z} is @code{(x, y)}
2062 then the result is @code{(x, -y)}
2064 @item @emph{Standard}:
2065 F77 and later, has overloads that are GNU extensions
2067 @item @emph{Class}:
2068 Elemental function
2070 @item @emph{Syntax}:
2071 @code{Z = CONJG(Z)}
2073 @item @emph{Arguments}:
2074 @multitable @columnfractions .15 .80
2075 @item @var{Z} @tab The type shall be @code{COMPLEX(*)}.
2076 @end multitable
2078 @item @emph{Return value}:
2079 The return value is of type @code{COMPLEX(*)}.
2081 @item @emph{Example}:
2082 @smallexample
2083 program test_conjg
2084     complex :: z = (2.0, 3.0)
2085     complex(8) :: dz = (2.71_8, -3.14_8)
2086     z= conjg(z)
2087     print *, z
2088     dz = dconjg(dz)
2089     print *, dz
2090 end program test_conjg
2091 @end smallexample
2093 @item @emph{Specific names}:
2094 @multitable @columnfractions .20 .20 .20 .40
2095 @item Name             @tab Argument             @tab Return type          @tab Standard
2096 @item @code{DCONJG(Z)} @tab @code{COMPLEX(8) Z}  @tab @code{COMPLEX(8)}    @tab GNU extension
2097 @end multitable
2098 @end table
2102 @node COS
2103 @section @code{COS} --- Cosine function 
2104 @findex @code{COS} intrinsic
2105 @findex @code{DCOS} intrinsic
2106 @findex @code{ZCOS} intrinsic
2107 @findex @code{CDCOS} intrinsic
2108 @cindex trigonometric functions
2110 @table @asis
2111 @item @emph{Description}:
2112 @code{COS(X)} computes the cosine of @var{X}.
2114 @item @emph{Standard}:
2115 F77 and later, has overloads that are GNU extensions
2117 @item @emph{Class}:
2118 Elemental function
2120 @item @emph{Syntax}:
2121 @code{X = COS(X)}
2123 @item @emph{Arguments}:
2124 @multitable @columnfractions .15 .80
2125 @item @var{X} @tab The type shall be @code{REAL(*)} or
2126 @code{COMPLEX(*)}.
2127 @end multitable
2129 @item @emph{Return value}:
2130 The return value is of type @code{REAL(*)} and it lies in the
2131 range @math{ -1 \leq \cos (x) \leq 1}.  The kind type
2132 parameter is the same as @var{X}.
2134 @item @emph{Example}:
2135 @smallexample
2136 program test_cos
2137   real :: x = 0.0
2138   x = cos(x)
2139 end program test_cos
2140 @end smallexample
2142 @item @emph{Specific names}:
2143 @multitable @columnfractions .20 .20 .20 .40
2144 @item Name            @tab Argument            @tab Return type       @tab Standard
2145 @item @code{DCOS(X)}  @tab @code{REAL(8) X}    @tab @code{REAL(8)}    @tab F77 and later
2146 @item @code{CCOS(X)}  @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab F77 and later
2147 @item @code{ZCOS(X)}  @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
2148 @item @code{CDCOS(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
2149 @end multitable
2151 @item @emph{See also}:
2152 Inverse function: @ref{ACOS}
2154 @end table
2158 @node COSH
2159 @section @code{COSH} --- Hyperbolic cosine function 
2160 @findex @code{COSH} intrinsic
2161 @findex @code{DCOSH} intrinsic
2162 @cindex hyperbolic cosine
2164 @table @asis
2165 @item @emph{Description}:
2166 @code{COSH(X)} computes the hyperbolic cosine of @var{X}.
2168 @item @emph{Standard}:
2169 F77 and later
2171 @item @emph{Class}:
2172 Elemental function
2174 @item @emph{Syntax}:
2175 @code{X = COSH(X)}
2177 @item @emph{Arguments}:
2178 @multitable @columnfractions .15 .80
2179 @item @var{X} @tab The type shall be @code{REAL(*)}.
2180 @end multitable
2182 @item @emph{Return value}:
2183 The return value is of type @code{REAL(*)} and it is positive
2184 (@math{ \cosh (x) \geq 0 }.
2186 @item @emph{Example}:
2187 @smallexample
2188 program test_cosh
2189   real(8) :: x = 1.0_8
2190   x = cosh(x)
2191 end program test_cosh
2192 @end smallexample
2194 @item @emph{Specific names}:
2195 @multitable @columnfractions .20 .20 .20 .40
2196 @item Name            @tab Argument          @tab Return type       @tab Standard
2197 @item @code{DCOSH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F77 and later
2198 @end multitable
2200 @item @emph{See also}:
2201 Inverse function: @ref{ACOSH}
2203 @end table
2207 @node COUNT
2208 @section @code{COUNT} --- Count function
2209 @findex @code{COUNT} intrinsic
2210 @cindex count
2212 @table @asis
2213 @item @emph{Description}:
2214 @code{COUNT(MASK[,DIM])} counts the number of @code{.TRUE.} elements of
2215 @var{MASK} along the dimension of @var{DIM}.  If @var{DIM} is omitted it is
2216 taken to be @code{1}.  @var{DIM} is a scaler of type @code{INTEGER} in the
2217 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{MASK}.
2219 @item @emph{Standard}:
2220 F95 and later
2222 @item @emph{Class}:
2223 transformational function
2225 @item @emph{Syntax}:
2226 @code{I = COUNT(MASK[,DIM])}
2228 @item @emph{Arguments}:
2229 @multitable @columnfractions .15 .80
2230 @item @var{MASK} @tab The type shall be @code{LOGICAL}.
2231 @item @var{DIM}  @tab The type shall be @code{INTEGER}.
2232 @end multitable
2234 @item @emph{Return value}:
2235 The return value is of type @code{INTEGER} with rank equal to that of
2236 @var{MASK}.
2238 @item @emph{Example}:
2239 @smallexample
2240 program test_count
2241     integer, dimension(2,3) :: a, b
2242     logical, dimension(2,3) :: mask
2243     a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
2244     b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
2245     print '(3i3)', a(1,:)
2246     print '(3i3)', a(2,:)
2247     print *
2248     print '(3i3)', b(1,:)
2249     print '(3i3)', b(2,:)
2250     print *
2251     mask = a.ne.b
2252     print '(3l3)', mask(1,:)
2253     print '(3l3)', mask(2,:)
2254     print *
2255     print '(3i3)', count(mask)
2256     print *
2257     print '(3i3)', count(mask, 1)
2258     print *
2259     print '(3i3)', count(mask, 2)
2260 end program test_count
2261 @end smallexample
2262 @end table
2266 @node CPU_TIME
2267 @section @code{CPU_TIME} --- CPU elapsed time in seconds
2268 @findex @code{CPU_TIME} intrinsic
2269 @cindex CPU_TIME
2271 @table @asis
2272 @item @emph{Description}:
2273 Returns a @code{REAL} value representing the elapsed CPU time in seconds.  This
2274 is useful for testing segments of code to determine execution time.
2276 @item @emph{Standard}:
2277 F95 and later
2279 @item @emph{Class}:
2280 Subroutine
2282 @item @emph{Syntax}:
2283 @code{CPU_TIME(X)}
2285 @item @emph{Arguments}:
2286 @multitable @columnfractions .15 .80
2287 @item @var{X} @tab The type shall be @code{REAL} with @code{INTENT(OUT)}.
2288 @end multitable
2290 @item @emph{Return value}:
2291 None
2293 @item @emph{Example}:
2294 @smallexample
2295 program test_cpu_time
2296     real :: start, finish
2297     call cpu_time(start)
2298         ! put code to test here
2299     call cpu_time(finish)
2300     print '("Time = ",f6.3," seconds.")',finish-start
2301 end program test_cpu_time
2302 @end smallexample
2303 @end table
2307 @node CSHIFT
2308 @section @code{CSHIFT} --- Circular shift function
2309 @findex @code{CSHIFT} intrinsic
2310 @cindex bit manipulation
2312 @table @asis
2313 @item @emph{Description}:
2314 @code{CSHIFT(ARRAY, SHIFT[,DIM])} performs a circular shift on elements of
2315 @var{ARRAY} along the dimension of @var{DIM}.  If @var{DIM} is omitted it is
2316 taken to be @code{1}.  @var{DIM} is a scaler of type @code{INTEGER} in the
2317 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{ARRAY}.
2318 If the rank of @var{ARRAY} is one, then all elements of @var{ARRAY} are shifted
2319 by @var{SHIFT} places.  If rank is greater than one, then all complete rank one
2320 sections of @var{ARRAY} along the given dimension are shifted.  Elements
2321 shifted out one end of each rank one section are shifted back in the other end.
2323 @item @emph{Standard}:
2324 F95 and later
2326 @item @emph{Class}:
2327 transformational function
2329 @item @emph{Syntax}:
2330 @code{A = CSHIFT(A, SHIFT[,DIM])}
2332 @item @emph{Arguments}:
2333 @multitable @columnfractions .15 .80
2334 @item @var{ARRAY}  @tab May be any type, not scaler.
2335 @item @var{SHIFT}  @tab The type shall be @code{INTEGER}.
2336 @item @var{DIM}    @tab The type shall be @code{INTEGER}.
2337 @end multitable
2339 @item @emph{Return value}:
2340 Returns an array of same type and rank as the @var{ARRAY} argument.
2342 @item @emph{Example}:
2343 @smallexample
2344 program test_cshift
2345     integer, dimension(3,3) :: a
2346     a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2347     print '(3i3)', a(1,:)
2348     print '(3i3)', a(2,:)
2349     print '(3i3)', a(3,:)    
2350     a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
2351     print *
2352     print '(3i3)', a(1,:)
2353     print '(3i3)', a(2,:)
2354     print '(3i3)', a(3,:)
2355 end program test_cshift
2356 @end smallexample
2357 @end table
2360 @node CTIME
2361 @section @code{CTIME} --- Convert a time into a string
2362 @findex @code{CTIME} intrinsic
2363 @cindex ctime subroutine 
2365 @table @asis
2366 @item @emph{Description}:
2367 @code{CTIME(T,S)} converts @var{T}, a system time value, such as returned
2368 by @code{TIME8()}, to a string of the form @samp{Sat Aug 19 18:13:14
2369 1995}, and returns that string into @var{S}.
2371 If @code{CTIME} is invoked as a function, it can not be invoked as a
2372 subroutine, and vice versa.
2374 @var{T} is an @code{INTENT(IN)} @code{INTEGER(KIND=8)} variable.
2375 @var{S} is an @code{INTENT(OUT)} @code{CHARACTER} variable.
2377 @item @emph{Standard}:
2378 GNU extension
2380 @item @emph{Class}:
2381 Subroutine
2383 @item @emph{Syntax}:
2384 @multitable @columnfractions .80
2385 @item @code{CALL CTIME(T,S)}.
2386 @item @code{S = CTIME(T)}, (not recommended).
2387 @end multitable
2389 @item @emph{Arguments}:
2390 @multitable @columnfractions .15 .80
2391 @item @var{S}@tab The type shall be of type @code{CHARACTER}.
2392 @item @var{T}@tab The type shall be of type @code{INTEGER(KIND=8)}.
2393 @end multitable
2395 @item @emph{Return value}:
2396 The converted date and time as a string.
2398 @item @emph{Example}:
2399 @smallexample
2400 program test_ctime
2401     integer(8) :: i
2402     character(len=30) :: date
2403     i = time8()
2405     ! Do something, main part of the program
2406     
2407     call ctime(i,date)
2408     print *, 'Program was started on ', date
2409 end program test_ctime
2410 @end smallexample
2411 @end table
2413 @node DATE_AND_TIME
2414 @section @code{DATE_AND_TIME} --- Date and time subroutine
2415 @findex @code{DATE_AND_TIME} intrinsic
2416 @cindex DATE_AND_TIME
2418 @table @asis
2419 @item @emph{Description}:
2420 @code{DATE_AND_TIME(DATE, TIME, ZONE, VALUES)} gets the corresponding date and
2421 time information from the real-time system clock.  @var{DATE} is
2422 @code{INTENT(OUT)} and has form ccyymmdd.  @var{TIME} is @code{INTENT(OUT)} and
2423 has form hhmmss.sss.  @var{ZONE} is @code{INTENT(OUT)} and has form (+-)hhmm,
2424 representing the difference with respect to Coordinated Universal Time (UTC).
2425 Unavailable time and date parameters return blanks.
2427 @var{VALUES} is @code{INTENT(OUT)} and provides the following:
2429 @multitable @columnfractions .15 .30 .60
2430 @item @tab @code{VALUE(1)}: @tab The year
2431 @item @tab @code{VALUE(2)}: @tab The month
2432 @item @tab @code{VALUE(3)}: @tab The day of the month
2433 @item @tab @code{VALUE(4)}: @tab Time difference with UTC in minutes
2434 @item @tab @code{VALUE(5)}: @tab The hour of the day
2435 @item @tab @code{VALUE(6)}: @tab The minutes of the hour
2436 @item @tab @code{VALUE(7)}: @tab The seconds of the minute
2437 @item @tab @code{VALUE(8)}: @tab The milliseconds of the second
2438 @end multitable     
2440 @item @emph{Standard}:
2441 F95 and later
2443 @item @emph{Class}:
2444 Subroutine
2446 @item @emph{Syntax}:
2447 @code{CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])}
2449 @item @emph{Arguments}:
2450 @multitable @columnfractions .15 .80
2451 @item @var{DATE}  @tab (Optional) The type shall be @code{CHARACTER(8)} or larger.
2452 @item @var{TIME}  @tab (Optional) The type shall be @code{CHARACTER(10)} or larger.
2453 @item @var{ZONE}  @tab (Optional) The type shall be @code{CHARACTER(5)} or larger.
2454 @item @var{VALUES}@tab (Optional) The type shall be @code{INTEGER(8)}.
2455 @end multitable
2457 @item @emph{Return value}:
2458 None
2460 @item @emph{Example}:
2461 @smallexample
2462 program test_time_and_date
2463     character(8)  :: date
2464     character(10) :: time
2465     character(5)  :: zone
2466     integer,dimension(8) :: values
2467     ! using keyword arguments
2468     call date_and_time(date,time,zone,values)
2469     call date_and_time(DATE=date,ZONE=zone)
2470     call date_and_time(TIME=time)
2471     call date_and_time(VALUES=values)
2472     print '(a,2x,a,2x,a)', date, time, zone
2473     print '(8i5))', values
2474 end program test_time_and_date
2475 @end smallexample
2476 @end table
2480 @node DBLE
2481 @section @code{DBLE} --- Double conversion function 
2482 @findex @code{DBLE} intrinsic
2483 @cindex double conversion
2485 @table @asis
2486 @item @emph{Description}:
2487 @code{DBLE(X)} Converts @var{X} to double precision real type.
2489 @item @emph{Standard}:
2490 F77 and later
2492 @item @emph{Class}:
2493 Elemental function
2495 @item @emph{Syntax}:
2496 @code{X = DBLE(X)}
2498 @item @emph{Arguments}:
2499 @multitable @columnfractions .15 .80
2500 @item @var{X} @tab The type shall be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
2501 @end multitable
2503 @item @emph{Return value}:
2504 The return value is of type double precision real.
2506 @item @emph{Example}:
2507 @smallexample
2508 program test_dble
2509     real    :: x = 2.18
2510     integer :: i = 5
2511     complex :: z = (2.3,1.14)
2512     print *, dble(x), dble(i), dble(z)
2513 end program test_dble
2514 @end smallexample
2516 @item @emph{See also}:
2517 @ref{DFLOAT}, @ref{FLOAT}, @ref{REAL}
2518 @end table
2522 @node DCMPLX
2523 @section @code{DCMPLX} --- Double complex conversion function
2524 @findex @code{DCMPLX} intrinsic
2525 @cindex DCMPLX
2527 @table @asis
2528 @item @emph{Description}:
2529 @code{DCMPLX(X [,Y])} returns a double complex number where @var{X} is
2530 converted to the real component.  If @var{Y} is present it is converted to the
2531 imaginary component.  If @var{Y} is not present then the imaginary component is
2532 set to 0.0.  If @var{X} is complex then @var{Y} must not be present.
2534 @item @emph{Standard}:
2535 GNU extension
2537 @item @emph{Class}:
2538 Elemental function
2540 @item @emph{Syntax}:
2541 @code{C = DCMPLX(X)}
2542 @code{C = DCMPLX(X,Y)}
2544 @item @emph{Arguments}:
2545 @multitable @columnfractions .15 .80
2546 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
2547 @item @var{Y} @tab Optional if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}. 
2548 @end multitable
2550 @item @emph{Return value}:
2551 The return value is of type @code{COMPLEX(8)}
2553 @item @emph{Example}:
2554 @smallexample
2555 program test_dcmplx
2556     integer :: i = 42
2557     real :: x = 3.14
2558     complex :: z
2559     z = cmplx(i, x)
2560     print *, dcmplx(i)
2561     print *, dcmplx(x)
2562     print *, dcmplx(z)
2563     print *, dcmplx(x,i)
2564 end program test_dcmplx
2565 @end smallexample
2566 @end table
2570 @node DFLOAT
2571 @section @code{DFLOAT} --- Double conversion function 
2572 @findex @code{DFLOAT} intrinsic
2573 @cindex double float conversion
2575 @table @asis
2576 @item @emph{Description}:
2577 @code{DFLOAT(X)} Converts @var{X} to double precision real type.
2579 @item @emph{Standard}:
2580 GNU extension
2582 @item @emph{Class}:
2583 Elemental function
2585 @item @emph{Syntax}:
2586 @code{X = DFLOAT(X)}
2588 @item @emph{Arguments}:
2589 @multitable @columnfractions .15 .80
2590 @item @var{X} @tab The type shall be @code{INTEGER(*)}.
2591 @end multitable
2593 @item @emph{Return value}:
2594 The return value is of type double precision real.
2596 @item @emph{Example}:
2597 @smallexample
2598 program test_dfloat
2599     integer :: i = 5
2600     print *, dfloat(i)
2601 end program test_dfloat
2602 @end smallexample
2604 @item @emph{See also}:
2605 @ref{DBLE}, @ref{FLOAT}, @ref{REAL}
2606 @end table
2610 @node DIGITS
2611 @section @code{DIGITS} --- Significant digits function
2612 @findex @code{DIGITS} intrinsic
2613 @cindex digits, significant
2615 @table @asis
2616 @item @emph{Description}:
2617 @code{DIGITS(X)} returns the number of significant digits of the internal model
2618 representation of @var{X}.  For example, on a system using a 32-bit
2619 floating point representation, a default real number would likely return 24.
2621 @item @emph{Standard}:
2622 F95 and later
2624 @item @emph{Class}:
2625 Inquiry function
2627 @item @emph{Syntax}:
2628 @code{C = DIGITS(X)}
2630 @item @emph{Arguments}:
2631 @multitable @columnfractions .15 .80
2632 @item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
2633 @end multitable
2635 @item @emph{Return value}:
2636 The return value is of type @code{INTEGER}.
2638 @item @emph{Example}:
2639 @smallexample
2640 program test_digits
2641     integer :: i = 12345
2642     real :: x = 3.143
2643     real(8) :: y = 2.33
2644     print *, digits(i)
2645     print *, digits(x)
2646     print *, digits(y)
2647 end program test_digits
2648 @end smallexample
2649 @end table
2653 @node DIM
2654 @section @code{DIM} --- Dim function
2655 @findex @code{DIM} intrinsic
2656 @findex @code{IDIM} intrinsic
2657 @findex @code{DDIM} intrinsic
2658 @cindex dim
2660 @table @asis
2661 @item @emph{Description}:
2662 @code{DIM(X,Y)} returns the difference @code{X-Y} if the result is positive;
2663 otherwise returns zero.
2665 @item @emph{Standard}:
2666 F77 and later
2668 @item @emph{Class}:
2669 Elemental function
2671 @item @emph{Syntax}:
2672 @code{X = DIM(X,Y)}
2674 @item @emph{Arguments}:
2675 @multitable @columnfractions .15 .80
2676 @item @var{X} @tab The type shall be @code{INTEGER(*)} or @code{REAL(*)}
2677 @item @var{Y} @tab The type shall be the same type and kind as @var{X}.
2678 @end multitable
2680 @item @emph{Return value}:
2681 The return value is of type @code{INTEGER(*)} or @code{REAL(*)}.
2683 @item @emph{Example}:
2684 @smallexample
2685 program test_dim
2686     integer :: i
2687     real(8) :: x
2688     i = dim(4, 15)
2689     x = dim(4.345_8, 2.111_8)
2690     print *, i
2691     print *, x
2692 end program test_dim
2693 @end smallexample
2695 @item @emph{Specific names}:
2696 @multitable @columnfractions .20 .20 .20 .40
2697 @item Name             @tab Argument              @tab Return type       @tab Standard
2698 @item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X,Y} @tab @code{INTEGER(4)} @tab F77 and later
2699 @item @code{DDIM(X,Y)} @tab @code{REAL(8) X,Y}    @tab @code{REAL(8)}    @tab F77 and later
2700 @end multitable
2701 @end table
2705 @node DOT_PRODUCT
2706 @section @code{DOT_PRODUCT} --- Dot product function
2707 @findex @code{DOT_PRODUCT} intrinsic
2708 @cindex Dot product
2710 @table @asis
2711 @item @emph{Description}:
2712 @code{DOT_PRODUCT(X,Y)} computes the dot product multiplication of two vectors
2713 @var{X} and @var{Y}.  The two vectors may be either numeric or logical
2714 and must be arrays of rank one and of equal size. If the vectors are
2715 @code{INTEGER(*)} or @code{REAL(*)}, the result is @code{SUM(X*Y)}. If the
2716 vectors are @code{COMPLEX(*)}, the result is @code{SUM(CONJG(X)*Y)}. If the 
2717 vectors are @code{LOGICAL}, the result is @code{ANY(X.AND.Y)}.
2719 @item @emph{Standard}:
2720 F95 and later
2722 @item @emph{Class}:
2723 transformational function
2725 @item @emph{Syntax}:
2726 @code{S = DOT_PRODUCT(X,Y)}
2728 @item @emph{Arguments}:
2729 @multitable @columnfractions .15 .80
2730 @item @var{X} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2731 @item @var{Y} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2732 @end multitable
2734 @item @emph{Return value}:
2735 If the arguments are numeric, the return value is a scaler of numeric type,
2736 @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.  If the arguments are
2737 @code{LOGICAL}, the return value is @code{.TRUE.} or @code{.FALSE.}.
2739 @item @emph{Example}:
2740 @smallexample
2741 program test_dot_prod
2742     integer, dimension(3) :: a, b
2743     a = (/ 1, 2, 3 /)
2744     b = (/ 4, 5, 6 /)
2745     print '(3i3)', a
2746     print *
2747     print '(3i3)', b
2748     print *
2749     print *, dot_product(a,b)
2750 end program test_dot_prod
2751 @end smallexample
2752 @end table
2756 @node DPROD
2757 @section @code{DPROD} --- Double product function
2758 @findex @code{DPROD} intrinsic
2759 @cindex Double product
2761 @table @asis
2762 @item @emph{Description}:
2763 @code{DPROD(X,Y)} returns the product @code{X*Y}.
2765 @item @emph{Standard}:
2766 F77 and later
2768 @item @emph{Class}:
2769 Elemental function
2771 @item @emph{Syntax}:
2772 @code{D = DPROD(X,Y)}
2774 @item @emph{Arguments}:
2775 @multitable @columnfractions .15 .80
2776 @item @var{X} @tab The type shall be @code{REAL}.
2777 @item @var{Y} @tab The type shall be @code{REAL}.
2778 @end multitable
2780 @item @emph{Return value}:
2781 The return value is of type @code{REAL(8)}.
2783 @item @emph{Example}:
2784 @smallexample
2785 program test_dprod
2786     integer :: i
2787     real :: x = 5.2
2788     real :: y = 2.3
2789     real(8) :: d
2790     d = dprod(x,y)
2791     print *, d
2792 end program test_dprod
2793 @end smallexample
2794 @end table
2798 @node DREAL
2799 @section @code{DREAL} --- Double real part function
2800 @findex @code{DREAL} intrinsic
2801 @cindex Double real part
2803 @table @asis
2804 @item @emph{Description}:
2805 @code{DREAL(Z)} returns the real part of complex variable @var{Z}.
2807 @item @emph{Standard}:
2808 GNU extension
2810 @item @emph{Class}:
2811 Elemental function
2813 @item @emph{Syntax}:
2814 @code{D = DREAL(Z)}
2816 @item @emph{Arguments}:
2817 @multitable @columnfractions .15 .80
2818 @item @var{Z} @tab The type shall be @code{COMPLEX(8)}.
2819 @end multitable
2821 @item @emph{Return value}:
2822 The return value is of type @code{REAL(8)}.
2824 @item @emph{Example}:
2825 @smallexample
2826 program test_dreal
2827     complex(8) :: z = (1.3_8,7.2_8)
2828     print *, dreal(z)
2829 end program test_dreal
2830 @end smallexample
2832 @item @emph{See also}:
2833 @ref{AIMAG}
2835 @end table
2839 @node DTIME
2840 @section @code{DTIME} --- Execution time subroutine (or function)
2841 @findex @code{DTIME} intrinsic
2842 @cindex dtime subroutine 
2844 @table @asis
2845 @item @emph{Description}:
2846 @code{DTIME(TARRAY, RESULT)} initially returns the number of seconds of runtime
2847 since the start of the process's execution in @var{RESULT}.  @var{TARRAY}
2848 returns the user and system components of this time in @code{TARRAY(1)} and
2849 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) +
2850 TARRAY(2)}.
2852 Subsequent invocations of @code{DTIME} return values accumulated since the
2853 previous invocation.
2855 On some systems, the underlying timings are represented using types with
2856 sufficiently small limits that overflows (wrap around) are possible, such as
2857 32-bit types. Therefore, the values returned by this intrinsic might be, or
2858 become, negative, or numerically less than previous values, during a single
2859 run of the compiled program.
2861 If @code{DTIME} is invoked as a function, it can not be invoked as a
2862 subroutine, and vice versa.
2864 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2866 @multitable @columnfractions .15 .30 .60
2867 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2868 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2869 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2870 @end multitable
2872 @item @emph{Standard}:
2873 GNU extension
2875 @item @emph{Class}:
2876 Subroutine
2878 @item @emph{Syntax}:
2879 @multitable @columnfractions .80
2880 @item @code{CALL DTIME(TARRAY, RESULT)}.
2881 @item @code{RESULT = DTIME(TARRAY)}, (not recommended).
2882 @end multitable
2884 @item @emph{Arguments}:
2885 @multitable @columnfractions .15 .80
2886 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2887 @item @var{RESULT}@tab The type shall be @code{REAL}.
2888 @end multitable
2890 @item @emph{Return value}:
2891 Elapsed time in seconds since the start of program execution.
2893 @item @emph{Example}:
2894 @smallexample
2895 program test_dtime
2896     integer(8) :: i, j
2897     real, dimension(2) :: tarray
2898     real :: result
2899     call dtime(tarray, result)
2900     print *, result
2901     print *, tarray(1)
2902     print *, tarray(2)   
2903     do i=1,100000000    ! Just a delay
2904         j = i * i - i
2905     end do
2906     call dtime(tarray, result)
2907     print *, result
2908     print *, tarray(1)
2909     print *, tarray(2)
2910 end program test_dtime
2911 @end smallexample
2912 @end table
2916 @node EOSHIFT
2917 @section @code{EOSHIFT} --- End-off shift function
2918 @findex @code{EOSHIFT} intrinsic
2919 @cindex bit manipulation
2921 @table @asis
2922 @item @emph{Description}:
2923 @code{EOSHIFT(ARRAY, SHIFT[,BOUNDARY, DIM])} performs an end-off shift on
2924 elements of @var{ARRAY} along the dimension of @var{DIM}.  If @var{DIM} is
2925 omitted it is taken to be @code{1}.  @var{DIM} is a scaler of type
2926 @code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is the
2927 rank of @var{ARRAY}.  If the rank of @var{ARRAY} is one, then all elements of
2928 @var{ARRAY} are shifted by @var{SHIFT} places.  If rank is greater than one,
2929 then all complete rank one sections of @var{ARRAY} along the given dimension are
2930 shifted.  Elements shifted out one end of each rank one section are dropped.  If
2931 @var{BOUNDARY} is present then the corresponding value of from @var{BOUNDARY}
2932 is copied back in the other end.  If @var{BOUNDARY} is not present then the
2933 following are copied in depending on the type of @var{ARRAY}.
2935 @multitable @columnfractions .15 .80
2936 @item @emph{Array Type} @tab @emph{Boundary Value}
2937 @item Numeric  @tab 0 of the type and kind of @var{ARRAY}.
2938 @item Logical  @tab @code{.FALSE.}.
2939 @item Character(@var{len}) @tab @var{len} blanks.
2940 @end multitable
2942 @item @emph{Standard}:
2943 F95 and later
2945 @item @emph{Class}:
2946 transformational function
2948 @item @emph{Syntax}:
2949 @code{A = EOSHIFT(A, SHIFT[,BOUNDARY, DIM])}
2951 @item @emph{Arguments}:
2952 @multitable @columnfractions .15 .80
2953 @item @var{ARRAY}  @tab May be any type, not scaler.
2954 @item @var{SHIFT}  @tab The type shall be @code{INTEGER}.
2955 @item @var{BOUNDARY} @tab Same type as @var{ARRAY}. 
2956 @item @var{DIM}    @tab The type shall be @code{INTEGER}.
2957 @end multitable
2959 @item @emph{Return value}:
2960 Returns an array of same type and rank as the @var{ARRAY} argument.
2962 @item @emph{Example}:
2963 @smallexample
2964 program test_eoshift
2965     integer, dimension(3,3) :: a
2966     a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2967     print '(3i3)', a(1,:)
2968     print '(3i3)', a(2,:)
2969     print '(3i3)', a(3,:)    
2970     a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
2971     print *
2972     print '(3i3)', a(1,:)
2973     print '(3i3)', a(2,:)
2974     print '(3i3)', a(3,:)
2975 end program test_eoshift
2976 @end smallexample
2977 @end table
2981 @node EPSILON
2982 @section @code{EPSILON} --- Epsilon function
2983 @findex @code{EPSILON} intrinsic
2984 @cindex epsilon, significant
2986 @table @asis
2987 @item @emph{Description}:
2988 @code{EPSILON(X)} returns a nearly negligible number relative to @code{1}.
2990 @item @emph{Standard}:
2991 F95 and later
2993 @item @emph{Class}:
2994 Inquiry function
2996 @item @emph{Syntax}:
2997 @code{C = EPSILON(X)}
2999 @item @emph{Arguments}:
3000 @multitable @columnfractions .15 .80
3001 @item @var{X} @tab The type shall be @code{REAL(*)}.
3002 @end multitable
3004 @item @emph{Return value}:
3005 The return value is of same type as the argument.
3007 @item @emph{Example}:
3008 @smallexample
3009 program test_epsilon
3010     real :: x = 3.143
3011     real(8) :: y = 2.33
3012     print *, EPSILON(x)
3013     print *, EPSILON(y)
3014 end program test_epsilon
3015 @end smallexample
3016 @end table
3020 @node ERF
3021 @section @code{ERF} --- Error function 
3022 @findex @code{ERF} intrinsic
3023 @cindex error function
3025 @table @asis
3026 @item @emph{Description}:
3027 @code{ERF(X)} computes the error function of @var{X}.
3029 @item @emph{Standard}:
3030 GNU Extension
3032 @item @emph{Class}:
3033 Elemental function
3035 @item @emph{Syntax}:
3036 @code{X = ERF(X)}
3038 @item @emph{Arguments}:
3039 @multitable @columnfractions .15 .80
3040 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
3041 @end multitable
3043 @item @emph{Return value}:
3044 The return value is a scalar of type @code{REAL(*)} and it is positive
3045 (@math{ - 1 \leq erf (x) \leq 1 }.
3047 @item @emph{Example}:
3048 @smallexample
3049 program test_erf
3050   real(8) :: x = 0.17_8
3051   x = erf(x)
3052 end program test_erf
3053 @end smallexample
3055 @item @emph{Specific names}:
3056 @multitable @columnfractions .20 .20 .20 .40
3057 @item Name            @tab Argument          @tab Return type       @tab Standard
3058 @item @code{DERF(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
3059 @end multitable
3060 @end table
3064 @node ERFC
3065 @section @code{ERFC} --- Error function 
3066 @findex @code{ERFC} intrinsic
3067 @cindex error function
3069 @table @asis
3070 @item @emph{Description}:
3071 @code{ERFC(X)} computes the complementary error function of @var{X}.
3073 @item @emph{Standard}:
3074 GNU extension
3076 @item @emph{Class}:
3077 Elemental function
3079 @item @emph{Syntax}:
3080 @code{X = ERFC(X)}
3082 @item @emph{Arguments}:
3083 @multitable @columnfractions .15 .80
3084 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
3085 @end multitable
3087 @item @emph{Return value}:
3088 The return value is a scalar of type @code{REAL(*)} and it is positive
3089 (@math{ 0 \leq erfc (x) \leq 2 }.
3091 @item @emph{Example}:
3092 @smallexample
3093 program test_erfc
3094   real(8) :: x = 0.17_8
3095   x = erfc(x)
3096 end program test_erfc
3097 @end smallexample
3099 @item @emph{Specific names}:
3100 @multitable @columnfractions .20 .20 .20 .40
3101 @item Name            @tab Argument          @tab Return type       @tab Standard
3102 @item @code{DERFC(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
3103 @end multitable
3104 @end table
3108 @node ETIME
3109 @section @code{ETIME} --- Execution time subroutine (or function)
3110 @findex @code{ETIME} intrinsic
3111 @cindex time functions
3113 @table @asis
3114 @item @emph{Description}:
3115 @code{ETIME(TARRAY, RESULT)} returns the number of seconds of runtime
3116 since the start of the process's execution in @var{RESULT}.  @var{TARRAY}
3117 returns the user and system components of this time in @code{TARRAY(1)} and
3118 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
3120 On some systems, the underlying timings are represented using types with
3121 sufficiently small limits that overflows (wrap around) are possible, such as
3122 32-bit types. Therefore, the values returned by this intrinsic might be, or
3123 become, negative, or numerically less than previous values, during a single
3124 run of the compiled program.
3126 If @code{ETIME} is invoked as a function, it can not be invoked as a
3127 subroutine, and vice versa.
3129 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
3131 @multitable @columnfractions .15 .30 .60
3132 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
3133 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
3134 @item @tab @code{RESULT}: @tab Run time since start in seconds.
3135 @end multitable
3137 @item @emph{Standard}:
3138 GNU extension
3140 @item @emph{Class}:
3141 Subroutine
3143 @item @emph{Syntax}:
3144 @multitable @columnfractions .8
3145 @item @code{CALL ETIME(TARRAY, RESULT)}.
3146 @item @code{RESULT = ETIME(TARRAY)}, (not recommended).
3147 @end multitable
3149 @item @emph{Arguments}:
3150 @multitable @columnfractions .15 .80
3151 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
3152 @item @var{RESULT}@tab The type shall be @code{REAL}.
3153 @end multitable
3155 @item @emph{Return value}:
3156 Elapsed time in seconds since the start of program execution.
3158 @item @emph{Example}:
3159 @smallexample
3160 program test_etime
3161     integer(8) :: i, j
3162     real, dimension(2) :: tarray
3163     real :: result
3164     call ETIME(tarray, result)
3165     print *, result
3166     print *, tarray(1)
3167     print *, tarray(2)   
3168     do i=1,100000000    ! Just a delay
3169         j = i * i - i
3170     end do
3171     call ETIME(tarray, result)
3172     print *, result
3173     print *, tarray(1)
3174     print *, tarray(2)
3175 end program test_etime
3176 @end smallexample
3178 @item @emph{See also}:
3179 @ref{CPU_TIME}
3181 @end table
3185 @node EXIT
3186 @section @code{EXIT} --- Exit the program with status. 
3187 @findex @code{EXIT}
3188 @cindex exit
3190 @table @asis
3191 @item @emph{Description}:
3192 @code{EXIT} causes immediate termination of the program with status.  If status
3193 is omitted it returns the canonical @emph{success} for the system.  All Fortran
3194 I/O units are closed. 
3196 @item @emph{Standard}:
3197 GNU extension
3199 @item @emph{Class}:
3200 Subroutine
3202 @item @emph{Syntax}:
3203 @code{CALL EXIT([STATUS])}
3205 @item @emph{Arguments}:
3206 @multitable @columnfractions .15 .80
3207 @item @var{STATUS} @tab The type of the argument shall be @code{INTEGER(*)}.
3208 @end multitable
3210 @item @emph{Return value}:
3211 @code{STATUS} is passed to the parent process on exit.
3213 @item @emph{Example}:
3214 @smallexample
3215 program test_exit
3216   integer :: STATUS = 0
3217   print *, 'This program is going to exit.'
3218   call EXIT(STATUS)
3219 end program test_exit
3220 @end smallexample
3222 @item @emph{See also}:
3223 @ref{ABORT}, @ref{KILL}
3224 @end table
3228 @node EXP
3229 @section @code{EXP} --- Exponential function 
3230 @findex @code{EXP} intrinsic
3231 @findex @code{DEXP} intrinsic
3232 @findex @code{ZEXP} intrinsic
3233 @findex @code{CDEXP} intrinsic
3234 @cindex exponential
3236 @table @asis
3237 @item @emph{Description}:
3238 @code{EXP(X)} computes the base @math{e} exponential of @var{X}.
3240 @item @emph{Standard}:
3241 F77 and later, has overloads that are GNU extensions
3243 @item @emph{Class}:
3244 Elemental function
3246 @item @emph{Syntax}:
3247 @code{X = EXP(X)}
3249 @item @emph{Arguments}:
3250 @multitable @columnfractions .15 .80
3251 @item @var{X} @tab The type shall be @code{REAL(*)} or
3252 @code{COMPLEX(*)}.
3253 @end multitable
3255 @item @emph{Return value}:
3256 The return value has same type and kind as @var{X}.
3258 @item @emph{Example}:
3259 @smallexample
3260 program test_exp
3261   real :: x = 1.0
3262   x = exp(x)
3263 end program test_exp
3264 @end smallexample
3266 @item @emph{Specific names}:
3267 @multitable @columnfractions .20 .20 .20 .40
3268 @item Name            @tab Argument             @tab Return type         @tab Standard
3269 @item @code{DEXP(X)}  @tab @code{REAL(8) X}     @tab @code{REAL(8)}      @tab F77 and later
3270 @item @code{CEXP(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}   @tab F77 and later
3271 @item @code{ZEXP(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}   @tab GNU extension
3272 @item @code{CDEXP(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}   @tab GNU extension
3273 @end multitable
3274 @end table
3278 @node EXPONENT
3279 @section @code{EXPONENT} --- Exponent function 
3280 @findex @code{EXPONENT} intrinsic
3281 @cindex exponent function
3283 @table @asis
3284 @item @emph{Description}:
3285 @code{EXPONENT(X)} returns the value of the exponent part of @var{X}. If @var{X}
3286 is zero the value returned is zero. 
3288 @item @emph{Standard}:
3289 F95 and later
3291 @item @emph{Class}:
3292 Elemental function
3294 @item @emph{Syntax}:
3295 @code{I = EXPONENT(X)}
3297 @item @emph{Arguments}:
3298 @multitable @columnfractions .15 .80
3299 @item @var{X} @tab The type shall be @code{REAL(*)}.
3300 @end multitable
3302 @item @emph{Return value}:
3303 The return value is of type default @code{INTEGER}.
3305 @item @emph{Example}:
3306 @smallexample
3307 program test_exponent
3308   real :: x = 1.0
3309   integer :: i
3310   i = exponent(x)
3311   print *, i
3312   print *, exponent(0.0)
3313 end program test_exponent
3314 @end smallexample
3315 @end table
3318 @node FDATE
3319 @section @code{FDATE} --- Get the current time as a string
3320 @findex @code{FDATE} intrinsic
3321 @cindex fdate subroutine 
3323 @table @asis
3324 @item @emph{Description}:
3325 @code{FDATE(DATE)} returns the current date (using the same format as
3326 @code{CTIME}) in @var{DATE}. It is equivalent to @code{CALL CTIME(DATE,
3327 TIME8())}.
3329 If @code{FDATE} is invoked as a function, it can not be invoked as a
3330 subroutine, and vice versa.
3332 @var{DATE} is an @code{INTENT(OUT)} @code{CHARACTER} variable.
3334 @item @emph{Standard}:
3335 GNU extension
3337 @item @emph{Class}:
3338 Subroutine
3340 @item @emph{Syntax}:
3341 @multitable @columnfractions .80
3342 @item @code{CALL FDATE(DATE)}.
3343 @item @code{DATE = FDATE()}, (not recommended).
3344 @end multitable
3346 @item @emph{Arguments}:
3347 @multitable @columnfractions .15 .80
3348 @item @var{DATE}@tab The type shall be of type @code{CHARACTER}.
3349 @end multitable
3351 @item @emph{Return value}:
3352 The current date as a string.
3354 @item @emph{Example}:
3355 @smallexample
3356 program test_fdate
3357     integer(8) :: i, j
3358     character(len=30) :: date
3359     call fdate(date)
3360     print *, 'Program started on ', date
3361     do i = 1, 100000000 ! Just a delay
3362         j = i * i - i
3363     end do
3364     call fdate(date)
3365     print *, 'Program ended on ', date
3366 end program test_fdate
3367 @end smallexample
3368 @end table
3370 @node FLOAT
3372 @section @code{FLOAT} --- Convert integer to default real
3373 @findex @code{FLOAT} intrinsic
3374 @cindex conversion function (float)
3376 @table @asis
3377 @item @emph{Description}:
3378 @code{FLOAT(I)} converts the integer @var{I} to a default real value.
3380 @item @emph{Standard}:
3381 GNU extension
3383 @item @emph{Class}:
3384 Elemental function
3386 @item @emph{Syntax}:
3387 @code{X = FLOAT(I)}
3389 @item @emph{Arguments}:
3390 @multitable @columnfractions .15 .80
3391 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
3392 @end multitable
3394 @item @emph{Return value}:
3395 The return value is of type default @code{REAL}
3397 @item @emph{Example}:
3398 @smallexample
3399 program test_float
3400     integer :: i = 1
3401     if (float(i) /= 1.) call abort
3402 end program test_float
3403 @end smallexample
3405 @item @emph{See also}:
3406 @ref{DBLE}, @ref{DFLOAT}, @ref{REAL}
3407 @end table
3411 @node FGET
3412 @section @code{FGET} --- Read a single character in stream mode from stdin 
3413 @findex @code{FGET} intrinsic
3414 @cindex file operations
3415 @cindex stream operations
3417 @table @asis
3418 @item @emph{Description}:
3419 Read a single character in stream mode from stdin by bypassing normal 
3420 formatted output. Stream I/O should not be mixed with normal record-oriented 
3421 (formatted or unformatted) I/O on the same unit; the results are unpredictable.
3423 This intrinsic routine is provided for backwards compatibility with 
3424 @command{g77}.  GNU Fortran provides the Fortran 2003 Stream facility.
3425 Programmers should consider the use of new stream IO feature in new code 
3426 for future portability. See also @ref{Fortran 2003 status}.
3428 @item @emph{Standard}:
3429 GNU extension
3431 @item @emph{Class}:
3432 Non-elemental subroutine
3434 @item @emph{Syntax}:
3435 @code{CALL FGET(C[,STATUS])}
3437 @item @emph{Arguments}:
3438 @multitable @columnfractions .15 .80
3439 @item @var{C}      @tab The type shall be @code{CHARACTER}.
3440 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
3441                         -1 on end-of-file and a system specific positive error code otherwise.
3442 @end multitable
3444 @item @emph{Example}:
3445 @smallexample
3446 PROGRAM test_fget
3447   INTEGER, PARAMETER :: strlen = 100
3448   INTEGER :: status, i = 1
3449   CHARACTER(len=strlen) :: str = ""
3451   WRITE (*,*) 'Enter text:'
3452   DO
3453     CALL fget(str(i:i), status)
3454     if (status /= 0 .OR. i > strlen) exit
3455     i = i + 1
3456   END DO
3457   WRITE (*,*) TRIM(str)
3458 END PROGRAM
3459 @end smallexample
3461 @item @emph{See also}:
3462 @ref{FGETC}, @ref{FPUT}, @ref{FPUTC}
3463 @end table
3466 @node FGETC
3467 @section @code{FGETC} --- Read a single character in stream mode
3468 @findex @code{FGETC} intrinsic
3469 @cindex file operations
3470 @cindex stream operations
3472 @table @asis
3473 @item @emph{Description}:
3474 Read a single character in stream mode by bypassing normal formatted output. 
3475 Stream I/O should not be mixed with normal record-oriented (formatted or 
3476 unformatted) I/O on the same unit; the results are unpredictable.
3478 This intrinsic routine is provided for backwards compatibility with 
3479 @command{g77}.  GNU Fortran provides the Fortran 2003 Stream facility.
3480 Programmers should consider the use of new stream IO feature in new code 
3481 for future portability. See also @ref{Fortran 2003 status}.
3483 @item @emph{Standard}:
3484 GNU extension
3486 @item @emph{Class}:
3487 Non-elemental subroutine
3489 @item @emph{Syntax}:
3490 @code{CALL FGETC(UNIT,C[,STATUS])}
3492 @item @emph{Arguments}:
3493 @multitable @columnfractions .15 .80
3494 @item @var{UNIT}   @tab The type shall be @code{INTEGER}.
3495 @item @var{C}      @tab The type shall be @code{CHARACTER}.
3496 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
3497                         -1 on end-of-file and a system specific positive error code otherwise.
3498 @end multitable
3500 @item @emph{Example}:
3501 @smallexample
3502 PROGRAM test_fgetc
3503   INTEGER :: fd = 42, status
3504   CHARACTER :: c
3506   OPEN(UNIT=fd, FILE="/etc/passwd", ACTION="READ", STATUS = "OLD")
3507   DO
3508     CALL fgetc(fd, c, status)
3509     IF (status /= 0) EXIT
3510     call fput(c)
3511   END DO
3512   CLOSE(UNIT=fd)
3513 END PROGRAM
3514 @end smallexample
3516 @item @emph{See also}:
3517 @ref{FGET}, @ref{FPUT}, @ref{FPUTC}
3518 @end table
3522 @node FLOOR
3523 @section @code{FLOOR} --- Integer floor function
3524 @findex @code{FLOOR} intrinsic
3525 @cindex floor
3527 @table @asis
3528 @item @emph{Description}:
3529 @code{FLOOR(X)} returns the greatest integer less than or equal to @var{X}.
3531 @item @emph{Standard}:
3532 F95 and later
3534 @item @emph{Class}:
3535 Elemental function
3537 @item @emph{Syntax}:
3538 @code{I = FLOOR(X[,KIND])}
3540 @item @emph{Arguments}:
3541 @multitable @columnfractions .15 .80
3542 @item @var{X} @tab The type shall be @code{REAL(*)}.
3543 @item @var{KIND} @tab Optional scaler integer initialization expression.
3544 @end multitable
3546 @item @emph{Return value}:
3547 The return value is of type @code{INTEGER(KIND)}
3549 @item @emph{Example}:
3550 @smallexample
3551 program test_floor
3552     real :: x = 63.29
3553     real :: y = -63.59
3554     print *, floor(x) ! returns 63
3555     print *, floor(y) ! returns -64
3556 end program test_floor
3557 @end smallexample
3559 @item @emph{See also}:
3560 @ref{CEILING}, @ref{NINT}
3562 @end table
3566 @node FLUSH
3567 @section @code{FLUSH} --- Flush I/O unit(s)
3568 @findex @code{FLUSH}
3569 @cindex flush
3571 @table @asis
3572 @item @emph{Description}:
3573 Flushes Fortran unit(s) currently open for output. Without the optional
3574 argument, all units are flushed, otherwise just the unit specified.
3576 @item @emph{Standard}:
3577 GNU extension
3579 @item @emph{Class}:
3580 non-elemental subroutine
3582 @item @emph{Syntax}:
3583 @code{CALL FLUSH(UNIT)}
3585 @item @emph{Arguments}:
3586 @multitable @columnfractions .15 .80
3587 @item @var{UNIT} @tab (Optional) The type shall be @code{INTEGER}.
3588 @end multitable
3590 @item @emph{Note}:
3591 Beginning with the Fortran 2003 standard, there is a @code{FLUSH}
3592 statement that should be preferred over the @code{FLUSH} intrinsic.
3594 @end table
3598 @node FNUM
3599 @section @code{FNUM} --- File number function
3600 @findex @code{FNUM} intrinsic
3601 @cindex fnum
3603 @table @asis
3604 @item @emph{Description}:
3605 @code{FNUM(UNIT)} returns the POSIX file descriptor number corresponding to the
3606 open Fortran I/O unit @code{UNIT}.
3608 @item @emph{Standard}:
3609 GNU extension
3611 @item @emph{Class}:
3612 non-elemental function
3614 @item @emph{Syntax}:
3615 @code{I = FNUM(UNIT)}
3617 @item @emph{Arguments}:
3618 @multitable @columnfractions .15 .80
3619 @item @var{UNIT} @tab The type shall be @code{INTEGER}.
3620 @end multitable
3622 @item @emph{Return value}:
3623 The return value is of type @code{INTEGER}
3625 @item @emph{Example}:
3626 @smallexample
3627 program test_fnum
3628   integer :: i
3629   open (unit=10, status = "scratch")
3630   i = fnum(10)
3631   print *, i
3632   close (10)
3633 end program test_fnum
3634 @end smallexample
3635 @end table
3639 @node FPUT
3640 @section @code{FPUT} --- Write a single character in stream mode to stdout 
3641 @findex @code{FPUT} intrinsic
3642 @cindex file operations
3643 @cindex stream operations
3645 @table @asis
3646 @item @emph{Description}:
3647 Write a single character in stream mode to stdout by bypassing normal 
3648 formatted output. Stream I/O should not be mixed with normal record-oriented 
3649 (formatted or unformatted) I/O on the same unit; the results are unpredictable.
3651 This intrinsic routine is provided for backwards compatibility with 
3652 @command{g77}.  GNU Fortran provides the Fortran 2003 Stream facility.
3653 Programmers should consider the use of new stream IO feature in new code 
3654 for future portability. See also @ref{Fortran 2003 status}.
3656 @item @emph{Standard}:
3657 GNU extension
3659 @item @emph{Class}:
3660 Non-elemental subroutine
3662 @item @emph{Syntax}:
3663 @code{CALL FPUT(C[,STATUS])}
3665 @item @emph{Arguments}:
3666 @multitable @columnfractions .15 .80
3667 @item @var{C}      @tab The type shall be @code{CHARACTER}.
3668 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
3669                         -1 on end-of-file and a system specific positive error code otherwise.
3670 @end multitable
3672 @item @emph{Example}:
3673 @smallexample
3674 PROGRAM test_fput
3675   CHARACTER(len=*) :: str = "gfortran"
3676   INTEGER :: i
3677   DO i = 1, len_trim(str)
3678     CALL fput(str(i:i))
3679   END DO
3680 END PROGRAM
3681 @end smallexample
3683 @item @emph{See also}:
3684 @ref{FPUTC}, @ref{FGET}, @ref{FGETC}
3685 @end table
3689 @node FPUTC
3690 @section @code{FPUTC} --- Write a single character in stream mode
3691 @findex @code{FPUTC} intrinsic
3692 @cindex file operations
3693 @cindex stream operations
3695 @table @asis
3696 @item @emph{Description}:
3697 Write a single character in stream mode by bypassing normal formatted 
3698 output. Stream I/O should not be mixed with normal record-oriented 
3699 (formatted or unformatted) I/O on the same unit; the results are unpredictable.
3701 This intrinsic routine is provided for backwards compatibility with 
3702 @command{g77}.  GNU Fortran provides the Fortran 2003 Stream facility.
3703 Programmers should consider the use of new stream IO feature in new code 
3704 for future portability. See also @ref{Fortran 2003 status}.
3706 @item @emph{Standard}:
3707 GNU extension
3709 @item @emph{Class}:
3710 Non-elemental subroutine
3712 @item @emph{Syntax}:
3713 @code{CALL FPUTC(UNIT,C[,STATUS])}
3715 @item @emph{Arguments}:
3716 @multitable @columnfractions .15 .80
3717 @item @var{UNIT}   @tab The type shall be @code{INTEGER}.
3718 @item @var{C}      @tab The type shall be @code{CHARACTER}.
3719 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER}. Returns 0 on success,
3720                         -1 on end-of-file and a system specific positive error code otherwise.
3721 @end multitable
3723 @item @emph{Example}:
3724 @smallexample
3725 PROGRAM test_fputc
3726   CHARACTER(len=*) :: str = "gfortran"
3727   INTEGER :: fd = 42, i
3729   OPEN(UNIT = fd, FILE = "out", ACTION = "WRITE", STATUS="NEW")
3730   DO i = 1, len_trim(str)
3731     CALL fputc(fd, str(i:i))
3732   END DO
3733   CLOSE(fd)
3734 END PROGRAM
3735 @end smallexample
3737 @item @emph{See also}:
3738 @ref{FPUT}, @ref{FGET}, @ref{FGETC}
3739 @end table
3743 @node FRACTION
3744 @section @code{FRACTION} --- Fractional part of the model representation
3745 @findex @code{FRACTION} intrinsic
3746 @cindex fractional part
3748 @table @asis
3749 @item @emph{Description}:
3750 @code{FRACTION(X)} returns the fractional part of the model
3751 representation of @code{X}.
3753 @item @emph{Standard}:
3754 F95 and later
3756 @item @emph{Class}:
3757 Elemental function
3759 @item @emph{Syntax}:
3760 @code{Y = FRACTION(X)}
3762 @item @emph{Arguments}:
3763 @multitable @columnfractions .15 .80
3764 @item @var{X} @tab The type of the argument shall be a @code{REAL}.
3765 @end multitable
3767 @item @emph{Return value}:
3768 The return value is of the same type and kind as the argument.
3769 The fractional part of the model representation of @code{X} is returned;
3770 it is @code{X * RADIX(X)**(-EXPONENT(X))}.
3772 @item @emph{Example}:
3773 @smallexample
3774 program test_fraction
3775   real :: x
3776   x = 178.1387e-4
3777   print *, fraction(x), x * radix(x)**(-exponent(x))
3778 end program test_fraction
3779 @end smallexample
3781 @end table
3785 @node FREE
3786 @section @code{FREE} --- Frees memory
3787 @findex @code{FREE} intrinsic
3788 @cindex FREE
3790 @table @asis
3791 @item @emph{Description}:
3792 Frees memory previously allocated by @code{MALLOC()}. The @code{FREE}
3793 intrinsic is an extension intended to be used with Cray pointers, and is
3794 provided in GNU Fortran to allow user to compile legacy code. For
3795 new code using Fortran 95 pointers, the memory de-allocation intrinsic is
3796 @code{DEALLOCATE}.
3798 @item @emph{Standard}:
3799 GNU extension
3801 @item @emph{Class}:
3802 Subroutine
3804 @item @emph{Syntax}:
3805 @code{FREE(PTR)}
3807 @item @emph{Arguments}:
3808 @multitable @columnfractions .15 .80
3809 @item @var{PTR} @tab The type shall be @code{INTEGER}. It represents the
3810 location of the memory that should be de-allocated.
3811 @end multitable
3813 @item @emph{Return value}:
3814 None
3816 @item @emph{Example}:
3817 See @code{MALLOC} for an example.
3819 @item @emph{See also}:
3820 @ref{MALLOC}
3821 @end table
3826 @node FSTAT
3827 @section @code{FSTAT} --- Get file status
3828 @findex @code{FSTAT} intrinsic
3829 @cindex file system operations 
3831 @table @asis
3832 @item @emph{Description}:
3833 @code{FSTAT} is identical to @ref{STAT}, except that information about an 
3834 already opened file is obtained.
3836 The elements in @code{BUFF} are the same as described by @ref{STAT}.
3838 @item @emph{Standard}:
3839 GNU extension
3841 @item @emph{Class}:
3842 Non-elemental subroutine
3844 @item @emph{Syntax}:
3845 @code{CALL fstat(UNIT,BUFF[,STATUS])}
3847 @item @emph{Arguments}:
3848 @multitable @columnfractions .15 .80
3849 @item @var{UNIT}   @tab An open I/O unit number of type @code{INTEGER}.
3850 @item @var{BUFF}   @tab The type shall be @code{INTEGER(4), DIMENSION(13)}.
3851 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER(4)}. Returns 0 
3852                         on success and a system specific error code otherwise.
3853 @end multitable
3855 @item @emph{Example}:
3856 See @ref{STAT} for an example.
3858 @item @emph{See also}:
3859 To stat a link: @ref{LSTAT}, to stat a file: @ref{STAT}
3860 @end table
3864 @node FSEEK
3865 @section @code{FSEEK} --- Low level file positioning subroutine
3866 @findex @code{FSEEK} 
3867 @cindex file system functions
3869 Not yet implemented in GNU Fortran.
3871 @table @asis
3872 @item @emph{Description}:
3874 @item @emph{Standard}:
3875 GNU extension
3877 @item @emph{Class}:
3878 Subroutine
3880 @item @emph{Syntax}:
3881 @item @emph{Arguments}:
3882 @item @emph{Return value}:
3883 @item @emph{Example}:
3884 @item @emph{Specific names}:
3885 @item @emph{See also}:
3886 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
3888 @end table
3892 @node FTELL
3893 @section @code{FTELL} --- Current stream position
3894 @findex @code{FTELL} intrinsic
3896 @table @asis
3897 @item @emph{Description}:
3898 Retrieves the current position within an open file.
3900 This intrinsic is provided in both subroutine and function forms; however,
3901 only one form can be used in any given program unit.
3903 @item @emph{Standard}:
3904 GNU extension
3906 @item @emph{Class}:
3907 Subroutine, function
3909 @item @emph{Syntax}:
3910 @multitable @columnfractions .80
3911 @item @code{CALL FTELL(UNIT, OFFSET)}
3912 @item @code{OFFSET = FTELL(UNIT)}
3913 @end multitable
3915 @item @emph{Arguments}:
3916 @multitable @columnfractions .15 .80
3917 @item @var{OFFSET}  @tab Shall of type @code{INTEGER}.
3918 @item @var{UNIT}    @tab Shall of type @code{INTEGER}.
3919 @end multitable
3921 @item @emph{Return value}:
3922 In either syntax, @var{OFFSET} is set to the current offset of unit
3923 number @var{UNIT}, or to @math{-1} if the unit is not currently open.
3925 @item @emph{Example}:
3926 @smallexample
3927 PROGRAM test_ftell
3928   INTEGER :: i
3929   OPEN(10, FILE="temp.dat")
3930   CALL ftell(10,i)
3931   WRITE(*,*) i
3932 END PROGRAM
3933 @end smallexample
3935 @item @emph{See also}:
3936 @ref{FSEEK}
3937 @end table
3941 @node GETARG
3942 @section @code{GETARG} --- Get command line arguments
3943 @findex @code{GETARG} intrinsic
3944 @cindex command line arguments
3945 @cindex getopt
3947 @table @asis
3948 @item @emph{Description}:
3949 Retrieve the @var{N}th argument that was passed on the
3950 command line when the containing program was invoked.
3952 This intrinsic routine is provided for backwards compatibility with 
3953 GNU Fortran 77.  In new code, programmers should consider the use of 
3954 the @ref{GET_COMMAND_ARGUMENT} intrinsic defined by the Fortran 2003 
3955 standard.
3957 @item @emph{Standard}:
3958 GNU extension
3960 @item @emph{Class}:
3961 Subroutine
3963 @item @emph{Syntax}:
3964 @code{CALL GETARG(N,ARG)}
3966 @item @emph{Arguments}:
3967 @multitable @columnfractions .15 .80
3968 @item @var{N}   @tab Shall of type @code{INTEGER(4)}, @math{@var{N} \geq 0}
3969 @item @var{ARG} @tab Shall be of type @code{CHARACTER(*)}. 
3970 @end multitable
3972 @item @emph{Return value}:
3973 After @code{GETARG} returns, the @var{ARG} argument holds the @var{N}th 
3974 command line argument. If @var{ARG} can not hold the argument, it is 
3975 truncated to fit the length of @var{ARG}. If there are less than @var{N}
3976 arguments specified at the command line, @var{ARG} will be filled with blanks.
3977 If @math{@var{N} = 0}, @var{ARG} is set to the name of the program (on systems
3978 that support this feature).
3980 @item @emph{Example}:
3981 @smallexample
3982 PROGRAM test_getarg
3983   INTEGER :: i
3984   CHARACTER(len=32) :: arg
3986   DO i = 1, iargc()
3987     CALL getarg(i, arg)
3988     WRITE (*,*) arg
3989   END DO
3990 END PROGRAM
3991 @end smallexample
3993 @item @emph{See also}:
3994 GNU Fortran 77 compatibility function: @ref{IARGC}
3996 F2003 functions and subroutines: @ref{GET_COMMAND}, @ref{GET_COMMAND_ARGUMENT}, @ref{COMMAND_ARGUMENT_COUNT}
3997 @end table
4001 @node GET_COMMAND
4002 @section @code{GET_COMMAND} --- Get the entire command line
4003 @findex @code{GET_COMMAND} intrinsic
4004 @cindex command line arguments
4005 @cindex getopt
4007 @table @asis
4008 @item @emph{Description}:
4009 Retrieve the entire command line that was used to invoke the program.
4011 @item @emph{Standard}:
4012 F2003
4014 @item @emph{Class}:
4015 Subroutine
4017 @item @emph{Syntax}:
4018 @code{CALL GET_COMMAND(CMD)}
4020 @item @emph{Arguments}:
4021 @multitable @columnfractions .15 .80
4022 @item @var{CMD} @tab Shall be of type @code{CHARACTER(*)}. 
4023 @end multitable
4025 @item @emph{Return value}:
4026 Stores the entire command line that was used to invoke the program in @var{ARG}. 
4027 If @var{ARG} is not large enough, the command will be truncated. 
4029 @item @emph{Example}:
4030 @smallexample
4031 PROGRAM test_get_command
4032   CHARACTER(len=255) :: cmd
4033   CALL get_command(cmd)
4034   WRITE (*,*) TRIM(cmd)
4035 END PROGRAM
4036 @end smallexample
4038 @item @emph{See also}:
4039 @ref{GET_COMMAND_ARGUMENT}, @ref{COMMAND_ARGUMENT_COUNT}
4040 @end table
4044 @node GET_COMMAND_ARGUMENT
4045 @section @code{GET_COMMAND_ARGUMENT} --- Get command line arguments
4046 @findex @code{GET_COMMAND_ARGUMENT} intrinsic
4047 @cindex command line arguments
4048 @cindex getopt
4050 @table @asis
4051 @item @emph{Description}:
4052 Retrieve the @var{N}th argument that was passed on the
4053 command line when the containing program was invoked.
4055 @item @emph{Standard}:
4056 F2003
4058 @item @emph{Class}:
4059 Subroutine
4061 @item @emph{Syntax}:
4062 @code{CALL GET_COMMAND_ARGUMENT(N,ARG)}
4064 @item @emph{Arguments}:
4065 @multitable @columnfractions .15 .80
4066 @item @var{N}   @tab Shall of type @code{INTEGER(4)}, @math{@var{N} \geq 0}
4067 @item @var{ARG} @tab Shall be of type @code{CHARACTER(*)}. 
4068 @end multitable
4070 @item @emph{Return value}:
4071 After @code{GET_COMMAND_ARGUMENT} returns, the @var{ARG} argument holds the 
4072 @var{N}th command line argument. If @var{ARG} can not hold the argument, it is 
4073 truncated to fit the length of @var{ARG}. If there are less than @var{N}
4074 arguments specified at the command line, @var{ARG} will be filled with blanks. 
4075 If @math{@var{N} = 0}, @var{ARG} is set to the name of the program (on systems
4076 that support this feature).
4078 @item @emph{Example}:
4079 @smallexample
4080 PROGRAM test_get_command_argument
4081   INTEGER :: i
4082   CHARACTER(len=32) :: arg
4084   i = 0
4085   DO
4086     CALL get_command_argument(i, arg)
4087     IF (LEN_TRIM(arg) == 0) EXIT
4089     WRITE (*,*) TRIM(arg)
4090     i = i+1
4091   END DO
4092 END PROGRAM
4093 @end smallexample
4095 @item @emph{See also}:
4096 @ref{GET_COMMAND}, @ref{COMMAND_ARGUMENT_COUNT}
4097 @end table
4101 @node GETCWD
4102 @section @code{GETCWD} --- Get current working directory
4103 @findex @code{GETCWD} intrinsic
4104 @cindex file system functions
4106 @table @asis
4107 @item @emph{Description}:
4108 Get current working directory.
4110 @item @emph{Standard}:
4111 GNU extension
4113 @item @emph{Class}:
4114 Non-elemental subroutine.
4116 @item @emph{Syntax}:
4117 @code{CALL GETCWD(CWD[,STATUS])}
4119 @item @emph{Arguments}:
4120 @multitable @columnfractions .15 .80
4121 @item @var{CWD}    @tab The type shall be @code{CHARACTER(*)}.
4122 @item @var{STATUS} @tab (Optional) status flag. Returns 0 on success, 
4123                         a system specific and non-zero error code otherwise.
4124 @end multitable
4126 @item @emph{Example}:
4127 @smallexample
4128 PROGRAM test_getcwd
4129   CHARACTER(len=255) :: cwd
4130   CALL getcwd(cwd)
4131   WRITE(*,*) TRIM(cwd)
4132 END PROGRAM
4133 @end smallexample
4135 @item @emph{See also}:
4136 @ref{CHDIR}
4137 @end table
4141 @node GETENV
4142 @section @code{GETENV} --- Get an environmental variable
4143 @findex @code{GETENV} intrinsic
4144 @cindex environment variable
4146 @table @asis
4147 @item @emph{Description}:
4148 Get the @var{VALUE} of the environmental variable @var{ENVVAR}.
4150 This intrinsic routine is provided for backwards compatibility with 
4151 GNU Fortran 77.  In new code, programmers should consider the use of 
4152 the @ref{GET_ENVIRONMENT_VARIABLE} intrinsic defined by the Fortran
4153 2003 standard.
4155 @item @emph{Standard}:
4156 GNU extension
4158 @item @emph{Class}:
4159 Subroutine
4161 @item @emph{Syntax}:
4162 @code{CALL GETENV(ENVVAR,VALUE)}
4164 @item @emph{Arguments}:
4165 @multitable @columnfractions .15 .80
4166 @item @var{ENVVAR} @tab Shall be of type @code{CHARACTER(*)}. 
4167 @item @var{VALUE}  @tab Shall be of type @code{CHARACTER(*)}. 
4168 @end multitable
4170 @item @emph{Return value}:
4171 Stores the value of @var{ENVVAR} in @var{VALUE}. If @var{VALUE} is 
4172 not large enough to hold the data, it is truncated. If @var{ENVVAR}
4173 is not set, @var{VALUE} will be filled with blanks.
4175 @item @emph{Example}:
4176 @smallexample
4177 PROGRAM test_getenv
4178   CHARACTER(len=255) :: homedir
4179   CALL getenv("HOME", homedir)
4180   WRITE (*,*) TRIM(homedir)
4181 END PROGRAM
4182 @end smallexample
4184 @item @emph{See also}:
4185 @ref{GET_ENVIRONMENT_VARIABLE}
4186 @end table
4190 @node GET_ENVIRONMENT_VARIABLE
4191 @section @code{GET_ENVIRONMENT_VARIABLE} --- Get an environmental variable
4192 @findex @code{GET_ENVIRONMENT_VARIABLE} intrinsic
4193 @cindex environment variable
4195 @table @asis
4196 @item @emph{Description}:
4197 Get the @var{VALUE} of the environmental variable @var{ENVVAR}.
4199 @item @emph{Standard}:
4200 F2003
4202 @item @emph{Class}:
4203 Subroutine
4205 @item @emph{Syntax}:
4206 @code{CALL GET_ENVIRONMENT_VARIABLE(ENVVAR,VALUE)}
4208 @item @emph{Arguments}:
4209 @multitable @columnfractions .15 .80
4210 @item @var{ENVVAR} @tab Shall be of type @code{CHARACTER(*)}. 
4211 @item @var{VALUE}  @tab Shall be of type @code{CHARACTER(*)}. 
4212 @end multitable
4214 @item @emph{Return value}:
4215 Stores the value of @var{ENVVAR} in @var{VALUE}. If @var{VALUE} is 
4216 not large enough to hold the data, it is truncated. If @var{ENVVAR}
4217 is not set, @var{VALUE} will be filled with blanks.
4219 @item @emph{Example}:
4220 @smallexample
4221 PROGRAM test_getenv
4222   CHARACTER(len=255) :: homedir
4223   CALL get_environment_variable("HOME", homedir)
4224   WRITE (*,*) TRIM(homedir)
4225 END PROGRAM
4226 @end smallexample
4227 @end table
4231 @node GETGID
4232 @section @code{GETGID} --- Group ID function
4233 @findex @code{GETGID} intrinsic
4234 @cindex GETGID
4236 @table @asis
4237 @item @emph{Description}:
4238 Returns the numerical group ID of the current process.
4240 @item @emph{Standard}:
4241 GNU extension
4243 @item @emph{Class}:
4244 function
4246 @item @emph{Syntax}:
4247 @code{I = GETGID()}
4249 @item @emph{Return value}:
4250 The return value of @code{GETGID} is an @code{INTEGER} of the default
4251 kind.
4254 @item @emph{Example}:
4255 See @code{GETPID} for an example.
4257 @item @emph{See also}:
4258 @ref{GETPID}, @ref{GETUID}
4259 @end table
4263 @node GETLOG
4264 @section @code{GETLOG} --- Get login name
4265 @findex @code{GETLOG} intrinsic
4267 @table @asis
4268 @item @emph{Description}:
4269 Gets the username under which the program is running.
4271 @item @emph{Standard}:
4272 GNU extension
4274 @item @emph{Class}:
4275 Subroutine
4277 @item @emph{Syntax}:
4278 @code{CALL GETLOG(LOGIN)}
4280 @item @emph{Arguments}:
4281 @multitable @columnfractions .15 .80
4282 @item @var{LOGIN} @tab Shall be of type @code{CHARACTER(*)}.
4283 @end multitable
4285 @item @emph{Return value}:
4286 Stores the current user name in @var{LOGIN}.  (On systems where 
4287 the @code{getlogin(3)} function is not implemented, this will
4288 return a blank string.)
4290 @item @emph{Example}:
4291 @smallexample
4292 PROGRAM TEST_GETLOG
4293   CHARACTER(32) :: login
4294   CALL GETLOG(login)
4295   WRITE(*,*) login
4296 END PROGRAM
4297 @end smallexample
4299 @item @emph{See also}:
4300 @ref{GETUID}
4301 @end table
4305 @node GETPID
4306 @section @code{GETPID} --- Process ID function
4307 @findex @code{GETPID} intrinsic
4308 @cindex GETPID
4310 @table @asis
4311 @item @emph{Description}:
4312 Returns the numerical process identifier of the current process.
4314 @item @emph{Standard}:
4315 GNU extension
4317 @item @emph{Class}:
4318 function
4320 @item @emph{Syntax}:
4321 @code{I = GETPID()}
4323 @item @emph{Return value}:
4324 The return value of @code{GETPID} is an @code{INTEGER} of the default
4325 kind.
4328 @item @emph{Example}:
4329 @smallexample
4330 program info
4331   print *, "The current process ID is ", getpid()
4332   print *, "Your numerical user ID is ", getuid()
4333   print *, "Your numerical group ID is ", getgid()
4334 end program info
4335 @end smallexample
4337 @item @emph{See also}:
4338 @ref{GETGID}, @ref{GETUID}
4339 @end table
4343 @node GETUID
4344 @section @code{GETUID} --- User ID function
4345 @findex @code{GETUID} intrinsic
4346 @cindex GETUID
4348 @table @asis
4349 @item @emph{Description}:
4350 Returns the numerical user ID of the current process.
4352 @item @emph{Standard}:
4353 GNU extension
4355 @item @emph{Class}:
4356 function
4358 @item @emph{Syntax}:
4359 @code{GETUID()}
4361 @item @emph{Return value}:
4362 The return value of @code{GETUID} is an @code{INTEGER} of the default
4363 kind.
4366 @item @emph{Example}:
4367 See @code{GETPID} for an example.
4369 @item @emph{See also}:
4370 @ref{GETPID}, @ref{GETLOG}
4371 @end table
4375 @node GMTIME
4376 @section @code{GMTIME} --- Convert time to GMT info
4377 @findex @code{GMTIME} 
4378 @cindex time function
4380 Not yet implemented in GNU Fortran.
4382 @table @asis
4383 @item @emph{Description}:
4385 @item @emph{Standard}:
4386 GNU extension
4388 @item @emph{Class}:
4389 Subroutine
4391 @item @emph{Syntax}:
4392 @item @emph{Arguments}:
4393 @item @emph{Return value}:
4394 @item @emph{Example}:
4395 @item @emph{Specific names}:
4396 @item @emph{See also}:
4398 @end table
4402 @node HOSTNM
4403 @section @code{HOSTNM} --- Get system host name
4404 @findex @code{HOSTNM} intrinsic
4406 @table @asis
4407 @item @emph{Description}:
4408 Retrieves the host name of the system on which the program is running.
4410 This intrinsic is provided in both subroutine and function forms; however,
4411 only one form can be used in any given program unit.
4413 @item @emph{Standard}:
4414 GNU extension
4416 @item @emph{Class}:
4417 Subroutine, function
4419 @item @emph{Syntax}:
4420 @multitable @columnfractions .80
4421 @item @code{CALL HOSTNM(NAME, STATUS)}
4422 @item @code{STATUS = HOSTNM(NAME)}
4423 @end multitable
4425 @item @emph{Arguments}:
4426 @multitable @columnfractions .15 .80
4427 @item @var{NAME}    @tab Shall of type @code{CHARACTER(*)}.
4428 @item @var{STATUS}  @tab (Optional) status flag of type @code{INTEGER}.
4429                          Returns 0 on success, or a system specific error
4430                          code otherwise.
4431 @end multitable
4433 @item @emph{Return value}:
4434 In either syntax, @var{NAME} is set to the current hostname if it can
4435 be obtained, or to a blank string otherwise.
4437 @end table
4441 @node HUGE
4442 @section @code{HUGE} --- Largest number of a kind
4443 @findex @code{HUGE} intrinsic
4444 @cindex huge
4446 @table @asis
4447 @item @emph{Description}:
4448 @code{HUGE(X)} returns the largest number that is not an infinity in
4449 the model of the type of @code{X}.
4451 @item @emph{Standard}:
4452 F95 and later
4454 @item @emph{Class}:
4455 Elemental function
4457 @item @emph{Syntax}:
4458 @code{Y = HUGE(X)}
4460 @item @emph{Arguments}:
4461 @multitable @columnfractions .15 .80
4462 @item @var{X} @tab shall be of type @code{REAL} or @code{INTEGER}.
4463 @end multitable
4465 @item @emph{Return value}:
4466 The return value is of the same type and kind as @var{X}
4468 @item @emph{Example}:
4469 @smallexample
4470 program test_huge_tiny
4471   print *, huge(0), huge(0.0), huge(0.0d0)
4472   print *, tiny(0.0), tiny(0.0d0)
4473 end program test_huge_tiny
4474 @end smallexample
4475 @end table
4479 @node IACHAR
4480 @section @code{IACHAR} --- Code in @acronym{ASCII} collating sequence 
4481 @findex @code{IACHAR} intrinsic
4482 @cindex @acronym{ASCII} collating sequence
4483 @cindex conversion function (character)
4485 @table @asis
4486 @item @emph{Description}:
4487 @code{IACHAR(C)} returns the code for the @acronym{ASCII} character
4488 in the first character position of @code{C}.
4490 @item @emph{Standard}:
4491 F95 and later
4493 @item @emph{Class}:
4494 Elemental function
4496 @item @emph{Syntax}:
4497 @code{I = IACHAR(C)}
4499 @item @emph{Arguments}:
4500 @multitable @columnfractions .15 .80
4501 @item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)}
4502 @end multitable
4504 @item @emph{Return value}:
4505 The return value is of type @code{INTEGER} and of the default integer
4506 kind.
4508 @item @emph{Example}:
4509 @smallexample
4510 program test_iachar
4511   integer i
4512   i = iachar(' ')
4513 end program test_iachar
4514 @end smallexample
4516 @item @emph{See also}:
4517 @ref{CHAR},@ref{ICHAR}
4519 @end table
4522 @node IAND
4523 @section @code{IAND} --- Bitwise logical and
4524 @findex @code{IAND} intrinsic
4525 @cindex bit operations
4527 @table @asis
4528 @item @emph{Description}:
4529 Bitwise logical @code{AND}.
4531 @item @emph{Standard}:
4532 F95 and later
4534 @item @emph{Class}:
4535 Elemental function
4537 @item @emph{Syntax}:
4538 @code{RESULT = IAND(X, Y)}
4540 @item @emph{Arguments}:
4541 @multitable @columnfractions .15 .80
4542 @item @var{X} @tab The type shall be @code{INTEGER(*)}.
4543 @item @var{Y} @tab The type shall be @code{INTEGER(*)}.
4544 @end multitable
4546 @item @emph{Return value}:
4547 The return type is @code{INTEGER(*)} after cross-promotion of the arguments. 
4549 @item @emph{Example}:
4550 @smallexample
4551 PROGRAM test_iand
4552   INTEGER :: a, b
4553   DATA a / Z'F' /, b / Z'3' /
4554   WRITE (*,*) IAND(a, b)
4555 END PROGRAM
4556 @end smallexample
4558 @item @emph{See also}:
4559 @ref{IOR}, @ref{IEOR}, @ref{IBITS}, @ref{IBSET}, @ref{IBCLR},
4560 @end table
4564 @node IARGC
4565 @section @code{IARGC} --- Get the number of command line arguments
4566 @findex @code{IARGC} intrinsic
4567 @cindex command line arguments
4568 @cindex getopt
4570 @table @asis
4571 @item @emph{Description}:
4572 @code{IARGC()} returns the number of arguments passed on the
4573 command line when the containing program was invoked.
4575 This intrinsic routine is provided for backwards compatibility with 
4576 GNU Fortran 77.  In new code, programmers should consider the use of 
4577 the @ref{COMMAND_ARGUMENT_COUNT} intrinsic defined by the Fortran 2003 
4578 standard.
4580 @item @emph{Standard}:
4581 GNU extension
4583 @item @emph{Class}:
4584 Non-elemental Function
4586 @item @emph{Syntax}:
4587 @code{I = IARGC()}
4589 @item @emph{Arguments}:
4590 None.
4592 @item @emph{Return value}:
4593 The number of command line arguments, type @code{INTEGER(4)}.
4595 @item @emph{Example}:
4596 See @ref{GETARG}
4598 @item @emph{See also}:
4599 GNU Fortran 77 compatibility subroutine: @ref{GETARG}
4601 F2003 functions and subroutines: @ref{GET_COMMAND}, @ref{GET_COMMAND_ARGUMENT}, @ref{COMMAND_ARGUMENT_COUNT}
4602 @end table
4606 @node IBCLR
4607 @section @code{IBCLR} --- Clear bit
4608 @findex @code{IBCLR} intrinsic
4609 @cindex bit operations
4611 Intrinsic implemented, documentation pending.
4613 @table @asis
4614 @item @emph{Description}:
4615 @item @emph{Standard}:
4616 F95 and later
4618 @item @emph{Class}:
4619 Elemental function
4621 @item @emph{Syntax}:
4622 @item @emph{Arguments}:
4623 @item @emph{Return value}:
4624 @item @emph{Example}:
4625 @item @emph{Specific names}:
4627 @item @emph{See also}:
4628 @ref{IBITS}, @ref{IBSET}, @ref{IAND}, @ref{IOR}, @ref{IEOR}
4629 @end table
4634 @node IBITS
4635 @section @code{IBITS} --- Bit extraction
4636 @findex @code{IBITS} intrinsic
4637 @cindex bit operations
4639 Intrinsic implemented, documentation pending.
4641 @table @asis
4642 @item @emph{Description}:
4643 @item @emph{Standard}:
4644 F95 and later
4646 @item @emph{Class}:
4647 Elemental function
4649 @item @emph{Syntax}:
4650 @item @emph{Arguments}:
4651 @item @emph{Return value}:
4652 @item @emph{Example}:
4653 @item @emph{Specific names}:
4654 @item @emph{See also}:
4655 @ref{IBCLR}, @ref{IBSET}, @ref{IAND}, @ref{IOR}, @ref{IEOR}
4657 @end table
4662 @node IBSET
4663 @section @code{IBSET} --- Set bit
4664 @findex @code{IBSET} intrinsic
4665 @cindex bit operations
4667 Intrinsic implemented, documentation pending.
4669 @table @asis
4670 @item @emph{Description}:
4671 @item @emph{Standard}:
4672 F95 and later
4674 @item @emph{Class}:
4675 Elemental function
4677 @item @emph{Syntax}:
4678 @item @emph{Arguments}:
4679 @item @emph{Return value}:
4680 @item @emph{Example}:
4681 @item @emph{Specific names}:
4683 @item @emph{See also}:
4684 @ref{IBCLR}, @ref{IBITS}, @ref{IAND}, @ref{IOR}, @ref{IEOR}
4686 @end table
4690 @node ICHAR
4691 @section @code{ICHAR} --- Character-to-integer conversion function
4692 @findex @code{ICHAR} intrinsic
4693 @cindex conversion function (character)
4695 @table @asis
4696 @item @emph{Description}:
4697 @code{ICHAR(C)} returns the code for the character in the first character
4698 position of @code{C} in the system's native character set.
4699 The correspondence between characters and their codes is not necessarily
4700 the same across different GNU Fortran implementations.
4702 @item @emph{Standard}:
4703 F95 and later
4705 @item @emph{Class}:
4706 Elemental function
4708 @item @emph{Syntax}:
4709 @code{I = ICHAR(C)}
4711 @item @emph{Arguments}:
4712 @multitable @columnfractions .15 .80
4713 @item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)}
4714 @end multitable
4716 @item @emph{Return value}:
4717 The return value is of type @code{INTEGER} and of the default integer
4718 kind.
4720 @item @emph{Example}:
4721 @smallexample
4722 program test_ichar
4723   integer i
4724   i = ichar(' ')
4725 end program test_ichar
4726 @end smallexample
4728 @item @emph{Note}:
4729 No intrinsic exists to convert a printable character string to a numerical
4730 value. For example, there is no intrinsic that, given the @code{CHARACTER}
4731 value 154, returns an @code{INTEGER} or @code{REAL} value with the
4732 value 154.
4734 Instead, you can use internal-file I/O to do this kind of conversion. For
4735 example:
4736 @smallexample
4737 program read_val
4738   integer value
4739   character(len=10) string
4741   string = '154'
4742   read (string,'(I10)') value
4743   print *, value
4744 end program read_val
4745 @end smallexample
4746 @end table
4748 @node IDATE
4749 @section @code{IDATE} --- Get current local time subroutine (day/month/year) 
4750 @findex @code{IDATE} intrinsic
4752 @table @asis
4753 @item @emph{Description}:
4754 @code{IDATE(TARRAY)} Fills @var{TARRAY} with the numerical values at the  
4755 current local time. The day (in the range 1-31), month (in the range 1-12), 
4756 and year appear in elements 1, 2, and 3 of @var{TARRAY}, respectively. 
4757 The year has four significant digits.
4759 @item @emph{Standard}:
4760 GNU extension
4762 @item @emph{Class}:
4763 Subroutine
4765 @item @emph{Syntax}:
4766 @code{CALL IDATE(TARRAY)}
4768 @item @emph{Arguments}:
4769 @multitable @columnfractions .15 .80
4770 @item @var{TARRAY} @tab The type shall be @code{INTEGER, DIMENSION(3)} and
4771 the kind shall be the default integer kind.
4772 @end multitable
4774 @item @emph{Return value}:
4775 Does not return.
4777 @item @emph{Example}:
4778 @smallexample
4779 program test_idate
4780   integer, dimension(3) :: tarray
4781   call idate(tarray)
4782   print *, tarray(1)
4783   print *, tarray(2)
4784   print *, tarray(3)
4785 end program test_idate
4786 @end smallexample
4787 @end table
4791 @node IEOR
4792 @section @code{IEOR} --- Bitwise logical exclusive or
4793 @findex @code{IEOR} intrinsic
4794 @cindex bit operations
4796 Intrinsic implemented, documentation pending.
4798 @table @asis
4799 @item @emph{Description}:
4800 @item @emph{Standard}:
4801 F95 and later
4803 @item @emph{Class}:
4804 Elemental function
4806 @item @emph{Syntax}:
4807 @item @emph{Arguments}:
4808 @item @emph{Return value}:
4809 @item @emph{Example}:
4810 @item @emph{Specific names}:
4812 @item @emph{See also}:
4813 @ref{IOR}, @ref{IAND}, @ref{IBITS}, @ref{IBSET}, @ref{IBCLR},
4814 @end table
4819 @node IERRNO
4820 @section @code{IERRNO} --- Get the last system error number
4821 @findex @code{IERRNO} intrinsic
4822 @cindex undocumented intrinsic 
4824 Intrinsic implemented, documentation pending.
4826 @table @asis
4827 @item @emph{Description}:
4828 @item @emph{Standard}:
4829 GNU extension
4831 @item @emph{Class}:
4832 @item @emph{Syntax}:
4833 @item @emph{Arguments}:
4834 @item @emph{Return value}:
4835 @item @emph{Example}:
4837 @item @emph{See also}:
4838 @ref{PERROR}
4839 @end table
4844 @node INDEX
4845 @section @code{INDEX} --- Position of a substring within a string
4846 @findex @code{INDEX} intrinsic
4847 @cindex undocumented intrinsic 
4849 Intrinsic implemented, documentation pending.
4851 @table @asis
4852 @item @emph{Description}:
4853 @item @emph{Standard}:
4854 F77 and later
4856 @item @emph{Class}:
4857 Elemental function
4859 @item @emph{Syntax}:
4860 @item @emph{Arguments}:
4861 @item @emph{Return value}:
4862 @item @emph{Example}:
4863 @item @emph{Specific names}:
4864 @item @emph{See also}:
4865 @end table
4870 @node INT
4871 @section @code{INT} --- Convert to integer type
4872 @findex @code{INT} intrinsic
4873 @findex @code{IFIX} intrinsic
4874 @findex @code{IDINT} intrinsic
4875 @cindex conversion function (integer)
4877 @table @asis
4878 @item @emph{Description}:
4879 Convert to integer type
4881 @item @emph{Standard}:
4882 F77 and later
4884 @item @emph{Class}:
4885 Elemental function
4887 @item @emph{Syntax}:
4888 @multitable @columnfractions .30 .80
4889 @item @code{X = INT(X)}
4890 @item @code{X = INT(X, KIND)}
4891 @end multitable
4893 @item @emph{Arguments}:
4894 @multitable @columnfractions .15 .80
4895 @item @var{X} @tab shall be of type @code{INTEGER(*)}, @code{REAL(*)} or @code{COMPLEX(*)}
4896 @item @var{KIND}  @tab (Optional) @var{KIND} shall be a scalar integer.
4897 @end multitable
4899 @item @emph{Return value}:
4900 These functions return a @code{INTEGER(*)} variable or array under 
4901 the following rules: 
4903 @table @asis
4904 @item (A)
4905 If @var{X} is of type @code{INTEGER(*)}, @code{INT(X) = X} 
4906 @item (B)
4907 If @var{X} is of type @code{REAL(*)} and @math{|X| < 1} @code{INT(X)} equals @var{0}. 
4908 If @math{|X| \geq 1}, then @code{INT(X)} equals the largest integer that does not exceed 
4909 the range of @var{X} and whose sign is the same as the sign of @var{X}.
4910 @item (C)
4911 If @var{X} is of type @code{COMPLEX(*)}, rule B is applied to the real part of X.
4912 @end table
4914 @item @emph{Example}:
4915 @smallexample
4916 program test_int
4917   integer :: i = 42
4918   complex :: z = (-3.7, 1.0)
4919   print *, int(i)
4920   print *, int(z), int(z,8)
4921 end program
4922 @end smallexample
4924 @item @emph{Specific names}:
4925 @multitable @columnfractions .20 .20 .20 .40
4926 @item Name             @tab Argument            @tab Return type       @tab Standard
4927 @item @code{IFIX(X)}   @tab @code{REAL(4) X}    @tab @code{INTEGER}    @tab F77 and later
4928 @item @code{IDINT(X)}  @tab @code{REAL(8) X}    @tab @code{INTEGER}    @tab F77 and later
4929 @end multitable
4931 @comment @item @emph{See also}:
4932 @end table
4937 @node IOR
4938 @section @code{IOR} --- Bitwise logical or
4939 @findex @code{IOR} intrinsic
4940 @cindex bit operations
4942 Intrinsic implemented, documentation pending.
4944 @table @asis
4945 @item @emph{Description}:
4946 @item @emph{Standard}:
4947 F95 and later
4949 @item @emph{Class}:
4950 Elemental function
4952 @item @emph{Syntax}:
4953 @item @emph{Arguments}:
4954 @item @emph{Return value}:
4955 @item @emph{Example}:
4956 @item @emph{Specific names}:
4958 @item @emph{See also}:
4959 @ref{IEOR}, @ref{IAND}, @ref{IBITS}, @ref{IBSET}, @ref{IBCLR},
4960 @end table
4965 @node IRAND
4966 @section @code{IRAND} --- Integer pseudo-random number
4967 @findex @code{IRAND} intrinsic
4968 @cindex random number
4970 @table @asis
4971 @item @emph{Description}:
4972 @code{IRAND(FLAG)} returns a pseudo-random number from a uniform
4973 distribution between 0 and a system-dependent limit (which is in most
4974 cases 2147483647). If @var{FLAG} is 0, the next number
4975 in the current sequence is returned; if @var{FLAG} is 1, the generator
4976 is restarted by @code{CALL SRAND(0)}; if @var{FLAG} has any other value,
4977 it is used as a new seed with @code{SRAND}.
4979 @item @emph{Standard}:
4980 GNU extension
4982 @item @emph{Class}:
4983 non-elemental function
4985 @item @emph{Syntax}:
4986 @code{I = IRAND(FLAG)}
4988 @item @emph{Arguments}:
4989 @multitable @columnfractions .15 .80
4990 @item @var{FLAG} @tab shall be a scalar @code{INTEGER} of kind 4.
4991 @end multitable
4993 @item @emph{Return value}:
4994 The return value is of @code{INTEGER(kind=4)} type.
4996 @item @emph{Example}:
4997 @smallexample
4998 program test_irand
4999   integer,parameter :: seed = 86456
5000   
5001   call srand(seed)
5002   print *, irand(), irand(), irand(), irand()
5003   print *, irand(seed), irand(), irand(), irand()
5004 end program test_irand
5005 @end smallexample
5007 @end table
5011 @node ISHFT
5012 @section @code{ISHFT} --- Shift bits
5013 @findex @code{ISHFT} intrinsic
5014 @cindex bit manipulation
5016 Intrinsic implemented, documentation pending.
5018 @table @asis
5019 @item @emph{Description}:
5020 @item @emph{Standard}:
5021 F95 and later
5023 @item @emph{Class}:
5024 Elemental function
5026 @item @emph{Syntax}:
5027 @item @emph{Arguments}:
5028 @item @emph{Return value}:
5029 @item @emph{Example}:
5030 @item @emph{Specific names}:
5032 @item @emph{See also}:
5033 @ref{ISHFTC}
5034 @end table
5039 @node ISHFTC
5040 @section @code{ISHFTC} --- Shift bits circularly
5041 @findex @code{ISHFTC} intrinsic
5042 @cindex bit manipulation
5044 Intrinsic implemented, documentation pending.
5046 @table @asis
5047 @item @emph{Description}:
5048 @item @emph{Standard}:
5049 F95 and later
5051 @item @emph{Class}:
5052 Elemental function
5054 @item @emph{Syntax}:
5055 @item @emph{Arguments}:
5056 @item @emph{Return value}:
5057 @item @emph{Example}:
5058 @item @emph{Specific names}:
5060 @item @emph{See also}:
5061 @ref{ISHFT}
5062 @end table
5066 @node ITIME
5067 @section @code{ITIME} --- Get current local time subroutine (hour/minutes/seconds) 
5068 @findex @code{ITIME} intrinsic
5070 @table @asis
5071 @item @emph{Description}:
5072 @code{IDATE(TARRAY)} Fills @var{TARRAY} with the numerical values at the  
5073 current local time. The hour (in the range 1-24), minute (in the range 1-60), 
5074 and seconds (in the range 1-60) appear in elements 1, 2, and 3 of @var{TARRAY}, 
5075 respectively.
5077 @item @emph{Standard}:
5078 GNU extension
5080 @item @emph{Class}:
5081 Subroutine
5083 @item @emph{Syntax}:
5084 @code{CALL ITIME(TARRAY)}
5086 @item @emph{Arguments}:
5087 @multitable @columnfractions .15 .80
5088 @item @var{TARRAY} @tab The type shall be @code{INTEGER, DIMENSION(3)}
5089 and the kind shall be the default integer kind.
5090 @end multitable
5092 @item @emph{Return value}:
5093 Does not return.
5096 @item @emph{Example}:
5097 @smallexample
5098 program test_itime
5099   integer, dimension(3) :: tarray
5100   call itime(tarray)
5101   print *, tarray(1)
5102   print *, tarray(2)
5103   print *, tarray(3)
5104 end program test_itime
5105 @end smallexample
5106 @end table
5110 @node KILL
5111 @section @code{KILL} --- Send a signal to a process
5112 @findex @code{KILL} intrinsic
5113 @cindex undocumented intrinsic 
5115 Intrinsic implemented, documentation pending.
5117 @table @asis
5118 @item @emph{Description}:
5119 @item @emph{Standard}:
5120 GNU extension
5122 @item @emph{Class}:
5123 Subroutine
5125 @item @emph{Syntax}:
5126 @item @emph{Arguments}:
5127 @item @emph{Return value}:
5128 @item @emph{Example}:
5129 @item @emph{Specific names}:
5131 @item @emph{See also}:
5132 @ref{ABORT}, @ref{EXIT}
5133 @end table
5137 @node KIND
5138 @section @code{KIND} --- Kind of an entity
5139 @findex @code{KIND} intrinsic
5141 @table @asis
5142 @item @emph{Description}:
5143 @code{KIND(X)} returns the kind value of the entity @var{X}.
5145 @item @emph{Standard}:
5146 F95 and later
5148 @item @emph{Class}:
5149 Inquiry function
5151 @item @emph{Syntax}:
5152 @code{K = KIND(X)}
5154 @item @emph{Arguments}:
5155 @multitable @columnfractions .15 .80
5156 @item @var{X} @tab Shall be of type @code{LOGICAL}, @code{INTEGER},
5157 @code{REAL}, @code{COMPLEX} or @code{CHARACTER}.
5158 @end multitable
5160 @item @emph{Return value}:
5161 The return value is a scalar of type @code{INTEGER} and of the default
5162 integer kind.
5164 @item @emph{Example}:
5165 @smallexample
5166 program test_kind
5167   integer,parameter :: kc = kind(' ')
5168   integer,parameter :: kl = kind(.true.)
5170   print *, "The default character kind is ", kc
5171   print *, "The default logical kind is ", kl
5172 end program test_kind
5173 @end smallexample
5175 @end table
5179 @node LBOUND
5180 @section @code{LBOUND} --- Lower dimension bounds of an array
5181 @findex @code{LBOUND} intrinsic
5182 @cindex undocumented intrinsic 
5184 Intrinsic implemented, documentation pending.
5186 @table @asis
5187 @item @emph{Description}:
5188 @item @emph{Standard}:
5189 F95 and later
5191 @item @emph{Class}:
5192 Inquiry function
5194 @item @emph{Syntax}:
5195 @item @emph{Arguments}:
5196 @item @emph{Return value}:
5197 @item @emph{Example}:
5198 @item @emph{See also}:
5199 @ref{UBOUND}
5200 @end table
5205 @node LEN
5206 @section @code{LEN} --- Length of a character entity
5207 @findex @code{LEN} intrinsic
5208 @cindex undocumented intrinsic 
5210 Intrinsic implemented, documentation pending.
5212 @table @asis
5213 @item @emph{Description}:
5214 @item @emph{Standard}:
5215 F77 and later
5217 @item @emph{Class}:
5218 Inquiry function
5220 @item @emph{Syntax}:
5221 @item @emph{Arguments}:
5222 @item @emph{Return value}:
5223 @item @emph{Example}:
5224 @item @emph{Specific names}:
5226 @item @emph{See also}:
5227 @ref{LEN_TRIM}, @ref{ADJUSTL}, @ref{ADJUSTR}
5228 @end table
5233 @node LEN_TRIM
5234 @section @code{LEN_TRIM} --- Length of a character entity without trailing blank characters
5235 @findex @code{LEN_TRIM} intrinsic
5236 @cindex undocumented intrinsic 
5238 Intrinsic implemented, documentation pending.
5240 @table @asis
5241 @item @emph{Description}:
5242 @item @emph{Standard}:
5243 F95 and later
5245 @item @emph{Class}:
5246 Elemental function
5248 @item @emph{Syntax}:
5249 @item @emph{Arguments}:
5250 @item @emph{Return value}:
5251 @item @emph{Example}:
5253 @item @emph{See also}:
5254 @ref{LEN}, @ref{ADJUSTL}, @ref{ADJUSTR}
5255 @end table
5260 @node LGE
5261 @section @code{LGE} --- Lexical greater than or equal
5262 @findex @code{LGE} intrinsic
5263 @cindex comparison (lexical)
5265 Intrinsic implemented, documentation pending.
5267 @table @asis
5268 @item @emph{Description}:
5269 @item @emph{Standard}:
5270 F77 and later
5272 @item @emph{Class}:
5273 Elemental function
5275 @item @emph{Syntax}:
5276 @item @emph{Arguments}:
5277 @item @emph{Return value}:
5278 @item @emph{Example}:
5280 @item @emph{See also}:
5281 @ref{LGT}, @ref{LLE}, @ref{LLT}
5282 @end table
5287 @node LGT
5288 @section @code{LGT} --- Lexical greater than
5289 @findex @code{LGT} intrinsic
5290 @cindex comparison (lexical)
5292 Intrinsic implemented, documentation pending.
5294 @table @asis
5295 @item @emph{Description}:
5296 @item @emph{Standard}:
5297 F77 and later
5299 @item @emph{Class}:
5300 Elemental function
5302 @item @emph{Syntax}:
5303 @item @emph{Arguments}:
5304 @item @emph{Return value}:
5305 @item @emph{Example}:
5307 @item @emph{See also}:
5308 @ref{LGE}, @ref{LLE}, @ref{LLT}
5309 @end table
5314 @node LINK
5315 @section @code{LINK} --- Create a hard link
5316 @findex @code{LINK} intrinsic
5317 @cindex file system operations
5319 Intrinsic implemented, documentation pending.
5321 @table @asis
5322 @item @emph{Description}:
5323 @item @emph{Standard}:
5324 GNU extension
5326 @item @emph{Class}:
5327 Subroutine
5329 @item @emph{Syntax}:
5330 @item @emph{Arguments}:
5331 @item @emph{Return value}:
5332 @item @emph{Example}:
5333 @item @emph{Specific names}:
5335 @item @emph{See also}:
5336 @ref{UNLINK}
5337 @end table
5342 @node LLE
5343 @section @code{LLE} --- Lexical less than or equal
5344 @findex @code{LLE} intrinsic
5345 @cindex comparison (lexical)
5347 Intrinsic implemented, documentation pending.
5349 @table @asis
5350 @item @emph{Description}:
5351 @item @emph{Standard}:
5352 F77 and later
5354 @item @emph{Class}:
5355 Elemental function
5357 @item @emph{Syntax}:
5358 @item @emph{Arguments}:
5359 @item @emph{Return value}:
5360 @item @emph{Example}:
5362 @item @emph{See also}:
5363 @ref{LGE}, @ref{LGT}, @ref{LLT}
5364 @end table
5369 @node LLT
5370 @section @code{LLT} --- Lexical less than
5371 @findex @code{LLT} intrinsic
5372 @cindex comparison (lexical)
5374 Intrinsic implemented, documentation pending.
5376 @table @asis
5377 @item @emph{Description}:
5378 @item @emph{Standard}:
5379 F77 and later
5381 @item @emph{Class}:
5382 Elemental function
5384 @item @emph{Syntax}:
5385 @item @emph{Arguments}:
5386 @item @emph{Return value}:
5387 @item @emph{Example}:
5389 @item @emph{See also}:
5390 @ref{LGE}, @ref{LGT}, @ref{LLE}
5391 @end table
5396 @node LNBLNK
5397 @section @code{LNBLNK} --- Index of the last non-blank character in a string
5398 @findex @code{LNBLNK} intrinsic
5399 @cindex undocumented intrinsic 
5401 Intrinsic implemented, documentation pending.
5403 @table @asis
5404 @item @emph{Description}:
5405 @item @emph{Standard}:
5406 GNU extension
5408 @item @emph{Class}:
5409 @item @emph{Syntax}:
5410 @item @emph{Arguments}:
5411 @item @emph{Return value}:
5412 @item @emph{Example}:
5413 @item @emph{Specific names}:
5415 @item @emph{See also}:
5416 @ref{INDEX}, @ref{LEN_TRIM}
5417 @end table
5422 @node LOC
5423 @section @code{LOC} --- Returns the address of a variable
5424 @findex @code{LOC} intrinsic
5425 @cindex loc
5427 @table @asis
5428 @item @emph{Description}:
5429 @code{LOC(X)} returns the address of @var{X} as an integer.
5431 @item @emph{Standard}:
5432 GNU extension
5434 @item @emph{Class}:
5435 Inquiry function
5437 @item @emph{Syntax}:
5438 @code{I = LOC(X)}
5440 @item @emph{Arguments}:
5441 @multitable @columnfractions .15 .80
5442 @item @var{X} @tab Variable of any type.
5443 @end multitable
5445 @item @emph{Return value}:
5446 The return value is of type @code{INTEGER}, with a @code{KIND}
5447 corresponding to the size (in bytes) of a memory address on the target
5448 machine.
5450 @item @emph{Example}:
5451 @smallexample
5452 program test_loc
5453   integer :: i
5454   real :: r
5455   i = loc(r)
5456   print *, i
5457 end program test_loc
5458 @end smallexample
5459 @end table
5461 @node LOG
5462 @section @code{LOG} --- Logarithm function
5463 @findex @code{LOG} intrinsic
5464 @findex @code{ALOG} intrinsic
5465 @findex @code{DLOG} intrinsic
5466 @findex @code{CLOG} intrinsic
5467 @findex @code{ZLOG} intrinsic
5468 @findex @code{CDLOG} intrinsic
5469 @cindex logarithm
5471 @table @asis
5472 @item @emph{Description}:
5473 @code{LOG(X)} computes the logarithm of @var{X}.
5475 @item @emph{Standard}:
5476 F77 and later
5478 @item @emph{Class}:
5479 Elemental function
5481 @item @emph{Syntax}:
5482 @code{X = LOG(X)}
5484 @item @emph{Arguments}:
5485 @multitable @columnfractions .15 .80
5486 @item @var{X} @tab The type shall be @code{REAL(*)} or
5487 @code{COMPLEX(*)}.
5488 @end multitable
5490 @item @emph{Return value}:
5491 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
5492 The kind type parameter is the same as @var{X}.
5494 @item @emph{Example}:
5495 @smallexample
5496 program test_log
5497   real(8) :: x = 1.0_8
5498   complex :: z = (1.0, 2.0)
5499   x = log(x)
5500   z = log(z)
5501 end program test_log
5502 @end smallexample
5504 @item @emph{Specific names}:
5505 @multitable @columnfractions .20 .20 .20 .40
5506 @item Name            @tab Argument          @tab Return type       @tab Standard
5507 @item @code{ALOG(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab f95, gnu
5508 @item @code{DLOG(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
5509 @item @code{CLOG(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
5510 @item @code{ZLOG(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
5511 @item @code{CDLOG(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
5512 @end multitable
5513 @end table
5517 @node LOG10
5518 @section @code{LOG10} --- Base 10 logarithm function
5519 @findex @code{LOG10} intrinsic
5520 @findex @code{ALOG10} intrinsic
5521 @findex @code{DLOG10} intrinsic
5522 @cindex logarithm
5524 @table @asis
5525 @item @emph{Description}:
5526 @code{LOG10(X)} computes the base 10 logarithm of @var{X}.
5528 @item @emph{Standard}:
5529 F77 and later
5531 @item @emph{Class}:
5532 Elemental function
5534 @item @emph{Syntax}:
5535 @code{X = LOG10(X)}
5537 @item @emph{Arguments}:
5538 @multitable @columnfractions .15 .80
5539 @item @var{X} @tab The type shall be @code{REAL(*)} or
5540 @code{COMPLEX(*)}.
5541 @end multitable
5543 @item @emph{Return value}:
5544 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
5545 The kind type parameter is the same as @var{X}.
5547 @item @emph{Example}:
5548 @smallexample
5549 program test_log10
5550   real(8) :: x = 10.0_8
5551   x = log10(x)
5552 end program test_log10
5553 @end smallexample
5555 @item @emph{Specific names}:
5556 @multitable @columnfractions .20 .20 .20 .40
5557 @item Name            @tab Argument          @tab Return type       @tab Standard
5558 @item @code{ALOG10(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab F95 and later
5559 @item @code{DLOG10(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F95 and later
5560 @end multitable
5561 @end table
5564 @node LOGICAL
5565 @section @code{LOGICAL} --- Convert to logical type
5566 @findex @code{LOGICAL} intrinsic
5567 @cindex conversion function (logical)
5569 Intrinsic implemented, documentation pending.
5571 @table @asis
5572 @item @emph{Description}:
5573 @item @emph{Standard}:
5574 F95 and later
5576 @item @emph{Class}:
5577 Elemental function
5579 @item @emph{Syntax}:
5580 @item @emph{Arguments}:
5581 @item @emph{Return value}:
5582 @item @emph{Example}:
5583 @item @emph{Specific names}:
5584 @item @emph{See also}:
5585 @end table
5590 @node LSHIFT
5591 @section @code{LSHIFT} --- Left shift bits
5592 @findex @code{LSHIFT} 
5593 @cindex bit manipulation
5595 Not yet implemented in GNU Fortran.
5597 @table @asis
5598 @item @emph{Description}:
5600 @item @emph{Standard}:
5601 GNU extension
5603 @item @emph{Class}:
5604 Function
5606 @item @emph{Syntax}:
5607 @item @emph{Arguments}:
5608 @item @emph{Return value}:
5609 @item @emph{Example}:
5610 @item @emph{Specific names}:
5611 @item @emph{See also}:
5613 @end table
5616 @node LSTAT
5617 @section @code{LSTAT} --- Get file status
5618 @findex @code{LSTAT} intrinsic
5619 @cindex file system operations 
5621 @table @asis
5622 @item @emph{Description}:
5623 @code{LSTAT} is identical to @ref{STAT}, except that if path is a symbolic link, 
5624 then the link itself is statted, not the file that it refers to.
5626 The elements in @code{BUFF} are the same as described by @ref{STAT}.
5628 @item @emph{Standard}:
5629 GNU extension
5631 @item @emph{Class}:
5632 Non-elemental subroutine
5634 @item @emph{Syntax}:
5635 @code{CALL LSTAT(FILE,BUFF[,STATUS])}
5637 @item @emph{Arguments}:
5638 @multitable @columnfractions .15 .80
5639 @item @var{FILE}   @tab The type shall be @code{CHARACTER(*)}, a valid path within the file system.
5640 @item @var{BUFF}   @tab The type shall be @code{INTEGER(4), DIMENSION(13)}.
5641 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER(4)}. Returns 0 
5642                         on success and a system specific error code otherwise.
5643 @end multitable
5645 @item @emph{Example}:
5646 See @ref{STAT} for an example.
5648 @item @emph{See also}:
5649 To stat an open file: @ref{FSTAT}, to stat a file: @ref{STAT}
5650 @end table
5654 @node LTIME
5655 @section @code{LTIME} --- Convert time to local time info
5656 @findex @code{LTIME} 
5657 @cindex time function
5659 Not yet implemented in GNU Fortran.
5661 @table @asis
5662 @item @emph{Description}:
5664 @item @emph{Standard}:
5665 GNU extension
5667 @item @emph{Class}:
5668 Subroutine
5670 @item @emph{Syntax}:
5671 @item @emph{Arguments}:
5672 @item @emph{Return value}:
5673 @item @emph{Example}:
5674 @item @emph{Specific names}:
5675 @item @emph{See also}:
5677 @end table
5681 @node MALLOC
5682 @section @code{MALLOC} --- Allocate dynamic memory
5683 @findex @code{MALLOC} intrinsic
5684 @cindex MALLOC
5686 @table @asis
5687 @item @emph{Description}:
5688 @code{MALLOC(SIZE)} allocates @var{SIZE} bytes of dynamic memory and
5689 returns the address of the allocated memory. The @code{MALLOC} intrinsic
5690 is an extension intended to be used with Cray pointers, and is provided
5691 in GNU Fortran to allow the user to compile legacy code. For new code
5692 using Fortran 95 pointers, the memory allocation intrinsic is
5693 @code{ALLOCATE}.
5695 @item @emph{Standard}:
5696 GNU extension
5698 @item @emph{Class}:
5699 non-elemental function
5701 @item @emph{Syntax}:
5702 @code{PTR = MALLOC(SIZE)}
5704 @item @emph{Arguments}:
5705 @multitable @columnfractions .15 .80
5706 @item @var{SIZE} @tab The type shall be @code{INTEGER(*)}.
5707 @end multitable
5709 @item @emph{Return value}:
5710 The return value is of type @code{INTEGER(K)}, with @var{K} such that
5711 variables of type @code{INTEGER(K)} have the same size as
5712 C pointers (@code{sizeof(void *)}).
5714 @item @emph{Example}:
5715 The following example demonstrates the use of @code{MALLOC} and
5716 @code{FREE} with Cray pointers. This example is intended to run on
5717 32-bit systems, where the default integer kind is suitable to store
5718 pointers; on 64-bit systems, ptr_x would need to be declared as
5719 @code{integer(kind=8)}.
5721 @smallexample
5722 program test_malloc
5723   integer i
5724   integer ptr_x
5725   real*8 x(*), z
5726   pointer(ptr_x,x)
5728   ptr_x = malloc(20*8)
5729   do i = 1, 20
5730     x(i) = sqrt(1.0d0 / i)
5731   end do
5732   z = 0
5733   do i = 1, 20
5734     z = z + x(i)
5735     print *, z
5736   end do
5737   call free(ptr_x)
5738 end program test_malloc
5739 @end smallexample
5741 @item @emph{See also}:
5742 @ref{FREE}
5743 @end table
5746 @node MATMUL
5747 @section @code{MATMUL} --- matrix multiplication
5748 @findex @code{MATMUL} intrinsic
5749 @cindex matrix operations
5751 Intrinsic implemented, documentation pending.
5753 @table @asis
5754 @item @emph{Description}:
5755 @item @emph{Standard}:
5756 F95 and later
5758 @item @emph{Class}:
5759 Transformational function
5761 @item @emph{Syntax}:
5762 @item @emph{Arguments}:
5763 @item @emph{Return value}:
5764 @item @emph{Example}:
5765 @item @emph{See also}:
5766 @end table
5769 @node MAX
5770 @section @code{MAX} --- Maximum value of an argument list
5771 @findex @code{MAX} intrinsic
5772 @cindex undocumented intrinsic 
5774 Intrinsic implemented, documentation pending.
5776 @table @asis
5777 @item @emph{Description}:
5778 @item @emph{Standard}:
5779 F77 and later
5781 @item @emph{Class}:
5782 Elemental function
5784 @item @emph{Syntax}:
5785 @item @emph{Arguments}:
5786 @item @emph{Return value}:
5787 @item @emph{Example}:
5789 @item @emph{Specific names}:
5790 @multitable @columnfractions .20 .20 .20 .40
5791 @item Name             @tab Argument            @tab Return type         @tab Standard
5792 @item @code{MAX0(I)}   @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)}   @tab F77 and later
5793 @item @code{AMAX0(I)}  @tab @code{INTEGER(4) I} @tab @code{REAL(MAX(X))} @tab F77 and later
5794 @item @code{MAX1(X)}   @tab @code{REAL(*) X}    @tab @code{INT(MAX(X))}  @tab F77 and later
5795 @item @code{AMAX1(X)}  @tab @code{REAL(4)    X} @tab @code{REAL(4)}      @tab F77 and later
5796 @item @code{DMAX1(X)}  @tab @code{REAL(8)    X} @tab @code{REAL(8)}      @tab F77 and later
5797 @end multitable
5799 @item @emph{See also}:
5800 @ref{MAXLOC} @ref{MAXVAL}
5801 @end table
5804 @node MAXEXPONENT
5805 @section @code{MAXEXPONENT} --- Maximum exponent of a real kind
5806 @findex @code{MAXEXPONENT} intrinsic
5807 @cindex MAXEXPONENT
5809 @table @asis
5810 @item @emph{Description}:
5811 @code{MAXEXPONENT(X)} returns the maximum exponent in the model of the
5812 type of @code{X}.
5814 @item @emph{Standard}:
5815 F95 and later
5817 @item @emph{Class}:
5818 Inquiry function
5820 @item @emph{Syntax}:
5821 @code{I = MAXEXPONENT(X)}
5823 @item @emph{Arguments}:
5824 @multitable @columnfractions .15 .80
5825 @item @var{X} @tab shall be of type @code{REAL}.
5826 @end multitable
5828 @item @emph{Return value}:
5829 The return value is of type @code{INTEGER} and of the default integer
5830 kind.
5832 @item @emph{Example}:
5833 @smallexample
5834 program exponents
5835   real(kind=4) :: x
5836   real(kind=8) :: y
5838   print *, minexponent(x), maxexponent(x)
5839   print *, minexponent(y), maxexponent(y)
5840 end program exponents
5841 @end smallexample
5842 @end table
5845 @node MAXLOC
5846 @section @code{MAXLOC} --- Location of the maximum value within an array
5847 @findex @code{MAXLOC} intrinsic
5848 @cindex undocumented intrinsic 
5850 Intrinsic implemented, documentation pending.
5852 @table @asis
5853 @item @emph{Description}:
5854 @item @emph{Standard}:
5855 F95 and later
5857 @item @emph{Class}:
5858 Transformational function
5860 @item @emph{Syntax}:
5861 @item @emph{Arguments}:
5862 @item @emph{Return value}:
5863 @item @emph{Example}:
5864 @item @emph{See also}:
5865 @ref{MAX}, @ref{MAXVAL}
5866 @end table
5870 @node MAXVAL
5871 @section @code{MAXVAL} --- Maximum value of an array
5872 @findex @code{MAXVAL} intrinsic
5873 @cindex undocumented intrinsic 
5875 Intrinsic implemented, documentation pending.
5877 @table @asis
5878 @item @emph{Description}:
5879 @item @emph{Standard}:
5882 @item @emph{Class}:
5883 Transformational function
5885 @item @emph{Syntax}:
5886 @item @emph{Arguments}:
5887 @item @emph{Return value}:
5888 @item @emph{Example}:
5889 @item @emph{Specific names}:
5891 @item @emph{See also}:
5892 @ref{MAX}, @ref{MAXLOC}
5893 @end table
5898 @node MERGE
5899 @section @code{MERGE} --- Merge arrays
5900 @findex @code{MERGE} intrinsic
5901 @cindex undocumented intrinsic 
5903 Intrinsic implemented, documentation pending.
5905 @table @asis
5906 @item @emph{Description}:
5907 @item @emph{Standard}:
5908 F95 and later
5910 @item @emph{Class}:
5911 elemental function
5913 @item @emph{Syntax}:
5914 @item @emph{Arguments}:
5915 @item @emph{Return value}:
5916 @item @emph{Example}:
5917 @item @emph{Specific names}:
5918 @item @emph{See also}:
5919 @end table
5922 @node MIN
5923 @section @code{MIN} --- Minimum value of an argument list
5924 @findex @code{MIN} intrinsic
5925 @cindex undocumented intrinsic 
5927 Intrinsic implemented, documentation pending.
5929 @table @asis
5930 @item @emph{Description}:
5931 @item @emph{Standard}:
5932 F77 and later
5934 @item @emph{Class}:
5935 Elemental function
5937 @item @emph{Syntax}:
5938 @item @emph{Arguments}:
5939 @item @emph{Return value}:
5940 @item @emph{Example}:
5942 @item @emph{Specific names}:
5943 @multitable @columnfractions .20 .20 .20 .40
5944 @item Name             @tab Argument            @tab Return type         @tab Standard
5945 @item @code{MIN0(I)}   @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)}   @tab F77 and later
5946 @item @code{AMIN0(I)}  @tab @code{INTEGER(4) I} @tab @code{REAL(MIN(X))} @tab F77 and later
5947 @item @code{MIN1(X)}   @tab @code{REAL(*) X}    @tab @code{INT(MIN(X))}  @tab F77 and later
5948 @item @code{AMIN1(X)}  @tab @code{REAL(4)    X} @tab @code{REAL(4)}      @tab F77 and later
5949 @item @code{DMIN1(X)}  @tab @code{REAL(8)    X} @tab @code{REAL(8)}      @tab F77 and later
5950 @end multitable
5952 @item @emph{See also}:
5953 @ref{MINLOC}, @ref{MINVAL}
5954 @end table
5956 @node MINEXPONENT
5957 @section @code{MINEXPONENT} --- Minimum exponent of a real kind
5958 @findex @code{MINEXPONENT} intrinsic
5959 @cindex MINEXPONENT
5961 @table @asis
5962 @item @emph{Description}:
5963 @code{MINEXPONENT(X)} returns the minimum exponent in the model of the
5964 type of @code{X}.
5966 @item @emph{Standard}:
5967 F95 and later
5969 @item @emph{Class}:
5970 Inquiry function
5972 @item @emph{Syntax}:
5973 @code{I = MINEXPONENT(X)}
5975 @item @emph{Arguments}:
5976 @multitable @columnfractions .15 .80
5977 @item @var{X} @tab shall be of type @code{REAL}.
5978 @end multitable
5980 @item @emph{Return value}:
5981 The return value is of type @code{INTEGER} and of the default integer
5982 kind.
5984 @item @emph{Example}:
5985 See @code{MAXEXPONENT} for an example.
5986 @end table
5989 @node MINLOC
5990 @section @code{MINLOC} --- Location of the minimum value within an array
5991 @findex @code{MINLOC} intrinsic
5992 @cindex undocumented intrinsic 
5994 Intrinsic implemented, documentation pending.
5996 @table @asis
5997 @item @emph{Description}:
5998 @item @emph{Standard}:
5999 F95 and later
6001 @item @emph{Class}:
6002 Transformational function
6004 @item @emph{Syntax}:
6005 @item @emph{Arguments}:
6006 @item @emph{Return value}:
6007 @item @emph{Example}:
6009 @item @emph{See also}:
6010 @ref{MIN}, @ref{MINVAL}
6012 @end table
6015 @node MINVAL
6016 @section @code{MINVAL} --- Minimum value of an array
6017 @findex @code{MINVAL} intrinsic
6018 @cindex undocumented intrinsic 
6020 Intrinsic implemented, documentation pending.
6022 @table @asis
6023 @item @emph{Description}:
6024 @item @emph{Standard}:
6025 F95 and later
6027 @item @emph{Class}:
6028 Transformational function
6030 @item @emph{Syntax}:
6031 @item @emph{Arguments}:
6032 @item @emph{Return value}:
6033 @item @emph{Example}:
6035 @item @emph{See also}:
6036 @ref{MIN}, @ref{MINLOC}
6037 @end table
6042 @node MOD
6043 @section @code{MOD} --- Remainder function
6044 @findex @code{MOD} intrinsic
6045 @findex @code{AMOD} intrinsic
6046 @findex @code{DMOD} intrinsic
6047 @cindex remainder
6049 @table @asis
6050 @item @emph{Description}:
6051 @code{MOD(A,P)} computes the remainder of the division of A by P. It is
6052 calculated as @code{A - (INT(A/P) * P)}.
6054 @item @emph{Standard}:
6055 F77 and later
6057 @item @emph{Class}:
6058 Elemental function
6060 @item @emph{Syntax}:
6061 @code{X = MOD(A,P)}
6063 @item @emph{Arguments}:
6064 @multitable @columnfractions .15 .80
6065 @item @var{A} @tab shall be a scalar of type @code{INTEGER} or @code{REAL}
6066 @item @var{P} @tab shall be a scalar of the same type as @var{A} and not
6067 equal to zero
6068 @end multitable
6070 @item @emph{Return value}:
6071 The kind of the return value is the result of cross-promoting
6072 the kinds of the arguments.
6074 @item @emph{Example}:
6075 @smallexample
6076 program test_mod
6077   print *, mod(17,3)
6078   print *, mod(17.5,5.5)
6079   print *, mod(17.5d0,5.5)
6080   print *, mod(17.5,5.5d0)
6082   print *, mod(-17,3)
6083   print *, mod(-17.5,5.5)
6084   print *, mod(-17.5d0,5.5)
6085   print *, mod(-17.5,5.5d0)
6087   print *, mod(17,-3)
6088   print *, mod(17.5,-5.5)
6089   print *, mod(17.5d0,-5.5)
6090   print *, mod(17.5,-5.5d0)
6091 end program test_mod
6092 @end smallexample
6094 @item @emph{Specific names}:
6095 @multitable @columnfractions .20 .20 .20 .40
6096 @item Name             @tab Arguments      @tab Return type    @tab Standard
6097 @item @code{AMOD(A,P)} @tab @code{REAL(4)} @tab @code{REAL(4)} @tab F95 and later
6098 @item @code{DMOD(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab F95 and later
6099 @end multitable
6100 @end table
6104 @node MODULO
6105 @section @code{MODULO} --- Modulo function
6106 @findex @code{MODULO} intrinsic
6107 @cindex modulo
6109 @table @asis
6110 @item @emph{Description}:
6111 @code{MODULO(A,P)} computes the @var{A} modulo @var{P}.
6113 @item @emph{Standard}:
6114 F95 and later
6116 @item @emph{Class}:
6117 Elemental function
6119 @item @emph{Syntax}:
6120 @code{X = MODULO(A,P)}
6122 @item @emph{Arguments}:
6123 @multitable @columnfractions .15 .80
6124 @item @var{A} @tab shall be a scalar of type @code{INTEGER} or @code{REAL}
6125 @item @var{P} @tab shall be a scalar of the same type and kind as @var{A}
6126 @end multitable
6128 @item @emph{Return value}:
6129 The type and kind of the result are those of the arguments.
6130 @table @asis
6131 @item If @var{A} and @var{P} are of type @code{INTEGER}:
6132 @code{MODULO(A,P)} has the value @var{R} such that @code{A=Q*P+R}, where
6133 @var{Q} is an integer and @var{R} is between 0 (inclusive) and @var{P}
6134 (exclusive).
6135 @item If @var{A} and @var{P} are of type @code{REAL}:
6136 @code{MODULO(A,P)} has the value of @code{A - FLOOR (A / P) * P}.
6137 @end table
6138 In all cases, if @var{P} is zero the result is processor-dependent.
6140 @item @emph{Example}:
6141 @smallexample
6142 program test_modulo
6143   print *, modulo(17,3)
6144   print *, modulo(17.5,5.5)
6146   print *, modulo(-17,3)
6147   print *, modulo(-17.5,5.5)
6149   print *, modulo(17,-3)
6150   print *, modulo(17.5,-5.5)
6151 end program test_mod
6152 @end smallexample
6154 @end table
6158 @node MVBITS
6159 @section @code{MVBITS} --- Move bits from one integer to another
6160 @findex @code{MVBITS} intrinsic
6161 @cindex bit operations
6163 Intrinsic implemented, documentation pending.
6165 @table @asis
6166 @item @emph{Description}:
6167 @item @emph{Standard}:
6168 F95 and later
6170 @item @emph{Class}:
6171 Elemental subroutine
6173 @item @emph{Syntax}:
6174 @item @emph{Arguments}:
6175 @item @emph{Return value}:
6176 @item @emph{Example}:
6177 @item @emph{See also}:
6178 @end table
6183 @node MOVE_ALLOC
6184 @section @code{MOVE_ALLOC} --- Move allocation from one object to another
6185 @findex @code{MOVE_ALLOC} intrinsic
6186 @cindex MOVE_ALLOC
6188 @table @asis
6189 @item @emph{Description}:
6190 @code{MOVE_ALLOC(SRC, DEST)} moves the allocation from @var{SRC} to
6191 @var{DEST}.  @var{SRC} will become deallocated in the process.
6193 @item @emph{Standard}:
6194 F2003 and later
6196 @item @emph{Class}:
6197 Subroutine
6199 @item @emph{Syntax}:
6200 @code{CALL MOVE_ALLOC(SRC, DEST)}
6202 @item @emph{Arguments}:
6203 @multitable @columnfractions .15 .80
6204 @item @var{SRC} @tab @code{ALLOCATABLE}, @code{INTENT(INOUT)}, may be of any type and kind.
6205 @item @var{DEST} @tab @code{ALLOCATABLE}, @code{INTENT(OUT)}, shall be of the same type, kind and rank as @var{SRC}
6206 @end multitable
6208 @item @emph{Return value}:
6209 None
6211 @item @emph{Example}:
6212 @smallexample
6213 program test_move_alloc
6214     integer, allocatable :: a(:), b(:)
6216     allocate(a(3))
6217     a = [ 1, 2, 3 ]
6218     call move_alloc(a, b)
6219     print *, allocated(a), allocated(b)
6220     print *, b
6221 end program test_move_alloc
6222 @end smallexample
6223 @end table
6227 @node NEAREST
6228 @section @code{NEAREST} --- Nearest representable number
6229 @findex @code{NEAREST} intrinsic
6230 @cindex processor-representable number
6232 @table @asis
6233 @item @emph{Description}:
6234 @code{NEAREST(X, S)} returns the processor-representable number nearest
6235 to @code{X} in the direction indicated by the sign of @code{S}.
6237 @item @emph{Standard}:
6238 F95 and later
6240 @item @emph{Class}:
6241 Elemental function
6243 @item @emph{Syntax}:
6244 @code{Y = NEAREST(X, S)}
6246 @item @emph{Arguments}:
6247 @multitable @columnfractions .15 .80
6248 @item @var{X} @tab shall be of type @code{REAL}.
6249 @item @var{S} @tab (Optional) shall be of type @code{REAL} and
6250 not equal to zero.
6251 @end multitable
6253 @item @emph{Return value}:
6254 The return value is of the same type as @code{X}. If @code{S} is
6255 positive, @code{NEAREST} returns the processor-representable number
6256 greater than @code{X} and nearest to it. If @code{S} is negative,
6257 @code{NEAREST} returns the processor-representable number smaller than
6258 @code{X} and nearest to it.
6260 @item @emph{Example}:
6261 @smallexample
6262 program test_nearest
6263   real :: x, y
6264   x = nearest(42.0, 1.0)
6265   y = nearest(42.0, -1.0)
6266   write (*,"(3(G20.15))") x, y, x - y
6267 end program test_nearest
6268 @end smallexample
6269 @end table
6273 @node NEW_LINE
6274 @section @code{NEW_LINE} --- New line character
6275 @findex @code{NEW_LINE} intrinsic
6276 @findex @code{NEW_LINE} intrinsic
6278 @table @asis
6279 @item @emph{Description}:
6280 @code{NEW_LINE(C)} returns the new-line character
6282 @item @emph{Standard}:
6283 F2003 and later
6285 @item @emph{Class}:
6286 Elemental function
6288 @item @emph{Syntax}:
6289 @code{C = NEW_LINE(C)}
6291 @item @emph{Arguments}:
6292 @multitable @columnfractions .15 .80
6293 @item @var{C}    @tab The argument shall be a scalar or array of the
6294                       type @code{CHARACTER}.
6295 @end multitable
6297 @item @emph{Return value}:
6298 Returns a @var{CHARACTER} scalar of length one with the new-line character of
6299 the same kind as parameter @var{C}.
6301 @item @emph{Example}:
6302 @smallexample
6303 program newline
6304   implicit none
6305   write(*,'(A)') 'This is record 1.'//NEW_LINE('A')//'This is record 2.'
6306 end program newline
6307 @end smallexample
6308 @end table
6312 @node NINT
6313 @section @code{NINT} --- Nearest whole number
6314 @findex @code{NINT} intrinsic
6315 @findex @code{IDNINT} intrinsic
6316 @cindex whole number
6318 @table @asis
6319 @item @emph{Description}:
6320 @code{NINT(X)} rounds its argument to the nearest whole number.
6322 @item @emph{Standard}:
6323 F77 and later
6325 @item @emph{Class}:
6326 Elemental function
6328 @item @emph{Syntax}:
6329 @code{X = NINT(X)}
6331 @item @emph{Arguments}:
6332 @multitable @columnfractions .15 .80
6333 @item @var{X}    @tab The type of the argument shall be @code{REAL}.
6334 @end multitable
6336 @item @emph{Return value}:
6337 Returns @var{A} with the fractional portion of its magnitude eliminated by
6338 rounding to the nearest whole number and with its sign preserved,
6339 converted to an @code{INTEGER} of the default kind.
6341 @item @emph{Example}:
6342 @smallexample
6343 program test_nint
6344   real(4) x4
6345   real(8) x8
6346   x4 = 1.234E0_4
6347   x8 = 4.321_8
6348   print *, nint(x4), idnint(x8)
6349 end program test_nint
6350 @end smallexample
6352 @item @emph{Specific names}:
6353 @multitable @columnfractions .33 .33 .33
6354 @item Name             @tab Argument         @tab Standard
6355 @item @code{IDNINT(X)} @tab @code{REAL(8)}   @tab F95 and later
6356 @end multitable
6358 @item @emph{See also}:
6359 @ref{CEILING}, @ref{FLOOR}
6361 @end table
6364 @node NOT
6365 @section @code{NOT} --- Logical negation
6366 @findex @code{NOT} intrinsic
6367 @cindex logical operations
6369 Intrinsic implemented, documentation pending.
6371 @table @asis
6372 @item @emph{Description}:
6373 @item @emph{Standard}:
6374 F77 and later
6376 @item @emph{Class}:
6377 Elemental function
6379 @item @emph{Syntax}:
6380 @item @emph{Arguments}:
6381 @item @emph{Return value}:
6382 @item @emph{Example}:
6383 @item @emph{See also}:
6384 @end table
6389 @node NULL
6390 @section @code{NULL} --- Function that returns an disassociated pointer
6391 @findex @code{NULL} intrinsic
6392 @cindex undocumented intrinsic 
6394 Intrinsic implemented, documentation pending.
6396 @table @asis
6397 @item @emph{Description}:
6398 @item @emph{Standard}:
6399 F95 and later
6401 @item @emph{Class}:
6402 Transformational function
6404 @item @emph{Syntax}:
6405 @item @emph{Arguments}:
6406 @item @emph{Return value}:
6407 @item @emph{Example}:
6408 @item @emph{See also}:
6409 @ref{ASSOCIATED}
6410 @end table
6415 @node OR
6416 @section @code{OR} --- Bitwise logical OR
6417 @findex @code{OR} intrinsic
6418 @cindex bit operations
6420 @table @asis
6421 @item @emph{Description}:
6422 Bitwise logical @code{OR}.
6424 This intrinsic routine is provided for backwards compatibility with 
6425 GNU Fortran 77.  For integer arguments, programmers should consider
6426 the use of the @ref{IOR} intrinsic defined by the Fortran standard.
6428 @item @emph{Standard}:
6429 GNU extension
6431 @item @emph{Class}:
6432 Non-elemental function
6434 @item @emph{Syntax}:
6435 @code{RESULT = OR(X, Y)}
6437 @item @emph{Arguments}:
6438 @multitable @columnfractions .15 .80
6439 @item @var{X} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
6440 @item @var{Y} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
6441 @end multitable
6443 @item @emph{Return value}:
6444 The return type is either @code{INTEGER(*)} or @code{LOGICAL} 
6445 after cross-promotion of the arguments.
6447 @item @emph{Example}:
6448 @smallexample
6449 PROGRAM test_or
6450   LOGICAL :: T = .TRUE., F = ..FALSE.
6451   INTEGER :: a, b
6452   DATA a / Z'F' /, b / Z'3' /
6454   WRITE (*,*) OR(T, T), OR(T, F), OR(F, T), OR(F, F)
6455   WRITE (*,*) OR(a, b)
6456 END PROGRAM
6457 @end smallexample
6459 @item @emph{See also}:
6460 F95 elemental function: @ref{IOR}
6461 @end table
6466 @node PACK
6467 @section @code{PACK} --- Pack an array into an array of rank one
6468 @findex @code{PACK} intrinsic
6469 @cindex undocumented intrinsic 
6471 Intrinsic implemented, documentation pending.
6473 @table @asis
6474 @item @emph{Description}:
6475 @item @emph{Standard}:
6476 F95 and later
6478 @item @emph{Class}:
6479 Transformational function
6481 @item @emph{Syntax}:
6482 @item @emph{Arguments}:
6483 @item @emph{Return value}:
6484 @item @emph{Example}:
6485 @item @emph{Specific names}:
6486 @item @emph{See also}:
6487 @ref{UNPACK}
6488 @end table
6493 @node PERROR
6494 @section @code{PERROR} --- Print system error message
6495 @findex @code{PERROR} intrinsic
6496 @cindex undocumented intrinsic 
6498 Intrinsic implemented, documentation pending.
6500 @table @asis
6501 @item @emph{Description}:
6502 @item @emph{Standard}:
6503 GNU extension
6505 @item @emph{Class}:
6506 Subroutine
6508 @item @emph{Syntax}:
6509 @item @emph{Arguments}:
6510 @item @emph{Return value}:
6511 @item @emph{Example}:
6512 @item @emph{Specific names}:
6513 @item @emph{See also}:
6514 @ref{IERRNO}
6515 @end table
6520 @node PRECISION
6521 @section @code{PRECISION} --- Decimal precision of a real kind
6522 @findex @code{PRECISION} intrinsic
6523 @cindex PRECISION
6525 @table @asis
6526 @item @emph{Description}:
6527 @code{PRECISION(X)} returns the decimal precision in the model of the
6528 type of @code{X}.
6530 @item @emph{Standard}:
6531 F95 and later
6533 @item @emph{Class}:
6534 Inquiry function
6536 @item @emph{Syntax}:
6537 @code{I = PRECISION(X)}
6539 @item @emph{Arguments}:
6540 @multitable @columnfractions .15 .80
6541 @item @var{X} @tab shall be of type @code{REAL} or @code{COMPLEX}.
6542 @end multitable
6544 @item @emph{Return value}:
6545 The return value is of type @code{INTEGER} and of the default integer
6546 kind.
6548 @item @emph{Example}:
6549 @smallexample
6550 program prec_and_range
6551   real(kind=4) :: x(2)
6552   complex(kind=8) :: y
6554   print *, precision(x), range(x)
6555   print *, precision(y), range(y)
6556 end program prec_and_range
6557 @end smallexample
6558 @end table
6562 @node PRESENT
6563 @section @code{PRESENT} --- Determine whether an optional argument is specified
6564 @findex @code{PRESENT} intrinsic
6565 @cindex undocumented intrinsic 
6567 Intrinsic implemented, documentation pending.
6569 @table @asis
6570 @item @emph{Description}:
6571 @item @emph{Standard}:
6572 F95 and later
6574 @item @emph{Class}:
6575 Inquiry function
6577 @item @emph{Syntax}:
6578 @item @emph{Arguments}:
6579 @item @emph{Return value}:
6580 @item @emph{Example}:
6581 @item @emph{See also}:
6582 @end table
6587 @node PRODUCT
6588 @section @code{PRODUCT} --- Product of array elements
6589 @findex @code{PRODUCT} intrinsic
6590 @cindex undocumented intrinsic 
6592 Intrinsic implemented, documentation pending.
6594 @table @asis
6595 @item @emph{Description}:
6596 @item @emph{Standard}:
6597 F95 and later
6599 @item @emph{Class}:
6600 Transformational function
6602 @item @emph{Syntax}:
6603 @item @emph{Arguments}:
6604 @item @emph{Return value}:
6605 @item @emph{Example}:
6606 @item @emph{Specific names}:
6607 @item @emph{See also}:
6608 @ref{SUM}
6609 @end table
6614 @node RADIX
6615 @section @code{RADIX} --- Base of a model number
6616 @findex @code{RADIX} intrinsic
6617 @cindex base
6619 @table @asis
6620 @item @emph{Description}:
6621 @code{RADIX(X)} returns the base of the model representing the entity @var{X}.
6623 @item @emph{Standard}:
6624 F95 and later
6626 @item @emph{Class}:
6627 Inquiry function
6629 @item @emph{Syntax}:
6630 @code{R = RADIX(X)}
6632 @item @emph{Arguments}:
6633 @multitable @columnfractions .15 .80
6634 @item @var{X} @tab Shall be of type @code{INTEGER} or @code{REAL}
6635 @end multitable
6637 @item @emph{Return value}:
6638 The return value is a scalar of type @code{INTEGER} and of the default
6639 integer kind.
6641 @item @emph{Example}:
6642 @smallexample
6643 program test_radix
6644   print *, "The radix for the default integer kind is", radix(0)
6645   print *, "The radix for the default real kind is", radix(0.0)
6646 end program test_radix
6647 @end smallexample
6649 @end table
6653 @node RANDOM_NUMBER
6654 @section @code{RANDOM_NUMBER} --- Pseudo-random number
6655 @findex @code{RANDOM_NUMBER} intrinsic
6656 @cindex random numbers
6658 Intrinsic implemented, documentation pending.
6660 @table @asis
6661 @item @emph{Description}:
6662 @item @emph{Standard}:
6663 F95 and later
6665 @item @emph{Class}:
6666 Elemental subroutine
6668 @item @emph{Syntax}:
6669 @item @emph{Arguments}:
6670 @item @emph{Return value}:
6671 @item @emph{Example}:
6672 @item @emph{See also}:
6673 @ref{RANDOM_SEED}
6674 @end table
6679 @node RANDOM_SEED
6680 @section @code{RANDOM_SEED} --- Initialize a pseudo-random number sequence
6681 @findex @code{RANDOM_SEED} intrinsic
6682 @cindex random numbers
6684 Intrinsic implemented, documentation pending.
6686 @table @asis
6687 @item @emph{Description}:
6688 @item @emph{Standard}:
6689 F95 and later
6691 @item @emph{Class}:
6692 Subroutine
6694 @item @emph{Syntax}:
6695 @item @emph{Arguments}:
6696 @item @emph{Return value}:
6697 @item @emph{Example}:
6698 @item @emph{See also}:
6699 @ref{RANDOM_NUMBER}
6700 @end table
6705 @node RAND
6706 @section @code{RAND} --- Real pseudo-random number
6707 @findex @code{RAND} intrinsic
6708 @findex @code{RAN} intrinsic
6709 @cindex random number
6711 @table @asis
6712 @item @emph{Description}:
6713 @code{RAND(FLAG)} returns a pseudo-random number from a uniform
6714 distribution between 0 and 1. If @var{FLAG} is 0, the next number
6715 in the current sequence is returned; if @var{FLAG} is 1, the generator
6716 is restarted by @code{CALL SRAND(0)}; if @var{FLAG} has any other value,
6717 it is used as a new seed with @code{SRAND}.
6719 @item @emph{Standard}:
6720 GNU extension
6722 @item @emph{Class}:
6723 non-elemental function
6725 @item @emph{Syntax}:
6726 @code{X = RAND(FLAG)}
6728 @item @emph{Arguments}:
6729 @multitable @columnfractions .15 .80
6730 @item @var{FLAG} @tab shall be a scalar @code{INTEGER} of kind 4.
6731 @end multitable
6733 @item @emph{Return value}:
6734 The return value is of @code{REAL} type and the default kind.
6736 @item @emph{Example}:
6737 @smallexample
6738 program test_rand
6739   integer,parameter :: seed = 86456
6740   
6741   call srand(seed)
6742   print *, rand(), rand(), rand(), rand()
6743   print *, rand(seed), rand(), rand(), rand()
6744 end program test_rand
6745 @end smallexample
6747 @item @emph{Note}:
6748 For compatibility with HP FORTRAN 77/iX, the @code{RAN} intrinsic is
6749 provided as an alias for @code{RAND}.
6751 @item @emph{See also}:
6752 @ref{SRAND}, @ref{RANDOM_NUMBER}
6754 @end table
6758 @node RANGE
6759 @section @code{RANGE} --- Decimal exponent range of a real kind
6760 @findex @code{RANGE} intrinsic
6761 @cindex RANGE
6763 @table @asis
6764 @item @emph{Description}:
6765 @code{RANGE(X)} returns the decimal exponent range in the model of the
6766 type of @code{X}.
6768 @item @emph{Standard}:
6769 F95 and later
6771 @item @emph{Class}:
6772 Inquiry function
6774 @item @emph{Syntax}:
6775 @code{I = RANGE(X)}
6777 @item @emph{Arguments}:
6778 @multitable @columnfractions .15 .80
6779 @item @var{X} @tab shall be of type @code{REAL} or @code{COMPLEX}.
6780 @end multitable
6782 @item @emph{Return value}:
6783 The return value is of type @code{INTEGER} and of the default integer
6784 kind.
6786 @item @emph{Example}:
6787 See @code{PRECISION} for an example.
6788 @end table
6792 @node RAN
6793 @section @code{RAN} --- Real pseudo-random number
6794 @findex @code{RAN} intrinsic
6795 @cindex random number
6797 @table @asis
6798 @item @emph{Standard}:
6799 GNU extension
6801 @item @emph{See also}:
6802 @ref{RAND}, @ref{RANDOM_NUMBER}
6803 @end table
6807 @node REAL
6808 @section @code{REAL} --- Convert to real type 
6809 @findex @code{REAL} intrinsic
6810 @findex @code{REALPART} intrinsic
6811 @cindex true values
6813 @table @asis
6814 @item @emph{Description}:
6815 @code{REAL(X [, KIND])} converts its argument @var{X} to a real type.  The
6816 @code{REALPART(X)} function is provided for compatibility with @command{g77},
6817 and its use is strongly discouraged.
6819 @item @emph{Standard}:
6820 F77 and later
6822 @item @emph{Class}:
6823 Elemental function
6825 @item @emph{Syntax}:
6826 @multitable @columnfractions .30 .80
6827 @item @code{X = REAL(X)}
6828 @item @code{X = REAL(X, KIND)}
6829 @item @code{X = REALPART(Z)}
6830 @end multitable
6832 @item @emph{Arguments}:
6833 @multitable @columnfractions .15 .80
6834 @item @var{X} @tab shall be @code{INTEGER(*)}, @code{REAL(*)}, or  
6835 @code{COMPLEX(*)}.
6836 @item @var{KIND}  @tab (Optional) @var{KIND} shall be a scalar integer.
6837 @end multitable
6839 @item @emph{Return value}:
6840 These functions return a @code{REAL(*)} variable or array under
6841 the following rules: 
6843 @table @asis
6844 @item (A)
6845 @code{REAL(X)} is converted to a default real type if @var{X} is an 
6846 integer or real variable.
6847 @item (B)
6848 @code{REAL(X)} is converted to a real type with the kind type parameter
6849 of @var{X} if @var{X} is a complex variable.
6850 @item (C)
6851 @code{REAL(X, KIND)} is converted to a real type with kind type
6852 parameter @var{KIND} if @var{X} is a complex, integer, or real
6853 variable.
6854 @end table
6856 @item @emph{Example}:
6857 @smallexample
6858 program test_real
6859   complex :: x = (1.0, 2.0)
6860   print *, real(x), real(x,8), realpart(x)
6861 end program test_real
6862 @end smallexample
6864 @item @emph{See also}:
6865 @ref{DBLE}, @ref{DFLOAT}, @ref{FLOAT}
6867 @end table
6870 @node RENAME
6871 @section @code{RENAME} --- Rename a file
6872 @findex @code{RENAME} intrinsic
6873 @cindex file system operations
6875 Intrinsic implemented, documentation pending.
6877 @table @asis
6878 @item @emph{Description}:
6879 @item @emph{Standard}:
6880 GNU extension
6882 @item @emph{Class}:
6883 Subroutine
6885 @item @emph{Syntax}:
6886 @item @emph{Arguments}:
6887 @item @emph{Return value}:
6888 @item @emph{Example}:
6889 @item @emph{See also}:
6890 @end table
6895 @node REPEAT
6896 @section @code{REPEAT} --- Repeated string concatenation 
6897 @findex @code{REPEAT} intrinsic
6898 @cindex string manipulation
6900 Intrinsic implemented, documentation pending.
6902 @table @asis
6903 @item @emph{Description}:
6904 @item @emph{Standard}:
6905 F95 and later
6907 @item @emph{Class}:
6908 Transformational function
6910 @item @emph{Syntax}:
6911 @item @emph{Arguments}:
6912 @item @emph{Return value}:
6913 @item @emph{Example}:
6914 @item @emph{See also}:
6915 @end table
6920 @node RESHAPE
6921 @section @code{RESHAPE} --- Function to reshape an array
6922 @findex @code{RESHAPE} intrinsic
6923 @cindex array manipulation
6925 Intrinsic implemented, documentation pending.
6927 @table @asis
6928 @item @emph{Description}:
6929 @item @emph{Standard}:
6930 F95 and later
6932 @item @emph{Class}:
6933 Transformational function
6935 @item @emph{Syntax}:
6936 @item @emph{Arguments}:
6937 @item @emph{Return value}:
6938 @item @emph{Example}:
6939 @item @emph{See also}:
6940 @ref{SHAPE}
6941 @end table
6945 @node RRSPACING
6946 @section @code{RRSPACING} --- Reciprocal of the relative spacing
6947 @findex @code{RRSPACING} intrinsic
6949 @table @asis
6950 @item @emph{Description}:
6951 @code{RRSPACING(X)} returns the  reciprocal of the relative spacing of
6952 model numbers near @var{X}.
6954 @item @emph{Standard}:
6955 F95 and later
6957 @item @emph{Class}:
6958 Elemental function
6960 @item @emph{Syntax}:
6961 @code{Y = RRSPACING(X)}
6963 @item @emph{Arguments}:
6964 @multitable @columnfractions .15 .80
6965 @item @var{X} @tab shall be of type @code{REAL}.
6966 @end multitable
6968 @item @emph{Return value}:
6969 The return value is of the same type and kind as @var{X}.
6970 The value returned is equal to
6971 @code{ABS(FRACTION(X)) * FLOAT(RADIX(X))**DIGITS(X)}.
6973 @end table
6977 @node RSHIFT
6978 @section @code{RSHIFT} --- Right shift bits
6979 @findex @code{RSHIFT} 
6980 @cindex bit manipulation
6982 Not yet implemented in GNU Fortran.
6984 @table @asis
6985 @item @emph{Description}:
6987 @item @emph{Standard}:
6988 GNU extension
6990 @item @emph{Class}:
6991 Function
6993 @item @emph{Syntax}:
6994 @item @emph{Arguments}:
6995 @item @emph{Return value}:
6996 @item @emph{Example}:
6997 @item @emph{See also}:
6999 @end table
7003 @node SCALE
7004 @section @code{SCALE} --- Scale a real value
7005 @findex @code{SCALE} intrinsic
7007 @table @asis
7008 @item @emph{Description}:
7009 @code{SCALE(X,I)} returns @code{X * RADIX(X)**I}.
7011 @item @emph{Standard}:
7012 F95 and later
7014 @item @emph{Class}:
7015 Elemental function
7017 @item @emph{Syntax}:
7018 @code{Y = SCALE(X, I)}
7020 @item @emph{Arguments}:
7021 @multitable @columnfractions .15 .80
7022 @item @var{X} @tab The type of the argument shall be a @code{REAL}.
7023 @item @var{I} @tab The type of the argument shall be a @code{INTEGER}.
7024 @end multitable
7026 @item @emph{Return value}:
7027 The return value is of the same type and kind as @var{X}.
7028 Its value is @code{X * RADIX(X)**I}.
7030 @item @emph{Example}:
7031 @smallexample
7032 program test_scale
7033   real :: x = 178.1387e-4
7034   integer :: i = 5
7035   print *, scale(x,i), x*radix(x)**i
7036 end program test_scale
7037 @end smallexample
7039 @end table
7042 @node SCAN
7043 @section @code{SCAN} --- Scan a string for the presence of a set of characters
7044 @findex @code{SCAN} intrinsic
7045 @cindex string manipulation
7047 Intrinsic implemented, documentation pending.
7049 @table @asis
7050 @item @emph{Description}:
7051 @item @emph{Standard}:
7052 F95 and later
7054 @item @emph{Class}:
7055 Elemental function
7057 @item @emph{Syntax}:
7058 @item @emph{Arguments}:
7059 @item @emph{Return value}:
7060 @item @emph{Example}:
7061 @item @emph{See also}:
7062 @end table
7067 @node SECNDS
7068 @section @code{SECNDS} --- Time function
7069 @findex @code{SECNDS} intrinsic
7070 @cindex SECNDS
7072 @table @asis
7073 @item @emph{Description}:
7074 @code{SECNDS(X)} gets the time in seconds from the real-time system clock.
7075 @var{X} is a reference time, also in seconds. If this is zero, the time in
7076 seconds from midnight is returned. This function is non-standard and its
7077 use is discouraged.
7079 @item @emph{Standard}:
7080 GNU extension
7082 @item @emph{Class}:
7083 function
7085 @item @emph{Syntax}:
7086 @code{T = SECNDS (X)}
7088 @item @emph{Arguments}:
7089 @multitable @columnfractions .15 .80
7090 @item Name        @tab Type
7091 @item @var{T}     @tab REAL(4)
7092 @item @var{X}     @tab REAL(4)
7093 @end multitable
7095 @item @emph{Return value}:
7096 None
7098 @item @emph{Example}:
7099 @smallexample
7100 program test_secnds
7101     real(4) :: t1, t2
7102     print *, secnds (0.0)   ! seconds since midnight
7103     t1 = secnds (0.0)       ! reference time
7104     do i = 1, 10000000      ! do something
7105     end do
7106     t2 = secnds (t1)        ! elapsed time
7107     print *, "Something took ", t2, " seconds."
7108 end program test_secnds
7109 @end smallexample
7110 @end table
7114 @node SELECTED_INT_KIND
7115 @section @code{SELECTED_INT_KIND} --- Choose integer kind
7116 @findex @code{SELECTED_INT_KIND} intrinsic
7117 @cindex integer kind
7119 @table @asis
7120 @item @emph{Description}:
7121 @code{SELECTED_INT_KIND(I)} return the kind value of the smallest integer
7122 type that can represent all values ranging from @math{-10^I} (exclusive)
7123 to @math{10^I} (exclusive). If there is no integer kind that accommodates
7124 this range, @code{SELECTED_INT_KIND} returns @math{-1}.
7126 @item @emph{Standard}:
7127 F95 and later
7129 @item @emph{Class}:
7130 Transformational function
7132 @item @emph{Syntax}:
7133 @multitable @columnfractions .30 .80
7134 @item @code{J = SELECTED_INT_KIND(I)}
7135 @end multitable
7137 @item @emph{Arguments}:
7138 @multitable @columnfractions .15 .80
7139 @item @var{I} @tab shall be a scalar and of type @code{INTEGER}.
7140 @end multitable
7142 @item @emph{Example}:
7143 @smallexample
7144 program large_integers
7145   integer,parameter :: k5 = selected_int_kind(5)
7146   integer,parameter :: k15 = selected_int_kind(15)
7147   integer(kind=k5) :: i5
7148   integer(kind=k15) :: i15
7150   print *, huge(i5), huge(i15)
7152   ! The following inequalities are always true
7153   print *, huge(i5) >= 10_k5**5-1
7154   print *, huge(i15) >= 10_k15**15-1
7155 end program large_integers
7156 @end smallexample
7157 @end table
7161 @node SELECTED_REAL_KIND
7162 @section @code{SELECTED_REAL_KIND} --- Choose real kind
7163 @findex @code{SELECTED_REAL_KIND} intrinsic
7164 @cindex real kind
7166 @table @asis
7167 @item @emph{Description}:
7168 @code{SELECTED_REAL_KIND(P,R)} return the kind value of a real data type
7169 with decimal precision greater of at least @code{P} digits and exponent
7170 range greater at least @code{R}. 
7172 @item @emph{Standard}:
7173 F95 and later
7175 @item @emph{Class}:
7176 Transformational function
7178 @item @emph{Syntax}:
7179 @multitable @columnfractions .30 .80
7180 @item @code{I = SELECTED_REAL_KIND(P,R)}
7181 @end multitable
7183 @item @emph{Arguments}:
7184 @multitable @columnfractions .15 .80
7185 @item @var{P} @tab (Optional) shall be a scalar and of type @code{INTEGER}.
7186 @item @var{R} @tab (Optional) shall be a scalar and of type @code{INTEGER}.
7187 @end multitable
7188 At least one argument shall be present.
7190 @item @emph{Return value}:
7192 @code{SELECTED_REAL_KIND} returns the value of the kind type parameter of
7193 a real data type with decimal precision of at least @code{P} digits and a
7194 decimal exponent range of at least @code{R}. If more than one real data
7195 type meet the criteria, the kind of the data type with the smallest
7196 decimal precision is returned. If no real data type matches the criteria,
7197 the result is
7198 @table @asis
7199 @item -1 if the processor does not support a real data type with a
7200 precision greater than or equal to @code{P}
7201 @item -2 if the processor does not support a real type with an exponent
7202 range greater than or equal to @code{R}
7203 @item -3 if neither is supported.
7204 @end table
7206 @item @emph{Example}:
7207 @smallexample
7208 program real_kinds
7209   integer,parameter :: p6 = selected_real_kind(6)
7210   integer,parameter :: p10r100 = selected_real_kind(10,100)
7211   integer,parameter :: r400 = selected_real_kind(r=400)
7212   real(kind=p6) :: x
7213   real(kind=p10r100) :: y
7214   real(kind=r400) :: z
7216   print *, precision(x), range(x)
7217   print *, precision(y), range(y)
7218   print *, precision(z), range(z)
7219 end program real_kinds
7220 @end smallexample
7221 @end table
7225 @node SET_EXPONENT
7226 @section @code{SET_EXPONENT} --- Set the exponent of the model
7227 @findex @code{SET_EXPONENT} intrinsic
7228 @cindex exponent
7230 @table @asis
7231 @item @emph{Description}:
7232 @code{SET_EXPONENT(X, I)} returns the real number whose fractional part
7233 is that that of @var{X} and whose exponent part if @var{I}.
7235 @item @emph{Standard}:
7236 F95 and later
7238 @item @emph{Class}:
7239 Elemental function
7241 @item @emph{Syntax}:
7242 @code{Y = SET_EXPONENT(X, I)}
7244 @item @emph{Arguments}:
7245 @multitable @columnfractions .15 .80
7246 @item @var{X} @tab shall be of type @code{REAL}.
7247 @item @var{I} @tab shall be of type @code{INTEGER}.
7248 @end multitable
7250 @item @emph{Return value}:
7251 The return value is of the same type and kind as @var{X}.
7252 The real number whose fractional part
7253 is that that of @var{X} and whose exponent part if @var{I} is returned;
7254 it is @code{FRACTION(X) * RADIX(X)**I}.
7256 @item @emph{Example}:
7257 @smallexample
7258 program test_setexp
7259   real :: x = 178.1387e-4
7260   integer :: i = 17
7261   print *, set_exponent(x), fraction(x) * radix(x)**i
7262 end program test_setexp
7263 @end smallexample
7265 @end table
7269 @node SHAPE
7270 @section @code{SHAPE} --- Determine the shape of an array
7271 @findex @code{SHAPE} intrinsic
7272 @cindex array manipulation
7274 Intrinsic implemented, documentation pending.
7276 @table @asis
7277 @item @emph{Description}:
7278 @item @emph{Standard}:
7279 F95 and later
7281 @item @emph{Class}:
7282 Inquiry function
7284 @item @emph{Syntax}:
7285 @item @emph{Arguments}:
7286 @item @emph{Return value}:
7287 @item @emph{Example}:
7288 @item @emph{See also}:
7289 @ref{RESHAPE}
7290 @end table
7295 @node SIGN
7296 @section @code{SIGN} --- Sign copying function
7297 @findex @code{SIGN} intrinsic
7298 @findex @code{ISIGN} intrinsic
7299 @findex @code{DSIGN} intrinsic
7300 @cindex sign copying
7302 @table @asis
7303 @item @emph{Description}:
7304 @code{SIGN(A,B)} returns the value of @var{A} with the sign of @var{B}.
7306 @item @emph{Standard}:
7307 F77 and later
7309 @item @emph{Class}:
7310 Elemental function
7312 @item @emph{Syntax}:
7313 @code{X = SIGN(A,B)}
7315 @item @emph{Arguments}:
7316 @multitable @columnfractions .15 .80
7317 @item @var{A} @tab shall be a scalar of type @code{INTEGER} or @code{REAL}
7318 @item @var{B} @tab shall be a scalar of the same type and kind as @var{A}
7319 @end multitable
7321 @item @emph{Return value}:
7322 The kind of the return value is that of @var{A} and @var{B}.
7323 If @math{B\ge 0} then the result is @code{ABS(A)}, else
7324 it is @code{-ABS(A)}.
7326 @item @emph{Example}:
7327 @smallexample
7328 program test_sign
7329   print *, sign(-12,1)
7330   print *, sign(-12,0)
7331   print *, sign(-12,-1)
7333   print *, sign(-12.,1.)
7334   print *, sign(-12.,0.)
7335   print *, sign(-12.,-1.)
7336 end program test_sign
7337 @end smallexample
7339 @item @emph{Specific names}:
7340 @multitable @columnfractions .20 .20 .20 .40
7341 @item Name              @tab Arguments      @tab Return type    @tab Standard
7342 @item @code{ISIGN(A,P)} @tab @code{INTEGER(4)} @tab @code{INTEGER(4)} @tab f95, gnu
7343 @item @code{DSIGN(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab f95, gnu
7344 @end multitable
7345 @end table
7349 @node SIGNAL
7350 @section @code{SIGNAL} --- Signal handling subroutine (or function)
7351 @findex @code{SIGNAL} intrinsic
7352 @cindex SIGNAL subroutine 
7354 @table @asis
7355 @item @emph{Description}:
7356 @code{SIGNAL(NUMBER, HANDLER [, STATUS])} causes external subroutine
7357 @var{HANDLER} to be executed with a single integer argument when signal
7358 @var{NUMBER} occurs.  If @var{HANDLER} is an integer, it can be used to
7359 turn off handling of signal @var{NUMBER} or revert to its default
7360 action.  See @code{signal(2)}.
7362 If @code{SIGNAL} is called as a subroutine and the @var{STATUS} argument
7363 is supplied, it is set to the value returned by @code{signal(2)}.
7365 @item @emph{Standard}:
7366 GNU extension
7368 @item @emph{Class}:
7369 subroutine, non-elemental function
7371 @item @emph{Syntax}:
7372 @multitable @columnfractions .30 .80
7373 @item @code{CALL ALARM(NUMBER, HANDLER)}
7374 @item @code{CALL ALARM(NUMBER, HANDLER, STATUS)}
7375 @item @code{STATUS = ALARM(NUMBER, HANDLER)}
7376 @end multitable
7378 @item @emph{Arguments}:
7379 @multitable @columnfractions .15 .80
7380 @item @var{NUMBER} @tab shall be a scalar integer, with @code{INTENT(IN)}
7381 @item @var{HANDLER}@tab Signal handler (@code{INTEGER FUNCTION} or
7382 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
7383 @code{INTEGER}. It is @code{INTENT(IN)}.
7384 @item @var{STATUS} @tab (Optional) @var{STATUS} shall be a scalar
7385 integer. It has @code{INTENT(OUT)}.
7386 @end multitable
7388 @item @emph{Return value}:
7389 The @code{SIGNAL} functions returns the value returned by @code{signal(2)}.
7391 @item @emph{Example}:
7392 @smallexample
7393 program test_signal
7394   intrinsic signal
7395   external handler_print
7397   call signal (12, handler_print)
7398   call signal (10, 1)
7400   call sleep (30)
7401 end program test_signal
7402 @end smallexample
7403 @end table
7408 @node SIN
7409 @section @code{SIN} --- Sine function 
7410 @findex @code{SIN} intrinsic
7411 @findex @code{DSIN} intrinsic
7412 @findex @code{ZSIN} intrinsic
7413 @findex @code{CDSIN} intrinsic
7414 @cindex trigonometric functions
7416 @table @asis
7417 @item @emph{Description}:
7418 @code{SIN(X)} computes the sine of @var{X}.
7420 @item @emph{Standard}:
7421 F77 and later
7423 @item @emph{Class}:
7424 Elemental function
7426 @item @emph{Syntax}:
7427 @code{X = SIN(X)}
7429 @item @emph{Arguments}:
7430 @multitable @columnfractions .15 .80
7431 @item @var{X} @tab The type shall be @code{REAL(*)} or
7432 @code{COMPLEX(*)}.
7433 @end multitable
7435 @item @emph{Return value}:
7436 The return value has same type and kind as @var{X}.
7438 @item @emph{Example}:
7439 @smallexample
7440 program test_sin
7441   real :: x = 0.0
7442   x = sin(x)
7443 end program test_sin
7444 @end smallexample
7446 @item @emph{Specific names}:
7447 @multitable @columnfractions .20 .20 .20 .40
7448 @item Name            @tab Argument          @tab Return type       @tab Standard
7449 @item @code{DSIN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
7450 @item @code{CSIN(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
7451 @item @code{ZSIN(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
7452 @item @code{CDSIN(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
7453 @end multitable
7455 @item @emph{See also}:
7456 @ref{ASIN}
7457 @end table
7461 @node SINH
7462 @section @code{SINH} --- Hyperbolic sine function 
7463 @findex @code{SINH} intrinsic
7464 @findex @code{DSINH} intrinsic
7465 @cindex hyperbolic sine
7467 @table @asis
7468 @item @emph{Description}:
7469 @code{SINH(X)} computes the hyperbolic sine of @var{X}.
7471 @item @emph{Standard}:
7472 F95 and later
7474 @item @emph{Class}:
7475 Elemental function
7477 @item @emph{Syntax}:
7478 @code{X = SINH(X)}
7480 @item @emph{Arguments}:
7481 @multitable @columnfractions .15 .80
7482 @item @var{X} @tab The type shall be @code{REAL(*)}.
7483 @end multitable
7485 @item @emph{Return value}:
7486 The return value is of type @code{REAL(*)}.
7488 @item @emph{Example}:
7489 @smallexample
7490 program test_sinh
7491   real(8) :: x = - 1.0_8
7492   x = sinh(x)
7493 end program test_sinh
7494 @end smallexample
7496 @item @emph{Specific names}:
7497 @multitable @columnfractions .20 .20 .20 .40
7498 @item Name            @tab Argument          @tab Return type       @tab Standard
7499 @item @code{DSINH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F95 and later
7500 @end multitable
7502 @item @emph{See also}:
7503 @ref{ASINH}
7504 @end table
7508 @node SIZE
7509 @section @code{SIZE} --- Determine the size of an array
7510 @findex @code{SIZE} intrinsic
7511 @cindex array manipulation
7513 Intrinsic implemented, documentation pending.
7515 @table @asis
7516 @item @emph{Description}:
7517 @item @emph{Standard}:
7518 F95 and later
7520 @item @emph{Class}:
7521 Inquiry function
7523 @item @emph{Syntax}:
7524 @item @emph{Arguments}:
7525 @item @emph{Return value}:
7526 @item @emph{Example}:
7527 @item @emph{See also}:
7528 @end table
7532 @node SNGL
7533 @section @code{SNGL} --- Convert double precision real to default real
7534 @findex @code{SNGL} intrinsic
7535 @cindex conversion function (real)
7537 @table @asis
7538 @item @emph{Description}:
7539 @code{SNGL(A)} converts the double precision real @var{A}
7540 to a default real value. This is an archaic form of @code{REAL}
7541 that is specific to one type for @var{A}.
7543 @item @emph{Standard}:
7544 GNU extension
7546 @item @emph{Class}:
7547 function
7549 @item @emph{Syntax}:
7550 @code{X = SNGL(A)}
7552 @item @emph{Arguments}:
7553 @multitable @columnfractions .15 .80
7554 @item @var{A} @tab The type shall be a double precision @code{REAL}.
7555 @end multitable
7557 @item @emph{Return value}:
7558 The return value is of type default @code{REAL}.
7560 @item @emph{See also}:
7561 @ref{DBLE}
7562 @end table
7566 @node SPACING
7567 @section @code{SPACING} --- Smallest distance between two numbers of a given type
7568 @findex @code{SPACING} intrinsic
7569 @cindex undocumented intrinsic 
7571 Intrinsic implemented, documentation pending.
7573 @table @asis
7574 @item @emph{Description}:
7575 @item @emph{Standard}:
7576 F95 and later
7578 @item @emph{Class}:
7579 Elemental function
7581 @item @emph{Syntax}:
7582 @item @emph{Arguments}:
7583 @item @emph{Return value}:
7584 @item @emph{Example}:
7585 @item @emph{See also}:
7586 @end table
7591 @node SPREAD
7592 @section @code{SPREAD} --- Add a dimension to an array
7593 @findex @code{SPREAD} intrinsic
7594 @cindex array manipulation
7596 Intrinsic implemented, documentation pending.
7598 @table @asis
7599 @item @emph{Description}:
7600 @item @emph{Standard}:
7601 F95 and later
7603 @item @emph{Class}:
7604 Transformational function
7606 @item @emph{Syntax}:
7607 @item @emph{Arguments}:
7608 @item @emph{Return value}:
7609 @item @emph{Example}:
7610 @item @emph{See also}:
7611 @end table
7616 @node SQRT
7617 @section @code{SQRT} --- Square-root function
7618 @findex @code{SQRT} intrinsic
7619 @findex @code{DSQRT} intrinsic
7620 @findex @code{CSQRT} intrinsic
7621 @findex @code{ZSQRT} intrinsic
7622 @findex @code{CDSQRT} intrinsic
7623 @cindex square-root
7625 @table @asis
7626 @item @emph{Description}:
7627 @code{SQRT(X)} computes the square root of @var{X}.
7629 @item @emph{Standard}:
7630 F77 and later
7632 @item @emph{Class}:
7633 Elemental function
7635 @item @emph{Syntax}:
7636 @code{X = SQRT(X)}
7638 @item @emph{Arguments}:
7639 @multitable @columnfractions .15 .80
7640 @item @var{X} @tab The type shall be @code{REAL(*)} or
7641 @code{COMPLEX(*)}.
7642 @end multitable
7644 @item @emph{Return value}:
7645 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
7646 The kind type parameter is the same as @var{X}.
7648 @item @emph{Example}:
7649 @smallexample
7650 program test_sqrt
7651   real(8) :: x = 2.0_8
7652   complex :: z = (1.0, 2.0)
7653   x = sqrt(x)
7654   z = sqrt(z)
7655 end program test_sqrt
7656 @end smallexample
7658 @item @emph{Specific names}:
7659 @multitable @columnfractions .20 .20 .20 .40
7660 @item Name             @tab Argument             @tab Return type          @tab Standard
7661 @item @code{DSQRT(X)}  @tab @code{REAL(8) X}     @tab @code{REAL(8)}       @tab F95 and later
7662 @item @code{CSQRT(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab F95 and later
7663 @item @code{ZSQRT(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab GNU extension
7664 @item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab GNU extension
7665 @end multitable
7666 @end table
7670 @node SRAND
7671 @section @code{SRAND} --- Reinitialize the random number generator
7672 @findex @code{SRAND} intrinsic
7673 @cindex random number
7675 @table @asis
7676 @item @emph{Description}:
7677 @code{SRAND} reinitializes the pseudo-random number generator
7678 called by @code{RAND} and @code{IRAND}. The new seed used by the
7679 generator is specified by the required argument @var{SEED}.
7681 @item @emph{Standard}:
7682 GNU extension
7684 @item @emph{Class}:
7685 non-elemental subroutine
7687 @item @emph{Syntax}:
7688 @code{CALL SRAND(SEED)}
7690 @item @emph{Arguments}:
7691 @multitable @columnfractions .15 .80
7692 @item @var{SEED} @tab shall be a scalar @code{INTEGER(kind=4)}.
7693 @end multitable
7695 @item @emph{Return value}:
7696 Does not return.
7698 @item @emph{Example}:
7699 See @code{RAND} and @code{IRAND} for examples.
7701 @item @emph{Notes}:
7702 The Fortran 2003 standard specifies the intrinsic @code{RANDOM_SEED} to
7703 initialize the pseudo-random numbers generator and @code{RANDOM_NUMBER}
7704 to generate pseudo-random numbers. Please note that in
7705 GNU Fortran, these two sets of intrinsics (@code{RAND},
7706 @code{IRAND} and @code{SRAND} on the one hand, @code{RANDOM_NUMBER} and
7707 @code{RANDOM_SEED} on the other hand) access two independent
7708 pseudo-random number generators.
7710 @item @emph{See also}:
7711 @ref{RAND}, @ref{RANDOM_SEED}, @ref{RANDOM_NUMBER}
7713 @end table
7716 @node STAT
7717 @section @code{STAT} --- Get file status
7718 @findex @code{STAT} intrinsic
7719 @cindex file system operations
7721 @table @asis
7722 @item @emph{Description}:
7723 This function returns information about a file. No permissions are required on 
7724 the file itself, but execute (search) permission is required on all of the 
7725 directories in path that lead to the file.
7727 The elements that are obtained and stored in the array @code{BUFF}:
7728 @multitable @columnfractions .15 .80
7729 @item @code{buff(1)}   @tab  Device ID 
7730 @item @code{buff(2)}   @tab  Inode number 
7731 @item @code{buff(3)}   @tab  File mode 
7732 @item @code{buff(4)}   @tab  Number of links 
7733 @item @code{buff(5)}   @tab  Owner's uid 
7734 @item @code{buff(6)}   @tab  Owner's gid 
7735 @item @code{buff(7)}   @tab  ID of device containing directory entry for file (0 if not available) 
7736 @item @code{buff(8)}   @tab  File size (bytes) 
7737 @item @code{buff(9)}   @tab  Last access time 
7738 @item @code{buff(10)}  @tab  Last modification time 
7739 @item @code{buff(11)}  @tab  Last file status change time 
7740 @item @code{buff(12)}  @tab  Preferred I/O block size (-1 if not available) 
7741 @item @code{buff(13)}  @tab  Number of blocks allocated (-1 if not available)
7742 @end multitable
7744 Not all these elements are relevant on all systems. 
7745 If an element is not relevant, it is returned as 0.
7748 @item @emph{Standard}:
7749 GNU extension
7751 @item @emph{Class}:
7752 Non-elemental subroutine
7754 @item @emph{Syntax}:
7755 @code{CALL STAT(FILE,BUFF[,STATUS])}
7757 @item @emph{Arguments}:
7758 @multitable @columnfractions .15 .80
7759 @item @var{FILE}   @tab The type shall be @code{CHARACTER(*)}, a valid path within the file system.
7760 @item @var{BUFF}   @tab The type shall be @code{INTEGER(4), DIMENSION(13)}.
7761 @item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER(4)}. Returns 0 
7762                         on success and a system specific error code otherwise.
7763 @end multitable
7765 @item @emph{Example}:
7766 @smallexample
7767 PROGRAM test_stat
7768   INTEGER, DIMENSION(13) :: buff
7769   INTEGER :: status
7771   CALL STAT("/etc/passwd", buff, status)
7773   IF (status == 0) THEN
7774     WRITE (*, FMT="('Device ID:',               T30, I19)") buff(1)
7775     WRITE (*, FMT="('Inode number:',            T30, I19)") buff(2)
7776     WRITE (*, FMT="('File mode (octal):',       T30, O19)") buff(3)
7777     WRITE (*, FMT="('Number of links:',         T30, I19)") buff(4)
7778     WRITE (*, FMT="('Owner''s uid:',            T30, I19)") buff(5)
7779     WRITE (*, FMT="('Owner''s gid:',            T30, I19)") buff(6)
7780     WRITE (*, FMT="('Device where located:',    T30, I19)") buff(7)
7781     WRITE (*, FMT="('File size:',               T30, I19)") buff(8)
7782     WRITE (*, FMT="('Last access time:',        T30, A19)") CTIME(buff(9))
7783     WRITE (*, FMT="('Last modification time',   T30, A19)") CTIME(buff(10))
7784     WRITE (*, FMT="('Last status change time:', T30, A19)") CTIME(buff(11))
7785     WRITE (*, FMT="('Preferred block size:',    T30, I19)") buff(12)
7786     WRITE (*, FMT="('No. of blocks allocated:', T30, I19)") buff(13)
7787   END IF
7788 END PROGRAM
7789 @end smallexample
7791 @item @emph{See also}:
7792 To stat an open file: @ref{FSTAT}, to stat a link: @ref{LSTAT}
7793 @end table
7797 @node SUM
7798 @section @code{SUM} --- Sum of array elements
7799 @findex @code{SUM} intrinsic
7800 @cindex array manipulation
7802 Intrinsic implemented, documentation pending.
7804 @table @asis
7805 @item @emph{Description}:
7806 @item @emph{Standard}:
7807 F95 and later
7809 @item @emph{Class}:
7810 Transformational function
7812 @item @emph{Syntax}:
7813 @item @emph{Arguments}:
7814 @item @emph{Return value}:
7815 @item @emph{Example}:
7816 @item @emph{See also}:
7817 @ref{PRODUCT}
7818 @end table
7823 @node SYMLNK
7824 @section @code{SYMLNK} --- Create a symbolic link
7825 @findex @code{SYMLNK} intrinsic
7826 @cindex file system operations
7828 Intrinsic implemented, documentation pending.
7830 @table @asis
7831 @item @emph{Description}:
7832 @item @emph{Standard}:
7833 @item @emph{Class}:
7834 GNU extension
7836 @item @emph{Syntax}:
7837 @item @emph{Arguments}:
7838 @item @emph{Return value}:
7839 @item @emph{Example}:
7840 @item @emph{See also}:
7841 @end table
7846 @node SYSTEM
7847 @section @code{SYSTEM} --- Execute a shell command
7848 @findex @code{SYSTEM} intrinsic
7849 @cindex undocumented intrinsic 
7851 Intrinsic implemented, documentation pending.
7853 @table @asis
7854 @item @emph{Description}:
7855 @item @emph{Standard}:
7856 GNU extension
7858 @item @emph{Class}:
7859 Subroutine
7861 @item @emph{Syntax}:
7862 @item @emph{Arguments}:
7863 @item @emph{Return value}:
7864 @item @emph{Example}:
7865 @item @emph{See also}:
7866 @end table
7871 @node SYSTEM_CLOCK
7872 @section @code{SYSTEM_CLOCK} --- Time function
7873 @findex @code{SYSTEM_CLOCK} intrinsic
7874 @cindex time functions
7876 Intrinsic implemented, documentation pending.
7878 @table @asis
7879 @item @emph{Description}:
7880 @item @emph{Standard}:
7881 F95 and later
7883 @item @emph{Class}:
7884 Subroutine
7886 @item @emph{Syntax}:
7887 @item @emph{Arguments}:
7888 @item @emph{Return value}:
7889 @item @emph{Example}:
7890 @item @emph{See also}:
7891 @end table
7895 @node TAN
7896 @section @code{TAN} --- Tangent function
7897 @findex @code{TAN} intrinsic
7898 @findex @code{DTAN} intrinsic
7899 @cindex trigonometric functions
7901 @table @asis
7902 @item @emph{Description}:
7903 @code{TAN(X)} computes the tangent of @var{X}.
7905 @item @emph{Standard}:
7906 F77 and later
7908 @item @emph{Class}:
7909 Elemental function
7911 @item @emph{Syntax}:
7912 @code{X = TAN(X)}
7914 @item @emph{Arguments}:
7915 @multitable @columnfractions .15 .80
7916 @item @var{X} @tab The type shall be @code{REAL(*)}.
7917 @end multitable
7919 @item @emph{Return value}:
7920 The return value is of type @code{REAL(*)}.  The kind type parameter is
7921 the same as @var{X}.
7923 @item @emph{Example}:
7924 @smallexample
7925 program test_tan
7926   real(8) :: x = 0.165_8
7927   x = tan(x)
7928 end program test_tan
7929 @end smallexample
7931 @item @emph{Specific names}:
7932 @multitable @columnfractions .20 .20 .20 .40
7933 @item Name            @tab Argument          @tab Return type       @tab Standard
7934 @item @code{DTAN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F95 and later
7935 @end multitable
7937 @item @emph{See also}:
7938 @ref{ATAN}
7939 @end table
7943 @node TANH
7944 @section @code{TANH} --- Hyperbolic tangent function 
7945 @findex @code{TANH} intrinsic
7946 @findex @code{DTANH} intrinsic
7947 @cindex hyperbolic tangent
7949 @table @asis
7950 @item @emph{Description}:
7951 @code{TANH(X)} computes the hyperbolic tangent of @var{X}.
7953 @item @emph{Standard}:
7954 F77 and later
7956 @item @emph{Class}:
7957 Elemental function
7959 @item @emph{Syntax}:
7960 @code{X = TANH(X)}
7962 @item @emph{Arguments}:
7963 @multitable @columnfractions .15 .80
7964 @item @var{X} @tab The type shall be @code{REAL(*)}.
7965 @end multitable
7967 @item @emph{Return value}:
7968 The return value is of type @code{REAL(*)} and lies in the range
7969 @math{ - 1 \leq tanh(x) \leq 1 }.
7971 @item @emph{Example}:
7972 @smallexample
7973 program test_tanh
7974   real(8) :: x = 2.1_8
7975   x = tanh(x)
7976 end program test_tanh
7977 @end smallexample
7979 @item @emph{Specific names}:
7980 @multitable @columnfractions .20 .20 .20 .40
7981 @item Name            @tab Argument          @tab Return type       @tab Standard
7982 @item @code{DTANH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F95 and later
7983 @end multitable
7985 @item @emph{See also}:
7986 @ref{ATANH}
7987 @end table
7991 @node TIME
7992 @section @code{TIME} --- Time function
7993 @findex @code{TIME} intrinsic
7994 @cindex time functions
7996 Intrinsic implemented, documentation pending.
7998 @table @asis
7999 @item @emph{Description}:
8000 @item @emph{Standard}:
8001 GNU extension
8003 @item @emph{Class}:
8004 Non-elemental function
8006 @item @emph{Syntax}:
8007 @item @emph{Arguments}:
8008 @item @emph{Return value}:
8009 @item @emph{Example}:
8010 @item @emph{See also}:
8011 @end table
8015 @node TINY
8016 @section @code{TINY} --- Smallest positive number of a real kind
8017 @findex @code{TINY} intrinsic
8018 @cindex tiny
8020 @table @asis
8021 @item @emph{Description}:
8022 @code{TINY(X)} returns the smallest positive (non zero) number
8023 in the model of the type of @code{X}.
8025 @item @emph{Standard}:
8026 F95 and later
8028 @item @emph{Class}:
8029 Elemental function
8031 @item @emph{Syntax}:
8032 @code{Y = TINY(X)}
8034 @item @emph{Arguments}:
8035 @multitable @columnfractions .15 .80
8036 @item @var{X} @tab shall be of type @code{REAL}.
8037 @end multitable
8039 @item @emph{Return value}:
8040 The return value is of the same type and kind as @var{X}
8042 @item @emph{Example}:
8043 See @code{HUGE} for an example.
8044 @end table
8048 @node TRANSFER
8049 @section @code{TRANSFER} --- Transfer bit patterns
8050 @findex @code{TRANSFER} intrinsic
8051 @cindex bit manipulation
8053 Intrinsic implemented, documentation pending.
8055 @table @asis
8056 @item @emph{Description}:
8057 @item @emph{Standard}:
8058 F95 and later
8060 @item @emph{Class}:
8061 Transformational function
8063 @item @emph{Syntax}:
8064 @item @emph{Arguments}:
8065 @item @emph{Return value}:
8066 @item @emph{Example}:
8067 @item @emph{See also}:
8068 @end table
8073 @node TRANSPOSE
8074 @section @code{TRANSPOSE} --- Transpose an array of rank two
8075 @findex @code{TRANSPOSE} intrinsic
8076 @cindex matrix manipulation
8078 Intrinsic implemented, documentation pending.
8080 @table @asis
8081 @item @emph{Description}:
8082 @item @emph{Standard}:
8083 F95 and later
8085 @item @emph{Class}:
8086 Transformational function
8088 @item @emph{Syntax}:
8089 @item @emph{Arguments}:
8090 @item @emph{Return value}:
8091 @item @emph{Example}:
8092 @item @emph{See also}:
8093 @end table
8098 @node TRIM
8099 @section @code{TRIM} --- Function to remove trailing blank characters of a string
8100 @findex @code{TRIM} intrinsic
8101 @cindex string manipulation
8103 Intrinsic implemented, documentation pending.
8105 @table @asis
8106 @item @emph{Description}:
8107 @item @emph{Standard}:
8108 F95 and later
8110 @item @emph{Class}:
8111 Transformational function
8113 @item @emph{Syntax}:
8114 @item @emph{Arguments}:
8115 @item @emph{Return value}:
8116 @item @emph{Example}:
8117 @item @emph{See also}:
8118 @end table
8123 @node UBOUND
8124 @section @code{UBOUND} --- Upper dimension bounds of an array
8125 @findex @code{UBOUND} intrinsic
8126 @cindex undocumented intrinsic 
8128 Intrinsic implemented, documentation pending.
8130 @table @asis
8131 @item @emph{Description}:
8133 @item @emph{Standard}:
8134 F95 and later
8136 @item @emph{Class}:
8137 Inquiry function
8139 @item @emph{Syntax}:
8140 @item @emph{Arguments}:
8141 @item @emph{Return value}:
8142 @item @emph{Example}:
8143 @item @emph{Specific names}:
8145 @item @emph{See also}:
8146 @ref{LBOUND}
8147 @end table
8152 @node UMASK
8153 @section @code{UMASK} --- Set the file creation mask
8154 @findex @code{UMASK} intrinsic
8155 @cindex file system operations
8157 Intrinsic implemented, documentation pending.
8159 @table @asis
8160 @item @emph{Description}:
8161 @item @emph{Standard}:
8162 GNU extension
8164 @item @emph{Class}:
8165 Subroutine
8167 @item @emph{Syntax}:
8168 @item @emph{Arguments}:
8169 @item @emph{Return value}:
8170 @item @emph{Example}:
8171 @item @emph{Specific names}:
8172 @item @emph{See also}:
8173 @end table
8178 @node UNLINK
8179 @section @code{UNLINK} --- Remove a file from the file system
8180 @findex @code{UNLINK} intrinsic
8181 @cindex file system operations
8183 Intrinsic implemented, documentation pending.
8185 @table @asis
8186 @item @emph{Description}:
8187 @item @emph{Standard}:
8188 GNU extension
8190 @item @emph{Class}:
8191 Subroutine
8193 @item @emph{Syntax}:
8194 @item @emph{Arguments}:
8195 @item @emph{Return value}:
8196 @item @emph{Example}:
8198 @item @emph{See also}:
8199 @ref{LINK}
8200 @end table
8205 @node UNMASK
8206 @section @code{UNMASK} --- (?)
8207 @findex @code{UNMASK} intrinsic
8208 @cindex undocumented intrinsic 
8210 Intrinsic implemented, documentation pending.
8212 @table @asis
8213 @item @emph{Description}:
8214 @item @emph{Standard}:
8215 @item @emph{Class}:
8216 @item @emph{Syntax}:
8217 @item @emph{Arguments}:
8218 @item @emph{Return value}:
8219 @item @emph{Example}:
8220 @item @emph{Specific names}:
8221 @item @emph{See also}:
8222 @end table
8227 @node UNPACK
8228 @section @code{UNPACK} --- Unpack an array of rank one into an array
8229 @findex @code{UNPACK} intrinsic
8230 @cindex array manipulation
8232 Intrinsic implemented, documentation pending.
8234 @table @asis
8235 @item @emph{Description}:
8236 @item @emph{Standard}:
8237 F95 and later
8239 @item @emph{Class}:
8240 Transformational function
8242 @item @emph{Syntax}:
8243 @item @emph{Arguments}:
8244 @item @emph{Return value}:
8245 @item @emph{Example}:
8247 @item @emph{See also}:
8248 @ref{PACK}
8249 @end table
8254 @node VERIFY
8255 @section @code{VERIFY} --- Scan a string for the absence of a set of characters
8256 @findex @code{VERIFY} intrinsic
8257 @cindex string manipulation
8259 Intrinsic implemented, documentation pending.
8261 @table @asis
8262 @item @emph{Description}:
8263 @item @emph{Standard}:
8264 F95 and later
8266 @item @emph{Class}:
8267 Elemental function
8269 @item @emph{Syntax}:
8270 @item @emph{Arguments}:
8271 @item @emph{Return value}:
8272 @item @emph{Example}:
8273 @item @emph{Specific names}:
8274 @item @emph{See also}:
8275 @end table
8278 @node XOR
8279 @section @code{XOR} --- Bitwise logical exclusive OR
8280 @findex @code{XOR} intrinsic
8281 @cindex bit operations
8283 @table @asis
8284 @item @emph{Description}:
8285 Bitwise logical exclusive or. 
8287 This intrinsic routine is provided for backwards compatibility with 
8288 GNU Fortran 77.  For integer arguments, programmers should consider
8289 the use of the @ref{IEOR} intrinsic defined by the Fortran standard.
8291 @item @emph{Standard}:
8292 GNU extension
8294 @item @emph{Class}:
8295 Non-elemental function
8297 @item @emph{Syntax}:
8298 @code{RESULT = XOR(X, Y)}
8300 @item @emph{Arguments}:
8301 @multitable @columnfractions .15 .80
8302 @item @var{X} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
8303 @item @var{Y} @tab The type shall be either @code{INTEGER(*)} or @code{LOGICAL}.
8304 @end multitable
8306 @item @emph{Return value}:
8307 The return type is either @code{INTEGER(*)} or @code{LOGICAL}
8308 after cross-promotion of the arguments.
8310 @item @emph{Example}:
8311 @smallexample
8312 PROGRAM test_xor
8313   LOGICAL :: T = .TRUE., F = .FALSE.
8314   INTEGER :: a, b
8315   DATA a / Z,'F' /, b / Z'3' /
8317   WRITE (*,*) XOR(T, T), XOR(T, F), XOR(F, T), XOR(F, F)
8318   WRITE (*,*) XOR(a, b)
8319 END PROGRAM
8320 @end smallexample
8322 @item @emph{See also}:
8323 F95 elemental function: @ref{IEOR}
8324 @end table