<?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 Multi-dimensional array pointer points to a 1D array? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769043#M21646</link>
    <description>Easy way - pass X(1) to a subroutine where the argument is declared (1:50000000,1:2) and do what you need there. This can also be done with pointer remapping in version 12 but I'll have to do some experiments first. You can also fake it by using C_F_POINTER(C_LOC(X),P,[50000000,2]) where P is a POINTER with dimension (:,:).&lt;BR /&gt;</description>
    <pubDate>Thu, 09 Dec 2010 01:46:11 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2010-12-09T01:46:11Z</dc:date>
    <item>
      <title>Multi-dimensional array pointer points to a 1D array?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769042#M21645</link>
      <description>I have a a prrety large 1D array allocated. Let us say x(1:100000000). Then I want to use a 2D array pointer y(1:50000000,1:2) to point to x, so I can access array elements in a more meaningful way.&lt;BR /&gt;&lt;BR /&gt;Is there an easy way to do this? I do not want to reallocate memory and copy x to y.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 09 Dec 2010 00:51:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769042#M21645</guid>
      <dc:creator>Yaqi_Wang</dc:creator>
      <dc:date>2010-12-09T00:51:59Z</dc:date>
    </item>
    <item>
      <title>Multi-dimensional array pointer points to a 1D array?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769043#M21646</link>
      <description>Easy way - pass X(1) to a subroutine where the argument is declared (1:50000000,1:2) and do what you need there. This can also be done with pointer remapping in version 12 but I'll have to do some experiments first. You can also fake it by using C_F_POINTER(C_LOC(X),P,[50000000,2]) where P is a POINTER with dimension (:,:).&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Dec 2010 01:46:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769043#M21646</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-12-09T01:46:11Z</dc:date>
    </item>
    <item>
      <title>Multi-dimensional array pointer points to a 1D array?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769044#M21647</link>
      <description>thanks Steve.&lt;BR /&gt;&lt;BR /&gt;Few further questions:&lt;BR /&gt;&lt;BR /&gt;Is the pointer remapping written in Fortran standard?&lt;BR /&gt;&lt;BR /&gt;If I use C_F_POINTER to remap the pointer and later x becomes unaccessable, then can I deallocate memory with ponter Y?&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Dec 2010 02:35:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769044#M21647</guid>
      <dc:creator>Yaqi_Wang</dc:creator>
      <dc:date>2010-12-09T02:35:23Z</dc:date>
    </item>
    <item>
      <title>Multi-dimensional array pointer points to a 1D array?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769045#M21648</link>
      <description>There are a few things that the program below does not test but it looks like pointer remapping is working in IVF 12 update 1.&lt;BR /&gt;&lt;BR /&gt;Abhi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-----&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fxfortran]      Program Test_PointerPartition
         
            !
            ! Purpose: Test bounds remapping for pointers.
            !
         
         Implicit None

         Real(8), Target :: A(0:20), C(22:26)
         
         Real(8), Pointer :: B(:)
         
         Integer, Target  :: G(100)
         Integer, Pointer :: H(:,:)
         
         Integer :: i
         
   !
   !##########
   !

         A = 1.0d0; C = 0.0d0
        

         Nullify(B)
         B =&amp;gt; A(11:20)
         print *, LBOUND(B), UBOUND(B)
         ! correct answer: 1, 10
         
         Nullify(B)
         B =&amp;gt; A
         print *, LBOUND(B), UBOUND(B)
         ! correct answer: 0, 20
         
         Nullify(B)
         B =&amp;gt; A(:)
         print *, LBOUND(B), UBOUND(B)
         ! correct answer: 1, 21

         Nullify(B)
         B =&amp;gt; C
         print *, LBOUND(B), UBOUND(B)
         ! correct answer: 22, 26         
         
         Nullify(B)
         B =&amp;gt; C(:)
         print *, LBOUND(B), UBOUND(B)
         ! correct answer: 1, 5         

         Nullify(B)
         B(51:60) =&amp;gt; A(11:20)
         print *, LBOUND(B), UBOUND(B)
         ! correct answer: 51, 60

         Nullify(B)
         B(1:5) =&amp;gt; C
         print *, LBOUND(B), UBOUND(B)
         ! correct answer: 1, 5 
         
         Nullify(H)
         H(0:24,2:5) =&amp;gt; G
         print *, LBOUND(H), UBOUND(H)
         ! correct answer: {0, 2}, {24,5}
         
         do i=1,Size(G)
            G(i) = i
         end do
         print *, H(5,:)
         ! correct answer: {6,31,56,81}

      End Program Test_PointerPartition[/fxfortran]&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Dec 2010 07:36:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769045#M21648</guid>
      <dc:creator>abhimodak</dc:creator>
      <dc:date>2010-12-09T07:36:50Z</dc:date>
    </item>
    <item>
      <title>Multi-dimensional array pointer points to a 1D array?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769046#M21649</link>
      <description>Pointer remapping is standard F2003. If you create a new pointer with C_F_POINTER you can still deallocate using the original pointer.</description>
      <pubDate>Thu, 09 Dec 2010 15:32:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Multi-dimensional-array-pointer-points-to-a-1D-array/m-p/769046#M21649</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-12-09T15:32:29Z</dc:date>
    </item>
  </channel>
</rss>

