<?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 The problem is that a in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083683#M122521</link>
    <description>&lt;P&gt;The problem is that a subscript of (:,:,1) is &lt;STRONG&gt;always &lt;/STRONG&gt;contiguous for an array that started out as contiguous, which, if the declaration shown is representative, is the case. I would very much like to see an actual test case, as I suspect there is something important that hasn't been shown.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Jan 2016 19:59:39 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2016-01-13T19:59:39Z</dc:date>
    <item>
      <title>Temporary array creation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083673#M122511</link>
      <description>&lt;P&gt;I'm getting the famous warning of a temporary array created,&amp;nbsp;forrtl: warning (406): fort: (1): In call to XXXX, an array temporary was created for argument #N. However, I create simple code to mimic the larger code, and I don't get the same warning. See code below. Essentially I'm passing in a subset array into subroutine XXXX, and indexing on the last index, which should give me a contiguous memory chunk. What else could cause this temporary array creation?&amp;nbsp;ifort version 16.0.0&lt;/P&gt;

&lt;P&gt;&lt;STRONG style="font-size: 1em; line-height: 1.5;"&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program testArrayPassSubroutine                                                 
        integer :: sze,i                                                        
        real, dimension(3,3,2) :: arr
        real, dimension(2,3,3) :: arr2

        !do k=1,2
        !       do j=1,3
        !               do i=1,3
        !                       arr(i,j,k) = (k-1)*9 + (j-1)*3 + i
        !               enddo
        !       enddo
        !enddo

        !do k=1,3
        !        do j=1,3
        !                do i=1,2
        !                        arr2(i,j,k) = (k-1)*9 + (j-1)*3 + i
        !                enddo
        !        enddo
        !enddo

        !This is like the original code, which throws the warning(406):...temporary array creation
        write(*,*) "Test1 start"
        call test(arr(:,:,1))
        write(*,*) "Test1 done"

        !This is where I would expect a warning(406), and indeed see it
        write(*,*) "Test2 start"
        call test(arr2(1,:,:))
        write(*,*) "Test2 done"

        contains
        subroutine test(a)
        integer :: i,j
        real, dimension(3,3) :: a

        do i=1,3
                do j=1,3
                        a(j,i) = j*i
                enddo
        enddo

        write(*,*) "Array",(a)
        write(*,*) ""
        end subroutine test
end program testArrayPassSubroutine
&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Output:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Test1 start&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;Array &amp;nbsp; 1.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;4.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 6.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 6.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 9.000000&lt;/P&gt;

&lt;P&gt;&amp;nbsp;Test1 done&lt;BR /&gt;
	&amp;nbsp;Test2 start&lt;BR /&gt;
	forrtl: warning (406): fort: (1): In call to TEST, an array temporary was created for argument #1&lt;/P&gt;

&lt;P&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&lt;BR /&gt;
	a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0000000000403876 &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;0000000000400689 &amp;nbsp;MAIN__ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 29 &amp;nbsp;testArrayPassSubroutine.F90&lt;BR /&gt;
	a.out &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;00000000004004AE &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;000000000048D9F1 &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;0000000000400389 &amp;nbsp;Unknown &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Unknown &amp;nbsp;Unknown&lt;BR /&gt;
	&amp;nbsp;Array &amp;nbsp; 1.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 2.000000&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;4.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 6.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 3.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 6.000000 &amp;nbsp; &amp;nbsp; &amp;nbsp; 9.000000&lt;/P&gt;

&lt;P&gt;&amp;nbsp;Test2 done&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 14:29:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083673#M122511</guid>
      <dc:creator>Michael_C_5</dc:creator>
      <dc:date>2016-01-12T14:29:31Z</dc:date>
    </item>
    <item>
      <title>Your output shows no array</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083674#M122512</link>
      <description>&lt;P&gt;Your output shows no array temporary in Test1 (expected result). Section arr(:,:,1) is contiguous&lt;/P&gt;

&lt;P&gt;And shows array temporary in Test 2 (expected result). Section arr2(1,:,:) is not contiguous.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 17:27:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083674#M122512</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-01-12T17:27:01Z</dc:date>
    </item>
    <item>
      <title>Yes, that's the point,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083675#M122513</link>
      <description>&lt;P&gt;Yes, that's the point, perhaps my code comments weren't clear. This code is derived from a larger code. The larger code effectively does Test1, which as this smaller code shows should not create array temporarys. But for some reason in the larger code I am getting an array temporary. Is there another reason array temporary's would be created?&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 17:54:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083675#M122513</guid>
      <dc:creator>Michael_C_5</dc:creator>
      <dc:date>2016-01-12T17:54:18Z</dc:date>
    </item>
    <item>
      <title>Generally, if the thing you</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083676#M122514</link>
      <description>&lt;P&gt;Generally, if the thing you're passing is not contiguous and the called routine expects contiguity, a copy will be made. My guess is that you are not correctly representing what the "larger code" does. I do know that there are some cases where the compiler doesn't even check and always makes a copy. The cases I have seen are where the index expressions include derived-type components, and should be improved in future versions.&lt;/P&gt;

&lt;P&gt;Please show us the actual call line that makes the copy.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 18:00:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083676#M122514</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-01-12T18:00:49Z</dc:date>
    </item>
    <item>
      <title>OK, here is a snippet of the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083677#M122515</link>
      <description>&lt;P style="font-size: 13.008px; line-height: 19.512px;"&gt;OK, here is a snippet of the larger code, I've tried to reduce it to the call and variables being passed in, hopefully this is clear enough. The warning is on the call col_f_f_df in the main subroutine.&lt;/P&gt;

&lt;P style="font-size: 13.008px; line-height: 19.512px;"&gt;There is a derived-type object (ci) being passed in, and in the subroutine indexed and input into the array being complained about (fi_half, through delr). Could this be the reason?&lt;/P&gt;

&lt;P style="font-size: 13.008px; line-height: 19.512px;"&gt;&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;subroutine main()
...
real (kind=8), dimension(col_f_nvr, col_f_nvz) :: dist_ni,dfi, dist_iteri   ! local
real (kind=8),dimension((col_f_nvr-1),(col_f_nvz-1),2) :: fi_half,dfidr,dfidz,fe_half,dfedr,dfedz
...
type(col_f_core_type) :: ci, ce

...
do iter_inter=1, vpic_inner_iter_max
	...
	call col_f_f_df(ci, 1, dist_iteri, fi_half(:,:,1), dfidr(:,:,1), dfidz(:,:,1))  !i-i
	...
enddo



subroutine col_f_f_df(cs, op_mode, f, f_half, dfdr, dfdz)
...

type(col_f_core_type), intent(in) :: cs
integer, intent(in) :: op_mode
real(kind=8) :: mesh_dr, mesh_dz
real(kind=8), dimension(col_f_nvr, col_f_nvz) :: f
real(kind=8), dimension(col_f_nvr-1, col_f_nvz-1) :: f_half, dfdr, dfdz
real(kind=8) :: tmpr1, tmpr2, tmpr3, tmpr4
integer :: index_I, index_J
real (kind=8) :: delr, cdelr, delz, cdelz

do index_I=1,col_f_nvz-1
       do index_J=1, col_f_nvr-1
       	   delr = cs%delta_r(index_J,op_mode)
           cdelr = 1D0-delr
           delz = cs%delta_z(index_I,op_mode)
           cdelz = 1D0-delz

           tmpr1 = f(index_J, index_I)
           tmpr2 = f(index_J+1, index_I)
           tmpr3 = f(index_J,index_I+1)
           tmpr4 = f(index_J+1,index_I+1)
       		f_half(index_J, index_I) = tmpr1 * delr*delz &amp;amp;
                                     + tmpr3 * delr*cdelz &amp;amp;
                                     + tmpr2 * cdelr*delz &amp;amp;
                                     + tmpr4 * cdelr*cdelz

			...
		enddo
enddo


&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 19:56:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083677#M122515</guid>
      <dc:creator>Michael_C_5</dc:creator>
      <dc:date>2016-01-12T19:56:26Z</dc:date>
    </item>
    <item>
      <title>What is the message that</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083678#M122516</link>
      <description>&lt;P&gt;What is the message that comes out - which argument does it complain about? &amp;nbsp;How you fill in the arrays is of no consequence.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 21:29:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083678#M122516</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-01-12T21:29:07Z</dc:date>
    </item>
    <item>
      <title>It's the fourth argument, fi</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083679#M122517</link>
      <description>&lt;P&gt;It's the fourth argument, fi_half:&lt;/P&gt;

&lt;P&gt;forrtl: warning (406): fort: (1): In call to COL_F_F_DF, an array temporary was created for argument #4&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 16:28:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083679#M122517</guid>
      <dc:creator>Michael_C_5</dc:creator>
      <dc:date>2016-01-13T16:28:07Z</dc:date>
    </item>
    <item>
      <title>Sorry, its the fourth, fifth,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083680#M122518</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Sorry, its the fourth, fifth, and sixth (I'm using MPI, so several warning show up, esp. since this is in a loop):&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;forrtl: warning (406): fort: (1): In call to COL_F_F_DF, an array temporary was created for argument #4&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;forrtl: warning (406): fort: (1): In call to COL_F_F_DF, an array temporary was created for argument #5&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;forrtl: warning (406): fort: (1): In call to COL_F_F_DF, an array temporary was created for argument #6&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 16:35:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083680#M122518</guid>
      <dc:creator>Michael_C_5</dc:creator>
      <dc:date>2016-01-13T16:35:42Z</dc:date>
    </item>
    <item>
      <title>How and where are col_f_nvr</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083681#M122519</link>
      <description>&lt;P&gt;How and where are col_f_nvr and col_f_nvz declared? I haven't been able yet to construct a test case that reproduces the problem.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 18:50:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083681#M122519</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-01-13T18:50:50Z</dc:date>
    </item>
    <item>
      <title>Quote:Michael C. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083682#M122520</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Michael C. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Sorry, its the fourth, fifth, and sixth (I'm using MPI, so several warning show up, esp. since this is in a loop):&lt;/P&gt;

&lt;P&gt;forrtl: warning (406): fort: (1): In call to COL_F_F_DF, an array temporary was created for argument #4&lt;BR /&gt;
	forrtl: warning (406): fort: (1): In call to COL_F_F_DF, an array temporary was created for argument #5&lt;BR /&gt;
	forrtl: warning (406): fort: (1): In call to COL_F_F_DF, an array temporary was created for argument #6&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Looking at your code snippet in Message #5, it seems as though you might be doing something along the lines in the code shown below. &amp;nbsp;In such cases, as explained by Jim and Steve, the compiler might suspect the array section is not contiguous and add code to create an array temporary. &amp;nbsp;As Steve indicated, you need to supply a proper reproducer or share actual code with Intel to get good advice.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program p

   implicit none

   integer, parameter :: M = 3
   integer :: N

   real :: r(M,M,2)

   N = M-1

   call foo( r(1:N,1:N,:) )

   print *, " r = ", r

   stop

contains

   subroutine foo( r )

      real, intent(inout) :: r(N,N,2)  !.. N is some host-associated variable

      integer :: i

      do i = 1, size(r, dim=3)
         call bar( r(:,:,i) )
      end do

      return

   end subroutine foo

   subroutine bar( s )

      real, intent(inout) :: s(N,N)   !.. N is some host-associated variable

      s = 0.0

      return

   end subroutine bar

end program
&lt;/PRE&gt;

&lt;P&gt;Upon execution on Windows,&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;forrtl: warning (406): fort: (1): In call to FOO, an array temporary was created
 for argument #1

Image              PC                Routine            Line        Source

p64.exe            000000013FE152DE  Unknown               Unknown  Unknown
p64.exe            000000013FE11197  MAIN__                     12  p.f90
p64.exe            000000013FEAD77E  Unknown               Unknown  Unknown
p64.exe            000000013FEAE0AC  Unknown               Unknown  Unknown
p64.exe            000000013FEAE1EE  Unknown               Unknown  Unknown
kernel32.dll       0000000076F859DD  Unknown               Unknown  Unknown
ntdll.dll          00000000771BA631  Unknown               Unknown  Unknown
  r =  0.000000 0.000000 0.000000 0.000000
 0.000000 0.000000 0.000000 0.000000 0.000000
 0.000000 0.000000 0.000000 0.000000 0.000000
 0.000000 0.000000 0.000000 0.000000
Press any key to continue . . .&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 19:39:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083682#M122520</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2016-01-13T19:39:05Z</dc:date>
    </item>
    <item>
      <title>The problem is that a</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083683#M122521</link>
      <description>&lt;P&gt;The problem is that a subscript of (:,:,1) is &lt;STRONG&gt;always &lt;/STRONG&gt;contiguous for an array that started out as contiguous, which, if the declaration shown is representative, is the case. I would very much like to see an actual test case, as I suspect there is something important that hasn't been shown.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 19:59:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083683#M122521</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-01-13T19:59:39Z</dc:date>
    </item>
    <item>
      <title>In your #10 example, N is not</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083684#M122522</link>
      <description>&lt;P&gt;In your #10 example, N is not the full size of the first two dimensions of r.&lt;/P&gt;

&lt;P&gt;You requested to transmit r(1:M-1,1:M-1,i)&amp;nbsp; i=1,2&lt;/P&gt;

&lt;P&gt;Where M is the size of the first two dimensions of r. This section is not contiguous because&lt;/P&gt;

&lt;P&gt;sections r(M,1:M,i) and r(1:M,M,i) (last row and last column) are not passed (thus must be effectively compressed out via temporary).&lt;/P&gt;

&lt;P&gt;If you want to avoid the array temporary, pass the entire array section (1:M,1:M,i) to foo. Perform similar fix to bar.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 21:33:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083684#M122522</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2016-01-13T21:33:35Z</dc:date>
    </item>
    <item>
      <title>#10 is FortranFan's. He's</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083685#M122523</link>
      <description>&lt;P&gt;#10 is FortranFan's. He's trying to help, but his example isn't representative of Michael C's code as shown in this thread.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 21:44:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083685#M122523</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-01-13T21:44:15Z</dc:date>
    </item>
    <item>
      <title>Quote:jimdempseyatthecove</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083686#M122524</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;jimdempseyatthecove wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;In your #10 example, N is not the full size of the first two dimensions of r. ..&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P style="font-size: 13.008px; line-height: 19.512px;"&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Steve Lionel (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P style="font-size: 13.008px; line-height: 19.512px;"&gt;#10 is FortranFan's. He's trying to help, but his example isn't representative of Michael C's code as shown in this thread.&lt;/P&gt;

&lt;P style="font-size: 13.008px; line-height: 19.512px;"&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Yes, as mentioned by Steve, I was simply trying to suggest to OP that information on array dimensions (col_f_nvr, col_f_nvz) and how they are defined need to be provided as they do play a role, as shown by the simple code in Message #10.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 21:56:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083686#M122524</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2016-01-13T21:56:45Z</dc:date>
    </item>
    <item>
      <title>Quote:Steve Lionel (Intel)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083687#M122525</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;How and where are col_f_nvr and col_f_nvz declared? I haven't been able yet to construct a test case that reproduces the problem.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;There is a module read in at the beginning of the subroutine I called "main":&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;subroutine main()
use col_f_module
&lt;/PRE&gt;

&lt;P&gt;In col_f_module are defined col_f_nvr and col_f_nvz:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;integer :: col_f_nvr, col_f_nvz&lt;/PRE&gt;

&lt;P&gt;And they are instantiated in a setup routine called prior to this "main" subroutine (sorry, shouldn't have used "main" for the subroutine name). Values are derived from an input file; for the simulation I'm running they are:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;col_f_nvr = 32
col_f_nvz = 31&lt;/PRE&gt;

&lt;P&gt;After the initial setup, these never change, so I don't think it should be an issue pointed out in #10.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 22:22:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083687#M122525</guid>
      <dc:creator>Michael_C_5</dc:creator>
      <dc:date>2016-01-13T22:22:00Z</dc:date>
    </item>
    <item>
      <title>Quote:Michael C. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083688#M122526</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Michael C. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;.. In col_f_module are defined col_f_nvr and col_f_nvz: ..&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;After the initial setup, these never change, so I don't think it should be an issue pointed out in #10.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;I think your situation is akin to:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program p

   implicit none

   integer :: N

   N = 3

   call foo()

   stop

contains

   subroutine foo( )

      real :: r((N-1),(N-1),2)

      call bar( r(:,:,1) )

      return

   end subroutine foo

   subroutine bar( s )

      real, intent(inout) :: s(N-1,N-1)

      s = 0.0

      return

   end subroutine bar

end program&lt;/PRE&gt;

&lt;P&gt;Upon execution on Windows,&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;forrtl: warning (406): fort: (1): In call to BAR, an array temporary was created
 for argument #1

Image              PC                Routine            Line        Source

p64.exe            000000013FAF827E  Unknown               Unknown  Unknown
p64.exe            000000013FAF128C  P_ip_FOO                   19  p.f90
p64.exe            000000013FAF1040  MAIN__                      9  p.f90
p64.exe            000000013FB84C7E  Unknown               Unknown  Unknown
p64.exe            000000013FB855AC  Unknown               Unknown  Unknown
p64.exe            000000013FB856EE  Unknown               Unknown  Unknown
kernel32.dll       0000000076F859DD  Unknown               Unknown  Unknown
ntdll.dll          00000000771BA631  Unknown               Unknown  Unknown
Press any key to continue . . .&lt;/PRE&gt;

&lt;P&gt;Note if one makes a small change to code as shown below, no run-time warning about array temporary is issued:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program p

   implicit none

   integer :: N
   integer :: M

   N = 3
   M = N-1

   call foo()

   stop

contains

   subroutine foo( )

      real :: r(M,M,2)

      call bar( r(:,:,1) )

      return

   end subroutine foo

   subroutine bar( s )

      real, intent(inout) :: s(M,M)

      s = 0.0

      return

   end subroutine bar

end program&lt;/PRE&gt;

&lt;P&gt;I think I have noticed this before. &amp;nbsp;I'll leave it up to you and Intel to follow-up.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 22:41:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083688#M122526</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2016-01-13T22:41:30Z</dc:date>
    </item>
    <item>
      <title>Or you can consider the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083689#M122527</link>
      <description>&lt;P&gt;Or you can consider the following:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;module m

   implicit none

   integer :: N

end module m

subroutine foo( )

   use m, only : N

   real :: r((N-1),(N-1),2)

   call bar( r(:,:,1) )

   return

end subroutine foo

subroutine bar( s )

   use m, only : N

   real, intent(inout) :: s(N-1,N-1)

   s = 0.0

   return

end subroutine bar
&lt;/PRE&gt;

&lt;PRE class="brush:fortran;"&gt;program p

   use m, only : N

   implicit none

   N = 3

   call foo()

   stop

end program
&lt;/PRE&gt;

&lt;P&gt;Upon execution,&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;forrtl: warning (406): fort: (1): In call to BAR, an array temporary was created
 for argument #1

Image              PC                Routine            Line        Source

p64.exe            000000013F78427E  Unknown               Unknown  Unknown
p64.exe            000000013F781325  FOO                        15  m.f90
p64.exe            000000013F78198C  MAIN__                      9  p.f90
p64.exe            000000013F814C3E  Unknown               Unknown  Unknown
p64.exe            000000013F81556C  Unknown               Unknown  Unknown
p64.exe            000000013F8156AE  Unknown               Unknown  Unknown
kernel32.dll       0000000076F859DD  Unknown               Unknown  Unknown
ntdll.dll          00000000771BA631  Unknown               Unknown  Unknown
Press any key to continue . . .&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 22:47:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083689#M122527</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2016-01-13T22:47:11Z</dc:date>
    </item>
    <item>
      <title>Quote:Michael C. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083690#M122528</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Michael C. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;..&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;subroutine main()
...
real (kind=8), dimension(col_f_nvr, col_f_nvz) :: dist_ni,dfi, dist_iteri   ! local
real (kind=8),dimension((col_f_nvr-1),(col_f_nvz-1),2) :: fi_half,dfidr,dfidz,fe_half,dfedr,dfedz
...
..
&lt;SPAN style="font-family: Arial, 宋体, Tahoma, Helvetica, sans-serif; font-size: 1em; line-height: 1.5;"&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-family: Arial, 宋体, Tahoma, Helvetica, sans-serif; font-size: 1em; line-height: 1.5;"&gt;Try removing the parenthesis around col_f_nvr-1 and col_f_nvz-1 in your actual code!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2016 22:51:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083690#M122528</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2016-01-13T22:51:14Z</dc:date>
    </item>
    <item>
      <title>Thanks to FortranFan for</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083691#M122529</link>
      <description>&lt;P&gt;Thanks to FortranFan for coming up with a complete reproducer. I have escalated this as issue&amp;nbsp;DPD200380709. Indeed, the parentheses in the declaration trigger the problem - apparently the compiler decides that the declaration is "too complex" to do the run-time test, even though the subscript syntax in the call should indicate that the argument will always be contiguous.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 16:56:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083691#M122529</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-01-14T16:56:48Z</dc:date>
    </item>
    <item>
      <title>Yes, thanks FortranFan,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083692#M122530</link>
      <description>&lt;P&gt;Yes, thanks FortranFan, removing the parenthesis removed the array temporary warning. Thanks to all for looking into this.&lt;/P&gt;

&lt;P&gt;Just to be sure, this was just a bug in the warning system from the compiler right? There weren't actually array temporarys being created, correct?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2016 18:18:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Temporary-array-creation/m-p/1083692#M122530</guid>
      <dc:creator>Michael_C_5</dc:creator>
      <dc:date>2016-01-14T18:18:09Z</dc:date>
    </item>
  </channel>
</rss>

