From patchwork Sun Oct 28 14:13:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Thomas_K=C3=B6nig?= X-Patchwork-Id: 989990 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-488477-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tkoenig.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="DPNNrHVi"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=tkoenig.net header.i=@tkoenig.net header.b="kNPFVUOu"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42jfqL0m5Nz9sDN for ; Mon, 29 Oct 2018 01:14:03 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=mpBVFNBw4uCCI9e0XfRTF49V2QLEGv8MOSNQvYa76AA3XXQLt/ qIAF/UyiUxjVO1i5KKawKjDApxhhtorlncPTboO3S/NglFVTWKzhyS+sX/nW30a9 dskcA6Ww97jpxc3lJ1UJcANnKSlewWthJyHu77c65owM4n9Zwq3redsvs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=aw4Zo3R8Dm3dPSYKBaI0A+7AgSU=; b=DPNNrHViM2nRMZrWsP3w GJwhaGf5jsP8/X0Zav1lYV8F0aUvjmRp+5lAUYaIQ/3QzIebewfYIoxdOTGRPyn8 NxNH3gPLLpQk0oT30T/HBDH31Bv5PVWeaubsb/rtaMqPEFMvDjGMJQMfXN95hWuc aK4yj8LMRxOJZX/Li90jsWI= Received: (qmail 75573 invoked by alias); 28 Oct 2018 14:13:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 75551 invoked by uid 89); 28 Oct 2018 14:13:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=inclusive, unformatted, Arbeitskopie, rank X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (85.215.255.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 28 Oct 2018 14:13:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1540736030; s=strato-dkim-0002; d=tkoenig.net; h=Date:Message-ID:Subject:From:To:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=+7wrGyKDVNJw3j7vq5P9MfT+bjmO+AnMKvqPZujZJ+0=; b=kNPFVUOuGStsFO9+Xc5RDSR23X0OwpG69zaRvu1S4QVxTg9PQmucvEBBK1iMjlMAgv kcdYFxA9v+/fVPPQ8To15beIG2lAy+SWRF6yMLd9/qsEsGo4Hjl2GkihLc0uwpKynKvu gA2iRjEqhaR+5t3bBiZOxxrplBHSn0C6gyeOUp1Nh0EP3LNO0qLy0h5rOZtGDq/onP7K LCWIiuIUI0rIcaow4t6mFdy1NwPmZTo7nuB2ZmNDg3EGZTZgS3GhAO/bg0s1aKONOG9q y8sBqzMwnFTDjYKXmnrWGaw3dhQEULsQYohC6A7G5IdJLoMy9ME+0x3GuBWiqsXghK24 wuWQ== Received: from [192.168.178.68] by smtp.strato.de (RZmta 44.3 DYNA|AUTH) with ESMTPSA id w0b013u9SEDnn9U (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 28 Oct 2018 15:13:49 +0100 (CET) To: "fortran@gcc.gnu.org" , gcc-patches From: =?utf-8?q?Thomas_K=C3=B6nig?= Subject: [patch, doc, fortran] Document FINDLOC Message-ID: Date: Sun, 28 Oct 2018 15:13:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Hi, here is the promised documentation for FINDLOC. Tested with "make dvi" and "make pdf". OK for trunk? Regards Thomas 2018-10-28 Thomas Koenig PR fortran/54613 * gfortran.texi (File format of unformatted sequential files): Replace random comma with period. * intrinsic.texi (Intrinsic Procedures): Add FINDLOC to menu. (FINDLOC): Document. (MAXLOC): Add refrence to FINDLOC. (MINLOC): Likewise. Index: gfortran.texi =================================================================== --- gfortran.texi (Revision 265569) +++ gfortran.texi (Arbeitskopie) @@ -1479,7 +1479,7 @@ contains a negative number, then there is a preced In the most simple case, with only one subrecord per logical record, both record markers contain the number of bytes of user data in the -record, +record. The format for unformatted sequential data can be duplicated using unformatted stream, as shown in the example program for an unformatted Index: intrinsic.texi =================================================================== --- intrinsic.texi (Revision 265569) +++ intrinsic.texi (Arbeitskopie) @@ -148,6 +148,7 @@ Some basic guidelines for editing this document: * @code{FDATE}: FDATE, Subroutine (or function) to get the current time as a string * @code{FGET}: FGET, Read a single character in stream mode from stdin * @code{FGETC}: FGETC, Read a single character in stream mode +* @code{FINDLOC}: FINDLOC, Search an array for a value * @code{FLOOR}: FLOOR, Integer floor function * @code{FLUSH}: FLUSH, Flush I/O unit(s) * @code{FNUM}: FNUM, File number function @@ -6021,8 +6022,68 @@ END PROGRAM @ref{FGET}, @ref{FPUT}, @ref{FPUTC} @end table +@node FINDLOC +@section @code{FINDLOC} --- Search an array for a value +@fnindex FINDLOC +@cindex findloc +@table @asis +@item @emph{Description}: +Determines the location of the element in the array with the value +given in the @var{VALUE} argument, or, if the @var{DIM} argument is +supplied, determines the locations of the maximum element along each +row of the array in the @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 value +@var{VALUE}, the location returned is 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 2008 and later. + +@item @emph{Class}: +Transformational function + +@item @emph{Syntax}: +@multitable @columnfractions .80 +@item @code{RESULT = FINDLOC(ARRAY, VALUE, DIM [, MASK] [,KIND] [,BACK])} +@item @code{RESULT = FINDLOC(ARRAY, VALUE, [, MASK] [,KIND] [,BACK])} +@end multitable + +@item @emph{Arguments}: +@multitable @columnfractions .15 .70 +@item @var{ARRAY} @tab Shall be an array of intrinsic type. +@item @var{VALUE} @tab A scalar of intrinsic type which is in type +conformance with @var{ARRAY}. +@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{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}: +If @var{DIM} is absent, the result is a rank-one array with a length +equal to the rank of @var{ARRAY}. If @var{DIM} is present, the result +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. 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{MAXLOC}, @ref{MINLOC} + +@end table + @node FLOOR @section @code{FLOOR} --- Integer floor function @fnindex FLOOR @@ -10039,7 +10100,7 @@ is present, the result is an integer of kind @var{ is of default kind. @item @emph{See also}: -@ref{MAX}, @ref{MAXVAL} +@ref{FINDLOC}, @ref{MAX}, @ref{MAXVAL} @end table @@ -10395,7 +10456,7 @@ is present, the result is an integer of kind @var{ is of default kind. @item @emph{See also}: -@ref{MIN}, @ref{MINVAL} +@ref{FINDLOC}, @ref{MIN}, @ref{MINVAL} @end table