Add SB-1 specific multilib support. Patch by Fred Fish.
[official-gcc.git] / gcc / fortran / intrinsic.texi
blobdcab1cfb9ded8ddb5db4e8c128115462c8667209
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.
7 Permission is granted to copy, distribute and/or modify this document
8 under the terms of the GNU Free Documentation License, Version 1.2 or
9 any later version published by the Free Software Foundation; with the
10 Invariant Sections being ``GNU General Public License'' and ``Funding
11 Free Software'', the Front-Cover texts being (a) (see below), and with
12 the Back-Cover Texts being (b) (see below).  A copy of the license is
13 included in the gfdl(7) man page.
16 Some basic guidelines for editing this document:
18   (1) The intrinsic procedures are to be listed in alphabetical order.
19   (2) The generic name is to be use.
20   (3) The specific names are included in the function index and in a
21       table at the end of the node (See ABS entry).
22   (4) Try to maintain the same style for each entry.
25 @end ignore
27 @node Intrinsic Procedures
28 @chapter Intrinsic Procedures
29 @cindex Intrinsic Procedures
31 This portion of the document is incomplete and undergoing massive expansion 
32 and editing.  All contributions and corrections are strongly encouraged. 
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{CTIME}:         CTIME,     Subroutine (or function) to convert a time into a string
72 * @code{DATE_AND_TIME}: DATE_AND_TIME, Date and time subroutine
73 * @code{DBLE}:          DBLE,      Double precision conversion function
74 * @code{DCMPLX}:        DCMPLX,    Double complex conversion function
75 * @code{DFLOAT}:        DFLOAT,    Double precision conversion function
76 * @code{DIGITS}:        DIGITS,    Significant digits function
77 * @code{DIM}:           DIM,       Dim function
78 * @code{DOT_PRODUCT}:   DOT_PRODUCT, Dot product function
79 * @code{DPROD}:         DPROD,     Double product function
80 * @code{DREAL}:         DREAL,     Double real part function
81 * @code{DTIME}:         DTIME,     Execution time subroutine (or function)
82 * @code{EOSHIFT}:       EOSHIFT,   End-off shift function
83 * @code{EPSILON}:       EPSILON,   Epsilon function
84 * @code{ERF}:           ERF,       Error function
85 * @code{ERFC}:          ERFC,      Complementary error function
86 * @code{ETIME}:         ETIME,     Execution time subroutine (or function)
87 * @code{EXIT}:          EXIT,      Exit the program with status.
88 * @code{EXP}:           EXP,       Exponential function
89 * @code{EXPONENT}:      EXPONENT,  Exponent function
90 * @code{FDATE}:         FDATE,     Subroutine (or function) to get the current time as a string
91 * @code{FLOAT}:         FLOAT,     Convert integer to default real
92 * @code{FLOOR}:         FLOOR,     Integer floor function
93 * @code{FNUM}:          FNUM,      File number function
94 * @code{FREE}:          FREE,      Memory de-allocation subroutine
95 * @code{LOC}:           LOC,       Returns the address of a variable
96 * @code{LOG}:           LOG,       Logarithm function
97 * @code{LOG10}:         LOG10,     Base 10 logarithm function 
98 * @code{MALLOC}:        MALLOC,    Dynamic memory allocation function
99 * @code{REAL}:          REAL,      Convert to real type 
100 * @code{SECNDS}:        SECNDS,    Time function
101 * @code{SIGNAL}:        SIGNAL,    Signal handling subroutine (or function)
102 * @code{SIN}:           SIN,       Sine function
103 * @code{SINH}:          SINH,      Hyperbolic sine function
104 * @code{SQRT}:          SQRT,      Square-root function
105 * @code{TAN}:           TAN,       Tangent function
106 * @code{TANH}:          TANH,      Hyperbolic tangent function
107 @end menu
109 @node Introduction
110 @section Introduction to intrinsic procedures
112 Gfortran provides a rich set of intrinsic procedures that includes all
113 the intrinsic procedures required by the Fortran 95 standard, a set of
114 intrinsic procedures for backwards compatibility with Gnu Fortran 77
115 (i.e., @command{g77}), and a small selection of intrinsic procedures
116 from the Fortran 2003 standard.  Any description here, which conflicts with a 
117 description in either the Fortran 95 standard or the Fortran 2003 standard,
118 is unintentional and the standard(s) should be considered authoritative.
120 The enumeration of the @code{KIND} type parameter is processor defined in
121 the Fortran 95 standard.  Gfortran defines the default integer type and
122 default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)},
123 respectively.  The standard mandates that both data types shall have
124 another kind, which have more precision.  On typical target architectures
125 supported by @command{gfortran}, this kind type parameter is @code{KIND=8}.
126 Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
127 In the description of generic intrinsic procedures, the kind type parameter
128 will be specified by @code{KIND=*}, and in the description of specific
129 names for an intrinsic procedure the kind type parameter will be explicitly
130 given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}).  Finally, for
131 brevity the optional @code{KIND=} syntax will be omitted.
133 Many of the intrinsics procedures take one or more optional arguments.
134 This document follows the convention used in the Fortran 95 standard,
135 and denotes such arguments by square brackets.
137 @command{Gfortran} offers the @option{-std=f95} and @option{-std=gnu} options,
138 which can be used to restrict the set of intrinsic procedures to a 
139 given standard.  By default, @command{gfortran} sets the @option{-std=gnu}
140 option, and so all intrinsic procedures described here are accepted.  There
141 is one caveat.  For a select group of intrinsic procedures, @command{g77}
142 implemented both a function and a subroutine.  Both classes 
143 have been implemented in @command{gfortran} for backwards compatibility
144 with @command{g77}.  It is noted here that these functions and subroutines
145 cannot be intermixed in a given subprogram.  In the descriptions that follow,
146 the applicable option(s) is noted.
150 @node ABORT
151 @section @code{ABORT} --- Abort the program  
152 @findex @code{ABORT}
153 @cindex abort
155 @table @asis
156 @item @emph{Description}:
157 @code{ABORT} causes immediate termination of the program.  On operating
158 systems that support a core dump, @code{ABORT} will produce a core dump,
159 which is suitable for debugging purposes.
161 @item @emph{Option}:
164 @item @emph{Class}:
165 non-elemental subroutine
167 @item @emph{Syntax}:
168 @code{CALL ABORT}
170 @item @emph{Return value}:
171 Does not return.
173 @item @emph{Example}:
174 @smallexample
175 program test_abort
176   integer :: i = 1, j = 2
177   if (i /= j) call abort
178 end program test_abort
179 @end smallexample
180 @end table
184 @node ABS
185 @section @code{ABS} --- Absolute value  
186 @findex @code{ABS} intrinsic
187 @findex @code{CABS} intrinsic
188 @findex @code{DABS} intrinsic
189 @findex @code{IABS} intrinsic
190 @findex @code{ZABS} intrinsic
191 @findex @code{CDABS} intrinsic
192 @cindex absolute value
194 @table @asis
195 @item @emph{Description}:
196 @code{ABS(X)} computes the absolute value of @code{X}.
198 @item @emph{Option}:
199 f95, gnu
201 @item @emph{Class}:
202 elemental function
204 @item @emph{Syntax}:
205 @code{X = ABS(X)}
207 @item @emph{Arguments}:
208 @multitable @columnfractions .15 .80
209 @item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)},
210 @code{REAL(*)}, or @code{COMPLEX(*)}.
211 @end multitable
213 @item @emph{Return value}:
214 The return value is of the same type and
215 kind as the argument except the return value is @code{REAL(*)} for a
216 @code{COMPLEX(*)} argument.
218 @item @emph{Example}:
219 @smallexample
220 program test_abs
221   integer :: i = -1
222   real :: x = -1.e0
223   complex :: z = (-1.e0,0.e0)
224   i = abs(i)
225   x = abs(x)
226   x = abs(z)
227 end program test_abs
228 @end smallexample
230 @item @emph{Specific names}:
231 @multitable @columnfractions .24 .24 .24 .24
232 @item Name            @tab Argument            @tab Return type       @tab Option
233 @item @code{CABS(Z)}  @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)}    @tab f95, gnu
234 @item @code{DABS(X)}  @tab @code{REAL(8)    X} @tab @code{REAL(8)}    @tab f95, gnu
235 @item @code{IABS(I)}  @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab f95, gnu
236 @item @code{ZABS(Z)}  @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
237 @item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
238 @end multitable
239 @end table
243 @node ACHAR
244 @section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence 
245 @findex @code{ACHAR} intrinsic
246 @cindex @acronym{ASCII} collating sequence
248 @table @asis
249 @item @emph{Description}:
250 @code{ACHAR(I)} returns the character located at position @code{I}
251 in the @acronym{ASCII} collating sequence.
253 @item @emph{Option}:
254 f95, gnu
256 @item @emph{Class}:
257 elemental function
259 @item @emph{Syntax}:
260 @code{C = ACHAR(I)}
262 @item @emph{Arguments}:
263 @multitable @columnfractions .15 .80
264 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
265 @end multitable
267 @item @emph{Return value}:
268 The return value is of type @code{CHARACTER} with a length of one.  The
269 kind type parameter is the same as  @code{KIND('A')}.
271 @item @emph{Example}:
272 @smallexample
273 program test_achar
274   character c
275   c = achar(32)
276 end program test_achar
277 @end smallexample
278 @end table
282 @node ACOS
283 @section @code{ACOS} --- Arc cosine function 
284 @findex @code{ACOS} intrinsic
285 @findex @code{DACOS} intrinsic
286 @cindex arc cosine
288 @table @asis
289 @item @emph{Description}:
290 @code{ACOS(X)} computes the arc cosine of @var{X}.
292 @item @emph{Option}:
293 f95, gnu
295 @item @emph{Class}:
296 elemental function
298 @item @emph{Syntax}:
299 @code{X = ACOS(X)}
301 @item @emph{Arguments}:
302 @multitable @columnfractions .15 .80
303 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
304 less than one.
305 @end multitable
307 @item @emph{Return value}:
308 The return value is of type @code{REAL(*)} and it lies in the
309 range @math{ 0 \leq \arccos (x) \leq \pi}.  The kind type
310 parameter is the same as @var{X}.
312 @item @emph{Example}:
313 @smallexample
314 program test_acos
315   real(8) :: x = 0.866_8
316   x = achar(x)
317 end program test_acos
318 @end smallexample
320 @item @emph{Specific names}:
321 @multitable @columnfractions .24 .24 .24 .24
322 @item Name            @tab Argument          @tab Return type       @tab Option
323 @item @code{DACOS(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
324 @end multitable
325 @end table
329 @node ADJUSTL
330 @section @code{ADJUSTL} --- Left adjust a string 
331 @findex @code{ADJUSTL} intrinsic
332 @cindex adjust string
334 @table @asis
335 @item @emph{Description}:
336 @code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.
337 Spaces are inserted at the end of the string as needed.
339 @item @emph{Option}:
340 f95, gnu
342 @item @emph{Class}:
343 elemental function
345 @item @emph{Syntax}:
346 @code{STR = ADJUSTL(STR)}
348 @item @emph{Arguments}:
349 @multitable @columnfractions .15 .80
350 @item @var{STR} @tab The type shall be @code{CHARACTER}.
351 @end multitable
353 @item @emph{Return value}:
354 The return value is of type @code{CHARACTER} where leading spaces 
355 are removed and the same number of spaces are inserted on the end
356 of @var{STR}.
358 @item @emph{Example}:
359 @smallexample
360 program test_adjustl
361   character(len=20) :: str = '   gfortran'
362   str = adjustl(str)
363   print *, str
364 end program test_adjustl
365 @end smallexample
366 @end table
370 @node ADJUSTR
371 @section @code{ADJUSTR} --- Right adjust a string 
372 @findex @code{ADJUSTR} intrinsic
373 @cindex adjust string
375 @table @asis
376 @item @emph{Description}:
377 @code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.
378 Spaces are inserted at the start of the string as needed.
380 @item @emph{Option}:
381 f95, gnu
383 @item @emph{Class}:
384 elemental function
386 @item @emph{Syntax}:
387 @code{STR = ADJUSTR(STR)}
389 @item @emph{Arguments}:
390 @multitable @columnfractions .15 .80
391 @item @var{STR} @tab The type shall be @code{CHARACTER}.
392 @end multitable
394 @item @emph{Return value}:
395 The return value is of type @code{CHARACTER} where trailing spaces 
396 are removed and the same number of spaces are inserted at the start
397 of @var{STR}.
399 @item @emph{Example}:
400 @smallexample
401 program test_adjustr
402   character(len=20) :: str = 'gfortran'
403   str = adjustr(str)
404   print *, str
405 end program test_adjustr
406 @end smallexample
407 @end table
411 @node AIMAG
412 @section @code{AIMAG} --- Imaginary part of complex number  
413 @findex @code{AIMAG} intrinsic
414 @findex @code{DIMAG} intrinsic
415 @findex @code{IMAG} intrinsic
416 @findex @code{IMAGPART} intrinsic
417 @cindex Imaginary part
419 @table @asis
420 @item @emph{Description}:
421 @code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.
422 The @code{IMAG(Z)} and @code{IMAGPART(Z)} intrinsic functions are provided
423 for compatibility with @command{g77}, and their use in new code is 
424 strongly discouraged.
426 @item @emph{Option}:
427 f95, gnu
429 @item @emph{Class}:
430 elemental function
432 @item @emph{Syntax}:
433 @code{X = AIMAG(Z)}
435 @item @emph{Arguments}:
436 @multitable @columnfractions .15 .80
437 @item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.
438 @end multitable
440 @item @emph{Return value}:
441 The return value is of type real with the
442 kind type parameter of the argument.
444 @item @emph{Example}:
445 @smallexample
446 program test_aimag
447   complex(4) z4
448   complex(8) z8
449   z4 = cmplx(1.e0_4, 0.e0_4)
450   z8 = cmplx(0.e0_8, 1.e0_8)
451   print *, aimag(z4), dimag(z8)
452 end program test_aimag
453 @end smallexample
455 @item @emph{Specific names}:
456 @multitable @columnfractions .24 .24 .24 .24
457 @item Name            @tab Argument            @tab Return type       @tab Option
458 @item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)}    @tab f95, gnu
459 @item @code{IMAG(Z)}  @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)}    @tab gnu
460 @item @code{IMAGPART(Z)} @tab @code{COMPLEX(*) Z} @tab @code{REAL(*)} @tab gnu
461 @end multitable
462 @end table
466 @node AINT
467 @section @code{AINT} --- Imaginary part of complex number  
468 @findex @code{AINT} intrinsic
469 @findex @code{DINT} intrinsic
470 @cindex whole number
472 @table @asis
473 @item @emph{Description}:
474 @code{AINT(X [, KIND])} truncates its argument to a whole number.
476 @item @emph{Option}:
477 f95, gnu
479 @item @emph{Class}:
480 elemental function
482 @item @emph{Syntax}:
483 @code{X = AINT(X)} 
484 @code{X = AINT(X, KIND)}
486 @item @emph{Arguments}:
487 @multitable @columnfractions .15 .80
488 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
489 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
490 initialization expression.
491 @end multitable
493 @item @emph{Return value}:
494 The return value is of type real with the kind type parameter of the
495 argument if the optional @var{KIND} is absent; otherwise, the kind
496 type parameter will be given by @var{KIND}.  If the magnitude of 
497 @var{X} is less than one, then @code{AINT(X)} returns zero.  If the
498 magnitude is equal to or greater than one, then it returns the largest
499 whole number that does not exceed its magnitude.  The sign is the same
500 as the sign of @var{X}. 
502 @item @emph{Example}:
503 @smallexample
504 program test_aint
505   real(4) x4
506   real(8) x8
507   x4 = 1.234E0_4
508   x8 = 4.321_8
509   print *, aint(x4), dint(x8)
510   x8 = aint(x4,8)
511 end program test_aint
512 @end smallexample
514 @item @emph{Specific names}:
515 @multitable @columnfractions .24 .24 .24 .24
516 @item Name           @tab Argument         @tab Return type      @tab Option
517 @item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab f95, gnu
518 @end multitable
519 @end table
523 @node ALARM
524 @section @code{ALARM} --- Execute a routine after a given delay
525 @findex @code{ALARM} intrinsic
527 @table @asis
528 @item @emph{Description}:
529 @code{ALARM(SECONDS [, STATUS])} causes external subroutine @var{HANDLER}
530 to be executed after a delay of @var{SECONDS} by using @code{alarm(1)} to
531 set up a signal and @code{signal(2)} to catch it. If @var{STATUS} is
532 supplied, it will be returned with the number of seconds remaining until
533 any previously scheduled alarm was due to be delivered, or zero if there
534 was no previously scheduled alarm.
536 @item @emph{Option}:
539 @item @emph{Class}:
540 subroutine
542 @item @emph{Syntax}:
543 @code{CALL ALARM(SECONDS, HANDLER)} 
544 @code{CALL ALARM(SECONDS, HANDLER, STATUS)}
546 @item @emph{Arguments}:
547 @multitable @columnfractions .15 .80
548 @item @var{SECONDS} @tab The type of the argument shall be a scalar
549 @code{INTEGER}. It is @code{INTENT(IN)}.
550 @item @var{HANDLER} @tab Signal handler (@code{INTEGER FUNCTION} or
551 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
552 @code{INTEGER}. It is @code{INTENT(IN)}.
553 @item @var{STATUS}  @tab (Optional) @var{STATUS} shall be a scalar
554 @code{INTEGER} variable. It is @code{INTENT(OUT)}.
555 @end multitable
557 @item @emph{Example}:
558 @smallexample
559 program test_alarm
560   external handler_print
561   integer i
562   call alarm (3, handler_print, i)
563   print *, i
564   call sleep(10)
565 end program test_alarm
566 @end smallexample
567 This will cause the external routine @var{handler_print} to be called
568 after 3 seconds.
569 @end table
573 @node ALL
574 @section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true 
575 @findex @code{ALL} intrinsic
576 @cindex true values
578 @table @asis
579 @item @emph{Description}:
580 @code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}
581 in the array along dimension @var{DIM}.
583 @item @emph{Option}:
584 f95, gnu
586 @item @emph{Class}:
587 transformational function
589 @item @emph{Syntax}:
590 @code{L = ALL(MASK)} 
591 @code{L = ALL(MASK, DIM)}
593 @item @emph{Arguments}:
594 @multitable @columnfractions .15 .80
595 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
596 it shall not be scalar.
597 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
598 with a value that lies between one and the rank of @var{MASK}.
599 @end multitable
601 @item @emph{Return value}:
602 @code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
603 the kind type parameter is the same as the kind type parameter of
604 @var{MASK}.  If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns
605 an array with the rank of @var{MASK} minus 1.  The shape is determined from
606 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
608 @table @asis
609 @item (A)
610 @code{ALL(MASK)} is true if all elements of @var{MASK} are true.
611 It also is true if @var{MASK} has zero size; otherwise, it is false.
612 @item (B)
613 If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent
614 to @code{ALL(MASK)}.  If the rank is greater than one, then @code{ALL(MASK,DIM)}
615 is determined by applying @code{ALL} to the array sections.
616 @end table
618 @item @emph{Example}:
619 @smallexample
620 program test_all
621   logical l
622   l = all((/.true., .true., .true./))
623   print *, l
624   call section
625   contains
626     subroutine section
627       integer a(2,3), b(2,3)
628       a = 1
629       b = 1
630       b(2,2) = 2
631       print *, all(a .eq. b, 1)
632       print *, all(a .eq. b, 2)
633     end subroutine section
634 end program test_all
635 @end smallexample
636 @end table
640 @node ALLOCATED
641 @section @code{ALLOCATED} --- Status of an allocatable entity
642 @findex @code{ALLOCATED} intrinsic
643 @cindex allocation status
645 @table @asis
646 @item @emph{Description}:
647 @code{ALLOCATED(X)} checks the status of whether @var{X} is allocated.
649 @item @emph{Option}:
650 f95, gnu
652 @item @emph{Class}:
653 inquiry function
655 @item @emph{Syntax}:
656 @code{L = ALLOCATED(X)}
658 @item @emph{Arguments}:
659 @multitable @columnfractions .15 .80
660 @item @var{X}    @tab The argument shall be an @code{ALLOCATABLE} array.
661 @end multitable
663 @item @emph{Return value}:
664 The return value is a scalar @code{LOGICAL} with the default logical
665 kind type parameter.  If @var{X} is allocated, @code{ALLOCATED(X)}
666 is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.} 
668 @item @emph{Example}:
669 @smallexample
670 program test_allocated
671   integer :: i = 4
672   real(4), allocatable :: x(:)
673   if (allocated(x) .eqv. .false.) allocate(x(i)
674 end program test_allocated
675 @end smallexample
676 @end table
680 @node ANINT
681 @section @code{ANINT} --- Imaginary part of complex number  
682 @findex @code{ANINT} intrinsic
683 @findex @code{DNINT} intrinsic
684 @cindex whole number
686 @table @asis
687 @item @emph{Description}:
688 @code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.
690 @item @emph{Option}:
691 f95, gnu
693 @item @emph{Class}:
694 elemental function
696 @item @emph{Syntax}:
697 @code{X = ANINT(X)}
698 @code{X = ANINT(X, KIND)}
700 @item @emph{Arguments}:
701 @multitable @columnfractions .15 .80
702 @item @var{X}    @tab The type of the argument shall be @code{REAL(*)}.
703 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
704 initialization expression.
705 @end multitable
707 @item @emph{Return value}:
708 The return value is of type real with the kind type parameter of the
709 argument if the optional @var{KIND} is absent; otherwise, the kind
710 type parameter will be given by @var{KIND}.  If @var{X} is greater than
711 zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}.  If @var{X} is
712 less than or equal to zero, then return @code{AINT(X-0.5)}.
714 @item @emph{Example}:
715 @smallexample
716 program test_anint
717   real(4) x4
718   real(8) x8
719   x4 = 1.234E0_4
720   x8 = 4.321_8
721   print *, anint(x4), dnint(x8)
722   x8 = anint(x4,8)
723 end program test_anint
724 @end smallexample
726 @item @emph{Specific names}:
727 @multitable @columnfractions .24 .24 .24 .24
728 @item Name            @tab Argument         @tab Return type      @tab Option
729 @item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)}   @tab f95, gnu
730 @end multitable
731 @end table
735 @node ANY
736 @section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true 
737 @findex @code{ANY} intrinsic
738 @cindex true values
740 @table @asis
741 @item @emph{Description}:
742 @code{ANY(MASK [, DIM])} determines if any of the values in the logical array
743 @var{MASK} along dimension @var{DIM} are @code{.TRUE.}.
745 @item @emph{Option}:
746 f95, gnu
748 @item @emph{Class}:
749 transformational function
751 @item @emph{Syntax}:
752 @code{L = ANY(MASK)} 
753 @code{L = ANY(MASK, DIM)}
755 @item @emph{Arguments}:
756 @multitable @columnfractions .15 .80
757 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
758 it shall not be scalar.
759 @item @var{DIM}  @tab (Optional) @var{DIM} shall be a scalar integer
760 with a value that lies between one and the rank of @var{MASK}.
761 @end multitable
763 @item @emph{Return value}:
764 @code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
765 the kind type parameter is the same as the kind type parameter of
766 @var{MASK}.  If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns
767 an array with the rank of @var{MASK} minus 1.  The shape is determined from
768 the shape of @var{MASK} where the @var{DIM} dimension is elided. 
770 @table @asis
771 @item (A)
772 @code{ANY(MASK)} is true if any element of @var{MASK} is true;
773 otherwise, it is false.  It also is false if @var{MASK} has zero size.
774 @item (B)
775 If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent
776 to @code{ANY(MASK)}.  If the rank is greater than one, then @code{ANY(MASK,DIM)}
777 is determined by applying @code{ANY} to the array sections.
778 @end table
780 @item @emph{Example}:
781 @smallexample
782 program test_any
783   logical l
784   l = any((/.true., .true., .true./))
785   print *, l
786   call section
787   contains
788     subroutine section
789       integer a(2,3), b(2,3)
790       a = 1
791       b = 1
792       b(2,2) = 2
793       print *, any(a .eq. b, 1)
794       print *, any(a .eq. b, 2)
795     end subroutine section
796 end program test_any
797 @end smallexample
798 @end table
802 @node ASIN
803 @section @code{ASIN} --- Arcsine function 
804 @findex @code{ASIN} intrinsic
805 @findex @code{DASIN} intrinsic
806 @cindex arcsine
808 @table @asis
809 @item @emph{Description}:
810 @code{ASIN(X)} computes the arcsine of its @var{X}.
812 @item @emph{Option}:
813 f95, gnu
815 @item @emph{Class}:
816 elemental function
818 @item @emph{Syntax}:
819 @code{X = ASIN(X)}
821 @item @emph{Arguments}:
822 @multitable @columnfractions .15 .80
823 @item @var{X} @tab The type shall be @code{REAL(*)}, and a magnitude that is
824 less than one.
825 @end multitable
827 @item @emph{Return value}:
828 The return value is of type @code{REAL(*)} and it lies in the
829 range @math{-\pi / 2 \leq \arccos (x) \leq \pi / 2}.  The kind type
830 parameter is the same as @var{X}.
832 @item @emph{Example}:
833 @smallexample
834 program test_asin
835   real(8) :: x = 0.866_8
836   x = asin(x)
837 end program test_asin
838 @end smallexample
840 @item @emph{Specific names}:
841 @multitable @columnfractions .24 .24 .24 .24
842 @item Name            @tab Argument          @tab Return type       @tab Option
843 @item @code{DASIN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
844 @end multitable
845 @end table
849 @node ASSOCIATED
850 @section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair 
851 @findex @code{ASSOCIATED} intrinsic
852 @cindex pointer status
854 @table @asis
855 @item @emph{Description}:
856 @code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR}
857 or if @var{PTR} is associated with the target @var{TGT}.
859 @item @emph{Option}:
860 f95, gnu
862 @item @emph{Class}:
863 inquiry function
865 @item @emph{Syntax}:
866 @code{L = ASSOCIATED(PTR)} 
867 @code{L = ASSOCIATED(PTR [, TGT])}
869 @item @emph{Arguments}:
870 @multitable @columnfractions .15 .80
871 @item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute and
872 it can be of any type.
873 @item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} or
874 a @code{TARGET}.  It must have the same type, kind type parameter, and
875 array rank as @var{PTR}.
876 @end multitable
877 The status of neither @var{PTR} nor @var{TGT} can be undefined.
879 @item @emph{Return value}:
880 @code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}.
881 There are several cases:
882 @table @asis
883 @item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)}
884 is true if @var{PTR} is associated with a target; otherwise, it returns false.
885 @item (B) If @var{TGT} is present and a scalar target, the result is true if
886 @var{TGT}
887 is not a 0 sized storage sequence and the target associated with @var{PTR}
888 occupies the same storage units.  If @var{PTR} is disassociated, then the 
889 result is false.
890 @item (C) If @var{TGT} is present and an array target, the result is true if
891 @var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, are
892 arrays whose elements are not 0 sized storage sequences, and @var{TGT} and
893 @var{PTR} occupy the same storage units in array element order.
894 As in case(B), the result is false, if @var{PTR} is disassociated.
895 @item (D) If @var{TGT} is present and an scalar pointer, the result is true if
896 target associated with @var{PTR} and the target associated with @var{TGT}
897 are not 0 sized storage sequences and occupy the same storage units.
898 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
899 @item (E) If @var{TGT} is present and an array pointer, the result is true if
900 target associated with @var{PTR} and the target associated with @var{TGT}
901 have the same shape, are not 0 sized arrays, are arrays whose elements are
902 not 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the same
903 storage units in array element order.
904 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
905 @end table
907 @item @emph{Example}:
908 @smallexample
909 program test_associated
910    implicit none
911    real, target  :: tgt(2) = (/1., 2./)
912    real, pointer :: ptr(:)
913    ptr => tgt
914    if (associated(ptr)     .eqv. .false.) call abort
915    if (associated(ptr,tgt) .eqv. .false.) call abort
916 end program test_associated
917 @end smallexample
918 @end table
922 @node ATAN
923 @section @code{ATAN} --- Arctangent function 
924 @findex @code{ATAN} intrinsic
925 @findex @code{DATAN} intrinsic
926 @cindex arctangent
928 @table @asis
929 @item @emph{Description}:
930 @code{ATAN(X)} computes the arctangent of @var{X}.
932 @item @emph{Option}:
933 f95, gnu
935 @item @emph{Class}:
936 elemental function
938 @item @emph{Syntax}:
939 @code{X = ATAN(X)}
941 @item @emph{Arguments}:
942 @multitable @columnfractions .15 .80
943 @item @var{X} @tab The type shall be @code{REAL(*)}.
944 @end multitable
946 @item @emph{Return value}:
947 The return value is of type @code{REAL(*)} and it lies in the
948 range @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}.
950 @item @emph{Example}:
951 @smallexample
952 program test_atan
953   real(8) :: x = 2.866_8
954   x = atan(x)
955 end program test_atan
956 @end smallexample
958 @item @emph{Specific names}:
959 @multitable @columnfractions .24 .24 .24 .24
960 @item Name            @tab Argument          @tab Return type       @tab Option
961 @item @code{DATAN(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
962 @end multitable
963 @end table
967 @node ATAN2
968 @section @code{ATAN2} --- Arctangent function 
969 @findex @code{ATAN2} intrinsic
970 @findex @code{DATAN2} intrinsic
971 @cindex arctangent
973 @table @asis
974 @item @emph{Description}:
975 @code{ATAN2(Y,X)} computes the arctangent of the complex number @math{X + i Y}.
977 @item @emph{Option}:
978 f95, gnu
980 @item @emph{Class}:
981 elemental function
983 @item @emph{Syntax}:
984 @code{X = ATAN2(Y,X)}
986 @item @emph{Arguments}:
987 @multitable @columnfractions .15 .80
988 @item @var{Y} @tab The type shall be @code{REAL(*)}.
989 @item @var{X} @tab The type and kind type parameter shall be the same as @var{Y}.
990 If @var{Y} is zero, then @var{X} must be nonzero.
991 @end multitable
993 @item @emph{Return value}:
994 The return value has the same type and kind type parameter as @var{Y}.
995 It is the principle value of the complex number @math{X + i Y}.  If
996 @var{X} is nonzero, then it lies in the range @math{-\pi \le \arccos (x) \leq \pi}.
997 The sign is positive if @var{Y} is positive.  If @var{Y} is zero, then
998 the return value is zero if @var{X} is positive and @math{\pi} if @var{X}
999 is negative.  Finally, if @var{X} is zero, then the magnitude of the result
1000 is @math{\pi/2}.
1002 @item @emph{Example}:
1003 @smallexample
1004 program test_atan2
1005   real(4) :: x = 1.e0_4, y = 0.5e0_4
1006   x = atan2(y,x)
1007 end program test_atan2
1008 @end smallexample
1010 @item @emph{Specific names}:
1011 @multitable @columnfractions .24 .24 .24 .24
1012 @item Name            @tab Argument          @tab Return type    @tab Option
1013 @item @code{DATAN2(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1014 @end multitable
1015 @end table
1019 @node BESJ0
1020 @section @code{BESJ0} --- Bessel function of the first kind of order 0
1021 @findex @code{BESJ0} intrinsic
1022 @findex @code{DBESJ0} intrinsic
1023 @cindex Bessel
1025 @table @asis
1026 @item @emph{Description}:
1027 @code{BESJ0(X)} computes the Bessel function of the first kind of order 0
1028 of @var{X}.
1030 @item @emph{Option}:
1033 @item @emph{Class}:
1034 elemental function
1036 @item @emph{Syntax}:
1037 @code{X = BESJ0(X)}
1039 @item @emph{Arguments}:
1040 @multitable @columnfractions .15 .80
1041 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1042 @end multitable
1044 @item @emph{Return value}:
1045 The return value is of type @code{REAL(*)} and it lies in the
1046 range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
1048 @item @emph{Example}:
1049 @smallexample
1050 program test_besj0
1051   real(8) :: x = 0.0_8
1052   x = besj0(x)
1053 end program test_besj0
1054 @end smallexample
1056 @item @emph{Specific names}:
1057 @multitable @columnfractions .24 .24 .24 .24
1058 @item Name            @tab Argument          @tab Return type       @tab Option
1059 @item @code{DBESJ0(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1060 @end multitable
1061 @end table
1065 @node BESJ1
1066 @section @code{BESJ1} --- Bessel function of the first kind of order 1
1067 @findex @code{BESJ1} intrinsic
1068 @findex @code{DBESJ1} intrinsic
1069 @cindex Bessel
1071 @table @asis
1072 @item @emph{Description}:
1073 @code{BESJ1(X)} computes the Bessel function of the first kind of order 1
1074 of @var{X}.
1076 @item @emph{Option}:
1079 @item @emph{Class}:
1080 elemental function
1082 @item @emph{Syntax}:
1083 @code{X = BESJ1(X)}
1085 @item @emph{Arguments}:
1086 @multitable @columnfractions .15 .80
1087 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1088 @end multitable
1090 @item @emph{Return value}:
1091 The return value is of type @code{REAL(*)} and it lies in the
1092 range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
1094 @item @emph{Example}:
1095 @smallexample
1096 program test_besj1
1097   real(8) :: x = 1.0_8
1098   x = besj1(x)
1099 end program test_besj1
1100 @end smallexample
1102 @item @emph{Specific names}:
1103 @multitable @columnfractions .24 .24 .24 .24
1104 @item Name            @tab Argument          @tab Return type       @tab Option
1105 @item @code{DBESJ1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1106 @end multitable
1107 @end table
1111 @node BESJN
1112 @section @code{BESJN} --- Bessel function of the first kind
1113 @findex @code{BESJN} intrinsic
1114 @findex @code{DBESJN} intrinsic
1115 @cindex Bessel
1117 @table @asis
1118 @item @emph{Description}:
1119 @code{BESJN(N, X)} computes the Bessel function of the first kind of order
1120 @var{N} of @var{X}.
1122 @item @emph{Option}:
1125 @item @emph{Class}:
1126 elemental function
1128 @item @emph{Syntax}:
1129 @code{Y = BESJN(N, X)}
1131 @item @emph{Arguments}:
1132 @multitable @columnfractions .15 .80
1133 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1134 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1135 @end multitable
1137 @item @emph{Return value}:
1138 The return value is a scalar of type @code{REAL(*)}.
1140 @item @emph{Example}:
1141 @smallexample
1142 program test_besjn
1143   real(8) :: x = 1.0_8
1144   x = besjn(5,x)
1145 end program test_besjn
1146 @end smallexample
1148 @item @emph{Specific names}:
1149 @multitable @columnfractions .24 .24 .24 .24
1150 @item Name             @tab Argument            @tab Return type       @tab Option
1151 @item @code{DBESJN(X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}    @tab gnu
1152 @item                  @tab @code{REAL(8) X}    @tab                   @tab
1153 @end multitable
1154 @end table
1158 @node BESY0
1159 @section @code{BESY0} --- Bessel function of the second kind of order 0
1160 @findex @code{BESY0} intrinsic
1161 @findex @code{DBESY0} intrinsic
1162 @cindex Bessel
1164 @table @asis
1165 @item @emph{Description}:
1166 @code{BESY0(X)} computes the Bessel function of the second kind of order 0
1167 of @var{X}.
1169 @item @emph{Option}:
1172 @item @emph{Class}:
1173 elemental function
1175 @item @emph{Syntax}:
1176 @code{X = BESY0(X)}
1178 @item @emph{Arguments}:
1179 @multitable @columnfractions .15 .80
1180 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1181 @end multitable
1183 @item @emph{Return value}:
1184 The return value is a scalar of type @code{REAL(*)}.
1186 @item @emph{Example}:
1187 @smallexample
1188 program test_besy0
1189   real(8) :: x = 0.0_8
1190   x = besy0(x)
1191 end program test_besy0
1192 @end smallexample
1194 @item @emph{Specific names}:
1195 @multitable @columnfractions .24 .24 .24 .24
1196 @item Name            @tab Argument          @tab Return type       @tab Option
1197 @item @code{DBESY0(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1198 @end multitable
1199 @end table
1203 @node BESY1
1204 @section @code{BESY1} --- Bessel function of the second kind of order 1
1205 @findex @code{BESY1} intrinsic
1206 @findex @code{DBESY1} intrinsic
1207 @cindex Bessel
1209 @table @asis
1210 @item @emph{Description}:
1211 @code{BESY1(X)} computes the Bessel function of the second kind of order 1
1212 of @var{X}.
1214 @item @emph{Option}:
1217 @item @emph{Class}:
1218 elemental function
1220 @item @emph{Syntax}:
1221 @code{X = BESY1(X)}
1223 @item @emph{Arguments}:
1224 @multitable @columnfractions .15 .80
1225 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1226 @end multitable
1228 @item @emph{Return value}:
1229 The return value is a scalar of type @code{REAL(*)}.
1231 @item @emph{Example}:
1232 @smallexample
1233 program test_besy1
1234   real(8) :: x = 1.0_8
1235   x = besy1(x)
1236 end program test_besy1
1237 @end smallexample
1239 @item @emph{Specific names}:
1240 @multitable @columnfractions .24 .24 .24 .24
1241 @item Name            @tab Argument          @tab Return type       @tab Option
1242 @item @code{DBESY1(X)}@tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
1243 @end multitable
1244 @end table
1248 @node BESYN
1249 @section @code{BESYN} --- Bessel function of the second kind
1250 @findex @code{BESYN} intrinsic
1251 @findex @code{DBESYN} intrinsic
1252 @cindex Bessel
1254 @table @asis
1255 @item @emph{Description}:
1256 @code{BESYN(N, X)} computes the Bessel function of the second kind of order
1257 @var{N} of @var{X}.
1259 @item @emph{Option}:
1262 @item @emph{Class}:
1263 elemental function
1265 @item @emph{Syntax}:
1266 @code{Y = BESYN(N, X)}
1268 @item @emph{Arguments}:
1269 @multitable @columnfractions .15 .80
1270 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1271 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1272 @end multitable
1274 @item @emph{Return value}:
1275 The return value is a scalar of type @code{REAL(*)}.
1277 @item @emph{Example}:
1278 @smallexample
1279 program test_besyn
1280   real(8) :: x = 1.0_8
1281   x = besyn(5,x)
1282 end program test_besyn
1283 @end smallexample
1285 @item @emph{Specific names}:
1286 @multitable @columnfractions .24 .24 .24 .24
1287 @item Name               @tab Argument            @tab Return type     @tab Option
1288 @item @code{DBESYN(N,X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)}  @tab gnu
1289 @item                    @tab @code{REAL(8)    X} @tab                 @tab 
1290 @end multitable
1291 @end table
1295 @node BIT_SIZE
1296 @section @code{BIT_SIZE} --- Bit size inquiry function
1297 @findex @code{BIT_SIZE} intrinsic
1298 @cindex bit_size
1300 @table @asis
1301 @item @emph{Description}:
1302 @code{BIT_SIZE(I)} returns the number of bits (integer precision plus sign bit)
1303 represented by the type of @var{I}.
1305 @item @emph{Option}:
1306 f95, gnu
1308 @item @emph{Class}:
1309 elemental function
1311 @item @emph{Syntax}:
1312 @code{I = BIT_SIZE(I)}
1314 @item @emph{Arguments}:
1315 @multitable @columnfractions .15 .80
1316 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1317 @end multitable
1319 @item @emph{Return value}:
1320 The return value is of type @code{INTEGER(*)}
1322 @item @emph{Example}:
1323 @smallexample
1324 program test_bit_size
1325     integer :: i = 123
1326     integer :: size
1327     size = bit_size(i)
1328     print *, size
1329 end program test_bit_size
1330 @end smallexample
1331 @end table
1335 @node BTEST
1336 @section @code{BTEST} --- Bit test function
1337 @findex @code{BTEST} intrinsic
1338 @cindex BTEST
1340 @table @asis
1341 @item @emph{Description}:
1342 @code{BTEST(I,POS)} returns logical @code{.TRUE.} if the bit at @var{POS}
1343 in @var{I} is set.
1345 @item @emph{Option}:
1346 f95, gnu
1348 @item @emph{Class}:
1349 elemental function
1351 @item @emph{Syntax}:
1352 @code{I = BTEST(I,POS)}
1354 @item @emph{Arguments}:
1355 @multitable @columnfractions .15 .80
1356 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1357 @item @var{POS} @tab The type shall be @code{INTEGER(*)}.
1358 @end multitable
1360 @item @emph{Return value}:
1361 The return value is of type @code{LOGICAL}
1363 @item @emph{Example}:
1364 @smallexample
1365 program test_btest
1366     integer :: i = 32768 + 1024 + 64
1367     integer :: pos
1368     logical :: bool
1369     do pos=0,16
1370         bool = btest(i, pos) 
1371         print *, pos, bool
1372     end do
1373 end program test_btest
1374 @end smallexample
1375 @end table
1379 @node CEILING
1380 @section @code{CEILING} --- Integer ceiling function
1381 @findex @code{CEILING} intrinsic
1382 @cindex CEILING
1384 @table @asis
1385 @item @emph{Description}:
1386 @code{CEILING(X)} returns the least integer greater than or equal to @var{X}.
1388 @item @emph{Option}:
1389 f95, gnu
1391 @item @emph{Class}:
1392 elemental function
1394 @item @emph{Syntax}:
1395 @code{I = CEILING(X[,KIND])}
1397 @item @emph{Arguments}:
1398 @multitable @columnfractions .15 .80
1399 @item @var{X} @tab The type shall be @code{REAL(*)}.
1400 @item @var{KIND} @tab Optional scaler integer initialization expression.
1401 @end multitable
1403 @item @emph{Return value}:
1404 The return value is of type @code{INTEGER(KIND)}
1406 @item @emph{Example}:
1407 @smallexample
1408 program test_ceiling
1409     real :: x = 63.29
1410     real :: y = -63.59
1411     print *, ceiling(x) ! returns 64
1412     print *, ceiling(y) ! returns -63
1413 end program test_ceiling
1414 @end smallexample
1415 @end table
1419 @node CHAR
1420 @section @code{CHAR} --- Character conversion function
1421 @findex @code{CHAR} intrinsic
1422 @cindex CHAR
1424 @table @asis
1425 @item @emph{Description}:
1426 @code{CHAR(I,[KIND])} returns the character represented by the integer @var{I}.
1428 @item @emph{Option}:
1429 f95, gnu
1431 @item @emph{Class}:
1432 elemental function
1434 @item @emph{Syntax}:
1435 @code{C = CHAR(I[,KIND])}
1437 @item @emph{Arguments}:
1438 @multitable @columnfractions .15 .80
1439 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1440 @item @var{KIND} @tab Optional scaler integer initialization expression.
1441 @end multitable
1443 @item @emph{Return value}:
1444 The return value is of type @code{CHARACTER(1)}
1446 @item @emph{Example}:
1447 @smallexample
1448 program test_char
1449     integer :: i = 74
1450     character(1) :: c
1451     c = char(i)
1452     print *, i, c ! returns 'J'
1453 end program test_char
1454 @end smallexample
1455 @end table
1459 @node CMPLX
1460 @section @code{CMPLX} --- Complex conversion function
1461 @findex @code{CMPLX} intrinsic
1462 @cindex CMPLX
1464 @table @asis
1465 @item @emph{Description}:
1466 @code{CMPLX(X,[Y,KIND])} returns a complex number where @var{X} is converted to
1467 the real component.  If @var{Y} is present it is converted to the imaginary
1468 component.  If @var{Y} is not present then the imaginary component is set to
1469 0.0.  If @var{X} is complex then @var{Y} must not be present.
1471 @item @emph{Option}:
1472 f95, gnu
1474 @item @emph{Class}:
1475 elemental function
1477 @item @emph{Syntax}:
1478 @code{C = CMPLX(X[,Y,KIND])}
1480 @item @emph{Arguments}:
1481 @multitable @columnfractions .15 .80
1482 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1483 @item @var{Y} @tab Optional, allowed if @var{X} is not @code{COMPLEX(*)}.  May be @code{INTEGER(*)} or @code{REAL(*)}. 
1484 @item @var{KIND} @tab Optional scaler integer initialization expression.
1485 @end multitable
1487 @item @emph{Return value}:
1488 The return value is of type @code{COMPLEX(*)}
1490 @item @emph{Example}:
1491 @smallexample
1492 program test_cmplx
1493     integer :: i = 42
1494     real :: x = 3.14
1495     complex :: z
1496     z = cmplx(i, x)
1497     print *, z, cmplx(x)
1498 end program test_cmplx
1499 @end smallexample
1500 @end table
1504 @node COMMAND_ARGUMENT_COUNT
1505 @section @code{COMMAND_ARGUMENT_COUNT} --- Argument count function 
1506 @findex @code{COMMAND_ARGUMENT_COUNT} intrinsic
1507 @cindex command argument count
1509 @table @asis
1510 @item @emph{Description}:
1511 @code{COMMAND_ARGUMENT_COUNT()} returns the number of arguments passed on the
1512 command line when the containing program was invoked.
1514 @item @emph{Option}:
1515 f2003, gnu
1517 @item @emph{Class}:
1518 non-elemental function
1520 @item @emph{Syntax}:
1521 @code{I = COMMAND_ARGUMENT_COUNT()}
1523 @item @emph{Arguments}:
1524 @multitable @columnfractions .15 .80
1525 @item None
1526 @end multitable
1528 @item @emph{Return value}:
1529 The return value is of type @code{INTEGER(4)}
1531 @item @emph{Example}:
1532 @smallexample
1533 program test_command_argument_count
1534     integer :: count
1535     count = command_argument_count()
1536     print *, count
1537 end program test_command_argument_count
1538 @end smallexample
1539 @end table
1543 @node CONJG
1544 @section @code{CONJG} --- Complex conjugate function 
1545 @findex @code{CONJG} intrinsic
1546 @findex @code{DCONJG} intrinsic
1547 @cindex complex conjugate
1548 @table @asis
1549 @item @emph{Description}:
1550 @code{CONJG(Z)} returns the conjugate of @var{Z}.  If @var{Z} is @code{(x, y)}
1551 then the result is @code{(x, -y)}
1553 @item @emph{Option}:
1554 f95, gnu
1556 @item @emph{Class}:
1557 elemental function
1559 @item @emph{Syntax}:
1560 @code{Z = CONJG(Z)}
1562 @item @emph{Arguments}:
1563 @multitable @columnfractions .15 .80
1564 @item @var{Z} @tab The type shall be @code{COMPLEX(*)}.
1565 @end multitable
1567 @item @emph{Return value}:
1568 The return value is of type @code{COMPLEX(*)}.
1570 @item @emph{Example}:
1571 @smallexample
1572 program test_conjg
1573     complex :: z = (2.0, 3.0)
1574     complex(8) :: dz = (2.71_8, -3.14_8)
1575     z= conjg(z)
1576     print *, z
1577     dz = dconjg(dz)
1578     print *, dz
1579 end program test_conjg
1580 @end smallexample
1582 @item @emph{Specific names}:
1583 @multitable @columnfractions .24 .24 .24 .24
1584 @item Name             @tab Argument             @tab Return type          @tab Option
1585 @item @code{DCONJG(Z)} @tab @code{COMPLEX(8) Z}  @tab @code{COMPLEX(8)}    @tab gnu
1586 @end multitable
1587 @end table
1591 @node COS
1592 @section @code{COS} --- Cosine function 
1593 @findex @code{COS} intrinsic
1594 @findex @code{DCOS} intrinsic
1595 @findex @code{ZCOS} intrinsic
1596 @findex @code{CDCOS} intrinsic
1597 @cindex cosine
1599 @table @asis
1600 @item @emph{Description}:
1601 @code{COS(X)} computes the cosine of @var{X}.
1603 @item @emph{Option}:
1604 f95, gnu
1606 @item @emph{Class}:
1607 elemental function
1609 @item @emph{Syntax}:
1610 @code{X = COS(X)}
1612 @item @emph{Arguments}:
1613 @multitable @columnfractions .15 .80
1614 @item @var{X} @tab The type shall be @code{REAL(*)} or
1615 @code{COMPLEX(*)}.
1616 @end multitable
1618 @item @emph{Return value}:
1619 The return value has the same type and kind as @var{X}.
1621 @item @emph{Example}:
1622 @smallexample
1623 program test_cos
1624   real :: x = 0.0
1625   x = cos(x)
1626 end program test_cos
1627 @end smallexample
1629 @item @emph{Specific names}:
1630 @multitable @columnfractions .24 .24 .24 .24
1631 @item Name            @tab Argument          @tab Return type     @tab Option
1632 @item @code{DCOS(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}  @tab f95, gnu
1633 @item @code{CCOS(X)}@tab @code{COMPLEX(4) X}@tab @code{COMPLEX(4)}@tab f95, gnu
1634 @item @code{ZCOS(X)}@tab @code{COMPLEX(8) X}@tab @code{COMPLEX(8)}@tab f95, gnu
1635 @item @code{CDCOS(X)}@tab @code{COMPLEX(8) X}@tab @code{COMPLEX(8)}@tab f95, gnu
1636 @end multitable
1637 @end table
1641 @node COSH
1642 @section @code{COSH} --- Hyperbolic cosine function 
1643 @findex @code{COSH} intrinsic
1644 @findex @code{DCOSH} intrinsic
1645 @cindex hyperbolic cosine
1647 @table @asis
1648 @item @emph{Description}:
1649 @code{COSH(X)} computes the hyperbolic cosine of @var{X}.
1651 @item @emph{Option}:
1652 f95, gnu
1654 @item @emph{Class}:
1655 elemental function
1657 @item @emph{Syntax}:
1658 @code{X = COSH(X)}
1660 @item @emph{Arguments}:
1661 @multitable @columnfractions .15 .80
1662 @item @var{X} @tab The type shall be @code{REAL(*)}.
1663 @end multitable
1665 @item @emph{Return value}:
1666 The return value is of type @code{REAL(*)} and it is positive
1667 (@math{ \cosh (x) \geq 0 }.
1669 @item @emph{Example}:
1670 @smallexample
1671 program test_cosh
1672   real(8) :: x = 1.0_8
1673   x = cosh(x)
1674 end program test_cosh
1675 @end smallexample
1677 @item @emph{Specific names}:
1678 @multitable @columnfractions .24 .24 .24 .24
1679 @item Name            @tab Argument          @tab Return type       @tab Option
1680 @item @code{DCOSH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
1681 @end multitable
1682 @end table
1686 @node COUNT
1687 @section @code{COUNT} --- Count function
1688 @findex @code{COUNT} intrinsic
1689 @cindex count
1691 @table @asis
1692 @item @emph{Description}:
1693 @code{COUNT(MASK[,DIM])} counts the number of @code{.TRUE.} elements of
1694 @var{MASK} along the dimension of @var{DIM}.  If @var{DIM} is omitted it is
1695 taken to be @code{1}.  @var{DIM} is a scaler of type @code{INTEGER} in the
1696 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{MASK}.
1698 @item @emph{Option}:
1699 f95, gnu
1701 @item @emph{Class}:
1702 transformational function
1704 @item @emph{Syntax}:
1705 @code{I = COUNT(MASK[,DIM])}
1707 @item @emph{Arguments}:
1708 @multitable @columnfractions .15 .80
1709 @item @var{MASK} @tab The type shall be @code{LOGICAL}.
1710 @item @var{DIM}  @tab The type shall be @code{INTEGER}.
1711 @end multitable
1713 @item @emph{Return value}:
1714 The return value is of type @code{INTEGER} with rank equal to that of
1715 @var{MASK}.
1717 @item @emph{Example}:
1718 @smallexample
1719 program test_count
1720     integer, dimension(2,3) :: a, b
1721     logical, dimension(2,3) :: mask
1722     a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
1723     b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
1724     print '(3i3)', a(1,:)
1725     print '(3i3)', a(2,:)
1726     print *
1727     print '(3i3)', b(1,:)
1728     print '(3i3)', b(2,:)
1729     print *
1730     mask = a.ne.b
1731     print '(3l3)', mask(1,:)
1732     print '(3l3)', mask(2,:)
1733     print *
1734     print '(3i3)', count(mask)
1735     print *
1736     print '(3i3)', count(mask, 1)
1737     print *
1738     print '(3i3)', count(mask, 2)
1739 end program test_count
1740 @end smallexample
1741 @end table
1745 @node CPU_TIME
1746 @section @code{CPU_TIME} --- CPU elapsed time in seconds
1747 @findex @code{CPU_TIME} intrinsic
1748 @cindex CPU_TIME
1750 @table @asis
1751 @item @emph{Description}:
1752 Returns a @code{REAL} value representing the elapsed CPU time in seconds.  This
1753 is useful for testing segments of code to determine execution time.
1755 @item @emph{Option}:
1756 f95, gnu
1758 @item @emph{Class}:
1759 subroutine
1761 @item @emph{Syntax}:
1762 @code{CPU_TIME(X)}
1764 @item @emph{Arguments}:
1765 @multitable @columnfractions .15 .80
1766 @item @var{X} @tab The type shall be @code{REAL} with @code{INTENT(OUT)}.
1767 @end multitable
1769 @item @emph{Return value}:
1770 None
1772 @item @emph{Example}:
1773 @smallexample
1774 program test_cpu_time
1775     real :: start, finish
1776     call cpu_time(start)
1777         ! put code to test here
1778     call cpu_time(finish)
1779     print '("Time = ",f6.3," seconds.")',finish-start
1780 end program test_cpu_time
1781 @end smallexample
1782 @end table
1786 @node CSHIFT
1787 @section @code{CSHIFT} --- Circular shift function
1788 @findex @code{CSHIFT} intrinsic
1789 @cindex cshift intrinsic
1791 @table @asis
1792 @item @emph{Description}:
1793 @code{CSHIFT(ARRAY, SHIFT[,DIM])} performs a circular shift on elements of
1794 @var{ARRAY} along the dimension of @var{DIM}.  If @var{DIM} is omitted it is
1795 taken to be @code{1}.  @var{DIM} is a scaler of type @code{INTEGER} in the
1796 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{ARRAY}.
1797 If the rank of @var{ARRAY} is one, then all elements of @var{ARRAY} are shifted
1798 by @var{SHIFT} places.  If rank is greater than one, then all complete rank one
1799 sections of @var{ARRAY} along the given dimension are shifted.  Elements
1800 shifted out one end of each rank one section are shifted back in the other end.
1802 @item @emph{Option}:
1803 f95, gnu
1805 @item @emph{Class}:
1806 transformational function
1808 @item @emph{Syntax}:
1809 @code{A = CSHIFT(A, SHIFT[,DIM])}
1811 @item @emph{Arguments}:
1812 @multitable @columnfractions .15 .80
1813 @item @var{ARRAY}  @tab May be any type, not scaler.
1814 @item @var{SHIFT}  @tab The type shall be @code{INTEGER}.
1815 @item @var{DIM}    @tab The type shall be @code{INTEGER}.
1816 @end multitable
1818 @item @emph{Return value}:
1819 Returns an array of same type and rank as the @var{ARRAY} argument.
1821 @item @emph{Example}:
1822 @smallexample
1823 program test_cshift
1824     integer, dimension(3,3) :: a
1825     a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
1826     print '(3i3)', a(1,:)
1827     print '(3i3)', a(2,:)
1828     print '(3i3)', a(3,:)    
1829     a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
1830     print *
1831     print '(3i3)', a(1,:)
1832     print '(3i3)', a(2,:)
1833     print '(3i3)', a(3,:)
1834 end program test_cshift
1835 @end smallexample
1836 @end table
1839 @node CTIME
1840 @section @code{CTIME} --- Convert a time into a string
1841 @findex @code{CTIME} intrinsic
1842 @cindex ctime subroutine 
1844 @table @asis
1845 @item @emph{Description}:
1846 @code{CTIME(T,S)} converts @var{T}, a system time value, such as returned
1847 by @code{TIME8()}, to a string of the form @samp{Sat Aug 19 18:13:14
1848 1995}, and returns that string into @var{S}.
1850 If @code{CTIME} is invoked as a function, it can not be invoked as a
1851 subroutine, and vice versa.
1853 @var{T} is an @code{INTENT(IN)} @code{INTEGER(KIND=8)} variable.
1854 @var{S} is an @code{INTENT(OUT)} @code{CHARACTER} variable.
1856 @item @emph{Option}:
1859 @item @emph{Class}:
1860 subroutine
1862 @item @emph{Syntax}:
1863 @multitable @columnfractions .80
1864 @item @code{CALL CTIME(T,S)}.
1865 @item @code{S = CTIME(T)}, (not recommended).
1866 @end multitable
1868 @item @emph{Arguments}:
1869 @multitable @columnfractions .15 .80
1870 @item @var{S}@tab The type shall be of type @code{CHARACTER}.
1871 @item @var{T}@tab The type shall be of type @code{INTEGER(KIND=8)}.
1872 @end multitable
1874 @item @emph{Return value}:
1875 The converted date and time as a string.
1877 @item @emph{Example}:
1878 @smallexample
1879 program test_ctime
1880     integer(8) :: i
1881     character(len=30) :: date
1882     i = time8()
1884     ! Do something, main part of the program
1885     
1886     call ctime(i,date)
1887     print *, 'Program was started on ', date
1888 end program test_ctime
1889 @end smallexample
1890 @end table
1892 @node DATE_AND_TIME
1893 @section @code{DATE_AND_TIME} --- Date and time subroutine
1894 @findex @code{DATE_AND_TIME} intrinsic
1895 @cindex DATE_AND_TIME
1897 @table @asis
1898 @item @emph{Description}:
1899 @code{DATE_AND_TIME(DATE, TIME, ZONE, VALUES)} gets the corresponding date and
1900 time information from the real-time system clock.  @var{DATE} is
1901 @code{INTENT(OUT)} and has form ccyymmdd.  @var{TIME} is @code{INTENT(OUT)} and
1902 has form hhmmss.sss.  @var{ZONE} is @code{INTENT(OUT)} and has form (+-)hhmm,
1903 representing the difference with respect to Coordinated Universal Time (UTC).
1904 Unavailable time and date parameters return blanks.
1906 @var{VALUES} is @code{INTENT(OUT)} and provides the following:
1908 @multitable @columnfractions .15 .30 .60
1909 @item @tab @code{VALUE(1)}: @tab The year
1910 @item @tab @code{VALUE(2)}: @tab The month
1911 @item @tab @code{VALUE(3)}: @tab The day of the month
1912 @item @tab @code{VAlUE(4)}: @tab Time difference with UTC in minutes
1913 @item @tab @code{VALUE(5)}: @tab The hour of the day
1914 @item @tab @code{VALUE(6)}: @tab The minutes of the hour
1915 @item @tab @code{VALUE(7)}: @tab The seconds of the minute
1916 @item @tab @code{VALUE(8)}: @tab The milliseconds of the second
1917 @end multitable     
1919 @item @emph{Option}:
1920 f95, gnu
1922 @item @emph{Class}:
1923 subroutine
1925 @item @emph{Syntax}:
1926 @code{CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])}
1928 @item @emph{Arguments}:
1929 @multitable @columnfractions .15 .80
1930 @item @var{DATE}  @tab (Optional) The type shall be @code{CHARACTER(8)} or larger.
1931 @item @var{TIME}  @tab (Optional) The type shall be @code{CHARACTER(10)} or larger.
1932 @item @var{ZONE}  @tab (Optional) The type shall be @code{CHARACTER(5)} or larger.
1933 @item @var{VALUES}@tab (Optional) The type shall be @code{INTEGER(8)}.
1934 @end multitable
1936 @item @emph{Return value}:
1937 None
1939 @item @emph{Example}:
1940 @smallexample
1941 program test_time_and_date
1942     character(8)  :: date
1943     character(10) :: time
1944     character(5)  :: zone
1945     integer,dimension(8) :: values
1946     ! using keyword arguments
1947     call date_and_time(date,time,zone,values)
1948     call date_and_time(DATE=date,ZONE=zone)
1949     call date_and_time(TIME=time)
1950     call date_and_time(VALUES=values)
1951     print '(a,2x,a,2x,a)', date, time, zone
1952     print '(8i5))', values
1953 end program test_time_and_date
1954 @end smallexample
1955 @end table
1959 @node DBLE
1960 @section @code{DBLE} --- Double conversion function 
1961 @findex @code{DBLE} intrinsic
1962 @cindex double conversion
1964 @table @asis
1965 @item @emph{Description}:
1966 @code{DBLE(X)} Converts @var{X} to double precision real type.
1967 @code{DFLOAT} is an alias for @code{DBLE}
1969 @item @emph{Option}:
1970 f95, gnu
1972 @item @emph{Class}:
1973 elemental function
1975 @item @emph{Syntax}:
1976 @code{X = DBLE(X)}
1977 @code{X = DFLOAT(X)}
1979 @item @emph{Arguments}:
1980 @multitable @columnfractions .15 .80
1981 @item @var{X} @tab The type shall be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1982 @end multitable
1984 @item @emph{Return value}:
1985 The return value is of type double precision real.
1987 @item @emph{Example}:
1988 @smallexample
1989 program test_dble
1990     real    :: x = 2.18
1991     integer :: i = 5
1992     complex :: z = (2.3,1.14)
1993     print *, dble(x), dble(i), dfloat(z)
1994 end program test_dble
1995 @end smallexample
1996 @end table
2000 @node DCMPLX
2001 @section @code{DCMPLX} --- Double complex conversion function
2002 @findex @code{DCMPLX} intrinsic
2003 @cindex DCMPLX
2005 @table @asis
2006 @item @emph{Description}:
2007 @code{DCMPLX(X [,Y])} returns a double complex number where @var{X} is
2008 converted to the real component.  If @var{Y} is present it is converted to the
2009 imaginary component.  If @var{Y} is not present then the imaginary component is
2010 set to 0.0.  If @var{X} is complex then @var{Y} must not be present.
2012 @item @emph{Option}:
2013 f95, gnu
2015 @item @emph{Class}:
2016 elemental function
2018 @item @emph{Syntax}:
2019 @code{C = DCMPLX(X)}
2020 @code{C = DCMPLX(X,Y)}
2022 @item @emph{Arguments}:
2023 @multitable @columnfractions .15 .80
2024 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
2025 @item @var{Y} @tab Optional if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}. 
2026 @end multitable
2028 @item @emph{Return value}:
2029 The return value is of type @code{COMPLEX(8)}
2031 @item @emph{Example}:
2032 @smallexample
2033 program test_dcmplx
2034     integer :: i = 42
2035     real :: x = 3.14
2036     complex :: z
2037     z = cmplx(i, x)
2038     print *, dcmplx(i)
2039     print *, dcmplx(x)
2040     print *, dcmplx(z)
2041     print *, dcmplx(x,i)
2042 end program test_dcmplx
2043 @end smallexample
2044 @end table
2048 @node DFLOAT
2049 @section @code{DFLOAT} --- Double conversion function 
2050 @findex @code{DFLOAT} intrinsic
2051 @cindex double float conversion
2053 @table @asis
2054 @item @emph{Description}:
2055 @code{DFLOAT(X)} Converts @var{X} to double precision real type.
2056 @code{DFLOAT} is an alias for @code{DBLE}.  See @code{DBLE}.
2057 @end table
2061 @node DIGITS
2062 @section @code{DIGITS} --- Significant digits function
2063 @findex @code{DIGITS} intrinsic
2064 @cindex digits, significant
2066 @table @asis
2067 @item @emph{Description}:
2068 @code{DIGITS(X)} returns the number of significant digits of the internal model
2069 representation of @var{X}.  For example, on a system using a 32-bit
2070 floating point representation, a default real number would likely return 24.
2072 @item @emph{Option}:
2073 f95, gnu
2075 @item @emph{Class}:
2076 inquiry function
2078 @item @emph{Syntax}:
2079 @code{C = DIGITS(X)}
2081 @item @emph{Arguments}:
2082 @multitable @columnfractions .15 .80
2083 @item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
2084 @end multitable
2086 @item @emph{Return value}:
2087 The return value is of type @code{INTEGER}.
2089 @item @emph{Example}:
2090 @smallexample
2091 program test_digits
2092     integer :: i = 12345
2093     real :: x = 3.143
2094     real(8) :: y = 2.33
2095     print *, digits(i)
2096     print *, digits(x)
2097     print *, digits(y)
2098 end program test_digits
2099 @end smallexample
2100 @end table
2104 @node DIM
2105 @section @code{DIM} --- Dim function
2106 @findex @code{DIM} intrinsic
2107 @findex @code{IDIM} intrinsic
2108 @findex @code{DDIM} intrinsic
2109 @cindex dim
2111 @table @asis
2112 @item @emph{Description}:
2113 @code{DIM(X,Y)} returns the difference @code{X-Y} if the result is positive;
2114 otherwise returns zero.
2116 @item @emph{Option}:
2117 f95, gnu
2119 @item @emph{Class}:
2120 elemental function
2122 @item @emph{Syntax}:
2123 @code{X = DIM(X,Y)}
2125 @item @emph{Arguments}:
2126 @multitable @columnfractions .15 .80
2127 @item @var{X} @tab The type shall be @code{INTEGER(*)} or @code{REAL(*)}
2128 @item @var{Y} @tab The type shall be the same type and kind as @var{X}.
2129 @end multitable
2131 @item @emph{Return value}:
2132 The return value is of type @code{INTEGER(*)} or @code{REAL(*)}.
2134 @item @emph{Example}:
2135 @smallexample
2136 program test_dim
2137     integer :: i
2138     real(8) :: x
2139     i = dim(4, 15)
2140     x = dim(4.345_8, 2.111_8)
2141     print *, i
2142     print *, x
2143 end program test_dim
2144 @end smallexample
2146 @item @emph{Specific names}:
2147 @multitable @columnfractions .24 .24 .24 .24
2148 @item Name            @tab Argument          @tab Return type       @tab Option
2149 @item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X,Y} @tab @code{INTEGER(4)} @tab gnu
2150 @item @code{DDIM(X,Y)} @tab @code{REAL(8) X,Y}  @tab @code{REAL(8)} @tab gnu
2151 @end multitable
2152 @end table
2156 @node DOT_PRODUCT
2157 @section @code{DOT_PRODUCT} --- Dot product function
2158 @findex @code{DOT_PRODUCT} intrinsic
2159 @cindex Dot product
2161 @table @asis
2162 @item @emph{Description}:
2163 @code{DOT_PRODUCT(X,Y)} computes the dot product multiplication of two vectors
2164 @var{X} and @var{Y}.  The two vectors may be either numeric or logical
2165 and must be arrays of rank one and of equal size. If the vectors are
2166 @code{INTEGER(*)} or @code{REAL(*)}, the result is @code{SUM(X*Y)}. If the
2167 vectors are @code{COMPLEX(*)}, the result is @code{SUM(CONJG(X)*Y)}. If the 
2168 vectors are @code{LOGICAL}, the result is @code{ANY(X.AND.Y)}.
2170 @item @emph{Option}:
2173 @item @emph{Class}:
2174 transformational function
2176 @item @emph{Syntax}:
2177 @code{S = DOT_PRODUCT(X,Y)}
2179 @item @emph{Arguments}:
2180 @multitable @columnfractions .15 .80
2181 @item @var{X} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2182 @item @var{Y} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2183 @end multitable
2185 @item @emph{Return value}:
2186 If the arguments are numeric, the return value is a scaler of numeric type,
2187 @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.  If the arguments are
2188 @code{LOGICAL}, the return value is @code{.TRUE.} or @code{.FALSE.}.
2190 @item @emph{Example}:
2191 @smallexample
2192 program test_dot_prod
2193     integer, dimension(3) :: a, b
2194     a = (/ 1, 2, 3 /)
2195     b = (/ 4, 5, 6 /)
2196     print '(3i3)', a
2197     print *
2198     print '(3i3)', b
2199     print *
2200     print *, dot_product(a,b)
2201 end program test_dot_prod
2202 @end smallexample
2203 @end table
2207 @node DPROD
2208 @section @code{DPROD} --- Double product function
2209 @findex @code{DPROD} intrinsic
2210 @cindex Double product
2212 @table @asis
2213 @item @emph{Description}:
2214 @code{DPROD(X,Y)} returns the product @code{X*Y}.
2216 @item @emph{Option}:
2217 f95, gnu
2219 @item @emph{Class}:
2220 elemental function
2222 @item @emph{Syntax}:
2223 @code{D = DPROD(X,Y)}
2225 @item @emph{Arguments}:
2226 @multitable @columnfractions .15 .80
2227 @item @var{X} @tab The type shall be @code{REAL}.
2228 @item @var{Y} @tab The type shall be @code{REAL}.
2229 @end multitable
2231 @item @emph{Return value}:
2232 The return value is of type @code{REAL(8)}.
2234 @item @emph{Example}:
2235 @smallexample
2236 program test_dprod
2237     integer :: i
2238     real :: x = 5.2
2239     real :: y = 2.3
2240     real(8) :: d
2241     d = dprod(x,y)
2242     print *, d
2243 end program test_dprod
2244 @end smallexample
2245 @end table
2249 @node DREAL
2250 @section @code{DREAL} --- Double real part function
2251 @findex @code{DREAL} intrinsic
2252 @cindex Double real part
2254 @table @asis
2255 @item @emph{Description}:
2256 @code{DREAL(Z)} returns the real part of complex variable @var{Z}.
2258 @item @emph{Option}:
2261 @item @emph{Class}:
2262 elemental function
2264 @item @emph{Syntax}:
2265 @code{D = DREAL(Z)}
2267 @item @emph{Arguments}:
2268 @multitable @columnfractions .15 .80
2269 @item @var{Z} @tab The type shall be @code{COMPLEX(8)}.
2270 @end multitable
2272 @item @emph{Return value}:
2273 The return value is of type @code{REAL(8)}.
2275 @item @emph{Example}:
2276 @smallexample
2277 program test_dreal
2278     complex(8) :: z = (1.3_8,7.2_8)
2279     print *, dreal(z)
2280 end program test_dreal
2281 @end smallexample
2282 @end table
2286 @node DTIME
2287 @section @code{DTIME} --- Execution time subroutine (or function)
2288 @findex @code{DTIME} intrinsic
2289 @cindex dtime subroutine 
2291 @table @asis
2292 @item @emph{Description}:
2293 @code{DTIME(TARRAY, RESULT)} initially returns the number of seconds of runtime
2294 since the start of the process's execution in @var{RESULT}.  @var{TARRAY}
2295 returns the user and system components of this time in @code{TARRAY(1)} and
2296 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) +
2297 TARRAY(2)}.
2299 Subsequent invocations of @code{DTIME} return values accumulated since the
2300 previous invocation.
2302 On some systems, the underlying timings are represented using types with
2303 sufficiently small limits that overflows (wraparounds) are possible, such as
2304 32-bit types. Therefore, the values returned by this intrinsic might be, or
2305 become, negative, or numerically less than previous values, during a single
2306 run of the compiled program.
2308 If @code{DTIME} is invoked as a function, it can not be invoked as a
2309 subroutine, and vice versa.
2311 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2313 @multitable @columnfractions .15 .30 .60
2314 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2315 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2316 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2317 @end multitable
2319 @item @emph{Option}:
2322 @item @emph{Class}:
2323 subroutine
2325 @item @emph{Syntax}:
2326 @multitable @columnfractions .80
2327 @item @code{CALL DTIME(TARRAY, RESULT)}.
2328 @item @code{RESULT = DTIME(TARRAY)}, (not recommended).
2329 @end multitable
2331 @item @emph{Arguments}:
2332 @multitable @columnfractions .15 .80
2333 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2334 @item @var{RESULT}@tab The type shall be @code{REAL}.
2335 @end multitable
2337 @item @emph{Return value}:
2338 Elapsed time in seconds since the start of program execution.
2340 @item @emph{Example}:
2341 @smallexample
2342 program test_dtime
2343     integer(8) :: i, j
2344     real, dimension(2) :: tarray
2345     real :: result
2346     call dtime(tarray, result)
2347     print *, result
2348     print *, tarray(1)
2349     print *, tarray(2)   
2350     do i=1,100000000    ! Just a delay
2351         j = i * i - i
2352     end do
2353     call dtime(tarray, result)
2354     print *, result
2355     print *, tarray(1)
2356     print *, tarray(2)
2357 end program test_dtime
2358 @end smallexample
2359 @end table
2363 @node EOSHIFT
2364 @section @code{EOSHIFT} --- End-off shift function
2365 @findex @code{EOSHIFT} intrinsic
2366 @cindex eoshift intrinsic
2368 @table @asis
2369 @item @emph{Description}:
2370 @code{EOSHIFT(ARRAY, SHIFT[,BOUNDARY, DIM])} performs an end-off shift on
2371 elements of @var{ARRAY} along the dimension of @var{DIM}.  If @var{DIM} is
2372 omitted it is taken to be @code{1}.  @var{DIM} is a scaler of type
2373 @code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is the
2374 rank of @var{ARRAY}.  If the rank of @var{ARRAY} is one, then all elements of
2375 @var{ARRAY} are shifted by @var{SHIFT} places.  If rank is greater than one,
2376 then all complete rank one sections of @var{ARRAY} along the given dimension are
2377 shifted.  Elements shifted out one end of each rank one section are dropped.  If
2378 @var{BOUNDARY} is present then the corresponding value of from @var{BOUNDARY}
2379 is copied back in the other end.  If @var{BOUNDARY} is not present then the
2380 following are copied in depending on the type of @var{ARRAY}.
2382 @multitable @columnfractions .15 .80
2383 @item @emph{Array Type} @tab @emph{Boundary Value}
2384 @item Numeric  @tab 0 of the type and kind of @var{ARRAY}.
2385 @item Logical  @tab @code{.FALSE.}.
2386 @item Character(@var{len}) @tab @var{len} blanks.
2387 @end multitable
2389 @item @emph{Option}:
2390 f95, gnu
2392 @item @emph{Class}:
2393 transformational function
2395 @item @emph{Syntax}:
2396 @code{A = EOSHIFT(A, SHIFT[,BOUNDARY, DIM])}
2398 @item @emph{Arguments}:
2399 @multitable @columnfractions .15 .80
2400 @item @var{ARRAY}  @tab May be any type, not scaler.
2401 @item @var{SHIFT}  @tab The type shall be @code{INTEGER}.
2402 @item @var{BOUNDARY} @tab Same type as @var{ARRAY}. 
2403 @item @var{DIM}    @tab The type shall be @code{INTEGER}.
2404 @end multitable
2406 @item @emph{Return value}:
2407 Returns an array of same type and rank as the @var{ARRAY} argument.
2409 @item @emph{Example}:
2410 @smallexample
2411 program test_eoshift
2412     integer, dimension(3,3) :: a
2413     a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2414     print '(3i3)', a(1,:)
2415     print '(3i3)', a(2,:)
2416     print '(3i3)', a(3,:)    
2417     a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
2418     print *
2419     print '(3i3)', a(1,:)
2420     print '(3i3)', a(2,:)
2421     print '(3i3)', a(3,:)
2422 end program test_eoshift
2423 @end smallexample
2424 @end table
2428 @node EPSILON
2429 @section @code{EPSILON} --- Epsilon function
2430 @findex @code{EPSILON} intrinsic
2431 @cindex epsilon, significant
2433 @table @asis
2434 @item @emph{Description}:
2435 @code{EPSILON(X)} returns a nearly negligible number relative to @code{1}.
2437 @item @emph{Option}:
2438 f95, gnu
2440 @item @emph{Class}:
2441 inquiry function
2443 @item @emph{Syntax}:
2444 @code{C = EPSILON(X)}
2446 @item @emph{Arguments}:
2447 @multitable @columnfractions .15 .80
2448 @item @var{X} @tab The type shall be @code{REAL(*)}.
2449 @end multitable
2451 @item @emph{Return value}:
2452 The return value is of same type as the argument.
2454 @item @emph{Example}:
2455 @smallexample
2456 program test_epsilon
2457     real :: x = 3.143
2458     real(8) :: y = 2.33
2459     print *, EPSILON(x)
2460     print *, EPSILON(y)
2461 end program test_epsilon
2462 @end smallexample
2463 @end table
2467 @node ERF
2468 @section @code{ERF} --- Error function 
2469 @findex @code{ERF} intrinsic
2470 @cindex error function
2472 @table @asis
2473 @item @emph{Description}:
2474 @code{ERF(X)} computes the error function of @var{X}.
2476 @item @emph{Option}:
2479 @item @emph{Class}:
2480 elemental function
2482 @item @emph{Syntax}:
2483 @code{X = ERF(X)}
2485 @item @emph{Arguments}:
2486 @multitable @columnfractions .15 .80
2487 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
2488 @end multitable
2490 @item @emph{Return value}:
2491 The return value is a scalar of type @code{REAL(*)} and it is positive
2492 (@math{ - 1 \leq erf (x) \leq 1 }.
2494 @item @emph{Example}:
2495 @smallexample
2496 program test_erf
2497   real(8) :: x = 0.17_8
2498   x = erf(x)
2499 end program test_erf
2500 @end smallexample
2502 @item @emph{Specific names}:
2503 @multitable @columnfractions .24 .24 .24 .24
2504 @item Name            @tab Argument          @tab Return type       @tab Option
2505 @item @code{DERF(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
2506 @end multitable
2507 @end table
2511 @node ERFC
2512 @section @code{ERFC} --- Error function 
2513 @findex @code{ERFC} intrinsic
2514 @cindex error function
2516 @table @asis
2517 @item @emph{Description}:
2518 @code{ERFC(X)} computes the complementary error function of @var{X}.
2520 @item @emph{Option}:
2523 @item @emph{Class}:
2524 elemental function
2526 @item @emph{Syntax}:
2527 @code{X = ERFC(X)}
2529 @item @emph{Arguments}:
2530 @multitable @columnfractions .15 .80
2531 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
2532 @end multitable
2534 @item @emph{Return value}:
2535 The return value is a scalar of type @code{REAL(*)} and it is positive
2536 (@math{ 0 \leq erfc (x) \leq 2 }.
2538 @item @emph{Example}:
2539 @smallexample
2540 program test_erfc
2541   real(8) :: x = 0.17_8
2542   x = erfc(x)
2543 end program test_erfc
2544 @end smallexample
2546 @item @emph{Specific names}:
2547 @multitable @columnfractions .24 .24 .24 .24
2548 @item Name            @tab Argument          @tab Return type       @tab Option
2549 @item @code{DERFC(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab gnu
2550 @end multitable
2551 @end table
2555 @node ETIME
2556 @section @code{ETIME} --- Execution time subroutine (or function)
2557 @findex @code{ETIME} intrinsic
2558 @cindex ETIME subroutine 
2560 @table @asis
2561 @item @emph{Description}:
2562 @code{ETIME(TARRAY, RESULT)} returns the number of seconds of runtime
2563 since the start of the process's execution in @var{RESULT}.  @var{TARRAY}
2564 returns the user and system components of this time in @code{TARRAY(1)} and
2565 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
2567 On some systems, the underlying timings are represented using types with
2568 sufficiently small limits that overflows (wraparounds) are possible, such as
2569 32-bit types. Therefore, the values returned by this intrinsic might be, or
2570 become, negative, or numerically less than previous values, during a single
2571 run of the compiled program.
2573 If @code{ETIME} is invoked as a function, it can not be invoked as a
2574 subroutine, and vice versa.
2576 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2578 @multitable @columnfractions .15 .30 .60
2579 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2580 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2581 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2582 @end multitable
2584 @item @emph{Option}:
2587 @item @emph{Class}:
2588 subroutine
2590 @item @emph{Syntax}:
2591 @multitable @columnfractions .8
2592 @item @code{CALL ETIME(TARRAY, RESULT)}.
2593 @item @code{RESULT = ETIME(TARRAY)}, (not recommended).
2594 @end multitable
2596 @item @emph{Arguments}:
2597 @multitable @columnfractions .15 .80
2598 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2599 @item @var{RESULT}@tab The type shall be @code{REAL}.
2600 @end multitable
2602 @item @emph{Return value}:
2603 Elapsed time in seconds since the start of program execution.
2605 @item @emph{Example}:
2606 @smallexample
2607 program test_etime
2608     integer(8) :: i, j
2609     real, dimension(2) :: tarray
2610     real :: result
2611     call ETIME(tarray, result)
2612     print *, result
2613     print *, tarray(1)
2614     print *, tarray(2)   
2615     do i=1,100000000    ! Just a delay
2616         j = i * i - i
2617     end do
2618     call ETIME(tarray, result)
2619     print *, result
2620     print *, tarray(1)
2621     print *, tarray(2)
2622 end program test_etime
2623 @end smallexample
2624 @end table
2628 @node EXIT
2629 @section @code{EXIT} --- Exit the program with status. 
2630 @findex @code{EXIT}
2631 @cindex exit
2633 @table @asis
2634 @item @emph{Description}:
2635 @code{EXIT} causes immediate termination of the program with status.  If status
2636 is omitted it returns the canonical @emph{success} for the system.  All Fortran
2637 I/O units are closed. 
2639 @item @emph{Option}:
2642 @item @emph{Class}:
2643 non-elemental subroutine
2645 @item @emph{Syntax}:
2646 @code{CALL EXIT([STATUS])}
2648 @item @emph{Arguments}:
2649 @multitable @columnfractions .15 .80
2650 @item @var{STATUS} @tab The type of the argument shall be @code{INTEGER(*)}.
2651 @end multitable
2653 @item @emph{Return value}:
2654 @code{STATUS} is passed to the parent process on exit.
2656 @item @emph{Example}:
2657 @smallexample
2658 program test_exit
2659   integer :: STATUS = 0
2660   print *, 'This program is going to exit.'
2661   call EXIT(STATUS)
2662 end program test_exit
2663 @end smallexample
2664 @end table
2668 @node EXP
2669 @section @code{EXP} --- Exponential function 
2670 @findex @code{EXP} intrinsic
2671 @findex @code{DEXP} intrinsic
2672 @findex @code{ZEXP} intrinsic
2673 @findex @code{CDEXP} intrinsic
2674 @cindex exponential
2676 @table @asis
2677 @item @emph{Description}:
2678 @code{EXP(X)} computes the base @math{e} exponential of @var{X}.
2680 @item @emph{Option}:
2681 f95, gnu
2683 @item @emph{Class}:
2684 elemental function
2686 @item @emph{Syntax}:
2687 @code{X = EXP(X)}
2689 @item @emph{Arguments}:
2690 @multitable @columnfractions .15 .80
2691 @item @var{X} @tab The type shall be @code{REAL(*)} or
2692 @code{COMPLEX(*)}.
2693 @end multitable
2695 @item @emph{Return value}:
2696 The return value has same type and kind as @var{X}.
2698 @item @emph{Example}:
2699 @smallexample
2700 program test_exp
2701   real :: x = 1.0
2702   x = exp(x)
2703 end program test_exp
2704 @end smallexample
2706 @item @emph{Specific names}:
2707 @multitable @columnfractions .24 .24 .24 .24
2708 @item Name            @tab Argument          @tab Return type       @tab Option
2709 @item @code{DEXP(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
2710 @item @code{CEXP(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
2711 @item @code{ZEXP(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
2712 @item @code{CDEXP(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
2713 @end multitable
2714 @end table
2718 @node EXPONENT
2719 @section @code{EXPONENT} --- Exponent function 
2720 @findex @code{EXPONENT} intrinsic
2721 @cindex exponent function
2723 @table @asis
2724 @item @emph{Description}:
2725 @code{EXPONENT(X)} returns the value of the exponent part of @var{X}. If @var{X}
2726 is zero the value returned is zero. 
2728 @item @emph{Option}:
2729 f95, gnu
2731 @item @emph{Class}:
2732 elemental function
2734 @item @emph{Syntax}:
2735 @code{I = EXPONENT(X)}
2737 @item @emph{Arguments}:
2738 @multitable @columnfractions .15 .80
2739 @item @var{X} @tab The type shall be @code{REAL(*)}.
2740 @end multitable
2742 @item @emph{Return value}:
2743 The return value is of type default @code{INTEGER}.
2745 @item @emph{Example}:
2746 @smallexample
2747 program test_exponent
2748   real :: x = 1.0
2749   integer :: i
2750   i = exponent(x)
2751   print *, i
2752   print *, exponent(0.0)
2753 end program test_exponent
2754 @end smallexample
2755 @end table
2758 @node FREE
2759 @section @code{FREE} --- Frees memory
2760 @findex @code{FREE} intrinsic
2761 @cindex FREE
2763 @table @asis
2764 @item @emph{Description}:
2765 Frees memory previously allocated by @code{MALLOC()}. The @code{FREE}
2766 intrinsic is an extension intended to be used with Cray pointers, and is
2767 provided in @command{gfortran} to allow user to compile legacy code. For
2768 new code using Fortran 95 pointers, the memory de-allocation intrinsic is
2769 @code{DEALLOCATE}.
2771 @item @emph{Option}:
2774 @item @emph{Class}:
2775 subroutine
2777 @item @emph{Syntax}:
2778 @code{FREE(PTR)}
2780 @item @emph{Arguments}:
2781 @multitable @columnfractions .15 .80
2782 @item @var{PTR} @tab The type shall be @code{INTEGER}. It represents the
2783 location of the memory that should be de-allocated.
2784 @end multitable
2786 @item @emph{Return value}:
2787 None
2789 @item @emph{Example}:
2790 See @code{MALLOC} for an example.
2791 @end table
2794 @node FDATE
2795 @section @code{FDATE} --- Get the current time as a string
2796 @findex @code{FDATE} intrinsic
2797 @cindex fdate subroutine 
2799 @table @asis
2800 @item @emph{Description}:
2801 @code{FDATE(DATE)} returns the current date (using the same format as
2802 @code{CTIME}) in @var{DATE}. It is equivalent to @code{CALL CTIME(DATE,
2803 TIME8())}.
2805 If @code{FDATE} is invoked as a function, it can not be invoked as a
2806 subroutine, and vice versa.
2808 @var{DATE} is an @code{INTENT(OUT)} @code{CHARACTER} variable.
2810 @item @emph{Option}:
2813 @item @emph{Class}:
2814 subroutine
2816 @item @emph{Syntax}:
2817 @multitable @columnfractions .80
2818 @item @code{CALL FDATE(DATE)}.
2819 @item @code{DATE = FDATE()}, (not recommended).
2820 @end multitable
2822 @item @emph{Arguments}:
2823 @multitable @columnfractions .15 .80
2824 @item @var{DATE}@tab The type shall be of type @code{CHARACTER}.
2825 @end multitable
2827 @item @emph{Return value}:
2828 The current date and time as a string.
2830 @item @emph{Example}:
2831 @smallexample
2832 program test_fdate
2833     integer(8) :: i, j
2834     character(len=30) :: date
2835     call fdate(date)
2836     print *, 'Program started on ', date
2837     do i = 1, 100000000 ! Just a delay
2838         j = i * i - i
2839     end do
2840     call fdate(date)
2841     print *, 'Program ended on ', date
2842 end program test_fdate
2843 @end smallexample
2844 @end table
2846 @node FLOAT
2847 @section @code{FLOAT} --- Convert integer to default real
2848 @findex @code{FLOAT} intrinsic
2849 @cindex float
2851 @table @asis
2852 @item @emph{Description}:
2853 @code{FLOAT(I)} converts the integer @var{I} to a default real value.
2855 @item @emph{Option}:
2858 @item @emph{Class}:
2859 function
2861 @item @emph{Syntax}:
2862 @code{X = FLOAT(I)}
2864 @item @emph{Arguments}:
2865 @multitable @columnfractions .15 .80
2866 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
2867 @end multitable
2869 @item @emph{Return value}:
2870 The return value is of type default @code{REAL}
2872 @item @emph{Example}:
2873 @smallexample
2874 program test_float
2875     integer :: i = 1
2876     if (float(i) /= 1.) call abort
2877 end program test_float
2878 @end smallexample
2879 @end table
2882 @node FLOOR
2883 @section @code{FLOOR} --- Integer floor function
2884 @findex @code{FLOOR} intrinsic
2885 @cindex floor
2887 @table @asis
2888 @item @emph{Description}:
2889 @code{FLOOR(X)} returns the greatest integer less than or equal to @var{X}.
2891 @item @emph{Option}:
2892 f95, gnu
2894 @item @emph{Class}:
2895 elemental function
2897 @item @emph{Syntax}:
2898 @code{I = FLOOR(X[,KIND])}
2900 @item @emph{Arguments}:
2901 @multitable @columnfractions .15 .80
2902 @item @var{X} @tab The type shall be @code{REAL(*)}.
2903 @item @var{KIND} @tab Optional scaler integer initialization expression.
2904 @end multitable
2906 @item @emph{Return value}:
2907 The return value is of type @code{INTEGER(KIND)}
2909 @item @emph{Example}:
2910 @smallexample
2911 program test_floor
2912     real :: x = 63.29
2913     real :: y = -63.59
2914     print *, floor(x) ! returns 63
2915     print *, floor(y) ! returns -64
2916 end program test_floor
2917 @end smallexample
2918 @end table
2922 @node FNUM
2923 @section @code{FNUM} --- File number function
2924 @findex @code{FNUM} intrinsic
2925 @cindex fnum
2927 @table @asis
2928 @item @emph{Description}:
2929 @code{FNUM(UNIT)} returns the Posix file descriptor number corresponding to the
2930 open Fortran I/O unit @code{UNIT}.
2932 @item @emph{Option}:
2935 @item @emph{Class}:
2936 non-elemental function
2938 @item @emph{Syntax}:
2939 @code{I = FNUM(UNIT)}
2941 @item @emph{Arguments}:
2942 @multitable @columnfractions .15 .80
2943 @item @var{UNIT} @tab The type shall be @code{INTEGER}.
2944 @end multitable
2946 @item @emph{Return value}:
2947 The return value is of type @code{INTEGER}
2949 @item @emph{Example}:
2950 @smallexample
2951 program test_fnum
2952   integer :: i
2953   open (unit=10, status = "scratch")
2954   i = fnum(10)
2955   print *, i
2956   close (10)
2957 end program test_fnum
2958 @end smallexample
2959 @end table
2961 @node LOC
2962 @section @code{LOC} --- Returns the address of a variable
2963 @findex @code{LOC} intrinsic
2964 @cindex loc
2966 @table @asis
2967 @item @emph{Description}:
2968 @code{LOC(X)} returns the address of @var{X} as an integer.
2970 @item @emph{Option}:
2973 @item @emph{Class}:
2974 inquiry function
2976 @item @emph{Syntax}:
2977 @code{I = LOC(X)}
2979 @item @emph{Arguments}:
2980 @multitable @columnfractions .15 .80
2981 @item @var{X} @tab Variable of any type.
2982 @end multitable
2984 @item @emph{Return value}:
2985 The return value is of type @code{INTEGER(n)}, where @code{n} is the
2986 size (in bytes) of a memory address on the target machine.
2988 @item @emph{Example}:
2989 @smallexample
2990 program test_loc
2991   integer :: i
2992   real :: r
2993   i = loc(r)
2994   print *, i
2995 end program test_loc
2996 @end smallexample
2997 @end table
2999 @node LOG
3000 @section @code{LOG} --- Logarithm function
3001 @findex @code{LOG} intrinsic
3002 @findex @code{ALOG} intrinsic
3003 @findex @code{DLOG} intrinsic
3004 @findex @code{CLOG} intrinsic
3005 @findex @code{ZLOG} intrinsic
3006 @findex @code{CDLOG} intrinsic
3007 @cindex logarithm
3009 @table @asis
3010 @item @emph{Description}:
3011 @code{LOG(X)} computes the logarithm of @var{X}.
3013 @item @emph{Option}:
3014 f95, gnu
3016 @item @emph{Class}:
3017 elemental function
3019 @item @emph{Syntax}:
3020 @code{X = LOG(X)}
3022 @item @emph{Arguments}:
3023 @multitable @columnfractions .15 .80
3024 @item @var{X} @tab The type shall be @code{REAL(*)} or
3025 @code{COMPLEX(*)}.
3026 @end multitable
3028 @item @emph{Return value}:
3029 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
3030 The kind type parameter is the same as @var{X}.
3032 @item @emph{Example}:
3033 @smallexample
3034 program test_log
3035   real(8) :: x = 1.0_8
3036   complex :: z = (1.0, 2.0)
3037   x = log(x)
3038   z = log(z)
3039 end program test_log
3040 @end smallexample
3042 @item @emph{Specific names}:
3043 @multitable @columnfractions .24 .24 .24 .24
3044 @item Name            @tab Argument          @tab Return type       @tab Option
3045 @item @code{ALOG(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab f95, gnu
3046 @item @code{DLOG(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3047 @item @code{CLOG(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
3048 @item @code{ZLOG(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3049 @item @code{CDLOG(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3050 @end multitable
3051 @end table
3055 @node LOG10
3056 @section @code{LOG10} --- Base 10 logarithm function
3057 @findex @code{LOG10} intrinsic
3058 @findex @code{ALOG10} intrinsic
3059 @findex @code{DLOG10} intrinsic
3060 @cindex logarithm
3062 @table @asis
3063 @item @emph{Description}:
3064 @code{LOG10(X)} computes the base 10 logarithm of @var{X}.
3066 @item @emph{Option}:
3067 f95, gnu
3069 @item @emph{Class}:
3070 elemental function
3072 @item @emph{Syntax}:
3073 @code{X = LOG10(X)}
3075 @item @emph{Arguments}:
3076 @multitable @columnfractions .15 .80
3077 @item @var{X} @tab The type shall be @code{REAL(*)} or
3078 @code{COMPLEX(*)}.
3079 @end multitable
3081 @item @emph{Return value}:
3082 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
3083 The kind type parameter is the same as @var{X}.
3085 @item @emph{Example}:
3086 @smallexample
3087 program test_log10
3088   real(8) :: x = 10.0_8
3089   x = log10(x)
3090 end program test_log10
3091 @end smallexample
3093 @item @emph{Specific names}:
3094 @multitable @columnfractions .24 .24 .24 .24
3095 @item Name            @tab Argument          @tab Return type       @tab Option
3096 @item @code{ALOG10(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)}    @tab f95, gnu
3097 @item @code{DLOG10(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3098 @end multitable
3099 @end table
3102 @node MALLOC
3103 @section @code{MALLOC} --- Allocate dynamic memory
3104 @findex @code{MALLOC} intrinsic
3105 @cindex MALLOC
3107 @table @asis
3108 @item @emph{Description}:
3109 @code{MALLOC(SIZE)} allocates @var{SIZE} bytes of dynamic memory and
3110 returns the address of the allocated memory. The @code{MALLOC} intrinsic
3111 is an extension intended to be used with Cray pointers, and is provided
3112 in @command{gfortran} to allow user to compile legacy code. For new code
3113 using Fortran 95 pointers, the memory allocation intrinsic is
3114 @code{ALLOCATE}.
3116 @item @emph{Option}:
3119 @item @emph{Class}:
3120 non-elemental function
3122 @item @emph{Syntax}:
3123 @code{PTR = MALLOC(SIZE)}
3125 @item @emph{Arguments}:
3126 @multitable @columnfractions .15 .80
3127 @item @var{SIZE} @tab The type shall be @code{INTEGER(*)}.
3128 @end multitable
3130 @item @emph{Return value}:
3131 The return value is of type @code{INTEGER(K)}, with @var{K} such that
3132 variables of type @code{INTEGER(K)} have the same size as
3133 C pointers (@code{sizeof(void *)}).
3135 @item @emph{Example}:
3136 The following example demonstrates the use of @code{MALLOC} and
3137 @code{FREE} with Cray pointers. This example is intended to run on
3138 32-bit systems, where the default integer kind is suitable to store
3139 pointers; on 64-bit systems, ptr_x would need to be declared as
3140 @code{integer(kind=8)}.
3142 @smallexample
3143 program test_malloc
3144   integer i
3145   integer ptr_x
3146   real*8 x(*), z
3147   pointer(ptr_x,x)
3149   ptr_x = malloc(20*8)
3150   do i = 1, 20
3151     x(i) = sqrt(1.0d0 / i)
3152   end do
3153   z = 0
3154   do i = 1, 20
3155     z = z + x(i)
3156     print *, z
3157   end do
3158   call free(ptr_x)
3159 end program test_malloc
3160 @end smallexample
3161 @end table
3164 @node REAL
3165 @section @code{REAL} --- Convert to real type 
3166 @findex @code{REAL} intrinsic
3167 @findex @code{REALPART} intrinsic
3168 @cindex true values
3170 @table @asis
3171 @item @emph{Description}:
3172 @code{REAL(X [, KIND])} converts its argument @var{X} to a real type.  The
3173 @code{REALPART(X)} function is provided for compatibility with @command{g77},
3174 and its use is strongly discouraged.
3176 @item @emph{Option}:
3177 f95, gnu
3179 @item @emph{Class}:
3180 transformational function
3182 @item @emph{Syntax}:
3183 @multitable @columnfractions .30 .80
3184 @item @code{X = REAL(X)}
3185 @item @code{X = REAL(X, KIND)}
3186 @item @code{X = REALPART(Z)}
3187 @end multitable
3189 @item @emph{Arguments}:
3190 @multitable @columnfractions .15 .80
3191 @item @var{X} @tab shall be @code{INTEGER(*)}, @code{REAL(*)}, or  
3192 @code{COMPLEX(*)}.
3193 @item @var{KIND}  @tab (Optional) @var{KIND} shall be a scalar integer.
3194 @end multitable
3196 @item @emph{Return value}:
3197 These functions return the a @code{REAL(*)} variable or array under
3198 the following rules: 
3200 @table @asis
3201 @item (A)
3202 @code{REAL(X)} is converted to a default real type if @var{X} is an 
3203 integer or real variable.
3204 @item (B)
3205 @code{REAL(X)} is converted to a real type with the kind type parameter
3206 of @var{X} if @var{X} is a complex variable.
3207 @item (C)
3208 @code{REAL(X, KIND)} is converted to a real type with kind type
3209 parameter @var{KIND} if @var{X} is a complex, integer, or real
3210 variable.
3211 @end table
3213 @item @emph{Example}:
3214 @smallexample
3215 program test_real
3216   complex :: x = (1.0, 2.0)
3217   print *, real(x), real(x,8), realpart(x)
3218   end program test_real
3219 @end smallexample
3220 @end table
3224 @node SIGNAL
3225 @section @code{SIGNAL} --- Signal handling subroutine (or function)
3226 @findex @code{SIGNAL} intrinsic
3227 @cindex SIGNAL subroutine 
3229 @table @asis
3230 @item @emph{Description}:
3231 @code{SIGNAL(NUMBER, HANDLER [, STATUS])} causes external subroutine
3232 @var{HANDLER} to be executed with a single integer argument when signal
3233 @var{NUMBER} occurs.  If @var{HANDLER} is an integer, it can be used to
3234 turn off handling of signal @var{NUMBER} or revert to its default
3235 action.  See @code{signal(2)}.
3237 If @code{SIGNAL} is called as a subroutine and the @var{STATUS} argument
3238 is supplied, it is set to the value returned by @code{signal(2)}.
3240 @item @emph{Option}:
3243 @item @emph{Class}:
3244 subroutine, non-elemental function
3246 @item @emph{Syntax}:
3247 @multitable @columnfractions .30 .80
3248 @item @code{CALL ALARM(NUMBER, HANDLER)}
3249 @item @code{CALL ALARM(NUMBER, HANDLER, STATUS)}
3250 @item @code{STATUS = ALARM(NUMBER, HANDLER)}
3251 @end multitable
3253 @item @emph{Arguments}:
3254 @multitable @columnfractions .15 .80
3255 @item @var{NUMBER} @tab shall be a scalar integer, with @code{INTENT(IN)}
3256 @item @var{HANDLER}@tab Signal handler (@code{INTEGER FUNCTION} or
3257 @code{SUBROUTINE}) or dummy/global @code{INTEGER} scalar.
3258 @code{INTEGER}. It is @code{INTENT(IN)}.
3259 @item @var{STATUS} @tab (Optional) @var{STATUS} shall be a scalar
3260 integer. It has @code{INTENT(OUT)}.
3261 @end multitable
3263 @item @emph{Return value}:
3264 The @code{SIGNAL} functions returns the value returned by @code{signal(2)}.
3266 @item @emph{Example}:
3267 @smallexample
3268 program test_signal
3269   intrinsic signal
3270   external handler_print
3272   call signal (12, handler_print)
3273   call signal (10, 1)
3275   call sleep (30)
3276 end program test_signal
3277 @end smallexample
3278 @end table
3283 @node SECNDS
3284 @section @code{SECNDS} --- Time subroutine
3285 @findex @code{SECNDS} intrinsic
3286 @cindex SECNDS
3288 @table @asis
3289 @item @emph{Description}:
3290 @code{SECNDS(X)} gets the time in seconds from the real-time system clock.
3291 @var{X} is a reference time, also in seconds. If this is zero, the time in
3292 seconds from midnight is returned. This function is non-standard and its
3293 use is discouraged.
3295 @item @emph{Option}:
3298 @item @emph{Class}:
3299 function
3301 @item @emph{Syntax}:
3302 @code{T = SECNDS (X)}
3304 @item @emph{Arguments}:
3305 @multitable @columnfractions .15 .80
3306 @item Name        @tab Type
3307 @item @var{T}     @tab REAL(4)
3308 @item @var{X}     @tab REAL(4)
3309 @end multitable
3311 @item @emph{Return value}:
3312 None
3314 @item @emph{Example}:
3315 @smallexample
3316 program test_secnds
3317     real(4) :: t1, t2
3318     print *, secnds (0.0)   ! seconds since midnight
3319     t1 = secnds (0.0)       ! reference time
3320     do i = 1, 10000000      ! do something
3321     end do
3322     t2 = secnds (t1)        ! elapsed time
3323     print *, "Something took ", t2, " seconds."
3324 end program test_secnds
3325 @end smallexample
3326 @end table
3330 @node SIN
3331 @section @code{SIN} --- Sine function 
3332 @findex @code{SIN} intrinsic
3333 @findex @code{DSIN} intrinsic
3334 @findex @code{ZSIN} intrinsic
3335 @findex @code{CDSIN} intrinsic
3336 @cindex sine
3338 @table @asis
3339 @item @emph{Description}:
3340 @code{SIN(X)} computes the sine of @var{X}.
3342 @item @emph{Option}:
3343 f95, gnu
3345 @item @emph{Class}:
3346 elemental function
3348 @item @emph{Syntax}:
3349 @code{X = SIN(X)}
3351 @item @emph{Arguments}:
3352 @multitable @columnfractions .15 .80
3353 @item @var{X} @tab The type shall be @code{REAL(*)} or
3354 @code{COMPLEX(*)}.
3355 @end multitable
3357 @item @emph{Return value}:
3358 The return value has same type and king than @var{X}.
3360 @item @emph{Example}:
3361 @smallexample
3362 program test_sin
3363   real :: x = 0.0
3364   x = sin(x)
3365 end program test_sin
3366 @end smallexample
3368 @item @emph{Specific names}:
3369 @multitable @columnfractions .24 .24 .24 .24
3370 @item Name            @tab Argument          @tab Return type       @tab Option
3371 @item @code{DSIN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3372 @item @code{CSIN(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
3373 @item @code{ZSIN(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3374 @item @code{CDSIN(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3375 @end multitable
3376 @end table
3380 @node SINH
3381 @section @code{SINH} --- Hyperbolic sine function 
3382 @findex @code{SINH} intrinsic
3383 @findex @code{DSINH} intrinsic
3384 @cindex hyperbolic sine
3386 @table @asis
3387 @item @emph{Description}:
3388 @code{SINH(X)} computes the hyperbolic sine of @var{X}.
3390 @item @emph{Option}:
3391 f95, gnu
3393 @item @emph{Class}:
3394 elemental function
3396 @item @emph{Syntax}:
3397 @code{X = SINH(X)}
3399 @item @emph{Arguments}:
3400 @multitable @columnfractions .15 .80
3401 @item @var{X} @tab The type shall be @code{REAL(*)}.
3402 @end multitable
3404 @item @emph{Return value}:
3405 The return value is of type @code{REAL(*)}.
3407 @item @emph{Example}:
3408 @smallexample
3409 program test_sinh
3410   real(8) :: x = - 1.0_8
3411   x = sinh(x)
3412 end program test_sinh
3413 @end smallexample
3415 @item @emph{Specific names}:
3416 @multitable @columnfractions .24 .24 .24 .24
3417 @item Name            @tab Argument          @tab Return type       @tab Option
3418 @item @code{DSINH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3419 @end multitable
3420 @end table
3424 @node SQRT
3425 @section @code{SQRT} --- Square-root function
3426 @findex @code{SQRT} intrinsic
3427 @findex @code{DSQRT} intrinsic
3428 @findex @code{CSQRT} intrinsic
3429 @findex @code{ZSQRT} intrinsic
3430 @findex @code{CDSQRT} intrinsic
3431 @cindex square-root
3433 @table @asis
3434 @item @emph{Description}:
3435 @code{SQRT(X)} computes the square root of @var{X}.
3437 @item @emph{Option}:
3438 f95, gnu
3440 @item @emph{Class}:
3441 elemental function
3443 @item @emph{Syntax}:
3444 @code{X = SQRT(X)}
3446 @item @emph{Arguments}:
3447 @multitable @columnfractions .15 .80
3448 @item @var{X} @tab The type shall be @code{REAL(*)} or
3449 @code{COMPLEX(*)}.
3450 @end multitable
3452 @item @emph{Return value}:
3453 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
3454 The kind type parameter is the same as @var{X}.
3456 @item @emph{Example}:
3457 @smallexample
3458 program test_sqrt
3459   real(8) :: x = 2.0_8
3460   complex :: z = (1.0, 2.0)
3461   x = sqrt(x)
3462   z = sqrt(z)
3463 end program test_sqrt
3464 @end smallexample
3466 @item @emph{Specific names}:
3467 @multitable @columnfractions .24 .24 .24 .24
3468 @item Name            @tab Argument          @tab Return type       @tab Option
3469 @item @code{DSQRT(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3470 @item @code{CSQRT(X)}  @tab @code{COMPLEX(4) X}  @tab @code{COMPLEX(4)}    @tab f95, gnu
3471 @item @code{ZSQRT(X)}  @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3472 @item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X}  @tab @code{COMPLEX(8)}    @tab f95, gnu
3473 @end multitable
3474 @end table
3478 @node TAN
3479 @section @code{TAN} --- Tangent function
3480 @findex @code{TAN} intrinsic
3481 @findex @code{DTAN} intrinsic
3482 @cindex tangent
3484 @table @asis
3485 @item @emph{Description}:
3486 @code{TAN(X)} computes the tangent of @var{X}.
3488 @item @emph{Option}:
3489 f95, gnu
3491 @item @emph{Class}:
3492 elemental function
3494 @item @emph{Syntax}:
3495 @code{X = TAN(X)}
3497 @item @emph{Arguments}:
3498 @multitable @columnfractions .15 .80
3499 @item @var{X} @tab The type shall be @code{REAL(*)}.
3500 @end multitable
3502 @item @emph{Return value}:
3503 The return value is of type @code{REAL(*)}.  The kind type parameter is
3504 the same as @var{X}.
3506 @item @emph{Example}:
3507 @smallexample
3508 program test_tan
3509   real(8) :: x = 0.165_8
3510   x = tan(x)
3511 end program test_tan
3512 @end smallexample
3514 @item @emph{Specific names}:
3515 @multitable @columnfractions .24 .24 .24 .24
3516 @item Name            @tab Argument          @tab Return type       @tab Option
3517 @item @code{DTAN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3518 @end multitable
3519 @end table
3523 @node TANH
3524 @section @code{TANH} --- Hyperbolic tangent function 
3525 @findex @code{TANH} intrinsic
3526 @findex @code{DTANH} intrinsic
3527 @cindex hyperbolic tangent
3529 @table @asis
3530 @item @emph{Description}:
3531 @code{TANH(X)} computes the hyperbolic tangent of @var{X}.
3533 @item @emph{Option}:
3534 f95, gnu
3536 @item @emph{Class}:
3537 elemental function
3539 @item @emph{Syntax}:
3540 @code{X = TANH(X)}
3542 @item @emph{Arguments}:
3543 @multitable @columnfractions .15 .80
3544 @item @var{X} @tab The type shall be @code{REAL(*)}.
3545 @end multitable
3547 @item @emph{Return value}:
3548 The return value is of type @code{REAL(*)} and lies in the range
3549 @math{ - 1 \leq tanh(x) \leq 1 }.
3551 @item @emph{Example}:
3552 @smallexample
3553 program test_tanh
3554   real(8) :: x = 2.1_8
3555   x = tanh(x)
3556 end program test_tanh
3557 @end smallexample
3559 @item @emph{Specific names}:
3560 @multitable @columnfractions .24 .24 .24 .24
3561 @item Name            @tab Argument          @tab Return type       @tab Option
3562 @item @code{DTANH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)}    @tab f95, gnu
3563 @end multitable
3564 @end table
3568 @comment sub   flush
3569 @comment 
3570 @comment gen   fraction
3571 @comment 
3572 @comment gen   fstat
3573 @comment sub   fstat
3574 @comment 
3575 @comment sub   getarg
3576 @comment 
3577 @comment gen   getcwd
3578 @comment sub   getcwd
3579 @comment 
3580 @comment sub   getenv
3581 @comment 
3582 @comment gen   getgid
3583 @comment 
3584 @comment gen   getpid
3585 @comment 
3586 @comment gen   getuid
3587 @comment 
3588 @comment sub   get_command
3589 @comment 
3590 @comment sub   get_command_argument
3591 @comment 
3592 @comment sub   get_environment_variable
3593 @comment 
3594 @comment gen   huge
3595 @comment 
3596 @comment gen   iachar
3597 @comment 
3598 @comment gen   iand
3599 @comment 
3600 @comment gen   iargc
3601 @comment 
3602 @comment gen   ibclr
3603 @comment 
3604 @comment gen   ibits
3605 @comment 
3606 @comment gen   ibset
3607 @comment 
3608 @comment gen   ichar
3609 @comment 
3610 @comment gen   ieor
3611 @comment 
3612 @comment gen   index
3613 @comment 
3614 @comment gen   int
3615 @comment       ifix
3616 @comment       idint
3617 @comment 
3618 @comment gen   ior
3619 @comment 
3620 @comment gen   irand
3621 @comment 
3622 @comment gen   ishft
3623 @comment 
3624 @comment gen   ishftc
3625 @comment 
3626 @comment gen   kind
3627 @comment 
3628 @comment gen   lbound
3629 @comment 
3630 @comment gen   len
3631 @comment 
3632 @comment gen   len_trim
3633 @comment 
3634 @comment gen   lge
3635 @comment 
3636 @comment gen   lgt
3637 @comment 
3638 @comment gen   lle
3639 @comment 
3640 @comment gen   llt
3641 @comment 
3642 @comment gen   logical
3643 @comment 
3644 @comment gen   matmul
3645 @comment 
3646 @comment gen   max
3647 @comment       max0
3648 @comment       amax0
3649 @comment       amax1
3650 @comment       max1
3651 @comment       dmax1
3652 @comment 
3653 @comment gen   maxexponent
3654 @comment 
3655 @comment gen   maxloc
3656 @comment 
3657 @comment gen   maxval
3658 @comment 
3659 @comment gen   merge
3660 @comment 
3661 @comment gen   min
3662 @comment       min0
3663 @comment       amin0
3664 @comment       amin1
3665 @comment       min1
3666 @comment       dmin1
3667 @comment 
3668 @comment gen   minexponent
3669 @comment 
3670 @comment gen   minloc
3671 @comment 
3672 @comment gen   minval
3673 @comment 
3674 @comment gen   mod
3675 @comment       amod
3676 @comment       dmod
3677 @comment 
3678 @comment gen   modulo
3679 @comment 
3680 @comment sub   mvbits
3681 @comment 
3682 @comment gen   nearest
3683 @comment 
3684 @comment gen   nint
3685 @comment       idnint
3686 @comment 
3687 @comment gen   not
3688 @comment 
3689 @comment gen   null
3690 @comment 
3691 @comment gen   pack
3692 @comment 
3693 @comment gen   precision
3694 @comment 
3695 @comment gen   present
3696 @comment 
3697 @comment gen   product
3698 @comment 
3699 @comment gen   radix
3700 @comment 
3701 @comment gen   rand
3702 @comment       ran 
3703 @comment 
3704 @comment sub   random_number
3705 @comment 
3706 @comment sub   random_seed
3707 @comment 
3708 @comment gen   range
3709 @comment 
3710 @comment gen   real
3711 @comment       float
3712 @comment       sngl
3713 @comment 
3714 @comment gen   repeat
3715 @comment 
3716 @comment gen   reshape
3717 @comment 
3718 @comment gen   rrspacing
3719 @comment 
3720 @comment gen   scale
3721 @comment 
3722 @comment gen   scan
3723 @comment 
3724 @comment gen   second
3725 @comment sub   second
3726 @comment 
3727 @comment gen   selected_int_kind
3728 @comment 
3729 @comment gen   selected_real_kind
3730 @comment 
3731 @comment gen   set_exponent
3732 @comment 
3733 @comment gen   shape
3734 @comment 
3735 @comment gen   sign
3736 @comment       isign
3737 @comment       dsign
3738 @comment 
3739 @comment gen   size
3740 @comment 
3741 @comment gen   spacing
3742 @comment 
3743 @comment gen   spread
3744 @comment 
3745 @comment sub   srand
3746 @comment 
3747 @comment gen   stat
3748 @comment sub   stat
3749 @comment 
3750 @comment gen   sum
3751 @comment 
3752 @comment gen   system
3753 @comment sub   system
3754 @comment 
3755 @comment sub system_clock
3756 @comment 
3757 @comment gen   tiny
3758 @comment 
3759 @comment gen   transfer
3760 @comment 
3761 @comment gen   transpose
3762 @comment 
3763 @comment gen   trim
3764 @comment 
3765 @comment gen   ubound
3766 @comment 
3767 @comment gen   umask
3768 @comment sub   umask
3769 @comment 
3770 @comment gen   unlink
3771 @comment sub   unlink
3772 @comment 
3773 @comment gen   unpack
3774 @comment 
3775 @comment gen   verify