<?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 Differing types error in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Differing-types-error/m-p/769197#M21709</link>
    <description>Hi Everyone,&lt;BR /&gt;&lt;BR /&gt;I'm new to this forum, I hope I'm keeping up all the guidelines...&lt;BR /&gt;I've been working with a proprietary code, and tried to make a copy of one of the subroutines so that it will receive and return double precision variables instead of real ones. For that purpose, I copied the subroutine itself, a suroutine it calls, and the interface, and changed all the relevant variables and numbers within them to double precision. I've been getting "error #6633: The type of the actual argument differs from the type of the dummy argument", but I have checked and triple-checked that all the variables are declared as double precision. I'm not using any new types, either, only the internal double precision declarations.&lt;BR /&gt;Since the code is proprietary, I can't post it here, and I can't think of a simple way to reproduce the problem. I know that it's impossible to give a solution under such restrictions, and I don't expect one - but I'd really appreciate any ideas that could direct me in the right direction...&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;</description>
    <pubDate>Sat, 05 May 2012 18:27:07 GMT</pubDate>
    <dc:creator>omnia666</dc:creator>
    <dc:date>2012-05-05T18:27:07Z</dc:date>
    <item>
      <title>Differing types error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Differing-types-error/m-p/769197#M21709</link>
      <description>Hi Everyone,&lt;BR /&gt;&lt;BR /&gt;I'm new to this forum, I hope I'm keeping up all the guidelines...&lt;BR /&gt;I've been working with a proprietary code, and tried to make a copy of one of the subroutines so that it will receive and return double precision variables instead of real ones. For that purpose, I copied the subroutine itself, a suroutine it calls, and the interface, and changed all the relevant variables and numbers within them to double precision. I've been getting "error #6633: The type of the actual argument differs from the type of the dummy argument", but I have checked and triple-checked that all the variables are declared as double precision. I'm not using any new types, either, only the internal double precision declarations.&lt;BR /&gt;Since the code is proprietary, I can't post it here, and I can't think of a simple way to reproduce the problem. I know that it's impossible to give a solution under such restrictions, and I don't expect one - but I'd really appreciate any ideas that could direct me in the right direction...&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;</description>
      <pubDate>Sat, 05 May 2012 18:27:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Differing-types-error/m-p/769197#M21709</guid>
      <dc:creator>omnia666</dc:creator>
      <dc:date>2012-05-05T18:27:07Z</dc:date>
    </item>
    <item>
      <title>Differing types error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Differing-types-error/m-p/769198#M21710</link>
      <description>Since you haven't posted any code, we are forced to compose our own examples.&lt;BR /&gt;&lt;BR /&gt;[bash]module mod
   implicit none
   interface
      subroutine sub(x)
         double precision x
      end subroutine sub
   end interface
end module mod

program prog
   use mod
   implicit none
   real x
   x = 1
   call sub(x)
end program prog

recursive subroutine sub(x)
   use mod, other =&amp;gt; sub
   implicit none
   real x
   procedure(other), pointer :: fpp
   fpp =&amp;gt; sub
end subroutine sub
[/bash]&lt;BR /&gt;Here the handwritten interface disagrees with both the actual external subroutine and the calling context. I tried this code with gfortran and got some very nice error messages:&lt;BR /&gt;&lt;BR /&gt;[bash]wrong_type.f90:15.12:

   call sub(x)
            1
Error: Type mismatch in argument 'x' at (1); passed REAL(4) to REAL(8)
wrong_type.f90:23.10:

   fpp =&amp;gt; sub
          1
Error: Interface mismatch in procedure pointer assignment at (1): Type/rank mism
atch in argument 'x'[/bash]&lt;BR /&gt;We can see that for the incorrect invocation in program prog gfortran tells us exactly which argument is mismatched and the nature of the mismatch. Inside subroutine sub we have added the Fortran procedure pointer fpp for the explicit purpose of comparing the interface body to the declarations in sub. Although the error message isn't quite as nice as the one received from program prog it still seems to narrow the possibilities down significantly.&lt;BR /&gt;&lt;BR /&gt;I suggest you try tests like this with ifort or gfortran to see if you can stigmatize some syntax as an error. This may enable you to create a very small example which gives no hint as to the nature of the actual code so that you can post it safely.</description>
      <pubDate>Sun, 06 May 2012 23:54:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Differing-types-error/m-p/769198#M21710</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2012-05-06T23:54:37Z</dc:date>
    </item>
  </channel>
</rss>

