<?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: Initialize a default value for a derived type component var in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Initialize-a-default-value-for-a-derived-type-component-variable/m-p/895609#M79563</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Aah... that's the thing I was also missing... The "::" delimiter...&lt;BR /&gt;&lt;BR /&gt;Thanks a lot Steve. This is a very convenient feature.&lt;BR /&gt;&lt;BR /&gt;Olivier</description>
    <pubDate>Tue, 24 Feb 2009 19:10:43 GMT</pubDate>
    <dc:creator>OP1</dc:creator>
    <dc:date>2009-02-24T19:10:43Z</dc:date>
    <item>
      <title>Initialize a default value for a derived type component variable.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Initialize-a-default-value-for-a-derived-type-component-variable/m-p/895606#M79560</link>
      <description>I am not sure about the syntax for assigning a default value to a component of a derived type variable. I want all new instances of my derived type have some of their components assigned a default value.&lt;BR /&gt;For instance:&lt;BR /&gt;&lt;BR /&gt;TYPE MY_TYPE&lt;BR /&gt; LOGICAL IS_IT_INITIALIZED&lt;BR /&gt;INTEGERT&lt;BR /&gt; ...&lt;BR /&gt;END TYPE MY_TYPE&lt;BR /&gt;&lt;BR /&gt;Now, when I declare a variable A of type MY_TYPE, I want to make sure that the component IS_IT_INITIALIZED is set to .FALSE. and T to 1000 (for instance).&lt;BR /&gt;Is there a way to do this? Or should I manually initialize every new instance of MY_TYPE when I declare it?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;Olivier</description>
      <pubDate>Tue, 24 Feb 2009 16:50:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Initialize-a-default-value-for-a-derived-type-component-variable/m-p/895606#M79560</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2009-02-24T16:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Initialize a default value for a derived type component var</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Initialize-a-default-value-for-a-derived-type-component-variable/m-p/895607#M79561</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/326069"&gt;opmkl&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;I am not sure about the syntax for assigning a default value to a component of a derived type variable. I want all new instances of my derived type have some of their components assigned a default value.&lt;BR /&gt;For instance:&lt;BR /&gt;&lt;BR /&gt;TYPE MY_TYPE&lt;BR /&gt; LOGICAL IS_IT_INITIALIZED&lt;BR /&gt;INTEGERT&lt;BR /&gt; ...&lt;BR /&gt;END TYPE MY_TYPE&lt;BR /&gt;&lt;BR /&gt;Now, when I declare a variable A of type MY_TYPE, I want to make sure that the component IS_IT_INITIALIZED is set to .FALSE. and T to 1000 (for instance).&lt;BR /&gt;Is there a way to do this? Or should I manually initialize every new instance of MY_TYPE when I declare it?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;Olivier&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;BR /&gt;Yes you can do it.&lt;BR /&gt;TYPE MY_TYPE&lt;BR /&gt;LOGICAL IS_IT_INITIALIZED = .FALSE.&lt;BR /&gt;INTEGER T = 1000&lt;BR /&gt;...&lt;BR /&gt;END TYPE MY_TYPE&lt;BR /&gt;&lt;BR /&gt;Then TYPE(MY_TYPE) AnOther will take the default values&lt;BR /&gt;&lt;BR /&gt;Les</description>
      <pubDate>Tue, 24 Feb 2009 17:39:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Initialize-a-default-value-for-a-derived-type-component-variable/m-p/895607#M79561</guid>
      <dc:creator>Les_Neilson</dc:creator>
      <dc:date>2009-02-24T17:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: Initialize a default value for a derived type component var</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Initialize-a-default-value-for-a-derived-type-component-variable/m-p/895608#M79562</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
Almost. You need to use:&lt;BR /&gt;&lt;BR /&gt;LOGICAL :: IS_IT_INITIALIZED = .FALSE.&lt;BR /&gt;INTEGER :: T = 1000&lt;BR /&gt;&lt;BR /&gt;If you're going to supply an initial value, the :: delimiter is required.&lt;BR /&gt;</description>
      <pubDate>Tue, 24 Feb 2009 18:10:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Initialize-a-default-value-for-a-derived-type-component-variable/m-p/895608#M79562</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2009-02-24T18:10:50Z</dc:date>
    </item>
    <item>
      <title>Re: Initialize a default value for a derived type component var</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Initialize-a-default-value-for-a-derived-type-component-variable/m-p/895609#M79563</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Aah... that's the thing I was also missing... The "::" delimiter...&lt;BR /&gt;&lt;BR /&gt;Thanks a lot Steve. This is a very convenient feature.&lt;BR /&gt;&lt;BR /&gt;Olivier</description>
      <pubDate>Tue, 24 Feb 2009 19:10:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Initialize-a-default-value-for-a-derived-type-component-variable/m-p/895609#M79563</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2009-02-24T19:10:43Z</dc:date>
    </item>
  </channel>
</rss>

