<?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 Dummy array size (fake dynamic mem alloc in fortran77) in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757341#M12828</link>
    <description>Thanks for all the replies! Yes, i would normally be using 95+ and use ALLOCATE/DEALLOCATE but I just came across this and was wondering if it was ripe for producing undesirable behavior, e.g. stack corruption.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
    <pubDate>Wed, 31 Aug 2011 18:17:32 GMT</pubDate>
    <dc:creator>wolfpackNC</dc:creator>
    <dc:date>2011-08-31T18:17:32Z</dc:date>
    <item>
      <title>Dummy array size (fake dynamic mem alloc in fortran77)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757338#M12825</link>
      <description>I'm guessing that this is clearly not good code??? But yet it compiles and runs. If n gets to big then we get seg fault (core dump)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;but, Will somebody explain how I am able to create array 'c' of variable size in fortran 77 and store values in it. Should this be illegal?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;program foo2&lt;BR /&gt; implicit none&lt;BR /&gt; &lt;BR /&gt; integer n&lt;BR /&gt;&lt;BR /&gt; n=300&lt;BR /&gt;&lt;BR /&gt; call bar(n)&lt;BR /&gt;&lt;BR /&gt; end program&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; subroutine bar(m)&lt;BR /&gt; implicit none&lt;BR /&gt;&lt;BR /&gt; real*8 c(m,m)&lt;BR /&gt; integer m,i,j&lt;BR /&gt;&lt;BR /&gt; do i=1,m&lt;BR /&gt; do j=1,m&lt;BR /&gt; c(i,j)=2.0d0&lt;BR /&gt; enddo&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; do i=1,m&lt;BR /&gt; do j=1,m&lt;BR /&gt; write(*,*)'HOW??',c(i,j)&lt;BR /&gt; enddo&lt;BR /&gt; enddo&lt;BR /&gt;&lt;BR /&gt; end subroutine</description>
      <pubDate>Tue, 30 Aug 2011 23:46:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757338#M12825</guid>
      <dc:creator>wolfpackNC</dc:creator>
      <dc:date>2011-08-30T23:46:00Z</dc:date>
    </item>
    <item>
      <title>Dummy array size (fake dynamic mem alloc in fortran77)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757339#M12826</link>
      <description>That is probably because you run out of stack space. You could increase stack size (bash: ulimit -s hard), or compile with the -heap-arrays compiler option, or use allocatable arrays (not in Fortran 77).</description>
      <pubDate>Wed, 31 Aug 2011 08:02:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757339#M12826</guid>
      <dc:creator>tom_p</dc:creator>
      <dc:date>2011-08-31T08:02:19Z</dc:date>
    </item>
    <item>
      <title>Dummy array size (fake dynamic mem alloc in fortran77)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757340#M12827</link>
      <description>The automatic array extension was not part of Fortran 77, although several compilers supported it (some with very limited size). Fortran 77 didn't require compilers to have a means for flagging extensions they supported.&lt;BR /&gt;Nesting the loops backwards was bad in all versions of Fortran; even a few F77 compilers might have tried to fix this for you.&lt;BR /&gt;Also, yes, it's better style to use ALLOCATE with an appropriate error message in case of failure, which will tell you immediately where the fault occurred, should you exceed stack limits in a real program. You'll have difficulty with useability of any compiler which lies in the transition between f77 and f90 where automatic was supported but allocatable was not. Yes, I know some such may be left over from a decade ago.&lt;BR /&gt;</description>
      <pubDate>Wed, 31 Aug 2011 12:31:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757340#M12827</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2011-08-31T12:31:51Z</dc:date>
    </item>
    <item>
      <title>Dummy array size (fake dynamic mem alloc in fortran77)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757341#M12828</link>
      <description>Thanks for all the replies! Yes, i would normally be using 95+ and use ALLOCATE/DEALLOCATE but I just came across this and was wondering if it was ripe for producing undesirable behavior, e.g. stack corruption.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Wed, 31 Aug 2011 18:17:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757341#M12828</guid>
      <dc:creator>wolfpackNC</dc:creator>
      <dc:date>2011-08-31T18:17:32Z</dc:date>
    </item>
    <item>
      <title>Dummy array size (fake dynamic mem alloc in fortran77)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757342#M12829</link>
      <description>This will not cause stack corruption, unless your code writes out of bounds of the dummy array. A segment fault (running out of stack) is not stack corruption - it is a resource limitation.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Wed, 31 Aug 2011 18:28:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Dummy-array-size-fake-dynamic-mem-alloc-in-fortran77/m-p/757342#M12829</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2011-08-31T18:28:23Z</dc:date>
    </item>
  </channel>
</rss>

