<?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 Passing allocatable arrays in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969918#M23677</link>
    <description>How do I pass allocatable arrays?  The following code compiles in CVF version 6.6 on NT, but the array is not passed properly from the main routine to subroutine and back. &lt;BR /&gt;Eddie Breeveld &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt;&lt;FONT size="+0"&gt; 
      module generator 
       implicit none 
       interface 
         subroutine WZDMG(WZMPTR) 
          double precision, allocatable :: WZMPTR(:) 
         end subroutine 
       end interface 
      end module 
 
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 
 
      program main 
      use generator 
      implicit none 
      double precision, allocatable :: WZMPTR(:) 
 
      allocate(WZMPTR(1)) 
      wzmptr(1) = 8.7654d0 
      print *,'1: Main', shape(WZMPTR), wzmptr(1) 
      call WZDMG(WZMPTR) 
      print *,'2: Main', shape(WZMPTR), wzmptr(1), wzmptr(99) 
      stop 
      end 
 
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 
 
      subroutine WZDMG(WZMPTR) 
      use generator 
      implicit none 
      double precision, allocatable :: WZMPTR(:) 
 
      print *,'1: wzdmg', shape(WZMPTR), wzmptr(1) 
      allocate(WZMPTR(1000)) 
      WZMPTR(99) = 12.345d0 
      print *,'2: wzdmg', shape(WZMPTR), wzmptr(1), wzmptr(99) 
      return 
      end 
&lt;/FONT&gt; &lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Oct 2001 17:38:14 GMT</pubDate>
    <dc:creator>Intel_C_Intel</dc:creator>
    <dc:date>2001-10-16T17:38:14Z</dc:date>
    <item>
      <title>Passing allocatable arrays</title>
      <link>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969918#M23677</link>
      <description>How do I pass allocatable arrays?  The following code compiles in CVF version 6.6 on NT, but the array is not passed properly from the main routine to subroutine and back. &lt;BR /&gt;Eddie Breeveld &lt;BR /&gt; &lt;BR /&gt;&lt;PRE&gt;&lt;FONT size="+0"&gt; 
      module generator 
       implicit none 
       interface 
         subroutine WZDMG(WZMPTR) 
          double precision, allocatable :: WZMPTR(:) 
         end subroutine 
       end interface 
      end module 
 
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 
 
      program main 
      use generator 
      implicit none 
      double precision, allocatable :: WZMPTR(:) 
 
      allocate(WZMPTR(1)) 
      wzmptr(1) = 8.7654d0 
      print *,'1: Main', shape(WZMPTR), wzmptr(1) 
      call WZDMG(WZMPTR) 
      print *,'2: Main', shape(WZMPTR), wzmptr(1), wzmptr(99) 
      stop 
      end 
 
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc 
 
      subroutine WZDMG(WZMPTR) 
      use generator 
      implicit none 
      double precision, allocatable :: WZMPTR(:) 
 
      print *,'1: wzdmg', shape(WZMPTR), wzmptr(1) 
      allocate(WZMPTR(1000)) 
      WZMPTR(99) = 12.345d0 
      print *,'2: wzdmg', shape(WZMPTR), wzmptr(1), wzmptr(99) 
      return 
      end 
&lt;/FONT&gt; &lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Oct 2001 17:38:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969918#M23677</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-10-16T17:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Passing allocatable arrays</title>
      <link>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969919#M23678</link>
      <description>That &lt;B&gt;compiles&lt;/B&gt;? My CFV5.0D rightfully complains that dummy argument cannot be allocatable, as the standard says. You have to replace ALLOCATABLE attributes with POINTER attributes and it will work.  &lt;BR /&gt; &lt;BR /&gt;Also, note that you have a memory leak in the example -- wzmptr allocated in the PROGRAM can never be deallocated since its association with allocated memory is lost when it's allocated again in the subroutine. &lt;BR /&gt; &lt;BR /&gt;Jugoslav</description>
      <pubDate>Tue, 16 Oct 2001 18:06:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969919#M23678</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2001-10-16T18:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: Passing allocatable arrays</title>
      <link>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969920#M23679</link>
      <description>Great! Thanks Jugoslav &lt;BR /&gt; &lt;BR /&gt;Eddie</description>
      <pubDate>Tue, 16 Oct 2001 18:27:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969920#M23679</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-10-16T18:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Passing allocatable arrays</title>
      <link>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969921#M23680</link>
      <description>Yes, it would compile in 6.6 - 6.6 partially implements a new Fortran 2000 feature called "Allocatable components of derived types" which also permits dummy arguments to be ALLOCATABLE.  There are a number of bugs in the implementation, which is why we haven't documented it yet, though the next update will fix a lot of them.  &lt;BR /&gt;&lt;BR /&gt;Your source looks like it should be ok to me - I'll run it past our expert in this area to see what he thinks.&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Tue, 16 Oct 2001 23:17:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969921#M23680</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2001-10-16T23:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Passing allocatable arrays</title>
      <link>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969922#M23681</link>
      <description>You can work around this problem till the next release by making WZMPTR assumed-shape in the interface block (i.e. get rid of the ALLOCATABLE attribute there) and declaring it to be a POINTER rather than ALLOCATABLE in the actual subroutine.  You will also have to compile the debug version as this doesn't work in the release version.  Of course if you implement this workaround you should comment these illegal declarations so that you can find them easily when CVF fixes the bug(s) you are working around.  Probably you are better off making everything POINTERs for now.</description>
      <pubDate>Wed, 17 Oct 2001 04:01:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969922#M23681</guid>
      <dc:creator>Intel_C_Intel</dc:creator>
      <dc:date>2001-10-17T04:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Passing allocatable arrays</title>
      <link>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969923#M23682</link>
      <description>James or Steve or ..., &lt;BR /&gt;I have dang little experience using pointers in CVF. &lt;BR /&gt;Is there a complete example of how to pass allocatable array using pointers all within docuemented implementation of CVF6.6? &lt;BR /&gt;I especially cannot use the debug code since the compuations get too slow unoptimized.</description>
      <pubDate>Tue, 13 Nov 2001 05:01:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Passing-allocatable-arrays/m-p/969923#M23682</guid>
      <dc:creator>rahzan</dc:creator>
      <dc:date>2001-11-13T05:01:15Z</dc:date>
    </item>
  </channel>
</rss>

