ALL.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1999-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>The GNU Fortran Compiler: ALL</title>
  20. <meta name="description" content="The GNU Fortran Compiler: ALL">
  21. <meta name="keywords" content="The GNU Fortran Compiler: ALL">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Intrinsic-Procedures.html#Intrinsic-Procedures" rel="up" title="Intrinsic Procedures">
  30. <link href="ALLOCATED.html#ALLOCATED" rel="next" title="ALLOCATED">
  31. <link href="ALARM.html#ALARM" rel="prev" title="ALARM">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style:oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="ALL"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="ALLOCATED.html#ALLOCATED" accesskey="n" rel="next">ALLOCATED</a>, Previous: <a href="ALARM.html#ALARM" accesskey="p" rel="prev">ALARM</a>, Up: <a href="Intrinsic-Procedures.html#Intrinsic-Procedures" accesskey="u" rel="up">Intrinsic Procedures</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="ALL-_002d_002d_002d-All-values-in-MASK-along-DIM-are-true"></a>
  69. <h3 class="section">9.14 <code>ALL</code> &mdash; All values in <var>MASK</var> along <var>DIM</var> are true</h3>
  70. <a name="index-ALL"></a>
  71. <a name="index-array_002c-apply-condition"></a>
  72. <a name="index-array_002c-condition-testing"></a>
  73. <dl compact="compact">
  74. <dt><em>Description</em>:</dt>
  75. <dd><p><code>ALL(MASK [, DIM])</code> determines if all the values are true in <var>MASK</var>
  76. in the array along dimension <var>DIM</var>.
  77. </p>
  78. </dd>
  79. <dt><em>Standard</em>:</dt>
  80. <dd><p>Fortran 95 and later
  81. </p>
  82. </dd>
  83. <dt><em>Class</em>:</dt>
  84. <dd><p>Transformational function
  85. </p>
  86. </dd>
  87. <dt><em>Syntax</em>:</dt>
  88. <dd><p><code>RESULT = ALL(MASK [, DIM])</code>
  89. </p>
  90. </dd>
  91. <dt><em>Arguments</em>:</dt>
  92. <dd><table>
  93. <tr><td width="15%"><var>MASK</var></td><td width="70%">The type of the argument shall be <code>LOGICAL</code> and
  94. it shall not be scalar.</td></tr>
  95. <tr><td width="15%"><var>DIM</var></td><td width="70%">(Optional) <var>DIM</var> shall be a scalar integer
  96. with a value that lies between one and the rank of <var>MASK</var>.</td></tr>
  97. </table>
  98. </dd>
  99. <dt><em>Return value</em>:</dt>
  100. <dd><p><code>ALL(MASK)</code> returns a scalar value of type <code>LOGICAL</code> where
  101. the kind type parameter is the same as the kind type parameter of
  102. <var>MASK</var>. If <var>DIM</var> is present, then <code>ALL(MASK, DIM)</code> returns
  103. an array with the rank of <var>MASK</var> minus 1. The shape is determined from
  104. the shape of <var>MASK</var> where the <var>DIM</var> dimension is elided.
  105. </p>
  106. <dl compact="compact">
  107. <dt>(A)</dt>
  108. <dd><p><code>ALL(MASK)</code> is true if all elements of <var>MASK</var> are true.
  109. It also is true if <var>MASK</var> has zero size; otherwise, it is false.
  110. </p></dd>
  111. <dt>(B)</dt>
  112. <dd><p>If the rank of <var>MASK</var> is one, then <code>ALL(MASK,DIM)</code> is equivalent
  113. to <code>ALL(MASK)</code>. If the rank is greater than one, then <code>ALL(MASK,DIM)</code>
  114. is determined by applying <code>ALL</code> to the array sections.
  115. </p></dd>
  116. </dl>
  117. </dd>
  118. <dt><em>Example</em>:</dt>
  119. <dd><div class="smallexample">
  120. <pre class="smallexample">program test_all
  121. logical l
  122. l = all((/.true., .true., .true./))
  123. print *, l
  124. call section
  125. contains
  126. subroutine section
  127. integer a(2,3), b(2,3)
  128. a = 1
  129. b = 1
  130. b(2,2) = 2
  131. print *, all(a .eq. b, 1)
  132. print *, all(a .eq. b, 2)
  133. end subroutine section
  134. end program test_all
  135. </pre></div>
  136. </dd>
  137. </dl>
  138. <hr>
  139. <div class="header">
  140. <p>
  141. Next: <a href="ALLOCATED.html#ALLOCATED" accesskey="n" rel="next">ALLOCATED</a>, Previous: <a href="ALARM.html#ALARM" accesskey="p" rel="prev">ALARM</a>, Up: <a href="Intrinsic-Procedures.html#Intrinsic-Procedures" accesskey="u" rel="up">Intrinsic Procedures</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  142. </div>
  143. </body>
  144. </html>