<?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 Re: using ifort to improve code robustness in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757713#M13200</link>
    <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;By macros I mean editor or IDE keyboard macro capability. Most mature editors have a capability of executing macros. I.e. you press a Hot-Key or Fn key (with/without Shift, Ctrl, Alt, left and right varients) and it executes the specified macro. In this case you write the macro. After your initial edits your program will likely be&lt;BR /&gt;&lt;BR /&gt;subroutine YourSubroutine()&lt;BR /&gt; implicit none&lt;BR /&gt; ...&lt;BR /&gt;end subroutine YourSubroutine&lt;BR /&gt;&lt;BR /&gt;Compiling the above you might receive an error&lt;BR /&gt;&lt;BR /&gt; A = B + C&lt;BR /&gt; ^ undefined symbol&lt;BR /&gt;&lt;BR /&gt;and a whole bunch of additional errors.&lt;BR /&gt;&lt;BR /&gt;In the IDE both the source window and error message windows are open. When clicking on the line in the error message window, the edit window positions to the line in error. Your development system may have a similar capability. Assuming it does. If you place the cursor within or at the beginning of the symbol in error (A in this case) and if you write a macro to functionally perform the following&lt;BR /&gt;&lt;BR /&gt;goto(beginningOfWord)&lt;BR /&gt;mark&lt;BR /&gt;goto(endOfWord)&lt;BR /&gt;copy&lt;BR /&gt;insert('***here***')&lt;BR /&gt;searchBackwards('implicit none')&lt;BR /&gt;advance line&lt;BR /&gt;insert('real :: ')&lt;BR /&gt;paste&lt;BR /&gt;insert('n')&lt;BR /&gt;replace('***here***','')&lt;BR /&gt;&lt;BR /&gt;This macro is assigned to the one you want to use for REAL(4), or REAL&lt;BR /&gt;You setup a similar one for REAL(8), INTEGER, LOGICAL, etc...&lt;BR /&gt;&lt;BR /&gt;Most macro systems permit you to record keystrokes to generate the macro. Many macro systems use a scripting language (Linux/Mac may use Python). These macros can often be written to a file for use in every edit session.&lt;BR /&gt;&lt;BR /&gt;The editing session (once macros built)&lt;BR /&gt;&lt;BR /&gt;compile&lt;BR /&gt;repeat until done&lt;BR /&gt; click on error line to goto source line in error&lt;BR /&gt; decide what the variable type should be an if macro available to perform edit&lt;BR /&gt; execute macro or hand edit if macro not available&lt;BR /&gt;end repeat&lt;BR /&gt;&lt;BR /&gt;compile&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 11 Aug 2009 20:25:12 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2009-08-11T20:25:12Z</dc:date>
    <item>
      <title>using ifort to improve code robustness</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757708#M13195</link>
      <description>I have legacy F77 code that I wish to improve the robustness and portability thereof, making the ifort compiler take as much of the strain as possible.
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;For example, I am removing 'IMPLICIT REAL*8(A-H,O-Z)' and require explicit typing of all variables. Is there an easy way that the ifort compiler (or another Intel tool) can help? At the moment I'm just compiling with IMPLICIT NONE then adding by add each variable that the compiler claims is used but not declared.&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Secondly, there will be areas of code where variables are assigned but not used. It would be nice to remove these areas altogether from the source code. I know that ifort -O2 will perform dead code elimination and I can see from -opt-report than some stuff is being removed but is it possible to the the compiler to spit out which lines/variables/basic blocks are being removed?&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Many thanks, Michael, Univ of Manchester&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Aug 2009 14:12:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757708#M13195</guid>
      <dc:creator>mkbane</dc:creator>
      <dc:date>2009-08-06T14:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: using ifort to improve code robustness</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757709#M13196</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;Using IMPLICIT NONE then on variable by variable basis is likely the best method since this will provide you with a case by case analysis as to if the 'IMPLICIT REAL*8(A-H,O-Z)' was potentially a cause for a problem in the first place (e.g. a temporary was created and used when it was not intended to be createdand used, or wrong type used). Any automatic tool would produce the same symptom in your program. Yes, this is work, if you learn how to use macro capabilities of your editor (assuming it has macro capabilities), then conversion work might be relatively fast (e.g. F8 toplace variable nameat cursor into paste buffer, insert find me later token into code, search backwards to IMPLICIT, advance line, insert 'REAL*8 :: ', paste paste buffer, insert new line, search for and delete find me later token. F4 for REAL*4, Alt-F8 forarray declaration, etc...&lt;BR /&gt;&lt;BR /&gt;For unused variables, enable the FPP, and place #if 0 and #endif around your declarations.Compile, get errors (form IMPLICIT NONE) then move appropriate declarations outside of scope of #if 0.&lt;BR /&gt;&lt;BR /&gt;This goes relatively fast.&lt;BR /&gt;&lt;BR /&gt;Your goal is not only robustness but correctness of code. Take the time to do it right.&lt;BR /&gt;&lt;BR /&gt;Also, I strongly suggest using INTERFACE declarations.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Aug 2009 15:28:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757709#M13196</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-08-06T15:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: using ifort to improve code robustness</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757710#M13197</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/99850"&gt;jimdempseyatthecove&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; &lt;BR /&gt;Using IMPLICIT NONE then on variable by variable basis is likely the best method since&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;SPAN style="font-weight: bold;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;SPAN style="font-weight: bold;"&gt;yeah was hoping there was a quicker/easier way...&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;SPAN style="font-weight: bold;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;SPAN style="font-weight: bold;"&gt;another Q that springs to mind is how to tell ifort to EXCLUDE extensions (cf gfortran -pedantic) - I've an example that ifort -warn all compiles without any warning/error whereas gfortran -pedantic picks up the use of extensions&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;SPAN style="font-weight: bold;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;SPAN style="font-weight: bold;"&gt;ta, Michael&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Aug 2009 14:07:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757710#M13197</guid>
      <dc:creator>mkbane</dc:creator>
      <dc:date>2009-08-11T14:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: using ifort to improve code robustness</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757711#M13198</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;The &lt;STRONG&gt;-stand &lt;EM&gt;{keyword}&lt;/EM&gt;&lt;/STRONG&gt; option might help. You select a Standard to be applied via &lt;EM&gt;&lt;STRONG&gt;{keyword}&lt;/STRONG&gt;&lt;/EM&gt; = f90, f95, or f03</description>
      <pubDate>Tue, 11 Aug 2009 14:48:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757711#M13198</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2009-08-11T14:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: using ifort to improve code robustness</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757712#M13199</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="width: 100%; margin-top: 5px;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/99850"&gt;jimdempseyatthecove&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt; if you learn how to use macro capabilities of your editor (assuming it has macro capabilities), then conversion work might be relatively fast (e.g. F8 toplace variable nameat cursor into paste buffer, insert find me later token into code, search backwards to IMPLICIT, advance line, insert 'REAL*8 :: ', paste paste buffer, insert new line, search for and delete find me later token. F4 for REAL*4, Alt-F8 forarray declaration, etc...&lt;BR /&gt;&lt;BR /&gt;For unused variables, enable the FPP, and place #if 0 and #endif around your declarations.Compile, get errors (form IMPLICIT NONE) then move appropriate declarations outside of scope of #if 0.&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt; &lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
Dear Jim,&lt;BR /&gt;can you manage time to elaborate this? I think it will be of much help, and if possible, not start with a IDE&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Aug 2009 15:53:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757712#M13199</guid>
      <dc:creator>roddur</dc:creator>
      <dc:date>2009-08-11T15:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: using ifort to improve code robustness</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757713#M13200</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;By macros I mean editor or IDE keyboard macro capability. Most mature editors have a capability of executing macros. I.e. you press a Hot-Key or Fn key (with/without Shift, Ctrl, Alt, left and right varients) and it executes the specified macro. In this case you write the macro. After your initial edits your program will likely be&lt;BR /&gt;&lt;BR /&gt;subroutine YourSubroutine()&lt;BR /&gt; implicit none&lt;BR /&gt; ...&lt;BR /&gt;end subroutine YourSubroutine&lt;BR /&gt;&lt;BR /&gt;Compiling the above you might receive an error&lt;BR /&gt;&lt;BR /&gt; A = B + C&lt;BR /&gt; ^ undefined symbol&lt;BR /&gt;&lt;BR /&gt;and a whole bunch of additional errors.&lt;BR /&gt;&lt;BR /&gt;In the IDE both the source window and error message windows are open. When clicking on the line in the error message window, the edit window positions to the line in error. Your development system may have a similar capability. Assuming it does. If you place the cursor within or at the beginning of the symbol in error (A in this case) and if you write a macro to functionally perform the following&lt;BR /&gt;&lt;BR /&gt;goto(beginningOfWord)&lt;BR /&gt;mark&lt;BR /&gt;goto(endOfWord)&lt;BR /&gt;copy&lt;BR /&gt;insert('***here***')&lt;BR /&gt;searchBackwards('implicit none')&lt;BR /&gt;advance line&lt;BR /&gt;insert('real :: ')&lt;BR /&gt;paste&lt;BR /&gt;insert('n')&lt;BR /&gt;replace('***here***','')&lt;BR /&gt;&lt;BR /&gt;This macro is assigned to the one you want to use for REAL(4), or REAL&lt;BR /&gt;You setup a similar one for REAL(8), INTEGER, LOGICAL, etc...&lt;BR /&gt;&lt;BR /&gt;Most macro systems permit you to record keystrokes to generate the macro. Many macro systems use a scripting language (Linux/Mac may use Python). These macros can often be written to a file for use in every edit session.&lt;BR /&gt;&lt;BR /&gt;The editing session (once macros built)&lt;BR /&gt;&lt;BR /&gt;compile&lt;BR /&gt;repeat until done&lt;BR /&gt; click on error line to goto source line in error&lt;BR /&gt; decide what the variable type should be an if macro available to perform edit&lt;BR /&gt; execute macro or hand edit if macro not available&lt;BR /&gt;end repeat&lt;BR /&gt;&lt;BR /&gt;compile&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Aug 2009 20:25:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/using-ifort-to-improve-code-robustness/m-p/757713#M13200</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2009-08-11T20:25:12Z</dc:date>
    </item>
  </channel>
</rss>

