Mercurial > hg > CbC > CbC_gcc
diff gcc/fortran/intrinsic.texi @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
line wrap: on
line diff
--- a/gcc/fortran/intrinsic.texi Fri Oct 27 22:46:09 2017 +0900 +++ b/gcc/fortran/intrinsic.texi Thu Oct 25 07:37:49 2018 +0900 @@ -1,5 +1,5 @@ @ignore -Copyright (C) 2005-2017 Free Software Foundation, Inc. +Copyright (C) 2005-2018 Free Software Foundation, Inc. This is part of the GNU Fortran manual. For copying conditions, see the file gfortran.texi. @@ -262,6 +262,7 @@ * @code{RADIX}: RADIX, Base of a data model * @code{RAN}: RAN, Real pseudo-random number * @code{RAND}: RAND, Real pseudo-random number +* @code{RANDOM_INIT}: RANDOM_INIT, Initialize pseudo-random number generator * @code{RANDOM_NUMBER}: RANDOM_NUMBER, Pseudo-random number * @code{RANDOM_SEED}: RANDOM_SEED, Initialize a pseudo-random number sequence * @code{RANGE}: RANGE, Decimal exponent range @@ -8715,30 +8716,31 @@ @table @asis @item @emph{Description}: @item @emph{Standard}: -Sends the signal specified by @var{SIGNAL} to the process @var{PID}. +Sends the signal specified by @var{SIG} to the process @var{PID}. See @code{kill(2)}. -This intrinsic is provided in both subroutine and function forms; however, -only one form can be used in any given program unit. +This intrinsic is provided in both subroutine and function forms; +however, only one form can be used in any given program unit. @item @emph{Class}: Subroutine, function @item @emph{Syntax}: @multitable @columnfractions .80 -@item @code{CALL KILL(C, VALUE [, STATUS])} -@item @code{STATUS = KILL(C, VALUE)} -@end multitable - -@item @emph{Arguments}: -@multitable @columnfractions .15 .70 -@item @var{C} @tab Shall be a scalar @code{INTEGER}, with -@code{INTENT(IN)} -@item @var{VALUE} @tab Shall be a scalar @code{INTEGER}, with -@code{INTENT(IN)} -@item @var{STATUS} @tab (Optional) status flag of type @code{INTEGER(4)} or -@code{INTEGER(8)}. Returns 0 on success, or a system-specific error code -otherwise. +@item @code{CALL KILL(PID, SIG [, STATUS])} +@item @code{STATUS = KILL(PID, SIG)} +@end multitable + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{PID} @tab Shall be a scalar @code{INTEGER} with @code{INTENT(IN)}. +@item @var{SIG} @tab Shall be a scalar @code{INTEGER} with @code{INTENT(IN)}. +@item @var{STATUS} @tab [Subroutine](Optional) +Shall be a scalar @code{INTEGER}. +Returns 0 on success; otherwise a system-specific error code is returned. +@item @var{STATUS} @tab [Function] The kind type parameter is that of +@code{pid}. +Returns 0 on success; otherwise a system-specific error code is returned. @end multitable @item @emph{See also}: @@ -8746,7 +8748,6 @@ @end table - @node KIND @section @code{KIND} --- Kind of an entity @fnindex KIND @@ -9870,6 +9871,7 @@ type; otherwise, an array of @code{LOGICAL} type. The rank shall be one or two, and the first (or only) dimension of @var{MATRIX_B} shall be equal to the last (or only) dimension of @var{MATRIX_A}. +@var{MATRIX_A} and @var{MATRIX_B} shall not both be rank one arrays. @end multitable @item @emph{Return value}: @@ -9990,22 +9992,26 @@ @var{DIM} direction. If @var{MASK} is present, only the elements for which @var{MASK} is @code{.TRUE.} are considered. If more than one element in the array has the maximum value, the location returned is -that of the first such element in array element order. If the array has -zero size, or all of the elements of @var{MASK} are @code{.FALSE.}, then +that of the first such element in array element order if the +@var{BACK} is not present, or if it false; otherwise, the location +returned is that of the first such element. If the array has zero +size, or all of the elements of @var{MASK} are @code{.FALSE.}, then the result is an array of zeroes. Similarly, if @var{DIM} is supplied and all of the elements of @var{MASK} along a given row are zero, the result value for that row is zero. @item @emph{Standard}: -Fortran 95 and later +Fortran 95 and later; @var{ARRAY} of @code{CHARACTER} and the +@var{KIND} argument are available in Fortran 2003 and later. +The @var{BACK} argument is available in Fortran 2008 and later. @item @emph{Class}: Transformational function @item @emph{Syntax}: @multitable @columnfractions .80 -@item @code{RESULT = MAXLOC(ARRAY, DIM [, MASK])} -@item @code{RESULT = MAXLOC(ARRAY [, MASK])} +@item @code{RESULT = MAXLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])} +@item @code{RESULT = MAXLOC(ARRAY [, MASK] [,KIND] [,BACK])} @end multitable @item @emph{Arguments}: @@ -10017,6 +10023,9 @@ inclusive. It may not be an optional dummy argument. @item @var{MASK} @tab Shall be an array of type @code{LOGICAL}, and conformable with @var{ARRAY}. +@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization +expression indicating the kind parameter of the result. +@item @var{BACK} @tab (Optional) A scalar of type @code{LOGICAL}. @end multitable @item @emph{Return value}: @@ -10025,8 +10034,9 @@ is an array with a rank one less than the rank of @var{ARRAY}, and a size corresponding to the size of @var{ARRAY} with the @var{DIM} dimension removed. If @var{DIM} is present and @var{ARRAY} has a rank -of one, the result is a scalar. In all cases, the result is of default -@code{INTEGER} type. +of one, the result is a scalar. If the optional argument @var{KIND} +is present, the result is an integer of kind @var{KIND}, otherwise it +is of default kind. @item @emph{See also}: @ref{MAX}, @ref{MAXVAL} @@ -10338,33 +10348,40 @@ @var{DIM} direction. If @var{MASK} is present, only the elements for which @var{MASK} is @code{.TRUE.} are considered. If more than one element in the array has the minimum value, the location returned is -that of the first such element in array element order. If the array has +that of the first such element in array element order if the +@var{BACK} is not present, or if it false; otherwise, the location +returned is that of the first such element. If the array has zero size, or all of the elements of @var{MASK} are @code{.FALSE.}, then the result is an array of zeroes. Similarly, if @var{DIM} is supplied and all of the elements of @var{MASK} along a given row are zero, the result value for that row is zero. @item @emph{Standard}: -Fortran 95 and later +Fortran 95 and later; @var{ARRAY} of @code{CHARACTER} and the +@var{KIND} argument are available in Fortran 2003 and later. +The @var{BACK} argument is available in Fortran 2008 and later. @item @emph{Class}: Transformational function @item @emph{Syntax}: @multitable @columnfractions .80 -@item @code{RESULT = MINLOC(ARRAY, DIM [, MASK])} -@item @code{RESULT = MINLOC(ARRAY [, MASK])} -@end multitable - -@item @emph{Arguments}: -@multitable @columnfractions .15 .70 -@item @var{ARRAY} @tab Shall be an array of type @code{INTEGER} or -@code{REAL}. +@item @code{RESULT = MINLOC(ARRAY, DIM [, MASK] [,KIND] [,BACK])} +@item @code{RESULT = MINLOC(ARRAY [, MASK], [,KIND] [,BACK])} +@end multitable + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{ARRAY} @tab Shall be an array of type @code{INTEGER}, +@code{REAL} or @code{CHARACTER}. @item @var{DIM} @tab (Optional) Shall be a scalar of type @code{INTEGER}, with a value between one and the rank of @var{ARRAY}, inclusive. It may not be an optional dummy argument. @item @var{MASK} @tab Shall be an array of type @code{LOGICAL}, and conformable with @var{ARRAY}. +@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization +expression indicating the kind parameter of the result. +@item @var{BACK} @tab (Optional) A scalar of type @code{LOGICAL}. @end multitable @item @emph{Return value}: @@ -10373,8 +10390,9 @@ is an array with a rank one less than the rank of @var{ARRAY}, and a size corresponding to the size of @var{ARRAY} with the @var{DIM} dimension removed. If @var{DIM} is present and @var{ARRAY} has a rank -of one, the result is a scalar. In all cases, the result is of default -@code{INTEGER} type. +of one, the result is a scalar. If the optional argument @var{KIND} +is present, the result is an integer of kind @var{KIND}, otherwise it +is of default kind. @item @emph{See also}: @ref{MIN}, @ref{MINVAL} @@ -11581,6 +11599,60 @@ @end table +@node RANDOM_INIT +@section @code{RANDOM_INIT} --- Initialize a pseudo-random number generator +@fnindex RANDOM_INIT +@cindex random number generation, initialization + +@table @asis +@item @emph{Description}: +Initializes the state of the pseudorandom number generator used by +@code{RANDOM_NUMBER}. + +@item @emph{Standard}: +Fortran 2018 + +@item @emph{Class}: +Subroutine + +@item @emph{Syntax}: +@code{CALL RANDOM_INIT(REPEATABLE, IMAGE_DISTINCT)} + +@item @emph{Arguments}: +@multitable @columnfractions .20 .75 +@item @var{REPEATABLE} @tab Shall be a scalar with a @code{LOGICAL} type, +and it is @code{INTENT(IN)}. If it is @code{.true.}, the seed is set to +a processor-dependent value that is the same each time @code{RANDOM_INIT} +is called from the same image. The term ``same image'' means a single +instance of program execution. The sequence of random numbers is different +for repeated execution of the program. If it is @code{.false.}, the seed +is set to a processor-dependent value. +@item @var{IMAGE_DISTINCT} @tab Shall be a scalar with a +@code{LOGICAL} type, and it is @code{INTENT(IN)}. If it is @code{.true.}, +the seed is set to a processor-dependent value that is distinct from th +seed set by a call to @code{RANDOM_INIT} in another image. If it is +@code{.false.}, the seed is set value that does depend which image called +@code{RANDOM_INIT}. +@end multitable + +@item @emph{Example}: +@smallexample +program test_random_seed + implicit none + real x(3), y(3) + call random_init(.true., .true.) + call random_number(x) + call random_init(.true., .true.) + call random_number(y) + ! x and y are the same sequence + if (any(x /= y)) call abort +end program test_random_seed +@end smallexample + +@item @emph{See also}: +@ref{RANDOM_NUMBER}, @ref{RANDOM_SEED} +@end table + @node RANDOM_NUMBER @section @code{RANDOM_NUMBER} --- Pseudo-random number @@ -11626,7 +11698,7 @@ @end smallexample @item @emph{See also}: -@ref{RANDOM_SEED} +@ref{RANDOM_SEED}, @ref{RANDOM_INIT} @end table @@ -11696,7 +11768,7 @@ @end smallexample @item @emph{See also}: -@ref{RANDOM_NUMBER} +@ref{RANDOM_NUMBER}, @ref{RANDOM_INIT} @end table