OSDN Git Service

dae94cc7ab85d379db508dd314f34bfced446ffd
[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 @menu
35 * Introduction:         Introduction
36 * @code{ABORT}:         ABORT,     Abort the program     
37 * @code{ABS}:           ABS,       Absolute value     
38 * @code{ACHAR}:         ACHAR,     Character in @acronym{ASCII} collating sequence
39 * @code{ACOS}:          ACOS,      Arc cosine function
40 * @code{ADJUSTL}:       ADJUSTL,   Left adjust a string
41 * @code{ADJUSTR}:       ADJUSTR,   Right adjust a string
42 * @code{AIMAG}:         AIMAG,     Imaginary part of complex number
43 * @code{AINT}:          AINT,      Truncate to a whole number
44 * @code{ALARM}:         ALARM,     Set an alarm clock
45 * @code{ALL}:           ALL,       Determine if all values are true
46 * @code{ALLOCATED}:     ALLOCATED, Status of allocatable entity
47 * @code{ANINT}:         ANINT,     Nearest whole number
48 * @code{ANY}:           ANY,       Determine if any values are true
49 * @code{ASIN}:          ASIN,      Arcsine function
50 * @code{ASSOCIATED}:    ASSOCIATED, Status of a pointer or pointer/target pair
51 * @code{ATAN}:          ATAN,      Arctangent function
52 * @code{ATAN2}:         ATAN2,     Arctangent function
53 * @code{BESJ0}:         BESJ0,     Bessel function of the first kind of order 0
54 * @code{BESJ1}:         BESJ1,     Bessel function of the first kind of order 1
55 * @code{BESJN}:         BESJN,     Bessel function of the first kind
56 * @code{BESY0}:         BESY0,     Bessel function of the second kind of order 0
57 * @code{BESY1}:         BESY1,     Bessel function of the second kind of order 1
58 * @code{BESYN}:         BESYN,     Bessel function of the second kind
59 * @code{BIT_SIZE}:      BIT_SIZE,  Bit size inquiry function
60 * @code{BTEST}:         BTEST,     Bit test function
61 * @code{CEILING}:       CEILING,   Integer ceiling function
62 * @code{CHAR}:          CHAR,      Character conversion function
63 * @code{CMPLX}:         CMPLX,     Complex conversion function
64 * @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT,  Command line argument count
65 * @code{CONJG}:         CONJG,     Complex conjugate function
66 * @code{COS}:           COS,       Cosine function
67 * @code{COSH}:          COSH,      Hyperbolic cosine function
68 * @code{COUNT}:         COUNT,     Count occurrences of .TRUE. in an array
69 * @code{CPU_TIME}:      CPU_TIME,  CPU time subroutine
70 * @code{CSHIFT}:        CSHIFT,    Circular array shift function
71 * @code{DATE_AND_TIME}: DATE_AND_TIME, Date and time subroutine
72 * @code{DBLE}:          DBLE,      Double precision conversion function
73 * @code{DCMPLX}:        DCMPLX,    Double complex conversion function
74 * @code{DFLOAT}:        DFLOAT,    Double precision conversion function
75 * @code{DIGITS}:        DIGITS,    Significant digits function
76 * @code{DIM}:           DIM,       Dim function
77 * @code{DOT_PRODUCT}:   DOT_PRODUCT, Dot product function
78 * @code{DPROD}:         DPROD,     Double product function
79 * @code{DREAL}:         DREAL,     Double real part function
80 * @code{DTIME}:         DTIME,     Execution time subroutine (or function)
81 * @code{EOSHIFT}:       EOSHIFT,   End-off shift function
82 * @code{EPSILON}:       EPSILON,   Epsilon function
83 * @code{ERF}:           ERF,       Error function
84 * @code{ERFC}:          ERFC,      Complementary error function
85 * @code{ETIME}:         ETIME,     Execution time subroutine (or function)
86 * @code{EXIT}:          EXIT,      Exit the program with status.
87 * @code{EXP}:           EXP,       Exponential function
88 * @code{EXPONENT}:      EXPONENT,  Exponent function
89 * @code{FLOOR}:         FLOOR,     Integer floor function
90 * @code{FNUM}:          FNUM,      File number function
91 * @code{FREE}:          FREE,      Memory de-allocation subroutine
92 * @code{LOC}:           LOC,       Returns the address of a variable
93 * @code{LOG}:           LOG,       Logarithm function
94 * @code{LOG10}:         LOG10,     Base 10 logarithm function 
95 * @code{MALLOC}:        MALLOC,    Dynamic memory allocation function
96 * @code{REAL}:          REAL,      Convert to real type 
97 * @code{SECNDS}:        SECNDS,    Time function
98 * @code{SIGNAL}:        SIGNAL,    Signal handling subroutine (or function)
99 * @code{SIN}:           SIN,       Sine function
100 * @code{SINH}:          SINH,      Hyperbolic sine function
101 * @code{SQRT}:          SQRT,      Square-root function
102 * @code{TAN}:           TAN,       Tangent function
103 * @code{TANH}:          TANH,      Hyperbolic tangent function
104 @end menu
105
106 @node Introduction
107 @section Introduction to intrinsic procedures
108
109 Gfortran provides a rich set of intrinsic procedures that includes all
110 the intrinsic procedures required by the Fortran 95 standard, a set of
111 intrinsic procedures for backwards compatibility with Gnu Fortran 77
112 (i.e., @command{g77}), and a small selection of intrinsic procedures
113 from the Fortran 2003 standard.  Any description here, which conflicts with a 
114 description in either the Fortran 95 standard or the Fortran 2003 standard,
115 is unintentional and the standard(s) should be considered authoritative.
116
117 The enumeration of the @code{KIND} type parameter is processor defined in
118 the Fortran 95 standard.  Gfortran defines the default integer type and
119 default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)},
120 respectively.  The standard mandates that both data types shall have
121 another kind, which have more precision.  On typical target architectures
122 supported by @command{gfortran}, this kind type parameter is @code{KIND=8}.
123 Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
124 In the description of generic intrinsic procedures, the kind type parameter
125 will be specified by @code{KIND=*}, and in the description of specific
126 names for an intrinsic procedure the kind type parameter will be explicitly
127 given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}).  Finally, for
128 brevity the optional @code{KIND=} syntax will be omitted.
129
130 Many of the intrinsics procedures take one or more optional arguments.
131 This document follows the convention used in the Fortran 95 standard,
132 and denotes such arguments by square brackets.
133
134 @command{Gfortran} offers the @option{-std=f95} and @option{-std=gnu} options,
135 which can be used to restrict the set of intrinsic procedures to a 
136 given standard.  By default, @command{gfortran} sets the @option{-std=gnu}
137 option, and so all intrinsic procedures described here are accepted.  There
138 is one caveat.  For a select group of intrinsic procedures, @command{g77}
139 implemented both a function and a subroutine.  Both classes 
140 have been implemented in @command{gfortran} for backwards compatibility
141 with @command{g77}.  It is noted here that these functions and subroutines
142 cannot be intermixed in a given subprogram.  In the descriptions that follow,
143 the applicable option(s) is noted.
144
145
146
147 @node ABORT
148 @section @code{ABORT} --- Abort the program  
149 @findex @code{ABORT}
150 @cindex abort
151
152 @table @asis
153 @item @emph{Description}:
154 @code{ABORT} causes immediate termination of the program.  On operating
155 systems that support a core dump, @code{ABORT} will produce a core dump,
156 which is suitable for debugging purposes.
157
158 @item @emph{Option}:
159 gnu
160
161 @item @emph{Class}:
162 non-elemental subroutine
163
164 @item @emph{Syntax}:
165 @code{CALL ABORT}
166
167 @item @emph{Return value}:
168 Does not return.
169
170 @item @emph{Example}:
171 @smallexample
172 program test_abort
173   integer :: i = 1, j = 2
174   if (i /= j) call abort
175 end program test_abort
176 @end smallexample
177 @end table
178
179
180
181 @node ABS
182 @section @code{ABS} --- Absolute value  
183 @findex @code{ABS} intrinsic
184 @findex @code{CABS} intrinsic
185 @findex @code{DABS} intrinsic
186 @findex @code{IABS} intrinsic
187 @findex @code{ZABS} intrinsic
188 @findex @code{CDABS} intrinsic
189 @cindex absolute value
190
191 @table @asis
192 @item @emph{Description}:
193 @code{ABS(X)} computes the absolute value of @code{X}.
194
195 @item @emph{Option}:
196 f95, gnu
197
198 @item @emph{Class}:
199 elemental function
200
201 @item @emph{Syntax}:
202 @code{X = ABS(X)}
203
204 @item @emph{Arguments}:
205 @multitable @columnfractions .15 .80
206 @item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)},
207 @code{REAL(*)}, or @code{COMPLEX(*)}.
208 @end multitable
209
210 @item @emph{Return value}:
211 The return value is of the same type and
212 kind as the argument except the return value is @code{REAL(*)} for a
213 @code{COMPLEX(*)} argument.
214
215 @item @emph{Example}:
216 @smallexample
217 program test_abs
218   integer :: i = -1
219   real :: x = -1.e0
220   complex :: z = (-1.e0,0.e0)
221   i = abs(i)
222   x = abs(x)
223   x = abs(z)
224 end program test_abs
225 @end smallexample
226
227 @item @emph{Specific names}:
228 @multitable @columnfractions .24 .24 .24 .24
229 @item Name            @tab Argument            @tab Return type       @tab Option
230 @item @code{CABS(Z)}  @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)}    @tab f95, gnu
231 @item @code{DABS(X)}  @tab @code{REAL(8)    X} @tab @code{REAL(8)}    @tab f95, gnu
232 @item @code{IABS(I)}  @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab f95, gnu
233 @item @code{ZABS(Z)}  @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
234 @item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
235 @end multitable
236 @end table
237
238
239
240 @node ACHAR
241 @section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence 
242 @findex @code{ACHAR} intrinsic
243 @cindex @acronym{ASCII} collating sequence
244
245 @table @asis
246 @item @emph{Description}:
247 @code{ACHAR(I)} returns the character located at position @code{I}
248 in the @acronym{ASCII} collating sequence.
249
250 @item @emph{Option}:
251 f95, gnu
252
253 @item @emph{Class}:
254 elemental function
255
256 @item @emph{Syntax}:
257 @code{C = ACHAR(I)}
258
259 @item @emph{Arguments}:
260 @multitable @columnfractions .15 .80
261 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
262 @end multitable
263
264 @item @emph{Return value}:
265 The return value is of type @code{CHARACTER} with a length of one.  The
266 kind type parameter is the same as  @code{KIND('A')}.
267
268 @item @emph{Example}:
269 @smallexample
270 program test_achar
271   character c
272   c = achar(32)
273 end program test_achar
274 @end smallexample
275 @end table
276
277
278
279 @node ACOS
280 @section @code{ACOS} --- Arc cosine function 
281 @findex @code{ACOS} intrinsic
282 @findex @code{DACOS} intrinsic
283 @cindex arc cosine
284
285 @table @asis
286 @item @emph{Description}:
287 @code{ACOS(X)} computes the arc cosine of @var{X}.
288
289 @item @emph{Option}:
290 f95, gnu
291
292 @item @emph{Class}:
293 elemental function
294
295 @item @emph{Syntax}:
296 @code{X = ACOS(X)}
297
298 @item @emph{Arguments}:
299 @multitable @columnfractions .15 .80
300 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
301 less than one.
302 @end multitable
303
304 @item @emph{Return value}:
305 The return value is of type @code{REAL(*)} and it lies in the
306 range @math{ 0 \leq \arccos (x) \leq \pi}.  The kind type
307 parameter is the same as @var{X}.
308
309 @item @emph{Example}:
310 @smallexample
311 program test_acos
312   real(8) :: x = 0.866_8
313   x = achar(x)
314 end program test_acos
315 @end smallexample
316
317 @item @emph{Specific names}:
318 @multitable @columnfractions .24 .24 .24 .24
319 @item Name            @tab Argument          @tab Return type       @tab Option
320 @item @code{DACOS(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
321 @end multitable
322 @end table
323
324
325
326 @node ADJUSTL
327 @section @code{ADJUSTL} --- Left adjust a string 
328 @findex @code{ADJUSTL} intrinsic
329 @cindex adjust string
330
331 @table @asis
332 @item @emph{Description}:
333 @code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.
334 Spaces are inserted at the end of the string as needed.
335
336 @item @emph{Option}:
337 f95, gnu
338
339 @item @emph{Class}:
340 elemental function
341
342 @item @emph{Syntax}:
343 @code{STR = ADJUSTL(STR)}
344
345 @item @emph{Arguments}:
346 @multitable @columnfractions .15 .80
347 @item @var{STR} @tab The type shall be @code{CHARACTER}.
348 @end multitable
349
350 @item @emph{Return value}:
351 The return value is of type @code{CHARACTER} where leading spaces 
352 are removed and the same number of spaces are inserted on the end
353 of @var{STR}.
354
355 @item @emph{Example}:
356 @smallexample
357 program test_adjustl
358   character(len=20) :: str = '   gfortran'
359   str = adjustl(str)
360   print *, str
361 end program test_adjustl
362 @end smallexample
363 @end table
364
365
366
367 @node ADJUSTR
368 @section @code{ADJUSTR} --- Right adjust a string 
369 @findex @code{ADJUSTR} intrinsic
370 @cindex adjust string
371
372 @table @asis
373 @item @emph{Description}:
374 @code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.
375 Spaces are inserted at the start of the string as needed.
376
377 @item @emph{Option}:
378 f95, gnu
379
380 @item @emph{Class}:
381 elemental function
382
383 @item @emph{Syntax}:
384 @code{STR = ADJUSTR(STR)}
385
386 @item @emph{Arguments}:
387 @multitable @columnfractions .15 .80
388 @item @var{STR} @tab The type shall be @code{CHARACTER}.
389 @end multitable
390
391 @item @emph{Return value}:
392 The return value is of type @code{CHARACTER} where trailing spaces 
393 are removed and the same number of spaces are inserted at the start
394 of @var{STR}.
395
396 @item @emph{Example}:
397 @smallexample
398 program test_adjustr
399   character(len=20) :: str = 'gfortran'
400   str = adjustr(str)
401   print *, str
402 end program test_adjustr
403 @end smallexample
404 @end table
405
406
407
408 @node AIMAG
409 @section @code{AIMAG} --- Imaginary part of complex number  
410 @findex @code{AIMAG} intrinsic
411 @findex @code{DIMAG} intrinsic
412 @findex @code{IMAG} intrinsic
413 @findex @code{IMAGPART} intrinsic
414 @cindex Imaginary part
415
416 @table @asis
417 @item @emph{Description}:
418 @code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.
419 The @code{IMAG(Z)} and @code{IMAGPART(Z)} intrinsic functions are provided
420 for compatibility with @command{g77}, and their use in new code is 
421 strongly discouraged.
422
423 @item @emph{Option}:
424 f95, gnu
425
426 @item @emph{Class}:
427 elemental function
428
429 @item @emph{Syntax}:
430 @code{X = AIMAG(Z)}
431
432 @item @emph{Arguments}:
433 @multitable @columnfractions .15 .80
434 @item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.
435 @end multitable
436
437 @item @emph{Return value}:
438 The return value is of type real with the
439 kind type parameter of the argument.
440
441 @item @emph{Example}:
442 @smallexample
443 program test_aimag
444   complex(4) z4
445   complex(8) z8
446   z4 = cmplx(1.e0_4, 0.e0_4)
447   z8 = cmplx(0.e0_8, 1.e0_8)
448   print *, aimag(z4), dimag(z8)
449 end program test_aimag
450 @end smallexample
451
452 @item @emph{Specific names}:
453 @multitable @columnfractions .24 .24 .24 .24
454 @item Name            @tab Argument            @tab Return type       @tab Option
455 @item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)}    @tab f95, gnu
456 @item @code{IMAG(Z)}  @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)}    @tab gnu
457 @item @code{IMAGPART(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab gnu
458 @end multitable
459 @end table
460
461
462
463 @node AINT
464 @section @code{AINT} --- Imaginary part of complex number  
465 @findex @code{AINT} intrinsic
466 @findex @code{DINT} intrinsic
467 @cindex whole number
468
469 @table @asis
470 @item @emph{Description}:
471 @code{AINT(X [, KIND])} truncates its argument to a whole number.
472
473 @item @emph{Option}:
474 f95, gnu
475
476 @item @emph{Class}:
477 elemental function
478
479 @item @emph{Syntax}:
480 @code{X = AINT(X)} 
481 @code{X = AINT(X, KIND)}
482
483 @item @emph{Arguments}:
484 @multitable @columnfractions .15 .80
485 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
486 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
487 initialization expression.
488 @end multitable
489
490 @item @emph{Return value}:
491 The return value is of type real with the kind type parameter of the
492 argument if the optional @var{KIND} is absent; otherwise, the kind
493 type parameter will be given by @var{KIND}.  If the magnitude of 
494 @var{X} is less than one, then @code{AINT(X)} returns zero.  If the
495 magnitude is equal to or greater than one, then it returns the largest
496 whole number that does not exceed its magnitude.  The sign is the same
497 as the sign of @var{X}. 
498
499 @item @emph{Example}:
500 @smallexample
501 program test_aint
502   real(4) x4
503   real(8) x8
504   x4 = 1.234E0_4
505   x8 = 4.321_8
506   print *, aint(x4), dint(x8)
507   x8 = aint(x4,8)
508 end program test_aint
509 @end smallexample
510
511 @item @emph{Specific names}:
512 @multitable @columnfractions .24 .24 .24 .24
513 @item Name           @tab Argument         @tab Return type      @tab Option
514 @item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab f95, gnu
515 @end multitable
516 @end table
517
518
519
520 @node ALARM
521 @section @code{ALARM} --- Execute a routine after a given delay
522 @findex @code{ALARM} intrinsic
523
524 @table @asis
525 @item @emph{Description}:
526 @code{ALARM(SECONDS [, STATUS])} causes external subroutine @var{HANDLER}
527 to be executed after a delay of @var{SECONDS} by using @code{alarm(1)} to
528 set up a signal and @code{signal(2)} to catch it. If @var{STATUS} is
529 supplied, it will be returned with the number of seconds remaining until
530 any previously scheduled alarm was due to be delivered, or zero if there
531 was no previously scheduled alarm.
532
533 @item @emph{Option}:
534 gnu
535
536 @item @emph{Class}:
537 subroutine
538
539 @item @emph{Syntax}:
540 @code{CALL ALARM(SECONDS, HANDLER)} 
541 @code{CALL ALARM(SECONDS, HANDLER, STATUS)}
542
543 @item @emph{Arguments}:
544 @multitable @columnfractions .15 .80
545 @item @var{SECONDS} @tab The type of the argument shall be a scalar
546 @code{INTEGER}. It is @code{INTENT(IN)}.
547 @item @var{HANDLER} @tab Signal handler (@code{INTEGER FUNCTION} or
548 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
549 @code{INTEGER}. It is @code{INTENT(IN)}.
550 @item @var{STATUS}  @tab (Optional) @var{STATUS} shall be a scalar
551 @code{INTEGER} variable. It is @code{INTENT(OUT)}.
552 @end multitable
553
554 @item @emph{Example}:
555 @smallexample
556 program test_alarm
557   external handler_print
558   integer i
559   call alarm (3, handler_print, i)
560   print *, i
561   call sleep(10)
562 end program test_alarm
563 @end smallexample
564 This will cause the external routine @var{handler_print} to be called
565 after 3 seconds.
566 @end table
567
568
569
570 @node ALL
571 @section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true 
572 @findex @code{ALL} intrinsic
573 @cindex true values
574
575 @table @asis
576 @item @emph{Description}:
577 @code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}
578 in the array along dimension @var{DIM}.
579
580 @item @emph{Option}:
581 f95, gnu
582
583 @item @emph{Class}:
584 transformational function
585
586 @item @emph{Syntax}:
587 @code{L = ALL(MASK)} 
588 @code{L = ALL(MASK, DIM)}
589
590 @item @emph{Arguments}:
591 @multitable @columnfractions .15 .80
592 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
593 it shall not be scalar.
594 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
595 with a value that lies between one and the rank of @var{MASK}.
596 @end multitable
597
598 @item @emph{Return value}:
599 @code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
600 the kind type parameter is the same as the kind type parameter of
601 @var{MASK}.  If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns
602 an array with the rank of @var{MASK} minus 1.  The shape is determined from
603 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
604
605 @table @asis
606 @item (A)
607 @code{ALL(MASK)} is true if all elements of @var{MASK} are true.
608 It also is true if @var{MASK} has zero size; otherwise, it is false.
609 @item (B)
610 If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent
611 to @code{ALL(MASK)}.  If the rank is greater than one, then @code{ALL(MASK,DIM)}
612 is determined by applying @code{ALL} to the array sections.
613 @end table
614
615 @item @emph{Example}:
616 @smallexample
617 program test_all
618   logical l
619   l = all((/.true., .true., .true./))
620   print *, l
621   call section
622   contains
623     subroutine section
624       integer a(2,3), b(2,3)
625       a = 1
626       b = 1
627       b(2,2) = 2
628       print *, all(a .eq. b, 1)
629       print *, all(a .eq. b, 2)
630     end subroutine section
631 end program test_all
632 @end smallexample
633 @end table
634
635
636
637 @node ALLOCATED
638 @section @code{ALLOCATED} --- Status of an allocatable entity
639 @findex @code{ALLOCATED} intrinsic
640 @cindex allocation status
641
642 @table @asis
643 @item @emph{Description}:
644 @code{ALLOCATED(X)} checks the status of whether @var{X} is allocated.
645
646 @item @emph{Option}:
647 f95, gnu
648
649 @item @emph{Class}:
650 inquiry function
651
652 @item @emph{Syntax}:
653 @code{L = ALLOCATED(X)}
654
655 @item @emph{Arguments}:
656 @multitable @columnfractions .15 .80
657 @item @var{X}    @tab The argument shall be an @code{ALLOCATABLE} array.
658 @end multitable
659
660 @item @emph{Return value}:
661 The return value is a scalar @code{LOGICAL} with the default logical
662 kind type parameter.  If @var{X} is allocated, @code{ALLOCATED(X)}
663 is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.} 
664
665 @item @emph{Example}:
666 @smallexample
667 program test_allocated
668   integer :: i = 4
669   real(4), allocatable :: x(:)
670   if (allocated(x) .eqv. .false.) allocate(x(i)
671 end program test_allocated
672 @end smallexample
673 @end table
674
675
676
677 @node ANINT
678 @section @code{ANINT} --- Imaginary part of complex number  
679 @findex @code{ANINT} intrinsic
680 @findex @code{DNINT} intrinsic
681 @cindex whole number
682
683 @table @asis
684 @item @emph{Description}:
685 @code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.
686
687 @item @emph{Option}:
688 f95, gnu
689
690 @item @emph{Class}:
691 elemental function
692
693 @item @emph{Syntax}:
694 @code{X = ANINT(X)}
695 @code{X = ANINT(X, KIND)}
696
697 @item @emph{Arguments}:
698 @multitable @columnfractions .15 .80
699 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
700 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
701 initialization expression.
702 @end multitable
703
704 @item @emph{Return value}:
705 The return value is of type real with the kind type parameter of the
706 argument if the optional @var{KIND} is absent; otherwise, the kind
707 type parameter will be given by @var{KIND}.  If @var{X} is greater than
708 zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}.  If @var{X} is
709 less than or equal to zero, then return @code{AINT(X-0.5)}.
710
711 @item @emph{Example}:
712 @smallexample
713 program test_anint
714   real(4) x4
715   real(8) x8
716   x4 = 1.234E0_4
717   x8 = 4.321_8
718   print *, anint(x4), dnint(x8)
719   x8 = anint(x4,8)
720 end program test_anint
721 @end smallexample
722
723 @item @emph{Specific names}:
724 @multitable @columnfractions .24 .24 .24 .24
725 @item Name            @tab Argument         @tab Return type      @tab Option
726 @item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab f95, gnu
727 @end multitable
728 @end table
729
730
731
732 @node ANY
733 @section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true 
734 @findex @code{ANY} intrinsic
735 @cindex true values
736
737 @table @asis
738 @item @emph{Description}:
739 @code{ANY(MASK [, DIM])} determines if any of the values in the logical array
740 @var{MASK} along dimension @var{DIM} are @code{.TRUE.}.
741
742 @item @emph{Option}:
743 f95, gnu
744
745 @item @emph{Class}:
746 transformational function
747
748 @item @emph{Syntax}:
749 @code{L = ANY(MASK)} 
750 @code{L = ANY(MASK, DIM)}
751
752 @item @emph{Arguments}:
753 @multitable @columnfractions .15 .80
754 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
755 it shall not be scalar.
756 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
757 with a value that lies between one and the rank of @var{MASK}.
758 @end multitable
759
760 @item @emph{Return value}:
761 @code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
762 the kind type parameter is the same as the kind type parameter of
763 @var{MASK}.  If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns
764 an array with the rank of @var{MASK} minus 1.  The shape is determined from
765 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
766
767 @table @asis
768 @item (A)
769 @code{ANY(MASK)} is true if any element of @var{MASK} is true;
770 otherwise, it is false.  It also is false if @var{MASK} has zero size.
771 @item (B)
772 If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent
773 to @code{ANY(MASK)}.  If the rank is greater than one, then @code{ANY(MASK,DIM)}
774 is determined by applying @code{ANY} to the array sections.
775 @end table
776
777 @item @emph{Example}:
778 @smallexample
779 program test_any
780   logical l
781   l = any((/.true., .true., .true./))
782   print *, l
783   call section
784   contains
785     subroutine section
786       integer a(2,3), b(2,3)
787       a = 1
788       b = 1
789       b(2,2) = 2
790       print *, any(a .eq. b, 1)
791       print *, any(a .eq. b, 2)
792     end subroutine section
793 end program test_any
794 @end smallexample
795 @end table
796
797
798
799 @node ASIN
800 @section @code{ASIN} --- Arcsine function 
801 @findex @code{ASIN} intrinsic
802 @findex @code{DASIN} intrinsic
803 @cindex arcsine
804
805 @table @asis
806 @item @emph{Description}:
807 @code{ASIN(X)} computes the arcsine of its @var{X}.
808
809 @item @emph{Option}:
810 f95, gnu
811
812 @item @emph{Class}:
813 elemental function
814
815 @item @emph{Syntax}:
816 @code{X = ASIN(X)}
817
818 @item @emph{Arguments}:
819 @multitable @columnfractions .15 .80
820 @item @var{X} @tab The type shall be @code{REAL(*)}, and a magnitude that is
821 less than one.
822 @end multitable
823
824 @item @emph{Return value}:
825 The return value is of type @code{REAL(*)} and it lies in the
826 range @math{-\pi / 2 \leq \arccos (x) \leq \pi / 2}.  The kind type
827 parameter is the same as @var{X}.
828
829 @item @emph{Example}:
830 @smallexample
831 program test_asin
832   real(8) :: x = 0.866_8
833   x = asin(x)
834 end program test_asin
835 @end smallexample
836
837 @item @emph{Specific names}:
838 @multitable @columnfractions .24 .24 .24 .24
839 @item Name            @tab Argument          @tab Return type       @tab Option
840 @item @code{DASIN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
841 @end multitable
842 @end table
843
844
845
846 @node ASSOCIATED
847 @section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair 
848 @findex @code{ASSOCIATED} intrinsic
849 @cindex pointer status
850
851 @table @asis
852 @item @emph{Description}:
853 @code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR}
854 or if @var{PTR} is associated with the target @var{TGT}.
855
856 @item @emph{Option}:
857 f95, gnu
858
859 @item @emph{Class}:
860 inquiry function
861
862 @item @emph{Syntax}:
863 @code{L = ASSOCIATED(PTR)} 
864 @code{L = ASSOCIATED(PTR [, TGT])}
865
866 @item @emph{Arguments}:
867 @multitable @columnfractions .15 .80
868 @item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute and
869 it can be of any type.
870 @item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} or
871 a @code{TARGET}.  It must have the same type, kind type parameter, and
872 array rank as @var{PTR}.
873 @end multitable
874 The status of neither @var{PTR} nor @var{TGT} can be undefined.
875
876 @item @emph{Return value}:
877 @code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}.
878 There are several cases:
879 @table @asis
880 @item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)}
881 is true if @var{PTR} is associated with a target; otherwise, it returns false.
882 @item (B) If @var{TGT} is present and a scalar target, the result is true if
883 @var{TGT}
884 is not a 0 sized storage sequence and the target associated with @var{PTR}
885 occupies the same storage units.  If @var{PTR} is disassociated, then the 
886 result is false.
887 @item (C) If @var{TGT} is present and an array target, the result is true if
888 @var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, are
889 arrays whose elements are not 0 sized storage sequences, and @var{TGT} and
890 @var{PTR} occupy the same storage units in array element order.
891 As in case(B), the result is false, if @var{PTR} is disassociated.
892 @item (D) If @var{TGT} is present and an scalar pointer, the result is true if
893 target associated with @var{PTR} and the target associated with @var{TGT}
894 are not 0 sized storage sequences and occupy the same storage units.
895 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
896 @item (E) If @var{TGT} is present and an array pointer, the result is true if
897 target associated with @var{PTR} and the target associated with @var{TGT}
898 have the same shape, are not 0 sized arrays, are arrays whose elements are
899 not 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the same
900 storage units in array element order.
901 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
902 @end table
903
904 @item @emph{Example}:
905 @smallexample
906 program test_associated
907    implicit none
908    real, target  :: tgt(2) = (/1., 2./)
909    real, pointer :: ptr(:)
910    ptr => tgt
911    if (associated(ptr)     .eqv. .false.) call abort
912    if (associated(ptr,tgt) .eqv. .false.) call abort
913 end program test_associated
914 @end smallexample
915 @end table
916
917
918
919 @node ATAN
920 @section @code{ATAN} --- Arctangent function 
921 @findex @code{ATAN} intrinsic
922 @findex @code{DATAN} intrinsic
923 @cindex arctangent
924
925 @table @asis
926 @item @emph{Description}:
927 @code{ATAN(X)} computes the arctangent of @var{X}.
928
929 @item @emph{Option}:
930 f95, gnu
931
932 @item @emph{Class}:
933 elemental function
934
935 @item @emph{Syntax}:
936 @code{X = ATAN(X)}
937
938 @item @emph{Arguments}:
939 @multitable @columnfractions .15 .80
940 @item @var{X} @tab The type shall be @code{REAL(*)}.
941 @end multitable
942
943 @item @emph{Return value}:
944 The return value is of type @code{REAL(*)} and it lies in the
945 range @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}.
946
947 @item @emph{Example}:
948 @smallexample
949 program test_atan
950   real(8) :: x = 2.866_8
951   x = atan(x)
952 end program test_atan
953 @end smallexample
954
955 @item @emph{Specific names}:
956 @multitable @columnfractions .24 .24 .24 .24
957 @item Name            @tab Argument          @tab Return type       @tab Option
958 @item @code{DATAN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
959 @end multitable
960 @end table
961
962
963
964 @node ATAN2
965 @section @code{ATAN2} --- Arctangent function 
966 @findex @code{ATAN2} intrinsic
967 @findex @code{DATAN2} intrinsic
968 @cindex arctangent
969
970 @table @asis
971 @item @emph{Description}:
972 @code{ATAN2(Y,X)} computes the arctangent of the complex number @math{X + i Y}.
973
974 @item @emph{Option}:
975 f95, gnu
976
977 @item @emph{Class}:
978 elemental function
979
980 @item @emph{Syntax}:
981 @code{X = ATAN2(Y,X)}
982
983 @item @emph{Arguments}:
984 @multitable @columnfractions .15 .80
985 @item @var{Y} @tab The type shall be @code{REAL(*)}.
986 @item @var{X} @tab The type and kind type parameter shall be the same as @var{Y}.
987 If @var{Y} is zero, then @var{X} must be nonzero.
988 @end multitable
989
990 @item @emph{Return value}:
991 The return value has the same type and kind type parameter as @var{Y}.
992 It is the principle value of the complex number @math{X + i Y}.  If
993 @var{X} is nonzero, then it lies in the range @math{-\pi \le \arccos (x) \leq \pi}.
994 The sign is positive if @var{Y} is positive.  If @var{Y} is zero, then
995 the return value is zero if @var{X} is positive and @math{\pi} if @var{X}
996 is negative.  Finally, if @var{X} is zero, then the magnitude of the result
997 is @math{\pi/2}.
998
999 @item @emph{Example}:
1000 @smallexample
1001 program test_atan2
1002   real(4) :: x = 1.e0_4, y = 0.5e0_4
1003   x = atan2(y,x)
1004 end program test_atan2
1005 @end smallexample
1006
1007 @item @emph{Specific names}:
1008 @multitable @columnfractions .24 .24 .24 .24
1009 @item Name            @tab Argument          @tab Return type    @tab Option
1010 @item @code{DATAN2(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1011 @end multitable
1012 @end table
1013
1014
1015
1016 @node BESJ0
1017 @section @code{BESJ0} --- Bessel function of the first kind of order 0
1018 @findex @code{BESJ0} intrinsic
1019 @findex @code{DBESJ0} intrinsic
1020 @cindex Bessel
1021
1022 @table @asis
1023 @item @emph{Description}:
1024 @code{BESJ0(X)} computes the Bessel function of the first kind of order 0
1025 of @var{X}.
1026
1027 @item @emph{Option}:
1028 gnu
1029
1030 @item @emph{Class}:
1031 elemental function
1032
1033 @item @emph{Syntax}:
1034 @code{X = BESJ0(X)}
1035
1036 @item @emph{Arguments}:
1037 @multitable @columnfractions .15 .80
1038 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1039 @end multitable
1040
1041 @item @emph{Return value}:
1042 The return value is of type @code{REAL(*)} and it lies in the
1043 range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
1044
1045 @item @emph{Example}:
1046 @smallexample
1047 program test_besj0
1048   real(8) :: x = 0.0_8
1049   x = besj0(x)
1050 end program test_besj0
1051 @end smallexample
1052
1053 @item @emph{Specific names}:
1054 @multitable @columnfractions .24 .24 .24 .24
1055 @item Name            @tab Argument          @tab Return type       @tab Option
1056 @item @code{DBESJ0(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1057 @end multitable
1058 @end table
1059
1060
1061
1062 @node BESJ1
1063 @section @code{BESJ1} --- Bessel function of the first kind of order 1
1064 @findex @code{BESJ1} intrinsic
1065 @findex @code{DBESJ1} intrinsic
1066 @cindex Bessel
1067
1068 @table @asis
1069 @item @emph{Description}:
1070 @code{BESJ1(X)} computes the Bessel function of the first kind of order 1
1071 of @var{X}.
1072
1073 @item @emph{Option}:
1074 gnu
1075
1076 @item @emph{Class}:
1077 elemental function
1078
1079 @item @emph{Syntax}:
1080 @code{X = BESJ1(X)}
1081
1082 @item @emph{Arguments}:
1083 @multitable @columnfractions .15 .80
1084 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1085 @end multitable
1086
1087 @item @emph{Return value}:
1088 The return value is of type @code{REAL(*)} and it lies in the
1089 range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
1090
1091 @item @emph{Example}:
1092 @smallexample
1093 program test_besj1
1094   real(8) :: x = 1.0_8
1095   x = besj1(x)
1096 end program test_besj1
1097 @end smallexample
1098
1099 @item @emph{Specific names}:
1100 @multitable @columnfractions .24 .24 .24 .24
1101 @item Name            @tab Argument          @tab Return type       @tab Option
1102 @item @code{DBESJ1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1103 @end multitable
1104 @end table
1105
1106
1107
1108 @node BESJN
1109 @section @code{BESJN} --- Bessel function of the first kind
1110 @findex @code{BESJN} intrinsic
1111 @findex @code{DBESJN} intrinsic
1112 @cindex Bessel
1113
1114 @table @asis
1115 @item @emph{Description}:
1116 @code{BESJN(N, X)} computes the Bessel function of the first kind of order
1117 @var{N} of @var{X}.
1118
1119 @item @emph{Option}:
1120 gnu
1121
1122 @item @emph{Class}:
1123 elemental function
1124
1125 @item @emph{Syntax}:
1126 @code{Y = BESJN(N, X)}
1127
1128 @item @emph{Arguments}:
1129 @multitable @columnfractions .15 .80
1130 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1131 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1132 @end multitable
1133
1134 @item @emph{Return value}:
1135 The return value is a scalar of type @code{REAL(*)}.
1136
1137 @item @emph{Example}:
1138 @smallexample
1139 program test_besjn
1140   real(8) :: x = 1.0_8
1141   x = besjn(5,x)
1142 end program test_besjn
1143 @end smallexample
1144
1145 @item @emph{Specific names}:
1146 @multitable @columnfractions .24 .24 .24 .24
1147 @item Name             @tab Argument            @tab Return type       @tab Option
1148 @item @code{DBESJN(X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}    @tab gnu
1149 @item                  @tab @code{REAL(8) X}    @tab                   @tab
1150 @end multitable
1151 @end table
1152
1153
1154
1155 @node BESY0
1156 @section @code{BESY0} --- Bessel function of the second kind of order 0
1157 @findex @code{BESY0} intrinsic
1158 @findex @code{DBESY0} intrinsic
1159 @cindex Bessel
1160
1161 @table @asis
1162 @item @emph{Description}:
1163 @code{BESY0(X)} computes the Bessel function of the second kind of order 0
1164 of @var{X}.
1165
1166 @item @emph{Option}:
1167 gnu
1168
1169 @item @emph{Class}:
1170 elemental function
1171
1172 @item @emph{Syntax}:
1173 @code{X = BESY0(X)}
1174
1175 @item @emph{Arguments}:
1176 @multitable @columnfractions .15 .80
1177 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1178 @end multitable
1179
1180 @item @emph{Return value}:
1181 The return value is a scalar of type @code{REAL(*)}.
1182
1183 @item @emph{Example}:
1184 @smallexample
1185 program test_besy0
1186   real(8) :: x = 0.0_8
1187   x = besy0(x)
1188 end program test_besy0
1189 @end smallexample
1190
1191 @item @emph{Specific names}:
1192 @multitable @columnfractions .24 .24 .24 .24
1193 @item Name            @tab Argument          @tab Return type       @tab Option
1194 @item @code{DBESY0(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1195 @end multitable
1196 @end table
1197
1198
1199
1200 @node BESY1
1201 @section @code{BESY1} --- Bessel function of the second kind of order 1
1202 @findex @code{BESY1} intrinsic
1203 @findex @code{DBESY1} intrinsic
1204 @cindex Bessel
1205
1206 @table @asis
1207 @item @emph{Description}:
1208 @code{BESY1(X)} computes the Bessel function of the second kind of order 1
1209 of @var{X}.
1210
1211 @item @emph{Option}:
1212 gnu
1213
1214 @item @emph{Class}:
1215 elemental function
1216
1217 @item @emph{Syntax}:
1218 @code{X = BESY1(X)}
1219
1220 @item @emph{Arguments}:
1221 @multitable @columnfractions .15 .80
1222 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1223 @end multitable
1224
1225 @item @emph{Return value}:
1226 The return value is a scalar of type @code{REAL(*)}.
1227
1228 @item @emph{Example}:
1229 @smallexample
1230 program test_besy1
1231   real(8) :: x = 1.0_8
1232   x = besy1(x)
1233 end program test_besy1
1234 @end smallexample
1235
1236 @item @emph{Specific names}:
1237 @multitable @columnfractions .24 .24 .24 .24
1238 @item Name            @tab Argument          @tab Return type       @tab Option
1239 @item @code{DBESY1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1240 @end multitable
1241 @end table
1242
1243
1244
1245 @node BESYN
1246 @section @code{BESYN} --- Bessel function of the second kind
1247 @findex @code{BESYN} intrinsic
1248 @findex @code{DBESYN} intrinsic
1249 @cindex Bessel
1250
1251 @table @asis
1252 @item @emph{Description}:
1253 @code{BESYN(N, X)} computes the Bessel function of the second kind of order
1254 @var{N} of @var{X}.
1255
1256 @item @emph{Option}:
1257 gnu
1258
1259 @item @emph{Class}:
1260 elemental function
1261
1262 @item @emph{Syntax}:
1263 @code{Y = BESYN(N, X)}
1264
1265 @item @emph{Arguments}:
1266 @multitable @columnfractions .15 .80
1267 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1268 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1269 @end multitable
1270
1271 @item @emph{Return value}:
1272 The return value is a scalar of type @code{REAL(*)}.
1273
1274 @item @emph{Example}:
1275 @smallexample
1276 program test_besyn
1277   real(8) :: x = 1.0_8
1278   x = besyn(5,x)
1279 end program test_besyn
1280 @end smallexample
1281
1282 @item @emph{Specific names}:
1283 @multitable @columnfractions .24 .24 .24 .24
1284 @item Name               @tab Argument            @tab Return type     @tab Option
1285 @item @code{DBESYN(N,X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}  @tab gnu
1286 @item                    @tab @code{REAL(8)    X} @tab                 @tab 
1287 @end multitable
1288 @end table
1289
1290
1291
1292 @node BIT_SIZE
1293 @section @code{BIT_SIZE} --- Bit size inquiry function
1294 @findex @code{BIT_SIZE} intrinsic
1295 @cindex bit_size
1296
1297 @table @asis
1298 @item @emph{Description}:
1299 @code{BIT_SIZE(I)} returns the number of bits (integer precision plus sign bit)
1300 represented by the type of @var{I}.
1301
1302 @item @emph{Option}:
1303 f95, gnu
1304
1305 @item @emph{Class}:
1306 elemental function
1307
1308 @item @emph{Syntax}:
1309 @code{I = BIT_SIZE(I)}
1310
1311 @item @emph{Arguments}:
1312 @multitable @columnfractions .15 .80
1313 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1314 @end multitable
1315
1316 @item @emph{Return value}:
1317 The return value is of type @code{INTEGER(*)}
1318
1319 @item @emph{Example}:
1320 @smallexample
1321 program test_bit_size
1322     integer :: i = 123
1323     integer :: size
1324     size = bit_size(i)
1325     print *, size
1326 end program test_bit_size
1327 @end smallexample
1328 @end table
1329
1330
1331
1332 @node BTEST
1333 @section @code{BTEST} --- Bit test function
1334 @findex @code{BTEST} intrinsic
1335 @cindex BTEST
1336
1337 @table @asis
1338 @item @emph{Description}:
1339 @code{BTEST(I,POS)} returns logical @code{.TRUE.} if the bit at @var{POS}
1340 in @var{I} is set.
1341
1342 @item @emph{Option}:
1343 f95, gnu
1344
1345 @item @emph{Class}:
1346 elemental function
1347
1348 @item @emph{Syntax}:
1349 @code{I = BTEST(I,POS)}
1350
1351 @item @emph{Arguments}:
1352 @multitable @columnfractions .15 .80
1353 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1354 @item @var{POS} @tab The type shall be @code{INTEGER(*)}.
1355 @end multitable
1356
1357 @item @emph{Return value}:
1358 The return value is of type @code{LOGICAL}
1359
1360 @item @emph{Example}:
1361 @smallexample
1362 program test_btest
1363     integer :: i = 32768 + 1024 + 64
1364     integer :: pos
1365     logical :: bool
1366     do pos=0,16
1367         bool = btest(i, pos) 
1368         print *, pos, bool
1369     end do
1370 end program test_btest
1371 @end smallexample
1372 @end table
1373
1374
1375
1376 @node CEILING
1377 @section @code{CEILING} --- Integer ceiling function
1378 @findex @code{CEILING} intrinsic
1379 @cindex CEILING
1380
1381 @table @asis
1382 @item @emph{Description}:
1383 @code{CEILING(X)} returns the least integer greater than or equal to @var{X}.
1384
1385 @item @emph{Option}:
1386 f95, gnu
1387
1388 @item @emph{Class}:
1389 elemental function
1390
1391 @item @emph{Syntax}:
1392 @code{I = CEILING(X[,KIND])}
1393
1394 @item @emph{Arguments}:
1395 @multitable @columnfractions .15 .80
1396 @item @var{X} @tab The type shall be @code{REAL(*)}.
1397 @item @var{KIND} @tab Optional scaler integer initialization expression.
1398 @end multitable
1399
1400 @item @emph{Return value}:
1401 The return value is of type @code{INTEGER(KIND)}
1402
1403 @item @emph{Example}:
1404 @smallexample
1405 program test_ceiling
1406     real :: x = 63.29
1407     real :: y = -63.59
1408     print *, ceiling(x) ! returns 64
1409     print *, ceiling(y) ! returns -63
1410 end program test_ceiling
1411 @end smallexample
1412 @end table
1413
1414
1415
1416 @node CHAR
1417 @section @code{CHAR} --- Character conversion function
1418 @findex @code{CHAR} intrinsic
1419 @cindex CHAR
1420
1421 @table @asis
1422 @item @emph{Description}:
1423 @code{CHAR(I,[KIND])} returns the character represented by the integer @var{I}.
1424
1425 @item @emph{Option}:
1426 f95, gnu
1427
1428 @item @emph{Class}:
1429 elemental function
1430
1431 @item @emph{Syntax}:
1432 @code{C = CHAR(I[,KIND])}
1433
1434 @item @emph{Arguments}:
1435 @multitable @columnfractions .15 .80
1436 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1437 @item @var{KIND} @tab Optional scaler integer initialization expression.
1438 @end multitable
1439
1440 @item @emph{Return value}:
1441 The return value is of type @code{CHARACTER(1)}
1442
1443 @item @emph{Example}:
1444 @smallexample
1445 program test_char
1446     integer :: i = 74
1447     character(1) :: c
1448     c = char(i)
1449     print *, i, c ! returns 'J'
1450 end program test_char
1451 @end smallexample
1452 @end table
1453
1454
1455
1456 @node CMPLX
1457 @section @code{CMPLX} --- Complex conversion function
1458 @findex @code{CMPLX} intrinsic
1459 @cindex CMPLX
1460
1461 @table @asis
1462 @item @emph{Description}:
1463 @code{CMPLX(X,[Y,KIND])} returns a complex number where @var{X} is converted to
1464 the real component.  If @var{Y} is present it is converted to the imaginary
1465 component.  If @var{Y} is not present then the imaginary component is set to
1466 0.0.  If @var{X} is complex then @var{Y} must not be present.
1467
1468 @item @emph{Option}:
1469 f95, gnu
1470
1471 @item @emph{Class}:
1472 elemental function
1473
1474 @item @emph{Syntax}:
1475 @code{C = CMPLX(X[,Y,KIND])}
1476
1477 @item @emph{Arguments}:
1478 @multitable @columnfractions .15 .80
1479 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1480 @item @var{Y} @tab Optional, allowed if @var{X} is not @code{COMPLEX(*)}.  May be @code{INTEGER(*)} or @code{REAL(*)}. 
1481 @item @var{KIND} @tab Optional scaler integer initialization expression.
1482 @end multitable
1483
1484 @item @emph{Return value}:
1485 The return value is of type @code{COMPLEX(*)}
1486
1487 @item @emph{Example}:
1488 @smallexample
1489 program test_cmplx
1490     integer :: i = 42
1491     real :: x = 3.14
1492     complex :: z
1493     z = cmplx(i, x)
1494     print *, z, cmplx(x)
1495 end program test_cmplx
1496 @end smallexample
1497 @end table
1498
1499
1500
1501 @node COMMAND_ARGUMENT_COUNT
1502 @section @code{COMMAND_ARGUMENT_COUNT} --- Argument count function 
1503 @findex @code{COMMAND_ARGUMENT_COUNT} intrinsic
1504 @cindex command argument count
1505
1506 @table @asis
1507 @item @emph{Description}:
1508 @code{COMMAND_ARGUMENT_COUNT()} returns the number of arguments passed on the
1509 command line when the containing program was invoked.
1510
1511 @item @emph{Option}:
1512 f2003, gnu
1513
1514 @item @emph{Class}:
1515 non-elemental function
1516
1517 @item @emph{Syntax}:
1518 @code{I = COMMAND_ARGUMENT_COUNT()}
1519
1520 @item @emph{Arguments}:
1521 @multitable @columnfractions .15 .80
1522 @item None
1523 @end multitable
1524
1525 @item @emph{Return value}:
1526 The return value is of type @code{INTEGER(4)}
1527
1528 @item @emph{Example}:
1529 @smallexample
1530 program test_command_argument_count
1531     integer :: count
1532     count = command_argument_count()
1533     print *, count
1534 end program test_command_argument_count
1535 @end smallexample
1536 @end table
1537
1538
1539
1540 @node CONJG
1541 @section @code{CONJG} --- Complex conjugate function 
1542 @findex @code{CONJG} intrinsic
1543 @findex @code{DCONJG} intrinsic
1544 @cindex complex conjugate
1545 @table @asis
1546 @item @emph{Description}:
1547 @code{CONJG(Z)} returns the conjugate of @var{Z}.  If @var{Z} is @code{(x, y)}
1548 then the result is @code{(x, -y)}
1549
1550 @item @emph{Option}:
1551 f95, gnu
1552
1553 @item @emph{Class}:
1554 elemental function
1555
1556 @item @emph{Syntax}:
1557 @code{Z = CONJG(Z)}
1558
1559 @item @emph{Arguments}:
1560 @multitable @columnfractions .15 .80
1561 @item @var{Z} @tab The type shall be @code{COMPLEX(*)}.
1562 @end multitable
1563
1564 @item @emph{Return value}:
1565 The return value is of type @code{COMPLEX(*)}.
1566
1567 @item @emph{Example}:
1568 @smallexample
1569 program test_conjg
1570     complex :: z = (2.0, 3.0)
1571     complex(8) :: dz = (2.71_8, -3.14_8)
1572     z= conjg(z)
1573     print *, z
1574     dz = dconjg(dz)
1575     print *, dz
1576 end program test_conjg
1577 @end smallexample
1578
1579 @item @emph{Specific names}:
1580 @multitable @columnfractions .24 .24 .24 .24
1581 @item Name             @tab Argument             @tab Return type          @tab Option
1582 @item @code{DCONJG(Z)} @tab @code{COMPLEX(8) Z}  @tab @code{COMPLEX(8)}    @tab gnu
1583 @end multitable
1584 @end table
1585
1586
1587
1588 @node COS
1589 @section @code{COS} --- Cosine function 
1590 @findex @code{COS} intrinsic
1591 @findex @code{DCOS} intrinsic
1592 @findex @code{ZCOS} intrinsic
1593 @findex @code{CDCOS} intrinsic
1594 @cindex cosine
1595
1596 @table @asis
1597 @item @emph{Description}:
1598 @code{COS(X)} computes the cosine of @var{X}.
1599
1600 @item @emph{Option}:
1601 f95, gnu
1602
1603 @item @emph{Class}:
1604 elemental function
1605
1606 @item @emph{Syntax}:
1607 @code{X = COS(X)}
1608
1609 @item @emph{Arguments}:
1610 @multitable @columnfractions .15 .80
1611 @item @var{X} @tab The type shall be @code{REAL(*)} or
1612 @code{COMPLEX(*)}.
1613 @end multitable
1614
1615 @item @emph{Return value}:
1616 The return value has the same type and kind as @var{X}.
1617
1618 @item @emph{Example}:
1619 @smallexample
1620 program test_cos
1621   real :: x = 0.0
1622   x = cos(x)
1623 end program test_cos
1624 @end smallexample
1625
1626 @item @emph{Specific names}:
1627 @multitable @columnfractions .24 .24 .24 .24
1628 @item Name            @tab Argument          @tab Return type     @tab Option
1629 @item @code{DCOS(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}  @tab f95, gnu
1630 @item @code{CCOS(X)}@tab @code{COMPLEX(4) X}@tab @code{COMPLEX(4)}@tab f95, gnu
1631 @item @code{ZCOS(X)}@tab @code{COMPLEX(8) X}@tab @code{COMPLEX(8)}@tab f95, gnu
1632 @item @code{CDCOS(X)}@tab @code{COMPLEX(8) X}@tab @code{COMPLEX(8)}@tab f95, gnu
1633 @end multitable
1634 @end table
1635
1636
1637
1638 @node COSH
1639 @section @code{COSH} --- Hyperbolic cosine function 
1640 @findex @code{COSH} intrinsic
1641 @findex @code{DCOSH} intrinsic
1642 @cindex hyperbolic cosine
1643
1644 @table @asis
1645 @item @emph{Description}:
1646 @code{COSH(X)} computes the hyperbolic cosine of @var{X}.
1647
1648 @item @emph{Option}:
1649 f95, gnu
1650
1651 @item @emph{Class}:
1652 elemental function
1653
1654 @item @emph{Syntax}:
1655 @code{X = COSH(X)}
1656
1657 @item @emph{Arguments}:
1658 @multitable @columnfractions .15 .80
1659 @item @var{X} @tab The type shall be @code{REAL(*)}.
1660 @end multitable
1661
1662 @item @emph{Return value}:
1663 The return value is of type @code{REAL(*)} and it is positive
1664 (@math{ \cosh (x) \geq 0 }.
1665
1666 @item @emph{Example}:
1667 @smallexample
1668 program test_cosh
1669   real(8) :: x = 1.0_8
1670   x = cosh(x)
1671 end program test_cosh
1672 @end smallexample
1673
1674 @item @emph{Specific names}:
1675 @multitable @columnfractions .24 .24 .24 .24
1676 @item Name            @tab Argument          @tab Return type       @tab Option
1677 @item @code{DCOSH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1678 @end multitable
1679 @end table
1680
1681
1682
1683 @node COUNT
1684 @section @code{COUNT} --- Count function
1685 @findex @code{COUNT} intrinsic
1686 @cindex count
1687
1688 @table @asis
1689 @item @emph{Description}:
1690 @code{COUNT(MASK[,DIM])} counts the number of @code{.TRUE.} elements of
1691 @var{MASK} along the dimension of @var{DIM}.  If @var{DIM} is omitted it is
1692 taken to be @code{1}.  @var{DIM} is a scaler of type @code{INTEGER} in the
1693 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{MASK}.
1694
1695 @item @emph{Option}:
1696 f95, gnu
1697
1698 @item @emph{Class}:
1699 transformational function
1700
1701 @item @emph{Syntax}:
1702 @code{I = COUNT(MASK[,DIM])}
1703
1704 @item @emph{Arguments}:
1705 @multitable @columnfractions .15 .80
1706 @item @var{MASK} @tab The type shall be @code{LOGICAL}.
1707 @item @var{DIM}  @tab The type shall be @code{INTEGER}.
1708 @end multitable
1709
1710 @item @emph{Return value}:
1711 The return value is of type @code{INTEGER} with rank equal to that of
1712 @var{MASK}.
1713
1714 @item @emph{Example}:
1715 @smallexample
1716 program test_count
1717     integer, dimension(2,3) :: a, b
1718     logical, dimension(2,3) :: mask
1719     a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
1720     b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
1721     print '(3i3)', a(1,:)
1722     print '(3i3)', a(2,:)
1723     print *
1724     print '(3i3)', b(1,:)
1725     print '(3i3)', b(2,:)
1726     print *
1727     mask = a.ne.b
1728     print '(3l3)', mask(1,:)
1729     print '(3l3)', mask(2,:)
1730     print *
1731     print '(3i3)', count(mask)
1732     print *
1733     print '(3i3)', count(mask, 1)
1734     print *
1735     print '(3i3)', count(mask, 2)
1736 end program test_count
1737 @end smallexample
1738 @end table
1739
1740
1741
1742 @node CPU_TIME
1743 @section @code{CPU_TIME} --- CPU elapsed time in seconds
1744 @findex @code{CPU_TIME} intrinsic
1745 @cindex CPU_TIME
1746
1747 @table @asis
1748 @item @emph{Description}:
1749 Returns a @code{REAL} value representing the elapsed CPU time in seconds.  This
1750 is useful for testing segments of code to determine execution time.
1751
1752 @item @emph{Option}:
1753 f95, gnu
1754
1755 @item @emph{Class}:
1756 subroutine
1757
1758 @item @emph{Syntax}:
1759 @code{CPU_TIME(X)}
1760
1761 @item @emph{Arguments}:
1762 @multitable @columnfractions .15 .80
1763 @item @var{X} @tab The type shall be @code{REAL} with @code{INTENT(OUT)}.
1764 @end multitable
1765
1766 @item @emph{Return value}:
1767 None
1768
1769 @item @emph{Example}:
1770 @smallexample
1771 program test_cpu_time
1772     real :: start, finish
1773     call cpu_time(start)
1774         ! put code to test here
1775     call cpu_time(finish)
1776     print '("Time = ",f6.3," seconds.")',finish-start
1777 end program test_cpu_time
1778 @end smallexample
1779 @end table
1780
1781
1782
1783 @node CSHIFT
1784 @section @code{CSHIFT} --- Circular shift function
1785 @findex @code{CSHIFT} intrinsic
1786 @cindex cshift intrinsic
1787
1788 @table @asis
1789 @item @emph{Description}:
1790 @code{CSHIFT(ARRAY, SHIFT[,DIM])} performs a circular shift on elements of
1791 @var{ARRAY} along the dimension of @var{DIM}.  If @var{DIM} is omitted it is
1792 taken to be @code{1}.  @var{DIM} is a scaler of type @code{INTEGER} in the
1793 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{ARRAY}.
1794 If the rank of @var{ARRAY} is one, then all elements of @var{ARRAY} are shifted
1795 by @var{SHIFT} places.  If rank is greater than one, then all complete rank one
1796 sections of @var{ARRAY} along the given dimension are shifted.  Elements
1797 shifted out one end of each rank one section are shifted back in the other end.
1798
1799 @item @emph{Option}:
1800 f95, gnu
1801
1802 @item @emph{Class}:
1803 transformational function
1804
1805 @item @emph{Syntax}:
1806 @code{A = CSHIFT(A, SHIFT[,DIM])}
1807
1808 @item @emph{Arguments}:
1809 @multitable @columnfractions .15 .80
1810 @item @var{ARRAY}  @tab May be any type, not scaler.
1811 @item @var{SHIFT}  @tab The type shall be @code{INTEGER}.
1812 @item @var{DIM}    @tab The type shall be @code{INTEGER}.
1813 @end multitable
1814
1815 @item @emph{Return value}:
1816 Returns an array of same type and rank as the @var{ARRAY} argument.
1817
1818 @item @emph{Example}:
1819 @smallexample
1820 program test_cshift
1821     integer, dimension(3,3) :: a
1822     a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
1823     print '(3i3)', a(1,:)
1824     print '(3i3)', a(2,:)
1825     print '(3i3)', a(3,:)    
1826     a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
1827     print *
1828     print '(3i3)', a(1,:)
1829     print '(3i3)', a(2,:)
1830     print '(3i3)', a(3,:)
1831 end program test_cshift
1832 @end smallexample
1833 @end table
1834
1835
1836
1837 @node DATE_AND_TIME
1838 @section @code{DATE_AND_TIME} --- Date and time subroutine
1839 @findex @code{DATE_AND_TIME} intrinsic
1840 @cindex DATE_AND_TIME
1841
1842 @table @asis
1843 @item @emph{Description}:
1844 @code{DATE_AND_TIME(DATE, TIME, ZONE, VALUES)} gets the corresponding date and
1845 time information from the real-time system clock.  @var{DATE} is
1846 @code{INTENT(OUT)} and has form ccyymmdd.  @var{TIME} is @code{INTENT(OUT)} and
1847 has form hhmmss.sss.  @var{ZONE} is @code{INTENT(OUT)} and has form (+-)hhmm,
1848 representing the difference with respect to Coordinated Universal Time (UTC).
1849 Unavailable time and date parameters return blanks.
1850
1851 @var{VALUES} is @code{INTENT(OUT)} and provides the following:
1852
1853 @multitable @columnfractions .15 .30 .60
1854 @item @tab @code{VALUE(1)}: @tab The year
1855 @item @tab @code{VALUE(2)}: @tab The month
1856 @item @tab @code{VALUE(3)}: @tab The day of the month
1857 @item @tab @code{VAlUE(4)}: @tab Time difference with UTC in minutes
1858 @item @tab @code{VALUE(5)}: @tab The hour of the day
1859 @item @tab @code{VALUE(6)}: @tab The minutes of the hour
1860 @item @tab @code{VALUE(7)}: @tab The seconds of the minute
1861 @item @tab @code{VALUE(8)}: @tab The milliseconds of the second
1862 @end multitable     
1863
1864 @item @emph{Option}:
1865 f95, gnu
1866
1867 @item @emph{Class}:
1868 subroutine
1869
1870 @item @emph{Syntax}:
1871 @code{CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])}
1872
1873 @item @emph{Arguments}:
1874 @multitable @columnfractions .15 .80
1875 @item @var{DATE}  @tab (Optional) The type shall be @code{CHARACTER(8)} or larger.
1876 @item @var{TIME}  @tab (Optional) The type shall be @code{CHARACTER(10)} or larger.
1877 @item @var{ZONE}  @tab (Optional) The type shall be @code{CHARACTER(5)} or larger.
1878 @item @var{VALUES}@tab (Optional) The type shall be @code{INTEGER(8)}.
1879 @end multitable
1880
1881 @item @emph{Return value}:
1882 None
1883
1884 @item @emph{Example}:
1885 @smallexample
1886 program test_time_and_date
1887     character(8)  :: date
1888     character(10) :: time
1889     character(5)  :: zone
1890     integer,dimension(8) :: values
1891     ! using keyword arguments
1892     call date_and_time(date,time,zone,values)
1893     call date_and_time(DATE=date,ZONE=zone)
1894     call date_and_time(TIME=time)
1895     call date_and_time(VALUES=values)
1896     print '(a,2x,a,2x,a)', date, time, zone
1897     print '(8i5))', values
1898 end program test_time_and_date
1899 @end smallexample
1900 @end table
1901
1902
1903
1904 @node DBLE
1905 @section @code{DBLE} --- Double conversion function 
1906 @findex @code{DBLE} intrinsic
1907 @cindex double conversion
1908
1909 @table @asis
1910 @item @emph{Description}:
1911 @code{DBLE(X)} Converts @var{X} to double precision real type.
1912 @code{DFLOAT} is an alias for @code{DBLE}
1913
1914 @item @emph{Option}:
1915 f95, gnu
1916
1917 @item @emph{Class}:
1918 elemental function
1919
1920 @item @emph{Syntax}:
1921 @code{X = DBLE(X)}
1922 @code{X = DFLOAT(X)}
1923
1924 @item @emph{Arguments}:
1925 @multitable @columnfractions .15 .80
1926 @item @var{X} @tab The type shall be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1927 @end multitable
1928
1929 @item @emph{Return value}:
1930 The return value is of type double precision real.
1931
1932 @item @emph{Example}:
1933 @smallexample
1934 program test_dble
1935     real    :: x = 2.18
1936     integer :: i = 5
1937     complex :: z = (2.3,1.14)
1938     print *, dble(x), dble(i), dfloat(z)
1939 end program test_dble
1940 @end smallexample
1941 @end table
1942
1943
1944
1945 @node DCMPLX
1946 @section @code{DCMPLX} --- Double complex conversion function
1947 @findex @code{DCMPLX} intrinsic
1948 @cindex DCMPLX
1949
1950 @table @asis
1951 @item @emph{Description}:
1952 @code{DCMPLX(X [,Y])} returns a double complex number where @var{X} is
1953 converted to the real component.  If @var{Y} is present it is converted to the
1954 imaginary component.  If @var{Y} is not present then the imaginary component is
1955 set to 0.0.  If @var{X} is complex then @var{Y} must not be present.
1956
1957 @item @emph{Option}:
1958 f95, gnu
1959
1960 @item @emph{Class}:
1961 elemental function
1962
1963 @item @emph{Syntax}:
1964 @code{C = DCMPLX(X)}
1965 @code{C = DCMPLX(X,Y)}
1966
1967 @item @emph{Arguments}:
1968 @multitable @columnfractions .15 .80
1969 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1970 @item @var{Y} @tab Optional if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}. 
1971 @end multitable
1972
1973 @item @emph{Return value}:
1974 The return value is of type @code{COMPLEX(8)}
1975
1976 @item @emph{Example}:
1977 @smallexample
1978 program test_dcmplx
1979     integer :: i = 42
1980     real :: x = 3.14
1981     complex :: z
1982     z = cmplx(i, x)
1983     print *, dcmplx(i)
1984     print *, dcmplx(x)
1985     print *, dcmplx(z)
1986     print *, dcmplx(x,i)
1987 end program test_dcmplx
1988 @end smallexample
1989 @end table
1990
1991
1992
1993 @node DFLOAT
1994 @section @code{DFLOAT} --- Double conversion function 
1995 @findex @code{DFLOAT} intrinsic
1996 @cindex double float conversion
1997
1998 @table @asis
1999 @item @emph{Description}:
2000 @code{DFLOAT(X)} Converts @var{X} to double precision real type.
2001 @code{DFLOAT} is an alias for @code{DBLE}.  See @code{DBLE}.
2002 @end table
2003
2004
2005
2006 @node DIGITS
2007 @section @code{DIGITS} --- Significant digits function
2008 @findex @code{DIGITS} intrinsic
2009 @cindex digits, significant
2010
2011 @table @asis
2012 @item @emph{Description}:
2013 @code{DIGITS(X)} returns the number of significant digits of the internal model
2014 representation of @var{X}.  For example, on a system using a 32-bit
2015 floating point representation, a default real number would likely return 24.
2016
2017 @item @emph{Option}:
2018 f95, gnu
2019
2020 @item @emph{Class}:
2021 inquiry function
2022
2023 @item @emph{Syntax}:
2024 @code{C = DIGITS(X)}
2025
2026 @item @emph{Arguments}:
2027 @multitable @columnfractions .15 .80
2028 @item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
2029 @end multitable
2030
2031 @item @emph{Return value}:
2032 The return value is of type @code{INTEGER}.
2033
2034 @item @emph{Example}:
2035 @smallexample
2036 program test_digits
2037     integer :: i = 12345
2038     real :: x = 3.143
2039     real(8) :: y = 2.33
2040     print *, digits(i)
2041     print *, digits(x)
2042     print *, digits(y)
2043 end program test_digits
2044 @end smallexample
2045 @end table
2046
2047
2048
2049 @node DIM
2050 @section @code{DIM} --- Dim function
2051 @findex @code{DIM} intrinsic
2052 @findex @code{IDIM} intrinsic
2053 @findex @code{DDIM} intrinsic
2054 @cindex dim
2055
2056 @table @asis
2057 @item @emph{Description}:
2058 @code{DIM(X,Y)} returns the difference @code{X-Y} if the result is positive;
2059 otherwise returns zero.
2060
2061 @item @emph{Option}:
2062 f95, gnu
2063
2064 @item @emph{Class}:
2065 elemental function
2066
2067 @item @emph{Syntax}:
2068 @code{X = DIM(X,Y)}
2069
2070 @item @emph{Arguments}:
2071 @multitable @columnfractions .15 .80
2072 @item @var{X} @tab The type shall be @code{INTEGER(*)} or @code{REAL(*)}
2073 @item @var{Y} @tab The type shall be the same type and kind as @var{X}.
2074 @end multitable
2075
2076 @item @emph{Return value}:
2077 The return value is of type @code{INTEGER(*)} or @code{REAL(*)}.
2078
2079 @item @emph{Example}:
2080 @smallexample
2081 program test_dim
2082     integer :: i
2083     real(8) :: x
2084     i = dim(4, 15)
2085     x = dim(4.345_8, 2.111_8)
2086     print *, i
2087     print *, x
2088 end program test_dim
2089 @end smallexample
2090
2091 @item @emph{Specific names}:
2092 @multitable @columnfractions .24 .24 .24 .24
2093 @item Name            @tab Argument          @tab Return type       @tab Option
2094 @item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X,Y} @tab @code{INTEGER(4)} @tab gnu
2095 @item @code{DDIM(X,Y)} @tab @code{REAL(8) X,Y}  @tab @code{REAL(8)} @tab gnu
2096 @end multitable
2097 @end table
2098
2099
2100
2101 @node DOT_PRODUCT
2102 @section @code{DOT_PRODUCT} --- Dot product function
2103 @findex @code{DOT_PRODUCT} intrinsic
2104 @cindex Dot product
2105
2106 @table @asis
2107 @item @emph{Description}:
2108 @code{DOT_PRODUCT(X,Y)} computes the dot product multiplication of two vectors
2109 @var{X} and @var{Y}.  The two vectors may be either numeric or logical
2110 and must be arrays of rank one and of equal size. If the vectors are
2111 @code{INTEGER(*)} or @code{REAL(*)}, the result is @code{SUM(X*Y)}. If the
2112 vectors are @code{COMPLEX(*)}, the result is @code{SUM(CONJG(X)*Y)}. If the 
2113 vectors are @code{LOGICAL}, the result is @code{ANY(X.AND.Y)}.
2114
2115 @item @emph{Option}:
2116 f95
2117
2118 @item @emph{Class}:
2119 transformational function
2120
2121 @item @emph{Syntax}:
2122 @code{S = DOT_PRODUCT(X,Y)}
2123
2124 @item @emph{Arguments}:
2125 @multitable @columnfractions .15 .80
2126 @item @var{X} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2127 @item @var{Y} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2128 @end multitable
2129
2130 @item @emph{Return value}:
2131 If the arguments are numeric, the return value is a scaler of numeric type,
2132 @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.  If the arguments are
2133 @code{LOGICAL}, the return value is @code{.TRUE.} or @code{.FALSE.}.
2134
2135 @item @emph{Example}:
2136 @smallexample
2137 program test_dot_prod
2138     integer, dimension(3) :: a, b
2139     a = (/ 1, 2, 3 /)
2140     b = (/ 4, 5, 6 /)
2141     print '(3i3)', a
2142     print *
2143     print '(3i3)', b
2144     print *
2145     print *, dot_product(a,b)
2146 end program test_dot_prod
2147 @end smallexample
2148 @end table
2149
2150
2151
2152 @node DPROD
2153 @section @code{DPROD} --- Double product function
2154 @findex @code{DPROD} intrinsic
2155 @cindex Double product
2156
2157 @table @asis
2158 @item @emph{Description}:
2159 @code{DPROD(X,Y)} returns the product @code{X*Y}.
2160
2161 @item @emph{Option}:
2162 f95, gnu
2163
2164 @item @emph{Class}:
2165 elemental function
2166
2167 @item @emph{Syntax}:
2168 @code{D = DPROD(X,Y)}
2169
2170 @item @emph{Arguments}:
2171 @multitable @columnfractions .15 .80
2172 @item @var{X} @tab The type shall be @code{REAL}.
2173 @item @var{Y} @tab The type shall be @code{REAL}.
2174 @end multitable
2175
2176 @item @emph{Return value}:
2177 The return value is of type @code{REAL(8)}.
2178
2179 @item @emph{Example}:
2180 @smallexample
2181 program test_dprod
2182     integer :: i
2183     real :: x = 5.2
2184     real :: y = 2.3
2185     real(8) :: d
2186     d = dprod(x,y)
2187     print *, d
2188 end program test_dprod
2189 @end smallexample
2190 @end table
2191
2192
2193
2194 @node DREAL
2195 @section @code{DREAL} --- Double real part function
2196 @findex @code{DREAL} intrinsic
2197 @cindex Double real part
2198
2199 @table @asis
2200 @item @emph{Description}:
2201 @code{DREAL(Z)} returns the real part of complex variable @var{Z}.
2202
2203 @item @emph{Option}:
2204 gnu
2205
2206 @item @emph{Class}:
2207 elemental function
2208
2209 @item @emph{Syntax}:
2210 @code{D = DREAL(Z)}
2211
2212 @item @emph{Arguments}:
2213 @multitable @columnfractions .15 .80
2214 @item @var{Z} @tab The type shall be @code{COMPLEX(8)}.
2215 @end multitable
2216
2217 @item @emph{Return value}:
2218 The return value is of type @code{REAL(8)}.
2219
2220 @item @emph{Example}:
2221 @smallexample
2222 program test_dreal
2223     complex(8) :: z = (1.3_8,7.2_8)
2224     print *, dreal(z)
2225 end program test_dreal
2226 @end smallexample
2227 @end table
2228
2229
2230
2231 @node DTIME
2232 @section @code{DTIME} --- Execution time subroutine (or function)
2233 @findex @code{DTIME} intrinsic
2234 @cindex dtime subroutine 
2235
2236 @table @asis
2237 @item @emph{Description}:
2238 @code{DTIME(TARRAY, RESULT)} initially returns the number of seconds of runtime
2239 since the start of the process's execution in @var{RESULT}.  @var{TARRAY}
2240 returns the user and system components of this time in @code{TARRAY(1)} and
2241 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) +
2242 TARRAY(2)}.
2243
2244 Subsequent invocations of @code{DTIME} return values accumulated since the
2245 previous invocation.
2246
2247 On some systems, the underlying timings are represented using types with
2248 sufficiently small limits that overflows (wraparounds) are possible, such as
2249 32-bit types. Therefore, the values returned by this intrinsic might be, or
2250 become, negative, or numerically less than previous values, during a single
2251 run of the compiled program.
2252
2253 If @code{DTIME} is invoked as a function, it can not be invoked as a
2254 subroutine, and vice versa.
2255
2256 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2257
2258 @multitable @columnfractions .15 .30 .60
2259 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2260 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2261 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2262 @end multitable
2263
2264 @item @emph{Option}:
2265 gnu
2266
2267 @item @emph{Class}:
2268 subroutine
2269
2270 @item @emph{Syntax}:
2271 @multitable @columnfractions .80
2272 @item @code{CALL DTIME(TARRAY, RESULT)}.
2273 @item @code{RESULT = DTIME(TARRAY)}, (not recommended).
2274 @end multitable
2275
2276 @item @emph{Arguments}:
2277 @multitable @columnfractions .15 .80
2278 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2279 @item @var{RESULT}@tab The type shall be @code{REAL}.
2280 @end multitable
2281
2282 @item @emph{Return value}:
2283 Elapsed time in seconds since the start of program execution.
2284
2285 @item @emph{Example}:
2286 @smallexample
2287 program test_dtime
2288     integer(8) :: i, j
2289     real, dimension(2) :: tarray
2290     real :: result
2291     call dtime(tarray, result)
2292     print *, result
2293     print *, tarray(1)
2294     print *, tarray(2)   
2295     do i=1,100000000    ! Just a delay
2296         j = i * i - i
2297     end do
2298     call dtime(tarray, result)
2299     print *, result
2300     print *, tarray(1)
2301     print *, tarray(2)
2302 end program test_dtime
2303 @end smallexample
2304 @end table
2305
2306
2307
2308 @node EOSHIFT
2309 @section @code{EOSHIFT} --- End-off shift function
2310 @findex @code{EOSHIFT} intrinsic
2311 @cindex eoshift intrinsic
2312
2313 @table @asis
2314 @item @emph{Description}:
2315 @code{EOSHIFT(ARRAY, SHIFT[,BOUNDARY, DIM])} performs an end-off shift on
2316 elements of @var{ARRAY} along the dimension of @var{DIM}.  If @var{DIM} is
2317 omitted it is taken to be @code{1}.  @var{DIM} is a scaler of type
2318 @code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is the
2319 rank of @var{ARRAY}.  If the rank of @var{ARRAY} is one, then all elements of
2320 @var{ARRAY} are shifted by @var{SHIFT} places.  If rank is greater than one,
2321 then all complete rank one sections of @var{ARRAY} along the given dimension are
2322 shifted.  Elements shifted out one end of each rank one section are dropped.  If
2323 @var{BOUNDARY} is present then the corresponding value of from @var{BOUNDARY}
2324 is copied back in the other end.  If @var{BOUNDARY} is not present then the
2325 following are copied in depending on the type of @var{ARRAY}.
2326
2327 @multitable @columnfractions .15 .80
2328 @item @emph{Array Type} @tab @emph{Boundary Value}
2329 @item Numeric  @tab 0 of the type and kind of @var{ARRAY}.
2330 @item Logical  @tab @code{.FALSE.}.
2331 @item Character(@var{len}) @tab @var{len} blanks.
2332 @end multitable
2333
2334 @item @emph{Option}:
2335 f95, gnu
2336
2337 @item @emph{Class}:
2338 transformational function
2339
2340 @item @emph{Syntax}:
2341 @code{A = EOSHIFT(A, SHIFT[,BOUNDARY, DIM])}
2342
2343 @item @emph{Arguments}:
2344 @multitable @columnfractions .15 .80
2345 @item @var{ARRAY}  @tab May be any type, not scaler.
2346 @item @var{SHIFT}  @tab The type shall be @code{INTEGER}.
2347 @item @var{BOUNDARY} @tab Same type as @var{ARRAY}. 
2348 @item @var{DIM}    @tab The type shall be @code{INTEGER}.
2349 @end multitable
2350
2351 @item @emph{Return value}:
2352 Returns an array of same type and rank as the @var{ARRAY} argument.
2353
2354 @item @emph{Example}:
2355 @smallexample
2356 program test_eoshift
2357     integer, dimension(3,3) :: a
2358     a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2359     print '(3i3)', a(1,:)
2360     print '(3i3)', a(2,:)
2361     print '(3i3)', a(3,:)    
2362     a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
2363     print *
2364     print '(3i3)', a(1,:)
2365     print '(3i3)', a(2,:)
2366     print '(3i3)', a(3,:)
2367 end program test_eoshift
2368 @end smallexample
2369 @end table
2370
2371
2372
2373 @node EPSILON
2374 @section @code{EPSILON} --- Epsilon function
2375 @findex @code{EPSILON} intrinsic
2376 @cindex epsilon, significant
2377
2378 @table @asis
2379 @item @emph{Description}:
2380 @code{EPSILON(X)} returns a nearly negligible number relative to @code{1}.
2381
2382 @item @emph{Option}:
2383 f95, gnu
2384
2385 @item @emph{Class}:
2386 inquiry function
2387
2388 @item @emph{Syntax}:
2389 @code{C = EPSILON(X)}
2390
2391 @item @emph{Arguments}:
2392 @multitable @columnfractions .15 .80
2393 @item @var{X} @tab The type shall be @code{REAL(*)}.
2394 @end multitable
2395
2396 @item @emph{Return value}:
2397 The return value is of same type as the argument.
2398
2399 @item @emph{Example}:
2400 @smallexample
2401 program test_epsilon
2402     real :: x = 3.143
2403     real(8) :: y = 2.33
2404     print *, EPSILON(x)
2405     print *, EPSILON(y)
2406 end program test_epsilon
2407 @end smallexample
2408 @end table
2409
2410
2411
2412 @node ERF
2413 @section @code{ERF} --- Error function 
2414 @findex @code{ERF} intrinsic
2415 @cindex error function
2416
2417 @table @asis
2418 @item @emph{Description}:
2419 @code{ERF(X)} computes the error function of @var{X}.
2420
2421 @item @emph{Option}:
2422 gnu
2423
2424 @item @emph{Class}:
2425 elemental function
2426
2427 @item @emph{Syntax}:
2428 @code{X = ERF(X)}
2429
2430 @item @emph{Arguments}:
2431 @multitable @columnfractions .15 .80
2432 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
2433 @end multitable
2434
2435 @item @emph{Return value}:
2436 The return value is a scalar of type @code{REAL(*)} and it is positive
2437 (@math{ - 1 \leq erf (x) \leq 1 }.
2438
2439 @item @emph{Example}:
2440 @smallexample
2441 program test_erf
2442   real(8) :: x = 0.17_8
2443   x = erf(x)
2444 end program test_erf
2445 @end smallexample
2446
2447 @item @emph{Specific names}:
2448 @multitable @columnfractions .24 .24 .24 .24
2449 @item Name            @tab Argument          @tab Return type       @tab Option
2450 @item @code{DERF(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
2451 @end multitable
2452 @end table
2453
2454
2455
2456 @node ERFC
2457 @section @code{ERFC} --- Error function 
2458 @findex @code{ERFC} intrinsic
2459 @cindex error function
2460
2461 @table @asis
2462 @item @emph{Description}:
2463 @code{ERFC(X)} computes the complementary error function of @var{X}.
2464
2465 @item @emph{Option}:
2466 gnu
2467
2468 @item @emph{Class}:
2469 elemental function
2470
2471 @item @emph{Syntax}:
2472 @code{X = ERFC(X)}
2473
2474 @item @emph{Arguments}:
2475 @multitable @columnfractions .15 .80
2476 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
2477 @end multitable
2478
2479 @item @emph{Return value}:
2480 The return value is a scalar of type @code{REAL(*)} and it is positive
2481 (@math{ 0 \leq erfc (x) \leq 2 }.
2482
2483 @item @emph{Example}:
2484 @smallexample
2485 program test_erfc
2486   real(8) :: x = 0.17_8
2487   x = erfc(x)
2488 end program test_erfc
2489 @end smallexample
2490
2491 @item @emph{Specific names}:
2492 @multitable @columnfractions .24 .24 .24 .24
2493 @item Name            @tab Argument          @tab Return type       @tab Option
2494 @item @code{DERFC(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
2495 @end multitable
2496 @end table
2497
2498
2499
2500 @node ETIME
2501 @section @code{ETIME} --- Execution time subroutine (or function)
2502 @findex @code{ETIME} intrinsic
2503 @cindex ETIME subroutine 
2504
2505 @table @asis
2506 @item @emph{Description}:
2507 @code{ETIME(TARRAY, RESULT)} returns the number of seconds of runtime
2508 since the start of the process's execution in @var{RESULT}.  @var{TARRAY}
2509 returns the user and system components of this time in @code{TARRAY(1)} and
2510 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
2511
2512 On some systems, the underlying timings are represented using types with
2513 sufficiently small limits that overflows (wraparounds) are possible, such as
2514 32-bit types. Therefore, the values returned by this intrinsic might be, or
2515 become, negative, or numerically less than previous values, during a single
2516 run of the compiled program.
2517
2518 If @code{ETIME} is invoked as a function, it can not be invoked as a
2519 subroutine, and vice versa.
2520
2521 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2522
2523 @multitable @columnfractions .15 .30 .60
2524 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2525 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2526 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2527 @end multitable
2528
2529 @item @emph{Option}:
2530 gnu
2531
2532 @item @emph{Class}:
2533 subroutine
2534
2535 @item @emph{Syntax}:
2536 @multitable @columnfractions .8
2537 @item @code{CALL ETIME(TARRAY, RESULT)}.
2538 @item @code{RESULT = ETIME(TARRAY)}, (not recommended).
2539 @end multitable
2540
2541 @item @emph{Arguments}:
2542 @multitable @columnfractions .15 .80
2543 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2544 @item @var{RESULT}@tab The type shall be @code{REAL}.
2545 @end multitable
2546
2547 @item @emph{Return value}:
2548 Elapsed time in seconds since the start of program execution.
2549
2550 @item @emph{Example}:
2551 @smallexample
2552 program test_etime
2553     integer(8) :: i, j
2554     real, dimension(2) :: tarray
2555     real :: result
2556     call ETIME(tarray, result)
2557     print *, result
2558     print *, tarray(1)
2559     print *, tarray(2)   
2560     do i=1,100000000    ! Just a delay
2561         j = i * i - i
2562     end do
2563     call ETIME(tarray, result)
2564     print *, result
2565     print *, tarray(1)
2566     print *, tarray(2)
2567 end program test_etime
2568 @end smallexample
2569 @end table
2570
2571
2572
2573 @node EXIT
2574 @section @code{EXIT} --- Exit the program with status. 
2575 @findex @code{EXIT}
2576 @cindex exit
2577
2578 @table @asis
2579 @item @emph{Description}:
2580 @code{EXIT} causes immediate termination of the program with status.  If status
2581 is omitted it returns the canonical @emph{success} for the system.  All Fortran
2582 I/O units are closed. 
2583
2584 @item @emph{Option}:
2585 gnu
2586
2587 @item @emph{Class}:
2588 non-elemental subroutine
2589
2590 @item @emph{Syntax}:
2591 @code{CALL EXIT([STATUS])}
2592
2593 @item @emph{Arguments}:
2594 @multitable @columnfractions .15 .80
2595 @item @var{STATUS} @tab The type of the argument shall be @code{INTEGER(*)}.
2596 @end multitable
2597
2598 @item @emph{Return value}:
2599 @code{STATUS} is passed to the parent process on exit.
2600
2601 @item @emph{Example}:
2602 @smallexample
2603 program test_exit
2604   integer :: STATUS = 0
2605   print *, 'This program is going to exit.'
2606   call EXIT(STATUS)
2607 end program test_exit
2608 @end smallexample
2609 @end table
2610
2611
2612
2613 @node EXP
2614 @section @code{EXP} --- Exponential function 
2615 @findex @code{EXP} intrinsic
2616 @findex @code{DEXP} intrinsic
2617 @findex @code{ZEXP} intrinsic
2618 @findex @code{CDEXP} intrinsic
2619 @cindex exponential
2620
2621 @table @asis
2622 @item @emph{Description}:
2623 @code{EXP(X)} computes the base @math{e} exponential of @var{X}.
2624
2625 @item @emph{Option}:
2626 f95, gnu
2627
2628 @item @emph{Class}:
2629 elemental function
2630
2631 @item @emph{Syntax}:
2632 @code{X = EXP(X)}
2633
2634 @item @emph{Arguments}:
2635 @multitable @columnfractions .15 .80
2636 @item @var{X} @tab The type shall be @code{REAL(*)} or
2637 @code{COMPLEX(*)}.
2638 @end multitable
2639
2640 @item @emph{Return value}:
2641 The return value has same type and kind as @var{X}.
2642
2643 @item @emph{Example}:
2644 @smallexample
2645 program test_exp
2646   real :: x = 1.0
2647   x = exp(x)
2648 end program test_exp
2649 @end smallexample
2650
2651 @item @emph{Specific names}:
2652 @multitable @columnfractions .24 .24 .24 .24
2653 @item Name            @tab Argument          @tab Return type       @tab Option
2654 @item @code{DEXP(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
2655 @item @code{CEXP(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
2656 @item @code{ZEXP(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
2657 @item @code{CDEXP(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
2658 @end multitable
2659 @end table
2660
2661
2662
2663 @node EXPONENT
2664 @section @code{EXPONENT} --- Exponent function 
2665 @findex @code{EXPONENT} intrinsic
2666 @cindex exponent function
2667
2668 @table @asis
2669 @item @emph{Description}:
2670 @code{EXPONENT(X)} returns the value of the exponent part of @var{X}. If @var{X}
2671 is zero the value returned is zero. 
2672
2673 @item @emph{Option}:
2674 f95, gnu
2675
2676 @item @emph{Class}:
2677 elemental function
2678
2679 @item @emph{Syntax}:
2680 @code{I = EXPONENT(X)}
2681
2682 @item @emph{Arguments}:
2683 @multitable @columnfractions .15 .80
2684 @item @var{X} @tab The type shall be @code{REAL(*)}.
2685 @end multitable
2686
2687 @item @emph{Return value}:
2688 The return value is of type default @code{INTEGER}.
2689
2690 @item @emph{Example}:
2691 @smallexample
2692 program test_exponent
2693   real :: x = 1.0
2694   integer :: i
2695   i = exponent(x)
2696   print *, i
2697   print *, exponent(0.0)
2698 end program test_exponent
2699 @end smallexample
2700 @end table
2701
2702
2703 @node FREE
2704 @section @code{FREE} --- Frees memory
2705 @findex @code{FREE} intrinsic
2706 @cindex FREE
2707
2708 @table @asis
2709 @item @emph{Description}:
2710 Frees memory previously allocated by @code{MALLOC()}. The @code{FREE}
2711 intrinsic is an extension intended to be used with Cray pointers, and is
2712 provided in @command{gfortran} to allow user to compile legacy code. For
2713 new code using Fortran 95 pointers, the memory de-allocation intrinsic is
2714 @code{DEALLOCATE}.
2715
2716 @item @emph{Option}:
2717 gnu
2718
2719 @item @emph{Class}:
2720 subroutine
2721
2722 @item @emph{Syntax}:
2723 @code{FREE(PTR)}
2724
2725 @item @emph{Arguments}:
2726 @multitable @columnfractions .15 .80
2727 @item @var{PTR} @tab The type shall be @code{INTEGER}. It represents the
2728 location of the memory that should be de-allocated.
2729 @end multitable
2730
2731 @item @emph{Return value}:
2732 None
2733
2734 @item @emph{Example}:
2735 See @code{MALLOC} for an example.
2736 @end table
2737
2738
2739 @node FLOOR
2740 @section @code{FLOOR} --- Integer floor function
2741 @findex @code{FLOOR} intrinsic
2742 @cindex floor
2743
2744 @table @asis
2745 @item @emph{Description}:
2746 @code{FLOOR(X)} returns the greatest integer less than or equal to @var{X}.
2747
2748 @item @emph{Option}:
2749 f95, gnu
2750
2751 @item @emph{Class}:
2752 elemental function
2753
2754 @item @emph{Syntax}:
2755 @code{I = FLOOR(X[,KIND])}
2756
2757 @item @emph{Arguments}:
2758 @multitable @columnfractions .15 .80
2759 @item @var{X} @tab The type shall be @code{REAL(*)}.
2760 @item @var{KIND} @tab Optional scaler integer initialization expression.
2761 @end multitable
2762
2763 @item @emph{Return value}:
2764 The return value is of type @code{INTEGER(KIND)}
2765
2766 @item @emph{Example}:
2767 @smallexample
2768 program test_floor
2769     real :: x = 63.29
2770     real :: y = -63.59
2771     print *, floor(x) ! returns 63
2772     print *, floor(y) ! returns -64
2773 end program test_floor
2774 @end smallexample
2775 @end table
2776
2777
2778
2779 @node FNUM
2780 @section @code{FNUM} --- File number function
2781 @findex @code{FNUM} intrinsic
2782 @cindex fnum
2783
2784 @table @asis
2785 @item @emph{Description}:
2786 @code{FNUM(UNIT)} returns the Posix file descriptor number corresponding to the
2787 open Fortran I/O unit @code{UNIT}.
2788
2789 @item @emph{Option}:
2790 gnu
2791
2792 @item @emph{Class}:
2793 non-elemental function
2794
2795 @item @emph{Syntax}:
2796 @code{I = FNUM(UNIT)}
2797
2798 @item @emph{Arguments}:
2799 @multitable @columnfractions .15 .80
2800 @item @var{UNIT} @tab The type shall be @code{INTEGER}.
2801 @end multitable
2802
2803 @item @emph{Return value}:
2804 The return value is of type @code{INTEGER}
2805
2806 @item @emph{Example}:
2807 @smallexample
2808 program test_fnum
2809   integer :: i
2810   open (unit=10, status = "scratch")
2811   i = fnum(10)
2812   print *, i
2813   close (10)
2814 end program test_fnum
2815 @end smallexample
2816 @end table
2817
2818 @node LOC
2819 @section @code{LOC} --- Returns the address of a variable
2820 @findex @code{LOC} intrinsic
2821 @cindex loc
2822
2823 @table @asis
2824 @item @emph{Description}:
2825 @code{LOC(X)} returns the address of @var{X} as an integer.
2826
2827 @item @emph{Option}:
2828 gnu
2829
2830 @item @emph{Class}:
2831 inquiry function
2832
2833 @item @emph{Syntax}:
2834 @code{I = LOC(X)}
2835
2836 @item @emph{Arguments}:
2837 @multitable @columnfractions .15 .80
2838 @item @var{X} @tab Variable of any type.
2839 @end multitable
2840
2841 @item @emph{Return value}:
2842 The return value is of type @code{INTEGER(n)}, where @code{n} is the
2843 size (in bytes) of a memory address on the target machine.
2844
2845 @item @emph{Example}:
2846 @smallexample
2847 program test_loc
2848   integer :: i
2849   real :: r
2850   i = loc(r)
2851   print *, i
2852 end program test_loc
2853 @end smallexample
2854 @end table
2855
2856 @node LOG
2857 @section @code{LOG} --- Logarithm function
2858 @findex @code{LOG} intrinsic
2859 @findex @code{ALOG} intrinsic
2860 @findex @code{DLOG} intrinsic
2861 @findex @code{CLOG} intrinsic
2862 @findex @code{ZLOG} intrinsic
2863 @findex @code{CDLOG} intrinsic
2864 @cindex logarithm
2865
2866 @table @asis
2867 @item @emph{Description}:
2868 @code{LOG(X)} computes the logarithm of @var{X}.
2869
2870 @item @emph{Option}:
2871 f95, gnu
2872
2873 @item @emph{Class}:
2874 elemental function
2875
2876 @item @emph{Syntax}:
2877 @code{X = LOG(X)}
2878
2879 @item @emph{Arguments}:
2880 @multitable @columnfractions .15 .80
2881 @item @var{X} @tab The type shall be @code{REAL(*)} or
2882 @code{COMPLEX(*)}.
2883 @end multitable
2884
2885 @item @emph{Return value}:
2886 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
2887 The kind type parameter is the same as @var{X}.
2888
2889 @item @emph{Example}:
2890 @smallexample
2891 program test_log
2892   real(8) :: x = 1.0_8
2893   complex :: z = (1.0, 2.0)
2894   x = log(x)
2895   z = log(z)
2896 end program test_log
2897 @end smallexample
2898
2899 @item @emph{Specific names}:
2900 @multitable @columnfractions .24 .24 .24 .24
2901 @item Name            @tab Argument          @tab Return type       @tab Option
2902 @item @code{ALOG(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab f95, gnu
2903 @item @code{DLOG(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
2904 @item @code{CLOG(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
2905 @item @code{ZLOG(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
2906 @item @code{CDLOG(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
2907 @end multitable
2908 @end table
2909
2910
2911
2912 @node LOG10
2913 @section @code{LOG10} --- Base 10 logarithm function
2914 @findex @code{LOG10} intrinsic
2915 @findex @code{ALOG10} intrinsic
2916 @findex @code{DLOG10} intrinsic
2917 @cindex logarithm
2918
2919 @table @asis
2920 @item @emph{Description}:
2921 @code{LOG10(X)} computes the base 10 logarithm of @var{X}.
2922
2923 @item @emph{Option}:
2924 f95, gnu
2925
2926 @item @emph{Class}:
2927 elemental function
2928
2929 @item @emph{Syntax}:
2930 @code{X = LOG10(X)}
2931
2932 @item @emph{Arguments}:
2933 @multitable @columnfractions .15 .80
2934 @item @var{X} @tab The type shall be @code{REAL(*)} or
2935 @code{COMPLEX(*)}.
2936 @end multitable
2937
2938 @item @emph{Return value}:
2939 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
2940 The kind type parameter is the same as @var{X}.
2941
2942 @item @emph{Example}:
2943 @smallexample
2944 program test_log10
2945   real(8) :: x = 10.0_8
2946   x = log10(x)
2947 end program test_log10
2948 @end smallexample
2949
2950 @item @emph{Specific names}:
2951 @multitable @columnfractions .24 .24 .24 .24
2952 @item Name            @tab Argument          @tab Return type       @tab Option
2953 @item @code{ALOG10(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab f95, gnu
2954 @item @code{DLOG10(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
2955 @end multitable
2956 @end table
2957
2958
2959 @node MALLOC
2960 @section @code{MALLOC} --- Allocate dynamic memory
2961 @findex @code{MALLOC} intrinsic
2962 @cindex MALLOC
2963
2964 @table @asis
2965 @item @emph{Description}:
2966 @code{MALLOC(SIZE)} allocates @var{SIZE} bytes of dynamic memory and
2967 returns the address of the allocated memory. The @code{MALLOC} intrinsic
2968 is an extension intended to be used with Cray pointers, and is provided
2969 in @command{gfortran} to allow user to compile legacy code. For new code
2970 using Fortran 95 pointers, the memory allocation intrinsic is
2971 @code{ALLOCATE}.
2972
2973 @item @emph{Option}:
2974 gnu
2975
2976 @item @emph{Class}:
2977 non-elemental function
2978
2979 @item @emph{Syntax}:
2980 @code{PTR = MALLOC(SIZE)}
2981
2982 @item @emph{Arguments}:
2983 @multitable @columnfractions .15 .80
2984 @item @var{SIZE} @tab The type shall be @code{INTEGER(*)}.
2985 @end multitable
2986
2987 @item @emph{Return value}:
2988 The return value is of type @code{INTEGER(K)}, with @var{K} such that
2989 variables of type @code{INTEGER(K)} have the same size as
2990 C pointers (@code{sizeof(void *)}).
2991
2992 @item @emph{Example}:
2993 The following example demonstrates the use of @code{MALLOC} and
2994 @code{FREE} with Cray pointers. This example is intended to run on
2995 32-bit systems, where the default integer kind is suitable to store
2996 pointers; on 64-bit systems, ptr_x would need to be declared as
2997 @code{integer(kind=8)}.
2998
2999 @smallexample
3000 program test_malloc
3001   integer i
3002   integer ptr_x
3003   real*8 x(*), z
3004   pointer(ptr_x,x)
3005
3006   ptr_x = malloc(20*8)
3007   do i = 1, 20
3008     x(i) = sqrt(1.0d0 / i)
3009   end do
3010   z = 0
3011   do i = 1, 20
3012     z = z + x(i)
3013     print *, z
3014   end do
3015   call free(ptr_x)
3016 end program test_malloc
3017 @end smallexample
3018 @end table
3019
3020
3021 @node REAL
3022 @section @code{REAL} --- Convert to real type 
3023 @findex @code{REAL} intrinsic
3024 @findex @code{REALPART} intrinsic
3025 @cindex true values
3026
3027 @table @asis
3028 @item @emph{Description}:
3029 @code{REAL(X [, KIND])} converts its argument @var{X} to a real type.  The
3030 @code{REALPART(X)} function is provided for compatibility with @command{g77},
3031 and its use is strongly discouraged.
3032
3033 @item @emph{Option}:
3034 f95, gnu
3035
3036 @item @emph{Class}:
3037 transformational function
3038
3039 @item @emph{Syntax}:
3040 @multitable @columnfractions .30 .80
3041 @item @code{X = REAL(X)}
3042 @item @code{X = REAL(X, KIND)}
3043 @item @code{X = REALPART(Z)}
3044 @end multitable
3045
3046 @item @emph{Arguments}:
3047 @multitable @columnfractions .15 .80
3048 @item @var{X} @tab shall be @code{INTEGER(*)}, @code{REAL(*)}, or  
3049 @code{COMPLEX(*)}.
3050 @item @var{KIND}  @tab (Optional) @var{KIND} shall be a scalar integer.
3051 @end multitable
3052
3053 @item @emph{Return value}:
3054 These functions return the a @code{REAL(*)} variable or array under
3055 the following rules: 
3056
3057 @table @asis
3058 @item (A)
3059 @code{REAL(X)} is converted to a default real type if @var{X} is an 
3060 integer or real variable.
3061 @item (B)
3062 @code{REAL(X)} is converted to a real type with the kind type parameter
3063 of @var{X} if @var{X} is a complex variable.
3064 @item (C)
3065 @code{REAL(X, KIND)} is converted to a real type with kind type
3066 parameter @var{KIND} if @var{X} is a complex, integer, or real
3067 variable.
3068 @end table
3069
3070 @item @emph{Example}:
3071 @smallexample
3072 program test_real
3073   complex :: x = (1.0, 2.0)
3074   print *, real(x), real(x,8), realpart(x)
3075   end program test_real
3076 @end smallexample
3077 @end table
3078
3079
3080
3081 @node SIGNAL
3082 @section @code{SIGNAL} --- Signal handling subroutine (or function)
3083 @findex @code{SIGNAL} intrinsic
3084 @cindex SIGNAL subroutine 
3085
3086 @table @asis
3087 @item @emph{Description}:
3088 @code{SIGNAL(NUMBER, HANDLER [, STATUS])} causes external subroutine
3089 @var{HANDLER} to be executed with a single integer argument when signal
3090 @var{NUMBER} occurs.  If @var{HANDLER} is an integer, it can be used to
3091 turn off handling of signal @var{NUMBER} or revert to its default
3092 action.  See @code{signal(2)}.
3093
3094 If @code{SIGNAL} is called as a subroutine and the @var{STATUS} argument
3095 is supplied, it is set to the value returned by @code{signal(2)}.
3096
3097 @item @emph{Option}:
3098 gnu
3099
3100 @item @emph{Class}:
3101 subroutine, non-elemental function
3102
3103 @item @emph{Syntax}:
3104 @multitable @columnfractions .30 .80
3105 @item @code{CALL ALARM(NUMBER, HANDLER)}
3106 @item @code{CALL ALARM(NUMBER, HANDLER, STATUS)}
3107 @item @code{STATUS = ALARM(NUMBER, HANDLER)}
3108 @end multitable
3109
3110 @item @emph{Arguments}:
3111 @multitable @columnfractions .15 .80
3112 @item @var{NUMBER} @tab shall be a scalar integer, with @code{INTENT(IN)}
3113 @item @var{HANDLER}@tab Signal handler (@code{INTEGER FUNCTION} or
3114 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
3115 @code{INTEGER}. It is @code{INTENT(IN)}.
3116 @item @var{STATUS} @tab (Optional) @var{STATUS} shall be a scalar
3117 integer. It has @code{INTENT(OUT)}.
3118 @end multitable
3119
3120 @item @emph{Return value}:
3121 The @code{SIGNAL} functions returns the value returned by @code{signal(2)}.
3122
3123 @item @emph{Example}:
3124 @smallexample
3125 program test_signal
3126   intrinsic signal
3127   external handler_print
3128
3129   call signal (12, handler_print)
3130   call signal (10, 1)
3131
3132   call sleep (30)
3133 end program test_signal
3134 @end smallexample
3135 @end table
3136
3137
3138
3139
3140 @node SECNDS
3141 @section @code{SECNDS} --- Time subroutine
3142 @findex @code{SECNDS} intrinsic
3143 @cindex SECNDS
3144
3145 @table @asis
3146 @item @emph{Description}:
3147 @code{SECNDS(X)} gets the time in seconds from the real-time system clock.
3148 @var{X} is a reference time, also in seconds. If this is zero, the time in
3149 seconds from midnight is returned. This function is non-standard and its
3150 use is discouraged.
3151
3152 @item @emph{Option}:
3153 gnu
3154
3155 @item @emph{Class}:
3156 function
3157
3158 @item @emph{Syntax}:
3159 @code{T = SECNDS (X)}
3160
3161 @item @emph{Arguments}:
3162 @multitable @columnfractions .15 .80
3163 @item Name        @tab Type
3164 @item @var{T}     @tab REAL(4)
3165 @item @var{X}     @tab REAL(4)
3166 @end multitable
3167
3168 @item @emph{Return value}:
3169 None
3170
3171 @item @emph{Example}:
3172 @smallexample
3173 program test_secnds
3174     real(4) :: t1, t2
3175     print *, secnds (0.0)   ! seconds since midnight
3176     t1 = secnds (0.0)       ! reference time
3177     do i = 1, 10000000      ! do something
3178     end do
3179     t2 = secnds (t1)        ! elapsed time
3180     print *, "Something took ", t2, " seconds."
3181 end program test_secnds
3182 @end smallexample
3183 @end table
3184
3185
3186
3187 @node SIN
3188 @section @code{SIN} --- Sine function 
3189 @findex @code{SIN} intrinsic
3190 @findex @code{DSIN} intrinsic
3191 @findex @code{ZSIN} intrinsic
3192 @findex @code{CDSIN} intrinsic
3193 @cindex sine
3194
3195 @table @asis
3196 @item @emph{Description}:
3197 @code{SIN(X)} computes the sine of @var{X}.
3198
3199 @item @emph{Option}:
3200 f95, gnu
3201
3202 @item @emph{Class}:
3203 elemental function
3204
3205 @item @emph{Syntax}:
3206 @code{X = SIN(X)}
3207
3208 @item @emph{Arguments}:
3209 @multitable @columnfractions .15 .80
3210 @item @var{X} @tab The type shall be @code{REAL(*)} or
3211 @code{COMPLEX(*)}.
3212 @end multitable
3213
3214 @item @emph{Return value}:
3215 The return value has same type and king than @var{X}.
3216
3217 @item @emph{Example}:
3218 @smallexample
3219 program test_sin
3220   real :: x = 0.0
3221   x = sin(x)
3222 end program test_sin
3223 @end smallexample
3224
3225 @item @emph{Specific names}:
3226 @multitable @columnfractions .24 .24 .24 .24
3227 @item Name            @tab Argument          @tab Return type       @tab Option
3228 @item @code{DSIN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3229 @item @code{CSIN(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
3230 @item @code{ZSIN(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3231 @item @code{CDSIN(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3232 @end multitable
3233 @end table
3234
3235
3236
3237 @node SINH
3238 @section @code{SINH} --- Hyperbolic sine function 
3239 @findex @code{SINH} intrinsic
3240 @findex @code{DSINH} intrinsic
3241 @cindex hyperbolic sine
3242
3243 @table @asis
3244 @item @emph{Description}:
3245 @code{SINH(X)} computes the hyperbolic sine of @var{X}.
3246
3247 @item @emph{Option}:
3248 f95, gnu
3249
3250 @item @emph{Class}:
3251 elemental function
3252
3253 @item @emph{Syntax}:
3254 @code{X = SINH(X)}
3255
3256 @item @emph{Arguments}:
3257 @multitable @columnfractions .15 .80
3258 @item @var{X} @tab The type shall be @code{REAL(*)}.
3259 @end multitable
3260
3261 @item @emph{Return value}:
3262 The return value is of type @code{REAL(*)}.
3263
3264 @item @emph{Example}:
3265 @smallexample
3266 program test_sinh
3267   real(8) :: x = - 1.0_8
3268   x = sinh(x)
3269 end program test_sinh
3270 @end smallexample
3271
3272 @item @emph{Specific names}:
3273 @multitable @columnfractions .24 .24 .24 .24
3274 @item Name            @tab Argument          @tab Return type       @tab Option
3275 @item @code{DSINH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3276 @end multitable
3277 @end table
3278
3279
3280
3281 @node SQRT
3282 @section @code{SQRT} --- Square-root function
3283 @findex @code{SQRT} intrinsic
3284 @findex @code{DSQRT} intrinsic
3285 @findex @code{CSQRT} intrinsic
3286 @findex @code{ZSQRT} intrinsic
3287 @findex @code{CDSQRT} intrinsic
3288 @cindex square-root
3289
3290 @table @asis
3291 @item @emph{Description}:
3292 @code{SQRT(X)} computes the square root of @var{X}.
3293
3294 @item @emph{Option}:
3295 f95, gnu
3296
3297 @item @emph{Class}:
3298 elemental function
3299
3300 @item @emph{Syntax}:
3301 @code{X = SQRT(X)}
3302
3303 @item @emph{Arguments}:
3304 @multitable @columnfractions .15 .80
3305 @item @var{X} @tab The type shall be @code{REAL(*)} or
3306 @code{COMPLEX(*)}.
3307 @end multitable
3308
3309 @item @emph{Return value}:
3310 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
3311 The kind type parameter is the same as @var{X}.
3312
3313 @item @emph{Example}:
3314 @smallexample
3315 program test_sqrt
3316   real(8) :: x = 2.0_8
3317   complex :: z = (1.0, 2.0)
3318   x = sqrt(x)
3319   z = sqrt(z)
3320 end program test_sqrt
3321 @end smallexample
3322
3323 @item @emph{Specific names}:
3324 @multitable @columnfractions .24 .24 .24 .24
3325 @item Name            @tab Argument          @tab Return type       @tab Option
3326 @item @code{DSQRT(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3327 @item @code{CSQRT(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
3328 @item @code{ZSQRT(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3329 @item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3330 @end multitable
3331 @end table
3332
3333
3334
3335 @node TAN
3336 @section @code{TAN} --- Tangent function
3337 @findex @code{TAN} intrinsic
3338 @findex @code{DTAN} intrinsic
3339 @cindex tangent
3340
3341 @table @asis
3342 @item @emph{Description}:
3343 @code{TAN(X)} computes the tangent of @var{X}.
3344
3345 @item @emph{Option}:
3346 f95, gnu
3347
3348 @item @emph{Class}:
3349 elemental function
3350
3351 @item @emph{Syntax}:
3352 @code{X = TAN(X)}
3353
3354 @item @emph{Arguments}:
3355 @multitable @columnfractions .15 .80
3356 @item @var{X} @tab The type shall be @code{REAL(*)}.
3357 @end multitable
3358
3359 @item @emph{Return value}:
3360 The return value is of type @code{REAL(*)}.  The kind type parameter is
3361 the same as @var{X}.
3362
3363 @item @emph{Example}:
3364 @smallexample
3365 program test_tan
3366   real(8) :: x = 0.165_8
3367   x = tan(x)
3368 end program test_tan
3369 @end smallexample
3370
3371 @item @emph{Specific names}:
3372 @multitable @columnfractions .24 .24 .24 .24
3373 @item Name            @tab Argument          @tab Return type       @tab Option
3374 @item @code{DTAN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3375 @end multitable
3376 @end table
3377
3378
3379
3380 @node TANH
3381 @section @code{TANH} --- Hyperbolic tangent function 
3382 @findex @code{TANH} intrinsic
3383 @findex @code{DTANH} intrinsic
3384 @cindex hyperbolic tangent
3385
3386 @table @asis
3387 @item @emph{Description}:
3388 @code{TANH(X)} computes the hyperbolic tangent of @var{X}.
3389
3390 @item @emph{Option}:
3391 f95, gnu
3392
3393 @item @emph{Class}:
3394 elemental function
3395
3396 @item @emph{Syntax}:
3397 @code{X = TANH(X)}
3398
3399 @item @emph{Arguments}:
3400 @multitable @columnfractions .15 .80
3401 @item @var{X} @tab The type shall be @code{REAL(*)}.
3402 @end multitable
3403
3404 @item @emph{Return value}:
3405 The return value is of type @code{REAL(*)} and lies in the range
3406 @math{ - 1 \leq tanh(x) \leq 1 }.
3407
3408 @item @emph{Example}:
3409 @smallexample
3410 program test_tanh
3411   real(8) :: x = 2.1_8
3412   x = tanh(x)
3413 end program test_tanh
3414 @end smallexample
3415
3416 @item @emph{Specific names}:
3417 @multitable @columnfractions .24 .24 .24 .24
3418 @item Name            @tab Argument          @tab Return type       @tab Option
3419 @item @code{DTANH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3420 @end multitable
3421 @end table
3422
3423
3424
3425 @comment sub   flush
3426 @comment 
3427 @comment gen   fraction
3428 @comment 
3429 @comment gen   fstat
3430 @comment sub   fstat
3431 @comment 
3432 @comment sub   getarg
3433 @comment 
3434 @comment gen   getcwd
3435 @comment sub   getcwd
3436 @comment 
3437 @comment sub   getenv
3438 @comment 
3439 @comment gen   getgid
3440 @comment 
3441 @comment gen   getpid
3442 @comment 
3443 @comment gen   getuid
3444 @comment 
3445 @comment sub   get_command
3446 @comment 
3447 @comment sub   get_command_argument
3448 @comment 
3449 @comment sub   get_environment_variable
3450 @comment 
3451 @comment gen   huge
3452 @comment 
3453 @comment gen   iachar
3454 @comment 
3455 @comment gen   iand
3456 @comment 
3457 @comment gen   iargc
3458 @comment 
3459 @comment gen   ibclr
3460 @comment 
3461 @comment gen   ibits
3462 @comment 
3463 @comment gen   ibset
3464 @comment 
3465 @comment gen   ichar
3466 @comment 
3467 @comment gen   ieor
3468 @comment 
3469 @comment gen   index
3470 @comment 
3471 @comment gen   int
3472 @comment       ifix
3473 @comment       idint
3474 @comment 
3475 @comment gen   ior
3476 @comment 
3477 @comment gen   irand
3478 @comment 
3479 @comment gen   ishft
3480 @comment 
3481 @comment gen   ishftc
3482 @comment 
3483 @comment gen   kind
3484 @comment 
3485 @comment gen   lbound
3486 @comment 
3487 @comment gen   len
3488 @comment 
3489 @comment gen   len_trim
3490 @comment 
3491 @comment gen   lge
3492 @comment 
3493 @comment gen   lgt
3494 @comment 
3495 @comment gen   lle
3496 @comment 
3497 @comment gen   llt
3498 @comment 
3499 @comment gen   logical
3500 @comment 
3501 @comment gen   matmul
3502 @comment 
3503 @comment gen   max
3504 @comment       max0
3505 @comment       amax0
3506 @comment       amax1
3507 @comment       max1
3508 @comment       dmax1
3509 @comment 
3510 @comment gen   maxexponent
3511 @comment 
3512 @comment gen   maxloc
3513 @comment 
3514 @comment gen   maxval
3515 @comment 
3516 @comment gen   merge
3517 @comment 
3518 @comment gen   min
3519 @comment       min0
3520 @comment       amin0
3521 @comment       amin1
3522 @comment       min1
3523 @comment       dmin1
3524 @comment 
3525 @comment gen   minexponent
3526 @comment 
3527 @comment gen   minloc
3528 @comment 
3529 @comment gen   minval
3530 @comment 
3531 @comment gen   mod
3532 @comment       amod
3533 @comment       dmod
3534 @comment 
3535 @comment gen   modulo
3536 @comment 
3537 @comment sub   mvbits
3538 @comment 
3539 @comment gen   nearest
3540 @comment 
3541 @comment gen   nint
3542 @comment       idnint
3543 @comment 
3544 @comment gen   not
3545 @comment 
3546 @comment gen   null
3547 @comment 
3548 @comment gen   pack
3549 @comment 
3550 @comment gen   precision
3551 @comment 
3552 @comment gen   present
3553 @comment 
3554 @comment gen   product
3555 @comment 
3556 @comment gen   radix
3557 @comment 
3558 @comment gen   rand
3559 @comment       ran 
3560 @comment 
3561 @comment sub   random_number
3562 @comment 
3563 @comment sub   random_seed
3564 @comment 
3565 @comment gen   range
3566 @comment 
3567 @comment gen   real
3568 @comment       float
3569 @comment       sngl
3570 @comment 
3571 @comment gen   repeat
3572 @comment 
3573 @comment gen   reshape
3574 @comment 
3575 @comment gen   rrspacing
3576 @comment 
3577 @comment gen   scale
3578 @comment 
3579 @comment gen   scan
3580 @comment 
3581 @comment gen   second
3582 @comment sub   second
3583 @comment 
3584 @comment gen   selected_int_kind
3585 @comment 
3586 @comment gen   selected_real_kind
3587 @comment 
3588 @comment gen   set_exponent
3589 @comment 
3590 @comment gen   shape
3591 @comment 
3592 @comment gen   sign
3593 @comment       isign
3594 @comment       dsign
3595 @comment 
3596 @comment gen   size
3597 @comment 
3598 @comment gen   spacing
3599 @comment 
3600 @comment gen   spread
3601 @comment 
3602 @comment sub   srand
3603 @comment 
3604 @comment gen   stat
3605 @comment sub   stat
3606 @comment 
3607 @comment gen   sum
3608 @comment 
3609 @comment gen   system
3610 @comment sub   system
3611 @comment 
3612 @comment sub system_clock
3613 @comment 
3614 @comment gen   tiny
3615 @comment 
3616 @comment gen   transfer
3617 @comment 
3618 @comment gen   transpose
3619 @comment 
3620 @comment gen   trim
3621 @comment 
3622 @comment gen   ubound
3623 @comment 
3624 @comment gen   umask
3625 @comment sub   umask
3626 @comment 
3627 @comment gen   unlink
3628 @comment sub   unlink
3629 @comment 
3630 @comment gen   unpack
3631 @comment 
3632 @comment gen   verify
3633