<?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 Add IMPLICIT NONE to your in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031254#M110669</link>
    <description>&lt;P&gt;Add IMPLICIT NONE to your subprograms, and use the /warn:interfaces compiler option. The former would have caused the use of KILL as a function, and the latter would have compared argument usage for consistency with argument declarations.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Dec 2014 16:58:48 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2014-12-22T16:58:48Z</dc:date>
    <item>
      <title>eliminating g77 intrinsic function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031253#M110668</link>
      <description>&lt;P&gt;In the applications that I have ported from g77 to Intel Fortran, many of the remaining run-time bugs are due to use of g77 intrinsic functions. &amp;nbsp;I am trying to come up with a way to track them down before they cause run-time errors. &amp;nbsp;I have an idea based on the following small example, but wanted to elicit ideas from this community.&lt;/P&gt;

&lt;P&gt;Here is a g77 function that kills a process, given the process id:&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INTEGER FUNCTION KILLER(PID)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INTEGER*4 PID, RESULT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL KILL(PID,9,RESULT)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;KILLER=RESULT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END&lt;BR /&gt;
	Notice the signature of the kill subroutine. &amp;nbsp;This snippet of code would be correctly implemented as follows in Intel Fortran:&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INTEGER FUNCTION KILLER(PID)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;USE IFPORT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INTEGER*4 PID, RESULT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RESULT = KILL(PID,9)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;KILLER=RESULT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END&lt;BR /&gt;
	As in C, kill() is an integer function with 2 arguments.&lt;/P&gt;

&lt;P&gt;This was an easy coding change to make, but the run-time bug that it caused was not as easy to track down. &amp;nbsp;I would rather find these at compile time. &amp;nbsp;I noticed that if I add "USE IFPORT" to the original implementation with the g77 intrinsic, I get a compile error. &amp;nbsp;Code is:&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INTEGER FUNCTION KILLER(PID)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;USE IFPORT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;INTEGER*4 PID, RESULT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL KILL(PID,9,RESULT)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;KILLER=RESULT&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;END&lt;BR /&gt;
	and compile error is:&lt;/P&gt;

&lt;P&gt;killererr.for(4): error #6552: The CALL statement is invoking a function subprogram as a subroutine. &amp;nbsp; [KILL]&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL KILL(PID,9,RESULT)&lt;BR /&gt;
	------------^&lt;BR /&gt;
	killererr.for(4): error #6784: The number of actual arguments cannot be greater than the number of dummy arguments. &amp;nbsp; [KILL]&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CALL KILL(PID,9,RESULT)&lt;BR /&gt;
	------------^&lt;BR /&gt;
	This is a good thing! &amp;nbsp;So now I'm wondering: Is there a compiler switch or some other way to indicate that I would like to "USE IFPORT" on all of my code? &amp;nbsp;Or any other approach that you can suggest, short of searching for every g77 intrinsic (I found an on-line reference) in the source code?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	JayB&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 16:06:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031253#M110668</guid>
      <dc:creator>jayb</dc:creator>
      <dc:date>2014-12-22T16:06:08Z</dc:date>
    </item>
    <item>
      <title>Add IMPLICIT NONE to your</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031254#M110669</link>
      <description>&lt;P&gt;Add IMPLICIT NONE to your subprograms, and use the /warn:interfaces compiler option. The former would have caused the use of KILL as a function, and the latter would have compared argument usage for consistency with argument declarations.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 16:58:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031254#M110669</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2014-12-22T16:58:48Z</dc:date>
    </item>
    <item>
      <title>Hi, Mecej4.  I tried your</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031255#M110670</link>
      <description>&lt;P&gt;Hi, Mecej4. &amp;nbsp;I tried your idea on the example above, adapted to Linux (-warn interface) and did not get any warnings. &amp;nbsp;Event "-warn all" did not give me warnings. &amp;nbsp;Thanks, though.&lt;/P&gt;

&lt;P&gt;Since "USE IFPORT" seems to ferret these out, I was hoping to find a way to indicate the use of the portability module without having to insert it into every function and subroutine.&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;-- JayB&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 20:02:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031255#M110670</guid>
      <dc:creator>jayb</dc:creator>
      <dc:date>2014-12-22T20:02:54Z</dc:date>
    </item>
    <item>
      <title>Do all (most) of your</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031256#M110671</link>
      <description>&lt;P&gt;Do all (most) of your subroutines and functions have a USE yourOwnModuleHere?&lt;/P&gt;

&lt;P&gt;If so, you can insert the USE IFPORT into that module.&lt;/P&gt;

&lt;P&gt;If not, then you might consider doing that so you can easily switch back and forth from g77 and ivf.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 21:17:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031256#M110671</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2014-12-22T21:17:18Z</dc:date>
    </item>
    <item>
      <title>Jim,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031257#M110672</link>
      <description>&lt;P&gt;Jim,&lt;/P&gt;

&lt;P&gt;Since this is a legacy application, the source code does not contain any modules. &amp;nbsp;But that sounds like an interesting idea, at least in terms of grouping subprograms for the type of check I have in mind.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
	JayB&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 21:47:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031257#M110672</guid>
      <dc:creator>jayb</dc:creator>
      <dc:date>2014-12-22T21:47:09Z</dc:date>
    </item>
    <item>
      <title>Well, I tried wrapping lots</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031258#M110673</link>
      <description>&lt;P&gt;Well, I tried wrapping lots of this application's small machine-generated (from RATFOR) FORTAN 77 files into a module. &amp;nbsp;A few problems ensued:&lt;/P&gt;

&lt;P&gt;1) Since modules are part of modern Fortran, the module construct would not be processed in a file with the .for extension. &amp;nbsp;So I tried .f90&lt;/P&gt;

&lt;P&gt;2) In a .f90 file, most of the FORTRAN 77 syntax was permissible. &amp;nbsp;But continuation lines (column 6 containing *) and comment lines (column 1 containing C) generated so many errors that the compiler decided to end things after a few hundred lines.&lt;/P&gt;

&lt;P&gt;Looking back, I'm pretty impressed that I got as far as I did!&lt;/P&gt;

&lt;P&gt;The original author has since provided me with an almost-complete list of g77 intrinsic functions that he used. &amp;nbsp;So I might just go ahead and use that; it's a very small subset of all g77 intrinsic functions.&lt;/P&gt;

&lt;P&gt;JayB&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 22:27:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031258#M110673</guid>
      <dc:creator>jayb</dc:creator>
      <dc:date>2014-12-22T22:27:58Z</dc:date>
    </item>
    <item>
      <title>Quote:Jayb wrote:Since</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031259#M110674</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Jayb wrote:&lt;BR /&gt;Since modules are part of modern Fortran, the module construct would not be processed in a file with the .for extension. &amp;nbsp;So I tried .f90. &lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;This is a misconception. A file suffix of .for or .f merely signifies to the compiler that the source file is in fixed format. With a suffix of .f90, the file is expected to be in free format, where the syntax for continuation lines is different.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 22:53:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031259#M110674</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2014-12-22T22:53:49Z</dc:date>
    </item>
    <item>
      <title>You're right.  I never</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031260#M110675</link>
      <description>&lt;P&gt;You're right. &amp;nbsp;I never thought to add a MODULE definition using fixed-format. &amp;nbsp;That's definitely an improvement for my current one-time purposes. &amp;nbsp;Although I'm getting some other odd compilation errors, I have already detected one more use of a g77 intrinsic used differently than an Intel Fortran portability function. &amp;nbsp;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 23:19:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/eliminating-g77-intrinsic-function/m-p/1031260#M110675</guid>
      <dc:creator>jayb</dc:creator>
      <dc:date>2014-12-22T23:19:36Z</dc:date>
    </item>
  </channel>
</rss>

