<?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 Subroutine interface problem with pointer in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Subroutine-interface-problem-with-pointer/m-p/787262#M30740</link>
    <description>I Observed some Times problems calling subroutines with pointers to a type as argument. See the simplified source code above.&lt;BR /&gt;The point is, that I have a valid pointer PatItem, before I call the subroutine DataBase_Pat_FindCorrespondingImage&lt;BR /&gt;Inside the subroutine, PatItem becomes invalid, and the program crashes.&lt;BR /&gt;If I put DataBase_Pat_FindCorrespondingImage into a module, than everithing is fine.&lt;BR /&gt;Has anybody an Idea what could be the problem ??&lt;BR /&gt;&lt;BR /&gt;Subroutine DataBase_Pat_FindCorrespondingImage(PatItem,StuItem,SerItem) !Image3D_Dim,pixel_spacing, StuItem,SerItem)&lt;BR /&gt; use VSIM_MESSAGE&lt;BR /&gt; implicit none&lt;BR /&gt; ! input variables&lt;BR /&gt; type(dbPatItem),pointer,intent(in):: PatItem ! Patient to look for an image&lt;BR /&gt; integer(2) Image3D_dim(3) ! image dimensions (x,y,z)&lt;BR /&gt; REAL(8) pixel_spacing(3) ! x,y,z &lt;BR /&gt; ! output variables&lt;BR /&gt; integer(2) iErr ! Error flag&lt;BR /&gt; type(dbStuItem),pointer,intent(out):: StuItem ! Pointer to the study with the right serie&lt;BR /&gt; type(dbSerItem),pointer,intent(out):: SerItem ! Poiinter to the serie containing the found image&lt;BR /&gt; &lt;BR /&gt; ! PatItem has strange values&lt;BR /&gt; nullify(StuItem) ! crash&lt;BR /&gt; nullify(SerItem)&lt;BR /&gt;&lt;BR /&gt; ...&lt;BR /&gt;end subroutine&lt;BR /&gt;&lt;BR /&gt;Subroutine Test(dbase,pat_id,stu_Uid,ser_Uid)&lt;BR /&gt; type(dbPatList) dbase ! database containing information where to find the block-images&lt;BR /&gt; character*(*) pat_id ! patient id&lt;BR /&gt; character*(*) stu_Uid ! study unique identifier&lt;BR /&gt; character*(*) ser_Uid ! serie unique identifier&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; type(dbPatItem),pointer:: PatItem ! Patient to look for an image&lt;BR /&gt;&lt;BR /&gt; call dbPatList_FindItem (dbase%pat_list, pat_id, foundPat,PatItem) ! check if Patient is already in database&lt;BR /&gt; ! PatItem is associated and contains valid values&lt;BR /&gt;call DataBase_Pat_FindCorrespondingImage(iErr, PatItem,VSIM_Image%Image3D_Dim,VSIM_Image%pixel_spacing, StuItem,SerItem)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;end Test&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 24 Nov 2011 09:17:24 GMT</pubDate>
    <dc:creator>jaeger0</dc:creator>
    <dc:date>2011-11-24T09:17:24Z</dc:date>
    <item>
      <title>Subroutine interface problem with pointer</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Subroutine-interface-problem-with-pointer/m-p/787262#M30740</link>
      <description>I Observed some Times problems calling subroutines with pointers to a type as argument. See the simplified source code above.&lt;BR /&gt;The point is, that I have a valid pointer PatItem, before I call the subroutine DataBase_Pat_FindCorrespondingImage&lt;BR /&gt;Inside the subroutine, PatItem becomes invalid, and the program crashes.&lt;BR /&gt;If I put DataBase_Pat_FindCorrespondingImage into a module, than everithing is fine.&lt;BR /&gt;Has anybody an Idea what could be the problem ??&lt;BR /&gt;&lt;BR /&gt;Subroutine DataBase_Pat_FindCorrespondingImage(PatItem,StuItem,SerItem) !Image3D_Dim,pixel_spacing, StuItem,SerItem)&lt;BR /&gt; use VSIM_MESSAGE&lt;BR /&gt; implicit none&lt;BR /&gt; ! input variables&lt;BR /&gt; type(dbPatItem),pointer,intent(in):: PatItem ! Patient to look for an image&lt;BR /&gt; integer(2) Image3D_dim(3) ! image dimensions (x,y,z)&lt;BR /&gt; REAL(8) pixel_spacing(3) ! x,y,z &lt;BR /&gt; ! output variables&lt;BR /&gt; integer(2) iErr ! Error flag&lt;BR /&gt; type(dbStuItem),pointer,intent(out):: StuItem ! Pointer to the study with the right serie&lt;BR /&gt; type(dbSerItem),pointer,intent(out):: SerItem ! Poiinter to the serie containing the found image&lt;BR /&gt; &lt;BR /&gt; ! PatItem has strange values&lt;BR /&gt; nullify(StuItem) ! crash&lt;BR /&gt; nullify(SerItem)&lt;BR /&gt;&lt;BR /&gt; ...&lt;BR /&gt;end subroutine&lt;BR /&gt;&lt;BR /&gt;Subroutine Test(dbase,pat_id,stu_Uid,ser_Uid)&lt;BR /&gt; type(dbPatList) dbase ! database containing information where to find the block-images&lt;BR /&gt; character*(*) pat_id ! patient id&lt;BR /&gt; character*(*) stu_Uid ! study unique identifier&lt;BR /&gt; character*(*) ser_Uid ! serie unique identifier&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; type(dbPatItem),pointer:: PatItem ! Patient to look for an image&lt;BR /&gt;&lt;BR /&gt; call dbPatList_FindItem (dbase%pat_list, pat_id, foundPat,PatItem) ! check if Patient is already in database&lt;BR /&gt; ! PatItem is associated and contains valid values&lt;BR /&gt;call DataBase_Pat_FindCorrespondingImage(iErr, PatItem,VSIM_Image%Image3D_Dim,VSIM_Image%pixel_spacing, StuItem,SerItem)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;end Test&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Nov 2011 09:17:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Subroutine-interface-problem-with-pointer/m-p/787262#M30740</guid>
      <dc:creator>jaeger0</dc:creator>
      <dc:date>2011-11-24T09:17:24Z</dc:date>
    </item>
    <item>
      <title>Subroutine interface problem with pointer</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Subroutine-interface-problem-with-pointer/m-p/787263#M30741</link>
      <description>If a procedure has a dummy argument that is a pointer then an explicit interface must be available in the calling scope. &lt;BR /&gt;&lt;BR /&gt;When you put DataBase_Pat_FindCorrespondingImage into a module that explicit interface is automatically created for you and made availble in any scope that USE's the module. &lt;BR /&gt;&lt;BR /&gt;If you don't want to have that procedure in a module then you will need to manually create the corresponding INTERFACE block.&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Nov 2011 09:58:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Subroutine-interface-problem-with-pointer/m-p/787263#M30741</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2011-11-24T09:58:49Z</dc:date>
    </item>
  </channel>
</rss>

