[PATCH] gcc/fortran/intrinsic.texi

Brooks Moses bmoses@stanford.edu
Sun Aug 20 19:32:00 GMT 2006


Daniel Franke wrote:
> Please find attached an updated version of the patch. Where appropiate, I 
> replaced DOCTODO by the phrase Jerry suggested above and added the indicated 
> disclaimer to the introduction. Intrinsics not yet implemented are depicted 
> by the phrase "Not yet implemenent in gfortran." (see meta-bug #19292).

Okay, here's a first-pass proofread.

There were a couple of common errors that I noticed which can be 
corrected by global search-and-replace; I haven't noted them below.

   "implemenent" should be "implemented"
   "Standardal" should be "Optional"

The latter corrects for a previous global search-and-replace that wasn't 
manually checked at each replacement.  Be careful!

I'm not sure of the most useful way to present my comments; I hope the 
following is sufficient and not too confusing.

- Brooks


-----------------

! Index: intrinsic.texi
 > ===================================================================
 > --- intrinsic.texi	(revision 115501)
 > +++ intrinsic.texi	(working copy)
 > @@ -31,12 +31,17 @@
 >  This portion of the document is incomplete and undergoing massive 
expansion
 >  and editing.  All contributions and corrections are strongly 
encouraged.
 >
 > +Implemented intrinsics are fully functional and available to the 
user to apply.
 > +Some intrinsics have documentation yet to be completed as indicated 
by 'documentation pending'.
 > +
 >  @menu
 >  * Introduction:         Introduction
 >  * @code{ABORT}:         ABORT,     Abort the program
 >  * @code{ABS}:           ABS,       Absolute value
 > +* @code{ACCESS}:        ACCESS,    Checks file accessibility

s/accessibility/access method/

 >  * @code{ACHAR}:         ACHAR,     Character in @acronym{ASCII} 
collating sequence
 >  * @code{ACOS}:          ACOS,      Arc cosine function

s/Arc cosine/Arccosine/

 > +* @code{ACOSH}:         ACOSH,     Area hyperbolic cosine function

s/Area/Inverse/   (Or, at least, "Hyperbolic arccosine".)

 >  * @code{ASIN}:          ASIN,      Arcsine function
 > +* @code{ASINH}:         ASINH,     Area hyperbolic sine function

s/Area/Inverse/

 >  * @code{ATAN}:          ATAN,      Arctangent function
 >  * @code{ATAN2}:         ATAN2,     Arctangent function
 > +* @code{ATANH}:         ATANH,     Area hyperbolic tangent function

s/Area/Inverse/

 >  * @code{GETUID}:        GETUID,    User ID function
 > +* @code{GMTIME}:        GMTIME,    Convert time to GMT info

(Not sure: Shouldn't this be GMTTIME with two "T"s?)
Does this actually convert a time, or does it return the system time in GMT?

 >  * @code{IDATE}:         IDATE,     Current local time (day/month/year)
 > +* @code{IEOR}:          IEOR,      Bitwise  logical exclusive or

Remove extra space after "bitwise"

 > +* @code{IERRNO}:        IERRNO,    Function to get the last system 
error number

s/Function to get/Get/

 > +* @code{INDEX}:         INDEX,     First Position of a substring 
within a string

s/First Position/Position/
(Note that, with the BACK argument, this can also give the last position!)

  >  * @code{PRECISION}:     PRECISION, Decimal precision of a real kind
 > +* @code{PRESENT}:       PRESENT,   Function to determine whether an 
optional argument was specified

s/Function to determine/Determine/
s/was/is/

 >  * @code{RADIX}:         RADIX,     Base of a data model
 > +* @code{RANDOM_NUMBER}: RANDOM_NUMBER, Subroutine to generate a 
pseudorandom number

s/Subroutine to generate a pseudorandom/Pseudo-random/

 > +* @code{RANDOM_SEED}:   RANDOM_SEED, Subroutine to initialize a 
pseudorandom number sequence

s/Subroutine to initialize a pseudorandom/Initialize a pseudo-random/

 >  * @code{SET_EXPONENT}:  SET_EXPONENT, Set the exponent of the model
 > +* @code{SHAPE}:         SHAPE,     Function to determine the shape 
of an array

s/Function to determine/Determine/

 >  * @code{SINH}:          SINH,      Hyperbolic sine function
 > +* @code{SIZE}:          SIZE,      Function to determine the size of 
an array

s/Function to determine/Determine/

 >  * @code{SNGL}:          SNGL,      Convert double precision real to 
default real
 > +* @code{SPACING}:       SPACING,   Smallest distance between to 
numbers of a given type

s/to/two/

 > +* @code{SYSTEM}:        SYSTEM,    Execute a shell command
 > +* @code{SYSTEM_CLOCK}:  SYSTEM_CLOCK, Time function

"Time function" is not very specific.

 >  * @code{TANH}:          TANH,      Hyperbolic tangent function
 > +* @code{TIME}:          TIME,      Time function

"Time function" is not very specific.

 > +@node ACCESS
 > +@section @code{ACCESS} --- Checks file accessibility

s/accessibility/access method/

 >  @node ACHAR
 >  @section @code{ACHAR} --- Character in @acronym{ASCII} collating 
sequence
 > @@ -281,11 +408,11 @@
 >  @code{ACHAR(I)} returns the character located at position @code{I}
 >  in the @acronym{ASCII} collating sequence.
 >
 > -@item @emph{Option}:
 > -f95, gnu
 > +@item @emph{Standard}:
 > +Standard in F77 and later

s/Standard in F77/F77/

 >  @item @emph{Syntax}:
 >  @code{C = ACHAR(I)}
 > @@ -314,17 +441,17 @@
 >  @section @code{ACOS} --- Arc cosine function

s/Arc cosine/Arccosine/

 > +@node ACOSH
 > +@section @code{ACOSH} --- Area hyperbolic cosine function

s/Area/Inverse/  or s/Area/Arc/

 > +@findex @code{ACOSH} intrinsic
 > +@cindex area hyperbolic cosine

s/area hyperbolic cosine/hyperbolic arccosine/

 > +@cindex hyperbolic cosine (inverse)

 > +@node ASINH
 > +@section @code{ASINH} --- Area hyperbolic sine function

s/Area/Inverse/  or s/Area/Arc/

 > +@findex @code{ASINH} intrinsic
 > +@cindex area hyperbolic sine

s/area hyperbolic sine/hyperbolic arcsine/

 > +@cindex hyperbolic sine (inverse)

 > +@node ATANH
 > +@section @code{ATANH} --- Area hyperbolic tangent function

s/Area/Inverse/  or s/Area/Arc/

 > +@findex @code{ASINH} intrinsic
 > +@cindex area hyperbolic tangent

s/area hyperbolic tangent/hyperbolic arctangent/

 > +@cindex hyperbolic tangent (inverse)

 >  @code{I = CEILING(X[,KIND])}
 > @@ -1428,7 +1656,7 @@
 >  @item @emph{Arguments}:
 >  @multitable @columnfractions .15 .80
 >  @item @var{X} @tab The type shall be @code{REAL(*)}.
 > -@item @var{KIND} @tab Optional scaler integer initialization expression.
 > +@item @var{KIND} @tab Standard scalar integer initialization expression.

s/Standard/Optional/

 > @@ -1450,17 +1682,17 @@
 >  @node CHAR

 > +@item @emph{See also}:
 > +@ref{ICHAR}, @ref{IACHAR}

This should also reference ACHAR.

 > @@ -1679,11 +1967,11 @@
 >  @item @emph{Description}:
 >  @code{COSH(X)} computes the hyperbolic cosine of @var{X}.

Is there not a See Also: ACOSH for this?

 > @@ -2667,11 +3020,11 @@
 >  is omitted it returns the canonical @emph{success} for the system. 
All Fortran
 >  I/O units are closed.
 >
 > -@item @emph{Option}:
 > -gnu
 > +@item @emph{Standard}:
 > +GNU extension
 >
 >  @item @emph{Class}:
 > -non-elemental subroutine
 > +Non-elemental subroutine

Why is this labeled "Non-elemental subroutine" when some are just 
"Subroutine"?

 > @@ -2924,8 +3334,8 @@
 >  Flushes Fortran unit(s) currently open for output. Without the optional
 >  argument, all units are flushed, otherwise just the unit specified.
 >
 > -@item @emph{Option}:
 > -gnu
 > +@item @emph{Standard}:
 > +GNU extension

This is FLUSH(), yes?  Isn't this standard F2003?

 >  @node GETPID
 >  @section @code{GETPID} --- Process ID function
 >  @findex @code{GETPID} intrinsic
 > @@ -3105,8 +3810,8 @@
 >  @item @emph{Description}:
 >  Returns the process numerical identificator of the current process.
 >
 > -@item @emph{Option}:
 > -gnu
 > +@item @emph{Standard}:
 > +GNU extension
 >
 >  @item @emph{Class}:
 >  function
 > @@ -3141,8 +3847,8 @@
 >  @item @emph{Description}:
 >  Returns the numerical user ID of the current process.

Shouldn't that be PID, not user ID?


 > +@node ICHAR
 > +@section @code{ICHAR} --- Character-to-integer conversion function
 > +@findex @code{ICHAR} intrinsic
 > +@cindex conversion function (character)
 > +
 > +@table @asis
 > +@item @emph{Description}:
 > +@code{ICHAR(C)} returns the code for the character in the first 
character
 > +position of @code{C} in the system's native character set.
 > +The correspondence between character and their codes is not necessarily

s/character/characters/

 > +
 > +@node IEOR
 > +@section @code{IEOR} --- Bitwise  logical exclusive or

Remove extraneous space after "Bitwise"

 > +@node IERRNO
 > +@section @code{IERRNO} --- Function to get the last system error number

s/Function to get/Get/

 > +@node INDEX
 > +@section @code{INDEX} --- First Position of a substring within a string

s/First Position/Position/

 > +@item Name            @tab Argument          @tab Return type 
@tab Standard
 >  @item @code{ALOG10(X)}  @tab @code{REAL(4) X}  @tab @code{REAL(4)} 
   @tab f95, gnu
 >  @item @code{DLOG10(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)} 
   @tab f95, gnu

The table entries here look like they need updating.

 > +@item Name             @tab Arguments      @tab Return type    @tab 
Standard
 >  @item @code{AMOD(A,P)} @tab @code{REAL(4)} @tab @code{REAL(4)} @tab 
f95, gnu
 >  @item @code{DMOD(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab 
f95, gnu

The table entries here look like they need updating.

 >  @end multitable
 > @@ -3818,11 +5530,11 @@
 >  @item @emph{Description}:
 >  @code{MODULO(A,P)} computes the @var{A} modulo @var{P}.
 >
 >  @item @emph{Specific names}:
 > -@multitable @columnfractions .24 .24 .24 .24
 > -@item Name             @tab Arguments      @tab Return type    @tab 
Option
 > +@multitable @columnfractions .20 .20 .20 .40
 > +@item Name             @tab Arguments      @tab Return type    @tab 
Standard
 >  @item @code{AMOD(A,P)} @tab @code{REAL(4)} @tab @code{REAL(4)} @tab 
f95, gnu
 >  @item @code{DMOD(A,P)} @tab @code{REAL(8)} @tab @code{REAL(8)} @tab 
f95, gnu

The table entries here look like they need updating.  Also, why are the 
MOD specific names listed under the MODULO intrinsic?

 > +@item Name             @tab Argument         @tab Standard
 >  @item @code{IDNINT(X)} @tab @code{REAL(8)} @tab f95, gnu

The table entries here look like they need updating.

 > +@node PRESENT
 > +@section @code{PRESENT} --- Function to determine whether an 
optional argument was specified

s/Function to determine/Determine/

 > +@node RANDOM_NUMBER
 > +@section @code{RANDOM_NUMBER} --- Subroutine to generate a 
pseudorandom number

s/Subroutine to generate a pseudorandom/Pseudo-random/

 > +@node RANDOM_SEED
 > +@section @code{RANDOM_SEED} --- Subroutine to initialize a 
pseudorandom number sequence

s/Subroutine to initialize a pseudorandom/Initialize a pseudo-random/

 > +@node SHAPE
 > +@section @code{SHAPE} --- Function to determine the shape of an array

s/Function to determine/Determine/

 > +@item Name            @tab Argument          @tab Return type 
@tab Standard
 >  @item @code{DSINH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)} 
@tab f95, gnu

Table entries need updating.

 > +@node SIZE
 > +@section @code{SIZE} --- Function to determine the size of an array

s/Function to determine/Determine/

 > +@node SPACING
 > +@section @code{SPACING} --- Smallest distance between to numbers of 
a given type

s/to/two/

 > +@item Name            @tab Argument          @tab Return type 
@tab Standard
 > +@item @code{DSQRT(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)} 
  @tab f95, gnu
 > +@item @code{CSQRT(X)}  @tab @code{COMPLEX(4) X}  @tab 
@code{COMPLEX(4)}    @tab f95, gnu
 > +@item @code{ZSQRT(X)}  @tab @code{COMPLEX(8) X}  @tab 
@code{COMPLEX(8)}    @tab f95, gnu
 > +@item @code{CDSQRT(X)} @tab @code{COMPLEX(8) X}  @tab 
@code{COMPLEX(8)}    @tab f95, gnu

Table entries need updating.

 > +@node SRAND
 > +@section @code{SRAND} --- Reinitialize the random number generator

 > +@item @emph{Notes}:
 > +The Fortran 2003 standard specifies the intrinsic @code{RANDOM_SEED} to
 > +initialize the pseudo-random numbers generator and @code{RANDOM_NUMBER}
 > +to generate pseudo-random numbers. Please note that in
 > +@command{gfortran}, these two sets of intrinsics (@code{RAND},
 > +@code{IRAND} and @code{SRAND} on the one hand, @code{RANDOM_NUMBER} and
 > +@code{RANDOM_SEED} on the other hand) access two independent
 > +pseudo-random numbers generators.

s/numbers/number/

 > +@item Name            @tab Argument          @tab Return type 
@tab Standard
 >  @item @code{DTAN(X)}  @tab @code{REAL(8) X}  @tab @code{REAL(8)} 
@tab f95, gnu

Table entries need updating.

 > +@item Name            @tab Argument          @tab Return type 
@tab Standard
 >  @item @code{DTANH(X)} @tab @code{REAL(8) X}  @tab @code{REAL(8)} 
@tab f95, gnu

Table entries need updating.



More information about the Fortran mailing list