<?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 You could have skipped the in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022794#M108572</link>
    <description>&lt;P&gt;You could have skipped the ALLOCATE if you used -standard-semantics.&lt;/P&gt;

&lt;P&gt;In the case where f is not allocatable, the shapes (dimensions and extents of each dimension) must conform. The compiler needs to decide how many elements to transfer, and it might take that from the left side or from the right. If it decides to take it from the left, 10000 elements, you'll likely run off the end of allocated memory and get the segfault. There are many, many ways to get a segfault and it's not possible to write an article listing each and every one.&lt;/P&gt;

&lt;P&gt;Prior to Fortran 2003, even allocatable arrays followed this rule. But F2003 added the behavior that if an allocatable array was on the left of an assignment, if necessary it was (re)allocated automatically to match the shape of what was assigned to it. We felt that the extra code needed to do this check would unfairly penalize programs that had done explicit allocations, so we did not make the reallocation default. We are discussing changing this behavior in the future, however. -standard-semantics is shorthand for all the options that change default behaviors that aren't F2003 compliant.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Aug 2014 01:10:14 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2014-08-14T01:10:14Z</dc:date>
    <item>
      <title>Array-valued function segmentation error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022791#M108569</link>
      <description>&lt;P&gt;The code below fails with segmentation error unless the arrays "f" and "e" have the same dimension using the Intel Fortran compiler. Appreciate if someone can explain why the array "f" cannot be larger (and much larger) than the array "e." Gfortran does not fail.&lt;/P&gt;

&lt;P&gt;---&lt;/P&gt;

&lt;P&gt;program test_arrfunc1&lt;/P&gt;

&lt;P&gt;! Test of array-valued functions, Aug. 12, 2014.&lt;BR /&gt;
	! Red Hat Enterprise Linux Workstation release 6.5 (Santiago)&lt;BR /&gt;
	! $ ifort --version&lt;BR /&gt;
	! ifort (IFORT) 14.0.1 20131008&lt;BR /&gt;
	! Copyright (C) 1985-2013 Intel Corporation. &amp;nbsp;All rights reserved.&lt;BR /&gt;
	! $ ifort -traceback test_arrfunc1.f90&lt;BR /&gt;
	! $ ./a.out&lt;BR /&gt;
	! forrtl: severe (174): SIGSEGV, segmentation fault occurred&lt;BR /&gt;
	! Image &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PC &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Routine &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Line &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Source &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	! a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;000000000046E269 &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	! a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;000000000046CBE0 &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	! a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;000000000043E872 &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	! a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0000000000423363 &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	! a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0000000000402FCB &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	! libpthread.so.0 &amp;nbsp; &amp;nbsp;0000003E9440F710 &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	! a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0000000000476286 &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	! a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0000000000402CCA &amp;nbsp;MAIN__ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 46 &amp;nbsp;test_arrfunc1.f90&lt;BR /&gt;
	! a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0000000000402BA6 &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	! libc.so.6 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0000003E9401ED1D &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	! a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0000000000402A99 &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	!&lt;BR /&gt;
	! Works when "real(kind=dp),dimension(np) :: f" is defined. Output is here:&lt;BR /&gt;
	! $ ./a.out&lt;BR /&gt;
	! f &amp;nbsp; 1.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3.00000000000000 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	! &amp;nbsp; &amp;nbsp;4.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;6.00000000000000 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	! &amp;nbsp; &amp;nbsp;7.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8.00000000000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9.00000000000000 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	! &amp;nbsp; &amp;nbsp;10.0000000000000 &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; implicit none&lt;/P&gt;

&lt;P&gt;&amp;nbsp; integer,parameter :: i4b = selected_int_kind(9)&lt;BR /&gt;
	&amp;nbsp; integer,parameter :: dp = kind(0.0d0)&lt;/P&gt;

&lt;P&gt;&amp;nbsp; integer(kind=i4b) :: i&lt;BR /&gt;
	&amp;nbsp; integer(kind=i4b),parameter :: np = 10&lt;/P&gt;

&lt;P&gt;&amp;nbsp; real(kind=dp),dimension(np) :: e&lt;BR /&gt;
	! &amp;nbsp;real(kind=dp),dimension(np) :: f &amp;nbsp; &amp;nbsp; ! works&lt;BR /&gt;
	&amp;nbsp; real(kind=dp),dimension(10000) :: f &amp;nbsp; ! fails&lt;/P&gt;

&lt;P&gt;&amp;nbsp; e = (/(i, i=1,np)/) &amp;nbsp; ! generate some values&lt;/P&gt;

&lt;P&gt;&amp;nbsp; ! call array-valued function&lt;BR /&gt;
	&amp;nbsp; f = arrfunc1(e,np)&lt;BR /&gt;
	&amp;nbsp; print *,'f',f(1:np)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; contains&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; function arrfunc1(e,np)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; implicit none&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; integer,parameter :: i4b = selected_int_kind(9)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; integer,parameter :: dp = kind(0.0d0)&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; integer(kind=i4b),intent(in) :: np&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; real(kind=dp),dimension(np),intent(in) :: e&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; real(kind=dp),dimension(np) :: arrfunc1&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; arrfunc1 = e&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; end function arrfunc1&lt;/P&gt;

&lt;P&gt;end program test_arrfunc1&lt;BR /&gt;
	---&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 21:30:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022791#M108569</guid>
      <dc:creator>Roger_D_</dc:creator>
      <dc:date>2014-08-13T21:30:21Z</dc:date>
    </item>
    <item>
      <title>Because your program is not</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022792#M108570</link>
      <description>&lt;P&gt;Because your program is not legal Fortran. Unless f is an allocatable array, the language requires that the shapes of f and e match. They don't, so the results are unpredictable. It might corrupt memory, might access unavailable memory (segfault), or might run without errors. All of these are acceptable by the standard.&lt;/P&gt;

&lt;P&gt;If f is an allocatable, deferred-shape array and you compile with -standard-semantics, it will work in Intel Fortran.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Aug 2014 23:13:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022792#M108570</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-08-13T23:13:51Z</dc:date>
    </item>
    <item>
      <title>Steve,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022793#M108571</link>
      <description>&lt;P&gt;Steve,&lt;/P&gt;

&lt;P&gt;OK. I tried making "f" a deferred shape array and allocated 10000 elements ...&lt;/P&gt;

&lt;P&gt;&amp;nbsp;integer(kind=i4b),parameter :: np = 10&lt;/P&gt;

&lt;P&gt;&amp;nbsp;real(kind=dp),dimension(np) :: e&lt;BR /&gt;
	&amp;nbsp;r&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;eal(kind=dp),dimension(:),allocatable :: f &amp;nbsp; ! works&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;e = (/(i, i=1,np)/) &amp;nbsp; ! generate some values&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; allocate(f(10000))&lt;BR /&gt;
	&amp;nbsp; ! call array-valued function&lt;BR /&gt;
	&amp;nbsp; f = arrfunc1(e,np)&lt;BR /&gt;
	&amp;nbsp; print *,'f',f(1:np)&lt;BR /&gt;
	&amp;nbsp; deallocate(f)&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;It works only if I compile with -standard-semantics as you pointed out. However, coming from old fortran and not an expert on modern fortran this is is indeed confusing, and I did not know this compiler option existed.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I checked all here:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/" target="_blank"&gt;https://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and was unable to understand the root cause. So I thank you very much indeed! If you have any other links useful in this context, please advice.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Roger&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 01:00:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022793#M108571</guid>
      <dc:creator>Roger_D_</dc:creator>
      <dc:date>2014-08-14T01:00:28Z</dc:date>
    </item>
    <item>
      <title>You could have skipped the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022794#M108572</link>
      <description>&lt;P&gt;You could have skipped the ALLOCATE if you used -standard-semantics.&lt;/P&gt;

&lt;P&gt;In the case where f is not allocatable, the shapes (dimensions and extents of each dimension) must conform. The compiler needs to decide how many elements to transfer, and it might take that from the left side or from the right. If it decides to take it from the left, 10000 elements, you'll likely run off the end of allocated memory and get the segfault. There are many, many ways to get a segfault and it's not possible to write an article listing each and every one.&lt;/P&gt;

&lt;P&gt;Prior to Fortran 2003, even allocatable arrays followed this rule. But F2003 added the behavior that if an allocatable array was on the left of an assignment, if necessary it was (re)allocated automatically to match the shape of what was assigned to it. We felt that the extra code needed to do this check would unfairly penalize programs that had done explicit allocations, so we did not make the reallocation default. We are discussing changing this behavior in the future, however. -standard-semantics is shorthand for all the options that change default behaviors that aren't F2003 compliant.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 01:10:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022794#M108572</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-08-14T01:10:14Z</dc:date>
    </item>
    <item>
      <title>I have a much better</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022795#M108573</link>
      <description>&lt;P&gt;I have a much better understanding now ... thanks again. Just a few comments/questions.&lt;/P&gt;

&lt;P&gt;1) Checked the code and it was confirmed that with the allocate statement in place and compiled with -standard-semantics the array "f" is being reallocated (from 10000 to 10 elements).&lt;/P&gt;

&lt;P&gt;2) I removed the allocate statement and it works fine too (when compiled with -standard-semantics). As long as "f" is allocatable the shape (extent) will be the same as the shape from the array function.&lt;/P&gt;

&lt;P&gt;3) Question: Is it important to use the deallocate statement? I have read that it is no longer necessary and memory is released when the function or subroutine exits.&lt;/P&gt;

&lt;P&gt;PS. The code above is of course just a modified snippet of a much larger code (3000 lines in Fortran 77) which I was working on to include a few new procedures. It failed (with segmentation error) due to the issue discussed here. I was also unable to use the debugger (idb). It did not step properly in the called function. It stepped into the routine but then jumped several lines and values did not make sense.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 04:49:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022795#M108573</guid>
      <dc:creator>Roger_D_</dc:creator>
      <dc:date>2014-08-14T04:49:48Z</dc:date>
    </item>
    <item>
      <title>Steve,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022796#M108574</link>
      <description>&lt;P&gt;Steve,&lt;/P&gt;

&lt;P&gt;I know that standards committees are loath to adding new keywords, but I as a user am loath to having behavioral changes in existing code. I think this is a case where there should have been a new keyword introduced:&lt;/P&gt;

&lt;P&gt;real, allocatable :: A(:) ! not reallocatable&lt;/P&gt;

&lt;P&gt;real, reallocatable :: B(:) ! allocatable and reallocatable&lt;/P&gt;

&lt;P&gt;Being an attribute, would likely present no conflict with code.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 12:44:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022796#M108574</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2014-08-14T12:44:04Z</dc:date>
    </item>
    <item>
      <title>Local ALLOCATABLE variables</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022797#M108575</link>
      <description>&lt;P&gt;Local ALLOCATABLE variables that don't have the SAVE attribute are automatically deallocated when they go out of scope. It's good practice to deallocate them explicitly anyway.&lt;/P&gt;

&lt;P&gt;Jim, I'm not in favor of a separate keyword - it just complicates things. My personal opinion is that the overhead of checking is low - perhaps we could have an option to turn it off if deemed necessary. I know the compiler team is very sensitive to anything that affects performance in a negative way, but I feel we need to weigh this against the increasingly frequent surprise of users when Intel Fortran doesn't work the way the standard says it should. Maybe 10+ years ago, when we added this feature, the decision was appropriate, but not now.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 13:54:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022797#M108575</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-08-14T13:54:53Z</dc:date>
    </item>
    <item>
      <title>Steve and Jim,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022798#M108576</link>
      <description>&lt;P&gt;Steve and Jim,&lt;/P&gt;

&lt;P&gt;Thanks to you both! It's good to know that the Intel compiler works fine. I suspected a compiler issue and since I haven't done much modern Fortran programming your comments are insightful to how the Intel compiler works for this issue. And it's good to know that this Forum is active with good support (first time post).&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 14:07:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022798#M108576</guid>
      <dc:creator>Roger_D_</dc:creator>
      <dc:date>2014-08-14T14:07:46Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022799#M108577</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Local ALLOCATABLE variables that don't have the SAVE attribute are automatically deallocated when they go out of scope. It's good practice to deallocate them explicitly anyway.&lt;/P&gt;

&lt;P&gt;...&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;With automatic deallocation or with an explicit deallocation statement, another point to consider is when the compiler actually releases the memory. &amp;nbsp; Steve, can you please comment on what one can expect with Intel Fortran?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;..&lt;/P&gt;

&lt;P&gt;Jim, I'm not in favor of a separate keyword - it just complicates things. My personal opinion is that the overhead of checking is low - perhaps we could have an option to turn it off if deemed necessary. I know the compiler team is very sensitive to anything that affects performance in a negative way, but I feel we need to weigh this against the increasingly frequent surprise of users when Intel Fortran doesn't work the way the standard says it should. Maybe 10+ years ago, when we added this feature, the decision was appropriate, but not now.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I agree with Steve - the chances of a new "REALLOCATABLE" keyword adding to the confusion are indeed high.&lt;/P&gt;

&lt;P&gt;But Steve, re: your statement, "the increasingly frequent surprise of users when Intel Fortran doesn't work the way the standard says it should", I wonder if it is now time for &lt;SPAN style="font-size: 12px; line-height: 18px;"&gt;-standard-semantics to be the default option. &amp;nbsp;What are your and the Intel compiler team's views on this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 14:21:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022799#M108577</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2014-08-14T14:21:01Z</dc:date>
    </item>
    <item>
      <title>It may be interesting to know</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022800#M108578</link>
      <description>&lt;P&gt;It may be interesting to know if Steve can confirm that performance deficits in -standard-semantics have been improved upon for the next release.&amp;nbsp; I suppose I'm in a minority in not using the option because in the past it prevented optimization of MAXLOC/MINLOC.&amp;nbsp;&amp;nbsp; The performance of -assume minus0 (which is needed to conform with f95 and later) has been excellent for several releases.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 15:44:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022800#M108578</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-08-14T15:44:48Z</dc:date>
    </item>
    <item>
      <title>-standard-semantics has a LOT</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022801#M108579</link>
      <description>&lt;P&gt;-standard-semantics has a LOT of effects. We did look at this and realized that we could never make it the default as it would change the meaning of such things as RECL= in an OPEN. But we could make the automatic reallocation default, and we've been doing some testing about that, both for performance and looking for bugs. It might happen for next year's release.&lt;/P&gt;

&lt;P&gt;Another option we've considered making default is -heap-arrays.&lt;/P&gt;

&lt;P&gt;FortranFan, when an allocatable variable is deallocated, we call "free". What happens after that is out of our control.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Aug 2014 16:23:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Array-valued-function-segmentation-error/m-p/1022801#M108579</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2014-08-14T16:23:30Z</dc:date>
    </item>
  </channel>
</rss>

