OSDN Git Service

2006-08-24 Daniel Franke <franke.daniel@gmail.com>,
[pf3gnuchains/gcc-fork.git] / gcc / fortran / intrinsic.texi
1 @ignore
2 Copyright (C) 2005
3 Free Software Foundation, Inc.
4 This is part of the GFORTRAN manual.   
5 For copying conditions, see the file gfortran.texi.
6
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.
14
15
16 Some basic guidelines for editing this document:
17
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.
23
24
25 @end ignore
26
27 @node Intrinsic Procedures
28 @chapter Intrinsic Procedures
29 @cindex Intrinsic Procedures
30
31 This portion of the document is incomplete and undergoing massive expansion 
32 and editing.  All contributions and corrections are strongly encouraged. 
33
34 Implemented intrinsics are fully functional and available to the user to apply. 
35 Some intrinsics have documentation yet to be completed as indicated by 'documentation pending'.
36
37 @menu
38 * Introduction:         Introduction
39 * @code{ABORT}:         ABORT,     Abort the program     
40 * @code{ABS}:           ABS,       Absolute value     
41 * @code{ACCESS}:        ACCESS,    Checks file access method
42 * @code{ACHAR}:         ACHAR,     Character in @acronym{ASCII} collating sequence
43 * @code{ACOS}:          ACOS,      Arccosine function
44 * @code{ACOSH}:         ACOSH,     Hyperbolic arccosine function
45 * @code{ADJUSTL}:       ADJUSTL,   Left adjust a string
46 * @code{ADJUSTR}:       ADJUSTR,   Right adjust a string
47 * @code{AIMAG}:         AIMAG,     Imaginary part of complex number
48 * @code{AINT}:          AINT,      Truncate to a whole number
49 * @code{ALARM}:         ALARM,     Set an alarm clock
50 * @code{ALL}:           ALL,       Determine if all values are true
51 * @code{ALLOCATED}:     ALLOCATED, Status of allocatable entity
52 * @code{AND}:           AND,       Logical and
53 * @code{ANINT}:         ANINT,     Nearest whole number
54 * @code{ANY}:           ANY,       Determine if any values are true
55 * @code{ASIN}:          ASIN,      Arcsine function
56 * @code{ASINH}:         ASINH,     Hyperbolic arcsine function
57 * @code{ASSOCIATED}:    ASSOCIATED, Status of a pointer or pointer/target pair
58 * @code{ATAN}:          ATAN,      Arctangent function
59 * @code{ATAN2}:         ATAN2,     Arctangent function
60 * @code{ATANH}:         ATANH,     Hyperbolic arctangent function
61 * @code{BESJ0}:         BESJ0,     Bessel function of the first kind of order 0
62 * @code{BESJ1}:         BESJ1,     Bessel function of the first kind of order 1
63 * @code{BESJN}:         BESJN,     Bessel function of the first kind
64 * @code{BESY0}:         BESY0,     Bessel function of the second kind of order 0
65 * @code{BESY1}:         BESY1,     Bessel function of the second kind of order 1
66 * @code{BESYN}:         BESYN,     Bessel function of the second kind
67 * @code{BIT_SIZE}:      BIT_SIZE,  Bit size inquiry function
68 * @code{BTEST}:         BTEST,     Bit test function
69 * @code{CEILING}:       CEILING,   Integer ceiling function
70 * @code{CHAR}:          CHAR,      Integer-to-character conversion function
71 * @code{CHDIR}:         CHDIR,     Change working directory
72 * @code{CHMOD}:         CHMOD,     Change access permissions of files
73 * @code{CMPLX}:         CMPLX,     Complex conversion function
74 * @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT,  Command line argument count
75 * @code{CONJG}:         CONJG,     Complex conjugate function
76 * @code{COS}:           COS,       Cosine function
77 * @code{COSH}:          COSH,      Hyperbolic cosine function
78 * @code{COUNT}:         COUNT,     Count occurrences of .TRUE. in an array
79 * @code{CPU_TIME}:      CPU_TIME,  CPU time subroutine
80 * @code{CSHIFT}:        CSHIFT,    Circular array shift function
81 * @code{CTIME}:         CTIME,     Subroutine (or function) to convert a time into a string
82 * @code{DATE_AND_TIME}: DATE_AND_TIME, Date and time subroutine
83 * @code{DBLE}:          DBLE,      Double precision conversion function
84 * @code{DCMPLX}:        DCMPLX,    Double complex conversion function
85 * @code{DFLOAT}:        DFLOAT,    Double precision conversion function
86 * @code{DIGITS}:        DIGITS,    Significant digits function
87 * @code{DIM}:           DIM,       Dim function
88 * @code{DOT_PRODUCT}:   DOT_PRODUCT, Dot product function
89 * @code{DPROD}:         DPROD,     Double product function
90 * @code{DREAL}:         DREAL,     Double real part function
91 * @code{DTIME}:         DTIME,     Execution time subroutine (or function)
92 * @code{EOSHIFT}:       EOSHIFT,   End-off shift function
93 * @code{EPSILON}:       EPSILON,   Epsilon function
94 * @code{EQV}:           EQV,       Logical equivalence
95 * @code{ERF}:           ERF,       Error function
96 * @code{ERFC}:          ERFC,      Complementary error function
97 * @code{ETIME}:         ETIME,     Execution time subroutine (or function)
98 * @code{EXIT}:          EXIT,      Exit the program with status.
99 * @code{EXP}:           EXP,       Exponential function
100 * @code{EXPONENT}:      EXPONENT,  Exponent function
101 * @code{FDATE}:         FDATE,     Subroutine (or function) to get the current time as a string
102 * @code{FGET}:          FGET,      Read a single character from stdin in stream mode
103 * @code{FGETC}:         FGETC,     Read a single character in stream mode
104 * @code{FLOAT}:         FLOAT,     Convert integer to default real
105 * @code{FLOOR}:         FLOOR,     Integer floor function
106 * @code{FLUSH}:         FLUSH,     Flush I/O unit(s)
107 * @code{FNUM}:          FNUM,      File number function
108 * @code{FPUT}:          FPUT,      Write a single character to stdout in stream mode
109 * @code{FPUTC}:         FPUTC,     Write a single character in stream mode
110 * @code{FRACTION}:      FRACTION,  Fractional part of the model representation
111 * @code{FREE}:          FREE,      Memory de-allocation subroutine
112 * @code{FSEEK}:         FSEEK,     Low level file positioning subroutine
113 * @code{FSTAT}:         FSTAT,     Get file status
114 * @code{FTELL}:         FTELL,     Current stream position
115 * @code{GETARG}:        GETARG,    Get command line arguments
116 * @code{GET_COMMAND}:   GET_COMMAND, Subroutine to retrieve the entire command line
117 * @code{GET_COMMAND_ARGUMENT}: GET_COMMAND_ARGUMENT, Subroutine to retrieve a command argument
118 * @code{GETCWD}:        GETCWD,    Get current working directory
119 * @code{GETENV}:        GETENV,    Get an environmental variable
120 * @code{GET_ENVIRONMENT_VARIABLE}: GET_ENVIRONMENT_VARIABLE, Get an environmental variable
121 * @code{GETGID}:        GETGID,    Group ID function
122 * @code{GETLOG}:        GETLOG,    Get login name
123 * @code{GETPID}:        GETPID,    Process ID function
124 * @code{GETUID}:        GETUID,    User ID function
125 * @code{GMTIME}:        GMTIME,    Convert time to GMT info
126 * @code{HOSTNM}:        HOSTNM,    Get system host name
127 * @code{HUGE}:          HUGE,      Largest number of a kind
128 * @code{IACHAR}:        IACHAR,    Code in @acronym{ASCII} collating sequence
129 * @code{IAND}:          IAND,      Bitwise logical and
130 * @code{IARGC}:         IARGC,     Get number of command line arguments
131 * @code{IBCLR}:         IBCLR,     Clear bit
132 * @code{IBITS}:         IBITS,     Bit extraction
133 * @code{IBSET}:         IBSET,     Set bit
134 * @code{ICHAR}:         ICHAR,     Character-to-integer conversion function
135 * @code{IDATE}:         IDATE,     Current local time (day/month/year)
136 * @code{IEOR}:          IEOR,      Bitwise logical exclusive or
137 * @code{IERRNO}:        IERRNO,    Function to get the last system error number
138 * @code{INDEX}:         INDEX,     Position of a substring within a string
139 * @code{INT}:           INT,       Convert to integer type
140 * @code{IOR}:           IOR,       Bitwise logical or
141 * @code{IRAND}:         IRAND,     Integer pseudo-random number
142 * @code{ISHFT}:         ISHFT,     Shift bits
143 * @code{ISHFTC}:        ISHFTC,    Shift bits circularly
144 * @code{ITIME}:         ITIME,     Current local time (hour/minutes/seconds)
145 * @code{KILL}:          KILL,      Send a signal to a process
146 * @code{KIND}:          KIND,      Kind of an entity
147 * @code{LBOUND}:        LBOUND,    Lower dimension bounds of an array
148 * @code{LEN}:           LEN,       Length of a character entity
149 * @code{LEN_TRIM}:      LEN_TRIM,  Length of a character entity without trailing blank characters
150 * @code{LGE}:           LGE,       Lexical greater than or equal
151 * @code{LGT}:           LGT,       Lexical greater than
152 * @code{LINK}:          LINK,      Create a hard link
153 * @code{LLE}:           LLE,       Lexical less than or equal
154 * @code{LLT}:           LLT,       Lexical less than
155 * @code{LNBLNK}:        LNBLNK,    Index of the last non-blank character in a string
156 * @code{LOC}:           LOC,       Returns the address of a variable
157 * @code{LOG}:           LOG,       Logarithm function
158 * @code{LOG10}:         LOG10,     Base 10 logarithm function 
159 * @code{LOGICAL}:       LOGICAL,   Convert to logical type
160 * @code{LSHIFT}:        LSHIFT,    Left shift bits
161 * @code{LTIME}:         LTIME,     Convert time to local time info
162 * @code{MALLOC}:        MALLOC,    Dynamic memory allocation function
163 * @code{MATMUL}:        MATMUL,    matrix multiplication
164 * @code{MAX}:           MAX,       Maximum value of an argument list
165 * @code{MAXEXPONENT}:   MAXEXPONENT, Maximum exponent of a real kind
166 * @code{MAXLOC}:        MAXLOC,    Location of the maximum value within an array
167 * @code{MAXVAL}:        MAXVAL,    Maximum value of an array
168 * @code{MERGE}:         MERGE,     Merge arrays
169 * @code{MIN}:           MIN,       Minimum value of an argument list
170 * @code{MINEXPONENT}:   MINEXPONENT, Minimum exponent of a real kind
171 * @code{MINLOC}:        MINLOC,    Location of the minimum value within an array
172 * @code{MINVAL}:        MINVAL,    Minimum value of an array
173 * @code{MOD}:           MOD,       Remainder function
174 * @code{MODULO}:        MODULO,    Modulo function
175 * @code{MVBITS}:        MVBITS,    Move bits from one integer to another
176 * @code{NEAREST}:       NEAREST,   Nearest representable number
177 * @code{NEQV}:          NEQV,      Logical non-equivalence
178 * @code{NINT}:          NINT,      Nearest whole number
179 * @code{NOT}:           NOT,       Logical negation
180 * @code{NULL}:          NULL,      Function that returns an dissassociated pointer
181 * @code{OR}:            OR,        Logical inclusive disjunction
182 * @code{PACK}:          PACK,      Pack an array into an array of rank one
183 * @code{PERROR}:        PERROR,    Print system error message
184 * @code{PRECISION}:     PRECISION, Decimal precision of a real kind
185 * @code{PRESENT}:       PRESENT,   Determine whether an optional argument is specified
186 * @code{PRODUCT}:       PRODUCT,   Product of array elements
187 * @code{RADIX}:         RADIX,     Base of a data model
188 * @code{RANDOM_NUMBER}: RANDOM_NUMBER, Pseudo-random number
189 * @code{RANDOM_SEED}:   RANDOM_SEED, Initialize a pseudo-random number sequence
190 * @code{RAND}:          RAND,      Real pseudo-random number
191 * @code{RANGE}:         RANGE,     Decimal exponent range of a real kind
192 * @code{RAN}:           RAN,       Real pseudo-random number
193 * @code{REAL}:          REAL,      Convert to real type 
194 * @code{RENAME}:        RENAME,    Rename a file
195 * @code{REPEAT}:        REPEAT,    Repeated string concatenation
196 * @code{RESHAPE}:       RESHAPE,   Function to reshape an array
197 * @code{RRSPACING}:     RRSPACING, Reciprocal of the relative spacing
198 * @code{RSHIFT}:        RSHIFT,    Right shift bits
199 * @code{SCALE}:         SCALE,     Scale a real value
200 * @code{SCAN}:          SCAN,      Scan a string for the presence of a set of characters
201 * @code{SECNDS}:        SECNDS,    Time function
202 @comment * @code{SECOND}:        SECOND,    (?)
203 @comment * @code{SECONDS}:       SECONDS,   (?)
204 * @code{SELECTED_INT_KIND}: SELECTED_INT_KIND,  Choose integer kind
205 * @code{SELECTED_REAL_KIND}: SELECTED_REAL_KIND,  Choose real kind
206 * @code{SET_EXPONENT}:  SET_EXPONENT, Set the exponent of the model
207 * @code{SHAPE}:         SHAPE,     Determine the shape of an array
208 * @code{SIGN}:          SIGN,      Sign copying function
209 * @code{SIGNAL}:        SIGNAL,    Signal handling subroutine (or function)
210 * @code{SIN}:           SIN,       Sine function
211 * @code{SINH}:          SINH,      Hyperbolic sine function
212 * @code{SIZE}:          SIZE,      Function to determine the size of an array
213 * @code{SNGL}:          SNGL,      Convert double precision real to default real
214 * @code{SPACING}:       SPACING,   Smallest distance between two numbers of a given type
215 * @code{SPREAD}:        SPREAD,    Add a dimension to an array 
216 * @code{SQRT}:          SQRT,      Square-root function
217 * @code{SRAND}:         SRAND,     Reinitialize the random number generator
218 * @code{STAT}:          STAT,      Get file status
219 * @code{SUM}:           SUM,       Sum of array elements
220 * @code{SYMLNK}:        SYMLNK,    Create a symbolic link
221 * @code{SYSTEM}:        SYSTEM,    Execute a shell command
222 * @code{SYSTEM_CLOCK}:  SYSTEM_CLOCK, Time function
223 * @code{TAN}:           TAN,       Tangent function
224 * @code{TANH}:          TANH,      Hyperbolic tangent function
225 * @code{TIME}:          TIME,      Time function
226 * @code{TINY}:          TINY,      Smallest positive number of a real kind
227 * @code{TRANSFER}:      TRANSFER,  Transfer bit patterns
228 * @code{TRANSPOSE}:     TRANSPOSE, Transpose an array of rank two
229 * @code{TRIM}:          TRIM,      Function to remove trailing blank characters of a string
230 * @code{UBOUND}:        UBOUND,    Upper dimension bounds of an array
231 * @code{UMASK}:         UMASK,     Set the file creation mask
232 * @code{UNLINK}:        UNLINK,    Remove a file from the file system
233 * @code{UNMASK}:        UNMASK,    (?)
234 * @code{UNPACK}:        UNPACK,    Unpack an array of rank one into an array
235 * @code{VERIFY}:        VERIFY,    Scan a string for the absence of a set of characters
236 * @code{XOR}:           XOR,       Logical exclusive or
237 @end menu
238
239 @node Introduction
240 @section Introduction to intrinsic procedures
241
242 Gfortran provides a rich set of intrinsic procedures that includes all
243 the intrinsic procedures required by the Fortran 95 standard, a set of
244 intrinsic procedures for backwards compatibility with Gnu Fortran 77
245 (i.e., @command{g77}), and a small selection of intrinsic procedures
246 from the Fortran 2003 standard.  Any description here, which conflicts with a 
247 description in either the Fortran 95 standard or the Fortran 2003 standard,
248 is unintentional and the standard(s) should be considered authoritative.
249
250 The enumeration of the @code{KIND} type parameter is processor defined in
251 the Fortran 95 standard.  Gfortran defines the default integer type and
252 default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)},
253 respectively.  The standard mandates that both data types shall have
254 another kind, which have more precision.  On typical target architectures
255 supported by @command{gfortran}, this kind type parameter is @code{KIND=8}.
256 Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
257 In the description of generic intrinsic procedures, the kind type parameter
258 will be specified by @code{KIND=*}, and in the description of specific
259 names for an intrinsic procedure the kind type parameter will be explicitly
260 given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}).  Finally, for
261 brevity the optional @code{KIND=} syntax will be omitted.
262
263 Many of the intrinsics procedures take one or more optional arguments.
264 This document follows the convention used in the Fortran 95 standard,
265 and denotes such arguments by square brackets.
266
267 @command{Gfortran} offers the @option{-std=f95} and @option{-std=gnu} options,
268 which can be used to restrict the set of intrinsic procedures to a 
269 given standard.  By default, @command{gfortran} sets the @option{-std=gnu}
270 option, and so all intrinsic procedures described here are accepted.  There
271 is one caveat.  For a select group of intrinsic procedures, @command{g77}
272 implemented both a function and a subroutine.  Both classes 
273 have been implemented in @command{gfortran} for backwards compatibility
274 with @command{g77}.  It is noted here that these functions and subroutines
275 cannot be intermixed in a given subprogram.  In the descriptions that follow,
276 the applicable option(s) is noted.
277
278
279
280 @node ABORT
281 @section @code{ABORT} --- Abort the program  
282 @findex @code{ABORT} intrinsic
283 @cindex abort
284
285 @table @asis
286 @item @emph{Description}:
287 @code{ABORT} causes immediate termination of the program.  On operating
288 systems that support a core dump, @code{ABORT} will produce a core dump,
289 which is suitable for debugging purposes.
290
291 @item @emph{Standard}:
292 GNU extension
293
294 @item @emph{Class}:
295 non-elemental subroutine
296
297 @item @emph{Syntax}:
298 @code{CALL ABORT}
299
300 @item @emph{Return value}:
301 Does not return.
302
303 @item @emph{Example}:
304 @smallexample
305 program test_abort
306   integer :: i = 1, j = 2
307   if (i /= j) call abort
308 end program test_abort
309 @end smallexample
310
311 @item @emph{See also}:
312 @ref{EXIT}, @ref{KILL}
313
314 @end table
315
316
317
318 @node ABS
319 @section @code{ABS} --- Absolute value  
320 @findex @code{ABS} intrinsic
321 @findex @code{CABS} intrinsic
322 @findex @code{DABS} intrinsic
323 @findex @code{IABS} intrinsic
324 @findex @code{ZABS} intrinsic
325 @findex @code{CDABS} intrinsic
326 @cindex absolute value
327
328 @table @asis
329 @item @emph{Description}:
330 @code{ABS(X)} computes the absolute value of @code{X}.
331
332 @item @emph{Standard}:
333 F77 and later, has overloads that are GNU extensions
334
335 @item @emph{Class}:
336 Elemental function
337
338 @item @emph{Syntax}:
339 @code{X = ABS(X)}
340
341 @item @emph{Arguments}:
342 @multitable @columnfractions .15 .80
343 @item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)},
344 @code{REAL(*)}, or @code{COMPLEX(*)}.
345 @end multitable
346
347 @item @emph{Return value}:
348 The return value is of the same type and
349 kind as the argument except the return value is @code{REAL(*)} for a
350 @code{COMPLEX(*)} argument.
351
352 @item @emph{Example}:
353 @smallexample
354 program test_abs
355   integer :: i = -1
356   real :: x = -1.e0
357   complex :: z = (-1.e0,0.e0)
358   i = abs(i)
359   x = abs(x)
360   x = abs(z)
361 end program test_abs
362 @end smallexample
363
364 @item @emph{Specific names}:
365 @multitable @columnfractions .20 .20 .20 .40
366 @item Name            @tab Argument            @tab Return type       @tab Standard
367 @item @code{CABS(Z)}  @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)}    @tab F77 and later
368 @item @code{DABS(X)}  @tab @code{REAL(8)    X} @tab @code{REAL(8)}    @tab F77 and later
369 @item @code{IABS(I)}  @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab F77 and later
370 @item @code{ZABS(Z)}  @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension
371 @item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab GNU extension
372 @end multitable
373 @end table
374
375
376 @node ACCESS
377 @section @code{ACCESS} --- Checks file access method
378 @findex @code{ACCESS} 
379 @cindex file system functions
380
381 Not yet implemented in gfortran.
382
383 @table @asis
384 @item @emph{Description}:
385
386 @item @emph{Standard}:
387 GNU extension
388
389 @item @emph{Class}:
390 @item @emph{Syntax}:
391 @item @emph{Arguments}:
392 @item @emph{Return value}:
393 @item @emph{Example}:
394 @item @emph{Specific names}:
395 @item @emph{See also}:
396 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
397
398 @end table
399
400
401 @node ACHAR
402 @section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence 
403 @findex @code{ACHAR} intrinsic
404 @cindex @acronym{ASCII} collating sequence
405
406 @table @asis
407 @item @emph{Description}:
408 @code{ACHAR(I)} returns the character located at position @code{I}
409 in the @acronym{ASCII} collating sequence.
410
411 @item @emph{Standard}:
412 F77 and later
413
414 @item @emph{Class}:
415 Elemental function
416
417 @item @emph{Syntax}:
418 @code{C = ACHAR(I)}
419
420 @item @emph{Arguments}:
421 @multitable @columnfractions .15 .80
422 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
423 @end multitable
424
425 @item @emph{Return value}:
426 The return value is of type @code{CHARACTER} with a length of one.  The
427 kind type parameter is the same as  @code{KIND('A')}.
428
429 @item @emph{Example}:
430 @smallexample
431 program test_achar
432   character c
433   c = achar(32)
434 end program test_achar
435 @end smallexample
436 @end table
437
438
439
440 @node ACOS
441 @section @code{ACOS} --- Arccosine function 
442 @findex @code{ACOS} intrinsic
443 @findex @code{DACOS} intrinsic
444 @cindex trigonometric functions (inverse)
445
446 @table @asis
447 @item @emph{Description}:
448 @code{ACOS(X)} computes the arccosine of @var{X} (inverse of @code{COS(X)}.
449
450 @item @emph{Standard}:
451 F77 and later
452
453 @item @emph{Class}:
454 Elemental function
455
456 @item @emph{Syntax}:
457 @code{X = ACOS(X)}
458
459 @item @emph{Arguments}:
460 @multitable @columnfractions .15 .80
461 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
462 less than one.
463 @end multitable
464
465 @item @emph{Return value}:
466 The return value is of type @code{REAL(*)} and it lies in the
467 range @math{ 0 \leq \arccos (x) \leq \pi}.  The kind type
468 parameter is the same as @var{X}.
469
470 @item @emph{Example}:
471 @smallexample
472 program test_acos
473   real(8) :: x = 0.866_8
474   x = acos(x)
475 end program test_acos
476 @end smallexample
477
478 @item @emph{Specific names}:
479 @multitable @columnfractions .20 .20 .20 .40
480 @item Name            @tab Argument          @tab Return type       @tab Standard
481 @item @code{DACOS(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F77 and later
482 @end multitable
483
484 @item @emph{See also}:
485 Inverse function: @ref{COS}
486
487 @end table
488
489
490 @node ACOSH
491 @section @code{ACOSH} --- Hyperbolic arccosine function
492 @findex @code{ACOSH} intrinsic
493 @cindex hyperbolic arccosine
494 @cindex hyperbolic cosine (inverse)
495
496 Intrinsic implemented, documentation pending.
497
498 @table @asis
499 @item @emph{Description}:
500 @item @emph{Standard}:
501 @item @emph{Class}:
502 @item @emph{Syntax}:
503 @item @emph{Arguments}:
504 @item @emph{Return value}:
505 @item @emph{Example}:
506 @item @emph{Specific names}:
507 @item @emph{See also}:
508 Inverse function: @ref{COSH}
509 @end table
510
511
512
513 @node ADJUSTL
514 @section @code{ADJUSTL} --- Left adjust a string 
515 @findex @code{ADJUSTL} intrinsic
516 @cindex adjust string
517
518 @table @asis
519 @item @emph{Description}:
520 @code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.
521 Spaces are inserted at the end of the string as needed.
522
523 @item @emph{Standard}:
524 F95 and later
525
526 @item @emph{Class}:
527 Elemental function
528
529 @item @emph{Syntax}:
530 @code{STR = ADJUSTL(STR)}
531
532 @item @emph{Arguments}:
533 @multitable @columnfractions .15 .80
534 @item @var{STR} @tab The type shall be @code{CHARACTER}.
535 @end multitable
536
537 @item @emph{Return value}:
538 The return value is of type @code{CHARACTER} where leading spaces 
539 are removed and the same number of spaces are inserted on the end
540 of @var{STR}.
541
542 @item @emph{Example}:
543 @smallexample
544 program test_adjustl
545   character(len=20) :: str = '   gfortran'
546   str = adjustl(str)
547   print *, str
548 end program test_adjustl
549 @end smallexample
550 @end table
551
552
553
554 @node ADJUSTR
555 @section @code{ADJUSTR} --- Right adjust a string 
556 @findex @code{ADJUSTR} intrinsic
557 @cindex adjust string
558
559 @table @asis
560 @item @emph{Description}:
561 @code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.
562 Spaces are inserted at the start of the string as needed.
563
564 @item @emph{Standard}:
565 F95 and later
566
567 @item @emph{Class}:
568 Elemental function
569
570 @item @emph{Syntax}:
571 @code{STR = ADJUSTR(STR)}
572
573 @item @emph{Arguments}:
574 @multitable @columnfractions .15 .80
575 @item @var{STR} @tab The type shall be @code{CHARACTER}.
576 @end multitable
577
578 @item @emph{Return value}:
579 The return value is of type @code{CHARACTER} where trailing spaces 
580 are removed and the same number of spaces are inserted at the start
581 of @var{STR}.
582
583 @item @emph{Example}:
584 @smallexample
585 program test_adjustr
586   character(len=20) :: str = 'gfortran'
587   str = adjustr(str)
588   print *, str
589 end program test_adjustr
590 @end smallexample
591 @end table
592
593
594
595 @node AIMAG
596 @section @code{AIMAG} --- Imaginary part of complex number  
597 @findex @code{AIMAG} intrinsic
598 @findex @code{DIMAG} intrinsic
599 @findex @code{IMAG} intrinsic
600 @findex @code{IMAGPART} intrinsic
601 @cindex Imaginary part
602
603 @table @asis
604 @item @emph{Description}:
605 @code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.
606 The @code{IMAG(Z)} and @code{IMAGPART(Z)} intrinsic functions are provided
607 for compatibility with @command{g77}, and their use in new code is 
608 strongly discouraged.
609
610 @item @emph{Standard}:
611 F77 and later, has overloads that are GNU extensions
612
613 @item @emph{Class}:
614 Elemental function
615
616 @item @emph{Syntax}:
617 @code{X = AIMAG(Z)}
618
619 @item @emph{Arguments}:
620 @multitable @columnfractions .15 .80
621 @item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.
622 @end multitable
623
624 @item @emph{Return value}:
625 The return value is of type real with the
626 kind type parameter of the argument.
627
628 @item @emph{Example}:
629 @smallexample
630 program test_aimag
631   complex(4) z4
632   complex(8) z8
633   z4 = cmplx(1.e0_4, 0.e0_4)
634   z8 = cmplx(0.e0_8, 1.e0_8)
635   print *, aimag(z4), dimag(z8)
636 end program test_aimag
637 @end smallexample
638
639 @item @emph{Specific names}:
640 @multitable @columnfractions .20 .20 .20 .40
641 @item Name            @tab Argument            @tab Return type       @tab Standard
642 @item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)}    @tab F95 and later
643 @item @code{IMAG(Z)}  @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)}    @tab GNU extension
644 @item @code{IMAGPART(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab GNU extension
645 @end multitable
646 @end table
647
648
649
650 @node AINT
651 @section @code{AINT} --- Truncate to a whole number
652 @findex @code{AINT} intrinsic
653 @findex @code{DINT} intrinsic
654 @cindex whole number
655
656 @table @asis
657 @item @emph{Description}:
658 @code{AINT(X [, KIND])} truncates its argument to a whole number.
659
660 @item @emph{Standard}:
661 F77 and later
662
663 @item @emph{Class}:
664 Elemental function
665
666 @item @emph{Syntax}:
667 @code{X = AINT(X)} 
668 @code{X = AINT(X, KIND)}
669
670 @item @emph{Arguments}:
671 @multitable @columnfractions .15 .80
672 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
673 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
674 initialization expression.
675 @end multitable
676
677 @item @emph{Return value}:
678 The return value is of type real with the kind type parameter of the
679 argument if the optional @var{KIND} is absent; otherwise, the kind
680 type parameter will be given by @var{KIND}.  If the magnitude of 
681 @var{X} is less than one, then @code{AINT(X)} returns zero.  If the
682 magnitude is equal to or greater than one, then it returns the largest
683 whole number that does not exceed its magnitude.  The sign is the same
684 as the sign of @var{X}. 
685
686 @item @emph{Example}:
687 @smallexample
688 program test_aint
689   real(4) x4
690   real(8) x8
691   x4 = 1.234E0_4
692   x8 = 4.321_8
693   print *, aint(x4), dint(x8)
694   x8 = aint(x4,8)
695 end program test_aint
696 @end smallexample
697
698 @item @emph{Specific names}:
699 @multitable @columnfractions .20 .20 .20 .40
700 @item Name           @tab Argument         @tab Return type      @tab Standard
701 @item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab F77 and later
702 @end multitable
703 @end table
704
705
706
707 @node ALARM
708 @section @code{ALARM} --- Execute a routine after a given delay
709 @findex @code{ALARM} intrinsic
710
711 @table @asis
712 @item @emph{Description}:
713 @code{ALARM(SECONDS, HANDLER [, STATUS])} causes external subroutine @var{HANDLER}
714 to be executed after a delay of @var{SECONDS} by using @code{alarm(1)} to
715 set up a signal and @code{signal(2)} to catch it. If @var{STATUS} is
716 supplied, it will be returned with the number of seconds remaining until
717 any previously scheduled alarm was due to be delivered, or zero if there
718 was no previously scheduled alarm.
719
720 @item @emph{Standard}:
721 GNU extension
722
723 @item @emph{Class}:
724 Subroutine
725
726 @item @emph{Syntax}:
727 @code{CALL ALARM(SECONDS, HANDLER)} 
728 @code{CALL ALARM(SECONDS, HANDLER, STATUS)}
729
730 @item @emph{Arguments}:
731 @multitable @columnfractions .15 .80
732 @item @var{SECONDS} @tab The type of the argument shall be a scalar
733 @code{INTEGER}. It is @code{INTENT(IN)}.
734 @item @var{HANDLER} @tab Signal handler (@code{INTEGER FUNCTION} or
735 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
736 @code{INTEGER}. It is @code{INTENT(IN)}.
737 @item @var{STATUS}  @tab (Optional) @var{STATUS} shall be a scalar
738 @code{INTEGER} variable. It is @code{INTENT(OUT)}.
739 @end multitable
740
741 @item @emph{Example}:
742 @smallexample
743 program test_alarm
744   external handler_print
745   integer i
746   call alarm (3, handler_print, i)
747   print *, i
748   call sleep(10)
749 end program test_alarm
750 @end smallexample
751 This will cause the external routine @var{handler_print} to be called
752 after 3 seconds.
753 @end table
754
755
756
757 @node ALL
758 @section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true 
759 @findex @code{ALL} intrinsic
760 @cindex true values
761
762 @table @asis
763 @item @emph{Description}:
764 @code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}
765 in the array along dimension @var{DIM}.
766
767 @item @emph{Standard}:
768 F95 and later
769
770 @item @emph{Class}:
771 transformational function
772
773 @item @emph{Syntax}:
774 @code{L = ALL(MASK)} 
775 @code{L = ALL(MASK, DIM)}
776
777 @item @emph{Arguments}:
778 @multitable @columnfractions .15 .80
779 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
780 it shall not be scalar.
781 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
782 with a value that lies between one and the rank of @var{MASK}.
783 @end multitable
784
785 @item @emph{Return value}:
786 @code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
787 the kind type parameter is the same as the kind type parameter of
788 @var{MASK}.  If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns
789 an array with the rank of @var{MASK} minus 1.  The shape is determined from
790 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
791
792 @table @asis
793 @item (A)
794 @code{ALL(MASK)} is true if all elements of @var{MASK} are true.
795 It also is true if @var{MASK} has zero size; otherwise, it is false.
796 @item (B)
797 If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent
798 to @code{ALL(MASK)}.  If the rank is greater than one, then @code{ALL(MASK,DIM)}
799 is determined by applying @code{ALL} to the array sections.
800 @end table
801
802 @item @emph{Example}:
803 @smallexample
804 program test_all
805   logical l
806   l = all((/.true., .true., .true./))
807   print *, l
808   call section
809   contains
810     subroutine section
811       integer a(2,3), b(2,3)
812       a = 1
813       b = 1
814       b(2,2) = 2
815       print *, all(a .eq. b, 1)
816       print *, all(a .eq. b, 2)
817     end subroutine section
818 end program test_all
819 @end smallexample
820 @end table
821
822
823
824 @node ALLOCATED
825 @section @code{ALLOCATED} --- Status of an allocatable entity
826 @findex @code{ALLOCATED} intrinsic
827 @cindex allocation status
828
829 @table @asis
830 @item @emph{Description}:
831 @code{ALLOCATED(X)} checks the status of whether @var{X} is allocated.
832
833 @item @emph{Standard}:
834 F95 and later
835
836 @item @emph{Class}:
837 Inquiry function
838
839 @item @emph{Syntax}:
840 @code{L = ALLOCATED(X)}
841
842 @item @emph{Arguments}:
843 @multitable @columnfractions .15 .80
844 @item @var{X}    @tab The argument shall be an @code{ALLOCATABLE} array.
845 @end multitable
846
847 @item @emph{Return value}:
848 The return value is a scalar @code{LOGICAL} with the default logical
849 kind type parameter.  If @var{X} is allocated, @code{ALLOCATED(X)}
850 is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.} 
851
852 @item @emph{Example}:
853 @smallexample
854 program test_allocated
855   integer :: i = 4
856   real(4), allocatable :: x(:)
857   if (allocated(x) .eqv. .false.) allocate(x(i))
858 end program test_allocated
859 @end smallexample
860 @end table
861
862
863 @node AND
864 @section @code{AND} --- Logical and
865 @findex @code{AND} intrinsic
866 @cindex logical operations
867
868 Intrinsic implemented, documentation pending.
869
870 @table @asis
871 @item @emph{Description}:
872 @item @emph{Standard}:
873 @item @emph{Class}:
874 @item @emph{Syntax}:
875 @item @emph{Arguments}:
876 @item @emph{Return value}:
877 @item @emph{Example}:
878 @item @emph{Specific names}:
879 @item @emph{See also}:
880 @end table
881
882
883
884 @node ANINT
885 @section @code{ANINT} --- Nearest whole number
886 @findex @code{ANINT} intrinsic
887 @findex @code{DNINT} intrinsic
888 @cindex whole number
889
890 @table @asis
891 @item @emph{Description}:
892 @code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.
893
894 @item @emph{Standard}:
895 F77 and later
896
897 @item @emph{Class}:
898 Elemental function
899
900 @item @emph{Syntax}:
901 @code{X = ANINT(X)}
902 @code{X = ANINT(X, KIND)}
903
904 @item @emph{Arguments}:
905 @multitable @columnfractions .15 .80
906 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
907 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
908 initialization expression.
909 @end multitable
910
911 @item @emph{Return value}:
912 The return value is of type real with the kind type parameter of the
913 argument if the optional @var{KIND} is absent; otherwise, the kind
914 type parameter will be given by @var{KIND}.  If @var{X} is greater than
915 zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}.  If @var{X} is
916 less than or equal to zero, then it returns @code{AINT(X-0.5)}.
917
918 @item @emph{Example}:
919 @smallexample
920 program test_anint
921   real(4) x4
922   real(8) x8
923   x4 = 1.234E0_4
924   x8 = 4.321_8
925   print *, anint(x4), dnint(x8)
926   x8 = anint(x4,8)
927 end program test_anint
928 @end smallexample
929
930 @item @emph{Specific names}:
931 @multitable @columnfractions .20 .20 .20 .40
932 @item Name            @tab Argument         @tab Return type      @tab Standard
933 @item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab F77 and later
934 @end multitable
935 @end table
936
937
938
939 @node ANY
940 @section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true 
941 @findex @code{ANY} intrinsic
942 @cindex true values
943
944 @table @asis
945 @item @emph{Description}:
946 @code{ANY(MASK [, DIM])} determines if any of the values in the logical array
947 @var{MASK} along dimension @var{DIM} are @code{.TRUE.}.
948
949 @item @emph{Standard}:
950 F95 and later
951
952 @item @emph{Class}:
953 transformational function
954
955 @item @emph{Syntax}:
956 @code{L = ANY(MASK)} 
957 @code{L = ANY(MASK, DIM)}
958
959 @item @emph{Arguments}:
960 @multitable @columnfractions .15 .80
961 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
962 it shall not be scalar.
963 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
964 with a value that lies between one and the rank of @var{MASK}.
965 @end multitable
966
967 @item @emph{Return value}:
968 @code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
969 the kind type parameter is the same as the kind type parameter of
970 @var{MASK}.  If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns
971 an array with the rank of @var{MASK} minus 1.  The shape is determined from
972 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
973
974 @table @asis
975 @item (A)
976 @code{ANY(MASK)} is true if any element of @var{MASK} is true;
977 otherwise, it is false.  It also is false if @var{MASK} has zero size.
978 @item (B)
979 If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent
980 to @code{ANY(MASK)}.  If the rank is greater than one, then @code{ANY(MASK,DIM)}
981 is determined by applying @code{ANY} to the array sections.
982 @end table
983
984 @item @emph{Example}:
985 @smallexample
986 program test_any
987   logical l
988   l = any((/.true., .true., .true./))
989   print *, l
990   call section
991   contains
992     subroutine section
993       integer a(2,3), b(2,3)
994       a = 1
995       b = 1
996       b(2,2) = 2
997       print *, any(a .eq. b, 1)
998       print *, any(a .eq. b, 2)
999     end subroutine section
1000 end program test_any
1001 @end smallexample
1002 @end table
1003
1004
1005
1006 @node ASIN
1007 @section @code{ASIN} --- Arcsine function 
1008 @findex @code{ASIN} intrinsic
1009 @findex @code{DASIN} intrinsic
1010 @cindex trigonometric functions (inverse)
1011
1012 @table @asis
1013 @item @emph{Description}:
1014 @code{ASIN(X)} computes the arcsine of its @var{X}.
1015
1016 @item @emph{Standard}:
1017 F77 and later
1018
1019 @item @emph{Class}:
1020 Elemental function
1021
1022 @item @emph{Syntax}:
1023 @code{X = ASIN(X)}
1024
1025 @item @emph{Arguments}:
1026 @multitable @columnfractions .15 .80
1027 @item @var{X} @tab The type shall be @code{REAL(*)}, and a magnitude that is
1028 less than one.
1029 @end multitable
1030
1031 @item @emph{Return value}:
1032 The return value is of type @code{REAL(*)} and it lies in the
1033 range @math{-\pi / 2 \leq \arcsin (x) \leq \pi / 2}.  The kind type
1034 parameter is the same as @var{X}.
1035
1036 @item @emph{Example}:
1037 @smallexample
1038 program test_asin
1039   real(8) :: x = 0.866_8
1040   x = asin(x)
1041 end program test_asin
1042 @end smallexample
1043
1044 @item @emph{Specific names}:
1045 @multitable @columnfractions .20 .20 .20 .40
1046 @item Name            @tab Argument          @tab Return type       @tab Standard
1047 @item @code{DASIN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F77 and later
1048 @end multitable
1049
1050 @item @emph{See also}:
1051 Inverse function: @ref{SIN}
1052
1053 @end table
1054
1055
1056 @node ASINH
1057 @section @code{ASINH} --- Hyperbolic arcsine function
1058 @findex @code{ASINH} intrinsic
1059 @cindex hyperbolic arcsine
1060 @cindex hyperbolic sine (inverse)
1061
1062 Intrinsic implemented, documentation pending.
1063
1064 @table @asis
1065 @item @emph{Description}:
1066 @item @emph{Standard}:
1067 @item @emph{Class}:
1068 @item @emph{Syntax}:
1069 @item @emph{Arguments}:
1070 @item @emph{Return value}:
1071 @item @emph{Example}:
1072 @item @emph{Specific names}:
1073 @item @emph{See also}:
1074 @end table
1075
1076
1077
1078 @node ASSOCIATED
1079 @section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair 
1080 @findex @code{ASSOCIATED} intrinsic
1081 @cindex pointer status
1082
1083 @table @asis
1084 @item @emph{Description}:
1085 @code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR}
1086 or if @var{PTR} is associated with the target @var{TGT}.
1087
1088 @item @emph{Standard}:
1089 F95 and later
1090
1091 @item @emph{Class}:
1092 Inquiry function
1093
1094 @item @emph{Syntax}:
1095 @code{L = ASSOCIATED(PTR)} 
1096 @code{L = ASSOCIATED(PTR [, TGT])}
1097
1098 @item @emph{Arguments}:
1099 @multitable @columnfractions .15 .80
1100 @item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute and
1101 it can be of any type.
1102 @item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} or
1103 a @code{TARGET}.  It must have the same type, kind type parameter, and
1104 array rank as @var{PTR}.
1105 @end multitable
1106 The status of neither @var{PTR} nor @var{TGT} can be undefined.
1107
1108 @item @emph{Return value}:
1109 @code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}.
1110 There are several cases:
1111 @table @asis
1112 @item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)}
1113 is true if @var{PTR} is associated with a target; otherwise, it returns false.
1114 @item (B) If @var{TGT} is present and a scalar target, the result is true if
1115 @var{TGT}
1116 is not a 0 sized storage sequence and the target associated with @var{PTR}
1117 occupies the same storage units.  If @var{PTR} is disassociated, then the 
1118 result is false.
1119 @item (C) If @var{TGT} is present and an array target, the result is true if
1120 @var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, are
1121 arrays whose elements are not 0 sized storage sequences, and @var{TGT} and
1122 @var{PTR} occupy the same storage units in array element order.
1123 As in case(B), the result is false, if @var{PTR} is disassociated.
1124 @item (D) If @var{TGT} is present and an scalar pointer, the result is true if
1125 target associated with @var{PTR} and the target associated with @var{TGT}
1126 are not 0 sized storage sequences and occupy the same storage units.
1127 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
1128 @item (E) If @var{TGT} is present and an array pointer, the result is true if
1129 target associated with @var{PTR} and the target associated with @var{TGT}
1130 have the same shape, are not 0 sized arrays, are arrays whose elements are
1131 not 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the same
1132 storage units in array element order.
1133 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
1134 @end table
1135
1136 @item @emph{Example}:
1137 @smallexample
1138 program test_associated
1139    implicit none
1140    real, target  :: tgt(2) = (/1., 2./)
1141    real, pointer :: ptr(:)
1142    ptr => tgt
1143    if (associated(ptr)     .eqv. .false.) call abort
1144    if (associated(ptr,tgt) .eqv. .false.) call abort
1145 end program test_associated
1146 @end smallexample
1147
1148 @item @emph{See also}:
1149 @ref{NULL}
1150 @end table
1151
1152
1153
1154 @node ATAN
1155 @section @code{ATAN} --- Arctangent function 
1156 @findex @code{ATAN} intrinsic
1157 @findex @code{DATAN} intrinsic
1158 @cindex trigonometric functions (inverse)
1159
1160 @table @asis
1161 @item @emph{Description}:
1162 @code{ATAN(X)} computes the arctangent of @var{X}.
1163
1164 @item @emph{Standard}:
1165 F77 and later
1166
1167 @item @emph{Class}:
1168 Elemental function
1169
1170 @item @emph{Syntax}:
1171 @code{X = ATAN(X)}
1172
1173 @item @emph{Arguments}:
1174 @multitable @columnfractions .15 .80
1175 @item @var{X} @tab The type shall be @code{REAL(*)}.
1176 @end multitable
1177
1178 @item @emph{Return value}:
1179 The return value is of type @code{REAL(*)} and it lies in the
1180 range @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}.
1181
1182 @item @emph{Example}:
1183 @smallexample
1184 program test_atan
1185   real(8) :: x = 2.866_8
1186   x = atan(x)
1187 end program test_atan
1188 @end smallexample
1189
1190 @item @emph{Specific names}:
1191 @multitable @columnfractions .20 .20 .20 .40
1192 @item Name            @tab Argument          @tab Return type       @tab Standard
1193 @item @code{DATAN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F77 and later
1194 @end multitable
1195
1196 @item @emph{See also}:
1197 Inverse function: @ref{TAN}
1198
1199 @end table
1200
1201
1202
1203 @node ATAN2
1204 @section @code{ATAN2} --- Arctangent function 
1205 @findex @code{ATAN2} intrinsic
1206 @findex @code{DATAN2} intrinsic
1207 @cindex trigonometric functions (inverse)
1208
1209 @table @asis
1210 @item @emph{Description}:
1211 @code{ATAN2(Y,X)} computes the arctangent of the complex number @math{X + i Y}.
1212
1213 @item @emph{Standard}:
1214 F77 and later
1215
1216 @item @emph{Class}:
1217 Elemental function
1218
1219 @item @emph{Syntax}:
1220 @code{X = ATAN2(Y,X)}
1221
1222 @item @emph{Arguments}:
1223 @multitable @columnfractions .15 .80
1224 @item @var{Y} @tab The type shall be @code{REAL(*)}.
1225 @item @var{X} @tab The type and kind type parameter shall be the same as @var{Y}.
1226 If @var{Y} is zero, then @var{X} must be nonzero.
1227 @end multitable
1228
1229 @item @emph{Return value}:
1230 The return value has the same type and kind type parameter as @var{Y}.
1231 It is the principal value of the complex number @math{X + i Y}.  If
1232 @var{X} is nonzero, then it lies in the range @math{-\pi \le \arccos (x) \leq \pi}.
1233 The sign is positive if @var{Y} is positive.  If @var{Y} is zero, then
1234 the return value is zero if @var{X} is positive and @math{\pi} if @var{X}
1235 is negative.  Finally, if @var{X} is zero, then the magnitude of the result
1236 is @math{\pi/2}.
1237
1238 @item @emph{Example}:
1239 @smallexample
1240 program test_atan2
1241   real(4) :: x = 1.e0_4, y = 0.5e0_4
1242   x = atan2(y,x)
1243 end program test_atan2
1244 @end smallexample
1245
1246 @item @emph{Specific names}:
1247 @multitable @columnfractions .20 .20 .20 .40
1248 @item Name            @tab Argument          @tab Return type    @tab Standard
1249 @item @code{DATAN2(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab F77 and later
1250 @end multitable
1251 @end table
1252
1253
1254
1255 @node ATANH
1256 @section @code{ATANH} --- Hyperbolic arctangent function
1257 @findex @code{ASINH} intrinsic
1258 @cindex hyperbolic arctangent
1259 @cindex hyperbolic tangent (inverse)
1260
1261 Intrinsic implemented, documentation pending.
1262
1263 @table @asis
1264 @item @emph{Description}:
1265 @item @emph{Standard}:
1266 @item @emph{Class}:
1267 @item @emph{Syntax}:
1268 @item @emph{Arguments}:
1269 @item @emph{Return value}:
1270 @item @emph{Example}:
1271 @item @emph{Specific names}:
1272 @item @emph{See also}:
1273 @end table
1274
1275
1276
1277
1278 @node BESJ0
1279 @section @code{BESJ0} --- Bessel function of the first kind of order 0
1280 @findex @code{BESJ0} intrinsic
1281 @findex @code{DBESJ0} intrinsic
1282 @cindex Bessel
1283
1284 @table @asis
1285 @item @emph{Description}:
1286 @code{BESJ0(X)} computes the Bessel function of the first kind of order 0
1287 of @var{X}.
1288
1289 @item @emph{Standard}:
1290 GNU extension
1291
1292 @item @emph{Class}:
1293 Elemental function
1294
1295 @item @emph{Syntax}:
1296 @code{X = BESJ0(X)}
1297
1298 @item @emph{Arguments}:
1299 @multitable @columnfractions .15 .80
1300 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1301 @end multitable
1302
1303 @item @emph{Return value}:
1304 The return value is of type @code{REAL(*)} and it lies in the
1305 range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
1306
1307 @item @emph{Example}:
1308 @smallexample
1309 program test_besj0
1310   real(8) :: x = 0.0_8
1311   x = besj0(x)
1312 end program test_besj0
1313 @end smallexample
1314
1315 @item @emph{Specific names}:
1316 @multitable @columnfractions .20 .20 .20 .40
1317 @item Name            @tab Argument          @tab Return type       @tab Standard
1318 @item @code{DBESJ0(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}   @tab GNU extension
1319 @end multitable
1320 @end table
1321
1322
1323
1324 @node BESJ1
1325 @section @code{BESJ1} --- Bessel function of the first kind of order 1
1326 @findex @code{BESJ1} intrinsic
1327 @findex @code{DBESJ1} intrinsic
1328 @cindex Bessel
1329
1330 @table @asis
1331 @item @emph{Description}:
1332 @code{BESJ1(X)} computes the Bessel function of the first kind of order 1
1333 of @var{X}.
1334
1335 @item @emph{Standard}:
1336 GNU extension
1337
1338 @item @emph{Class}:
1339 Elemental function
1340
1341 @item @emph{Syntax}:
1342 @code{X = BESJ1(X)}
1343
1344 @item @emph{Arguments}:
1345 @multitable @columnfractions .15 .80
1346 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1347 @end multitable
1348
1349 @item @emph{Return value}:
1350 The return value is of type @code{REAL(*)} and it lies in the
1351 range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
1352
1353 @item @emph{Example}:
1354 @smallexample
1355 program test_besj1
1356   real(8) :: x = 1.0_8
1357   x = besj1(x)
1358 end program test_besj1
1359 @end smallexample
1360
1361 @item @emph{Specific names}:
1362 @multitable @columnfractions .20 .20 .20 .40
1363 @item Name            @tab Argument          @tab Return type       @tab Standard
1364 @item @code{DBESJ1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
1365 @end multitable
1366 @end table
1367
1368
1369
1370 @node BESJN
1371 @section @code{BESJN} --- Bessel function of the first kind
1372 @findex @code{BESJN} intrinsic
1373 @findex @code{DBESJN} intrinsic
1374 @cindex Bessel
1375
1376 @table @asis
1377 @item @emph{Description}:
1378 @code{BESJN(N, X)} computes the Bessel function of the first kind of order
1379 @var{N} of @var{X}.
1380
1381 @item @emph{Standard}:
1382 GNU extension
1383
1384 @item @emph{Class}:
1385 Elemental function
1386
1387 @item @emph{Syntax}:
1388 @code{Y = BESJN(N, X)}
1389
1390 @item @emph{Arguments}:
1391 @multitable @columnfractions .15 .80
1392 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1393 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1394 @end multitable
1395
1396 @item @emph{Return value}:
1397 The return value is a scalar of type @code{REAL(*)}.
1398
1399 @item @emph{Example}:
1400 @smallexample
1401 program test_besjn
1402   real(8) :: x = 1.0_8
1403   x = besjn(5,x)
1404 end program test_besjn
1405 @end smallexample
1406
1407 @item @emph{Specific names}:
1408 @multitable @columnfractions .20 .20 .20 .40
1409 @item Name             @tab Argument            @tab Return type       @tab Standard
1410 @item @code{DBESJN(X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}    @tab GNU extension
1411 @item                  @tab @code{REAL(8) X}    @tab                   @tab
1412 @end multitable
1413 @end table
1414
1415
1416
1417 @node BESY0
1418 @section @code{BESY0} --- Bessel function of the second kind of order 0
1419 @findex @code{BESY0} intrinsic
1420 @findex @code{DBESY0} intrinsic
1421 @cindex Bessel
1422
1423 @table @asis
1424 @item @emph{Description}:
1425 @code{BESY0(X)} computes the Bessel function of the second kind of order 0
1426 of @var{X}.
1427
1428 @item @emph{Standard}:
1429 GNU extension
1430
1431 @item @emph{Class}:
1432 Elemental function
1433
1434 @item @emph{Syntax}:
1435 @code{X = BESY0(X)}
1436
1437 @item @emph{Arguments}:
1438 @multitable @columnfractions .15 .80
1439 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1440 @end multitable
1441
1442 @item @emph{Return value}:
1443 The return value is a scalar of type @code{REAL(*)}.
1444
1445 @item @emph{Example}:
1446 @smallexample
1447 program test_besy0
1448   real(8) :: x = 0.0_8
1449   x = besy0(x)
1450 end program test_besy0
1451 @end smallexample
1452
1453 @item @emph{Specific names}:
1454 @multitable @columnfractions .20 .20 .20 .40
1455 @item Name            @tab Argument          @tab Return type       @tab Standard
1456 @item @code{DBESY0(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
1457 @end multitable
1458 @end table
1459
1460
1461
1462 @node BESY1
1463 @section @code{BESY1} --- Bessel function of the second kind of order 1
1464 @findex @code{BESY1} intrinsic
1465 @findex @code{DBESY1} intrinsic
1466 @cindex Bessel
1467
1468 @table @asis
1469 @item @emph{Description}:
1470 @code{BESY1(X)} computes the Bessel function of the second kind of order 1
1471 of @var{X}.
1472
1473 @item @emph{Standard}:
1474 GNU extension
1475
1476 @item @emph{Class}:
1477 Elemental function
1478
1479 @item @emph{Syntax}:
1480 @code{X = BESY1(X)}
1481
1482 @item @emph{Arguments}:
1483 @multitable @columnfractions .15 .80
1484 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1485 @end multitable
1486
1487 @item @emph{Return value}:
1488 The return value is a scalar of type @code{REAL(*)}.
1489
1490 @item @emph{Example}:
1491 @smallexample
1492 program test_besy1
1493   real(8) :: x = 1.0_8
1494   x = besy1(x)
1495 end program test_besy1
1496 @end smallexample
1497
1498 @item @emph{Specific names}:
1499 @multitable @columnfractions .20 .20 .20 .40
1500 @item Name            @tab Argument          @tab Return type       @tab Standard
1501 @item @code{DBESY1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
1502 @end multitable
1503 @end table
1504
1505
1506
1507 @node BESYN
1508 @section @code{BESYN} --- Bessel function of the second kind
1509 @findex @code{BESYN} intrinsic
1510 @findex @code{DBESYN} intrinsic
1511 @cindex Bessel
1512
1513 @table @asis
1514 @item @emph{Description}:
1515 @code{BESYN(N, X)} computes the Bessel function of the second kind of order
1516 @var{N} of @var{X}.
1517
1518 @item @emph{Standard}:
1519 GNU extension
1520
1521 @item @emph{Class}:
1522 Elemental function
1523
1524 @item @emph{Syntax}:
1525 @code{Y = BESYN(N, X)}
1526
1527 @item @emph{Arguments}:
1528 @multitable @columnfractions .15 .80
1529 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1530 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1531 @end multitable
1532
1533 @item @emph{Return value}:
1534 The return value is a scalar of type @code{REAL(*)}.
1535
1536 @item @emph{Example}:
1537 @smallexample
1538 program test_besyn
1539   real(8) :: x = 1.0_8
1540   x = besyn(5,x)
1541 end program test_besyn
1542 @end smallexample
1543
1544 @item @emph{Specific names}:
1545 @multitable @columnfractions .20 .20 .20 .40
1546 @item Name               @tab Argument            @tab Return type     @tab Standard
1547 @item @code{DBESYN(N,X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}  @tab GNU extension
1548 @item                    @tab @code{REAL(8)    X} @tab                 @tab 
1549 @end multitable
1550 @end table
1551
1552
1553
1554 @node BIT_SIZE
1555 @section @code{BIT_SIZE} --- Bit size inquiry function
1556 @findex @code{BIT_SIZE} intrinsic
1557 @cindex bit_size
1558
1559 @table @asis
1560 @item @emph{Description}:
1561 @code{BIT_SIZE(I)} returns the number of bits (integer precision plus sign bit)
1562 represented by the type of @var{I}.
1563
1564 @item @emph{Standard}:
1565 F95 and later
1566
1567 @item @emph{Class}:
1568 Inquiry function
1569
1570 @item @emph{Syntax}:
1571 @code{I = BIT_SIZE(I)}
1572
1573 @item @emph{Arguments}:
1574 @multitable @columnfractions .15 .80
1575 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1576 @end multitable
1577
1578 @item @emph{Return value}:
1579 The return value is of type @code{INTEGER(*)}
1580
1581 @item @emph{Example}:
1582 @smallexample
1583 program test_bit_size
1584     integer :: i = 123
1585     integer :: size
1586     size = bit_size(i)
1587     print *, size
1588 end program test_bit_size
1589 @end smallexample
1590 @end table
1591
1592
1593
1594 @node BTEST
1595 @section @code{BTEST} --- Bit test function
1596 @findex @code{BTEST} intrinsic
1597 @cindex BTEST
1598
1599 @table @asis
1600 @item @emph{Description}:
1601 @code{BTEST(I,POS)} returns logical @code{.TRUE.} if the bit at @var{POS}
1602 in @var{I} is set.
1603
1604 @item @emph{Standard}:
1605 F95 and later
1606
1607 @item @emph{Class}:
1608 Elemental function
1609
1610 @item @emph{Syntax}:
1611 @code{I = BTEST(I,POS)}
1612
1613 @item @emph{Arguments}:
1614 @multitable @columnfractions .15 .80
1615 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1616 @item @var{POS} @tab The type shall be @code{INTEGER(*)}.
1617 @end multitable
1618
1619 @item @emph{Return value}:
1620 The return value is of type @code{LOGICAL}
1621
1622 @item @emph{Example}:
1623 @smallexample
1624 program test_btest
1625     integer :: i = 32768 + 1024 + 64
1626     integer :: pos
1627     logical :: bool
1628     do pos=0,16
1629         bool = btest(i, pos) 
1630         print *, pos, bool
1631     end do
1632 end program test_btest
1633 @end smallexample
1634 @end table
1635
1636
1637
1638 @node CEILING
1639 @section @code{CEILING} --- Integer ceiling function
1640 @findex @code{CEILING} intrinsic
1641 @cindex CEILING
1642
1643 @table @asis
1644 @item @emph{Description}:
1645 @code{CEILING(X)} returns the least integer greater than or equal to @var{X}.
1646
1647 @item @emph{Standard}:
1648 F95 and later
1649
1650 @item @emph{Class}:
1651 Elemental function
1652
1653 @item @emph{Syntax}:
1654 @code{I = CEILING(X[,KIND])}
1655
1656 @item @emph{Arguments}:
1657 @multitable @columnfractions .15 .80
1658 @item @var{X} @tab The type shall be @code{REAL(*)}.
1659 @item @var{KIND} @tab (Optional) scalar integer initialization expression.
1660 @end multitable
1661
1662 @item @emph{Return value}:
1663 The return value is of type @code{INTEGER(KIND)}
1664
1665 @item @emph{Example}:
1666 @smallexample
1667 program test_ceiling
1668     real :: x = 63.29
1669     real :: y = -63.59
1670     print *, ceiling(x) ! returns 64
1671     print *, ceiling(y) ! returns -63
1672 end program test_ceiling
1673 @end smallexample
1674
1675 @item @emph{See also}:
1676 @ref{FLOOR}, @ref{NINT}
1677
1678 @end table
1679
1680
1681
1682 @node CHAR
1683 @section @code{CHAR} --- Character conversion function
1684 @findex @code{CHAR} intrinsic
1685 @cindex conversion function (character)
1686
1687 @table @asis
1688 @item @emph{Description}:
1689 @code{CHAR(I,[KIND])} returns the character represented by the integer @var{I}.
1690
1691 @item @emph{Standard}:
1692 F77 and later
1693
1694 @item @emph{Class}:
1695 Elemental function
1696
1697 @item @emph{Syntax}:
1698 @code{C = CHAR(I[,KIND])}
1699
1700 @item @emph{Arguments}:
1701 @multitable @columnfractions .15 .80
1702 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1703 @item @var{KIND} @tab Optional scaler integer initialization expression.
1704 @end multitable
1705
1706 @item @emph{Return value}:
1707 The return value is of type @code{CHARACTER(1)}
1708
1709 @item @emph{Example}:
1710 @smallexample
1711 program test_char
1712     integer :: i = 74
1713     character(1) :: c
1714     c = char(i)
1715     print *, i, c ! returns 'J'
1716 end program test_char
1717 @end smallexample
1718
1719 @item @emph{See also}:
1720 @ref{ACHAR}, @ref{ICHAR}, @ref{IACHAR}
1721
1722 @end table
1723
1724
1725 @node CHDIR
1726 @section @code{CHDIR} --- Change working directory
1727 @findex @code{CHDIR} intrinsic
1728 @cindex file system functions
1729
1730 Intrinsic implemented, documentation pending.
1731
1732 @table @asis
1733 @item @emph{Description}:
1734 @item @emph{Standard}:
1735 @item @emph{Class}:
1736 @item @emph{Syntax}:
1737 @item @emph{Arguments}:
1738 @item @emph{Return value}:
1739 @item @emph{Example}:
1740 @item @emph{Specific names}:
1741 @item @emph{See also}:
1742 @end table
1743
1744
1745 @node CHMOD
1746 @section @code{CHMOD} --- Change access permissions of files
1747 @findex @code{CHMOD} 
1748 @cindex file system functions
1749
1750 Not yet implemented in gfortran.
1751
1752 @table @asis
1753 @item @emph{Description}:
1754
1755 @item @emph{Standard}:
1756 GNU extension
1757
1758 @item @emph{Class}:
1759 Subroutine
1760
1761 @item @emph{Syntax}:
1762 @item @emph{Arguments}:
1763 @item @emph{Return value}:
1764 @item @emph{Example}:
1765 @item @emph{Specific names}:
1766 @item @emph{See also}:
1767 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
1768
1769 @end table
1770
1771
1772 @node CMPLX
1773 @section @code{CMPLX} --- Complex conversion function
1774 @findex @code{CMPLX} intrinsic
1775 @cindex CMPLX
1776
1777 @table @asis
1778 @item @emph{Description}:
1779 @code{CMPLX(X[,Y[,KIND]])} returns a complex number where @var{X} is converted to
1780 the real component.  If @var{Y} is present it is converted to the imaginary
1781 component.  If @var{Y} is not present then the imaginary component is set to
1782 0.0.  If @var{X} is complex then @var{Y} must not be present.
1783
1784 @item @emph{Standard}:
1785 F77 and later
1786
1787 @item @emph{Class}:
1788 Elemental function
1789
1790 @item @emph{Syntax}:
1791 @code{C = CMPLX(X[,Y[,KIND]])}
1792
1793 @item @emph{Arguments}:
1794 @multitable @columnfractions .15 .80
1795 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1796 @item @var{Y} @tab Optional, allowed if @var{X} is not @code{COMPLEX(*)}.  May be @code{INTEGER(*)} or @code{REAL(*)}. 
1797 @item @var{KIND} @tab Optional scaler integer initialization expression.
1798 @end multitable
1799
1800 @item @emph{Return value}:
1801 The return value is of type @code{COMPLEX(*)}
1802
1803 @item @emph{Example}:
1804 @smallexample
1805 program test_cmplx
1806     integer :: i = 42
1807     real :: x = 3.14
1808     complex :: z
1809     z = cmplx(i, x)
1810     print *, z, cmplx(x)
1811 end program test_cmplx
1812 @end smallexample
1813 @end table
1814
1815
1816
1817 @node COMMAND_ARGUMENT_COUNT
1818 @section @code{COMMAND_ARGUMENT_COUNT} --- Argument count function 
1819 @findex @code{COMMAND_ARGUMENT_COUNT} intrinsic
1820 @cindex command argument count
1821
1822 @table @asis
1823 @item @emph{Description}:
1824 @code{COMMAND_ARGUMENT_COUNT()} returns the number of arguments passed on the
1825 command line when the containing program was invoked.
1826
1827 @item @emph{Standard}:
1828 F2003
1829
1830 @item @emph{Class}:
1831 Inquiry function
1832
1833 @item @emph{Syntax}:
1834 @code{I = COMMAND_ARGUMENT_COUNT()}
1835
1836 @item @emph{Arguments}:
1837 @multitable @columnfractions .15 .80
1838 @item None
1839 @end multitable
1840
1841 @item @emph{Return value}:
1842 The return value is of type @code{INTEGER(4)}
1843
1844 @item @emph{Example}:
1845 @smallexample
1846 program test_command_argument_count
1847     integer :: count
1848     count = command_argument_count()
1849     print *, count
1850 end program test_command_argument_count
1851 @end smallexample
1852 @end table
1853
1854
1855
1856 @node CONJG
1857 @section @code{CONJG} --- Complex conjugate function 
1858 @findex @code{CONJG} intrinsic
1859 @findex @code{DCONJG} intrinsic
1860 @cindex complex conjugate
1861 @table @asis
1862 @item @emph{Description}:
1863 @code{CONJG(Z)} returns the conjugate of @var{Z}.  If @var{Z} is @code{(x, y)}
1864 then the result is @code{(x, -y)}
1865
1866 @item @emph{Standard}:
1867 F77 and later, has overloads that are GNU extensions
1868
1869 @item @emph{Class}:
1870 Elemental function
1871
1872 @item @emph{Syntax}:
1873 @code{Z = CONJG(Z)}
1874
1875 @item @emph{Arguments}:
1876 @multitable @columnfractions .15 .80
1877 @item @var{Z} @tab The type shall be @code{COMPLEX(*)}.
1878 @end multitable
1879
1880 @item @emph{Return value}:
1881 The return value is of type @code{COMPLEX(*)}.
1882
1883 @item @emph{Example}:
1884 @smallexample
1885 program test_conjg
1886     complex :: z = (2.0, 3.0)
1887     complex(8) :: dz = (2.71_8, -3.14_8)
1888     z= conjg(z)
1889     print *, z
1890     dz = dconjg(dz)
1891     print *, dz
1892 end program test_conjg
1893 @end smallexample
1894
1895 @item @emph{Specific names}:
1896 @multitable @columnfractions .20 .20 .20 .40
1897 @item Name             @tab Argument             @tab Return type          @tab Standard
1898 @item @code{DCONJG(Z)} @tab @code{COMPLEX(8) Z}  @tab @code{COMPLEX(8)}    @tab GNU extension
1899 @end multitable
1900 @end table
1901
1902
1903
1904 @node COS
1905 @section @code{COS} --- Cosine function 
1906 @findex @code{COS} intrinsic
1907 @findex @code{DCOS} intrinsic
1908 @findex @code{ZCOS} intrinsic
1909 @findex @code{CDCOS} intrinsic
1910 @cindex trigonometric functions
1911
1912 @table @asis
1913 @item @emph{Description}:
1914 @code{COS(X)} computes the cosine of @var{X}.
1915
1916 @item @emph{Standard}:
1917 F77 and later, has overloads that are GNU extensions
1918
1919 @item @emph{Class}:
1920 Elemental function
1921
1922 @item @emph{Syntax}:
1923 @code{X = COS(X)}
1924
1925 @item @emph{Arguments}:
1926 @multitable @columnfractions .15 .80
1927 @item @var{X} @tab The type shall be @code{REAL(*)} or
1928 @code{COMPLEX(*)}.
1929 @end multitable
1930
1931 @item @emph{Return value}:
1932 The return value is of type @code{REAL(*)} and it lies in the
1933 range @math{ -1 \leq \cos (x) \leq 1}.  The kind type
1934 parameter is the same as @var{X}.
1935
1936 @item @emph{Example}:
1937 @smallexample
1938 program test_cos
1939   real :: x = 0.0
1940   x = cos(x)
1941 end program test_cos
1942 @end smallexample
1943
1944 @item @emph{Specific names}:
1945 @multitable @columnfractions .20 .20 .20 .40
1946 @item Name            @tab Argument            @tab Return type       @tab Standard
1947 @item @code{DCOS(X)}  @tab @code{REAL(8) X}    @tab @code{REAL(8)}    @tab F77 and later
1948 @item @code{CCOS(X)}  @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab F77 and later
1949 @item @code{ZCOS(X)}  @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
1950 @item @code{CDCOS(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab GNU extension
1951 @end multitable
1952
1953 @item @emph{See also}:
1954 Inverse function: @ref{ACOS}
1955
1956 @end table
1957
1958
1959
1960 @node COSH
1961 @section @code{COSH} --- Hyperbolic cosine function 
1962 @findex @code{COSH} intrinsic
1963 @findex @code{DCOSH} intrinsic
1964 @cindex hyperbolic cosine
1965
1966 @table @asis
1967 @item @emph{Description}:
1968 @code{COSH(X)} computes the hyperbolic cosine of @var{X}.
1969
1970 @item @emph{Standard}:
1971 F77 and later
1972
1973 @item @emph{Class}:
1974 Elemental function
1975
1976 @item @emph{Syntax}:
1977 @code{X = COSH(X)}
1978
1979 @item @emph{Arguments}:
1980 @multitable @columnfractions .15 .80
1981 @item @var{X} @tab The type shall be @code{REAL(*)}.
1982 @end multitable
1983
1984 @item @emph{Return value}:
1985 The return value is of type @code{REAL(*)} and it is positive
1986 (@math{ \cosh (x) \geq 0 }.
1987
1988 @item @emph{Example}:
1989 @smallexample
1990 program test_cosh
1991   real(8) :: x = 1.0_8
1992   x = cosh(x)
1993 end program test_cosh
1994 @end smallexample
1995
1996 @item @emph{Specific names}:
1997 @multitable @columnfractions .20 .20 .20 .40
1998 @item Name            @tab Argument          @tab Return type       @tab Standard
1999 @item @code{DCOSH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F77 and later
2000 @end multitable
2001
2002 @item @emph{See also}:
2003 Inverse function: @ref{ACOSH}
2004
2005 @end table
2006
2007
2008
2009 @node COUNT
2010 @section @code{COUNT} --- Count function
2011 @findex @code{COUNT} intrinsic
2012 @cindex count
2013
2014 @table @asis
2015 @item @emph{Description}:
2016 @code{COUNT(MASK[,DIM])} counts the number of @code{.TRUE.} elements of
2017 @var{MASK} along the dimension of @var{DIM}.  If @var{DIM} is omitted it is
2018 taken to be @code{1}.  @var{DIM} is a scaler of type @code{INTEGER} in the
2019 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{MASK}.
2020
2021 @item @emph{Standard}:
2022 F95 and later
2023
2024 @item @emph{Class}:
2025 transformational function
2026
2027 @item @emph{Syntax}:
2028 @code{I = COUNT(MASK[,DIM])}
2029
2030 @item @emph{Arguments}:
2031 @multitable @columnfractions .15 .80
2032 @item @var{MASK} @tab The type shall be @code{LOGICAL}.
2033 @item @var{DIM}  @tab The type shall be @code{INTEGER}.
2034 @end multitable
2035
2036 @item @emph{Return value}:
2037 The return value is of type @code{INTEGER} with rank equal to that of
2038 @var{MASK}.
2039
2040 @item @emph{Example}:
2041 @smallexample
2042 program test_count
2043     integer, dimension(2,3) :: a, b
2044     logical, dimension(2,3) :: mask
2045     a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
2046     b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
2047     print '(3i3)', a(1,:)
2048     print '(3i3)', a(2,:)
2049     print *
2050     print '(3i3)', b(1,:)
2051     print '(3i3)', b(2,:)
2052     print *
2053     mask = a.ne.b
2054     print '(3l3)', mask(1,:)
2055     print '(3l3)', mask(2,:)
2056     print *
2057     print '(3i3)', count(mask)
2058     print *
2059     print '(3i3)', count(mask, 1)
2060     print *
2061     print '(3i3)', count(mask, 2)
2062 end program test_count
2063 @end smallexample
2064 @end table
2065
2066
2067
2068 @node CPU_TIME
2069 @section @code{CPU_TIME} --- CPU elapsed time in seconds
2070 @findex @code{CPU_TIME} intrinsic
2071 @cindex CPU_TIME
2072
2073 @table @asis
2074 @item @emph{Description}:
2075 Returns a @code{REAL} value representing the elapsed CPU time in seconds.  This
2076 is useful for testing segments of code to determine execution time.
2077
2078 @item @emph{Standard}:
2079 F95 and later
2080
2081 @item @emph{Class}:
2082 Subroutine
2083
2084 @item @emph{Syntax}:
2085 @code{CPU_TIME(X)}
2086
2087 @item @emph{Arguments}:
2088 @multitable @columnfractions .15 .80
2089 @item @var{X} @tab The type shall be @code{REAL} with @code{INTENT(OUT)}.
2090 @end multitable
2091
2092 @item @emph{Return value}:
2093 None
2094
2095 @item @emph{Example}:
2096 @smallexample
2097 program test_cpu_time
2098     real :: start, finish
2099     call cpu_time(start)
2100         ! put code to test here
2101     call cpu_time(finish)
2102     print '("Time = ",f6.3," seconds.")',finish-start
2103 end program test_cpu_time
2104 @end smallexample
2105 @end table
2106
2107
2108
2109 @node CSHIFT
2110 @section @code{CSHIFT} --- Circular shift function
2111 @findex @code{CSHIFT} intrinsic
2112 @cindex bit manipulation
2113
2114 @table @asis
2115 @item @emph{Description}:
2116 @code{CSHIFT(ARRAY, SHIFT[,DIM])} performs a circular shift on elements of
2117 @var{ARRAY} along the dimension of @var{DIM}.  If @var{DIM} is omitted it is
2118 taken to be @code{1}.  @var{DIM} is a scaler of type @code{INTEGER} in the
2119 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{ARRAY}.
2120 If the rank of @var{ARRAY} is one, then all elements of @var{ARRAY} are shifted
2121 by @var{SHIFT} places.  If rank is greater than one, then all complete rank one
2122 sections of @var{ARRAY} along the given dimension are shifted.  Elements
2123 shifted out one end of each rank one section are shifted back in the other end.
2124
2125 @item @emph{Standard}:
2126 F95 and later
2127
2128 @item @emph{Class}:
2129 transformational function
2130
2131 @item @emph{Syntax}:
2132 @code{A = CSHIFT(A, SHIFT[,DIM])}
2133
2134 @item @emph{Arguments}:
2135 @multitable @columnfractions .15 .80
2136 @item @var{ARRAY}  @tab May be any type, not scaler.
2137 @item @var{SHIFT}  @tab The type shall be @code{INTEGER}.
2138 @item @var{DIM}    @tab The type shall be @code{INTEGER}.
2139 @end multitable
2140
2141 @item @emph{Return value}:
2142 Returns an array of same type and rank as the @var{ARRAY} argument.
2143
2144 @item @emph{Example}:
2145 @smallexample
2146 program test_cshift
2147     integer, dimension(3,3) :: a
2148     a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2149     print '(3i3)', a(1,:)
2150     print '(3i3)', a(2,:)
2151     print '(3i3)', a(3,:)    
2152     a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
2153     print *
2154     print '(3i3)', a(1,:)
2155     print '(3i3)', a(2,:)
2156     print '(3i3)', a(3,:)
2157 end program test_cshift
2158 @end smallexample
2159 @end table
2160
2161
2162 @node CTIME
2163 @section @code{CTIME} --- Convert a time into a string
2164 @findex @code{CTIME} intrinsic
2165 @cindex ctime subroutine 
2166
2167 @table @asis
2168 @item @emph{Description}:
2169 @code{CTIME(T,S)} converts @var{T}, a system time value, such as returned
2170 by @code{TIME8()}, to a string of the form @samp{Sat Aug 19 18:13:14
2171 1995}, and returns that string into @var{S}.
2172
2173 If @code{CTIME} is invoked as a function, it can not be invoked as a
2174 subroutine, and vice versa.
2175
2176 @var{T} is an @code{INTENT(IN)} @code{INTEGER(KIND=8)} variable.
2177 @var{S} is an @code{INTENT(OUT)} @code{CHARACTER} variable.
2178
2179 @item @emph{Standard}:
2180 GNU extension
2181
2182 @item @emph{Class}:
2183 Subroutine
2184
2185 @item @emph{Syntax}:
2186 @multitable @columnfractions .80
2187 @item @code{CALL CTIME(T,S)}.
2188 @item @code{S = CTIME(T)}, (not recommended).
2189 @end multitable
2190
2191 @item @emph{Arguments}:
2192 @multitable @columnfractions .15 .80
2193 @item @var{S}@tab The type shall be of type @code{CHARACTER}.
2194 @item @var{T}@tab The type shall be of type @code{INTEGER(KIND=8)}.
2195 @end multitable
2196
2197 @item @emph{Return value}:
2198 The converted date and time as a string.
2199
2200 @item @emph{Example}:
2201 @smallexample
2202 program test_ctime
2203     integer(8) :: i
2204     character(len=30) :: date
2205     i = time8()
2206
2207     ! Do something, main part of the program
2208     
2209     call ctime(i,date)
2210     print *, 'Program was started on ', date
2211 end program test_ctime
2212 @end smallexample
2213 @end table
2214
2215 @node DATE_AND_TIME
2216 @section @code{DATE_AND_TIME} --- Date and time subroutine
2217 @findex @code{DATE_AND_TIME} intrinsic
2218 @cindex DATE_AND_TIME
2219
2220 @table @asis
2221 @item @emph{Description}:
2222 @code{DATE_AND_TIME(DATE, TIME, ZONE, VALUES)} gets the corresponding date and
2223 time information from the real-time system clock.  @var{DATE} is
2224 @code{INTENT(OUT)} and has form ccyymmdd.  @var{TIME} is @code{INTENT(OUT)} and
2225 has form hhmmss.sss.  @var{ZONE} is @code{INTENT(OUT)} and has form (+-)hhmm,
2226 representing the difference with respect to Coordinated Universal Time (UTC).
2227 Unavailable time and date parameters return blanks.
2228
2229 @var{VALUES} is @code{INTENT(OUT)} and provides the following:
2230
2231 @multitable @columnfractions .15 .30 .60
2232 @item @tab @code{VALUE(1)}: @tab The year
2233 @item @tab @code{VALUE(2)}: @tab The month
2234 @item @tab @code{VALUE(3)}: @tab The day of the month
2235 @item @tab @code{VAlUE(4)}: @tab Time difference with UTC in minutes
2236 @item @tab @code{VALUE(5)}: @tab The hour of the day
2237 @item @tab @code{VALUE(6)}: @tab The minutes of the hour
2238 @item @tab @code{VALUE(7)}: @tab The seconds of the minute
2239 @item @tab @code{VALUE(8)}: @tab The milliseconds of the second
2240 @end multitable     
2241
2242 @item @emph{Standard}:
2243 F95 and later
2244
2245 @item @emph{Class}:
2246 Subroutine
2247
2248 @item @emph{Syntax}:
2249 @code{CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])}
2250
2251 @item @emph{Arguments}:
2252 @multitable @columnfractions .15 .80
2253 @item @var{DATE}  @tab (Optional) The type shall be @code{CHARACTER(8)} or larger.
2254 @item @var{TIME}  @tab (Optional) The type shall be @code{CHARACTER(10)} or larger.
2255 @item @var{ZONE}  @tab (Optional) The type shall be @code{CHARACTER(5)} or larger.
2256 @item @var{VALUES}@tab (Optional) The type shall be @code{INTEGER(8)}.
2257 @end multitable
2258
2259 @item @emph{Return value}:
2260 None
2261
2262 @item @emph{Example}:
2263 @smallexample
2264 program test_time_and_date
2265     character(8)  :: date
2266     character(10) :: time
2267     character(5)  :: zone
2268     integer,dimension(8) :: values
2269     ! using keyword arguments
2270     call date_and_time(date,time,zone,values)
2271     call date_and_time(DATE=date,ZONE=zone)
2272     call date_and_time(TIME=time)
2273     call date_and_time(VALUES=values)
2274     print '(a,2x,a,2x,a)', date, time, zone
2275     print '(8i5))', values
2276 end program test_time_and_date
2277 @end smallexample
2278 @end table
2279
2280
2281
2282 @node DBLE
2283 @section @code{DBLE} --- Double conversion function 
2284 @findex @code{DBLE} intrinsic
2285 @cindex double conversion
2286
2287 @table @asis
2288 @item @emph{Description}:
2289 @code{DBLE(X)} Converts @var{X} to double precision real type.
2290
2291 @item @emph{Standard}:
2292 F77 and later
2293
2294 @item @emph{Class}:
2295 Elemental function
2296
2297 @item @emph{Syntax}:
2298 @code{X = DBLE(X)}
2299
2300 @item @emph{Arguments}:
2301 @multitable @columnfractions .15 .80
2302 @item @var{X} @tab The type shall be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
2303 @end multitable
2304
2305 @item @emph{Return value}:
2306 The return value is of type double precision real.
2307
2308 @item @emph{Example}:
2309 @smallexample
2310 program test_dble
2311     real    :: x = 2.18
2312     integer :: i = 5
2313     complex :: z = (2.3,1.14)
2314     print *, dble(x), dble(i), dble(z)
2315 end program test_dble
2316 @end smallexample
2317
2318 @item @emph{See also}:
2319 @ref{DFLOAT}, @ref{FLOAT}, @ref{REAL}
2320 @end table
2321
2322
2323
2324 @node DCMPLX
2325 @section @code{DCMPLX} --- Double complex conversion function
2326 @findex @code{DCMPLX} intrinsic
2327 @cindex DCMPLX
2328
2329 @table @asis
2330 @item @emph{Description}:
2331 @code{DCMPLX(X [,Y])} returns a double complex number where @var{X} is
2332 converted to the real component.  If @var{Y} is present it is converted to the
2333 imaginary component.  If @var{Y} is not present then the imaginary component is
2334 set to 0.0.  If @var{X} is complex then @var{Y} must not be present.
2335
2336 @item @emph{Standard}:
2337 GNU extension
2338
2339 @item @emph{Class}:
2340 Elemental function
2341
2342 @item @emph{Syntax}:
2343 @code{C = DCMPLX(X)}
2344 @code{C = DCMPLX(X,Y)}
2345
2346 @item @emph{Arguments}:
2347 @multitable @columnfractions .15 .80
2348 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
2349 @item @var{Y} @tab Optional if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}. 
2350 @end multitable
2351
2352 @item @emph{Return value}:
2353 The return value is of type @code{COMPLEX(8)}
2354
2355 @item @emph{Example}:
2356 @smallexample
2357 program test_dcmplx
2358     integer :: i = 42
2359     real :: x = 3.14
2360     complex :: z
2361     z = cmplx(i, x)
2362     print *, dcmplx(i)
2363     print *, dcmplx(x)
2364     print *, dcmplx(z)
2365     print *, dcmplx(x,i)
2366 end program test_dcmplx
2367 @end smallexample
2368 @end table
2369
2370
2371
2372 @node DFLOAT
2373 @section @code{DFLOAT} --- Double conversion function 
2374 @findex @code{DFLOAT} intrinsic
2375 @cindex double float conversion
2376
2377 @table @asis
2378 @item @emph{Description}:
2379 @code{DFLOAT(X)} Converts @var{X} to double precision real type.
2380
2381 @item @emph{Standard}:
2382 GNU extension
2383
2384 @item @emph{Class}:
2385 Elemental function
2386
2387 @item @emph{Syntax}:
2388 @code{X = DFLOAT(X)}
2389
2390 @item @emph{Arguments}:
2391 @multitable @columnfractions .15 .80
2392 @item @var{X} @tab The type shall be @code{INTEGER(*)}.
2393 @end multitable
2394
2395 @item @emph{Return value}:
2396 The return value is of type double precision real.
2397
2398 @item @emph{Example}:
2399 @smallexample
2400 program test_dfloat
2401     integer :: i = 5
2402     print *, dfloat(i)
2403 end program test_dfloat
2404 @end smallexample
2405
2406 @item @emph{See also}:
2407 @ref{DBLE}, @ref{FLOAT}, @ref{REAL}
2408 @end table
2409
2410
2411
2412 @node DIGITS
2413 @section @code{DIGITS} --- Significant digits function
2414 @findex @code{DIGITS} intrinsic
2415 @cindex digits, significant
2416
2417 @table @asis
2418 @item @emph{Description}:
2419 @code{DIGITS(X)} returns the number of significant digits of the internal model
2420 representation of @var{X}.  For example, on a system using a 32-bit
2421 floating point representation, a default real number would likely return 24.
2422
2423 @item @emph{Standard}:
2424 F95 and later
2425
2426 @item @emph{Class}:
2427 Inquiry function
2428
2429 @item @emph{Syntax}:
2430 @code{C = DIGITS(X)}
2431
2432 @item @emph{Arguments}:
2433 @multitable @columnfractions .15 .80
2434 @item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
2435 @end multitable
2436
2437 @item @emph{Return value}:
2438 The return value is of type @code{INTEGER}.
2439
2440 @item @emph{Example}:
2441 @smallexample
2442 program test_digits
2443     integer :: i = 12345
2444     real :: x = 3.143
2445     real(8) :: y = 2.33
2446     print *, digits(i)
2447     print *, digits(x)
2448     print *, digits(y)
2449 end program test_digits
2450 @end smallexample
2451 @end table
2452
2453
2454
2455 @node DIM
2456 @section @code{DIM} --- Dim function
2457 @findex @code{DIM} intrinsic
2458 @findex @code{IDIM} intrinsic
2459 @findex @code{DDIM} intrinsic
2460 @cindex dim
2461
2462 @table @asis
2463 @item @emph{Description}:
2464 @code{DIM(X,Y)} returns the difference @code{X-Y} if the result is positive;
2465 otherwise returns zero.
2466
2467 @item @emph{Standard}:
2468 F77 and later
2469
2470 @item @emph{Class}:
2471 Elemental function
2472
2473 @item @emph{Syntax}:
2474 @code{X = DIM(X,Y)}
2475
2476 @item @emph{Arguments}:
2477 @multitable @columnfractions .15 .80
2478 @item @var{X} @tab The type shall be @code{INTEGER(*)} or @code{REAL(*)}
2479 @item @var{Y} @tab The type shall be the same type and kind as @var{X}.
2480 @end multitable
2481
2482 @item @emph{Return value}:
2483 The return value is of type @code{INTEGER(*)} or @code{REAL(*)}.
2484
2485 @item @emph{Example}:
2486 @smallexample
2487 program test_dim
2488     integer :: i
2489     real(8) :: x
2490     i = dim(4, 15)
2491     x = dim(4.345_8, 2.111_8)
2492     print *, i
2493     print *, x
2494 end program test_dim
2495 @end smallexample
2496
2497 @item @emph{Specific names}:
2498 @multitable @columnfractions .20 .20 .20 .40
2499 @item Name             @tab Argument              @tab Return type       @tab Standard
2500 @item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X,Y} @tab @code{INTEGER(4)} @tab F77 and later
2501 @item @code{DDIM(X,Y)} @tab @code{REAL(8) X,Y}    @tab @code{REAL(8)}    @tab F77 and later
2502 @end multitable
2503 @end table
2504
2505
2506
2507 @node DOT_PRODUCT
2508 @section @code{DOT_PRODUCT} --- Dot product function
2509 @findex @code{DOT_PRODUCT} intrinsic
2510 @cindex Dot product
2511
2512 @table @asis
2513 @item @emph{Description}:
2514 @code{DOT_PRODUCT(X,Y)} computes the dot product multiplication of two vectors
2515 @var{X} and @var{Y}.  The two vectors may be either numeric or logical
2516 and must be arrays of rank one and of equal size. If the vectors are
2517 @code{INTEGER(*)} or @code{REAL(*)}, the result is @code{SUM(X*Y)}. If the
2518 vectors are @code{COMPLEX(*)}, the result is @code{SUM(CONJG(X)*Y)}. If the 
2519 vectors are @code{LOGICAL}, the result is @code{ANY(X.AND.Y)}.
2520
2521 @item @emph{Standard}:
2522 F95 and later
2523
2524 @item @emph{Class}:
2525 transformational function
2526
2527 @item @emph{Syntax}:
2528 @code{S = DOT_PRODUCT(X,Y)}
2529
2530 @item @emph{Arguments}:
2531 @multitable @columnfractions .15 .80
2532 @item @var{X} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2533 @item @var{Y} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2534 @end multitable
2535
2536 @item @emph{Return value}:
2537 If the arguments are numeric, the return value is a scaler of numeric type,
2538 @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.  If the arguments are
2539 @code{LOGICAL}, the return value is @code{.TRUE.} or @code{.FALSE.}.
2540
2541 @item @emph{Example}:
2542 @smallexample
2543 program test_dot_prod
2544     integer, dimension(3) :: a, b
2545     a = (/ 1, 2, 3 /)
2546     b = (/ 4, 5, 6 /)
2547     print '(3i3)', a
2548     print *
2549     print '(3i3)', b
2550     print *
2551     print *, dot_product(a,b)
2552 end program test_dot_prod
2553 @end smallexample
2554 @end table
2555
2556
2557
2558 @node DPROD
2559 @section @code{DPROD} --- Double product function
2560 @findex @code{DPROD} intrinsic
2561 @cindex Double product
2562
2563 @table @asis
2564 @item @emph{Description}:
2565 @code{DPROD(X,Y)} returns the product @code{X*Y}.
2566
2567 @item @emph{Standard}:
2568 F77 and later
2569
2570 @item @emph{Class}:
2571 Elemental function
2572
2573 @item @emph{Syntax}:
2574 @code{D = DPROD(X,Y)}
2575
2576 @item @emph{Arguments}:
2577 @multitable @columnfractions .15 .80
2578 @item @var{X} @tab The type shall be @code{REAL}.
2579 @item @var{Y} @tab The type shall be @code{REAL}.
2580 @end multitable
2581
2582 @item @emph{Return value}:
2583 The return value is of type @code{REAL(8)}.
2584
2585 @item @emph{Example}:
2586 @smallexample
2587 program test_dprod
2588     integer :: i
2589     real :: x = 5.2
2590     real :: y = 2.3
2591     real(8) :: d
2592     d = dprod(x,y)
2593     print *, d
2594 end program test_dprod
2595 @end smallexample
2596 @end table
2597
2598
2599
2600 @node DREAL
2601 @section @code{DREAL} --- Double real part function
2602 @findex @code{DREAL} intrinsic
2603 @cindex Double real part
2604
2605 @table @asis
2606 @item @emph{Description}:
2607 @code{DREAL(Z)} returns the real part of complex variable @var{Z}.
2608
2609 @item @emph{Standard}:
2610 GNU extension
2611
2612 @item @emph{Class}:
2613 Elemental function
2614
2615 @item @emph{Syntax}:
2616 @code{D = DREAL(Z)}
2617
2618 @item @emph{Arguments}:
2619 @multitable @columnfractions .15 .80
2620 @item @var{Z} @tab The type shall be @code{COMPLEX(8)}.
2621 @end multitable
2622
2623 @item @emph{Return value}:
2624 The return value is of type @code{REAL(8)}.
2625
2626 @item @emph{Example}:
2627 @smallexample
2628 program test_dreal
2629     complex(8) :: z = (1.3_8,7.2_8)
2630     print *, dreal(z)
2631 end program test_dreal
2632 @end smallexample
2633
2634 @item @emph{See also}:
2635 @ref{AIMAG}
2636
2637 @end table
2638
2639
2640
2641 @node DTIME
2642 @section @code{DTIME} --- Execution time subroutine (or function)
2643 @findex @code{DTIME} intrinsic
2644 @cindex dtime subroutine 
2645
2646 @table @asis
2647 @item @emph{Description}:
2648 @code{DTIME(TARRAY, RESULT)} initially returns the number of seconds of runtime
2649 since the start of the process's execution in @var{RESULT}.  @var{TARRAY}
2650 returns the user and system components of this time in @code{TARRAY(1)} and
2651 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) +
2652 TARRAY(2)}.
2653
2654 Subsequent invocations of @code{DTIME} return values accumulated since the
2655 previous invocation.
2656
2657 On some systems, the underlying timings are represented using types with
2658 sufficiently small limits that overflows (wraparounds) are possible, such as
2659 32-bit types. Therefore, the values returned by this intrinsic might be, or
2660 become, negative, or numerically less than previous values, during a single
2661 run of the compiled program.
2662
2663 If @code{DTIME} is invoked as a function, it can not be invoked as a
2664 subroutine, and vice versa.
2665
2666 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2667
2668 @multitable @columnfractions .15 .30 .60
2669 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2670 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2671 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2672 @end multitable
2673
2674 @item @emph{Standard}:
2675 GNU extension
2676
2677 @item @emph{Class}:
2678 Subroutine
2679
2680 @item @emph{Syntax}:
2681 @multitable @columnfractions .80
2682 @item @code{CALL DTIME(TARRAY, RESULT)}.
2683 @item @code{RESULT = DTIME(TARRAY)}, (not recommended).
2684 @end multitable
2685
2686 @item @emph{Arguments}:
2687 @multitable @columnfractions .15 .80
2688 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2689 @item @var{RESULT}@tab The type shall be @code{REAL}.
2690 @end multitable
2691
2692 @item @emph{Return value}:
2693 Elapsed time in seconds since the start of program execution.
2694
2695 @item @emph{Example}:
2696 @smallexample
2697 program test_dtime
2698     integer(8) :: i, j
2699     real, dimension(2) :: tarray
2700     real :: result
2701     call dtime(tarray, result)
2702     print *, result
2703     print *, tarray(1)
2704     print *, tarray(2)   
2705     do i=1,100000000    ! Just a delay
2706         j = i * i - i
2707     end do
2708     call dtime(tarray, result)
2709     print *, result
2710     print *, tarray(1)
2711     print *, tarray(2)
2712 end program test_dtime
2713 @end smallexample
2714 @end table
2715
2716
2717
2718 @node EOSHIFT
2719 @section @code{EOSHIFT} --- End-off shift function
2720 @findex @code{EOSHIFT} intrinsic
2721 @cindex bit manipulation
2722
2723 @table @asis
2724 @item @emph{Description}:
2725 @code{EOSHIFT(ARRAY, SHIFT[,BOUNDARY, DIM])} performs an end-off shift on
2726 elements of @var{ARRAY} along the dimension of @var{DIM}.  If @var{DIM} is
2727 omitted it is taken to be @code{1}.  @var{DIM} is a scaler of type
2728 @code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is the
2729 rank of @var{ARRAY}.  If the rank of @var{ARRAY} is one, then all elements of
2730 @var{ARRAY} are shifted by @var{SHIFT} places.  If rank is greater than one,
2731 then all complete rank one sections of @var{ARRAY} along the given dimension are
2732 shifted.  Elements shifted out one end of each rank one section are dropped.  If
2733 @var{BOUNDARY} is present then the corresponding value of from @var{BOUNDARY}
2734 is copied back in the other end.  If @var{BOUNDARY} is not present then the
2735 following are copied in depending on the type of @var{ARRAY}.
2736
2737 @multitable @columnfractions .15 .80
2738 @item @emph{Array Type} @tab @emph{Boundary Value}
2739 @item Numeric  @tab 0 of the type and kind of @var{ARRAY}.
2740 @item Logical  @tab @code{.FALSE.}.
2741 @item Character(@var{len}) @tab @var{len} blanks.
2742 @end multitable
2743
2744 @item @emph{Standard}:
2745 F95 and later
2746
2747 @item @emph{Class}:
2748 transformational function
2749
2750 @item @emph{Syntax}:
2751 @code{A = EOSHIFT(A, SHIFT[,BOUNDARY, DIM])}
2752
2753 @item @emph{Arguments}:
2754 @multitable @columnfractions .15 .80
2755 @item @var{ARRAY}  @tab May be any type, not scaler.
2756 @item @var{SHIFT}  @tab The type shall be @code{INTEGER}.
2757 @item @var{BOUNDARY} @tab Same type as @var{ARRAY}. 
2758 @item @var{DIM}    @tab The type shall be @code{INTEGER}.
2759 @end multitable
2760
2761 @item @emph{Return value}:
2762 Returns an array of same type and rank as the @var{ARRAY} argument.
2763
2764 @item @emph{Example}:
2765 @smallexample
2766 program test_eoshift
2767     integer, dimension(3,3) :: a
2768     a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2769     print '(3i3)', a(1,:)
2770     print '(3i3)', a(2,:)
2771     print '(3i3)', a(3,:)    
2772     a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
2773     print *
2774     print '(3i3)', a(1,:)
2775     print '(3i3)', a(2,:)
2776     print '(3i3)', a(3,:)
2777 end program test_eoshift
2778 @end smallexample
2779 @end table
2780
2781
2782
2783 @node EPSILON
2784 @section @code{EPSILON} --- Epsilon function
2785 @findex @code{EPSILON} intrinsic
2786 @cindex epsilon, significant
2787
2788 @table @asis
2789 @item @emph{Description}:
2790 @code{EPSILON(X)} returns a nearly negligible number relative to @code{1}.
2791
2792 @item @emph{Standard}:
2793 F95 and later
2794
2795 @item @emph{Class}:
2796 Inquiry function
2797
2798 @item @emph{Syntax}:
2799 @code{C = EPSILON(X)}
2800
2801 @item @emph{Arguments}:
2802 @multitable @columnfractions .15 .80
2803 @item @var{X} @tab The type shall be @code{REAL(*)}.
2804 @end multitable
2805
2806 @item @emph{Return value}:
2807 The return value is of same type as the argument.
2808
2809 @item @emph{Example}:
2810 @smallexample
2811 program test_epsilon
2812     real :: x = 3.143
2813     real(8) :: y = 2.33
2814     print *, EPSILON(x)
2815     print *, EPSILON(y)
2816 end program test_epsilon
2817 @end smallexample
2818 @end table
2819
2820
2821
2822 @node EQV
2823 @section @code{EQV} --- Logical equivalence
2824 @findex @code{EQV} intrinsic
2825 @cindex logical operations
2826
2827 Intrinsic implemented, documentation pending.
2828
2829 @table @asis
2830 @item @emph{Description}:
2831 @item @emph{Standard}:
2832 F77 and later
2833
2834 @item @emph{Class}:
2835 @item @emph{Syntax}:
2836 @item @emph{Arguments}:
2837 @item @emph{Return value}:
2838 @item @emph{Example}:
2839 @item @emph{Specific names}:
2840 @item @emph{See also}:
2841 @ref{NEQV}
2842 @end table
2843
2844
2845
2846 @node ERF
2847 @section @code{ERF} --- Error function 
2848 @findex @code{ERF} intrinsic
2849 @cindex error function
2850
2851 @table @asis
2852 @item @emph{Description}:
2853 @code{ERF(X)} computes the error function of @var{X}.
2854
2855 @item @emph{Standard}:
2856 GNU Extension
2857
2858 @item @emph{Class}:
2859 Elemental function
2860
2861 @item @emph{Syntax}:
2862 @code{X = ERF(X)}
2863
2864 @item @emph{Arguments}:
2865 @multitable @columnfractions .15 .80
2866 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
2867 @end multitable
2868
2869 @item @emph{Return value}:
2870 The return value is a scalar of type @code{REAL(*)} and it is positive
2871 (@math{ - 1 \leq erf (x) \leq 1 }.
2872
2873 @item @emph{Example}:
2874 @smallexample
2875 program test_erf
2876   real(8) :: x = 0.17_8
2877   x = erf(x)
2878 end program test_erf
2879 @end smallexample
2880
2881 @item @emph{Specific names}:
2882 @multitable @columnfractions .20 .20 .20 .40
2883 @item Name            @tab Argument          @tab Return type       @tab Standard
2884 @item @code{DERF(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
2885 @end multitable
2886 @end table
2887
2888
2889
2890 @node ERFC
2891 @section @code{ERFC} --- Error function 
2892 @findex @code{ERFC} intrinsic
2893 @cindex error function
2894
2895 @table @asis
2896 @item @emph{Description}:
2897 @code{ERFC(X)} computes the complementary error function of @var{X}.
2898
2899 @item @emph{Standard}:
2900 GNU extension
2901
2902 @item @emph{Class}:
2903 Elemental function
2904
2905 @item @emph{Syntax}:
2906 @code{X = ERFC(X)}
2907
2908 @item @emph{Arguments}:
2909 @multitable @columnfractions .15 .80
2910 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
2911 @end multitable
2912
2913 @item @emph{Return value}:
2914 The return value is a scalar of type @code{REAL(*)} and it is positive
2915 (@math{ 0 \leq erfc (x) \leq 2 }.
2916
2917 @item @emph{Example}:
2918 @smallexample
2919 program test_erfc
2920   real(8) :: x = 0.17_8
2921   x = erfc(x)
2922 end program test_erfc
2923 @end smallexample
2924
2925 @item @emph{Specific names}:
2926 @multitable @columnfractions .20 .20 .20 .40
2927 @item Name            @tab Argument          @tab Return type       @tab Standard
2928 @item @code{DERFC(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab GNU extension
2929 @end multitable
2930 @end table
2931
2932
2933
2934 @node ETIME
2935 @section @code{ETIME} --- Execution time subroutine (or function)
2936 @findex @code{ETIME} intrinsic
2937 @cindex time functions
2938
2939 @table @asis
2940 @item @emph{Description}:
2941 @code{ETIME(TARRAY, RESULT)} returns the number of seconds of runtime
2942 since the start of the process's execution in @var{RESULT}.  @var{TARRAY}
2943 returns the user and system components of this time in @code{TARRAY(1)} and
2944 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
2945
2946 On some systems, the underlying timings are represented using types with
2947 sufficiently small limits that overflows (wraparounds) are possible, such as
2948 32-bit types. Therefore, the values returned by this intrinsic might be, or
2949 become, negative, or numerically less than previous values, during a single
2950 run of the compiled program.
2951
2952 If @code{ETIME} is invoked as a function, it can not be invoked as a
2953 subroutine, and vice versa.
2954
2955 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2956
2957 @multitable @columnfractions .15 .30 .60
2958 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2959 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2960 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2961 @end multitable
2962
2963 @item @emph{Standard}:
2964 GNU extension
2965
2966 @item @emph{Class}:
2967 Subroutine
2968
2969 @item @emph{Syntax}:
2970 @multitable @columnfractions .8
2971 @item @code{CALL ETIME(TARRAY, RESULT)}.
2972 @item @code{RESULT = ETIME(TARRAY)}, (not recommended).
2973 @end multitable
2974
2975 @item @emph{Arguments}:
2976 @multitable @columnfractions .15 .80
2977 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2978 @item @var{RESULT}@tab The type shall be @code{REAL}.
2979 @end multitable
2980
2981 @item @emph{Return value}:
2982 Elapsed time in seconds since the start of program execution.
2983
2984 @item @emph{Example}:
2985 @smallexample
2986 program test_etime
2987     integer(8) :: i, j
2988     real, dimension(2) :: tarray
2989     real :: result
2990     call ETIME(tarray, result)
2991     print *, result
2992     print *, tarray(1)
2993     print *, tarray(2)   
2994     do i=1,100000000    ! Just a delay
2995         j = i * i - i
2996     end do
2997     call ETIME(tarray, result)
2998     print *, result
2999     print *, tarray(1)
3000     print *, tarray(2)
3001 end program test_etime
3002 @end smallexample
3003
3004 @item @emph{See also}:
3005 @ref{CPU_TIME}
3006
3007 @end table
3008
3009
3010
3011 @node EXIT
3012 @section @code{EXIT} --- Exit the program with status. 
3013 @findex @code{EXIT}
3014 @cindex exit
3015
3016 @table @asis
3017 @item @emph{Description}:
3018 @code{EXIT} causes immediate termination of the program with status.  If status
3019 is omitted it returns the canonical @emph{success} for the system.  All Fortran
3020 I/O units are closed. 
3021
3022 @item @emph{Standard}:
3023 GNU extension
3024
3025 @item @emph{Class}:
3026 Subroutine
3027
3028 @item @emph{Syntax}:
3029 @code{CALL EXIT([STATUS])}
3030
3031 @item @emph{Arguments}:
3032 @multitable @columnfractions .15 .80
3033 @item @var{STATUS} @tab The type of the argument shall be @code{INTEGER(*)}.
3034 @end multitable
3035
3036 @item @emph{Return value}:
3037 @code{STATUS} is passed to the parent process on exit.
3038
3039 @item @emph{Example}:
3040 @smallexample
3041 program test_exit
3042   integer :: STATUS = 0
3043   print *, 'This program is going to exit.'
3044   call EXIT(STATUS)
3045 end program test_exit
3046 @end smallexample
3047
3048 @item @emph{See also}:
3049 @ref{ABORT}, @ref{KILL}
3050 @end table
3051
3052
3053
3054 @node EXP
3055 @section @code{EXP} --- Exponential function 
3056 @findex @code{EXP} intrinsic
3057 @findex @code{DEXP} intrinsic
3058 @findex @code{ZEXP} intrinsic
3059 @findex @code{CDEXP} intrinsic
3060 @cindex exponential
3061
3062 @table @asis
3063 @item @emph{Description}:
3064 @code{EXP(X)} computes the base @math{e} exponential of @var{X}.
3065
3066 @item @emph{Standard}:
3067 F77 and later, has overloads that are GNU extensions
3068
3069 @item @emph{Class}:
3070 Elemental function
3071
3072 @item @emph{Syntax}:
3073 @code{X = EXP(X)}
3074
3075 @item @emph{Arguments}:
3076 @multitable @columnfractions .15 .80
3077 @item @var{X} @tab The type shall be @code{REAL(*)} or
3078 @code{COMPLEX(*)}.
3079 @end multitable
3080
3081 @item @emph{Return value}:
3082 The return value has same type and kind as @var{X}.
3083
3084 @item @emph{Example}:
3085 @smallexample
3086 program test_exp
3087   real :: x = 1.0
3088   x = exp(x)
3089 end program test_exp
3090 @end smallexample
3091
3092 @item @emph{Specific names}:
3093 @multitable @columnfractions .20 .20 .20 .40
3094 @item Name            @tab Argument             @tab Return type         @tab Standard
3095 @item @code{DEXP(X)}  @tab @code{REAL(8) X}     @tab @code{REAL(8)}      @tab F77 and later
3096 @item @code{CEXP(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}   @tab F77 and later
3097 @item @code{ZEXP(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}   @tab GNU extension
3098 @item @code{CDEXP(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}   @tab GNU extension
3099 @end multitable
3100 @end table
3101
3102
3103
3104 @node EXPONENT
3105 @section @code{EXPONENT} --- Exponent function 
3106 @findex @code{EXPONENT} intrinsic
3107 @cindex exponent function
3108
3109 @table @asis
3110 @item @emph{Description}:
3111 @code{EXPONENT(X)} returns the value of the exponent part of @var{X}. If @var{X}
3112 is zero the value returned is zero. 
3113
3114 @item @emph{Standard}:
3115 F95 and later
3116
3117 @item @emph{Class}:
3118 Elemental function
3119
3120 @item @emph{Syntax}:
3121 @code{I = EXPONENT(X)}
3122
3123 @item @emph{Arguments}:
3124 @multitable @columnfractions .15 .80
3125 @item @var{X} @tab The type shall be @code{REAL(*)}.
3126 @end multitable
3127
3128 @item @emph{Return value}:
3129 The return value is of type default @code{INTEGER}.
3130
3131 @item @emph{Example}:
3132 @smallexample
3133 program test_exponent
3134   real :: x = 1.0
3135   integer :: i
3136   i = exponent(x)
3137   print *, i
3138   print *, exponent(0.0)
3139 end program test_exponent
3140 @end smallexample
3141 @end table
3142
3143
3144 @node FDATE
3145 @section @code{FDATE} --- Get the current time as a string
3146 @findex @code{FDATE} intrinsic
3147 @cindex fdate subroutine 
3148
3149 @table @asis
3150 @item @emph{Description}:
3151 @code{FDATE(DATE)} returns the current date (using the same format as
3152 @code{CTIME}) in @var{DATE}. It is equivalent to @code{CALL CTIME(DATE,
3153 TIME8())}.
3154
3155 If @code{FDATE} is invoked as a function, it can not be invoked as a
3156 subroutine, and vice versa.
3157
3158 @var{DATE} is an @code{INTENT(OUT)} @code{CHARACTER} variable.
3159
3160 @item @emph{Standard}:
3161 GNU extension
3162
3163 @item @emph{Class}:
3164 Subroutine
3165
3166 @item @emph{Syntax}:
3167 @multitable @columnfractions .80
3168 @item @code{CALL FDATE(DATE)}.
3169 @item @code{DATE = FDATE()}, (not recommended).
3170 @end multitable
3171
3172 @item @emph{Arguments}:
3173 @multitable @columnfractions .15 .80
3174 @item @var{DATE}@tab The type shall be of type @code{CHARACTER}.
3175 @end multitable
3176
3177 @item @emph{Return value}:
3178 The current date and time as a string.
3179
3180 @item @emph{Example}:
3181 @smallexample
3182 program test_fdate
3183     integer(8) :: i, j
3184     character(len=30) :: date
3185     call fdate(date)
3186     print *, 'Program started on ', date
3187     do i = 1, 100000000 ! Just a delay
3188         j = i * i - i
3189     end do
3190     call fdate(date)
3191     print *, 'Program ended on ', date
3192 end program test_fdate
3193 @end smallexample
3194 @end table
3195
3196 @node FLOAT
3197
3198 @section @code{FLOAT} --- Convert integer to default real
3199 @findex @code{FLOAT} intrinsic
3200 @cindex conversion function (float)
3201
3202 @table @asis
3203 @item @emph{Description}:
3204 @code{FLOAT(I)} converts the integer @var{I} to a default real value.
3205
3206 @item @emph{Standard}:
3207 GNU extension
3208
3209 @item @emph{Class}:
3210 Elemental function
3211
3212 @item @emph{Syntax}:
3213 @code{X = FLOAT(I)}
3214
3215 @item @emph{Arguments}:
3216 @multitable @columnfractions .15 .80
3217 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
3218 @end multitable
3219
3220 @item @emph{Return value}:
3221 The return value is of type default @code{REAL}
3222
3223 @item @emph{Example}:
3224 @smallexample
3225 program test_float
3226     integer :: i = 1
3227     if (float(i) /= 1.) call abort
3228 end program test_float
3229 @end smallexample
3230
3231 @item @emph{See also}:
3232 @ref{DBLE}, @ref{DFLOAT}, @ref{REAL}
3233 @end table
3234
3235
3236
3237 @node FGETC
3238 @section @code{FGETC} --- Read a single character in stream mode
3239 @findex @code{FGETC} intrinsic
3240 @cindex undocumented intrinsic 
3241
3242 Intrinsic implemented, documentation pending.
3243
3244 @table @asis
3245 @item @emph{Description}:
3246 @item @emph{Standard}:
3247 GNU extension
3248
3249 @item @emph{Class}:
3250 @item @emph{Syntax}:
3251 @item @emph{Arguments}:
3252 @item @emph{Return value}:
3253 @item @emph{Example}:
3254 @item @emph{Specific names}:
3255 @item @emph{See also}:
3256 @end table
3257
3258
3259
3260 @node FGET
3261 @section @code{FGET} --- Read a single character from stdin in stream mode
3262 @findex @code{FGET} intrinsic
3263 @cindex undocumented intrinsic 
3264
3265 Intrinsic implemented, documentation pending.
3266
3267 @table @asis
3268 @item @emph{Description}:
3269 @item @emph{Standard}:
3270 GNU extension
3271
3272 @item @emph{Class}:
3273 @item @emph{Syntax}:
3274 @item @emph{Arguments}:
3275 @item @emph{Return value}:
3276 @item @emph{Example}:
3277 @item @emph{Specific names}:
3278 @item @emph{See also}:
3279 @end table
3280
3281
3282 @node FLOOR
3283 @section @code{FLOOR} --- Integer floor function
3284 @findex @code{FLOOR} intrinsic
3285 @cindex floor
3286
3287 @table @asis
3288 @item @emph{Description}:
3289 @code{FLOOR(X)} returns the greatest integer less than or equal to @var{X}.
3290
3291 @item @emph{Standard}:
3292 F95 and later
3293
3294 @item @emph{Class}:
3295 Elemental function
3296
3297 @item @emph{Syntax}:
3298 @code{I = FLOOR(X[,KIND])}
3299
3300 @item @emph{Arguments}:
3301 @multitable @columnfractions .15 .80
3302 @item @var{X} @tab The type shall be @code{REAL(*)}.
3303 @item @var{KIND} @tab Optional scaler integer initialization expression.
3304 @end multitable
3305
3306 @item @emph{Return value}:
3307 The return value is of type @code{INTEGER(KIND)}
3308
3309 @item @emph{Example}:
3310 @smallexample
3311 program test_floor
3312     real :: x = 63.29
3313     real :: y = -63.59
3314     print *, floor(x) ! returns 63
3315     print *, floor(y) ! returns -64
3316 end program test_floor
3317 @end smallexample
3318
3319 @item @emph{See also}:
3320 @ref{CEILING}, @ref{NINT}
3321
3322 @end table
3323
3324
3325
3326 @node FLUSH
3327 @section @code{FLUSH} --- Flush I/O unit(s)
3328 @findex @code{FLUSH}
3329 @cindex flush
3330
3331 @table @asis
3332 @item @emph{Description}:
3333 Flushes Fortran unit(s) currently open for output. Without the optional
3334 argument, all units are flushed, otherwise just the unit specified.
3335
3336 @item @emph{Standard}:
3337 GNU extension
3338
3339 @item @emph{Class}:
3340 non-elemental subroutine
3341
3342 @item @emph{Syntax}:
3343 @code{CALL FLUSH(UNIT)}
3344
3345 @item @emph{Arguments}:
3346 @multitable @columnfractions .15 .80
3347 @item @var{UNIT} @tab (Optional) The type shall be @code{INTEGER}.
3348 @end multitable
3349
3350 @item @emph{Note}:
3351 Beginning with the Fortran 2003 standard, there is a @code{FLUSH}
3352 statement that should be preferred over the @code{FLUSH} intrinsic.
3353
3354 @end table
3355
3356
3357
3358 @node FNUM
3359 @section @code{FNUM} --- File number function
3360 @findex @code{FNUM} intrinsic
3361 @cindex fnum
3362
3363 @table @asis
3364 @item @emph{Description}:
3365 @code{FNUM(UNIT)} returns the Posix file descriptor number corresponding to the
3366 open Fortran I/O unit @code{UNIT}.
3367
3368 @item @emph{Standard}:
3369 GNU extension
3370
3371 @item @emph{Class}:
3372 non-elemental function
3373
3374 @item @emph{Syntax}:
3375 @code{I = FNUM(UNIT)}
3376
3377 @item @emph{Arguments}:
3378 @multitable @columnfractions .15 .80
3379 @item @var{UNIT} @tab The type shall be @code{INTEGER}.
3380 @end multitable
3381
3382 @item @emph{Return value}:
3383 The return value is of type @code{INTEGER}
3384
3385 @item @emph{Example}:
3386 @smallexample
3387 program test_fnum
3388   integer :: i
3389   open (unit=10, status = "scratch")
3390   i = fnum(10)
3391   print *, i
3392   close (10)
3393 end program test_fnum
3394 @end smallexample
3395 @end table
3396
3397
3398
3399 @node FPUT
3400 @section @code{FPUT} --- Write a single character to stdout in stream mode
3401 @findex @code{FPUT} intrinsic
3402 @cindex undocumented intrinsic 
3403
3404 Intrinsic implemented, documentation pending.
3405
3406 @table @asis
3407 @item @emph{Description}:
3408 @item @emph{Standard}:
3409 GNU extension
3410
3411 @item @emph{Class}:
3412 @item @emph{Syntax}:
3413 @item @emph{Arguments}:
3414 @item @emph{Return value}:
3415 @item @emph{Example}:
3416 @item @emph{Specific names}:
3417 @item @emph{See also}:
3418 @end table
3419
3420
3421
3422 @node FPUTC
3423 @section @code{FPUTC} --- Write a single character in stream mode
3424 @findex @code{FPUTC} intrinsic
3425 @cindex undocumented intrinsic 
3426
3427 Intrinsic implemented, documentation pending.
3428
3429 @table @asis
3430 @item @emph{Description}:
3431 @item @emph{Standard}:
3432 GNU extension
3433
3434 @item @emph{Class}:
3435 @item @emph{Syntax}:
3436 @item @emph{Arguments}:
3437 @item @emph{Return value}:
3438 @item @emph{Example}:
3439 @item @emph{Specific names}:
3440 @item @emph{See also}:
3441 @end table
3442
3443
3444
3445 @node FRACTION
3446 @section @code{FRACTION} --- Fractional part of the model representation
3447 @findex @code{FRACTION} intrinsic
3448 @cindex fractional part
3449
3450 @table @asis
3451 @item @emph{Description}:
3452 @code{FRACTION(X)} returns the fractional part of the model
3453 representation of @code{X}.
3454
3455 @item @emph{Standard}:
3456 F95 and later
3457
3458 @item @emph{Class}:
3459 Elemental function
3460
3461 @item @emph{Syntax}:
3462 @code{Y = FRACTION(X)}
3463
3464 @item @emph{Arguments}:
3465 @multitable @columnfractions .15 .80
3466 @item @var{X} @tab The type of the argument shall be a @code{REAL}.
3467 @end multitable
3468
3469 @item @emph{Return value}:
3470 The return value is of the same type and kind as the argument.
3471 The fractional part of the model representation of @code{X} is returned;
3472 it is @code{X * RADIX(X)**(-EXPONENT(X))}.
3473
3474 @item @emph{Example}:
3475 @smallexample
3476 program test_fraction
3477   real :: x
3478   x = 178.1387e-4
3479   print *, fraction(x), x * radix(x)**(-exponent(x))
3480 end program test_fraction
3481 @end smallexample
3482
3483 @end table
3484
3485
3486
3487 @node FREE
3488 @section @code{FREE} --- Frees memory
3489 @findex @code{FREE} intrinsic
3490 @cindex FREE
3491
3492 @table @asis
3493 @item @emph{Description}:
3494 Frees memory previously allocated by @code{MALLOC()}. The @code{FREE}
3495 intrinsic is an extension intended to be used with Cray pointers, and is
3496 provided in @command{gfortran} to allow user to compile legacy code. For
3497 new code using Fortran 95 pointers, the memory de-allocation intrinsic is
3498 @code{DEALLOCATE}.
3499
3500 @item @emph{Standard}:
3501 GNU extension
3502
3503 @item @emph{Class}:
3504 Subroutine
3505
3506 @item @emph{Syntax}:
3507 @code{FREE(PTR)}
3508
3509 @item @emph{Arguments}:
3510 @multitable @columnfractions .15 .80
3511 @item @var{PTR} @tab The type shall be @code{INTEGER}. It represents the
3512 location of the memory that should be de-allocated.
3513 @end multitable
3514
3515 @item @emph{Return value}:
3516 None
3517
3518 @item @emph{Example}:
3519 See @code{MALLOC} for an example.
3520
3521 @item @emph{See also}:
3522 @ref{MALLOC}
3523 @end table
3524
3525
3526
3527
3528 @node FSTAT
3529 @section @code{FSTAT} --- Get file status
3530 @findex @code{FSTAT} intrinsic
3531 @cindex undocumented intrinsic 
3532
3533 Intrinsic implemented, documentation pending.
3534
3535 @table @asis
3536 @item @emph{Description}:
3537 GNU extension
3538
3539 @item @emph{Standard}:
3540 @item @emph{Class}:
3541 @item @emph{Syntax}:
3542 @item @emph{Arguments}:
3543 @item @emph{Return value}:
3544 @item @emph{Example}:
3545 @item @emph{Specific names}:
3546 @item @emph{See also}:
3547 @end table
3548
3549
3550
3551 @node FSEEK
3552 @section @code{FSEEK} --- Low level file positioning subroutine
3553 @findex @code{FSEEK} 
3554 @cindex file system functions
3555
3556 Not yet implemented in gfortran.
3557
3558 @table @asis
3559 @item @emph{Description}:
3560
3561 @item @emph{Standard}:
3562 GNU extension
3563
3564 @item @emph{Class}:
3565 Subroutine
3566
3567 @item @emph{Syntax}:
3568 @item @emph{Arguments}:
3569 @item @emph{Return value}:
3570 @item @emph{Example}:
3571 @item @emph{Specific names}:
3572 @item @emph{See also}:
3573 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
3574
3575 @end table
3576
3577
3578
3579 @node FTELL
3580 @section @code{FTELL} --- Current stream position
3581 @findex @code{FTELL} intrinsic
3582 @cindex undocumented intrinsic 
3583
3584 Intrinsic implemented, documentation pending.
3585
3586 @table @asis
3587 @item @emph{Description}:
3588 @item @emph{Standard}:
3589 GNU extension
3590
3591 @item @emph{Class}:
3592 @item @emph{Syntax}:
3593 @item @emph{Arguments}:
3594 @item @emph{Return value}:
3595 @item @emph{Example}:
3596 @item @emph{Specific names}:
3597 @item @emph{See also}:
3598 @end table
3599
3600
3601
3602 @node GETARG
3603 @section @code{GETARG} --- Get command line arguments
3604 @findex @code{GETARG} intrinsic
3605 @cindex undocumented intrinsic 
3606
3607 Intrinsic implemented, documentation pending.
3608
3609 @table @asis
3610 @item @emph{Description}:
3611 @item @emph{Standard}:
3612 GNU extension
3613
3614 @item @emph{Class}:
3615 @item @emph{Syntax}:
3616 @item @emph{Arguments}:
3617 @item @emph{Return value}:
3618 @item @emph{Example}:
3619 @item @emph{Specific names}:
3620
3621 @item @emph{See also}:
3622 @ref{IARGC}, @ref{GET_COMMAND}, @ref{GET_COMMAND_ARGUMENT}
3623 @end table
3624
3625
3626
3627 @node GET_COMMAND
3628 @section @code{GET_COMMAND} --- Subroutine to retrieve the entire command line
3629 @findex @code{GET_COMMAND} intrinsic
3630 @cindex undocumented intrinsic 
3631
3632 Intrinsic implemented, documentation pending.
3633
3634 @table @asis
3635 @item @emph{Description}:
3636 @item @emph{Standard}:
3637 F2003
3638
3639 @item @emph{Class}:
3640 @item @emph{Syntax}:
3641 @item @emph{Arguments}:
3642 @item @emph{Return value}:
3643 @item @emph{Example}:
3644 @item @emph{Specific names}:
3645 @item @emph{See also}:
3646 @end table
3647
3648
3649
3650 @node GET_COMMAND_ARGUMENT
3651 @section @code{GET_COMMAND_ARGUMENT} --- Subroutine to retrieve a command argument
3652 @findex @code{GET_COMMAND_ARGUMENT} intrinsic
3653 @cindex undocumented intrinsic 
3654
3655 Intrinsic implemented, documentation pending.
3656
3657 @table @asis
3658 @item @emph{Description}:
3659 @item @emph{Standard}:
3660 F2003
3661
3662 @item @emph{Class}:
3663 @item @emph{Syntax}:
3664 @item @emph{Arguments}:
3665 @item @emph{Return value}:
3666 @item @emph{Example}:
3667 @item @emph{Specific names}:
3668 @item @emph{See also}:
3669 @ref{COMMAND_ARGUMENT_COUNT}
3670 @end table
3671
3672
3673
3674 @node GETCWD
3675 @section @code{GETCWD} --- Get current working directory
3676 @findex @code{GETCWD} intrinsic
3677 @cindex undocumented intrinsic 
3678
3679 Intrinsic implemented, documentation pending.
3680
3681 @table @asis
3682 @item @emph{Description}:
3683 @item @emph{Standard}:
3684 GNU extension
3685
3686 @item @emph{Class}:
3687 @item @emph{Syntax}:
3688 @item @emph{Arguments}:
3689 @item @emph{Return value}:
3690 @item @emph{Example}:
3691 @item @emph{Specific names}:
3692 @item @emph{See also}:
3693 @end table
3694
3695
3696
3697 @node GETENV
3698 @section @code{GETENV} --- Get an environmental variable
3699 @findex @code{GETENV} intrinsic
3700 @cindex undocumented intrinsic 
3701
3702 Intrinsic implemented, documentation pending.
3703
3704 @table @asis
3705 @item @emph{Description}:
3706 @item @emph{Standard}:
3707 GNU extension
3708
3709 @item @emph{Class}:
3710 @item @emph{Syntax}:
3711 @item @emph{Arguments}:
3712 @item @emph{Return value}:
3713 @item @emph{Example}:
3714 @item @emph{Specific names}:
3715 @item @emph{See also}:
3716 @ref{GET_ENVIRONMENT_VARIABLE}
3717 @end table
3718
3719
3720
3721 @node GET_ENVIRONMENT_VARIABLE
3722 @section @code{GET_ENVIRONMENT_VARIABLE} --- Get an environmental variable
3723 @findex @code{GET_ENVIRONMENT_VARIABLE} intrinsic
3724 @cindex undocumented intrinsic 
3725
3726 Intrinsic implemented, documentation pending.
3727
3728 @table @asis
3729 @item @emph{Description}:
3730 @item @emph{Standard}:
3731 F2003
3732
3733 @item @emph{Class}:
3734 Subroutine
3735
3736 @item @emph{Syntax}:
3737 @item @emph{Arguments}:
3738 @item @emph{Return value}:
3739 @item @emph{Example}:
3740 @item @emph{Specific names}:
3741 @item @emph{See also}:
3742 @end table
3743
3744
3745
3746 @node GETGID
3747 @section @code{GETGID} --- Group ID function
3748 @findex @code{GETGID} intrinsic
3749 @cindex GETGID
3750
3751 @table @asis
3752 @item @emph{Description}:
3753 Returns the numerical group ID of the current process.
3754
3755 @item @emph{Standard}:
3756 GNU extension
3757
3758 @item @emph{Class}:
3759 function
3760
3761 @item @emph{Syntax}:
3762 @code{I = GETGID()}
3763
3764 @item @emph{Return value}:
3765 The return value of @code{GETGID} is an @code{INTEGER} of the default
3766 kind.
3767
3768
3769 @item @emph{Example}:
3770 See @code{GETPID} for an example.
3771
3772 @item @emph{See also}:
3773 @ref{GETPID}
3774 @end table
3775
3776
3777
3778 @node GETLOG
3779 @section @code{GETLOG} --- Get login name
3780 @findex @code{GETLOG} intrinsic
3781 @cindex undocumented intrinsic 
3782
3783 Intrinsic implemented, documentation pending.
3784
3785 @table @asis
3786 @item @emph{Description}:
3787 @item @emph{Standard}:
3788 GNU extension
3789
3790 @item @emph{Class}:
3791 Subroutine
3792
3793 @item @emph{Syntax}:
3794 @item @emph{Arguments}:
3795 @item @emph{Return value}:
3796 @item @emph{Example}:
3797 @item @emph{Specific names}:
3798 @item @emph{See also}:
3799 @end table
3800
3801
3802
3803
3804 @node GETPID
3805 @section @code{GETPID} --- Process ID function
3806 @findex @code{GETPID} intrinsic
3807 @cindex GETPID
3808
3809 @table @asis
3810 @item @emph{Description}:
3811 Returns the numerical process identifier of the current process.
3812
3813 @item @emph{Standard}:
3814 GNU extension
3815
3816 @item @emph{Class}:
3817 function
3818
3819 @item @emph{Syntax}:
3820 @code{I = GETPID()}
3821
3822 @item @emph{Return value}:
3823 The return value of @code{GETPID} is an @code{INTEGER} of the default
3824 kind.
3825
3826
3827 @item @emph{Example}:
3828 @smallexample
3829 program info
3830   print *, "The current process ID is ", getpid()
3831   print *, "Your numerical user ID is ", getuid()
3832   print *, "Your numerical group ID is ", getgid()
3833 end program info
3834 @end smallexample
3835
3836 @end table
3837
3838
3839
3840 @node GETUID
3841 @section @code{GETUID} --- User ID function
3842 @findex @code{GETUID} intrinsic
3843 @cindex GETUID
3844
3845 @table @asis
3846 @item @emph{Description}:
3847 Returns the numerical user ID of the current process.
3848
3849 @item @emph{Standard}:
3850 GNU extension
3851
3852 @item @emph{Class}:
3853 function
3854
3855 @item @emph{Syntax}:
3856 @code{GETUID()}
3857
3858 @item @emph{Return value}:
3859 The return value of @code{GETUID} is an @code{INTEGER} of the default
3860 kind.
3861
3862
3863 @item @emph{Example}:
3864 See @code{GETPID} for an example.
3865
3866 @item @emph{See also}:
3867 @ref{GETPID}
3868 @end table
3869
3870
3871
3872 @node GMTIME
3873 @section @code{GMTIME} --- Convert time to GMT info
3874 @findex @code{GMTIME} 
3875 @cindex time function
3876
3877 Not yet implemented in gfortran.
3878
3879 @table @asis
3880 @item @emph{Description}:
3881
3882 @item @emph{Standard}:
3883 GNU extension
3884
3885 @item @emph{Class}:
3886 Subroutine
3887
3888 @item @emph{Syntax}:
3889 @item @emph{Arguments}:
3890 @item @emph{Return value}:
3891 @item @emph{Example}:
3892 @item @emph{Specific names}:
3893 @item @emph{See also}:
3894 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
3895
3896 @end table
3897
3898
3899
3900 @node HOSTNM
3901 @section @code{HOSTNM} --- Get system host name
3902 @findex @code{HOSTNM} intrinsic
3903 @cindex undocumented intrinsic 
3904
3905 Intrinsic implemented, documentation pending.
3906
3907 @table @asis
3908 @item @emph{Description}:
3909 @item @emph{Standard}:
3910 GNU extension
3911
3912 @item @emph{Class}:
3913 @item @emph{Syntax}:
3914 @item @emph{Arguments}:
3915 @item @emph{Return value}:
3916 @item @emph{Example}:
3917 @item @emph{Specific names}:
3918 @item @emph{See also}:
3919 @end table
3920
3921
3922
3923 @node HUGE
3924 @section @code{HUGE} --- Largest number of a kind
3925 @findex @code{HUGE} intrinsic
3926 @cindex huge
3927
3928 @table @asis
3929 @item @emph{Description}:
3930 @code{HUGE(X)} returns the largest number that is not an infinity in
3931 the model of the type of @code{X}.
3932
3933 @item @emph{Standard}:
3934 F95 and later
3935
3936 @item @emph{Class}:
3937 Elemental function
3938
3939 @item @emph{Syntax}:
3940 @code{Y = HUGE(X)}
3941
3942 @item @emph{Arguments}:
3943 @multitable @columnfractions .15 .80
3944 @item @var{X} @tab shall be of type @code{REAL} or @code{INTEGER}.
3945 @end multitable
3946
3947 @item @emph{Return value}:
3948 The return value is of the same type and kind as @var{X}
3949
3950 @item @emph{Example}:
3951 @smallexample
3952 program test_huge_tiny
3953   print *, huge(0), huge(0.0), huge(0.0d0)
3954   print *, tiny(0.0), tiny(0.0d0)
3955 end program test_huge_tiny
3956 @end smallexample
3957 @end table
3958
3959
3960
3961 @node IACHAR
3962 @section @code{IACHAR} --- Code in @acronym{ASCII} collating sequence 
3963 @findex @code{IACHAR} intrinsic
3964 @cindex @acronym{ASCII} collating sequence
3965 @cindex conversion function (character)
3966
3967 @table @asis
3968 @item @emph{Description}:
3969 @code{IACHAR(C)} returns the code for the @acronym{ASCII} character
3970 in the first character position of @code{C}.
3971
3972 @item @emph{Standard}:
3973 F95 and later
3974
3975 @item @emph{Class}:
3976 Elemental function
3977
3978 @item @emph{Syntax}:
3979 @code{I = IACHAR(C)}
3980
3981 @item @emph{Arguments}:
3982 @multitable @columnfractions .15 .80
3983 @item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)}
3984 @end multitable
3985
3986 @item @emph{Return value}:
3987 The return value is of type @code{INTEGER} and of the default integer
3988 kind.
3989
3990 @item @emph{Example}:
3991 @smallexample
3992 program test_iachar
3993   integer i
3994   i = iachar(' ')
3995 end program test_iachar
3996 @end smallexample
3997
3998 @item @emph{See also}:
3999 @ref{CHAR},@ref{ICHAR}
4000
4001 @end table
4002
4003
4004 @node IAND
4005 @section @code{IAND} --- Bitwise logical and
4006 @findex @code{IAND} intrinsic
4007 @cindex bit operations
4008
4009 Intrinsic implemented, documentation pending.
4010
4011 @table @asis
4012 @item @emph{Description}:
4013 @item @emph{Standard}:
4014 F95 and later
4015
4016 @item @emph{Class}:
4017 Elemental function
4018
4019 @item @emph{Syntax}:
4020 @item @emph{Arguments}:
4021 @item @emph{Return value}:
4022 @item @emph{Example}:
4023 @item @emph{Specific names}:
4024
4025 @item @emph{See also}:
4026 @ref{IOR}, @ref{IEOR}, @ref{IBITS}, @ref{IBSET}, @ref{IBCLR},
4027 @end table
4028
4029
4030
4031
4032 @node IARGC
4033 @section @code{IARGC} --- Get number of command line arguments
4034 @findex @code{IARGC} intrinsic
4035 @cindex undocumented intrinsic 
4036
4037 Intrinsic implemented, documentation pending.
4038
4039 @table @asis
4040 @item @emph{Description}:
4041 @item @emph{Standard}:
4042 GNU extension
4043
4044 @item @emph{Class}:
4045 @item @emph{Syntax}:
4046 @item @emph{Arguments}:
4047 @item @emph{Return value}:
4048 @item @emph{Example}:
4049 @item @emph{Specific names}:
4050 @item @emph{See also}:
4051 @ref{GETARG}, @ref{GET_COMMAND}, @ref{COMMAND_ARGUMENT_COUNT}, @ref{GET_COMMAND_ARGUMENT}
4052
4053 @end table
4054
4055
4056
4057
4058 @node IBCLR
4059 @section @code{IBCLR} --- Clear bit
4060 @findex @code{IBCLR} intrinsic
4061 @cindex bit operations
4062
4063 Intrinsic implemented, documentation pending.
4064
4065 @table @asis
4066 @item @emph{Description}:
4067 @item @emph{Standard}:
4068 F95 and later
4069
4070 @item @emph{Class}:
4071 Elemental function
4072
4073 @item @emph{Syntax}:
4074 @item @emph{Arguments}:
4075 @item @emph{Return value}:
4076 @item @emph{Example}:
4077 @item @emph{Specific names}:
4078
4079 @item @emph{See also}:
4080 @ref{IBITS}, @ref{IBSET}, @ref{IAND}, @ref{IOR}, @ref{IEOR}
4081 @end table
4082
4083
4084
4085
4086 @node IBITS
4087 @section @code{IBITS} --- Bit extraction
4088 @findex @code{IBITS} intrinsic
4089 @cindex bit operations
4090
4091 Intrinsic implemented, documentation pending.
4092
4093 @table @asis
4094 @item @emph{Description}:
4095 @item @emph{Standard}:
4096 F95 and later
4097
4098 @item @emph{Class}:
4099 Elemental function
4100
4101 @item @emph{Syntax}:
4102 @item @emph{Arguments}:
4103 @item @emph{Return value}:
4104 @item @emph{Example}:
4105 @item @emph{Specific names}:
4106 @item @emph{See also}:
4107 @ref{IBCLR}, @ref{IBSET}, @ref{IAND}, @ref{IOR}, @ref{IEOR}
4108
4109 @end table
4110
4111
4112
4113
4114 @node IBSET
4115 @section @code{IBSET} --- Set bit
4116 @findex @code{IBSET} intrinsic
4117 @cindex bit operations
4118
4119 Intrinsic implemented, documentation pending.
4120
4121 @table @asis
4122 @item @emph{Description}:
4123 @item @emph{Standard}:
4124 F95 and later
4125
4126 @item @emph{Class}:
4127 Elemental function
4128
4129 @item @emph{Syntax}:
4130 @item @emph{Arguments}:
4131 @item @emph{Return value}:
4132 @item @emph{Example}:
4133 @item @emph{Specific names}:
4134
4135 @item @emph{See also}:
4136 @ref{IBCLR}, @ref{IBITS}, @ref{IAND}, @ref{IOR}, @ref{IEOR}
4137
4138 @end table
4139
4140
4141
4142 @node ICHAR
4143 @section @code{ICHAR} --- Character-to-integer conversion function
4144 @findex @code{ICHAR} intrinsic
4145 @cindex conversion function (character)
4146
4147 @table @asis
4148 @item @emph{Description}:
4149 @code{ICHAR(C)} returns the code for the character in the first character
4150 position of @code{C} in the system's native character set.
4151 The correspondence between characters and their codes is not necessarily
4152 the same across different GNU Fortran implementations.
4153
4154 @item @emph{Standard}:
4155 F95 and later
4156
4157 @item @emph{Class}:
4158 Elemental function
4159
4160 @item @emph{Syntax}:
4161 @code{I = ICHAR(C)}
4162
4163 @item @emph{Arguments}:
4164 @multitable @columnfractions .15 .80
4165 @item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)}
4166 @end multitable
4167
4168 @item @emph{Return value}:
4169 The return value is of type @code{INTEGER} and of the default integer
4170 kind.
4171
4172 @item @emph{Example}:
4173 @smallexample
4174 program test_ichar
4175   integer i
4176   i = ichar(' ')
4177 end program test_ichar
4178 @end smallexample
4179
4180 @item @emph{Note}:
4181 No intrinsic exists to convert a printable character string to a numerical
4182 value. For example, there is no intrinsic that, given the @code{CHARACTER}
4183 value 154, returns an @code{INTEGER} or @code{REAL} value with the
4184 value 154.
4185
4186 Instead, you can use internal-file I/O to do this kind of conversion. For
4187 example:
4188 @smallexample
4189 program read_val
4190   integer value
4191   character(len=10) string
4192
4193   string = '154'
4194   read (string,'(I10)') value
4195   print *, value
4196 end program read_val
4197 @end smallexample
4198 @end table
4199
4200 @node IDATE
4201 @section @code{IDATE} --- Get current local time subroutine (day/month/year) 
4202 @findex @code{IDATE} intrinsic
4203
4204 @table @asis
4205 @item @emph{Description}:
4206 @code{IDATE(TARRAY)} Fills @var{TARRAY} with the numerical values at the  
4207 current local time. The day (in the range 1-31), month (in the range 1-12), 
4208 and year appear in elements 1, 2, and 3 of @var{TARRAY}, respectively. 
4209 The year has four significant digits.
4210
4211 @item @emph{Standard}:
4212 GNU extension
4213
4214 @item @emph{Class}:
4215 Subroutine
4216
4217 @item @emph{Syntax}:
4218 @code{CALL IDATE(TARRAY)}
4219
4220 @item @emph{Arguments}:
4221 @multitable @columnfractions .15 .80
4222 @item @var{TARRAY} @tab The type shall be @code{INTEGER, DIMENSION(3)} and
4223 the kind shall be the default integer kind.
4224 @end multitable
4225
4226 @item @emph{Return value}:
4227 Does not return.
4228
4229 @item @emph{Example}:
4230 @smallexample
4231 program test_idate
4232   integer, dimension(3) :: tarray
4233   call idate(tarray)
4234   print *, tarray(1)
4235   print *, tarray(2)
4236   print *, tarray(3)
4237 end program test_idate
4238 @end smallexample
4239 @end table
4240
4241
4242
4243 @node IEOR
4244 @section @code{IEOR} --- Bitwise logical exclusive or
4245 @findex @code{IEOR} intrinsic
4246 @cindex bit operations
4247
4248 Intrinsic implemented, documentation pending.
4249
4250 @table @asis
4251 @item @emph{Description}:
4252 @item @emph{Standard}:
4253 F95 and later
4254
4255 @item @emph{Class}:
4256 Elemental function
4257
4258 @item @emph{Syntax}:
4259 @item @emph{Arguments}:
4260 @item @emph{Return value}:
4261 @item @emph{Example}:
4262 @item @emph{Specific names}:
4263
4264 @item @emph{See also}:
4265 @ref{IOR}, @ref{IAND}, @ref{IBITS}, @ref{IBSET}, @ref{IBCLR},
4266 @end table
4267
4268
4269
4270
4271 @node IERRNO
4272 @section @code{IERRNO} --- Get the last system error number
4273 @findex @code{IERRNO} intrinsic
4274 @cindex undocumented intrinsic 
4275
4276 Intrinsic implemented, documentation pending.
4277
4278 @table @asis
4279 @item @emph{Description}:
4280 @item @emph{Standard}:
4281 GNU extension
4282
4283 @item @emph{Class}:
4284 @item @emph{Syntax}:
4285 @item @emph{Arguments}:
4286 @item @emph{Return value}:
4287 @item @emph{Example}:
4288
4289 @item @emph{See also}:
4290 @ref{PERROR}
4291 @end table
4292
4293
4294
4295
4296 @node INDEX
4297 @section @code{INDEX} --- Position of a substring within a string
4298 @findex @code{INDEX} intrinsic
4299 @cindex undocumented intrinsic 
4300
4301 Intrinsic implemented, documentation pending.
4302
4303 @table @asis
4304 @item @emph{Description}:
4305 @item @emph{Standard}:
4306 F77 and later
4307
4308 @item @emph{Class}:
4309 Elemental function
4310
4311 @item @emph{Syntax}:
4312 @item @emph{Arguments}:
4313 @item @emph{Return value}:
4314 @item @emph{Example}:
4315 @item @emph{Specific names}:
4316 @item @emph{See also}:
4317 @end table
4318
4319
4320
4321
4322 @node INT
4323 @section @code{INT} --- Convert to integer type
4324 @findex @code{INT} intrinsic
4325 @findex @code{IFIX} intrinsic
4326 @findex @code{IDINT} intrinsic
4327 @cindex conversion function (integer)
4328
4329 @table @asis
4330 @item @emph{Description}:
4331 Convert to integer type
4332
4333 @item @emph{Standard}:
4334 F77 and later
4335
4336 @item @emph{Class}:
4337 Elemental function
4338
4339 @item @emph{Syntax}:
4340 @multitable @columnfractions .30 .80
4341 @item @code{X = INT(X)}
4342 @item @code{X = INT(X, KIND)}
4343 @end multitable
4344
4345 @item @emph{Arguments}:
4346 @multitable @columnfractions .15 .80
4347 @item @var{X} @tab shall be of type @code{INTEGER(*)}, @code{REAL(*)} or @code{COMPLEX(*)}
4348 @item @var{KIND}  @tab (Optional) @var{KIND} shall be a scalar integer.
4349 @end multitable
4350
4351 @item @emph{Return value}:
4352 These functions return a @code{INTEGER(*)} variable or array under 
4353 the following rules: 
4354
4355 @table @asis
4356 @item (A)
4357 If @var{X} is of type @code{INTEGER(*)}, @code{INT(X) = X} 
4358 @item (B)
4359 If @var{X} is of type @code{REAL(*)} and @math{|X| < 1} @code{INT(X)} equals @var{0}. 
4360 If @math{|X| \geq 1}, then @code{INT(X)} equals the largest integer that does not exceed 
4361 the range of @var{X} and whose sign is the same as the sign of @var{X}.
4362 @item (C)
4363 If @var{X} is of type @code{COMPLEX(*)}, rule B is applied to the real part of X.
4364 @end table
4365
4366 @item @emph{Example}:
4367 @smallexample
4368 program test_int
4369   integer :: i = 42
4370   complex :: z = (-3.7, 1.0)
4371   print *, int(i)
4372   print *, int(z), int(z,8)
4373 end program
4374 @end smallexample
4375
4376 @item @emph{Specific names}:
4377 @multitable @columnfractions .20 .20 .20 .40
4378 @item Name             @tab Argument            @tab Return type       @tab Standard
4379 @item @code{IFIX(X)}   @tab @code{REAL(4) X}    @tab @code{INTEGER}    @tab F77 and later
4380 @item @code{IDINT(X)}  @tab @code{REAL(8) X}    @tab @code{INTEGER}    @tab F77 and later
4381 @end multitable
4382
4383 @comment @item @emph{See also}:
4384 @end table
4385
4386
4387
4388
4389 @node IOR
4390 @section @code{IOR} --- Bitwise logical or
4391 @findex @code{IOR} intrinsic
4392 @cindex bit operations
4393
4394 Intrinsic implemented, documentation pending.
4395
4396 @table @asis
4397 @item @emph{Description}:
4398 @item @emph{Standard}:
4399 F95 and later
4400
4401 @item @emph{Class}:
4402 Elemental function
4403
4404 @item @emph{Syntax}:
4405 @item @emph{Arguments}:
4406 @item @emph{Return value}:
4407 @item @emph{Example}:
4408 @item @emph{Specific names}:
4409
4410 @item @emph{See also}:
4411 @ref{IEOR}, @ref{IAND}, @ref{IBITS}, @ref{IBSET}, @ref{IBCLR},
4412 @end table
4413
4414
4415
4416
4417 @node IRAND
4418 @section @code{IRAND} --- Integer pseudo-random number
4419 @findex @code{IRAND} intrinsic
4420 @cindex random number
4421
4422 @table @asis
4423 @item @emph{Description}:
4424 @code{IRAND(FLAG)} returns a pseudo-random number from a uniform
4425 distribution between 0 and a system-dependent limit (which is in most
4426 cases 2147483647). If @var{FLAG} is 0, the next number
4427 in the current sequence is returned; if @var{FLAG} is 1, the generator
4428 is restarted by @code{CALL SRAND(0)}; if @var{FLAG} has any other value,
4429 it is used as a new seed with @code{SRAND}.
4430
4431 @item @emph{Standard}:
4432 GNU extension
4433
4434 @item @emph{Class}:
4435 non-elemental function
4436
4437 @item @emph{Syntax}:
4438 @code{I = IRAND(FLAG)}
4439
4440 @item @emph{Arguments}:
4441 @multitable @columnfractions .15 .80
4442 @item @var{FLAG} @tab shall be a scalar @code{INTEGER} of kind 4.
4443 @end multitable
4444
4445 @item @emph{Return value}:
4446 The return value is of @code{INTEGER(kind=4)} type.
4447
4448 @item @emph{Example}:
4449 @smallexample
4450 program test_irand
4451   integer,parameter :: seed = 86456
4452   
4453   call srand(seed)
4454   print *, irand(), irand(), irand(), irand()
4455   print *, irand(seed), irand(), irand(), irand()
4456 end program test_irand
4457 @end smallexample
4458
4459 @end table
4460
4461
4462
4463 @node ISHFT
4464 @section @code{ISHFT} --- Shift bits
4465 @findex @code{ISHFT} intrinsic
4466 @cindex bit manipulation
4467
4468 Intrinsic implemented, documentation pending.
4469
4470 @table @asis
4471 @item @emph{Description}:
4472 @item @emph{Standard}:
4473 F95 and later
4474
4475 @item @emph{Class}:
4476 Elemental function
4477
4478 @item @emph{Syntax}:
4479 @item @emph{Arguments}:
4480 @item @emph{Return value}:
4481 @item @emph{Example}:
4482 @item @emph{Specific names}:
4483
4484 @item @emph{See also}:
4485 @ref{ISHFTC}
4486 @end table
4487
4488
4489
4490
4491 @node ISHFTC
4492 @section @code{ISHFTC} --- Shift bits circularly
4493 @findex @code{ISHFTC} intrinsic
4494 @cindex bit manipulation
4495
4496 Intrinsic implemented, documentation pending.
4497
4498 @table @asis
4499 @item @emph{Description}:
4500 @item @emph{Standard}:
4501 F95 and later
4502
4503 @item @emph{Class}:
4504 Elemental function
4505
4506 @item @emph{Syntax}:
4507 @item @emph{Arguments}:
4508 @item @emph{Return value}:
4509 @item @emph{Example}:
4510 @item @emph{Specific names}:
4511
4512 @item @emph{See also}:
4513 @ref{ISHFT}
4514 @end table
4515
4516
4517
4518 @node ITIME
4519 @section @code{ITIME} --- Get current local time subroutine (hour/minutes/seconds) 
4520 @findex @code{ITIME} intrinsic
4521
4522 @table @asis
4523 @item @emph{Description}:
4524 @code{IDATE(TARRAY)} Fills @var{TARRAY} with the numerical values at the  
4525 current local time. The hour (in the range 1-24), minute (in the range 1-60), 
4526 and seconds (in the range 1-60) appear in elements 1, 2, and 3 of @var{TARRAY}, 
4527 respectively.
4528
4529 @item @emph{Standard}:
4530 GNU extension
4531
4532 @item @emph{Class}:
4533 Subroutine
4534
4535 @item @emph{Syntax}:
4536 @code{CALL ITIME(TARRAY)}
4537
4538 @item @emph{Arguments}:
4539 @multitable @columnfractions .15 .80
4540 @item @var{TARRAY} @tab The type shall be @code{INTEGER, DIMENSION(3)}
4541 and the kind shall be the default integer kind.
4542 @end multitable
4543
4544 @item @emph{Return value}:
4545 Does not return.
4546
4547
4548 @item @emph{Example}:
4549 @smallexample
4550 program test_itime
4551   integer, dimension(3) :: tarray
4552   call itime(tarray)
4553   print *, tarray(1)
4554   print *, tarray(2)
4555   print *, tarray(3)
4556 end program test_itime
4557 @end smallexample
4558 @end table
4559
4560
4561
4562 @node KILL
4563 @section @code{KILL} --- Send a signal to a process
4564 @findex @code{KILL} intrinsic
4565 @cindex undocumented intrinsic 
4566
4567 Intrinsic implemented, documentation pending.
4568
4569 @table @asis
4570 @item @emph{Description}:
4571 @item @emph{Standard}:
4572 GNU extension
4573
4574 @item @emph{Class}:
4575 Subroutine
4576
4577 @item @emph{Syntax}:
4578 @item @emph{Arguments}:
4579 @item @emph{Return value}:
4580 @item @emph{Example}:
4581 @item @emph{Specific names}:
4582
4583 @item @emph{See also}:
4584 @ref{ABORT}, @ref{EXIT}
4585 @end table
4586
4587
4588
4589 @node KIND
4590 @section @code{KIND} --- Kind of an entity
4591 @findex @code{KIND} intrinsic
4592
4593 @table @asis
4594 @item @emph{Description}:
4595 @code{KIND(X)} returns the kind value of the entity @var{X}.
4596
4597 @item @emph{Standard}:
4598 F95 and later
4599
4600 @item @emph{Class}:
4601 Inquiry function
4602
4603 @item @emph{Syntax}:
4604 @code{K = KIND(X)}
4605
4606 @item @emph{Arguments}:
4607 @multitable @columnfractions .15 .80
4608 @item @var{X} @tab Shall be of type @code{LOGICAL}, @code{INTEGER},
4609 @code{REAL}, @code{COMPLEX} or @code{CHARACTER}.
4610 @end multitable
4611
4612 @item @emph{Return value}:
4613 The return value is a scalar of type @code{INTEGER} and of the default
4614 integer kind.
4615
4616 @item @emph{Example}:
4617 @smallexample
4618 program test_kind
4619   integer,parameter :: kc = kind(' ')
4620   integer,parameter :: kl = kind(.true.)
4621
4622   print *, "The default character kind is ", kc
4623   print *, "The default logical kind is ", kl
4624 end program test_kind
4625 @end smallexample
4626
4627 @end table
4628
4629
4630
4631 @node LBOUND
4632 @section @code{LBOUND} --- Lower dimension bounds of an array
4633 @findex @code{LBOUND} intrinsic
4634 @cindex undocumented intrinsic 
4635
4636 Intrinsic implemented, documentation pending.
4637
4638 @table @asis
4639 @item @emph{Description}:
4640 @item @emph{Standard}:
4641 F95 and later
4642
4643 @item @emph{Class}:
4644 Inquiry function
4645
4646 @item @emph{Syntax}:
4647 @item @emph{Arguments}:
4648 @item @emph{Return value}:
4649 @item @emph{Example}:
4650 @item @emph{See also}:
4651 @ref{UBOUND}
4652 @end table
4653
4654
4655
4656
4657 @node LEN
4658 @section @code{LEN} --- Length of a character entity
4659 @findex @code{LEN} intrinsic
4660 @cindex undocumented intrinsic 
4661
4662 Intrinsic implemented, documentation pending.
4663
4664 @table @asis
4665 @item @emph{Description}:
4666 @item @emph{Standard}:
4667 F77 and later
4668
4669 @item @emph{Class}:
4670 Inquiry function
4671
4672 @item @emph{Syntax}:
4673 @item @emph{Arguments}:
4674 @item @emph{Return value}:
4675 @item @emph{Example}:
4676 @item @emph{Specific names}:
4677
4678 @item @emph{See also}:
4679 @ref{LEN_TRIM}, @ref{ADJUSTL}, @ref{ADJUSTR}
4680 @end table
4681
4682
4683
4684
4685 @node LEN_TRIM
4686 @section @code{LEN_TRIM} --- Length of a character entity without trailing blank characters
4687 @findex @code{LEN_TRIM} intrinsic
4688 @cindex undocumented intrinsic 
4689
4690 Intrinsic implemented, documentation pending.
4691
4692 @table @asis
4693 @item @emph{Description}:
4694 @item @emph{Standard}:
4695 F95 and later
4696
4697 @item @emph{Class}:
4698 Elemental function
4699
4700 @item @emph{Syntax}:
4701 @item @emph{Arguments}:
4702 @item @emph{Return value}:
4703 @item @emph{Example}:
4704
4705 @item @emph{See also}:
4706 @ref{LEN}, @ref{ADJUSTL}, @ref{ADJUSTR}
4707 @end table
4708
4709
4710
4711
4712 @node LGE
4713 @section @code{LGE} --- Lexical greater than or equal
4714 @findex @code{LGE} intrinsic
4715 @cindex comparison (lexical)
4716
4717 Intrinsic implemented, documentation pending.
4718
4719 @table @asis
4720 @item @emph{Description}:
4721 @item @emph{Standard}:
4722 F77 and later
4723
4724 @item @emph{Class}:
4725 Elemental function
4726
4727 @item @emph{Syntax}:
4728 @item @emph{Arguments}:
4729 @item @emph{Return value}:
4730 @item @emph{Example}:
4731
4732 @item @emph{See also}:
4733 @ref{LGT}, @ref{LLE}, @ref{LLT}
4734 @end table
4735
4736
4737
4738
4739 @node LGT
4740 @section @code{LGT} --- Lexical greater than
4741 @findex @code{LGT} intrinsic
4742 @cindex comparison (lexical)
4743
4744 Intrinsic implemented, documentation pending.
4745
4746 @table @asis
4747 @item @emph{Description}:
4748 @item @emph{Standard}:
4749 F77 and later
4750
4751 @item @emph{Class}:
4752 Elemental function
4753
4754 @item @emph{Syntax}:
4755 @item @emph{Arguments}:
4756 @item @emph{Return value}:
4757 @item @emph{Example}:
4758
4759 @item @emph{See also}:
4760 @ref{LGE}, @ref{LLE}, @ref{LLT}
4761 @end table
4762
4763
4764
4765
4766 @node LINK
4767 @section @code{LINK} --- Create a hard link
4768 @findex @code{LINK} intrinsic
4769 @cindex file system operations
4770
4771 Intrinsic implemented, documentation pending.
4772
4773 @table @asis
4774 @item @emph{Description}:
4775 @item @emph{Standard}:
4776 GNU extension
4777
4778 @item @emph{Class}:
4779 Subroutine
4780
4781 @item @emph{Syntax}:
4782 @item @emph{Arguments}:
4783 @item @emph{Return value}:
4784 @item @emph{Example}:
4785 @item @emph{Specific names}:
4786
4787 @item @emph{See also}:
4788 @ref{UNLINK}
4789 @end table
4790
4791
4792
4793
4794 @node LLE
4795 @section @code{LLE} --- Lexical less than or equal
4796 @findex @code{LLE} intrinsic
4797 @cindex comparison (lexical)
4798
4799 Intrinsic implemented, documentation pending.
4800
4801 @table @asis
4802 @item @emph{Description}:
4803 @item @emph{Standard}:
4804 F77 and later
4805
4806 @item @emph{Class}:
4807 Elemental function
4808
4809 @item @emph{Syntax}:
4810 @item @emph{Arguments}:
4811 @item @emph{Return value}:
4812 @item @emph{Example}:
4813
4814 @item @emph{See also}:
4815 @ref{LGE}, @ref{LGT}, @ref{LLT}
4816 @end table
4817
4818
4819
4820
4821 @node LLT
4822 @section @code{LLT} --- Lexical less than
4823 @findex @code{LLT} intrinsic
4824 @cindex comparison (lexical)
4825
4826 Intrinsic implemented, documentation pending.
4827
4828 @table @asis
4829 @item @emph{Description}:
4830 @item @emph{Standard}:
4831 F77 and later
4832
4833 @item @emph{Class}:
4834 Elemental function
4835
4836 @item @emph{Syntax}:
4837 @item @emph{Arguments}:
4838 @item @emph{Return value}:
4839 @item @emph{Example}:
4840
4841 @item @emph{See also}:
4842 @ref{LGE}, @ref{LGT}, @ref{LLE}
4843 @end table
4844
4845
4846
4847
4848 @node LNBLNK
4849 @section @code{LNBLNK} --- Index of the last non-blank character in a string
4850 @findex @code{LNBLNK} intrinsic
4851 @cindex undocumented intrinsic 
4852
4853 Intrinsic implemented, documentation pending.
4854
4855 @table @asis
4856 @item @emph{Description}:
4857 @item @emph{Standard}:
4858 GNU extension
4859
4860 @item @emph{Class}:
4861 @item @emph{Syntax}:
4862 @item @emph{Arguments}:
4863 @item @emph{Return value}:
4864 @item @emph{Example}:
4865 @item @emph{Specific names}:
4866
4867 @item @emph{See also}:
4868 @ref{INDEX}
4869 @end table
4870
4871
4872
4873
4874 @node LOC
4875 @section @code{LOC} --- Returns the address of a variable
4876 @findex @code{LOC} intrinsic
4877 @cindex loc
4878
4879 @table @asis
4880 @item @emph{Description}:
4881 @code{LOC(X)} returns the address of @var{X} as an integer.
4882
4883 @item @emph{Standard}:
4884 GNU extension
4885
4886 @item @emph{Class}:
4887 Inquiry function
4888
4889 @item @emph{Syntax}:
4890 @code{I = LOC(X)}
4891
4892 @item @emph{Arguments}:
4893 @multitable @columnfractions .15 .80
4894 @item @var{X} @tab Variable of any type.
4895 @end multitable
4896
4897 @item @emph{Return value}:
4898 The return value is of type @code{INTEGER(n)}, where @code{n} is the
4899 size (in bytes) of a memory address on the target machine.
4900
4901 @item @emph{Example}:
4902 @smallexample
4903 program test_loc
4904   integer :: i
4905   real :: r
4906   i = loc(r)
4907   print *, i
4908 end program test_loc
4909 @end smallexample
4910 @end table
4911
4912 @node LOG
4913 @section @code{LOG} --- Logarithm function
4914 @findex @code{LOG} intrinsic
4915 @findex @code{ALOG} intrinsic
4916 @findex @code{DLOG} intrinsic
4917 @findex @code{CLOG} intrinsic
4918 @findex @code{ZLOG} intrinsic
4919 @findex @code{CDLOG} intrinsic
4920 @cindex logarithm
4921
4922 @table @asis
4923 @item @emph{Description}:
4924 @code{LOG(X)} computes the logarithm of @var{X}.
4925
4926 @item @emph{Standard}:
4927 F77 and later
4928
4929 @item @emph{Class}:
4930 Elemental function
4931
4932 @item @emph{Syntax}:
4933 @code{X = LOG(X)}
4934
4935 @item @emph{Arguments}:
4936 @multitable @columnfractions .15 .80
4937 @item @var{X} @tab The type shall be @code{REAL(*)} or
4938 @code{COMPLEX(*)}.
4939 @end multitable
4940
4941 @item @emph{Return value}:
4942 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
4943 The kind type parameter is the same as @var{X}.
4944
4945 @item @emph{Example}:
4946 @smallexample
4947 program test_log
4948   real(8) :: x = 1.0_8
4949   complex :: z = (1.0, 2.0)
4950   x = log(x)
4951   z = log(z)
4952 end program test_log
4953 @end smallexample
4954
4955 @item @emph{Specific names}:
4956 @multitable @columnfractions .20 .20 .20 .40
4957 @item Name            @tab Argument          @tab Return type       @tab Standard
4958 @item @code{ALOG(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab f95, gnu
4959 @item @code{DLOG(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
4960 @item @code{CLOG(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
4961 @item @code{ZLOG(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
4962 @item @code{CDLOG(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
4963 @end multitable
4964 @end table
4965
4966
4967
4968 @node LOG10
4969 @section @code{LOG10} --- Base 10 logarithm function
4970 @findex @code{LOG10} intrinsic
4971 @findex @code{ALOG10} intrinsic
4972 @findex @code{DLOG10} intrinsic
4973 @cindex logarithm
4974
4975 @table @asis
4976 @item @emph{Description}:
4977 @code{LOG10(X)} computes the base 10 logarithm of @var{X}.
4978
4979 @item @emph{Standard}:
4980 F77 and later
4981
4982 @item @emph{Class}:
4983 Elemental function
4984
4985 @item @emph{Syntax}:
4986 @code{X = LOG10(X)}
4987
4988 @item @emph{Arguments}:
4989 @multitable @columnfractions .15 .80
4990 @item @var{X} @tab The type shall be @code{REAL(*)} or
4991 @code{COMPLEX(*)}.
4992 @end multitable
4993
4994 @item @emph{Return value}:
4995 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
4996 The kind type parameter is the same as @var{X}.
4997
4998 @item @emph{Example}:
4999 @smallexample
5000 program test_log10
5001   real(8) :: x = 10.0_8
5002   x = log10(x)
5003 end program test_log10
5004 @end smallexample
5005
5006 @item @emph{Specific names}:
5007 @multitable @columnfractions .20 .20 .20 .40
5008 @item Name            @tab Argument          @tab Return type       @tab Standard
5009 @item @code{ALOG10(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab F95 and later
5010 @item @code{DLOG10(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F95 and later
5011 @end multitable
5012 @end table
5013
5014
5015 @node LOGICAL
5016 @section @code{LOGICAL} --- Convert to logical type
5017 @findex @code{LOGICAL} intrinsic
5018 @cindex conversion function (logical)
5019
5020 Intrinsic implemented, documentation pending.
5021
5022 @table @asis
5023 @item @emph{Description}:
5024 @item @emph{Standard}:
5025 F95 and later
5026
5027 @item @emph{Class}:
5028 Elemental function
5029
5030 @item @emph{Syntax}:
5031 @item @emph{Arguments}:
5032 @item @emph{Return value}:
5033 @item @emph{Example}:
5034 @item @emph{Specific names}:
5035 @item @emph{See also}:
5036 @end table
5037
5038
5039
5040
5041 @node LSHIFT
5042 @section @code{LSHIFT} --- Left shift bits
5043 @findex @code{LSHIFT} 
5044 @cindex bit manipulation
5045
5046 Not yet implemented in gfortran.
5047
5048 @table @asis
5049 @item @emph{Description}:
5050
5051 @item @emph{Standard}:
5052 GNU extension
5053
5054 @item @emph{Class}:
5055 Function
5056
5057 @item @emph{Syntax}:
5058 @item @emph{Arguments}:
5059 @item @emph{Return value}:
5060 @item @emph{Example}:
5061 @item @emph{Specific names}:
5062 @item @emph{See also}:
5063 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
5064
5065 @end table
5066
5067
5068
5069 @node LTIME
5070 @section @code{LTIME} --- Convert time to local time info
5071 @findex @code{LTIME} 
5072 @cindex time function
5073
5074 Not yet implemented in gfortran.
5075
5076 @table @asis
5077 @item @emph{Description}:
5078
5079 @item @emph{Standard}:
5080 GNU extension
5081
5082 @item @emph{Class}:
5083 Subroutine
5084
5085 @item @emph{Syntax}:
5086 @item @emph{Arguments}:
5087 @item @emph{Return value}:
5088 @item @emph{Example}:
5089 @item @emph{Specific names}:
5090 @item @emph{See also}:
5091 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
5092
5093 @end table
5094
5095
5096
5097 @node MALLOC
5098 @section @code{MALLOC} --- Allocate dynamic memory
5099 @findex @code{MALLOC} intrinsic
5100 @cindex MALLOC
5101
5102 @table @asis
5103 @item @emph{Description}:
5104 @code{MALLOC(SIZE)} allocates @var{SIZE} bytes of dynamic memory and
5105 returns the address of the allocated memory. The @code{MALLOC} intrinsic
5106 is an extension intended to be used with Cray pointers, and is provided
5107 in @command{gfortran} to allow user to compile legacy code. For new code
5108 using Fortran 95 pointers, the memory allocation intrinsic is
5109 @code{ALLOCATE}.
5110
5111 @item @emph{Standard}:
5112 GNU extension
5113
5114 @item @emph{Class}:
5115 non-elemental function
5116
5117 @item @emph{Syntax}:
5118 @code{PTR = MALLOC(SIZE)}
5119
5120 @item @emph{Arguments}:
5121 @multitable @columnfractions .15 .80
5122 @item @var{SIZE} @tab The type shall be @code{INTEGER(*)}.
5123 @end multitable
5124
5125 @item @emph{Return value}:
5126 The return value is of type @code{INTEGER(K)}, with @var{K} such that
5127 variables of type @code{INTEGER(K)} have the same size as
5128 C pointers (@code{sizeof(void *)}).
5129
5130 @item @emph{Example}:
5131 The following example demonstrates the use of @code{MALLOC} and
5132 @code{FREE} with Cray pointers. This example is intended to run on
5133 32-bit systems, where the default integer kind is suitable to store
5134 pointers; on 64-bit systems, ptr_x would need to be declared as
5135 @code{integer(kind=8)}.
5136
5137 @smallexample
5138 program test_malloc
5139   integer i
5140   integer ptr_x
5141   real*8 x(*), z
5142   pointer(ptr_x,x)
5143
5144   ptr_x = malloc(20*8)
5145   do i = 1, 20
5146     x(i) = sqrt(1.0d0 / i)
5147   end do
5148   z = 0
5149   do i = 1, 20
5150     z = z + x(i)
5151     print *, z
5152   end do
5153   call free(ptr_x)
5154 end program test_malloc
5155 @end smallexample
5156
5157 @item @emph{See also}:
5158 @ref{FREE}
5159 @end table
5160
5161
5162 @node MATMUL
5163 @section @code{MATMUL} --- matrix multiplication
5164 @findex @code{MATMUL} intrinsic
5165 @cindex matrix operations
5166
5167 Intrinsic implemented, documentation pending.
5168
5169 @table @asis
5170 @item @emph{Description}:
5171 @item @emph{Standard}:
5172 F95 and later
5173
5174 @item @emph{Class}:
5175 Transformational function
5176
5177 @item @emph{Syntax}:
5178 @item @emph{Arguments}:
5179 @item @emph{Return value}:
5180 @item @emph{Example}:
5181 @item @emph{See also}:
5182 @end table
5183
5184
5185 @node MAX
5186 @section @code{MAX} --- Maximum value of an argument list
5187 @findex @code{MAX} intrinsic
5188 @cindex undocumented intrinsic 
5189
5190 Intrinsic implemented, documentation pending.
5191
5192 @table @asis
5193 @item @emph{Description}:
5194 @item @emph{Standard}:
5195 F77 and later
5196
5197 @item @emph{Class}:
5198 Elemental function
5199
5200 @item @emph{Syntax}:
5201 @item @emph{Arguments}:
5202 @item @emph{Return value}:
5203 @item @emph{Example}:
5204
5205 @item @emph{Specific names}:
5206 @multitable @columnfractions .20 .20 .20 .40
5207 @item Name             @tab Argument            @tab Return type         @tab Standard
5208 @item @code{MAX0(I)}   @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)}   @tab F77 and later
5209 @item @code{AMAX0(I)}  @tab @code{INTEGER(4) I} @tab @code{REAL(MAX(X))} @tab F77 and later
5210 @item @code{MAX1(X)}   @tab @code{REAL(*) X}    @tab @code{INT(MAX(X))}  @tab F77 and later
5211 @item @code{AMAX1(X)}  @tab @code{REAL(4)    X} @tab @code{REAL(4)}      @tab F77 and later
5212 @item @code{DMAX1(X)}  @tab @code{REAL(8)    X} @tab @code{REAL(8)}      @tab F77 and later
5213 @end multitable
5214
5215 @item @emph{See also}:
5216 @ref{MAXLOC} @ref{MAXVAL}
5217 @end table
5218
5219
5220 @node MAXEXPONENT
5221 @section @code{MAXEXPONENT} --- Maximum exponent of a real kind
5222 @findex @code{MAXEXPONENT} intrinsic
5223 @cindex MAXEXPONENT
5224
5225 @table @asis
5226 @item @emph{Description}:
5227 @code{MAXEXPONENT(X)} returns the maximum exponent in the model of the
5228 type of @code{X}.
5229
5230 @item @emph{Standard}:
5231 F95 and later
5232
5233 @item @emph{Class}:
5234 Inquiry function
5235
5236 @item @emph{Syntax}:
5237 @code{I = MAXEXPONENT(X)}
5238
5239 @item @emph{Arguments}:
5240 @multitable @columnfractions .15 .80
5241 @item @var{X} @tab shall be of type @code{REAL}.
5242 @end multitable
5243
5244 @item @emph{Return value}:
5245 The return value is of type @code{INTEGER} and of the default integer
5246 kind.
5247
5248 @item @emph{Example}:
5249 @smallexample
5250 program exponents
5251   real(kind=4) :: x
5252   real(kind=8) :: y
5253
5254   print *, minexponent(x), maxexponent(x)
5255   print *, minexponent(y), maxexponent(y)
5256 end program exponents
5257 @end smallexample
5258 @end table
5259
5260
5261 @node MAXLOC
5262 @section @code{MAXLOC} --- Location of the maximum value within an array
5263 @findex @code{MAXLOC} intrinsic
5264 @cindex undocumented intrinsic 
5265
5266 Intrinsic implemented, documentation pending.
5267
5268 @table @asis
5269 @item @emph{Description}:
5270 @item @emph{Standard}:
5271 F95 and later
5272
5273 @item @emph{Class}:
5274 Transformational function
5275
5276 @item @emph{Syntax}:
5277 @item @emph{Arguments}:
5278 @item @emph{Return value}:
5279 @item @emph{Example}:
5280 @item @emph{See also}:
5281 @ref{MAX}, @ref{MAXVAL}
5282 @end table
5283
5284
5285
5286 @node MAXVAL
5287 @section @code{MAXVAL} --- Maximum value of an array
5288 @findex @code{MAXVAL} intrinsic
5289 @cindex undocumented intrinsic 
5290
5291 Intrinsic implemented, documentation pending.
5292
5293 @table @asis
5294 @item @emph{Description}:
5295 @item @emph{Standard}:
5296
5297
5298 @item @emph{Class}:
5299 Transformational function
5300
5301 @item @emph{Syntax}:
5302 @item @emph{Arguments}:
5303 @item @emph{Return value}:
5304 @item @emph{Example}:
5305 @item @emph{Specific names}:
5306
5307 @item @emph{See also}:
5308 @ref{MAX}, @ref{MAXLOC}
5309 @end table
5310
5311
5312
5313
5314 @node MERGE
5315 @section @code{MERGE} --- Merge arrays
5316 @findex @code{MERGE} intrinsic
5317 @cindex undocumented intrinsic 
5318
5319 Intrinsic implemented, documentation pending.
5320
5321 @table @asis
5322 @item @emph{Description}:
5323 @item @emph{Standard}:
5324 F95 and later
5325
5326 @item @emph{Class}:
5327 elemental function
5328
5329 @item @emph{Syntax}:
5330 @item @emph{Arguments}:
5331 @item @emph{Return value}:
5332 @item @emph{Example}:
5333 @item @emph{Specific names}:
5334 @item @emph{See also}:
5335 @end table
5336
5337
5338 @node MIN
5339 @section @code{MIN} --- Minimum value of an argument list
5340 @findex @code{MIN} intrinsic
5341 @cindex undocumented intrinsic 
5342
5343 Intrinsic implemented, documentation pending.
5344
5345 @table @asis
5346 @item @emph{Description}:
5347 @item @emph{Standard}:
5348 F77 and later
5349
5350 @item @emph{Class}:
5351 Elemental function
5352
5353 @item @emph{Syntax}:
5354 @item @emph{Arguments}:
5355 @item @emph{Return value}:
5356 @item @emph{Example}:
5357
5358 @item @emph{Specific names}:
5359 @multitable @columnfractions .20 .20 .20 .40
5360 @item Name             @tab Argument            @tab Return type         @tab Standard
5361 @item @code{MIN0(I)}   @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)}   @tab F77 and later
5362 @item @code{AMIN0(I)}  @tab @code{INTEGER(4) I} @tab @code{REAL(MIN(X))} @tab F77 and later
5363 @item @code{MIN1(X)}   @tab @code{REAL(*) X}    @tab @code{INT(MIN(X))}  @tab F77 and later
5364 @item @code{AMIN1(X)}  @tab @code{REAL(4)    X} @tab @code{REAL(4)}      @tab F77 and later
5365 @item @code{DMIN1(X)}  @tab @code{REAL(8)    X} @tab @code{REAL(8)}      @tab F77 and later
5366 @end multitable
5367
5368 @item @emph{See also}:
5369 @ref{MINLOC}, @ref{MINVAL}
5370 @end table
5371
5372 @node MINEXPONENT
5373 @section @code{MINEXPONENT} --- Minimum exponent of a real kind
5374 @findex @code{MINEXPONENT} intrinsic
5375 @cindex MINEXPONENT
5376
5377 @table @asis
5378 @item @emph{Description}:
5379 @code{MINEXPONENT(X)} returns the minimum exponent in the model of the
5380 type of @code{X}.
5381
5382 @item @emph{Standard}:
5383 F95 and later
5384
5385 @item @emph{Class}:
5386 Inquiry function
5387
5388 @item @emph{Syntax}:
5389 @code{I = MINEXPONENT(X)}
5390
5391 @item @emph{Arguments}:
5392 @multitable @columnfractions .15 .80
5393 @item @var{X} @tab shall be of type @code{REAL}.
5394 @end multitable
5395
5396 @item @emph{Return value}:
5397 The return value is of type @code{INTEGER} and of the default integer
5398 kind.
5399
5400 @item @emph{Example}:
5401 See @code{MAXEXPONENT} for an example.
5402 @end table
5403
5404
5405 @node MINLOC
5406 @section @code{MINLOC} --- Location of the minimum value within an array
5407 @findex @code{MINLOC} intrinsic
5408 @cindex undocumented intrinsic 
5409
5410 Intrinsic implemented, documentation pending.
5411
5412 @table @asis
5413 @item @emph{Description}:
5414 @item @emph{Standard}:
5415 F95 and later
5416
5417 @item @emph{Class}:
5418 Transformational function
5419
5420 @item @emph{Syntax}:
5421 @item @emph{Arguments}:
5422 @item @emph{Return value}:
5423 @item @emph{Example}:
5424
5425 @item @emph{See also}:
5426 @ref{MIN}, @ref{MINVAL}
5427
5428 @end table
5429
5430
5431 @node MINVAL
5432 @section @code{MINVAL} --- Minimum value of an array
5433 @findex @code{MINVAL} intrinsic
5434 @cindex undocumented intrinsic 
5435
5436 Intrinsic implemented, documentation pending.
5437
5438 @table @asis
5439 @item @emph{Description}:
5440 @item @emph{Standard}:
5441 F95 and later
5442
5443 @item @emph{Class}:
5444 Transformational function
5445
5446 @item @emph{Syntax}:
5447 @item @emph{Arguments}:
5448 @item @emph{Return value}:
5449 @item @emph{Example}:
5450
5451 @item @emph{See also}:
5452 @ref{MIN}, @ref{MINLOC}
5453 @end table
5454
5455
5456
5457
5458 @node MOD
5459 @section @code{MOD} --- Remainder function
5460 @findex @code{MOD} intrinsic
5461 @findex @code{AMOD} intrinsic
5462 @findex @code{DMOD} intrinsic
5463 @cindex remainder
5464
5465 @table @asis
5466 @item @emph{Description}:
5467 @code{MOD(A,P)} computes the remainder of the division of A by P. It is
5468 calculated as @code{A - (INT(A/P) * P)}.
5469
5470 @item @emph{Standard}:
5471 F77 and later
5472
5473 @item @emph{Class}:
5474 Elemental function
5475
5476 @item @emph{Syntax}:
5477 @code{X = MOD(A,P)}
5478
5479 @item @emph{Arguments}:
5480 @multitable @columnfractions .15 .80
5481 @item @var{A} @tab shall be a scalar of type @code{INTEGER} or @code{REAL}
5482 @item @var{P} @tab shall be a scalar of the same type as @var{A} and not
5483 equal to zero
5484 @end multitable
5485
5486 @item @emph{Return value}:
5487 The kind of the return value is the result of cross-promoting
5488 the kinds of the arguments.
5489
5490 @item @emph{Example}:
5491 @smallexample
5492 program test_mod
5493   print *, mod(17,3)
5494   print *, mod(17.5,5.5)
5495   print *, mod(17.5d0,5.5)
5496   print *, mod(17.5,5.5d0)
5497
5498   print *, mod(-17,3)
5499   print *, mod(-17.5,5.5)
5500   print *, mod(-17.5d0,5.5)
5501   print *, mod(-17.5,5.5d0)
5502
5503   print *, mod(17,-3)
5504   print *, mod(17.5,-5.5)
5505   print *, mod(17.5d0,-5.5)
5506   print *, mod(17.5,-5.5d0)
5507 end program test_mod
5508 @end smallexample
5509
5510 @item @emph{Specific names}:
5511 @multitable @columnfractions .20 .20 .20 .40
5512 @item Name             @tab Arguments      @tab Return type    @tab Standard
5513 @item @code{AMOD(A,P)} @tab @code{REAL(4)} @tab @code{REAL(4)} @tab F95 and later
5514 @item @code{DMOD(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab F95 and later
5515 @end multitable
5516 @end table
5517
5518
5519
5520 @node MODULO
5521 @section @code{MODULO} --- Modulo function
5522 @findex @code{MODULO} intrinsic
5523 @cindex modulo
5524
5525 @table @asis
5526 @item @emph{Description}:
5527 @code{MODULO(A,P)} computes the @var{A} modulo @var{P}.
5528
5529 @item @emph{Standard}:
5530 F95 and later
5531
5532 @item @emph{Class}:
5533 Elemental function
5534
5535 @item @emph{Syntax}:
5536 @code{X = MODULO(A,P)}
5537
5538 @item @emph{Arguments}:
5539 @multitable @columnfractions .15 .80
5540 @item @var{A} @tab shall be a scalar of type @code{INTEGER} or @code{REAL}
5541 @item @var{P} @tab shall be a scalar of the same type and kind as @var{A}
5542 @end multitable
5543
5544 @item @emph{Return value}:
5545 The type and kind of the result are those of the arguments.
5546 @table @asis
5547 @item If @var{A} and @var{P} are of type @code{INTEGER}:
5548 @code{MODULO(A,P)} has the value @var{R} such that @code{A=Q*P+R}, where
5549 @var{Q} is an integer and @var{R} is between 0 (inclusive) and @var{P}
5550 (exclusive).
5551 @item If @var{A} and @var{P} are of type @code{REAL}:
5552 @code{MODULO(A,P)} has the value of @code{A - FLOOR (A / P) * P}.
5553 @end table
5554 In all cases, if @var{P} is zero the result is processor-dependent.
5555
5556 @item @emph{Example}:
5557 @smallexample
5558 program test_modulo
5559   print *, modulo(17,3)
5560   print *, modulo(17.5,5.5)
5561
5562   print *, modulo(-17,3)
5563   print *, modulo(-17.5,5.5)
5564
5565   print *, modulo(17,-3)
5566   print *, modulo(17.5,-5.5)
5567 end program test_mod
5568 @end smallexample
5569
5570 @end table
5571
5572
5573
5574 @node MVBITS
5575 @section @code{MVBITS} --- Move bits from one integer to another
5576 @findex @code{MVBITS} intrinsic
5577 @cindex bit operations
5578
5579 Intrinsic implemented, documentation pending.
5580
5581 @table @asis
5582 @item @emph{Description}:
5583 @item @emph{Standard}:
5584 F95 and later
5585
5586 @item @emph{Class}:
5587 Elemental subroutine
5588
5589 @item @emph{Syntax}:
5590 @item @emph{Arguments}:
5591 @item @emph{Return value}:
5592 @item @emph{Example}:
5593 @item @emph{See also}:
5594 @end table
5595
5596
5597
5598
5599 @node NEAREST
5600 @section @code{NEAREST} --- Nearest representable number
5601 @findex @code{NEAREST} intrinsic
5602 @cindex processor-representable number
5603
5604 @table @asis
5605 @item @emph{Description}:
5606 @code{NEAREST(X, S)} returns the processor-representable number nearest
5607 to @code{X} in the direction indicated by the sign of @code{S}.
5608
5609 @item @emph{Standard}:
5610 F95 and later
5611
5612 @item @emph{Class}:
5613 Elemental function
5614
5615 @item @emph{Syntax}:
5616 @code{Y = NEAREST(X, S)}
5617
5618 @item @emph{Arguments}:
5619 @multitable @columnfractions .15 .80
5620 @item @var{X} @tab shall be of type @code{REAL}.
5621 @item @var{S} @tab (Optional) shall be of type @code{REAL} and
5622 not equal to zero.
5623 @end multitable
5624
5625 @item @emph{Return value}:
5626 The return value is of the same type as @code{X}. If @code{S} is
5627 positive, @code{NEAREST} returns the processor-representable number
5628 greater than @code{X} and nearest to it. If @code{S} is negative,
5629 @code{NEAREST} returns the processor-representable number smaller than
5630 @code{X} and nearest to it.
5631
5632 @item @emph{Example}:
5633 @smallexample
5634 program test_nearest
5635   real :: x, y
5636   x = nearest(42.0, 1.0)
5637   y = nearest(42.0, -1.0)
5638   write (*,"(3(G20.15))") x, y, x - y
5639 end program test_nearest
5640 @end smallexample
5641 @end table
5642
5643
5644
5645 @node NEQV
5646 @section @code{NEQV} --- Logical non-equivalence
5647 @findex @code{NEQV} intrinsic
5648 @cindex logical operations
5649
5650 Intrinsic implemented, documentation pending.
5651
5652 @table @asis
5653 @item @emph{Description}:
5654 @item @emph{Standard}:
5655 F77 and later
5656
5657 @item @emph{Class}:
5658 @item @emph{Syntax}:
5659 @item @emph{Arguments}:
5660 @item @emph{Return value}:
5661 @item @emph{Example}:
5662 @item @emph{Specific names}:
5663 @item @emph{See also}:
5664 @ref{EQV}
5665 @end table
5666
5667
5668
5669
5670 @node NINT
5671 @section @code{NINT} --- Nearest whole number
5672 @findex @code{NINT} intrinsic
5673 @findex @code{IDNINT} intrinsic
5674 @cindex whole number
5675
5676 @table @asis
5677 @item @emph{Description}:
5678 @code{NINT(X)} rounds its argument to the nearest whole number.
5679
5680 @item @emph{Standard}:
5681 F77 and later
5682
5683 @item @emph{Class}:
5684 Elemental function
5685
5686 @item @emph{Syntax}:
5687 @code{X = NINT(X)}
5688
5689 @item @emph{Arguments}:
5690 @multitable @columnfractions .15 .80
5691 @item @var{X}    @tab The type of the argument shall be @code{REAL}.
5692 @end multitable
5693
5694 @item @emph{Return value}:
5695 Returns @var{A} with the fractional portion of its magnitude eliminated by
5696 rounding to the nearest whole number and with its sign preserved,
5697 converted to an @code{INTEGER} of the default kind.
5698
5699 @item @emph{Example}:
5700 @smallexample
5701 program test_nint
5702   real(4) x4
5703   real(8) x8
5704   x4 = 1.234E0_4
5705   x8 = 4.321_8
5706   print *, nint(x4), idnint(x8)
5707 end program test_nint
5708 @end smallexample
5709
5710 @item @emph{Specific names}:
5711 @multitable @columnfractions .33 .33 .33
5712 @item Name             @tab Argument         @tab Standard
5713 @item @code{IDNINT(X)} @tab @code{REAL(8)}   @tab F95 and later
5714 @end multitable
5715
5716 @item @emph{See also}:
5717 @ref{CEILING}, @ref{FLOOR}
5718
5719 @end table
5720
5721
5722 @node NOT
5723 @section @code{NOT} --- Logical negation
5724 @findex @code{NOT} intrinsic
5725 @cindex logical operations
5726
5727 Intrinsic implemented, documentation pending.
5728
5729 @table @asis
5730 @item @emph{Description}:
5731 @item @emph{Standard}:
5732 F77 and later
5733
5734 @item @emph{Class}:
5735 Elemental function
5736
5737 @item @emph{Syntax}:
5738 @item @emph{Arguments}:
5739 @item @emph{Return value}:
5740 @item @emph{Example}:
5741 @item @emph{See also}:
5742 @end table
5743
5744
5745
5746
5747 @node NULL
5748 @section @code{NULL} --- Function that returns an dissassociated pointer
5749 @findex @code{NULL} intrinsic
5750 @cindex undocumented intrinsic 
5751
5752 Intrinsic implemented, documentation pending.
5753
5754 @table @asis
5755 @item @emph{Description}:
5756 @item @emph{Standard}:
5757 F95 and later
5758
5759 @item @emph{Class}:
5760 Transformational function
5761
5762 @item @emph{Syntax}:
5763 @item @emph{Arguments}:
5764 @item @emph{Return value}:
5765 @item @emph{Example}:
5766 @item @emph{See also}:
5767 @ref{ASSOCIATED}
5768 @end table
5769
5770
5771
5772
5773 @node OR
5774 @section @code{OR} --- Logical inclusive disjunction
5775 @findex @code{OR} intrinsic
5776 @cindex logical operations
5777
5778 Intrinsic implemented, documentation pending.
5779
5780 @table @asis
5781 @item @emph{Description}:
5782 @item @emph{Standard}:
5783 F77 and later
5784
5785 @item @emph{Class}:
5786 @item @emph{Syntax}:
5787 @item @emph{Arguments}:
5788 @item @emph{Return value}:
5789 @item @emph{Example}:
5790 @item @emph{See also}:
5791 @end table
5792
5793
5794
5795
5796 @node PACK
5797 @section @code{PACK} --- Pack an array into an array of rank one
5798 @findex @code{PACK} intrinsic
5799 @cindex undocumented intrinsic 
5800
5801 Intrinsic implemented, documentation pending.
5802
5803 @table @asis
5804 @item @emph{Description}:
5805 @item @emph{Standard}:
5806 F95 and later
5807
5808 @item @emph{Class}:
5809 Transformational function
5810
5811 @item @emph{Syntax}:
5812 @item @emph{Arguments}:
5813 @item @emph{Return value}:
5814 @item @emph{Example}:
5815 @item @emph{Specific names}:
5816 @item @emph{See also}:
5817 @ref{UNPACK}
5818 @end table
5819
5820
5821
5822
5823 @node PERROR
5824 @section @code{PERROR} --- Print system error message
5825 @findex @code{PERROR} intrinsic
5826 @cindex undocumented intrinsic 
5827
5828 Intrinsic implemented, documentation pending.
5829
5830 @table @asis
5831 @item @emph{Description}:
5832 @item @emph{Standard}:
5833 GNU extension
5834
5835 @item @emph{Class}:
5836 Subroutine
5837
5838 @item @emph{Syntax}:
5839 @item @emph{Arguments}:
5840 @item @emph{Return value}:
5841 @item @emph{Example}:
5842 @item @emph{Specific names}:
5843 @item @emph{See also}:
5844 @ref{IERRNO}
5845 @end table
5846
5847
5848
5849
5850 @node PRECISION
5851 @section @code{PRECISION} --- Decimal precision of a real kind
5852 @findex @code{PRECISION} intrinsic
5853 @cindex PRECISION
5854
5855 @table @asis
5856 @item @emph{Description}:
5857 @code{PRECISION(X)} returns the decimal precision in the model of the
5858 type of @code{X}.
5859
5860 @item @emph{Standard}:
5861 F95 and later
5862
5863 @item @emph{Class}:
5864 Inquiry function
5865
5866 @item @emph{Syntax}:
5867 @code{I = PRECISION(X)}
5868
5869 @item @emph{Arguments}:
5870 @multitable @columnfractions .15 .80
5871 @item @var{X} @tab shall be of type @code{REAL} or @code{COMPLEX}.
5872 @end multitable
5873
5874 @item @emph{Return value}:
5875 The return value is of type @code{INTEGER} and of the default integer
5876 kind.
5877
5878 @item @emph{Example}:
5879 @smallexample
5880 program prec_and_range
5881   real(kind=4) :: x(2)
5882   complex(kind=8) :: y
5883
5884   print *, precision(x), range(x)
5885   print *, precision(y), range(y)
5886 end program prec_and_range
5887 @end smallexample
5888 @end table
5889
5890
5891
5892 @node PRESENT
5893 @section @code{PRESENT} --- Determine whether an optional argument is specified
5894 @findex @code{PRESENT} intrinsic
5895 @cindex undocumented intrinsic 
5896
5897 Intrinsic implemented, documentation pending.
5898
5899 @table @asis
5900 @item @emph{Description}:
5901 @item @emph{Standard}:
5902 F95 and later
5903
5904 @item @emph{Class}:
5905 Inquiry function
5906
5907 @item @emph{Syntax}:
5908 @item @emph{Arguments}:
5909 @item @emph{Return value}:
5910 @item @emph{Example}:
5911 @item @emph{See also}:
5912 @end table
5913
5914
5915
5916
5917 @node PRODUCT
5918 @section @code{PRODUCT} --- Product of array elements
5919 @findex @code{PRODUCT} intrinsic
5920 @cindex undocumented intrinsic 
5921
5922 Intrinsic implemented, documentation pending.
5923
5924 @table @asis
5925 @item @emph{Description}:
5926 @item @emph{Standard}:
5927 F95 and later
5928
5929 @item @emph{Class}:
5930 Transformational function
5931
5932 @item @emph{Syntax}:
5933 @item @emph{Arguments}:
5934 @item @emph{Return value}:
5935 @item @emph{Example}:
5936 @item @emph{Specific names}:
5937 @item @emph{See also}:
5938 @ref{SUM}
5939 @end table
5940
5941
5942
5943
5944 @node RADIX
5945 @section @code{RADIX} --- Base of a model number
5946 @findex @code{RADIX} intrinsic
5947 @cindex base
5948
5949 @table @asis
5950 @item @emph{Description}:
5951 @code{RADIX(X)} returns the base of the model representing the entity @var{X}.
5952
5953 @item @emph{Standard}:
5954 F95 and later
5955
5956 @item @emph{Class}:
5957 Inquiry function
5958
5959 @item @emph{Syntax}:
5960 @code{R = RADIX(X)}
5961
5962 @item @emph{Arguments}:
5963 @multitable @columnfractions .15 .80
5964 @item @var{X} @tab Shall be of type @code{INTEGER} or @code{REAL}
5965 @end multitable
5966
5967 @item @emph{Return value}:
5968 The return value is a scalar of type @code{INTEGER} and of the default
5969 integer kind.
5970
5971 @item @emph{Example}:
5972 @smallexample
5973 program test_radix
5974   print *, "The radix for the default integer kind is", radix(0)
5975   print *, "The radix for the default real kind is", radix(0.0)
5976 end program test_radix
5977 @end smallexample
5978
5979 @end table
5980
5981
5982
5983 @node RANDOM_NUMBER
5984 @section @code{RANDOM_NUMBER} --- Pseudo-random number
5985 @findex @code{RANDOM_NUMBER} intrinsic
5986 @cindex random numbers
5987
5988 Intrinsic implemented, documentation pending.
5989
5990 @table @asis
5991 @item @emph{Description}:
5992 @item @emph{Standard}:
5993 F95 and later
5994
5995 @item @emph{Class}:
5996 Elemental subroutine
5997
5998 @item @emph{Syntax}:
5999 @item @emph{Arguments}:
6000 @item @emph{Return value}:
6001 @item @emph{Example}:
6002 @item @emph{See also}:
6003 @ref{RANDOM_SEED}
6004 @end table
6005
6006
6007
6008
6009 @node RANDOM_SEED
6010 @section @code{RANDOM_SEED} --- Initialize a pseudo-random number sequence
6011 @findex @code{RANDOM_SEED} intrinsic
6012 @cindex random numbers
6013
6014 Intrinsic implemented, documentation pending.
6015
6016 @table @asis
6017 @item @emph{Description}:
6018 @item @emph{Standard}:
6019 F95 and later
6020
6021 @item @emph{Class}:
6022 Subroutine
6023
6024 @item @emph{Syntax}:
6025 @item @emph{Arguments}:
6026 @item @emph{Return value}:
6027 @item @emph{Example}:
6028 @item @emph{See also}:
6029 @ref{RANDOM_NUMBER}
6030 @end table
6031
6032
6033
6034
6035 @node RAND
6036 @section @code{RAND} --- Real pseudo-random number
6037 @findex @code{RAND} intrinsic
6038 @findex @code{RAN} intrinsic
6039 @cindex random number
6040
6041 @table @asis
6042 @item @emph{Description}:
6043 @code{RAND(FLAG)} returns a pseudo-random number from a uniform
6044 distribution between 0 and 1. If @var{FLAG} is 0, the next number
6045 in the current sequence is returned; if @var{FLAG} is 1, the generator
6046 is restarted by @code{CALL SRAND(0)}; if @var{FLAG} has any other value,
6047 it is used as a new seed with @code{SRAND}.
6048
6049 @item @emph{Standard}:
6050 GNU extension
6051
6052 @item @emph{Class}:
6053 non-elemental function
6054
6055 @item @emph{Syntax}:
6056 @code{X = RAND(FLAG)}
6057
6058 @item @emph{Arguments}:
6059 @multitable @columnfractions .15 .80
6060 @item @var{FLAG} @tab shall be a scalar @code{INTEGER} of kind 4.
6061 @end multitable
6062
6063 @item @emph{Return value}:
6064 The return value is of @code{REAL} type and the default kind.
6065
6066 @item @emph{Example}:
6067 @smallexample
6068 program test_rand
6069   integer,parameter :: seed = 86456
6070   
6071   call srand(seed)
6072   print *, rand(), rand(), rand(), rand()
6073   print *, rand(seed), rand(), rand(), rand()
6074 end program test_rand
6075 @end smallexample
6076
6077 @item @emph{Note}:
6078 For compatibility with HP FORTRAN 77/iX, the @code{RAN} intrinsic is
6079 provided as an alias for @code{RAND}.
6080
6081 @item @emph{See also}:
6082 @ref{SRAND}, @ref{RANDOM_NUMBER}
6083
6084 @end table
6085
6086
6087
6088 @node RANGE
6089 @section @code{RANGE} --- Decimal exponent range of a real kind
6090 @findex @code{RANGE} intrinsic
6091 @cindex RANGE
6092
6093 @table @asis
6094 @item @emph{Description}:
6095 @code{RANGE(X)} returns the decimal exponent range in the model of the
6096 type of @code{X}.
6097
6098 @item @emph{Standard}:
6099 F95 and later
6100
6101 @item @emph{Class}:
6102 Inquiry function
6103
6104 @item @emph{Syntax}:
6105 @code{I = RANGE(X)}
6106
6107 @item @emph{Arguments}:
6108 @multitable @columnfractions .15 .80
6109 @item @var{X} @tab shall be of type @code{REAL} or @code{COMPLEX}.
6110 @end multitable
6111
6112 @item @emph{Return value}:
6113 The return value is of type @code{INTEGER} and of the default integer
6114 kind.
6115
6116 @item @emph{Example}:
6117 See @code{PRECISION} for an example.
6118 @end table
6119
6120
6121
6122 @node RAN
6123 @section @code{RAN} --- Real pseudo-random number
6124 @findex @code{RAN} intrinsic
6125 @cindex random number
6126
6127 @table @asis
6128 @item @emph{Standard}:
6129 GNU extension
6130
6131 @item @emph{See also}:
6132 @ref{RAND}, @ref{RANDOM_NUMBER}
6133 @end table
6134
6135
6136
6137 @node REAL
6138 @section @code{REAL} --- Convert to real type 
6139 @findex @code{REAL} intrinsic
6140 @findex @code{REALPART} intrinsic
6141 @cindex true values
6142
6143 @table @asis
6144 @item @emph{Description}:
6145 @code{REAL(X [, KIND])} converts its argument @var{X} to a real type.  The
6146 @code{REALPART(X)} function is provided for compatibility with @command{g77},
6147 and its use is strongly discouraged.
6148
6149 @item @emph{Standard}:
6150 F77 and later
6151
6152 @item @emph{Class}:
6153 Elemental function
6154
6155 @item @emph{Syntax}:
6156 @multitable @columnfractions .30 .80
6157 @item @code{X = REAL(X)}
6158 @item @code{X = REAL(X, KIND)}
6159 @item @code{X = REALPART(Z)}
6160 @end multitable
6161
6162 @item @emph{Arguments}:
6163 @multitable @columnfractions .15 .80
6164 @item @var{X} @tab shall be @code{INTEGER(*)}, @code{REAL(*)}, or  
6165 @code{COMPLEX(*)}.
6166 @item @var{KIND}  @tab (Optional) @var{KIND} shall be a scalar integer.
6167 @end multitable
6168
6169 @item @emph{Return value}:
6170 These functions return a @code{REAL(*)} variable or array under
6171 the following rules: 
6172
6173 @table @asis
6174 @item (A)
6175 @code{REAL(X)} is converted to a default real type if @var{X} is an 
6176 integer or real variable.
6177 @item (B)
6178 @code{REAL(X)} is converted to a real type with the kind type parameter
6179 of @var{X} if @var{X} is a complex variable.
6180 @item (C)
6181 @code{REAL(X, KIND)} is converted to a real type with kind type
6182 parameter @var{KIND} if @var{X} is a complex, integer, or real
6183 variable.
6184 @end table
6185
6186 @item @emph{Example}:
6187 @smallexample
6188 program test_real
6189   complex :: x = (1.0, 2.0)
6190   print *, real(x), real(x,8), realpart(x)
6191 end program test_real
6192 @end smallexample
6193
6194 @item @emph{See also}:
6195 @ref{DBLE}, @ref{DFLOAT}, @ref{FLOAT}
6196
6197 @end table
6198
6199
6200 @node RENAME
6201 @section @code{RENAME} --- Rename a file
6202 @findex @code{RENAME} intrinsic
6203 @cindex file system operations
6204
6205 Intrinsic implemented, documentation pending.
6206
6207 @table @asis
6208 @item @emph{Description}:
6209 @item @emph{Standard}:
6210 GNU extension
6211
6212 @item @emph{Class}:
6213 Subroutine
6214
6215 @item @emph{Syntax}:
6216 @item @emph{Arguments}:
6217 @item @emph{Return value}:
6218 @item @emph{Example}:
6219 @item @emph{See also}:
6220 @end table
6221
6222
6223
6224
6225 @node REPEAT
6226 @section @code{REPEAT} --- Repeated string concatenation 
6227 @findex @code{REPEAT} intrinsic
6228 @cindex string manipulation
6229
6230 Intrinsic implemented, documentation pending.
6231
6232 @table @asis
6233 @item @emph{Description}:
6234 @item @emph{Standard}:
6235 F95 and later
6236
6237 @item @emph{Class}:
6238 Transformational function
6239
6240 @item @emph{Syntax}:
6241 @item @emph{Arguments}:
6242 @item @emph{Return value}:
6243 @item @emph{Example}:
6244 @item @emph{See also}:
6245 @end table
6246
6247
6248
6249
6250 @node RESHAPE
6251 @section @code{RESHAPE} --- Function to reshape an array
6252 @findex @code{RESHAPE} intrinsic
6253 @cindex array manipulation
6254
6255 Intrinsic implemented, documentation pending.
6256
6257 @table @asis
6258 @item @emph{Description}:
6259 @item @emph{Standard}:
6260 F95 and later
6261
6262 @item @emph{Class}:
6263 Transformational function
6264
6265 @item @emph{Syntax}:
6266 @item @emph{Arguments}:
6267 @item @emph{Return value}:
6268 @item @emph{Example}:
6269 @item @emph{See also}:
6270 @ref{SHAPE}
6271 @end table
6272
6273
6274
6275 @node RRSPACING
6276 @section @code{RRSPACING} --- Reciprocal of the relative spacing
6277 @findex @code{RRSPACING} intrinsic
6278
6279 @table @asis
6280 @item @emph{Description}:
6281 @code{RRSPACING(X)} returns the  reciprocal of the relative spacing of
6282 model numbers near @var{X}.
6283
6284 @item @emph{Standard}:
6285 F95 and later
6286
6287 @item @emph{Class}:
6288 Elemental function
6289
6290 @item @emph{Syntax}:
6291 @code{Y = RRSPACING(X)}
6292
6293 @item @emph{Arguments}:
6294 @multitable @columnfractions .15 .80
6295 @item @var{X} @tab shall be of type @code{REAL}.
6296 @end multitable
6297
6298 @item @emph{Return value}:
6299 The return value is of the same type and kind as @var{X}.
6300 The value returned is equal to
6301 @code{ABS(FRACTION(X)) * FLOAT(RADIX(X))**DIGITS(X)}.
6302
6303 @end table
6304
6305
6306
6307 @node RSHIFT
6308 @section @code{RSHIFT} --- Right shift bits
6309 @findex @code{RSHIFT} 
6310 @cindex bit manipulation
6311
6312 Not yet implemented in gfortran.
6313
6314 @table @asis
6315 @item @emph{Description}:
6316
6317 @item @emph{Standard}:
6318 GNU extension
6319
6320 @item @emph{Class}:
6321 Function
6322
6323 @item @emph{Syntax}:
6324 @item @emph{Arguments}:
6325 @item @emph{Return value}:
6326 @item @emph{Example}:
6327 @item @emph{See also}:
6328 @uref{http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19292, g77 features lacking in gfortran}
6329
6330 @end table
6331
6332
6333
6334 @node SCALE
6335 @section @code{SCALE} --- Scale a real value
6336 @findex @code{SCALE} intrinsic
6337
6338 @table @asis
6339 @item @emph{Description}:
6340 @code{SCALE(X,I)} returns @code{X * RADIX(X)**I}.
6341
6342 @item @emph{Standard}:
6343 F95 and later
6344
6345 @item @emph{Class}:
6346 Elemental function
6347
6348 @item @emph{Syntax}:
6349 @code{Y = SCALE(X, I)}
6350
6351 @item @emph{Arguments}:
6352 @multitable @columnfractions .15 .80
6353 @item @var{X} @tab The type of the argument shall be a @code{REAL}.
6354 @item @var{I} @tab The type of the argument shall be a @code{INTEGER}.
6355 @end multitable
6356
6357 @item @emph{Return value}:
6358 The return value is of the same type and kind as @var{X}.
6359 Its value is @code{X * RADIX(X)**I}.
6360
6361 @item @emph{Example}:
6362 @smallexample
6363 program test_scale
6364   real :: x = 178.1387e-4
6365   integer :: i = 5
6366   print *, scale(x,i), x*radix(x)**i
6367 end program test_scale
6368 @end smallexample
6369
6370 @end table
6371
6372
6373 @node SCAN
6374 @section @code{SCAN} --- Scan a string for the presence of a set of characters
6375 @findex @code{SCAN} intrinsic
6376 @cindex string manipulation
6377
6378 Intrinsic implemented, documentation pending.
6379
6380 @table @asis
6381 @item @emph{Description}:
6382 @item @emph{Standard}:
6383 F95 and later
6384
6385 @item @emph{Class}:
6386 Elemental function
6387
6388 @item @emph{Syntax}:
6389 @item @emph{Arguments}:
6390 @item @emph{Return value}:
6391 @item @emph{Example}:
6392 @item @emph{See also}:
6393 @end table
6394
6395
6396
6397
6398 @node SECNDS
6399 @section @code{SECNDS} --- Time function
6400 @findex @code{SECNDS} intrinsic
6401 @cindex SECNDS
6402
6403 @table @asis
6404 @item @emph{Description}:
6405 @code{SECNDS(X)} gets the time in seconds from the real-time system clock.
6406 @var{X} is a reference time, also in seconds. If this is zero, the time in
6407 seconds from midnight is returned. This function is non-standard and its
6408 use is discouraged.
6409
6410 @item @emph{Standard}:
6411 GNU extension
6412
6413 @item @emph{Class}:
6414 function
6415
6416 @item @emph{Syntax}:
6417 @code{T = SECNDS (X)}
6418
6419 @item @emph{Arguments}:
6420 @multitable @columnfractions .15 .80
6421 @item Name        @tab Type
6422 @item @var{T}     @tab REAL(4)
6423 @item @var{X}     @tab REAL(4)
6424 @end multitable
6425
6426 @item @emph{Return value}:
6427 None
6428
6429 @item @emph{Example}:
6430 @smallexample
6431 program test_secnds
6432     real(4) :: t1, t2
6433     print *, secnds (0.0)   ! seconds since midnight
6434     t1 = secnds (0.0)       ! reference time
6435     do i = 1, 10000000      ! do something
6436     end do
6437     t2 = secnds (t1)        ! elapsed time
6438     print *, "Something took ", t2, " seconds."
6439 end program test_secnds
6440 @end smallexample
6441 @end table
6442
6443
6444
6445 @node SELECTED_INT_KIND
6446 @section @code{SELECTED_INT_KIND} --- Choose integer kind
6447 @findex @code{SELECTED_INT_KIND} intrinsic
6448 @cindex integer kind
6449
6450 @table @asis
6451 @item @emph{Description}:
6452 @code{SELECTED_INT_KIND(I)} return the kind value of the smallest integer
6453 type that can represent all values ranging from @math{-10^I} (exclusive)
6454 to @math{10^I} (exclusive). If there is no integer kind that accommodates
6455 this range, @code{SELECTED_INT_KIND} returns @math{-1}.
6456
6457 @item @emph{Standard}:
6458 F95 and later
6459
6460 @item @emph{Class}:
6461 Transformational function
6462
6463 @item @emph{Syntax}:
6464 @multitable @columnfractions .30 .80
6465 @item @code{J = SELECTED_INT_KIND(I)}
6466 @end multitable
6467
6468 @item @emph{Arguments}:
6469 @multitable @columnfractions .15 .80
6470 @item @var{I} @tab shall be a scalar and of type @code{INTEGER}.
6471 @end multitable
6472
6473 @item @emph{Example}:
6474 @smallexample
6475 program large_integers
6476   integer,parameter :: k5 = selected_int_kind(5)
6477   integer,parameter :: k15 = selected_int_kind(15)
6478   integer(kind=k5) :: i5
6479   integer(kind=k15) :: i15
6480
6481   print *, huge(i5), huge(i15)
6482
6483   ! The following inequalities are always true
6484   print *, huge(i5) >= 10_k5**5-1
6485   print *, huge(i15) >= 10_k15**15-1
6486 end program large_integers
6487 @end smallexample
6488 @end table
6489
6490
6491
6492 @node SELECTED_REAL_KIND
6493 @section @code{SELECTED_REAL_KIND} --- Choose real kind
6494 @findex @code{SELECTED_REAL_KIND} intrinsic
6495 @cindex real kind
6496
6497 @table @asis
6498 @item @emph{Description}:
6499 @code{SELECTED_REAL_KIND(P,R)} return the kind value of a real data type
6500 with decimal precision greater of at least @code{P} digits and exponent
6501 range greater at least @code{R}. 
6502
6503 @item @emph{Standard}:
6504 F95 and later
6505
6506 @item @emph{Class}:
6507 Transformational function
6508
6509 @item @emph{Syntax}:
6510 @multitable @columnfractions .30 .80
6511 @item @code{I = SELECTED_REAL_KIND(P,R)}
6512 @end multitable
6513
6514 @item @emph{Arguments}:
6515 @multitable @columnfractions .15 .80
6516 @item @var{P} @tab (Optional) shall be a scalar and of type @code{INTEGER}.
6517 @item @var{R} @tab (Optional) shall be a scalar and of type @code{INTEGER}.
6518 @end multitable
6519 At least one argument shall be present.
6520
6521 @item @emph{Return value}:
6522
6523 @code{SELECTED_REAL_KIND} returns the value of the kind type parameter of
6524 a real data type with decimal precision of at least @code{P} digits and a
6525 decimal exponent range of at least @code{R}. If more than one real data
6526 type meet the criteria, the kind of the data type with the smallest
6527 decimal precision is returned. If no real data type matches the criteria,
6528 the result is
6529 @table @asis
6530 @item -1 if the processor does not support a real data type with a
6531 precision greater than or equal to @code{P}
6532 @item -2 if the processor does not support a real type with an exponent
6533 range greater than or equal to @code{R}
6534 @item -3 if neither is supported.
6535 @end table
6536
6537 @item @emph{Example}:
6538 @smallexample
6539 program real_kinds
6540   integer,parameter :: p6 = selected_real_kind(6)
6541   integer,parameter :: p10r100 = selected_real_kind(10,100)
6542   integer,parameter :: r400 = selected_real_kind(r=400)
6543   real(kind=p6) :: x
6544   real(kind=p10r100) :: y
6545   real(kind=r400) :: z
6546
6547   print *, precision(x), range(x)
6548   print *, precision(y), range(y)
6549   print *, precision(z), range(z)
6550 end program real_kinds
6551 @end smallexample
6552 @end table
6553
6554
6555
6556 @node SET_EXPONENT
6557 @section @code{SET_EXPONENT} --- Set the exponent of the model
6558 @findex @code{SET_EXPONENT} intrinsic
6559 @cindex exponent
6560
6561 @table @asis
6562 @item @emph{Description}:
6563 @code{SET_EXPONENT(X, I)} returns the real number whose fractional part
6564 is that that of @var{X} and whose exponent part if @var{I}.
6565
6566 @item @emph{Standard}:
6567 F95 and later
6568
6569 @item @emph{Class}:
6570 Elemental function
6571
6572 @item @emph{Syntax}:
6573 @code{Y = SET_EXPONENT(X, I)}
6574
6575 @item @emph{Arguments}:
6576 @multitable @columnfractions .15 .80
6577 @item @var{X} @tab shall be of type @code{REAL}.
6578 @item @var{I} @tab shall be of type @code{INTEGER}.
6579 @end multitable
6580
6581 @item @emph{Return value}:
6582 The return value is of the same type and kind as @var{X}.
6583 The real number whose fractional part
6584 is that that of @var{X} and whose exponent part if @var{I} is returned;
6585 it is @code{FRACTION(X) * RADIX(X)**I}.
6586
6587 @item @emph{Example}:
6588 @smallexample
6589 program test_setexp
6590   real :: x = 178.1387e-4
6591   integer :: i = 17
6592   print *, set_exponent(x), fraction(x) * radix(x)**i
6593 end program test_setexp
6594 @end smallexample
6595
6596 @end table
6597
6598
6599
6600 @node SHAPE
6601 @section @code{SHAPE} --- Determine the shape of an array
6602 @findex @code{SHAPE} intrinsic
6603 @cindex array manipulation
6604
6605 Intrinsic implemented, documentation pending.
6606
6607 @table @asis
6608 @item @emph{Description}:
6609 @item @emph{Standard}:
6610 F95 and later
6611
6612 @item @emph{Class}:
6613 Inquiry function
6614
6615 @item @emph{Syntax}:
6616 @item @emph{Arguments}:
6617 @item @emph{Return value}:
6618 @item @emph{Example}:
6619 @item @emph{See also}:
6620 @ref{RESHAPE}
6621 @end table
6622
6623
6624
6625
6626 @node SIGN
6627 @section @code{SIGN} --- Sign copying function
6628 @findex @code{SIGN} intrinsic
6629 @findex @code{ISIGN} intrinsic
6630 @findex @code{DSIGN} intrinsic
6631 @cindex sign copying
6632
6633 @table @asis
6634 @item @emph{Description}:
6635 @code{SIGN(A,B)} returns the value of @var{A} with the sign of @var{B}.
6636
6637 @item @emph{Standard}:
6638 F77 and later
6639
6640 @item @emph{Class}:
6641 Elemental function
6642
6643 @item @emph{Syntax}:
6644 @code{X = SIGN(A,B)}
6645
6646 @item @emph{Arguments}:
6647 @multitable @columnfractions .15 .80
6648 @item @var{A} @tab shall be a scalar of type @code{INTEGER} or @code{REAL}
6649 @item @var{B} @tab shall be a scalar of the same type and kind as @var{A}
6650 @end multitable
6651
6652 @item @emph{Return value}:
6653 The kind of the return value is that of @var{A} and @var{B}.
6654 If @math{B\ge 0} then the result is @code{ABS(A)}, else
6655 it is @code{-ABS(A)}.
6656
6657 @item @emph{Example}:
6658 @smallexample
6659 program test_sign
6660   print *, sign(-12,1)
6661   print *, sign(-12,0)
6662   print *, sign(-12,-1)
6663
6664   print *, sign(-12.,1.)
6665   print *, sign(-12.,0.)
6666   print *, sign(-12.,-1.)
6667 end program test_sign
6668 @end smallexample
6669
6670 @item @emph{Specific names}:
6671 @multitable @columnfractions .20 .20 .20 .40
6672 @item Name              @tab Arguments      @tab Return type    @tab Standard
6673 @item @code{ISIGN(A,P)} @tab @code{INTEGER(4)} @tab @code{INTEGER(4)} @tab f95, gnu
6674 @item @code{DSIGN(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab f95, gnu
6675 @end multitable
6676 @end table
6677
6678
6679
6680 @node SIGNAL
6681 @section @code{SIGNAL} --- Signal handling subroutine (or function)
6682 @findex @code{SIGNAL} intrinsic
6683 @cindex SIGNAL subroutine 
6684
6685 @table @asis
6686 @item @emph{Description}:
6687 @code{SIGNAL(NUMBER, HANDLER [, STATUS])} causes external subroutine
6688 @var{HANDLER} to be executed with a single integer argument when signal
6689 @var{NUMBER} occurs.  If @var{HANDLER} is an integer, it can be used to
6690 turn off handling of signal @var{NUMBER} or revert to its default
6691 action.  See @code{signal(2)}.
6692
6693 If @code{SIGNAL} is called as a subroutine and the @var{STATUS} argument
6694 is supplied, it is set to the value returned by @code{signal(2)}.
6695
6696 @item @emph{Standard}:
6697 GNU extension
6698
6699 @item @emph{Class}:
6700 subroutine, non-elemental function
6701
6702 @item @emph{Syntax}:
6703 @multitable @columnfractions .30 .80
6704 @item @code{CALL ALARM(NUMBER, HANDLER)}
6705 @item @code{CALL ALARM(NUMBER, HANDLER, STATUS)}
6706 @item @code{STATUS = ALARM(NUMBER, HANDLER)}
6707 @end multitable
6708
6709 @item @emph{Arguments}:
6710 @multitable @columnfractions .15 .80
6711 @item @var{NUMBER} @tab shall be a scalar integer, with @code{INTENT(IN)}
6712 @item @var{HANDLER}@tab Signal handler (@code{INTEGER FUNCTION} or
6713 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
6714 @code{INTEGER}. It is @code{INTENT(IN)}.
6715 @item @var{STATUS} @tab (Optional) @var{STATUS} shall be a scalar
6716 integer. It has @code{INTENT(OUT)}.
6717 @end multitable
6718
6719 @item @emph{Return value}:
6720 The @code{SIGNAL} functions returns the value returned by @code{signal(2)}.
6721
6722 @item @emph{Example}:
6723 @smallexample
6724 program test_signal
6725   intrinsic signal
6726   external handler_print
6727
6728   call signal (12, handler_print)
6729   call signal (10, 1)
6730
6731   call sleep (30)
6732 end program test_signal
6733 @end smallexample
6734 @end table
6735
6736
6737
6738
6739 @node SIN
6740 @section @code{SIN} --- Sine function 
6741 @findex @code{SIN} intrinsic
6742 @findex @code{DSIN} intrinsic
6743 @findex @code{ZSIN} intrinsic
6744 @findex @code{CDSIN} intrinsic
6745 @cindex trigonometric functions
6746
6747 @table @asis
6748 @item @emph{Description}:
6749 @code{SIN(X)} computes the sine of @var{X}.
6750
6751 @item @emph{Standard}:
6752 F77 and later
6753
6754 @item @emph{Class}:
6755 Elemental function
6756
6757 @item @emph{Syntax}:
6758 @code{X = SIN(X)}
6759
6760 @item @emph{Arguments}:
6761 @multitable @columnfractions .15 .80
6762 @item @var{X} @tab The type shall be @code{REAL(*)} or
6763 @code{COMPLEX(*)}.
6764 @end multitable
6765
6766 @item @emph{Return value}:
6767 The return value has same type and kind as @var{X}.
6768
6769 @item @emph{Example}:
6770 @smallexample
6771 program test_sin
6772   real :: x = 0.0
6773   x = sin(x)
6774 end program test_sin
6775 @end smallexample
6776
6777 @item @emph{Specific names}:
6778 @multitable @columnfractions .20 .20 .20 .40
6779 @item Name            @tab Argument          @tab Return type       @tab Standard
6780 @item @code{DSIN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
6781 @item @code{CSIN(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
6782 @item @code{ZSIN(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
6783 @item @code{CDSIN(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
6784 @end multitable
6785
6786 @item @emph{See also}:
6787 @ref{ASIN}
6788 @end table
6789
6790
6791
6792 @node SINH
6793 @section @code{SINH} --- Hyperbolic sine function 
6794 @findex @code{SINH} intrinsic
6795 @findex @code{DSINH} intrinsic
6796 @cindex hyperbolic sine
6797
6798 @table @asis
6799 @item @emph{Description}:
6800 @code{SINH(X)} computes the hyperbolic sine of @var{X}.
6801
6802 @item @emph{Standard}:
6803 F95 and later
6804
6805 @item @emph{Class}:
6806 Elemental function
6807
6808 @item @emph{Syntax}:
6809 @code{X = SINH(X)}
6810
6811 @item @emph{Arguments}:
6812 @multitable @columnfractions .15 .80
6813 @item @var{X} @tab The type shall be @code{REAL(*)}.
6814 @end multitable
6815
6816 @item @emph{Return value}:
6817 The return value is of type @code{REAL(*)}.
6818
6819 @item @emph{Example}:
6820 @smallexample
6821 program test_sinh
6822   real(8) :: x = - 1.0_8
6823   x = sinh(x)
6824 end program test_sinh
6825 @end smallexample
6826
6827 @item @emph{Specific names}:
6828 @multitable @columnfractions .20 .20 .20 .40
6829 @item Name            @tab Argument          @tab Return type       @tab Standard
6830 @item @code{DSINH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F95 and later
6831 @end multitable
6832
6833 @item @emph{See also}:
6834 @ref{ASINH}
6835 @end table
6836
6837
6838
6839 @node SIZE
6840 @section @code{SIZE} --- Determine the size of an array
6841 @findex @code{SIZE} intrinsic
6842 @cindex array manipulation
6843
6844 Intrinsic implemented, documentation pending.
6845
6846 @table @asis
6847 @item @emph{Description}:
6848 @item @emph{Standard}:
6849 F95 and later
6850
6851 @item @emph{Class}:
6852 Inquiry function
6853
6854 @item @emph{Syntax}:
6855 @item @emph{Arguments}:
6856 @item @emph{Return value}:
6857 @item @emph{Example}:
6858 @item @emph{See also}:
6859 @end table
6860
6861
6862
6863 @node SNGL
6864 @section @code{SNGL} --- Convert double precision real to default real
6865 @findex @code{SNGL} intrinsic
6866 @cindex conversion function (real)
6867
6868 @table @asis
6869 @item @emph{Description}:
6870 @code{SNGL(A)} converts the double precision real @var{A}
6871 to a default real value. This is an archaic form of @code{REAL}
6872 that is specific to one type for @var{A}.
6873
6874 @item @emph{Standard}:
6875 GNU extension
6876
6877 @item @emph{Class}:
6878 function
6879
6880 @item @emph{Syntax}:
6881 @code{X = SNGL(A)}
6882
6883 @item @emph{Arguments}:
6884 @multitable @columnfractions .15 .80
6885 @item @var{A} @tab The type shall be a double precision @code{REAL}.
6886 @end multitable
6887
6888 @item @emph{Return value}:
6889 The return value is of type default @code{REAL}.
6890
6891 @item @emph{See also}:
6892 @ref{DBLE}
6893 @end table
6894
6895
6896
6897 @node SPACING
6898 @section @code{SPACING} --- Smallest distance between two numbers of a given type
6899 @findex @code{SPACING} intrinsic
6900 @cindex undocumented intrinsic 
6901
6902 Intrinsic implemented, documentation pending.
6903
6904 @table @asis
6905 @item @emph{Description}:
6906 @item @emph{Standard}:
6907 F95 and later
6908
6909 @item @emph{Class}:
6910 Elemental function
6911
6912 @item @emph{Syntax}:
6913 @item @emph{Arguments}:
6914 @item @emph{Return value}:
6915 @item @emph{Example}:
6916 @item @emph{See also}:
6917 @end table
6918
6919
6920
6921
6922 @node SPREAD
6923 @section @code{SPREAD} --- Add a dimension to an array
6924 @findex @code{SPREAD} intrinsic
6925 @cindex array manipulation
6926
6927 Intrinsic implemented, documentation pending.
6928
6929 @table @asis
6930 @item @emph{Description}:
6931 @item @emph{Standard}:
6932 F95 and later
6933
6934 @item @emph{Class}:
6935 Transformational function
6936
6937 @item @emph{Syntax}:
6938 @item @emph{Arguments}:
6939 @item @emph{Return value}:
6940 @item @emph{Example}:
6941 @item @emph{See also}:
6942 @end table
6943
6944
6945
6946
6947 @node SQRT
6948 @section @code{SQRT} --- Square-root function
6949 @findex @code{SQRT} intrinsic
6950 @findex @code{DSQRT} intrinsic
6951 @findex @code{CSQRT} intrinsic
6952 @findex @code{ZSQRT} intrinsic
6953 @findex @code{CDSQRT} intrinsic
6954 @cindex square-root
6955
6956 @table @asis
6957 @item @emph{Description}:
6958 @code{SQRT(X)} computes the square root of @var{X}.
6959
6960 @item @emph{Standard}:
6961 F77 and later
6962
6963 @item @emph{Class}:
6964 Elemental function
6965
6966 @item @emph{Syntax}:
6967 @code{X = SQRT(X)}
6968
6969 @item @emph{Arguments}:
6970 @multitable @columnfractions .15 .80
6971 @item @var{X} @tab The type shall be @code{REAL(*)} or
6972 @code{COMPLEX(*)}.
6973 @end multitable
6974
6975 @item @emph{Return value}:
6976 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
6977 The kind type parameter is the same as @var{X}.
6978
6979 @item @emph{Example}:
6980 @smallexample
6981 program test_sqrt
6982   real(8) :: x = 2.0_8
6983   complex :: z = (1.0, 2.0)
6984   x = sqrt(x)
6985   z = sqrt(z)
6986 end program test_sqrt
6987 @end smallexample
6988
6989 @item @emph{Specific names}:
6990 @multitable @columnfractions .20 .20 .20 .40
6991 @item Name             @tab Argument             @tab Return type          @tab Standard
6992 @item @code{DSQRT(X)}  @tab @code{REAL(8) X}     @tab @code{REAL(8)}       @tab F95 and later
6993 @item @code{CSQRT(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab F95 and later
6994 @item @code{ZSQRT(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab GNU extension
6995 @item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab GNU extension
6996 @end multitable
6997 @end table
6998
6999
7000
7001 @node SRAND
7002 @section @code{SRAND} --- Reinitialize the random number generator
7003 @findex @code{SRAND} intrinsic
7004 @cindex random number
7005
7006 @table @asis
7007 @item @emph{Description}:
7008 @code{SRAND} reinitializes the pseudo-random number generator
7009 called by @code{RAND} and @code{IRAND}. The new seed used by the
7010 generator is specified by the required argument @var{SEED}.
7011
7012 @item @emph{Standard}:
7013 GNU extension
7014
7015 @item @emph{Class}:
7016 non-elemental subroutine
7017
7018 @item @emph{Syntax}:
7019 @code{CALL SRAND(SEED)}
7020
7021 @item @emph{Arguments}:
7022 @multitable @columnfractions .15 .80
7023 @item @var{SEED} @tab shall be a scalar @code{INTEGER(kind=4)}.
7024 @end multitable
7025
7026 @item @emph{Return value}:
7027 Does not return.
7028
7029 @item @emph{Example}:
7030 See @code{RAND} and @code{IRAND} for examples.
7031
7032 @item @emph{Notes}:
7033 The Fortran 2003 standard specifies the intrinsic @code{RANDOM_SEED} to
7034 initialize the pseudo-random numbers generator and @code{RANDOM_NUMBER}
7035 to generate pseudo-random numbers. Please note that in
7036 @command{gfortran}, these two sets of intrinsics (@code{RAND},
7037 @code{IRAND} and @code{SRAND} on the one hand, @code{RANDOM_NUMBER} and
7038 @code{RANDOM_SEED} on the other hand) access two independent
7039 pseudo-random number generators.
7040
7041 @item @emph{See also}:
7042 @ref{RAND}, @ref{RANDOM_SEED}, @ref{RANDOM_NUMBER}
7043
7044 @end table
7045
7046
7047 @node STAT
7048 @section @code{STAT} --- Get file status
7049 @findex @code{STAT} intrinsic
7050 @cindex file system operations
7051
7052 Intrinsic implemented, documentation pending.
7053
7054 @table @asis
7055 @item @emph{Description}:
7056 @item @emph{Standard}:
7057 GNU extension
7058
7059 @item @emph{Class}:
7060 @item @emph{Syntax}:
7061 @item @emph{Arguments}:
7062 @item @emph{Return value}:
7063 @item @emph{Example}:
7064 @item @emph{See also}:
7065 @ref{FSTAT}
7066 @end table
7067
7068
7069
7070
7071 @node SUM
7072 @section @code{SUM} --- Sum of array elements
7073 @findex @code{SUM} intrinsic
7074 @cindex array manipulation
7075
7076 Intrinsic implemented, documentation pending.
7077
7078 @table @asis
7079 @item @emph{Description}:
7080 @item @emph{Standard}:
7081 F95 and later
7082
7083 @item @emph{Class}:
7084 Transformational function
7085
7086 @item @emph{Syntax}:
7087 @item @emph{Arguments}:
7088 @item @emph{Return value}:
7089 @item @emph{Example}:
7090 @item @emph{See also}:
7091 @ref{PRODUCT}
7092 @end table
7093
7094
7095
7096
7097 @node SYMLNK
7098 @section @code{SYMLNK} --- Create a symbolic link
7099 @findex @code{SYMLNK} intrinsic
7100 @cindex file system operations
7101
7102 Intrinsic implemented, documentation pending.
7103
7104 @table @asis
7105 @item @emph{Description}:
7106 @item @emph{Standard}:
7107 @item @emph{Class}:
7108 GNU extension
7109
7110 @item @emph{Syntax}:
7111 @item @emph{Arguments}:
7112 @item @emph{Return value}:
7113 @item @emph{Example}:
7114 @item @emph{See also}:
7115 @end table
7116
7117
7118
7119
7120 @node SYSTEM
7121 @section @code{SYSTEM} --- Execute a shell command
7122 @findex @code{SYSTEM} intrinsic
7123 @cindex undocumented intrinsic 
7124
7125 Intrinsic implemented, documentation pending.
7126
7127 @table @asis
7128 @item @emph{Description}:
7129 @item @emph{Standard}:
7130 GNU extension
7131
7132 @item @emph{Class}:
7133 Subroutine
7134
7135 @item @emph{Syntax}:
7136 @item @emph{Arguments}:
7137 @item @emph{Return value}:
7138 @item @emph{Example}:
7139 @item @emph{See also}:
7140 @end table
7141
7142
7143
7144
7145 @node SYSTEM_CLOCK
7146 @section @code{SYSTEM_CLOCK} --- Time function
7147 @findex @code{SYSTEM_CLOCK} intrinsic
7148 @cindex time functions
7149
7150 Intrinsic implemented, documentation pending.
7151
7152 @table @asis
7153 @item @emph{Description}:
7154 @item @emph{Standard}:
7155 F95 and later
7156
7157 @item @emph{Class}:
7158 Subroutine
7159
7160 @item @emph{Syntax}:
7161 @item @emph{Arguments}:
7162 @item @emph{Return value}:
7163 @item @emph{Example}:
7164 @item @emph{See also}:
7165 @end table
7166
7167
7168
7169 @node TAN
7170 @section @code{TAN} --- Tangent function
7171 @findex @code{TAN} intrinsic
7172 @findex @code{DTAN} intrinsic
7173 @cindex trigonometric functions
7174
7175 @table @asis
7176 @item @emph{Description}:
7177 @code{TAN(X)} computes the tangent of @var{X}.
7178
7179 @item @emph{Standard}:
7180 F77 and later
7181
7182 @item @emph{Class}:
7183 Elemental function
7184
7185 @item @emph{Syntax}:
7186 @code{X = TAN(X)}
7187
7188 @item @emph{Arguments}:
7189 @multitable @columnfractions .15 .80
7190 @item @var{X} @tab The type shall be @code{REAL(*)}.
7191 @end multitable
7192
7193 @item @emph{Return value}:
7194 The return value is of type @code{REAL(*)}.  The kind type parameter is
7195 the same as @var{X}.
7196
7197 @item @emph{Example}:
7198 @smallexample
7199 program test_tan
7200   real(8) :: x = 0.165_8
7201   x = tan(x)
7202 end program test_tan
7203 @end smallexample
7204
7205 @item @emph{Specific names}:
7206 @multitable @columnfractions .20 .20 .20 .40
7207 @item Name            @tab Argument          @tab Return type       @tab Standard
7208 @item @code{DTAN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F95 and later
7209 @end multitable
7210
7211 @item @emph{See also}:
7212 @ref{ATAN}
7213 @end table
7214
7215
7216
7217 @node TANH
7218 @section @code{TANH} --- Hyperbolic tangent function 
7219 @findex @code{TANH} intrinsic
7220 @findex @code{DTANH} intrinsic
7221 @cindex hyperbolic tangent
7222
7223 @table @asis
7224 @item @emph{Description}:
7225 @code{TANH(X)} computes the hyperbolic tangent of @var{X}.
7226
7227 @item @emph{Standard}:
7228 F77 and later
7229
7230 @item @emph{Class}:
7231 Elemental function
7232
7233 @item @emph{Syntax}:
7234 @code{X = TANH(X)}
7235
7236 @item @emph{Arguments}:
7237 @multitable @columnfractions .15 .80
7238 @item @var{X} @tab The type shall be @code{REAL(*)}.
7239 @end multitable
7240
7241 @item @emph{Return value}:
7242 The return value is of type @code{REAL(*)} and lies in the range
7243 @math{ - 1 \leq tanh(x) \leq 1 }.
7244
7245 @item @emph{Example}:
7246 @smallexample
7247 program test_tanh
7248   real(8) :: x = 2.1_8
7249   x = tanh(x)
7250 end program test_tanh
7251 @end smallexample
7252
7253 @item @emph{Specific names}:
7254 @multitable @columnfractions .20 .20 .20 .40
7255 @item Name            @tab Argument          @tab Return type       @tab Standard
7256 @item @code{DTANH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab F95 and later
7257 @end multitable
7258
7259 @item @emph{See also}:
7260 @ref{ATANH}
7261 @end table
7262
7263
7264
7265 @node TIME
7266 @section @code{TIME} --- Time function
7267 @findex @code{TIME} intrinsic
7268 @cindex time functions
7269
7270 Intrinsic implemented, documentation pending.
7271
7272 @table @asis
7273 @item @emph{Description}:
7274 @item @emph{Standard}:
7275 GNU extension
7276
7277 @item @emph{Class}:
7278 Non-elemental function
7279
7280 @item @emph{Syntax}:
7281 @item @emph{Arguments}:
7282 @item @emph{Return value}:
7283 @item @emph{Example}:
7284 @item @emph{See also}:
7285 @end table
7286
7287
7288
7289 @node TINY
7290 @section @code{TINY} --- Smallest positive number of a real kind
7291 @findex @code{TINY} intrinsic
7292 @cindex tiny
7293
7294 @table @asis
7295 @item @emph{Description}:
7296 @code{TINY(X)} returns the smallest positive (non zero) number
7297 in the model of the type of @code{X}.
7298
7299 @item @emph{Standard}:
7300 F95 and later
7301
7302 @item @emph{Class}:
7303 Elemental function
7304
7305 @item @emph{Syntax}:
7306 @code{Y = TINY(X)}
7307
7308 @item @emph{Arguments}:
7309 @multitable @columnfractions .15 .80
7310 @item @var{X} @tab shall be of type @code{REAL}.
7311 @end multitable
7312
7313 @item @emph{Return value}:
7314 The return value is of the same type and kind as @var{X}
7315
7316 @item @emph{Example}:
7317 See @code{HUGE} for an example.
7318 @end table
7319
7320
7321
7322 @node TRANSFER
7323 @section @code{TRANSFER} --- Transfer bit patterns
7324 @findex @code{TRANSFER} intrinsic
7325 @cindex bit manipulation
7326
7327 Intrinsic implemented, documentation pending.
7328
7329 @table @asis
7330 @item @emph{Description}:
7331 @item @emph{Standard}:
7332 F95 and later
7333
7334 @item @emph{Class}:
7335 Transformational function
7336
7337 @item @emph{Syntax}:
7338 @item @emph{Arguments}:
7339 @item @emph{Return value}:
7340 @item @emph{Example}:
7341 @item @emph{See also}:
7342 @end table
7343
7344
7345
7346
7347 @node TRANSPOSE
7348 @section @code{TRANSPOSE} --- Transpose an array of rank two
7349 @findex @code{TRANSPOSE} intrinsic
7350 @cindex matrix manipulation
7351
7352 Intrinsic implemented, documentation pending.
7353
7354 @table @asis
7355 @item @emph{Description}:
7356 @item @emph{Standard}:
7357 F95 and later
7358
7359 @item @emph{Class}:
7360 Transformational function
7361
7362 @item @emph{Syntax}:
7363 @item @emph{Arguments}:
7364 @item @emph{Return value}:
7365 @item @emph{Example}:
7366 @item @emph{See also}:
7367 @end table
7368
7369
7370
7371
7372 @node TRIM
7373 @section @code{TRIM} --- Function to remove trailing blank characters of a string
7374 @findex @code{TRIM} intrinsic
7375 @cindex string manipulation
7376
7377 Intrinsic implemented, documentation pending.
7378
7379 @table @asis
7380 @item @emph{Description}:
7381 @item @emph{Standard}:
7382 F95 and later
7383
7384 @item @emph{Class}:
7385 Transformational function
7386
7387 @item @emph{Syntax}:
7388 @item @emph{Arguments}:
7389 @item @emph{Return value}:
7390 @item @emph{Example}:
7391 @item @emph{See also}:
7392 @end table
7393
7394
7395
7396
7397 @node UBOUND
7398 @section @code{UBOUND} --- Upper dimension bounds of an array
7399 @findex @code{UBOUND} intrinsic
7400 @cindex undocumented intrinsic 
7401
7402 Intrinsic implemented, documentation pending.
7403
7404 @table @asis
7405 @item @emph{Description}:
7406
7407 @item @emph{Standard}:
7408 F95 and later
7409
7410 @item @emph{Class}:
7411 Inquiry function
7412
7413 @item @emph{Syntax}:
7414 @item @emph{Arguments}:
7415 @item @emph{Return value}:
7416 @item @emph{Example}:
7417 @item @emph{Specific names}:
7418
7419 @item @emph{See also}:
7420 @ref{LBOUND}
7421 @end table
7422
7423
7424
7425
7426 @node UMASK
7427 @section @code{UMASK} --- Set the file creation mask
7428 @findex @code{UMASK} intrinsic
7429 @cindex file system operations
7430
7431 Intrinsic implemented, documentation pending.
7432
7433 @table @asis
7434 @item @emph{Description}:
7435 @item @emph{Standard}:
7436 GNU extension
7437
7438 @item @emph{Class}:
7439 Subroutine
7440
7441 @item @emph{Syntax}:
7442 @item @emph{Arguments}:
7443 @item @emph{Return value}:
7444 @item @emph{Example}:
7445 @item @emph{Specific names}:
7446 @item @emph{See also}:
7447 @end table
7448
7449
7450
7451
7452 @node UNLINK
7453 @section @code{UNLINK} --- Remove a file from the file system
7454 @findex @code{UNLINK} intrinsic
7455 @cindex file system operations
7456
7457 Intrinsic implemented, documentation pending.
7458
7459 @table @asis
7460 @item @emph{Description}:
7461 @item @emph{Standard}:
7462 GNU extension
7463
7464 @item @emph{Class}:
7465 Subroutine
7466
7467 @item @emph{Syntax}:
7468 @item @emph{Arguments}:
7469 @item @emph{Return value}:
7470 @item @emph{Example}:
7471
7472 @item @emph{See also}:
7473 @ref{LINK}
7474 @end table
7475
7476
7477
7478
7479 @node UNMASK
7480 @section @code{UNMASK} --- (?)
7481 @findex @code{UNMASK} intrinsic
7482 @cindex undocumented intrinsic 
7483
7484 Intrinsic implemented, documentation pending.
7485
7486 @table @asis
7487 @item @emph{Description}:
7488 @item @emph{Standard}:
7489 @item @emph{Class}:
7490 @item @emph{Syntax}:
7491 @item @emph{Arguments}:
7492 @item @emph{Return value}:
7493 @item @emph{Example}:
7494 @item @emph{Specific names}:
7495 @item @emph{See also}:
7496 @end table
7497
7498
7499
7500
7501 @node UNPACK
7502 @section @code{UNPACK} --- Unpack an array of rank one into an array
7503 @findex @code{UNPACK} intrinsic
7504 @cindex array manipulation
7505
7506 Intrinsic implemented, documentation pending.
7507
7508 @table @asis
7509 @item @emph{Description}:
7510 @item @emph{Standard}:
7511 F95 and later
7512
7513 @item @emph{Class}:
7514 Transformational function
7515
7516 @item @emph{Syntax}:
7517 @item @emph{Arguments}:
7518 @item @emph{Return value}:
7519 @item @emph{Example}:
7520
7521 @item @emph{See also}:
7522 @ref{PACK}
7523 @end table
7524
7525
7526
7527
7528 @node VERIFY
7529 @section @code{VERIFY} --- Scan a string for the absence of a set of characters
7530 @findex @code{VERIFY} intrinsic
7531 @cindex string manipulation
7532
7533 Intrinsic implemented, documentation pending.
7534
7535 @table @asis
7536 @item @emph{Description}:
7537 @item @emph{Standard}:
7538 F95 and later
7539
7540 @item @emph{Class}:
7541 Elemental function
7542
7543 @item @emph{Syntax}:
7544 @item @emph{Arguments}:
7545 @item @emph{Return value}:
7546 @item @emph{Example}:
7547 @item @emph{Specific names}:
7548 @item @emph{See also}:
7549 @end table
7550
7551
7552
7553
7554 @node XOR
7555 @section @code{XOR} --- Logical exclusive or
7556 @findex @code{XOR} intrinsic
7557 @cindex logical operations
7558
7559 Intrinsic implemented, documentation pending.
7560
7561 @table @asis
7562 @item @emph{Description}:
7563 @item @emph{Standard}:
7564 F77 and later
7565
7566 @item @emph{Class}:
7567 @item @emph{Syntax}:
7568 @item @emph{Arguments}:
7569 @item @emph{Return value}:
7570 @item @emph{Example}:
7571 @item @emph{Specific names}:
7572 @item @emph{See also}:
7573 @end table
7574
7575