<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SIZEOF() on derived type in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453096#M164846</link>
    <description>&lt;P&gt;First sizeof is not standard Fortran but for bind(c) types you can use c_sizeof which is. bind(c) derived types are of fixed size, so you could set as a parameter constant, not elegant buy hey ho.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2023 15:24:13 GMT</pubDate>
    <dc:creator>andrew_4619</dc:creator>
    <dc:date>2023-02-03T15:24:13Z</dc:date>
    <item>
      <title>SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453084#M164844</link>
      <description>&lt;P&gt;Does anyone know of a way to get a compile-time sizeof() on a generic type?&amp;nbsp; Let's say I'm declaring a module that handles all operations on a derived type:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MODULE MY_MOD
  USE, INTRINSIC :: ISO_C_BINDING
  USE, INTRINSIC :: IEEE_ARITHMETIC
  TYPE, BIND(C) :: MY_MOD_TYPE
    INTEGER(KIND=C_INT32_T) :: A
    INTEGER(KIND=C_INT32_T) :: B
    INTEGER(KIND=C_INT32_T) :: C
    REAL(KIND=C_FLOAT)      :: D
  END TYPE
  INTERFACE MY_MOD_TYPE
     MODULE PROCEDURE INIT_MY_MOD_TYPE
  END INTERFACE
CONTAINS
  PURE TYPE(MY_MOD_TYPE) FUNCTION INIT_MY_MOD_TYPE() RESULT(RET)
    RET%A = -1
    RET%B = -1
    RET%C = -1
    RET%D = IEEE_VALUE( 1.0, IEEE_QUIET_NAN )
  END FUNCTION

  PURE INTEGER(KIND=C_SIZE_T) FUNCTION MY_MOD_TYPE_SIZE ()
    TYPE(MY_MOD_TYPE) :: A
    MY_MOD_TYPE_SIZE = SIZEOF(A)
  END FUNCTION
END MODULE&lt;/LI-CODE&gt;
&lt;P&gt;So, in the above, I have an initializer function for the type, and something that will return the size of the type.&amp;nbsp; However, if I'm trying to write memory-optimized code, the my_mod_type_size() function is very wasteful -- I'm declaring an entire type (which could be dozens or even hundreds of megabytes in size) to just be able to do a sizeof() on the type, and then throw away the memory after the function exits.&amp;nbsp; It appears as though it's illegal to do a sizeof(type(my_mod_type)) -- is there any way to get this (preferably at compile-time, as can be done in C) without having to declare the variable and allocate the memory for it?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 14:55:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453084#M164844</guid>
      <dc:creator>ereisch</dc:creator>
      <dc:date>2023-02-03T14:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453096#M164846</link>
      <description>&lt;P&gt;First sizeof is not standard Fortran but for bind(c) types you can use c_sizeof which is. bind(c) derived types are of fixed size, so you could set as a parameter constant, not elegant buy hey ho.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 15:24:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453096#M164846</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2023-02-03T15:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453104#M164847</link>
      <description>&lt;LI-CODE lang="fortran"&gt;c_sizeof(MY_MOD_TYPE(0,0,0,0.0))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 03 Feb 2023 15:42:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453104#M164847</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2023-02-03T15:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453115#M164849</link>
      <description>&lt;P&gt;Yes I tried that as a parameter decl but it objects to it not being a constant expression which I think is wrong. I also thought&amp;nbsp;&lt;SPAN&gt;c_sizeof&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;MY_MOD_TYPE&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;) might work but it gives uninitialised variable errors for the components.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 16:18:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453115#M164849</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2023-02-03T16:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453245#M164862</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;Right - C_SIZEOF isn't allowed in a constant expression.&lt;/STRIKE&gt; This, though nonstandard, works:&lt;/P&gt;
&lt;P&gt;integer, parameter :: s = sizeof(my_mod_type(0,0,0,0.0))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: see below.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 21:39:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453245#M164862</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2023-02-03T21:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453258#M164866</link>
      <description>&lt;P&gt;Hmmm ok in my understanding C_SIZEOF&amp;nbsp; can only be used on a derived type that has bind(c) which precludes allocable and pointer components etc so you would think&amp;nbsp;C_SIZEOF of is in-fact&amp;nbsp; a constant expression that can be determined as compile time for but non-bind(c) DT this may not be true. The example above with the defualt constructor is however a constant....&lt;/P&gt;
&lt;P&gt;To cut to the chase I am thus not sure why&amp;nbsp;&lt;SPAN&gt;C_SIZEOF isn't allowed in a constant expression is that a specific&amp;nbsp;constraint?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 21:09:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453258#M164866</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2023-02-03T21:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453267#M164869</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/69081"&gt;@ereisch&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Re: "&lt;SPAN&gt;is there any way to get this (preferably at compile-time, as can be done in C) without having to declare the variable and allocate the memory for it?,&lt;/SPAN&gt;"&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;consider default initialization of components of the interoperable derived types, this is important&lt;/LI&gt;
&lt;LI&gt;consider a named constant "mold" of such types - basically a compile-time thingy with throw away value,&lt;/LI&gt;
&lt;LI&gt;and use the mold for the size generation.&lt;/LI&gt;
&lt;/UL&gt;
&lt;LI-CODE lang="fortran"&gt;   use, intrinsic :: iso_c_binding, only : c_int32_t, c_float, c_sizeof, c_size_t
   type, bind(C) :: t
      integer(kind=c_int32_t) :: a = 0_c_int32_t
      integer(kind=c_int32_t) :: b = 0_c_int32_t
      integer(kind=c_int32_t) :: c = 0_c_int32_t
      real(kind=c_float)      :: d = 0.0_c_float
   end type
   type(t), parameter :: mold_t = t()
   integer(c_size_t), parameter :: t_sz = c_sizeof( mold_t )
   print *, "t_sz = ", t_sz
end
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;C:\temp&amp;gt;ifort /standard-semantics p.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.8.0 Build 20221119_000000
Copyright (C) 1985-2022 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.34.31937.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:p.exe
-subsystem:console
p.obj

C:\temp&amp;gt;p.exe
 t_sz =  16

C:\temp&amp;gt;gfortran p.f90 -o p.exe

C:\temp&amp;gt;p.exe
 t_sz =                    16

C:\temp&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 03 Feb 2023 21:35:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453267#M164869</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2023-02-03T21:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453269#M164870</link>
      <description>&lt;P&gt;Constant expressions have restrictions on which functions may appear. Most intrinsic functions are OK if all their arguments are constant expressions, but only selected functions from intrinsic modules are allowed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However...&lt;/P&gt;
&lt;P&gt;C_SIZEOF is one that is explicitly allowed - I forgot that. There is a known bug in ifort that it does not allow a "specification inquiry" in a constant expression, and this is where C_SIZEOF and some other intrinsic module functions such as COMPILER_VERSION are permitted.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 21:38:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453269#M164870</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2023-02-03T21:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453300#M164872</link>
      <description>&lt;P&gt;If I read the Fortran 77 manual, I get one definition of constant expressions and if I read modern IFORT I get a second, when did they change?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 22:55:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453300#M164872</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-03T22:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453314#M164875</link>
      <description>&lt;P&gt;The rules for constant (or intilalization in earlier revisions) expressions change in every revision of the standard. Fortran 2023 makes them even more liberal.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 00:13:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453314#M164875</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2023-02-04T00:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453394#M164876</link>
      <description>&lt;P&gt;&lt;SPAN&gt;A&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;constant&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;expression&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;is made up of explicit constants and parameters and the FORTRAN operators. Each operand is either itself another constant expression, a constant, a symbolic name of a constant, or one of the intrinsic functions called with constant arguments.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;from&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;https://docs.oracle.com/cd/E19957-01/805-4939/6j4m0vn76/index.html#:~:text=A%20constant%20expression%20is%20made,functions%20called%20with%20constant%20arguments.&lt;/LI-CODE&gt;
&lt;P&gt;2010 at Oracle&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;But from Intel, manual,&amp;nbsp; there is no reference to Fortran operators, is this just implied.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;A constant expression is an expression that you can use as a kind type parameter, a named constant, or to specify an initial value for an entity. It is evaluated when a program is compiled.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;In a constant expression, each operation is intrinsic and each primary is one of the following:&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;UL&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;A constant or subobject of a constant&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;A specification inquiry where each designator or function argument is one of the following:&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;A constant expression&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;A variable whose properties inquired about are not assumed, deferred, or defined by an expression that is not a constant expression&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;A reference to the transformational function IEEE_SELECTED_REAL_KIND from the intrinsic module IEEE_ARITHMETIC, where each argument is a constant expression&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;A kind type parameter of the derived type being defined&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;A DO variable within an array constructor where each scalar integer expression of the corresponding DO loop is an constant expression&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI class="li"&gt;
&lt;DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;Another constant expression enclosed in parentheses, where each subscript, section subscript, substring starting and ending point, and type parameter value is a constant expression&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;UL id="constant-expressions_GUID-BD6F24D7-8FBB-4290-A2CB-6B196B287D98" class="ul"&gt;&lt;/UL&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;If a constant expression invokes an inquiry function for a type parameter or an array bound of an object, the type parameter or array bound must be specified in a prior specification statement (or to the left of the inquiry function in the same statement). The previous specification cannot be in the same entity declaration.&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="p"&gt;
&lt;DIV&gt;If a reference to a generic entity is included in a constant expression that is in the specification part of a module or submodule, that generic entity shall have no specific procedures defined subsequent to the constant expression in the module or submodule.&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 04 Feb 2023 14:34:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453394#M164876</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-04T14:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453397#M164878</link>
      <description>&lt;P&gt;Operators are implied by "expression". The Intel documentation is mainly quoting the standard but has left out parts. (Why are you referencing some document from Oracle? The Intel page for this is &lt;A href="https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/language-reference/expressions-and-assignment-statements/expressions/constant-and-specification-expressions/constant-expressions.html" target="_self"&gt;here&lt;/A&gt;.)&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 15:38:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453397#M164878</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2023-02-04T15:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453399#M164879</link>
      <description>&lt;P&gt;When the post listed constant expressions, I wondered what they meant, never heard the term, I found the Oracle site and it explained it.&amp;nbsp; I then went a found the Intel site and compared them, but I wondered if it was implied as the difference, so I asked.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would help if the Intel did list operators for someone like me, who only rarely reads the manual or worries about such fine detail.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I listed the stuff from the two sites, because I knew you would knew.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 16:21:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453399#M164879</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-04T16:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453400#M164880</link>
      <description>&lt;P&gt;In the Powerstation Fortran Manual there is no Constant Expressions in the index in any form, are they after Powerstation?&amp;nbsp; Or just left out?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 16:28:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453400#M164880</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-04T16:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453402#M164881</link>
      <description>&lt;P&gt;&lt;A href="https://wg5-fortran.org/ARCHIVE/Fortran77.html" target="_blank"&gt;https://wg5-fortran.org/ARCHIVE/Fortran77.html&lt;/A&gt;&amp;nbsp;read away plenty of stuff on constant expressions to be had.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 17:05:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453402#M164881</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2023-02-04T17:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453412#M164882</link>
      <description>&lt;PRE&gt;6.7  Constant_Expressions

          A  constant  expression  is  an   arithmetic   constant
          expression  (6.1.3),  a  character  constant expression
          (6.2.3), or a logical constant expression (6.4.4).
&lt;/PRE&gt;
&lt;P&gt;This definition from the Fortran 77 manual essentially matches the Intel one, as far as I can see, but they are not the same as the Oracle\, which is&amp;nbsp;&lt;SPAN&gt;or one of the intrinsic functions called with constant arguments could be argued is in the standard but could be missed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Interesting you can see where confusion comes in when writer knows what is meant and so do the committee, but some poor person misses the implied.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 20:25:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453412#M164882</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-04T20:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453416#M164883</link>
      <description>&lt;LI-CODE lang="fortran"&gt;!****************************************************************************
!
!  PROGRAM: Console2
!
!  PURPOSE:  Entry point for the console application.
!
!****************************************************************************

    program Console2

    implicit none
    
    real, parameter :: pi = 3.142
    
    real, parameter :: zero = cos(pi)

    ! Variables

    ! Body of Console2
    print *, 'Constant Expression :: ', zero

    end program Console2

&lt;/LI-CODE&gt;
&lt;P&gt;It is the use of cos that I find interesting, I understand, but it is not 100% clear if it is Intel legal, it works.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 20:41:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453416#M164883</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2023-02-04T20:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453420#M164884</link>
      <description>&lt;P&gt;totally legal! I always use:&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;real(dp), parameter :: pi = acos(-1.0_dp)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 04 Feb 2023 21:31:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453420#M164884</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2023-02-04T21:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453421#M164885</link>
      <description>&lt;P&gt;Is "zero = cos(pi)" the new math they talk about .. my kid's school introduced yet another version of "new math" this year, it's not 100% clear&amp;nbsp; ..&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/89041"&gt;@JohnNichols&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;LI-CODE lang="fortran"&gt;..
    real, parameter :: zero = cos(pi)
..
&lt;/LI-CODE&gt;
&lt;P&gt;It is the use of cos that I find interesting, I understand, but it is not 100% clear ..&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 21:40:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453421#M164885</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2023-02-04T21:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: SIZEOF() on derived type</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453422#M164886</link>
      <description>&lt;P&gt;Constant expressions were called initialization expressions in earlier standard revisions.&lt;/P&gt;
&lt;P&gt;Operators are described in the various sections under Expressions, broken out by numeric/logical/character/relational/defined.&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 22:05:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/SIZEOF-on-derived-type/m-p/1453422#M164886</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2023-02-04T22:05:50Z</dc:date>
    </item>
  </channel>
</rss>

