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, Arccosine 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{ATAN}: ATAN, Arctangent function
50 * @code{BESJ0}: BESJ0, Bessel function of the first kind of order 0
51 * @code{BESJ1}: BESJ1, Bessel function of the first kind of order 1
52 * @code{BESJN}: BESJN, Bessel function of the first kind
53 * @code{BESY0}: BESY0, Bessel function of the second kind of order 0
54 * @code{BESY1}: BESY1, Bessel function of the second kind of order 1
55 * @code{BESYN}: BESYN, Bessel function of the second kind
56 * @code{COS}: COS, Cosine function
57 * @code{COSH}: COSH, Hyperbolic cosine function
58 * @code{ERF}: ERF, Error function
59 * @code{ERFC}: ERFC, Complementary error function
60 * @code{EXP}: EXP, Cosine function
61 * @code{LOG}: LOG, Logarithm function
62 * @code{LOG10}: LOG10, Base 10 logarithm function
63 * @code{SQRT}: SQRT, Square-root function
64 * @code{SIN}: SIN, Sine function
65 * @code{SINH}: SINH, Hyperbolic sine function
66 * @code{TAN}: TAN, Tangent function
67 * @code{TANH}: TANH, Hyperbolic tangent function
71 @section Introduction to intrinsic procedures
73 Gfortran provides a rich set of intrinsic procedures that includes all
74 the intrinsic procedures required by the Fortran 95 standard, a set of
75 intrinsic procedures for backwards compatibility with Gnu Fortran 77
76 (i.e., @command{g77}), and a small selection of intrinsic procedures
77 from the Fortran 2003 standard. Any description here, which conflicts with a
78 description in either the Fortran 95 standard or the Fortran 2003 standard,
79 is unintentional and the standard(s) should be considered authoritative.
81 The enumeration of the @code{KIND} type parameter is processor defined in
82 the Fortran 95 standard. Gfortran defines the default integer type and
83 default real type by @code{INTEGER(KIND=4)} and @code{REAL(KIND=4)},
84 respectively. The standard mandates that both data types shall have
85 another kind, which have more precision. On typical target architectures
86 supports by @command{gfortran}, this kind type parameter is @code{KIND=8}.
87 Hence, @code{REAL(KIND=8)} and @code{DOUBLE PRECISION} are equivalent.
88 In the description of generic intrinsic procedures, the kind type parameter
89 will be specified by @code{KIND=*}, and in the description of specific
90 names for an intrinsic procedure the kind type parameter will be explicitly
91 given (e.g., @code{REAL(KIND=4)} or @code{REAL(KIND=8)}). Finally, for
92 brevity the optional @code{KIND=} syntax will be omitted.
94 Many of the intrinsics procedures take one or more optional arguments.
95 This document follows the convention used in the Fortran 95 standard,
96 and denotes such arguments by square brackets.
98 @command{Gfortran} offers the @option{-std=f95} and @option{-std=gnu} options,
99 which can be used to restrict the set of intrinsic procedures to a
100 given standard. By default, @command{gfortran} sets the @option{-std=gnu}
101 option, and so all intrinsic procedures describe here are accepted. There
102 is one caveat. For a select group of intrinsic procedures, @command{g77}
103 implemented both a function and a subroutine. Both classes
104 have been implemented in @command{gfortran} for backwards compatibility
105 with @command{g77}. It is noted here that these functions and subroutines
106 cannot be intermixed in a given subprogram. In the descriptions that follow,
107 the applicable option(s) is noted.
112 @section @code{ABORT} --- Abort the program
117 @item @emph{Description}:
118 @code{ABORT} causes immediate termination of the program. On operating
119 systems that support a core dump, @code{ABORT} will produce a core dump,
120 which is suitable for debugging purposes.
126 non-elemental subroutine
131 @item @emph{Return value}:
134 @item @emph{Example}:
137 integer :: i = 1, j = 2
138 if (i /= j) call abort
139 end program test_abort
146 @section @code{ABS} --- Absolute value
147 @findex @code{ABS} intrinsic
148 @findex @code{CABS} intrinsic
149 @findex @code{DABS} intrinsic
150 @findex @code{IABS} intrinsic
151 @findex @code{ZABS} intrinsic
152 @findex @code{CDABS} intrinsic
153 @cindex absolute value
156 @item @emph{Description}:
157 @code{ABS(X)} computes the absolute value of @code{X}.
168 @item @emph{Arguments}:
169 @multitable @columnfractions .15 .80
170 @item @var{X} @tab The type of the argument shall be an @code{INTEGER(*)},
171 @code{REAL(*)}, or @code{COMPLEX(*)}.
174 @item @emph{Return value}:
175 The return value is of the same type and
176 kind as the argument except the return value is @code{REAL(*)} for a
177 @code{COMPLEX(*)} argument.
179 @item @emph{Example}:
184 complex :: z = (-1.e0,0.e0)
191 @item @emph{Specific names}:
192 @multitable @columnfractions .24 .24 .24 .24
193 @item Name @tab Argument @tab Return type @tab Option
194 @item @code{CABS(Z)} @tab @code{COMPLEX(4) Z} @tab @code{REAL(4)} @tab f95, gnu
195 @item @code{DABS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
196 @item @code{IABS(I)} @tab @code{INTEGER(4) I} @tab @code{INTEGER(4)} @tab f95, gnu
197 @item @code{ZABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
198 @item @code{CDABS(Z)} @tab @code{COMPLEX(8) Z} @tab @code{COMPLEX(8)} @tab gnu
205 @section @code{ACHAR} --- Character in @acronym{ASCII} collating sequence
206 @findex @code{ACHAR} intrinsic
207 @cindex @acronym{ASCII} collating sequence
210 @item @emph{Description}:
211 @code{ACHAR(I)} returns the character located at position @code{I}
212 in the @acronym{ASCII} collating sequence.
223 @item @emph{Arguments}:
224 @multitable @columnfractions .15 .80
225 @item @var{I} @tab The type shall be an @code{INTEGER(*)}.
228 @item @emph{Return value}:
229 The return value is of type @code{CHARACTER} with a length of one. The
230 kind type parameter is the same as @code{KIND('A')}.
232 @item @emph{Example}:
237 end program test_achar
244 @section @code{ACOS} --- Arccosine function
245 @findex @code{ACOS} intrinsic
246 @findex @code{DACOS} intrinsic
250 @item @emph{Description}:
251 @code{ACOS(X)} computes the arccosine of its @var{X}.
262 @item @emph{Arguments}:
263 @multitable @columnfractions .15 .80
264 @item @var{X} @tab The type shall be an @code{REAL(*)}, and a magnitude that is
268 @item @emph{Return value}:
269 The return value is of type @code{REAL(*)} and it lies in the
270 range @math{ 0 \leq \arccos (x) \leq \pi}. The kind type
271 parameter is the same as @var{X}.
273 @item @emph{Example}:
276 real(8) :: x = 0.866_8
278 end program test_acos
281 @item @emph{Specific names}:
282 @multitable @columnfractions .24 .24 .24 .24
283 @item Name @tab Argument @tab Return type @tab Option
284 @item @code{DACOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
291 @section @code{ADJUSTL} --- Left adjust a string
292 @findex @code{ADJUSTL} intrinsic
293 @cindex adjust string
296 @item @emph{Description}:
297 @code{ADJUSTL(STR)} will left adjust a string by removing leading spaces.
298 Spaces are inserted at the end of the string as needed.
307 @code{STR = ADJUSTL(STR)}
309 @item @emph{Arguments}:
310 @multitable @columnfractions .15 .80
311 @item @var{STR} @tab The type shall be @code{CHARACTER}.
314 @item @emph{Return value}:
315 The return value is of type @code{CHARACTER} where leading spaces
316 are removed and the same number of spaces are inserted on the end
319 @item @emph{Example}:
322 character(len=20) :: str = ' gfortran'
325 end program test_adjustl
331 @section @code{ADJUSTR} --- Right adjust a string
332 @findex @code{ADJUSTR} intrinsic
333 @cindex adjust string
336 @item @emph{Description}:
337 @code{ADJUSTR(STR)} will right adjust a string by removing trailing spaces.
338 Spaces are inserted at the start of the string as needed.
347 @code{STR = ADJUSTR(STR)}
349 @item @emph{Arguments}:
350 @multitable @columnfractions .15 .80
351 @item @var{STR} @tab The type shall be @code{CHARACTER}.
354 @item @emph{Return value}:
355 The return value is of type @code{CHARACTER} where trailing spaces
356 are removed and the same number of spaces are inserted at the start
359 @item @emph{Example}:
362 character(len=20) :: str = 'gfortran'
365 end program test_adjustr
371 @section @code{AIMAG} --- Imaginary part of complex number
372 @findex @code{AIMAG} intrinsic
373 @findex @code{DIMAG} intrinsic
374 @cindex Imaginary part
377 @item @emph{Description}:
378 @code{AIMAG(Z)} yields the imaginary part of complex argument @code{Z}.
389 @item @emph{Arguments}:
390 @multitable @columnfractions .15 .80
391 @item @var{Z} @tab The type of the argument shall be @code{COMPLEX(*)}.
394 @item @emph{Return value}:
395 The return value is of type real with the
396 kind type parameter of the argument.
398 @item @emph{Example}:
403 z4 = cmplx(1.e0_4, 0.e0_4)
404 z8 = cmplx(0.e0_8, 1.e0_8)
405 print *, aimag(z4), dimag(z8)
406 end program test_aimag
409 @item @emph{Specific names}:
410 @multitable @columnfractions .24 .24 .24 .24
411 @item Name @tab Argument @tab Return type @tab Option
412 @item @code{DIMAG(Z)} @tab @code{COMPLEX(8) Z} @tab @code{REAL(8)} @tab f95, gnu
418 @section @code{AINT} --- Imaginary part of complex number
419 @findex @code{AINT} intrinsic
420 @findex @code{DINT} intrinsic
424 @item @emph{Description}:
425 @code{AINT(X [, KIND])} truncates its argument to a whole number.
434 @code{X = AINT(X)} @*
435 @code{X = AINT(X, KIND)}
437 @item @emph{Arguments}:
438 @multitable @columnfractions .15 .80
439 @item @var{X} @tab The type of the argument shall be @code{REAL(*)}.
440 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
441 initialization expression.
444 @item @emph{Return value}:
445 The return value is of type real with the kind type parameter of the
446 argument if the optional @var{KIND} is absence; otherwise, the kind
447 type parameter will be given by @var{KIND}. If the magnitude of
448 @var{X} is less than one, then @code{AINT(X)} returns zero. If the
449 magnitude is equal to or greater than one, then it returns the largest
450 whole number that does not exceed its magnitude. The sign is the same
451 as the sign of @var{X}.
453 @item @emph{Example}:
460 print *, aint(x4), dint(x8)
462 end program test_aint
465 @item @emph{Specific names}:
466 @multitable @columnfractions .24 .24 .24 .24
467 @item Name @tab Argument @tab Return type @tab Option
468 @item @code{DINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
474 @section @code{ALL} --- All values in @var{MASK} along @var{DIM} are true
475 @findex @code{ALL} intrinsic
479 @item @emph{Description}:
480 @code{ALL(MASK [, DIM])} determines if all the values are true in @var{MASK}
481 in the array along dimension @var{DIM}.
487 transformational function
490 @code{L = ALL(MASK)} @*
491 @code{L = ALL(MASK, DIM)}
493 @item @emph{Arguments}:
494 @multitable @columnfractions .15 .80
495 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
496 it shall not be scalar.
497 @item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer
498 with a value that lies between one and the rank of @var{MASK}.
501 @item @emph{Return value}:
502 @code{ALL(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
503 the kind type parameter is the same as the kind type parameter of
504 @var{MASK}. If @var{DIM} is present, then @code{ALL(MASK, DIM)} returns
505 an array with the rank of @var{MASK} minus 1. The shape is determined from
506 the shape of @var{MASK} where the @var{DIM} dimension is elided.
510 @code{ALL(MASK)} is true if all elements of @var{MASK} are true.
511 It also is true if @var{MASK} has zero size; otherwise, it is false.
513 If the rank of @var{MASK} is one, then @code{ALL(MASK,DIM)} is equivalent
514 to @code{ALL(MASK)}. If the rank is greater than one, then @code{ALL(MASK,DIM)}
515 is determined by applying @code{ALL} to the array sections.
518 @item @emph{Example}:
522 l = all((/.true., .true., .true./))
527 integer a(2,3), b(2,3)
531 print *, all(a .eq. b, 1)
532 print *, all(a .eq. b, 2)
533 end subroutine section
540 @section @code{ALLOCATED} --- Status of an allocatable entity
541 @findex @code{ALLOCATED} intrinsic
542 @cindex allocation status
545 @item @emph{Description}:
546 @code{ALLOCATED(X)} checks the status of wether @var{X} is allocated.
555 @code{L = ALLOCATED(X)}
557 @item @emph{Arguments}:
558 @multitable @columnfractions .15 .80
559 @item @var{X} @tab The argument shall be an @code{ALLOCATABLE} array.
562 @item @emph{Return value}:
563 The return value is a scalar @code{LOGICAL} with the default logical
564 kind type parameter. If @var{X} is allocated, @code{ALLOCATED(X)}
565 is @code{.TRUE.}; otherwise, it returns the @code{.TRUE.}
567 @item @emph{Example}:
569 program test_allocated
571 real(4), allocatable :: x(:)
572 if (allocated(x) .eqv. .false.) allocate(x(i)
573 end program test_allocated
579 @section @code{ANINT} --- Imaginary part of complex number
580 @findex @code{ANINT} intrinsic
581 @findex @code{DNINT} intrinsic
585 @item @emph{Description}:
586 @code{ANINT(X [, KIND])} rounds its argument to the nearest whole number.
595 @code{X = ANINT(X)} @*
596 @code{X = ANINT(X, KIND)}
598 @item @emph{Arguments}:
599 @multitable @columnfractions .15 .80
600 @item @var{X} @tab The type of the argument shall be @code{REAL(*)}.
601 @item @var{KIND} @tab (Optional) @var{KIND} shall be a scalar integer
602 initialization expression.
605 @item @emph{Return value}:
606 The return value is of type real with the kind type parameter of the
607 argument if the optional @var{KIND} is absence; otherwise, the kind
608 type parameter will be given by @var{KIND}. If @var{X} is greater than
609 zero, then @code{ANINT(X)} returns @code{AINT(X+0.5)}. If @var{X} is
610 less than or equal to zero, then return @code{AINT(X-0.5)}.
612 @item @emph{Example}:
619 print *, anint(x4), dnint(x8)
621 end program test_anint
624 @item @emph{Specific names}:
625 @multitable @columnfractions .24 .24 .24 .24
626 @item Name @tab Argument @tab Return type @tab Option
627 @item @code{DNINT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
633 @section @code{ANY} --- Any value in @var{MASK} along @var{DIM} is true
634 @findex @code{ANY} intrinsic
638 @item @emph{Description}:
639 @code{ANY(MASK [, DIM])} determines if any of the values is true in @var{MASK}
640 in the array along dimension @var{DIM}.
646 transformational function
649 @code{L = ANY(MASK)} @*
650 @code{L = ANY(MASK, DIM)}
652 @item @emph{Arguments}:
653 @multitable @columnfractions .15 .80
654 @item @var{MASK} @tab The type of the argument shall be @code{LOGICAL(*)} and
655 it shall not be scalar.
656 @item @var{DIM} @tab (Optional) @var{DIM} shall be a scalar integer
657 with a value that lies between one and the rank of @var{MASK}.
660 @item @emph{Return value}:
661 @code{ANY(MASK)} returns a scalar value of type @code{LOGICAL(*)} where
662 the kind type parameter is the same as the kind type parameter of
663 @var{MASK}. If @var{DIM} is present, then @code{ANY(MASK, DIM)} returns
664 an array with the rank of @var{MASK} minus 1. The shape is determined from
665 the shape of @var{MASK} where the @var{DIM} dimension is elided.
669 @code{ANY(MASK)} is true if any element of @var{MASK} is true;
670 otherwise, it is false. It also is false if @var{MASK} has zero size.
672 If the rank of @var{MASK} is one, then @code{ANY(MASK,DIM)} is equivalent
673 to @code{ANY(MASK)}. If the rank is greater than one, then @code{ANY(MASK,DIM)}
674 is determined by applying @code{ANY} to the array sections.
677 @item @emph{Example}:
681 l = any((/.true., .true., .true./))
686 integer a(2,3), b(2,3)
690 print *, any(a .eq. b, 1)
691 print *, any(a .eq. b, 2)
692 end subroutine section
699 @section @code{ASIN} --- Arcsine function
700 @findex @code{ASIN} intrinsic
701 @findex @code{DASIN} intrinsic
705 @item @emph{Description}:
706 @code{ASIN(X)} computes the arcsine of its @var{X}.
717 @item @emph{Arguments}:
718 @multitable @columnfractions .15 .80
719 @item @var{X} @tab The type shall be an @code{REAL(*)}, and a magnitude that is
723 @item @emph{Return value}:
724 The return value is of type @code{REAL(*)} and it lies in the
725 range @math{ \pi / 2 \leq \arccos (x) \leq \pi / 2}. The kind type
726 parameter is the same as @var{X}.
728 @item @emph{Example}:
731 real(8) :: x = 0.866_8
733 end program test_asin
736 @item @emph{Specific names}:
737 @multitable @columnfractions .24 .24 .24 .24
738 @item Name @tab Argument @tab Return type @tab Option
739 @item @code{DASIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
745 @section @code{ATAN} --- Arctangent function
746 @findex @code{ATAN} intrinsic
747 @findex @code{DATAN} intrinsic
751 @item @emph{Description}:
752 @code{ATAN(X)} computes the arctangent of @var{X}.
763 @item @emph{Arguments}:
764 @multitable @columnfractions .15 .80
765 @item @var{X} @tab The type shall be an @code{REAL(*)}.
768 @item @emph{Return value}:
769 The return value is of type @code{REAL(*)} and it lies in the
770 range @math{ - \pi / 2 \leq \arcsin (x) \leq \pi / 2}.
772 @item @emph{Example}:
775 real(8) :: x = 2.866_8
777 end program test_atan
780 @item @emph{Specific names}:
781 @multitable @columnfractions .24 .24 .24 .24
782 @item Name @tab Argument @tab Return type @tab Option
783 @item @code{DATAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
790 @section @code{BESJ0} --- Bessel function of the first kind of order 0
791 @findex @code{BESJ0} intrinsic
792 @findex @code{DBESJ0} intrinsic
796 @item @emph{Description}:
797 @code{BESJ0(X)} computes the Bessel function of the first kind of order 0
809 @item @emph{Arguments}:
810 @multitable @columnfractions .15 .80
811 @item @var{X} @tab The type shall be an @code{REAL(*)}.
814 @item @emph{Return value}:
815 The return value is of type @code{REAL(*)} and it lies in the
816 range @math{ - 0.4027... \leq Bessel (0,x) \leq 1}.
818 @item @emph{Example}:
823 end program test_besj0
826 @item @emph{Specific names}:
827 @multitable @columnfractions .24 .24 .24 .24
828 @item Name @tab Argument @tab Return type @tab Option
829 @item @code{DBESJ0(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
836 @section @code{BESJ1} --- Bessel function of the first kind of order 1
837 @findex @code{BESJ1} intrinsic
838 @findex @code{DBESJ1} intrinsic
842 @item @emph{Description}:
843 @code{BESJ1(X)} computes the Bessel function of the first kind of order 1
855 @item @emph{Arguments}:
856 @multitable @columnfractions .15 .80
857 @item @var{X} @tab The type shall be an @code{REAL(*)}.
860 @item @emph{Return value}:
861 The return value is of type @code{REAL(*)} and it lies in the
862 range @math{ - 0.5818... \leq Bessel (0,x) \leq 0.5818 }.
864 @item @emph{Example}:
869 end program test_besj1
872 @item @emph{Specific names}:
873 @multitable @columnfractions .24 .24 .24 .24
874 @item Name @tab Argument @tab Return type @tab Option
875 @item @code{DBESJ1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
882 @section @code{BESJN} --- Bessel function of the first kind
883 @findex @code{BESJN} intrinsic
884 @findex @code{DBESJN} intrinsic
888 @item @emph{Description}:
889 @code{BESJN(N, X)} computes the Bessel function of the first kind of order
899 @code{Y = BESJN(N, X)}
901 @item @emph{Arguments}:
902 @multitable @columnfractions .15 .80
903 @item @var{N} @tab The type shall be an @code{INTEGER(*)}.
904 @item @var{X} @tab The type shall be an @code{REAL(*)}.
907 @item @emph{Return value}:
908 The return value is of type @code{REAL(*)}.
910 @item @emph{Example}:
915 end program test_besjn
918 @item @emph{Specific names}:
919 @multitable @columnfractions .24 .24 .24 .24
920 @item Name @tab Argument @tab Return type @tab Option
921 @item @code{DBESJN(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
928 @section @code{BESY0} --- Bessel function of the second kind of order 0
929 @findex @code{BESY0} intrinsic
930 @findex @code{DBESY0} intrinsic
934 @item @emph{Description}:
935 @code{BESY0(X)} computes the Bessel function of the second kind of order 0
947 @item @emph{Arguments}:
948 @multitable @columnfractions .15 .80
949 @item @var{X} @tab The type shall be an @code{REAL(*)}.
952 @item @emph{Return value}:
953 The return value is of type @code{REAL(*)}.
955 @item @emph{Example}:
960 end program test_besy0
963 @item @emph{Specific names}:
964 @multitable @columnfractions .24 .24 .24 .24
965 @item Name @tab Argument @tab Return type @tab Option
966 @item @code{DBESY0(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
973 @section @code{BESY1} --- Bessel function of the second kind of order 1
974 @findex @code{BESY1} intrinsic
975 @findex @code{DBESY1} intrinsic
979 @item @emph{Description}:
980 @code{BESY1(X)} computes the Bessel function of the second kind of order 1
992 @item @emph{Arguments}:
993 @multitable @columnfractions .15 .80
994 @item @var{X} @tab The type shall be an @code{REAL(*)}.
997 @item @emph{Return value}:
998 The return value is of type @code{REAL(*)}.
1000 @item @emph{Example}:
1003 real(8) :: x = 1.0_8
1005 end program test_besy1
1008 @item @emph{Specific names}:
1009 @multitable @columnfractions .24 .24 .24 .24
1010 @item Name @tab Argument @tab Return type @tab Option
1011 @item @code{DBESY1(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
1018 @section @code{BESYN} --- Bessel function of the second kind
1019 @findex @code{BESYN} intrinsic
1020 @findex @code{DBESYN} intrinsic
1024 @item @emph{Description}:
1025 @code{BESYN(N, X)} computes the Bessel function of the second kind of order
1028 @item @emph{Option}:
1034 @item @emph{Syntax}:
1035 @code{Y = BESYN(N, X)}
1037 @item @emph{Arguments}:
1038 @multitable @columnfractions .15 .80
1039 @item @var{N} @tab The type shall be an @code{INTEGER(*)}.
1040 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1043 @item @emph{Return value}:
1044 The return value is of type @code{REAL(*)}.
1046 @item @emph{Example}:
1049 real(8) :: x = 1.0_8
1051 end program test_besyn
1054 @item @emph{Specific names}:
1055 @multitable @columnfractions .24 .24 .24 .24
1056 @item Name @tab Argument @tab Return type @tab Option
1057 @item @code{DBESYN(X)}@tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
1063 @section @code{COS} --- Cosine function
1064 @findex @code{COS} intrinsic
1065 @findex @code{DCOS} intrinsic
1066 @findex @code{ZCOS} intrinsic
1067 @findex @code{CDCOS} intrinsic
1071 @item @emph{Description}:
1072 @code{COS(X)} computes the cosine of @var{X}.
1074 @item @emph{Option}:
1080 @item @emph{Syntax}:
1083 @item @emph{Arguments}:
1084 @multitable @columnfractions .15 .80
1085 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1089 @item @emph{Return value}:
1090 The return value has same type and kind than @var{X}.
1092 @item @emph{Example}:
1097 end program test_cos
1100 @item @emph{Specific names}:
1101 @multitable @columnfractions .24 .24 .24 .24
1102 @item Name @tab Argument @tab Return type @tab Option
1103 @item @code{DCOS(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1104 @item @code{CCOS(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
1105 @item @code{ZCOS(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1106 @item @code{CDCOS(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1112 @section @code{COSH} --- Hyperbolic cosine function
1113 @findex @code{COSH} intrinsic
1114 @findex @code{DCOSH} intrinsic
1115 @cindex hyperbolic cosine
1118 @item @emph{Description}:
1119 @code{COSH(X)} computes the hyperbolic cosine of @var{X}.
1121 @item @emph{Option}:
1127 @item @emph{Syntax}:
1130 @item @emph{Arguments}:
1131 @multitable @columnfractions .15 .80
1132 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1135 @item @emph{Return value}:
1136 The return value is of type @code{REAL(*)} and it is positive
1137 (@math{ \cosh (x) \geq 0 }.
1139 @item @emph{Example}:
1142 real(8) :: x = 1.0_8
1144 end program test_cosh
1147 @item @emph{Specific names}:
1148 @multitable @columnfractions .24 .24 .24 .24
1149 @item Name @tab Argument @tab Return type @tab Option
1150 @item @code{DCOSH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1156 @section @code{ERF} --- Error function
1157 @findex @code{ERF} intrinsic
1161 @item @emph{Description}:
1162 @code{ERF(X)} computes the error function of @var{X}.
1164 @item @emph{Option}:
1170 @item @emph{Syntax}:
1173 @item @emph{Arguments}:
1174 @multitable @columnfractions .15 .80
1175 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1178 @item @emph{Return value}:
1179 The return value is of type @code{REAL(*)} and it is positive
1180 (@math{ - 1 \leq erf (x) \leq 1 }.
1182 @item @emph{Example}:
1185 real(8) :: x = 0.17_8
1187 end program test_erf
1190 @item @emph{Specific names}:
1191 @multitable @columnfractions .24 .24 .24 .24
1192 @item Name @tab Argument @tab Return type @tab Option
1193 @item @code{DERF(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
1200 @section @code{ERFC} --- Error function
1201 @findex @code{ERFC} intrinsic
1205 @item @emph{Description}:
1206 @code{ERFC(X)} computes the complementary error function of @var{X}.
1208 @item @emph{Option}:
1214 @item @emph{Syntax}:
1217 @item @emph{Arguments}:
1218 @multitable @columnfractions .15 .80
1219 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1222 @item @emph{Return value}:
1223 The return value is of type @code{REAL(*)} and it is positive
1224 (@math{ 0 \leq erfc (x) \leq 2 }.
1226 @item @emph{Example}:
1229 real(8) :: x = 0.17_8
1231 end program test_erfc
1234 @item @emph{Specific names}:
1235 @multitable @columnfractions .24 .24 .24 .24
1236 @item Name @tab Argument @tab Return type @tab Option
1237 @item @code{DERFC(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab gnu
1244 @section @code{EXP} --- Exponential function
1245 @findex @code{EXP} intrinsic
1246 @findex @code{DEXP} intrinsic
1247 @findex @code{ZEXP} intrinsic
1248 @findex @code{CDEXP} intrinsic
1252 @item @emph{Description}:
1253 @code{EXP(X)} computes the base @math{e} exponential of @var{X}.
1255 @item @emph{Option}:
1261 @item @emph{Syntax}:
1264 @item @emph{Arguments}:
1265 @multitable @columnfractions .15 .80
1266 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1270 @item @emph{Return value}:
1271 The return value has same type and kind than @var{X}.
1273 @item @emph{Example}:
1278 end program test_exp
1281 @item @emph{Specific names}:
1282 @multitable @columnfractions .24 .24 .24 .24
1283 @item Name @tab Argument @tab Return type @tab Option
1284 @item @code{DEXP(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1285 @item @code{CEXP(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
1286 @item @code{ZEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1287 @item @code{CDEXP(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1293 @section @code{LOG} --- Logarithm function
1294 @findex @code{LOG} intrinsic
1295 @findex @code{ALOG} intrinsic
1296 @findex @code{DLOG} intrinsic
1297 @findex @code{CLOG} intrinsic
1298 @findex @code{ZLOG} intrinsic
1299 @findex @code{CDLOG} intrinsic
1303 @item @emph{Description}:
1304 @code{LOG(X)} computes the logarithm of @var{X}.
1306 @item @emph{Option}:
1312 @item @emph{Syntax}:
1315 @item @emph{Arguments}:
1316 @multitable @columnfractions .15 .80
1317 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1321 @item @emph{Return value}:
1322 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
1323 The kind type parameter is the same as @var{X}.
1325 @item @emph{Example}:
1328 real(8) :: x = 1.0_8
1329 complex :: z = (1.0, 2.0)
1332 end program test_log
1335 @item @emph{Specific names}:
1336 @multitable @columnfractions .24 .24 .24 .24
1337 @item Name @tab Argument @tab Return type @tab Option
1338 @item @code{ALOG(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f95, gnu
1339 @item @code{DLOG(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1340 @item @code{CLOG(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
1341 @item @code{ZLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1342 @item @code{CDLOG(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1349 @section @code{LOG10} --- Base 10 logarithm function
1350 @findex @code{LOG10} intrinsic
1351 @findex @code{ALOG10} intrinsic
1352 @findex @code{DLOG10} intrinsic
1356 @item @emph{Description}:
1357 @code{LOG10(X)} computes the base 10 logarithm of @var{X}.
1359 @item @emph{Option}:
1365 @item @emph{Syntax}:
1368 @item @emph{Arguments}:
1369 @multitable @columnfractions .15 .80
1370 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1374 @item @emph{Return value}:
1375 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
1376 The kind type parameter is the same as @var{X}.
1378 @item @emph{Example}:
1381 real(8) :: x = 10.0_8
1383 end program test_log10
1386 @item @emph{Specific names}:
1387 @multitable @columnfractions .24 .24 .24 .24
1388 @item Name @tab Argument @tab Return type @tab Option
1389 @item @code{ALOG10(X)} @tab @code{REAL(4) X} @tab @code{REAL(4)} @tab f95, gnu
1390 @item @code{DLOG10(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1397 @section @code{SIN} --- Sine function
1398 @findex @code{SIN} intrinsic
1399 @findex @code{DSIN} intrinsic
1400 @findex @code{ZSIN} intrinsic
1401 @findex @code{CDSIN} intrinsic
1405 @item @emph{Description}:
1406 @code{SIN(X)} computes the sine of @var{X}.
1408 @item @emph{Option}:
1414 @item @emph{Syntax}:
1417 @item @emph{Arguments}:
1418 @multitable @columnfractions .15 .80
1419 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1423 @item @emph{Return value}:
1424 The return value has same type and king than @var{X}.
1426 @item @emph{Example}:
1431 end program test_sin
1434 @item @emph{Specific names}:
1435 @multitable @columnfractions .24 .24 .24 .24
1436 @item Name @tab Argument @tab Return type @tab Option
1437 @item @code{DSIN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1438 @item @code{CSIN(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
1439 @item @code{ZSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1440 @item @code{CDSIN(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1448 @section @code{SINH} --- Hyperbolic sine function
1449 @findex @code{SINH} intrinsic
1450 @findex @code{DSINH} intrinsic
1451 @cindex hyperbolic sine
1454 @item @emph{Description}:
1455 @code{SINH(X)} computes the hyperbolic sine of @var{X}.
1457 @item @emph{Option}:
1463 @item @emph{Syntax}:
1466 @item @emph{Arguments}:
1467 @multitable @columnfractions .15 .80
1468 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1471 @item @emph{Return value}:
1472 The return value is of type @code{REAL(*)}.
1474 @item @emph{Example}:
1477 real(8) :: x = - 1.0_8
1479 end program test_sinh
1482 @item @emph{Specific names}:
1483 @multitable @columnfractions .24 .24 .24 .24
1484 @item Name @tab Argument @tab Return type @tab Option
1485 @item @code{DSINH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1492 @section @code{SQRT} --- Square-root function
1493 @findex @code{SQRT} intrinsic
1494 @findex @code{DSQRT} intrinsic
1495 @findex @code{CSQRT} intrinsic
1496 @findex @code{ZSQRT} intrinsic
1497 @findex @code{CDSQRT} intrinsic
1501 @item @emph{Description}:
1502 @code{SQRT(X)} computes the square root of @var{X}.
1504 @item @emph{Option}:
1510 @item @emph{Syntax}:
1513 @item @emph{Arguments}:
1514 @multitable @columnfractions .15 .80
1515 @item @var{X} @tab The type shall be an @code{REAL(*)} or
1519 @item @emph{Return value}:
1520 The return value is of type @code{REAL(*)} or @code{COMPLEX(*)}.
1521 The kind type parameter is the same as @var{X}.
1523 @item @emph{Example}:
1526 real(8) :: x = 2.0_8
1527 complex :: z = (1.0, 2.0)
1530 end program test_sqrt
1533 @item @emph{Specific names}:
1534 @multitable @columnfractions .24 .24 .24 .24
1535 @item Name @tab Argument @tab Return type @tab Option
1536 @item @code{DSQRT(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1537 @item @code{CSQRT(X)} @tab @code{COMPLEX(4) X} @tab @code{COMPLEX(4)} @tab f95, gnu
1538 @item @code{ZSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1539 @item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X} @tab @code{COMPLEX(8)} @tab f95, gnu
1546 @section @code{TAN} --- Tangent function
1547 @findex @code{TAN} intrinsic
1548 @findex @code{DTAN} intrinsic
1552 @item @emph{Description}:
1553 @code{TAN(X)} computes the tangent of @var{X}.
1555 @item @emph{Option}:
1561 @item @emph{Syntax}:
1564 @item @emph{Arguments}:
1565 @multitable @columnfractions .15 .80
1566 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1569 @item @emph{Return value}:
1570 The return value is of type @code{REAL(*)}. The kind type parameter is
1571 the same as @var{X}.
1573 @item @emph{Example}:
1576 real(8) :: x = 0.165_8
1578 end program test_tan
1581 @item @emph{Specific names}:
1582 @multitable @columnfractions .24 .24 .24 .24
1583 @item Name @tab Argument @tab Return type @tab Option
1584 @item @code{DTAN(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1590 @section @code{TANH} --- Hyperbolic tangent function
1591 @findex @code{TANH} intrinsic
1592 @findex @code{DTANH} intrinsic
1593 @cindex hyperbolic tangent
1596 @item @emph{Description}:
1597 @code{TANH(X)} computes the hyperbolic tangent of @var{X}.
1599 @item @emph{Option}:
1605 @item @emph{Syntax}:
1608 @item @emph{Arguments}:
1609 @multitable @columnfractions .15 .80
1610 @item @var{X} @tab The type shall be an @code{REAL(*)}.
1613 @item @emph{Return value}:
1614 The return value is of type @code{REAL(*)} and lies in the range
1615 @math{ - 1 \leq tanh(x) \leq 1 }.
1617 @item @emph{Example}:
1620 real(8) :: x = 2.1_8
1622 end program test_tanh
1625 @item @emph{Specific names}:
1626 @multitable @columnfractions .24 .24 .24 .24
1627 @item Name @tab Argument @tab Return type @tab Option
1628 @item @code{DTANH(X)} @tab @code{REAL(8) X} @tab @code{REAL(8)} @tab f95, gnu
1634 @comment gen associated
1639 @comment gen bit_size
1643 @comment gen ceiling
1649 @comment gen command_argument_count
1656 @comment sub cpu_time
1660 @comment sub date_and_time
1673 @comment gen dot_product
1681 @comment gen eoshift
1683 @comment gen epsilon
1690 @comment gen exponent
1698 @comment gen fraction
1716 @comment sub get_command
1718 @comment sub get_command_argument
1720 @comment sub get_environment_variable
1760 @comment gen len_trim
1770 @comment gen logical
1781 @comment gen maxexponent
1796 @comment gen minexponent
1810 @comment gen nearest
1821 @comment gen precision
1823 @comment gen present
1825 @comment gen product
1832 @comment sub random_number
1834 @comment sub random_seed
1844 @comment gen reshape
1846 @comment gen rrspacing
1855 @comment gen selected_int_kind
1857 @comment gen selected_real_kind
1859 @comment gen set_exponent
1869 @comment gen spacing
1883 @comment sub system_clock
1887 @comment gen transfer
1889 @comment gen transpose