<?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 Argument checking is not working in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818738#M46570</link>
    <description>Instead consider going through your source and grouping related procedures (particularly from the point of view of how they are used) together into a module. Having lots and lots of "little" modules (each with one subroutine) just creates complexity without any benefit.&lt;BR /&gt;</description>
    <pubDate>Tue, 22 May 2012 21:25:31 GMT</pubDate>
    <dc:creator>IanH</dc:creator>
    <dc:date>2012-05-22T21:25:31Z</dc:date>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818729#M46561</link>
      <description>Hi there,&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I have an intel fortran project with a subroutine (Lets call it sub A) that calls another subroutine (sub B).&lt;/DIV&gt;&lt;DIV&gt;If I add a dummy argument to sub B, clean and rebuild, I get a nice Build succeeded, for example:&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;[fortran]subroutine A(l, j)
implicit none
integer, intent(in):: l, j

call B(l,j)

endsubroutine[/fortran] &lt;/DIV&gt;&lt;DIV&gt;but B now is something like&lt;/DIV&gt;&lt;DIV&gt;[fortran]subroutine B(l, j, k)
implicit none
integer, intent(in):: l, j
integer, intent(out):: k

k = l+j

endsubroutine[/fortran] &lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Is there anyway the compiler can tell me about this?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I have&lt;B&gt;/warn:interfaces &lt;/B&gt;and&lt;B&gt;/gen-interfaces &lt;/B&gt;as is explained in this thread:&lt;/DIV&gt;&lt;DIV&gt;&lt;A href="http://software.intel.com/en-us/forums/showthread.php?t=75790"&gt;http://software.intel.com/en-us/forums/showthread.php?t=75790&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;but still nothing!&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I haveIntel Visual Fortran Compiler Professional 11.1.048&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Any idea? it is really painfull to check by hand!&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 May 2012 18:23:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818729#M46561</guid>
      <dc:creator>bcartolo</dc:creator>
      <dc:date>2012-05-21T18:23:32Z</dc:date>
    </item>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818730#M46562</link>
      <description>&lt;P&gt;How are you compiling the program? Subroutine A needs to be able to see the interface for Subroutine B at compile time for warn interfaces find the problem. If the subroutines are compiled separately and subroutine A is compiled before subroutine B, theproblem will not be detected. &lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2012 18:47:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818730#M46562</guid>
      <dc:creator>Anonymous66</dc:creator>
      <dc:date>2012-05-21T18:47:49Z</dc:date>
    </item>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818731#M46563</link>
      <description>I go to Build-&amp;gt;Build Solution&lt;DIV&gt;Both subroutines are in the same project and solution.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Does that answer your question?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks!&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 May 2012 18:57:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818731#M46563</guid>
      <dc:creator>bcartolo</dc:creator>
      <dc:date>2012-05-21T18:57:02Z</dc:date>
    </item>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818732#M46564</link>
      <description>Hello,&lt;BR /&gt;warn:interfaces does seem to catch this inconsistency with a 12.1 compiler. I ran your program using:&lt;BR /&gt;&lt;BR /&gt;x:\cq\testing&amp;gt;ifort /warn:interfaces a1.f90&lt;BR /&gt;Intel Visual Fortran Compiler XE for applications running on IA-32, Version 12.1 Beta Build x&lt;BR /&gt;Copyright (C) 1985-2012 Intel Corporation. All rights reserved.&lt;BR /&gt;&lt;BR /&gt;a1.f90(5): error #6631: A non-optional actual argument must be present when invoking a procedure with an explicit interface. &lt;K&gt;&lt;BR /&gt; call B(l,j)&lt;BR /&gt;---------^&lt;BR /&gt;compilation aborted for a1.f90 (code 1)&lt;BR /&gt;&lt;BR /&gt;This functionality may have been provided later than the 11.1 compiler. I'd recommend using a newer compiler.&lt;BR /&gt;Best!&lt;BR /&gt;-Udit&lt;/K&gt;</description>
      <pubDate>Mon, 21 May 2012 18:57:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818732#M46564</guid>
      <dc:creator>Udit_P_Intel</dc:creator>
      <dc:date>2012-05-21T18:57:51Z</dc:date>
    </item>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818733#M46565</link>
      <description>The code above was just an example, not my actual case. I sometimes get error #6631, but not always!&lt;DIV&gt;Can't use another version of fortran because of: Money, compatibility with abaqus.&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 May 2012 19:01:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818733#M46565</guid>
      <dc:creator>bcartolo</dc:creator>
      <dc:date>2012-05-21T19:01:44Z</dc:date>
    </item>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818734#M46566</link>
      <description>If you control the source of subroutines A and B, then put B in a module.&lt;BR /&gt;&lt;BR /&gt;(If abaqus is calling B directly (not via A) then you won't be able to do this, but in that case adding arguments to B would also get you into trouble.)&lt;BR /&gt;&lt;BR /&gt;[fortran]module my_module_name
  implicit none
contains
  subroutine B(l,j,k)
    integer, intent(in) :: l, j
    integer, intent(out) :: k
    k = l + j
  end subroutine B  
end module my_module_name

subroutine A(l, j)
  use my_module_name
  implicit none
  integer, intent(in):: l, j
  ! Missing argument error guaranteed to be reported for the following line.
  call B(l,j)      
end subroutine A
[/fortran]</description>
      <pubDate>Mon, 21 May 2012 19:59:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818734#M46566</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2012-05-21T19:59:31Z</dc:date>
    </item>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818735#M46567</link>
      <description>Thanks!&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;But why putting the subroutine in a module will fix my problem?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Also, will I have multihreading issues with this?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;My past experience with modules is that they are not thread safe.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;See:&lt;A href="http://stackoverflow.com/questions/6439606/thread-safe-c-sharp-service-using-fortran-dll"&gt;http://stackoverflow.com/questions/6439606/thread-safe-c-sharp-service-using-fortran-dll&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Best&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 May 2012 20:03:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818735#M46567</guid>
      <dc:creator>bcartolo</dc:creator>
      <dc:date>2012-05-21T20:03:51Z</dc:date>
    </item>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818736#M46568</link>
      <description>Short answer - because that's what modules do. &lt;BR /&gt;&lt;BR /&gt;Long answer - when you put a procedure in a module and then 'use' that module in another scope, then the procedure automatically gains in that other scope what is known as an explicit interface. Practically this means that the compiler must have compiled the source file containing the module before it sees the USE statement, consequently the compiler knows everything about how the procedure should be called when it see the call, consequently it can check that the right arguments have been provided.&lt;BR /&gt;&lt;BR /&gt;("Guaranteed" in my example was a bit strong - I thought the standard required checking, but I might have been wrong. I suspect though, that if a compiler didn't check a call against an explicit interface then most compiler vendors would regard that as a compiler bug.)&lt;BR /&gt;&lt;BR /&gt;If you use external subprograms, as you were originally doing, then there's no guarantee that the source for subroutine B will be compiled before the call, consequently there's no guarantee that the compiler can check the call. &lt;BR /&gt;&lt;BR /&gt;(This lack of required compilation ordering with external subprograms is important in a few case, outside of those cases all procedures should either be module procedures or internal procedures.)&lt;BR /&gt;&lt;BR /&gt;Thread safety is an orthogonal issue to use of modules. You can create thread-unsafe code without using modules, you can create thread-safe code using modules. &lt;BR /&gt;&lt;BR /&gt;(There are multiple ways in which a program can be multi-threaded (automatic parallelization, coarrays, openmp, native threads...) - particularly when you start getting towards the end of that list (the stackoverflow example you link to is at the native thread level) then the whole program's design needs to be mindful of thread safety. Other traditionally non-threaded languages have exactly the same issues.)</description>
      <pubDate>Mon, 21 May 2012 21:03:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818736#M46568</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2012-05-21T21:03:41Z</dc:date>
    </item>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818737#M46569</link>
      <description>Thanks!&lt;DIV&gt;I suppose I will do one module for each subroutine.&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Best&lt;/DIV&gt;</description>
      <pubDate>Tue, 22 May 2012 15:33:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818737#M46569</guid>
      <dc:creator>bcartolo</dc:creator>
      <dc:date>2012-05-22T15:33:42Z</dc:date>
    </item>
    <item>
      <title>Argument checking is not working</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818738#M46570</link>
      <description>Instead consider going through your source and grouping related procedures (particularly from the point of view of how they are used) together into a module. Having lots and lots of "little" modules (each with one subroutine) just creates complexity without any benefit.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2012 21:25:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Argument-checking-is-not-working/m-p/818738#M46570</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2012-05-22T21:25:31Z</dc:date>
    </item>
  </channel>
</rss>

