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.
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.
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{ALL}: ALL, Determine if all values are true
45 * @code{ALLOCATED}: ALLOCATED, Status of allocatable entity
46 * @code{ANINT}: ANINT, Nearest whole number
47 * @code{ANY}: ANY, Determine if any values are true
48 * @code{ASIN}: ASIN, Arcsine function
49 * @code{ASSOCIATED}: ASSOCIATED, Status of a pointer or pointer/target pair
50 * @code{ATAN}: ATAN, Arctangent function
51 * @code{ATAN2}: ATAN2, Arctangent function
52 * @code{BESJ0}: BESJ0, Bessel function of the first kind of order 0
53 * @code{BESJ1}: BESJ1, Bessel function of the first kind of order 1
54 * @code{BESJN}: BESJN, Bessel function of the first kind
55 * @code{BESY0}: BESY0, Bessel function of the second kind of order 0
56 * @code{BESY1}: BESY1, Bessel function of the second kind of order 1
57 * @code{BESYN}: BESYN, Bessel function of the second kind
58 * @code{BIT_SIZE}: BIT_SIZE, Bit size inquiry function
59 * @code{BTEST}: BTEST, Bit test function
60 * @code{CEILING}: CEILING, Integer ceiling function
61 * @code{CHAR}: CHAR, Character conversion function
62 * @code{CMPLX}: CMPLX, Complex conversion function
63 * @code{COMMAND_ARGUMENT_COUNT}: COMMAND_ARGUMENT_COUNT, Command line argument count
64 * @code{CONJG}: CONJG, Complex conjugate function
65 * @code{COS}: COS, Cosine function
66 * @code{COSH}: COSH, Hyperbolic cosine function
67 * @code{COUNT}: COUNT, Count occurrences of .TRUE. in an array
68 * @code{CPU_TIME}: CPU_TIME, CPU time subroutine
69 * @code{CSHIFT}: CSHIFT, Circular array shift function
70 * @code{DATE_AND_TIME}: DATE_AND_TIME, Date and time subroutine
71 * @code{DBLE}: DBLE, Double precision conversion function
72 * @code{DCMPLX}: DCMPLX, Double complex conversion function
73 * @code{DFLOAT}: DFLOAT, Double precision conversion function
74 * @code{DIGITS}: DIGITS, Significant digits function
75 * @code{DIM}: DIM, Dim function
76 * @code{DOT_PRODUCT}: DOT_PRODUCT, Dot product function
77 * @code{DPROD}: DPROD, Double product function
78 * @code{DREAL}: DREAL, Double real part function
79 * @code{DTIME}: DTIME, Execution time subroutine (or function)
80 * @code{EOSHIFT}: EOSHIFT, End-off shift function
81 * @code{EPSILON}: EPSILON, Epsilon function
82 * @code{ERF}: ERF, Error function
83 * @code{ERFC}: ERFC, Complementary error function
84 * @code{ETIME}: ETIME, Execution time subroutine (or function)
85 * @code{EXIT}: EXIT, Exit the program with status.
86 * @code{EXP}: EXP, Cosine function
87 * @code{LOG}: LOG, Logarithm function
88 * @code{LOG10}: LOG10, Base 10 logarithm function
89 * @code{SQRT}: SQRT, Square-root function
90 * @code{SIN}: SIN, Sine function
91 * @code{SINH}: SINH, Hyperbolic sine function
92 * @code{TAN}: TAN, Tangent function
93 * @code{TANH}: TANH, Hyperbolic tangent function
97 @section Introduction to intrinsic procedures
99 Gfortran provides a rich set of intrinsic procedures that includes all
100 the intrinsic procedures required by the Fortran 95 standard, a set of
101 intrinsic procedures for backwards compatibility with Gnu Fortran 77
102 (i.e., @command{g77}), and a small selection of intrinsic procedures
103 from the Fortran 2003 standard. Any description here, which conflicts with a
104 description in either the Fortran 95 standard or the Fortran 2003 standard,
105 is unintentional and the standard(s) should be considered authoritative.
107 The enumeration of the @code{KIND} type parameter is processor defined in
108 the Fortran 95 standard. Gfortran defines the default integer type and
109 default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)},
110 respectively. The standard mandates that both data types shall have
111 another kind, which have more precision. On typical target architectures
112 supported by @command{gfortran}, this kind type parameter is @code{KIND=8}.
113 Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
114 In the description of generic intrinsic procedures, the kind type parameter
115 will be specified by @code{KIND=*}, and in the description of specific
116 names for an intrinsic procedure the kind type parameter will be explicitly
117 given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}). Finally, for
118 brevity the optional @code{KIND=} syntax will be omitted.
120 Many of the intrinsics procedures take one or more optional arguments.
121 This document follows the convention used in the Fortran 95 standard,
122 and denotes such arguments by square brackets.
124 @command{Gfortran} offers the @option{-std=f95} and @option{-std=gnu} options,
125 which can be used to restrict the set of intrinsic procedures to a
126 given standard. By default, @command{gfortran} sets the @option{-std=gnu}
127 option, and so all intrinsic procedures described here are accepted. There
128 is one caveat. For a select group of intrinsic procedures, @command{g77}
129 implemented both a function and a subroutine. Both classes
130 have been implemented in @command{gfortran} for backwards compatibility
131 with @command{g77}. It is noted here that these functions and subroutines
132 cannot be intermixed in a given subprogram. In the descriptions that follow,
133 the applicable option(s) is noted.
138 @section @code{ABORT} --- Abort the program
143 @item @emph{Description}:
144 @code{ABORT} causes immediate termination of the program. On operating
145 systems that support a core dump, @code{ABORT} will produce a core dump,
146 which is suitable for debugging purposes.
152 non-elemental subroutine
157 @item @emph{Return value}:
160 @item @emph{Example}:
163 integer :: i = 1, j = 2
164 if (i /= j) call abort
165 end program test_abort
172 @section @code{ABS} --- Absolute value
173 @findex @code{ABS} intrinsic
174 @findex @code{CABS} intrinsic
175 @findex @code{DABS} intrinsic
176 @findex @code{IABS} intrinsic
177 @findex @code{ZABS} intrinsic
178 @findex @code{CDABS} intrinsic
179 @cindex absolute value
182 @item @emph{Description}:
183 @code{ABS(X)} computes the absolute value of @code{X}.
194 @item @emph{Arguments}:
195 @multitable @columnfractions .15 .80
196 @item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)},
197 @code{REAL(*)}, or @code{COMPLEX(*)}.
200 @item @emph{Return value}:
201 The return value is of the same type and
202 kind as the argument except the return value is @code{REAL(*)} for a
203 @code{COMPLEX(*)} argument.
205 @item @emph{Example}:
210 complex :: z = (-1.e0,0.e0)
217 @item @emph{Specific names}:
218 @multitable @columnfractions .24 .24 .24 .24
219 @item Name @tab Argument @tab Return type @tab Option
220 @item @code{CABS(Z)} @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)} @tab f95, gnu
221 @item @code{DABS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
222 @item @code{IABS(I)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab f95, gnu
223 @item @code{ZABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
224 @item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
231 @section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence
232 @findex @code{ACHAR} intrinsic
233 @cindex @acronym{ASCII} collating sequence
236 @item @emph{Description}:
237 @code{ACHAR(I)} returns the character located at position @code{I}
238 in the @acronym{ASCII} collating sequence.
249 @item @emph{Arguments}:
250 @multitable @columnfractions .15 .80
251 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
254 @item @emph{Return value}:
255 The return value is of type @code{CHARACTER} with a length of one. The
256 kind type parameter is the same as @code{KIND('A')}.
258 @item @emph{Example}:
263 end program test_achar
270 @section @code{ACOS} --- Arc cosine function
271 @findex @code{ACOS} intrinsic
272 @findex @code{DACOS} intrinsic
276 @item @emph{Description}:
277 @code{ACOS(X)} computes the arc cosine of @var{X}.
288 @item @emph{Arguments}:
289 @multitable @columnfractions .15 .80
290 @item @var{X} @tab The type shall be @code{REAL(*)} with a magnitude that is
294 @item @emph{Return value}:
295 The return value is of type @code{REAL(*)} and it lies in the
296 range @math{ 0 \leq \arccos (x) \leq \pi}. The kind type
297 parameter is the same as @var{X}.
299 @item @emph{Example}:
302 real(8) :: x = 0.866_8
304 end program test_acos
307 @item @emph{Specific names}:
308 @multitable @columnfractions .24 .24 .24 .24
309 @item Name @tab Argument @tab Return type @tab Option
310 @item @code{DACOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
317 @section @code{ADJUSTL} --- Left adjust a string
318 @findex @code{ADJUSTL} intrinsic
319 @cindex adjust string
322 @item @emph{Description}:
323 @code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.
324 Spaces are inserted at the end of the string as needed.
333 @code{STR = ADJUSTL(STR)}
335 @item @emph{Arguments}:
336 @multitable @columnfractions .15 .80
337 @item @var{STR} @tab The type shall be @code{CHARACTER}.
340 @item @emph{Return value}:
341 The return value is of type @code{CHARACTER} where leading spaces
342 are removed and the same number of spaces are inserted on the end
345 @item @emph{Example}:
348 character(len=20) :: str = ' gfortran'
351 end program test_adjustl
358 @section @code{ADJUSTR} --- Right adjust a string
359 @findex @code{ADJUSTR} intrinsic
360 @cindex adjust string
363 @item @emph{Description}:
364 @code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.
365 Spaces are inserted at the start of the string as needed.
374 @code{STR = ADJUSTR(STR)}
376 @item @emph{Arguments}:
377 @multitable @columnfractions .15 .80
378 @item @var{STR} @tab The type shall be @code{CHARACTER}.
381 @item @emph{Return value}:
382 The return value is of type @code{CHARACTER} where trailing spaces
383 are removed and the same number of spaces are inserted at the start
386 @item @emph{Example}:
389 character(len=20) :: str = 'gfortran'
392 end program test_adjustr
399 @section @code{AIMAG} --- Imaginary part of complex number
400 @findex @code{AIMAG} intrinsic
401 @findex @code{DIMAG} intrinsic
402 @cindex Imaginary part
405 @item @emph{Description}:
406 @code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.
417 @item @emph{Arguments}:
418 @multitable @columnfractions .15 .80
419 @item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.
422 @item @emph{Return value}:
423 The return value is of type real with the
424 kind type parameter of the argument.
426 @item @emph{Example}:
431 z4 = cmplx(1.e0_4, 0.e0_4)
432 z8 = cmplx(0.e0_8, 1.e0_8)
433 print *, aimag(z4), dimag(z8)
434 end program test_aimag
437 @item @emph{Specific names}:
438 @multitable @columnfractions .24 .24 .24 .24
439 @item Name @tab Argument @tab Return type @tab Option
440 @item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab f95, gnu
447 @section @code{AINT} --- Imaginary part of complex number
448 @findex @code{AINT} intrinsic
449 @findex @code{DINT} intrinsic
453 @item @emph{Description}:
454 @code{AINT(X [, KIND])} truncates its argument to a whole number.
464 @code{X = AINT(X, KIND)}
466 @item @emph{Arguments}:
467 @multitable @columnfractions .15 .80
468 @item @var{X} @tab The type of the argument shall be @code{REAL(*)}.
469 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
470 initialization expression.
473 @item @emph{Return value}:
474 The return value is of type real with the kind type parameter of the
475 argument if the optional @var{KIND} is absent; otherwise, the kind
476 type parameter will be given by @var{KIND}. If the magnitude of
477 @var{X} is less than one, then @code{AINT(X)} returns zero. If the
478 magnitude is equal to or greater than one, then it returns the largest
479 whole number that does not exceed its magnitude. The sign is the same
480 as the sign of @var{X}.
482 @item @emph{Example}:
489 print *, aint(x4), dint(x8)
491 end program test_aint
494 @item @emph{Specific names}:
495 @multitable @columnfractions .24 .24 .24 .24
496 @item Name @tab Argument @tab Return type @tab Option
497 @item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
504 @section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true
505 @findex @code{ALL} intrinsic
509 @item @emph{Description}:
510 @code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}
511 in the array along dimension @var{DIM}.
517 transformational function
521 @code{L = ALL(MASK, DIM)}
523 @item @emph{Arguments}:
524 @multitable @columnfractions .15 .80
525 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
526 it shall not be scalar.
527 @item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer
528 with a value that lies between one and the rank of @var{MASK}.
531 @item @emph{Return value}:
532 @code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
533 the kind type parameter is the same as the kind type parameter of
534 @var{MASK}. If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns
535 an array with the rank of @var{MASK} minus 1. The shape is determined from
536 the shape of @var{MASK} where the @var{DIM} dimension is elided.
540 @code{ALL(MASK)} is true if all elements of @var{MASK} are true.
541 It also is true if @var{MASK} has zero size; otherwise, it is false.
543 If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent
544 to @code{ALL(MASK)}. If the rank is greater than one, then @code{ALL(MASK,DIM)}
545 is determined by applying @code{ALL} to the array sections.
548 @item @emph{Example}:
552 l = all((/.true., .true., .true./))
557 integer a(2,3), b(2,3)
561 print *, all(a .eq. b, 1)
562 print *, all(a .eq. b, 2)
563 end subroutine section
571 @section @code{ALLOCATED} --- Status of an allocatable entity
572 @findex @code{ALLOCATED} intrinsic
573 @cindex allocation status
576 @item @emph{Description}:
577 @code{ALLOCATED(X)} checks the status of whether @var{X} is allocated.
586 @code{L = ALLOCATED(X)}
588 @item @emph{Arguments}:
589 @multitable @columnfractions .15 .80
590 @item @var{X} @tab The argument shall be an @code{ALLOCATABLE} array.
593 @item @emph{Return value}:
594 The return value is a scalar @code{LOGICAL} with the default logical
595 kind type parameter. If @var{X} is allocated, @code{ALLOCATED(X)}
596 is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.}
598 @item @emph{Example}:
600 program test_allocated
602 real(4), allocatable :: x(:)
603 if (allocated(x) .eqv. .false.) allocate(x(i)
604 end program test_allocated
611 @section @code{ANINT} --- Imaginary part of complex number
612 @findex @code{ANINT} intrinsic
613 @findex @code{DNINT} intrinsic
617 @item @emph{Description}:
618 @code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.
628 @code{X = ANINT(X, KIND)}
630 @item @emph{Arguments}:
631 @multitable @columnfractions .15 .80
632 @item @var{X} @tab The type of the argument shall be @code{REAL(*)}.
633 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
634 initialization expression.
637 @item @emph{Return value}:
638 The return value is of type real with the kind type parameter of the
639 argument if the optional @var{KIND} is absent; otherwise, the kind
640 type parameter will be given by @var{KIND}. If @var{X} is greater than
641 zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}. If @var{X} is
642 less than or equal to zero, then return @code{AINT(X-0.5)}.
644 @item @emph{Example}:
651 print *, anint(x4), dnint(x8)
653 end program test_anint
656 @item @emph{Specific names}:
657 @multitable @columnfractions .24 .24 .24 .24
658 @item Name @tab Argument @tab Return type @tab Option
659 @item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
666 @section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true
667 @findex @code{ANY} intrinsic
671 @item @emph{Description}:
672 @code{ANY(MASK [, DIM])} determines if any of the values in the logical array
673 @var{MASK} along dimension @var{DIM} are @code{.TRUE.}.
679 transformational function
683 @code{L = ANY(MASK, DIM)}
685 @item @emph{Arguments}:
686 @multitable @columnfractions .15 .80
687 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
688 it shall not be scalar.
689 @item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer
690 with a value that lies between one and the rank of @var{MASK}.
693 @item @emph{Return value}:
694 @code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
695 the kind type parameter is the same as the kind type parameter of
696 @var{MASK}. If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns
697 an array with the rank of @var{MASK} minus 1. The shape is determined from
698 the shape of @var{MASK} where the @var{DIM} dimension is elided.
702 @code{ANY(MASK)} is true if any element of @var{MASK} is true;
703 otherwise, it is false. It also is false if @var{MASK} has zero size.
705 If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent
706 to @code{ANY(MASK)}. If the rank is greater than one, then @code{ANY(MASK,DIM)}
707 is determined by applying @code{ANY} to the array sections.
710 @item @emph{Example}:
714 l = any((/.true., .true., .true./))
719 integer a(2,3), b(2,3)
723 print *, any(a .eq. b, 1)
724 print *, any(a .eq. b, 2)
725 end subroutine section
733 @section @code{ASIN} --- Arcsine function
734 @findex @code{ASIN} intrinsic
735 @findex @code{DASIN} intrinsic
739 @item @emph{Description}:
740 @code{ASIN(X)} computes the arcsine of its @var{X}.
751 @item @emph{Arguments}:
752 @multitable @columnfractions .15 .80
753 @item @var{X} @tab The type shall be @code{REAL(*)}, and a magnitude that is
757 @item @emph{Return value}:
758 The return value is of type @code{REAL(*)} and it lies in the
759 range @math{-\pi / 2 \leq \arccos (x) \leq \pi / 2}. The kind type
760 parameter is the same as @var{X}.
762 @item @emph{Example}:
765 real(8) :: x = 0.866_8
767 end program test_asin
770 @item @emph{Specific names}:
771 @multitable @columnfractions .24 .24 .24 .24
772 @item Name @tab Argument @tab Return type @tab Option
773 @item @code{DASIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
780 @section @code{ASSOCIATED} --- Status of a pointer or pointer/target pair
781 @findex @code{ASSOCIATED} intrinsic
782 @cindex pointer status
785 @item @emph{Description}:
786 @code{ASSOCIATED(PTR [, TGT])} determines the status of the pointer @var{PTR}
787 or if @var{PTR} is associated with the target @var{TGT}.
796 @code{L = ASSOCIATED(PTR)}
797 @code{L = ASSOCIATED(PTR [, TGT])}
799 @item @emph{Arguments}:
800 @multitable @columnfractions .15 .80
801 @item @var{PTR} @tab @var{PTR} shall have the @code{POINTER} attribute and
802 it can be of any type.
803 @item @var{TGT} @tab (Optional) @var{TGT} shall be a @code{POINTER} or
804 a @code{TARGET}. It must have the same type, kind type parameter, and
805 array rank as @var{PTR}.
807 The status of neither @var{PTR} nor @var{TGT} can be undefined.
809 @item @emph{Return value}:
810 @code{ASSOCIATED(PTR)} returns a scalar value of type @code{LOGICAL(4)}.
811 There are several cases:
813 @item (A) If the optional @var{TGT} is not present, then @code{ASSOCIATED(PTR)}
814 is true if @var{PTR} is associated with a target; otherwise, it returns false.
815 @item (B) If @var{TGT} is present and a scalar target, the result is true if
817 is not a 0 sized storage sequence and the target associated with @var{PTR}
818 occupies the same storage units. If @var{PTR} is disassociated, then the
820 @item (C) If @var{TGT} is present and an array target, the result is true if
821 @var{TGT} and @var{PTR} have the same shape, are not 0 sized arrays, are
822 arrays whose elements are not 0 sized storage sequences, and @var{TGT} and
823 @var{PTR} occupy the same storage units in array element order.
824 As in case(B), the result is false, if @var{PTR} is disassociated.
825 @item (D) If @var{TGT} is present and an scalar pointer, the result is true if
826 target associated with @var{PTR} and the target associated with @var{TGT}
827 are not 0 sized storage sequences and occupy the same storage units.
828 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
829 @item (E) If @var{TGT} is present and an array pointer, the result is true if
830 target associated with @var{PTR} and the target associated with @var{TGT}
831 have the same shape, are not 0 sized arrays, are arrays whose elements are
832 not 0 sized storage sequences, and @var{TGT} and @var{PTR} occupy the same
833 storage units in array element order.
834 The result is false, if either @var{TGT} or @var{PTR} is disassociated.
837 @item @emph{Example}:
839 program test_associated
841 real, target :: tgt(2) = (/1., 2./)
842 real, pointer :: ptr(:)
844 if (associated(ptr) .eqv. .false.) call abort
845 if (associated(ptr,tgt) .eqv. .false.) call abort
846 end program test_associated
853 @section @code{ATAN} --- Arctangent function
854 @findex @code{ATAN} intrinsic
855 @findex @code{DATAN} intrinsic
859 @item @emph{Description}:
860 @code{ATAN(X)} computes the arctangent of @var{X}.
871 @item @emph{Arguments}:
872 @multitable @columnfractions .15 .80
873 @item @var{X} @tab The type shall be @code{REAL(*)}.
876 @item @emph{Return value}:
877 The return value is of type @code{REAL(*)} and it lies in the
878 range @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}.
880 @item @emph{Example}:
883 real(8) :: x = 2.866_8
885 end program test_atan
888 @item @emph{Specific names}:
889 @multitable @columnfractions .24 .24 .24 .24
890 @item Name @tab Argument @tab Return type @tab Option
891 @item @code{DATAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
898 @section @code{ATAN2} --- Arctangent function
899 @findex @code{ATAN2} intrinsic
900 @findex @code{DATAN2} intrinsic
904 @item @emph{Description}:
905 @code{ATAN2(Y,X)} computes the arctangent of the complex number @math{X + i Y}.
914 @code{X = ATAN2(Y,X)}
916 @item @emph{Arguments}:
917 @multitable @columnfractions .15 .80
918 @item @var{Y} @tab The type shall be @code{REAL(*)}.
919 @item @var{X} @tab The type and kind type parameter shall be the same as @var{Y}.
920 If @var{Y} is zero, then @var{X} must be nonzero.
923 @item @emph{Return value}:
924 The return value has the same type and kind type parameter as @var{Y}.
925 It is the principle value of the complex number @math{X + i Y}. If
926 @var{X} is nonzero, then it lies in the range @math{-\pi \le \arccos (x) \leq \pi}.
927 The sign is positive if @var{Y} is positive. If @var{Y} is zero, then
928 the return value is zero if @var{X} is positive and @math{\pi} if @var{X}
929 is negative. Finally, if @var{X} is zero, then the magnitude of the result
932 @item @emph{Example}:
935 real(4) :: x = 1.e0_4, y = 0.5e0_4
937 end program test_atan2
940 @item @emph{Specific names}:
941 @multitable @columnfractions .24 .24 .24 .24
942 @item Name @tab Argument @tab Return type @tab Option
943 @item @code{DATAN2(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
950 @section @code{BESJ0} --- Bessel function of the first kind of order 0
951 @findex @code{BESJ0} intrinsic
952 @findex @code{DBESJ0} intrinsic
956 @item @emph{Description}:
957 @code{BESJ0(X)} computes the Bessel function of the first kind of order 0
969 @item @emph{Arguments}:
970 @multitable @columnfractions .15 .80
971 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
974 @item @emph{Return value}:
975 The return value is of type @code{REAL(*)} and it lies in the
976 range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
978 @item @emph{Example}:
983 end program test_besj0
986 @item @emph{Specific names}:
987 @multitable @columnfractions .24 .24 .24 .24
988 @item Name @tab Argument @tab Return type @tab Option
989 @item @code{DBESJ0(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
996 @section @code{BESJ1} --- Bessel function of the first kind of order 1
997 @findex @code{BESJ1} intrinsic
998 @findex @code{DBESJ1} intrinsic
1002 @item @emph{Description}:
1003 @code{BESJ1(X)} computes the Bessel function of the first kind of order 1
1006 @item @emph{Option}:
1012 @item @emph{Syntax}:
1015 @item @emph{Arguments}:
1016 @multitable @columnfractions .15 .80
1017 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1020 @item @emph{Return value}:
1021 The return value is of type @code{REAL(*)} and it lies in the
1022 range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
1024 @item @emph{Example}:
1027 real(8) :: x = 1.0_8
1029 end program test_besj1
1032 @item @emph{Specific names}:
1033 @multitable @columnfractions .24 .24 .24 .24
1034 @item Name @tab Argument @tab Return type @tab Option
1035 @item @code{DBESJ1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
1042 @section @code{BESJN} --- Bessel function of the first kind
1043 @findex @code{BESJN} intrinsic
1044 @findex @code{DBESJN} intrinsic
1048 @item @emph{Description}:
1049 @code{BESJN(N, X)} computes the Bessel function of the first kind of order
1052 @item @emph{Option}:
1058 @item @emph{Syntax}:
1059 @code{Y = BESJN(N, X)}
1061 @item @emph{Arguments}:
1062 @multitable @columnfractions .15 .80
1063 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1064 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1067 @item @emph{Return value}:
1068 The return value is a scalar of type @code{REAL(*)}.
1070 @item @emph{Example}:
1073 real(8) :: x = 1.0_8
1075 end program test_besjn
1078 @item @emph{Specific names}:
1079 @multitable @columnfractions .24 .24 .24 .24
1080 @item Name @tab Argument @tab Return type @tab Option
1081 @item @code{DBESJN(X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)} @tab gnu
1082 @item @tab @code{REAL(8) X} @tab @tab
1089 @section @code{BESY0} --- Bessel function of the second kind of order 0
1090 @findex @code{BESY0} intrinsic
1091 @findex @code{DBESY0} intrinsic
1095 @item @emph{Description}:
1096 @code{BESY0(X)} computes the Bessel function of the second kind of order 0
1099 @item @emph{Option}:
1105 @item @emph{Syntax}:
1108 @item @emph{Arguments}:
1109 @multitable @columnfractions .15 .80
1110 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1113 @item @emph{Return value}:
1114 The return value is a scalar of type @code{REAL(*)}.
1116 @item @emph{Example}:
1119 real(8) :: x = 0.0_8
1121 end program test_besy0
1124 @item @emph{Specific names}:
1125 @multitable @columnfractions .24 .24 .24 .24
1126 @item Name @tab Argument @tab Return type @tab Option
1127 @item @code{DBESY0(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
1134 @section @code{BESY1} --- Bessel function of the second kind of order 1
1135 @findex @code{BESY1} intrinsic
1136 @findex @code{DBESY1} intrinsic
1140 @item @emph{Description}:
1141 @code{BESY1(X)} computes the Bessel function of the second kind of order 1
1144 @item @emph{Option}:
1150 @item @emph{Syntax}:
1153 @item @emph{Arguments}:
1154 @multitable @columnfractions .15 .80
1155 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1158 @item @emph{Return value}:
1159 The return value is a scalar of type @code{REAL(*)}.
1161 @item @emph{Example}:
1164 real(8) :: x = 1.0_8
1166 end program test_besy1
1169 @item @emph{Specific names}:
1170 @multitable @columnfractions .24 .24 .24 .24
1171 @item Name @tab Argument @tab Return type @tab Option
1172 @item @code{DBESY1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
1179 @section @code{BESYN} --- Bessel function of the second kind
1180 @findex @code{BESYN} intrinsic
1181 @findex @code{DBESYN} intrinsic
1185 @item @emph{Description}:
1186 @code{BESYN(N, X)} computes the Bessel function of the second kind of order
1189 @item @emph{Option}:
1195 @item @emph{Syntax}:
1196 @code{Y = BESYN(N, X)}
1198 @item @emph{Arguments}:
1199 @multitable @columnfractions .15 .80
1200 @item @var{N} @tab The type shall be @code{INTEGER(*)}, and it shall be scalar.
1201 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
1204 @item @emph{Return value}:
1205 The return value is a scalar of type @code{REAL(*)}.
1207 @item @emph{Example}:
1210 real(8) :: x = 1.0_8
1212 end program test_besyn
1215 @item @emph{Specific names}:
1216 @multitable @columnfractions .24 .24 .24 .24
1217 @item Name @tab Argument @tab Return type @tab Option
1218 @item @code{DBESYN(N,X)} @tab @code{INTEGER(*) N} @tab @code{REAL(8)} @tab gnu
1219 @item @tab @code{REAL(8) X} @tab @tab
1226 @section @code{BIT_SIZE} --- Bit size inquiry function
1227 @findex @code{BIT_SIZE} intrinsic
1231 @item @emph{Description}:
1232 @code{BIT_SIZE(I)} returns the number of bits (integer precision plus sign bit)
1233 represented by the type of @var{I}.
1235 @item @emph{Option}:
1241 @item @emph{Syntax}:
1242 @code{I = BIT_SIZE(I)}
1244 @item @emph{Arguments}:
1245 @multitable @columnfractions .15 .80
1246 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1249 @item @emph{Return value}:
1250 The return value is of type @code{INTEGER(*)}
1252 @item @emph{Example}:
1254 program test_bit_size
1259 end program test_bit_size
1266 @section @code{BTEST} --- Bit test function
1267 @findex @code{BTEST} intrinsic
1271 @item @emph{Description}:
1272 @code{BTEST(I,POS)} returns logical @code{.TRUE.} if the bit at @var{POS}
1275 @item @emph{Option}:
1281 @item @emph{Syntax}:
1282 @code{I = BTEST(I,POS)}
1284 @item @emph{Arguments}:
1285 @multitable @columnfractions .15 .80
1286 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1287 @item @var{POS} @tab The type shall be @code{INTEGER(*)}.
1290 @item @emph{Return value}:
1291 The return value is of type @code{LOGICAL}
1293 @item @emph{Example}:
1296 integer :: i = 32768 + 1024 + 64
1300 bool = btest(i, pos)
1303 end program test_btest
1310 @section @code{CEILING} --- Integer ceiling function
1311 @findex @code{CEILING} intrinsic
1315 @item @emph{Description}:
1316 @code{CEILING(X)} returns the least integer greater than or equal to @var{X}.
1318 @item @emph{Option}:
1324 @item @emph{Syntax}:
1325 @code{X = CEILING(X[,KIND])}
1327 @item @emph{Arguments}:
1328 @multitable @columnfractions .15 .80
1329 @item @var{X} @tab The type shall be @code{REAL(*)}.
1330 @item @var{KIND} @tab Optional scaler integer initialization expression.
1333 @item @emph{Return value}:
1334 The return value is of type @code{INTEGER(KIND)}
1336 @item @emph{Example}:
1338 program test_ceiling
1341 print *, ceiling(x) ! returns 64
1342 print *, ceiling(y) ! returns -63
1343 end program test_ceiling
1350 @section @code{CHAR} --- Character conversion function
1351 @findex @code{CHAR} intrinsic
1355 @item @emph{Description}:
1356 @code{CHAR(I,[KIND])} returns the character represented by the integer @var{I}.
1358 @item @emph{Option}:
1364 @item @emph{Syntax}:
1365 @code{C = CHAR(I[,KIND])}
1367 @item @emph{Arguments}:
1368 @multitable @columnfractions .15 .80
1369 @item @var{I} @tab The type shall be @code{INTEGER(*)}.
1370 @item @var{KIND} @tab Optional scaler integer initialization expression.
1373 @item @emph{Return value}:
1374 The return value is of type @code{CHARACTER(1)}
1376 @item @emph{Example}:
1382 print *, i, c ! returns 'J'
1383 end program test_char
1390 @section @code{CMPLX} --- Complex conversion function
1391 @findex @code{CMPLX} intrinsic
1395 @item @emph{Description}:
1396 @code{CMPLX(X,[Y,KIND])} returns a complex number where @var{X} is converted to
1397 the real component. If @var{Y} is present it is converted to the imaginary
1398 component. If @var{Y} is not present then the imaginary component is set to
1399 0.0. If @var{X} is complex then @var{Y} must not be present.
1401 @item @emph{Option}:
1407 @item @emph{Syntax}:
1408 @code{C = CMPLX(X[,Y,KIND])}
1410 @item @emph{Arguments}:
1411 @multitable @columnfractions .15 .80
1412 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1413 @item @var{Y} @tab Optional, allowed if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}.
1414 @item @var{KIND} @tab Optional scaler integer initialization expression.
1417 @item @emph{Return value}:
1418 The return value is of type @code{COMPLEX(*)}
1420 @item @emph{Example}:
1427 print *, z, cmplx(x)
1428 end program test_cmplx
1434 @node COMMAND_ARGUMENT_COUNT
1435 @section @code{COMMAND_ARGUMENT_COUNT} --- Argument count function
1436 @findex @code{COMMAND_ARGUMENT_COUNT} intrinsic
1437 @cindex command argument count
1440 @item @emph{Description}:
1441 @code{COMMAND_ARGUMENT_COUNT()} returns the number of arguments passed on the
1442 command line when the containing program was invoked.
1444 @item @emph{Option}:
1448 non-elemental function
1450 @item @emph{Syntax}:
1451 @code{I = COMMAND_ARGUMENT_COUNT()}
1453 @item @emph{Arguments}:
1454 @multitable @columnfractions .15 .80
1458 @item @emph{Return value}:
1459 The return value is of type @code{INTEGER(4)}
1461 @item @emph{Example}:
1463 program test_command_argument_count
1465 count = command_argument_count()
1467 end program test_command_argument_count
1474 @section @code{CONJG} --- Complex conjugate function
1475 @findex @code{CONJG} intrinsic
1476 @findex @code{DCONJG} intrinsic
1477 @cindex complex conjugate
1479 @item @emph{Description}:
1480 @code{CONJG(Z)} returns the conjugate of @var{Z}. If @var{Z} is @code{(x, y)}
1481 then the result is @code{(x, -y)}
1483 @item @emph{Option}:
1489 @item @emph{Syntax}:
1492 @item @emph{Arguments}:
1493 @multitable @columnfractions .15 .80
1494 @item @var{Z} @tab The type shall be @code{COMPLEX(*)}.
1497 @item @emph{Return value}:
1498 The return value is of type @code{COMPLEX(*)}.
1500 @item @emph{Example}:
1503 complex :: z = (2.0, 3.0)
1504 complex(8) :: dz = (2.71_8, -3.14_8)
1509 end program test_conjg
1512 @item @emph{Specific names}:
1513 @multitable @columnfractions .24 .24 .24 .24
1514 @item Name @tab Argument @tab Return type @tab Option
1515 @item @code{DCONJG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
1522 @section @code{COS} --- Cosine function
1523 @findex @code{COS} intrinsic
1524 @findex @code{DCOS} intrinsic
1525 @findex @code{ZCOS} intrinsic
1526 @findex @code{CDCOS} intrinsic
1530 @item @emph{Description}:
1531 @code{COS(X)} computes the cosine of @var{X}.
1533 @item @emph{Option}:
1539 @item @emph{Syntax}:
1542 @item @emph{Arguments}:
1543 @multitable @columnfractions .15 .80
1544 @item @var{X} @tab The type shall be @code{REAL(*)} or
1548 @item @emph{Return value}:
1549 The return value has the same type and kind as @var{X}.
1551 @item @emph{Example}:
1556 end program test_cos
1559 @item @emph{Specific names}:
1560 @multitable @columnfractions .24 .24 .24 .24
1561 @item Name @tab Argument @tab Return type @tab Option
1562 @item @code{DCOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1563 @item @code{CCOS(X)}@tab @code{COMPLEX(4) X}@tab @code{COMPLEX(4)}@tab f95, gnu
1564 @item @code{ZCOS(X)}@tab @code{COMPLEX(8) X}@tab @code{COMPLEX(8)}@tab f95, gnu
1565 @item @code{CDCOS(X)}@tab @code{COMPLEX(8) X}@tab @code{COMPLEX(8)}@tab f95, gnu
1572 @section @code{COSH} --- Hyperbolic cosine function
1573 @findex @code{COSH} intrinsic
1574 @findex @code{DCOSH} intrinsic
1575 @cindex hyperbolic cosine
1578 @item @emph{Description}:
1579 @code{COSH(X)} computes the hyperbolic cosine of @var{X}.
1581 @item @emph{Option}:
1587 @item @emph{Syntax}:
1590 @item @emph{Arguments}:
1591 @multitable @columnfractions .15 .80
1592 @item @var{X} @tab The type shall be @code{REAL(*)}.
1595 @item @emph{Return value}:
1596 The return value is of type @code{REAL(*)} and it is positive
1597 (@math{ \cosh (x) \geq 0 }.
1599 @item @emph{Example}:
1602 real(8) :: x = 1.0_8
1604 end program test_cosh
1607 @item @emph{Specific names}:
1608 @multitable @columnfractions .24 .24 .24 .24
1609 @item Name @tab Argument @tab Return type @tab Option
1610 @item @code{DCOSH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1617 @section @code{COUNT} --- Count function
1618 @findex @code{COUNT} intrinsic
1622 @item @emph{Description}:
1623 @code{COUNT(MASK[,DIM])} counts the number of @code{.TRUE.} elements of
1624 @var{MASK} along the dimension of @var{DIM}. If @var{DIM} is omitted it is
1625 taken to be @code{1}. @var{DIM} is a scaler of type @code{INTEGER} in the
1626 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{MASK}.
1628 @item @emph{Option}:
1632 transformational function
1634 @item @emph{Syntax}:
1635 @code{I = COUNT(MASK[,DIM])}
1637 @item @emph{Arguments}:
1638 @multitable @columnfractions .15 .80
1639 @item @var{MASK} @tab The type shall be @code{LOGICAL}.
1640 @item @var{DIM} @tab The type shall be @code{INTEGER}.
1643 @item @emph{Return value}:
1644 The return value is of type @code{INTEGER} with rank equal to that of
1647 @item @emph{Example}:
1650 integer, dimension(2,3) :: a, b
1651 logical, dimension(2,3) :: mask
1652 a = reshape( (/ 1, 2, 3, 4, 5, 6 /), (/ 2, 3 /))
1653 b = reshape( (/ 0, 7, 3, 4, 5, 8 /), (/ 2, 3 /))
1654 print '(3i3)', a(1,:)
1655 print '(3i3)', a(2,:)
1657 print '(3i3)', b(1,:)
1658 print '(3i3)', b(2,:)
1661 print '(3l3)', mask(1,:)
1662 print '(3l3)', mask(2,:)
1664 print '(3i3)', count(mask)
1666 print '(3i3)', count(mask, 1)
1668 print '(3i3)', count(mask, 2)
1669 end program test_count
1676 @section @code{CPU_TIME} --- CPU elapsed time in seconds
1677 @findex @code{CPU_TIME} intrinsic
1681 @item @emph{Description}:
1682 Returns a @code{REAL} value representing the elapsed CPU time in seconds. This
1683 is useful for testing segments of code to determine execution time.
1685 @item @emph{Option}:
1691 @item @emph{Syntax}:
1694 @item @emph{Arguments}:
1695 @multitable @columnfractions .15 .80
1696 @item @var{X} @tab The type shall be @code{REAL} with intent out.
1699 @item @emph{Return value}:
1702 @item @emph{Example}:
1704 program test_cpu_time
1705 real :: start, finish
1706 call cpu_time(start)
1707 ! put code to test here
1708 call cpu_time(finish)
1709 print '("Time = ",f6.3," seconds.")',finish-start
1710 end program test_cpu_time
1717 @section @code{CSHIFT} --- Circular shift function
1718 @findex @code{CSHIFT} intrinsic
1719 @cindex cshift intrinsic
1722 @item @emph{Description}:
1723 @code{CSHIFT(ARRAY, SHIFT[,DIM])} performs a circular shift on elements of
1724 @var{ARRAY} along the dimension of @var{DIM}. If @var{DIM} is omitted it is
1725 taken to be @code{1}. @var{DIM} is a scaler of type @code{INTEGER} in the
1726 range of @math{1 /leq DIM /leq n)} where @math{n} is the rank of @var{ARRAY}.
1727 If the rank of @var{ARRAY} is one, then all elements of @var{ARRAY} are shifted
1728 by @var{SHIFT} places. If rank is greater than one, then all complete rank one
1729 sections of @var{ARRAY} along the given dimension are shifted. Elements
1730 shifted out one end of each rank one section are shifted back in the other end.
1732 @item @emph{Option}:
1736 transformational function
1738 @item @emph{Syntax}:
1739 @code{A = CSHIFT(A, SHIFT[,DIM])}
1741 @item @emph{Arguments}:
1742 @multitable @columnfractions .15 .80
1743 @item @var{ARRAY} @tab May be any type, not scaler.
1744 @item @var{SHIFT} @tab The type shall be @code{INTEGER}.
1745 @item @var{DIM} @tab The type shall be @code{INTEGER}.
1748 @item @emph{Return value}:
1749 Returns an array of same type and rank as the @var{ARRAY} argument.
1751 @item @emph{Example}:
1754 integer, dimension(3,3) :: a
1755 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
1756 print '(3i3)', a(1,:)
1757 print '(3i3)', a(2,:)
1758 print '(3i3)', a(3,:)
1759 a = cshift(a, SHIFT=(/1, 2, -1/), DIM=2)
1761 print '(3i3)', a(1,:)
1762 print '(3i3)', a(2,:)
1763 print '(3i3)', a(3,:)
1764 end program test_cshift
1771 @section @code{DATE_AND_TIME} --- Date and time subroutine
1772 @findex @code{DATE_AND_TIME} intrinsic
1773 @cindex DATE_AND_TIME
1776 @item @emph{Description}:
1777 @code{DATE_AND_TIME(DATE, TIME, ZONE, VALUES)} gets the corresponding date and
1778 time information from the real-time system clock. @var{DATE} is
1779 @code{INTENT(OUT)} and has form ccyymmdd. @var{TIME} is @code{INTENT(OUT)} and
1780 has form hhmmss.sss. @var{ZONE} is @code{INTENT(OUT)} and has form (+-)hhmm,
1781 representing the difference with respect to Coordinated Universal Time (UTC).
1782 Unavailable time and date parameters return blanks.
1784 @var{VALUES} is @code{INTENT(OUT)} and provides the following:
1786 @multitable @columnfractions .15 .30 .60
1787 @item @tab @code{VALUE(1)}: @tab The year
1788 @item @tab @code{VALUE(2)}: @tab The month
1789 @item @tab @code{VALUE(3)}: @tab The day of the month
1790 @item @tab @code{VAlUE(4)}: @tab Time difference with UTC in minutes
1791 @item @tab @code{VALUE(5)}: @tab The hour of the day
1792 @item @tab @code{VALUE(6)}: @tab The minutes of the hour
1793 @item @tab @code{VALUE(7)}: @tab The seconds of the minute
1794 @item @tab @code{VALUE(8)}: @tab The milliseconds of the second
1797 @item @emph{Option}:
1803 @item @emph{Syntax}:
1804 @code{CALL DATE_AND_TIME([DATE, TIME, ZONE, VALUES])}
1806 @item @emph{Arguments}:
1807 @multitable @columnfractions .15 .80
1808 @item @var{DATE} @tab (Optional) The type shall be @code{CHARACTER(8)} or larger.
1809 @item @var{TIME} @tab (Optional) The type shall be @code{CHARACTER(10)} or larger.
1810 @item @var{ZONE} @tab (Optional) The type shall be @code{CHARACTER(5)} or larger.
1811 @item @var{VALUES}@tab (Optional) The type shall be @code{INTEGER(8)}.
1814 @item @emph{Return value}:
1817 @item @emph{Example}:
1819 program test_time_and_date
1820 character(8) :: date
1821 character(10) :: time
1822 character(5) :: zone
1823 integer,dimension(8) :: values
1824 ! using keyword arguments
1825 call date_and_time(date,time,zone,values)
1826 call date_and_time(DATE=date,ZONE=zone)
1827 call date_and_time(TIME=time)
1828 call date_and_time(VALUES=values)
1829 print '(a,2x,a,2x,a)', date, time, zone
1830 print '(8i5))', values
1831 end program test_time_and_date
1838 @section @code{DBLE} --- Double conversion function
1839 @findex @code{DBLE} intrinsic
1840 @cindex double conversion
1843 @item @emph{Description}:
1844 @code{DBLE(X)} Converts @var{X} to double precision real type.
1845 @code{DFLOAT} is an alias for @code{DBLE}
1847 @item @emph{Option}:
1853 @item @emph{Syntax}:
1855 @code{X = DFLOAT(X)}
1857 @item @emph{Arguments}:
1858 @multitable @columnfractions .15 .80
1859 @item @var{X} @tab The type shall be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1862 @item @emph{Return value}:
1863 The return value is of type double precision real.
1865 @item @emph{Example}:
1870 complex :: z = (2.3,1.14)
1871 print *, dble(x), dble(i), dfloat(z)
1872 end program test_dble
1879 @section @code{DCMPLX} --- Double complex conversion function
1880 @findex @code{DCMPLX} intrinsic
1884 @item @emph{Description}:
1885 @code{DCMPLX(X [,Y])} returns a double complex number where @var{X} is
1886 converted to the real component. If @var{Y} is present it is converted to the
1887 imaginary component. If @var{Y} is not present then the imaginary component is
1888 set to 0.0. If @var{X} is complex then @var{Y} must not be present.
1890 @item @emph{Option}:
1896 @item @emph{Syntax}:
1897 @code{C = DCMPLX(X)}
1898 @code{C = DCMPLX(X,Y)}
1900 @item @emph{Arguments}:
1901 @multitable @columnfractions .15 .80
1902 @item @var{X} @tab The type may be @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}.
1903 @item @var{Y} @tab Optional if @var{X} is not @code{COMPLEX(*)}. May be @code{INTEGER(*)} or @code{REAL(*)}.
1906 @item @emph{Return value}:
1907 The return value is of type @code{COMPLEX(8)}
1909 @item @emph{Example}:
1919 print *, dcmplx(x,i)
1920 end program test_dcmplx
1927 @section @code{DFLOAT} --- Double conversion function
1928 @findex @code{DFLOAT} intrinsic
1929 @cindex double float conversion
1932 @item @emph{Description}:
1933 @code{DFLOAT(X)} Converts @var{X} to double precision real type.
1934 @code{DFLOAT} is an alias for @code{DBLE}. See @code{DBLE}.
1940 @section @code{DIGITS} --- Significant digits function
1941 @findex @code{DIGITS} intrinsic
1942 @cindex digits, significant
1945 @item @emph{Description}:
1946 @code{DIGITS(X)} returns the number of significant digits of the internal model
1947 representation of @var{X}. For example, on a system using a 32-bit
1948 floating point representation, a default real number would likely return 24.
1950 @item @emph{Option}:
1956 @item @emph{Syntax}:
1957 @code{C = DIGITS(X)}
1959 @item @emph{Arguments}:
1960 @multitable @columnfractions .15 .80
1961 @item @var{X} @tab The type may be @code{INTEGER(*)} or @code{REAL(*)}.
1964 @item @emph{Return value}:
1965 The return value is of type @code{INTEGER}.
1967 @item @emph{Example}:
1970 integer :: i = 12345
1976 end program test_digits
1983 @section @code{DIM} --- Dim function
1984 @findex @code{DIM} intrinsic
1985 @findex @code{IDIM} intrinsic
1986 @findex @code{DDIM} intrinsic
1990 @item @emph{Description}:
1991 @code{DIM(X,Y)} returns the difference @code{X-Y} if the result is positive;
1992 otherwise returns zero.
1994 @item @emph{Option}:
2000 @item @emph{Syntax}:
2003 @item @emph{Arguments}:
2004 @multitable @columnfractions .15 .80
2005 @item @var{X} @tab The type shall be @code{INTEGER(*)} or @code{REAL(*)}
2006 @item @var{Y} @tab The type shall be the same type and kind as @var{X}.
2009 @item @emph{Return value}:
2010 The return value is of type @code{INTEGER(*)} or @code{REAL(*)}.
2012 @item @emph{Example}:
2018 x = dim(4.345_8, 2.111_8)
2021 end program test_dim
2024 @item @emph{Specific names}:
2025 @multitable @columnfractions .24 .24 .24 .24
2026 @item Name @tab Argument @tab Return type @tab Option
2027 @item @code{IDIM(X,Y)} @tab @code{INTEGER(4) X,Y} @tab @code{INTEGER(4)} @tab gnu
2028 @item @code{DDIM(X,Y)} @tab @code{REAL(8) X,Y} @tab @code{REAL(8)} @tab gnu
2035 @section @code{DOT_PRODUCT} --- Dot product function
2036 @findex @code{DOT_PRODUCT} intrinsic
2040 @item @emph{Description}:
2041 @code{DOT_PRODUCT(X,Y)} computes the dot product multiplication of two vectors
2042 @var{X} and @var{Y}. The two vectors may be either numeric or logical
2043 and must be arrays of rank one and of equal size. If the vectors are
2044 @code{INTEGER(*)} or @code{REAL(*)}, the result is @code{SUM(X*Y)}. If the
2045 vectors are @code{COMPLEX(*)}, the result is @code{SUM(CONJG(X)*Y)}. If the
2046 vectors are @code{LOGICAL}, the result is @code{ANY(X.AND.Y)}.
2048 @item @emph{Option}:
2052 transformational function
2054 @item @emph{Syntax}:
2055 @code{S = DOT_PRODUCT(X,Y)}
2057 @item @emph{Arguments}:
2058 @multitable @columnfractions .15 .80
2059 @item @var{X} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2060 @item @var{Y} @tab The type shall be numeric or @code{LOGICAL}, rank 1.
2063 @item @emph{Return value}:
2064 If the arguments are numeric, the return value is a scaler of numeric type,
2065 @code{INTEGER(*)}, @code{REAL(*)}, or @code{COMPLEX(*)}. If the arguments are
2066 @code{LOGICAL}, the return value is @code{.TRUE.} or @code{.FALSE.}.
2068 @item @emph{Example}:
2070 program test_dot_prod
2071 integer, dimension(3) :: a, b
2078 print *, dot_product(a,b)
2079 end program test_dot_prod
2086 @section @code{DPROD} --- Double product function
2087 @findex @code{DPROD} intrinsic
2088 @cindex Double product
2091 @item @emph{Description}:
2092 @code{DPROD(X,Y)} returns the product @code{X*Y}.
2094 @item @emph{Option}:
2100 @item @emph{Syntax}:
2101 @code{D = DPROD(X,Y)}
2103 @item @emph{Arguments}:
2104 @multitable @columnfractions .15 .80
2105 @item @var{X} @tab The type shall be @code{REAL}.
2106 @item @var{Y} @tab The type shall be @code{REAL}.
2109 @item @emph{Return value}:
2110 The return value is of type @code{REAL(8)}.
2112 @item @emph{Example}:
2121 end program test_dprod
2128 @section @code{DREAL} --- Double real part function
2129 @findex @code{DREAL} intrinsic
2130 @cindex Double real part
2133 @item @emph{Description}:
2134 @code{DREAL(Z)} returns the real part of complex variable @var{Z}.
2136 @item @emph{Option}:
2142 @item @emph{Syntax}:
2145 @item @emph{Arguments}:
2146 @multitable @columnfractions .15 .80
2147 @item @var{Z} @tab The type shall be @code{COMPLEX(8)}.
2150 @item @emph{Return value}:
2151 The return value is of type @code{REAL(8)}.
2153 @item @emph{Example}:
2156 complex(8) :: z = (1.3_8,7.2_8)
2158 end program test_dreal
2165 @section @code{DTIME} --- Execution time subroutine (or function)
2166 @findex @code{DTIME} intrinsic
2167 @cindex dtime subroutine
2170 @item @emph{Description}:
2171 @code{DTIME(TARRAY, RESULT)} initially returns the number of seconds of runtime
2172 since the start of the process's execution in @var{RESULT}. @var{TARRAY}
2173 returns the user and system components of this time in @code{TARRAY(1)} and
2174 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) +
2177 Subsequent invocations of @code{DTIME} return values accumulated since the
2178 previous invocation.
2180 On some systems, the underlying timings are represented using types with
2181 sufficiently small limits that overflows (wraparounds) are possible, such as
2182 32-bit types. Therefore, the values returned by this intrinsic might be, or
2183 become, negative, or numerically less than previous values, during a single
2184 run of the compiled program.
2186 If @code{DTIME} is invoked as a function, it can not be invoked as a
2187 subroutine, and vice versa.
2189 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2191 @multitable @columnfractions .15 .30 .60
2192 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2193 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2194 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2197 @item @emph{Option}:
2203 @item @emph{Syntax}:
2204 @multitable @columnfractions .80
2205 @item @code{CALL DTIME(TARRAY, RESULT)}.
2206 @item @code{RESULT = DTIME(TARRAY)}, (not recommended).
2209 @item @emph{Arguments}:
2210 @multitable @columnfractions .15 .80
2211 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2212 @item @var{RESULT}@tab The type shall be @code{REAL}.
2215 @item @emph{Return value}:
2216 Elapsed time in seconds since the start of program execution.
2218 @item @emph{Example}:
2222 real, dimension(2) :: tarray
2224 call dtime(tarray, result)
2228 do i=1,100000000 ! Just a delay
2231 call dtime(tarray, result)
2235 end program test_dtime
2242 @section @code{EOSHIFT} --- End-off shift function
2243 @findex @code{EOSHIFT} intrinsic
2244 @cindex eoshift intrinsic
2247 @item @emph{Description}:
2248 @code{EOSHIFT(ARRAY, SHIFT[,BOUNDARY, DIM])} performs an end-off shift on
2249 elements of @var{ARRAY} along the dimension of @var{DIM}. If @var{DIM} is
2250 omitted it is taken to be @code{1}. @var{DIM} is a scaler of type
2251 @code{INTEGER} in the range of @math{1 /leq DIM /leq n)} where @math{n} is the
2252 rank of @var{ARRAY}. If the rank of @var{ARRAY} is one, then all elements of
2253 @var{ARRAY} are shifted by @var{SHIFT} places. If rank is greater than one,
2254 then all complete rank one sections of @var{ARRAY} along the given dimension are
2255 shifted. Elements shifted out one end of each rank one section are dropped. If
2256 @var{BOUNDARY} is present then the corresponding value of from @var{BOUNDARY}
2257 is copied back in the other end. If @var{BOUNDARY} is not present then the
2258 following are copied in depending on the type of @var{ARRAY}.
2260 @multitable @columnfractions .15 .80
2261 @item @emph{Array Type} @tab @emph{Boundary Value}
2262 @item Numeric @tab 0 of the type and kind of @var{ARRAY}.
2263 @item Logical @tab @code{.FALSE.}.
2264 @item Character(@var{len}) @tab @var{len} blanks.
2267 @item @emph{Option}:
2271 transformational function
2273 @item @emph{Syntax}:
2274 @code{A = EOSHIFT(A, SHIFT[,BOUNDARY, DIM])}
2276 @item @emph{Arguments}:
2277 @multitable @columnfractions .15 .80
2278 @item @var{ARRAY} @tab May be any type, not scaler.
2279 @item @var{SHIFT} @tab The type shall be @code{INTEGER}.
2280 @item @var{BOUNDARY} @tab Same type as @var{ARRAY}.
2281 @item @var{DIM} @tab The type shall be @code{INTEGER}.
2284 @item @emph{Return value}:
2285 Returns an array of same type and rank as the @var{ARRAY} argument.
2287 @item @emph{Example}:
2289 program test_eoshift
2290 integer, dimension(3,3) :: a
2291 a = reshape( (/ 1, 2, 3, 4, 5, 6, 7, 8, 9 /), (/ 3, 3 /))
2292 print '(3i3)', a(1,:)
2293 print '(3i3)', a(2,:)
2294 print '(3i3)', a(3,:)
2295 a = EOSHIFT(a, SHIFT=(/1, 2, 1/), BOUNDARY=-5, DIM=2)
2297 print '(3i3)', a(1,:)
2298 print '(3i3)', a(2,:)
2299 print '(3i3)', a(3,:)
2300 end program test_eoshift
2307 @section @code{EPSILON} --- Epsilon function
2308 @findex @code{EPSILON} intrinsic
2309 @cindex epsilon, significant
2312 @item @emph{Description}:
2313 @code{EPSILON(X)} returns a nearly negligible number relative to @code{1}.
2315 @item @emph{Option}:
2321 @item @emph{Syntax}:
2322 @code{C = EPSILON(X)}
2324 @item @emph{Arguments}:
2325 @multitable @columnfractions .15 .80
2326 @item @var{X} @tab The type shall be @code{REAL(*)}.
2329 @item @emph{Return value}:
2330 The return value is of same type as the argument.
2332 @item @emph{Example}:
2334 program test_epsilon
2339 end program test_epsilon
2346 @section @code{ERF} --- Error function
2347 @findex @code{ERF} intrinsic
2348 @cindex error function
2351 @item @emph{Description}:
2352 @code{ERF(X)} computes the error function of @var{X}.
2354 @item @emph{Option}:
2360 @item @emph{Syntax}:
2363 @item @emph{Arguments}:
2364 @multitable @columnfractions .15 .80
2365 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
2368 @item @emph{Return value}:
2369 The return value is a scalar of type @code{REAL(*)} and it is positive
2370 (@math{ - 1 \leq erf (x) \leq 1 }.
2372 @item @emph{Example}:
2375 real(8) :: x = 0.17_8
2377 end program test_erf
2380 @item @emph{Specific names}:
2381 @multitable @columnfractions .24 .24 .24 .24
2382 @item Name @tab Argument @tab Return type @tab Option
2383 @item @code{DERF(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
2390 @section @code{ERFC} --- Error function
2391 @findex @code{ERFC} intrinsic
2392 @cindex error function
2395 @item @emph{Description}:
2396 @code{ERFC(X)} computes the complementary error function of @var{X}.
2398 @item @emph{Option}:
2404 @item @emph{Syntax}:
2407 @item @emph{Arguments}:
2408 @multitable @columnfractions .15 .80
2409 @item @var{X} @tab The type shall be @code{REAL(*)}, and it shall be scalar.
2412 @item @emph{Return value}:
2413 The return value is a scalar of type @code{REAL(*)} and it is positive
2414 (@math{ 0 \leq erfc (x) \leq 2 }.
2416 @item @emph{Example}:
2419 real(8) :: x = 0.17_8
2421 end program test_erfc
2424 @item @emph{Specific names}:
2425 @multitable @columnfractions .24 .24 .24 .24
2426 @item Name @tab Argument @tab Return type @tab Option
2427 @item @code{DERFC(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
2434 @section @code{ETIME} --- Execution time subroutine (or function)
2435 @findex @code{ETIME} intrinsic
2436 @cindex ETIME subroutine
2439 @item @emph{Description}:
2440 @code{ETIME(TARRAY, RESULT)} returns the number of seconds of runtime
2441 since the start of the process's execution in @var{RESULT}. @var{TARRAY}
2442 returns the user and system components of this time in @code{TARRAY(1)} and
2443 @code{TARRAY(2)} respectively. @var{RESULT} is equal to @code{TARRAY(1) + TARRAY(2)}.
2445 On some systems, the underlying timings are represented using types with
2446 sufficiently small limits that overflows (wraparounds) are possible, such as
2447 32-bit types. Therefore, the values returned by this intrinsic might be, or
2448 become, negative, or numerically less than previous values, during a single
2449 run of the compiled program.
2451 If @code{ETIME} is invoked as a function, it can not be invoked as a
2452 subroutine, and vice versa.
2454 @var{TARRAY} and @var{RESULT} are @code{INTENT(OUT)} and provide the following:
2456 @multitable @columnfractions .15 .30 .60
2457 @item @tab @code{TARRAY(1)}: @tab User time in seconds.
2458 @item @tab @code{TARRAY(2)}: @tab System time in seconds.
2459 @item @tab @code{RESULT}: @tab Run time since start in seconds.
2462 @item @emph{Option}:
2468 @item @emph{Syntax}:
2469 @multitable @columnfractions .8
2470 @item @code{CALL ETIME(TARRAY, RESULT)}.
2471 @item @code{RESULT = ETIME(TARRAY)}, (not recommended).
2474 @item @emph{Arguments}:
2475 @multitable @columnfractions .15 .80
2476 @item @var{TARRAY}@tab The type shall be @code{REAL, DIMENSION(2)}.
2477 @item @var{RESULT}@tab The type shall be @code{REAL}.
2480 @item @emph{Return value}:
2481 Elapsed time in seconds since the start of program execution.
2483 @item @emph{Example}:
2487 real, dimension(2) :: tarray
2489 call ETIME(tarray, result)
2493 do i=1,100000000 ! Just a delay
2496 call ETIME(tarray, result)
2500 end program test_etime
2507 @section @code{EXIT} --- Exit the program with status.
2512 @item @emph{Description}:
2513 @code{EXIT} causes immediate termination of the program with status. If status
2514 is omitted it returns the canonical @emph{success} for the system. All Fortran
2515 I/O units are closed.
2517 @item @emph{Option}:
2521 non-elemental subroutine
2523 @item @emph{Syntax}:
2524 @code{CALL EXIT([STATUS])}
2526 @item @emph{Arguments}:
2527 @multitable @columnfractions .15 .80
2528 @item @var{STATUS} @tab The type of the argument shall be @code{INTEGER(*)}.
2531 @item @emph{Return value}:
2532 @code{STATUS} is passed to the parent process on exit.
2534 @item @emph{Example}:
2537 integer :: STATUS = 0
2538 print *, 'This program is going to exit.'
2540 end program test_exit
2547 @section @code{EXP} --- Exponential function
2548 @findex @code{EXP} intrinsic
2549 @findex @code{DEXP} intrinsic
2550 @findex @code{ZEXP} intrinsic
2551 @findex @code{CDEXP} intrinsic
2555 @item @emph{Description}:
2556 @code{EXP(X)} computes the base @math{e} exponential of @var{X}.
2558 @item @emph{Option}:
2564 @item @emph{Syntax}:
2567 @item @emph{Arguments}:
2568 @multitable @columnfractions .15 .80
2569 @item @var{X} @tab The type shall be @code{REAL(*)} or
2573 @item @emph{Return value}:
2574 The return value has same type and kind as @var{X}.
2576 @item @emph{Example}:
2581 end program test_exp
2584 @item @emph{Specific names}:
2585 @multitable @columnfractions .24 .24 .24 .24
2586 @item Name @tab Argument @tab Return type @tab Option
2587 @item @code{DEXP(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
2588 @item @code{CEXP(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
2589 @item @code{ZEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
2590 @item @code{CDEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
2597 @section @code{LOG} --- Logarithm function
2598 @findex @code{LOG} intrinsic
2599 @findex @code{ALOG} intrinsic
2600 @findex @code{DLOG} intrinsic
2601 @findex @code{CLOG} intrinsic
2602 @findex @code{ZLOG} intrinsic
2603 @findex @code{CDLOG} intrinsic
2607 @item @emph{Description}:
2608 @code{LOG(X)} computes the logarithm of @var{X}.
2610 @item @emph{Option}:
2616 @item @emph{Syntax}:
2619 @item @emph{Arguments}:
2620 @multitable @columnfractions .15 .80
2621 @item @var{X} @tab The type shall be @code{REAL(*)} or
2625 @item @emph{Return value}:
2626 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
2627 The kind type parameter is the same as @var{X}.
2629 @item @emph{Example}:
2632 real(8) :: x = 1.0_8
2633 complex :: z = (1.0, 2.0)
2636 end program test_log
2639 @item @emph{Specific names}:
2640 @multitable @columnfractions .24 .24 .24 .24
2641 @item Name @tab Argument @tab Return type @tab Option
2642 @item @code{ALOG(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f95, gnu
2643 @item @code{DLOG(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
2644 @item @code{CLOG(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
2645 @item @code{ZLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
2646 @item @code{CDLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
2653 @section @code{LOG10} --- Base 10 logarithm function
2654 @findex @code{LOG10} intrinsic
2655 @findex @code{ALOG10} intrinsic
2656 @findex @code{DLOG10} intrinsic
2660 @item @emph{Description}:
2661 @code{LOG10(X)} computes the base 10 logarithm of @var{X}.
2663 @item @emph{Option}:
2669 @item @emph{Syntax}:
2672 @item @emph{Arguments}:
2673 @multitable @columnfractions .15 .80
2674 @item @var{X} @tab The type shall be @code{REAL(*)} or
2678 @item @emph{Return value}:
2679 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
2680 The kind type parameter is the same as @var{X}.
2682 @item @emph{Example}:
2685 real(8) :: x = 10.0_8
2687 end program test_log10
2690 @item @emph{Specific names}:
2691 @multitable @columnfractions .24 .24 .24 .24
2692 @item Name @tab Argument @tab Return type @tab Option
2693 @item @code{ALOG10(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f95, gnu
2694 @item @code{DLOG10(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
2701 @section @code{SIN} --- Sine function
2702 @findex @code{SIN} intrinsic
2703 @findex @code{DSIN} intrinsic
2704 @findex @code{ZSIN} intrinsic
2705 @findex @code{CDSIN} intrinsic
2709 @item @emph{Description}:
2710 @code{SIN(X)} computes the sine of @var{X}.
2712 @item @emph{Option}:
2718 @item @emph{Syntax}:
2721 @item @emph{Arguments}:
2722 @multitable @columnfractions .15 .80
2723 @item @var{X} @tab The type shall be @code{REAL(*)} or
2727 @item @emph{Return value}:
2728 The return value has same type and king than @var{X}.
2730 @item @emph{Example}:
2735 end program test_sin
2738 @item @emph{Specific names}:
2739 @multitable @columnfractions .24 .24 .24 .24
2740 @item Name @tab Argument @tab Return type @tab Option
2741 @item @code{DSIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
2742 @item @code{CSIN(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
2743 @item @code{ZSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
2744 @item @code{CDSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
2751 @section @code{SINH} --- Hyperbolic sine function
2752 @findex @code{SINH} intrinsic
2753 @findex @code{DSINH} intrinsic
2754 @cindex hyperbolic sine
2757 @item @emph{Description}:
2758 @code{SINH(X)} computes the hyperbolic sine of @var{X}.
2760 @item @emph{Option}:
2766 @item @emph{Syntax}:
2769 @item @emph{Arguments}:
2770 @multitable @columnfractions .15 .80
2771 @item @var{X} @tab The type shall be @code{REAL(*)}.
2774 @item @emph{Return value}:
2775 The return value is of type @code{REAL(*)}.
2777 @item @emph{Example}:
2780 real(8) :: x = - 1.0_8
2782 end program test_sinh
2785 @item @emph{Specific names}:
2786 @multitable @columnfractions .24 .24 .24 .24
2787 @item Name @tab Argument @tab Return type @tab Option
2788 @item @code{DSINH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
2795 @section @code{SQRT} --- Square-root function
2796 @findex @code{SQRT} intrinsic
2797 @findex @code{DSQRT} intrinsic
2798 @findex @code{CSQRT} intrinsic
2799 @findex @code{ZSQRT} intrinsic
2800 @findex @code{CDSQRT} intrinsic
2804 @item @emph{Description}:
2805 @code{SQRT(X)} computes the square root of @var{X}.
2807 @item @emph{Option}:
2813 @item @emph{Syntax}:
2816 @item @emph{Arguments}:
2817 @multitable @columnfractions .15 .80
2818 @item @var{X} @tab The type shall be @code{REAL(*)} or
2822 @item @emph{Return value}:
2823 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
2824 The kind type parameter is the same as @var{X}.
2826 @item @emph{Example}:
2829 real(8) :: x = 2.0_8
2830 complex :: z = (1.0, 2.0)
2833 end program test_sqrt
2836 @item @emph{Specific names}:
2837 @multitable @columnfractions .24 .24 .24 .24
2838 @item Name @tab Argument @tab Return type @tab Option
2839 @item @code{DSQRT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
2840 @item @code{CSQRT(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
2841 @item @code{ZSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
2842 @item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
2849 @section @code{TAN} --- Tangent function
2850 @findex @code{TAN} intrinsic
2851 @findex @code{DTAN} intrinsic
2855 @item @emph{Description}:
2856 @code{TAN(X)} computes the tangent of @var{X}.
2858 @item @emph{Option}:
2864 @item @emph{Syntax}:
2867 @item @emph{Arguments}:
2868 @multitable @columnfractions .15 .80
2869 @item @var{X} @tab The type shall be @code{REAL(*)}.
2872 @item @emph{Return value}:
2873 The return value is of type @code{REAL(*)}. The kind type parameter is
2874 the same as @var{X}.
2876 @item @emph{Example}:
2879 real(8) :: x = 0.165_8
2881 end program test_tan
2884 @item @emph{Specific names}:
2885 @multitable @columnfractions .24 .24 .24 .24
2886 @item Name @tab Argument @tab Return type @tab Option
2887 @item @code{DTAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
2894 @section @code{TANH} --- Hyperbolic tangent function
2895 @findex @code{TANH} intrinsic
2896 @findex @code{DTANH} intrinsic
2897 @cindex hyperbolic tangent
2900 @item @emph{Description}:
2901 @code{TANH(X)} computes the hyperbolic tangent of @var{X}.
2903 @item @emph{Option}:
2909 @item @emph{Syntax}:
2912 @item @emph{Arguments}:
2913 @multitable @columnfractions .15 .80
2914 @item @var{X} @tab The type shall be @code{REAL(*)}.
2917 @item @emph{Return value}:
2918 The return value is of type @code{REAL(*)} and lies in the range
2919 @math{ - 1 \leq tanh(x) \leq 1 }.
2921 @item @emph{Example}:
2924 real(8) :: x = 2.1_8
2926 end program test_tanh
2929 @item @emph{Specific names}:
2930 @multitable @columnfractions .24 .24 .24 .24
2931 @item Name @tab Argument @tab Return type @tab Option
2932 @item @code{DTANH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
2940 @comment gen exponent
2948 @comment gen fraction
2966 @comment sub get_command
2968 @comment sub get_command_argument
2970 @comment sub get_environment_variable
3010 @comment gen len_trim
3020 @comment gen logical
3031 @comment gen maxexponent
3046 @comment gen minexponent
3060 @comment gen nearest
3071 @comment gen precision
3073 @comment gen present
3075 @comment gen product
3082 @comment sub random_number
3084 @comment sub random_seed
3094 @comment gen reshape
3096 @comment gen rrspacing
3105 @comment gen selected_int_kind
3107 @comment gen selected_real_kind
3109 @comment gen set_exponent
3119 @comment gen spacing
3133 @comment sub system_clock
3137 @comment gen transfer
3139 @comment gen transpose