Fortran-2003-status.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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: Fortran 2003 status</title>
  20. <meta name="description" content="The GNU Fortran Compiler: Fortran 2003 status">
  21. <meta name="keywords" content="The GNU Fortran Compiler: Fortran 2003 status">
  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="Fortran-2003-and-2008-status.html#Fortran-2003-and-2008-status" rel="up" title="Fortran 2003 and 2008 status">
  30. <link href="Fortran-2008-status.html#Fortran-2008-status" rel="next" title="Fortran 2008 status">
  31. <link href="Fortran-2003-and-2008-status.html#Fortran-2003-and-2008-status" rel="prev" title="Fortran 2003 and 2008 status">
  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="Fortran-2003-status"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="Fortran-2008-status.html#Fortran-2008-status" accesskey="n" rel="next">Fortran 2008 status</a>, Up: <a href="Fortran-2003-and-2008-status.html#Fortran-2003-and-2008-status" accesskey="u" rel="up">Fortran 2003 and 2008 status</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="Fortran-2003-status-1"></a>
  69. <h3 class="section">4.1 Fortran 2003 status</h3>
  70. <p>GNU Fortran supports several Fortran 2003 features; an incomplete
  71. list can be found below. See also the
  72. <a href="https://gcc.gnu.org/wiki/Fortran2003">wiki page</a> about Fortran 2003.
  73. </p>
  74. <ul>
  75. <li> Procedure pointers including procedure-pointer components with
  76. <code>PASS</code> attribute.
  77. </li><li> Procedures which are bound to a derived type (type-bound procedures)
  78. including <code>PASS</code>, <code>PROCEDURE</code> and <code>GENERIC</code>, and
  79. operators bound to a type.
  80. </li><li> Abstract interfaces and type extension with the possibility to
  81. override type-bound procedures or to have deferred binding.
  82. </li><li> Polymorphic entities (&ldquo;<code>CLASS</code>&rdquo;) for derived types and unlimited
  83. polymorphism (&ldquo;<code>CLASS(*)</code>&rdquo;) &ndash; including <code>SAME_TYPE_AS</code>,
  84. <code>EXTENDS_TYPE_OF</code> and <code>SELECT TYPE</code> for scalars and arrays and
  85. finalization.
  86. </li><li> Generic interface names, which have the same name as derived types,
  87. are now supported. This allows one to write constructor functions. Note
  88. that Fortran does not support static constructor functions. For static
  89. variables, only default initialization or structure-constructor
  90. initialization are available.
  91. </li><li> The <code>ASSOCIATE</code> construct.
  92. </li><li> Interoperability with C including enumerations,
  93. </li><li> In structure constructors the components with default values may be
  94. omitted.
  95. </li><li> Extensions to the <code>ALLOCATE</code> statement, allowing for a
  96. type-specification with type parameter and for allocation and initialization
  97. from a <code>SOURCE=</code> expression; <code>ALLOCATE</code> and <code>DEALLOCATE</code>
  98. optionally return an error message string via <code>ERRMSG=</code>.
  99. </li><li> Reallocation on assignment: If an intrinsic assignment is
  100. used, an allocatable variable on the left-hand side is automatically allocated
  101. (if unallocated) or reallocated (if the shape is different). Currently, scalar
  102. deferred character length left-hand sides are correctly handled but arrays
  103. are not yet fully implemented.
  104. </li><li> Deferred-length character variables and scalar deferred-length character
  105. components of derived types are supported. (Note that array-valued compoents
  106. are not yet implemented.)
  107. </li><li> Transferring of allocations via <code>MOVE_ALLOC</code>.
  108. </li><li> The <code>PRIVATE</code> and <code>PUBLIC</code> attributes may be given individually
  109. to derived-type components.
  110. </li><li> In pointer assignments, the lower bound may be specified and
  111. the remapping of elements is supported.
  112. </li><li> For pointers an <code>INTENT</code> may be specified which affect the
  113. association status not the value of the pointer target.
  114. </li><li> Intrinsics <code>command_argument_count</code>, <code>get_command</code>,
  115. <code>get_command_argument</code>, and <code>get_environment_variable</code>.
  116. </li><li> Support for Unicode characters (ISO 10646) and UTF-8, including
  117. the <code>SELECTED_CHAR_KIND</code> and <code>NEW_LINE</code> intrinsic functions.
  118. </li><li> Support for binary, octal and hexadecimal (BOZ) constants in the
  119. intrinsic functions <code>INT</code>, <code>REAL</code>, <code>CMPLX</code> and <code>DBLE</code>.
  120. </li><li> Support for namelist variables with allocatable and pointer
  121. attribute and nonconstant length type parameter.
  122. </li><li> <a name="index-array_002c-constructors"></a>
  123. <a name="index-_005b_002e_002e_002e_005d"></a>
  124. Array constructors using square brackets. That is, <code>[...]</code> rather
  125. than <code>(/.../)</code>. Type-specification for array constructors like
  126. <code>(/ some-type :: ... /)</code>.
  127. </li><li> Extensions to the specification and initialization expressions,
  128. including the support for intrinsics with real and complex arguments.
  129. </li><li> Support for the asynchronous input/output syntax; however, the
  130. data transfer is currently always synchronously performed.
  131. </li><li> <a name="index-FLUSH-statement"></a>
  132. <a name="index-statement_002c-FLUSH"></a>
  133. <code>FLUSH</code> statement.
  134. </li><li> <a name="index-IOMSG_003d-specifier"></a>
  135. <code>IOMSG=</code> specifier for I/O statements.
  136. </li><li> <a name="index-ENUM-statement"></a>
  137. <a name="index-ENUMERATOR-statement"></a>
  138. <a name="index-statement_002c-ENUM"></a>
  139. <a name="index-statement_002c-ENUMERATOR"></a>
  140. <a name="index-fshort_002denums-1"></a>
  141. Support for the declaration of enumeration constants via the
  142. <code>ENUM</code> and <code>ENUMERATOR</code> statements. Interoperability with
  143. <code>gcc</code> is guaranteed also for the case where the
  144. <code>-fshort-enums</code> command line option is given.
  145. </li><li> <a name="index-TR-15581"></a>
  146. TR 15581:
  147. <ul>
  148. <li> <a name="index-ALLOCATABLE-dummy-arguments"></a>
  149. <code>ALLOCATABLE</code> dummy arguments.
  150. </li><li> <a name="index-ALLOCATABLE-function-results"></a>
  151. <code>ALLOCATABLE</code> function results
  152. </li><li> <a name="index-ALLOCATABLE-components-of-derived-types"></a>
  153. <code>ALLOCATABLE</code> components of derived types
  154. </li></ul>
  155. </li><li> <a name="index-STREAM-I_002fO"></a>
  156. <a name="index-ACCESS_003d_0027STREAM_0027-I_002fO"></a>
  157. The <code>OPEN</code> statement supports the <code>ACCESS='STREAM'</code> specifier,
  158. allowing I/O without any record structure.
  159. </li><li> Namelist input/output for internal files.
  160. </li><li> Minor I/O features: Rounding during formatted output, using of
  161. a decimal comma instead of a decimal point, setting whether a plus sign
  162. should appear for positive numbers. On systems where <code>strtod</code> honours
  163. the rounding mode, the rounding mode is also supported for input.
  164. </li><li> <a name="index-PROTECTED-statement"></a>
  165. <a name="index-statement_002c-PROTECTED"></a>
  166. The <code>PROTECTED</code> statement and attribute.
  167. </li><li> <a name="index-VALUE-statement"></a>
  168. <a name="index-statement_002c-VALUE"></a>
  169. The <code>VALUE</code> statement and attribute.
  170. </li><li> <a name="index-VOLATILE-statement"></a>
  171. <a name="index-statement_002c-VOLATILE"></a>
  172. The <code>VOLATILE</code> statement and attribute.
  173. </li><li> <a name="index-IMPORT-statement"></a>
  174. <a name="index-statement_002c-IMPORT"></a>
  175. The <code>IMPORT</code> statement, allowing to import
  176. host-associated derived types.
  177. </li><li> The intrinsic modules <code>ISO_FORTRAN_ENVIRONMENT</code> is supported,
  178. which contains parameters of the I/O units, storage sizes. Additionally,
  179. procedures for C interoperability are available in the <code>ISO_C_BINDING</code>
  180. module.
  181. </li><li> <a name="index-USE_002c-INTRINSIC-statement"></a>
  182. <a name="index-statement_002c-USE_002c-INTRINSIC"></a>
  183. <a name="index-ISO_005fFORTRAN_005fENV-statement"></a>
  184. <a name="index-statement_002c-ISO_005fFORTRAN_005fENV"></a>
  185. <code>USE</code> statement with <code>INTRINSIC</code> and <code>NON_INTRINSIC</code>
  186. attribute; supported intrinsic modules: <code>ISO_FORTRAN_ENV</code>,
  187. <code>ISO_C_BINDING</code>, <code>OMP_LIB</code> and <code>OMP_LIB_KINDS</code>,
  188. and <code>OPENACC</code>.
  189. </li><li> Renaming of operators in the <code>USE</code> statement.
  190. </li></ul>
  191. <hr>
  192. <div class="header">
  193. <p>
  194. Next: <a href="Fortran-2008-status.html#Fortran-2008-status" accesskey="n" rel="next">Fortran 2008 status</a>, Up: <a href="Fortran-2003-and-2008-status.html#Fortran-2003-and-2008-status" accesskey="u" rel="up">Fortran 2003 and 2008 status</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>
  195. </div>
  196. </body>
  197. </html>