<?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: Passing a contiguous allocatable array section to a explici in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-a-contiguous-allocatable-array-section-to-a-explicit/m-p/897700#M80101</link>
    <description>&lt;P&gt;Olivier,&lt;/P&gt;
&lt;P&gt;Consider using&lt;/P&gt;
&lt;P&gt;CALL SUB(M(:,1), size(M(:,1)))&lt;/P&gt;
&lt;P&gt;This reduces potential for error in the event the allocation is changed without changing N.&lt;/P&gt;
&lt;P&gt;The is nothing wrong with using the N as you had before... &lt;BR /&gt;&lt;EM&gt;as long as the N isn't reused with different values for different arr&lt;/EM&gt;ays. &lt;/P&gt;
&lt;P&gt;The above syntax should be within a few memory cycles of using N.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Aug 2008 18:13:49 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2008-08-26T18:13:49Z</dc:date>
    <item>
      <title>Passing a contiguous allocatable array section to a explicit shape array</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-a-contiguous-allocatable-array-section-to-a-explicit/m-p/897698#M80099</link>
      <description>&lt;P&gt;&lt;FONT face="Arial"&gt;Is passing a contiguous array section of an allocatable array to a subroutine where the corresponding dummy argument is an explicit shape array efficient? In other words, is a temporary array created?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;Consider the following example:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;PROGRAM PROG&lt;BR /&gt;INTEGER(4) N,P&lt;/FONT&gt;&lt;FONT face="Arial"&gt;&lt;BR /&gt;REAL(8),ALLOCATABLE :: M(:,:)&lt;BR /&gt;! Allocate and initialize M(N,P)&lt;BR /&gt;CALL SUB(M(:,1),N)&lt;/FONT&gt;&lt;FONT face="Arial"&gt;&lt;BR /&gt;END PROGRAM PROG&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;SUBROUTINE SUB(A,SIZE)&lt;BR /&gt;INTEGER(4) SIZE&lt;BR /&gt;REAL(8) A(SIZE)&lt;BR /&gt;! Do some work here...&lt;BR /&gt;END SUBROUTINE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;Is this efficient? Is the array passed by address or by value in SUB (in the later case a copy of the array section would need to be done I suppose).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;How does the compiler recognize that the data (the array section) is contiguous?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;Olivier&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Aug 2008 14:39:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-a-contiguous-allocatable-array-section-to-a-explicit/m-p/897698#M80099</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2008-08-26T14:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a contiguous allocatable array section to a explici</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-a-contiguous-allocatable-array-section-to-a-explicit/m-p/897699#M80100</link>
      <description>The compiler does a run-time test and creates the copy only if needed. To test this, add the /check:arg_temp_created option (Run-Time - Check for actual arguments using temporary storage) and see if you get a run-time warning when the call is made.&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Aug 2008 15:54:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-a-contiguous-allocatable-array-section-to-a-explicit/m-p/897699#M80100</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2008-08-26T15:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a contiguous allocatable array section to a explici</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-a-contiguous-allocatable-array-section-to-a-explicit/m-p/897700#M80101</link>
      <description>&lt;P&gt;Olivier,&lt;/P&gt;
&lt;P&gt;Consider using&lt;/P&gt;
&lt;P&gt;CALL SUB(M(:,1), size(M(:,1)))&lt;/P&gt;
&lt;P&gt;This reduces potential for error in the event the allocation is changed without changing N.&lt;/P&gt;
&lt;P&gt;The is nothing wrong with using the N as you had before... &lt;BR /&gt;&lt;EM&gt;as long as the N isn't reused with different values for different arr&lt;/EM&gt;ays. &lt;/P&gt;
&lt;P&gt;The above syntax should be within a few memory cycles of using N.&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Aug 2008 18:13:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-a-contiguous-allocatable-array-section-to-a-explicit/m-p/897700#M80101</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2008-08-26T18:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Passing a contiguous allocatable array section to a explici</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-a-contiguous-allocatable-array-section-to-a-explicit/m-p/897701#M80102</link>
      <description>&lt;P&gt;&lt;FONT face="Arial"&gt;Thank you Jim and Steve for your help. I found the run-time check solution proposed by Steve a very valuable tool.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Arial"&gt;Olivier&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Aug 2008 18:49:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Passing-a-contiguous-allocatable-array-section-to-a-explicit/m-p/897701#M80102</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2008-08-26T18:49:13Z</dc:date>
    </item>
  </channel>
</rss>

