<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Sun, 08 Nov 2009 00:49:22 -0800 -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <atom:link href="http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/66739/feed" rel="self" type="application/rss+xml" />
    <title>Intel Software Network - <![CDATA[ External Procedure ]]> feed</title>
    <link>http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/66739</link>
    <description></description>
    <language>en-us</language>
    <item>
      <title>Re: External Procedure</title>
      <description><![CDATA[ <div style="margin:0px;"></div>
Well, you did it in this example, though you have declared the function as integer(2) in one place and integer(4) in the other.  If the QSORT you are using wants an INTEGER(2) function make sure that you write the function that way.<br /><br />This has been a standard feature of Fortran since Fortran 77.  (In Fortran 66 the syntax was a bit different.)<br /> ]]></description>
      <link>http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/66739/</link>
      <pubDate>Fri, 03 Jul 2009 17:01:45 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/66739/</guid>
      <category>ISN General</category>
    </item>
    <item>
      <title>Re: External Procedure</title>
      <description><![CDATA[ <div style="margin:0px;">
<div id="quote_reply" style="width: 100%; margin-top: 5px;">
<div style="margin-left:2px;margin-right:2px;">Quoting - <a href="/en-us/profile/336209">Steve Lionel (Intel)</a></div>
<div style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"><em> Well, you did it in this example, though you have declared the function as integer(2) in one place and integer(4) in the other.  If the QSORT you are using wants an INTEGER(2) function make sure that you write the function that way.<br /><br />This has been a standard feature of Fortran since Fortran 77.  (In Fortran 66 the syntax was a bit different.)<br /></em></div>
</div>
</div>
<br />I'll fix it. Thank you.<br /><br />But, how can I create my on procedure that receive a function which is defined outside of the same?<br /><br />If it is hard to put here, where do I found it?<br /> ]]></description>
      <link>http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/66739/</link>
      <pubDate>Fri, 03 Jul 2009 18:48:38 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/66739/</guid>
      <category>ISN General</category>
    </item>
    <item>
      <title>Re: External Procedure</title>
      <description><![CDATA[ <div style="margin:0px;"></div>
Oh, sorry, I misunderstood your question.<br /><br />The Fortran 77 way is this:<br /><br />
<pre name="code" class="plain">subroutine callit (func, arg)
external func
integer func, arg
print *, func(arg)
end subroutine callit</pre>
When you call callit and pass your own function as the func argument, callit will call your function.<br /><br />The Fortran 90 way is this:<br /><br />
<pre name="code" class="plain">subroutine callit (func, arg)
interface
  integer function func (arg)
  integer, intent(in) : arg
  end function func
end interface
integer, intent(in) :: arg
print *, func(arg)
end subroutine callit</pre>
This is wordier, true, but it provides more information to the compiler.  In particular, if callit is in a module, the compiler can check to make sure that the function you pass has the correct interface.<br /><br />There's a Fortran 2003 way as well, with the new PROCEDURE declaration, but that's for another day.<br /> ]]></description>
      <link>http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/66739/</link>
      <pubDate>Sat, 04 Jul 2009 05:20:10 -0700</pubDate>
      <guid isPermaLink="true">http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/66739/</guid>
      <category>ISN General</category>
    </item>
  </channel></rss>