<?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: Problems exiting subroutines in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problems-exiting-subroutines/m-p/741273#M840</link>
    <description>Hi Jeff,&lt;BR /&gt;&lt;BLOCKQUOTE&gt;The problem seems to be that upon exiting a subroutine, variables used
in that subroutine are somehow "lost" from memory, or subsequently
overwritten, and this causes problems when the variables are used again
later in the main program. &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;I'm not completely sure what you mean by that. If you mean that a local variable does not keep the value from the last call to that subroutine, you need to use the &lt;B&gt;SAVE&lt;/B&gt; keyword as in&lt;BR /&gt;&lt;BLOCKQUOTE&gt;real, save :: myVariable&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;You could try whether the option &lt;B&gt;-save&lt;/B&gt; works for you.&lt;BR /&gt;&lt;BR /&gt;Tobias&lt;BR /&gt;</description>
    <pubDate>Sat, 08 Jul 2006 03:51:02 GMT</pubDate>
    <dc:creator>tobias-burnus</dc:creator>
    <dc:date>2006-07-08T03:51:02Z</dc:date>
    <item>
      <title>Problems exiting subroutines</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problems-exiting-subroutines/m-p/741272#M839</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have been using Fortran software written by a former associate of mine which was written and debugged on a Sun workstation; I am not sure which compiler, but it is likely to be rather old. I have now recompiled them in Linux using Ifort 9.0, and am experiencing some difficulties that seem to be related to system or compiler compatability. &lt;BR /&gt;&lt;BR /&gt;The problem seems to be that upon exiting a subroutine, variables used in that subroutine are somehow "lost" from memory, or subsequently overwritten, and this causes problems when the variables are used again later in the main program. This was apparently not a problem on the Sun workstation, but only occurs when I attempt to compile in Linux using Ifort 9.0. (The code also compiles and runs properly in Windows using the Compaq compiler.) I have heard that in some cases, with the newer versions of Fortran, variables passed to subroutines which are not declared a certain way may be lost when a subroutine closes.&lt;BR /&gt;&lt;BR /&gt;Thus my question: Is there a compiler option which will take care of this (as it was apparently not a problem in other versions of Fortran?), or a simple way of modifying the code to rectify the problem? I am not a programmer myself, merely a consumer of Fortran code, and the programs are enormous :)&lt;BR /&gt;&lt;BR /&gt;Thanks for any advice,&lt;BR /&gt;&lt;BR /&gt;Jeff&lt;BR /&gt;</description>
      <pubDate>Sat, 08 Jul 2006 03:23:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problems-exiting-subroutines/m-p/741272#M839</guid>
      <dc:creator>jjkay</dc:creator>
      <dc:date>2006-07-08T03:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problems exiting subroutines</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problems-exiting-subroutines/m-p/741273#M840</link>
      <description>Hi Jeff,&lt;BR /&gt;&lt;BLOCKQUOTE&gt;The problem seems to be that upon exiting a subroutine, variables used
in that subroutine are somehow "lost" from memory, or subsequently
overwritten, and this causes problems when the variables are used again
later in the main program. &lt;BR /&gt;&lt;/BLOCKQUOTE&gt;I'm not completely sure what you mean by that. If you mean that a local variable does not keep the value from the last call to that subroutine, you need to use the &lt;B&gt;SAVE&lt;/B&gt; keyword as in&lt;BR /&gt;&lt;BLOCKQUOTE&gt;real, save :: myVariable&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;You could try whether the option &lt;B&gt;-save&lt;/B&gt; works for you.&lt;BR /&gt;&lt;BR /&gt;Tobias&lt;BR /&gt;</description>
      <pubDate>Sat, 08 Jul 2006 03:51:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problems-exiting-subroutines/m-p/741273#M840</guid>
      <dc:creator>tobias-burnus</dc:creator>
      <dc:date>2006-07-08T03:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problems exiting subroutines</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problems-exiting-subroutines/m-p/741274#M841</link>
      <description>Hi Tobias,&lt;BR /&gt;&lt;BR /&gt;I tried compiling with the "-save" option, and it worked perfectly! Thanks so much for your help!&lt;BR /&gt;&lt;BR /&gt;Jeff&lt;BR /&gt;</description>
      <pubDate>Sat, 08 Jul 2006 04:29:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problems-exiting-subroutines/m-p/741274#M841</guid>
      <dc:creator>jjkay</dc:creator>
      <dc:date>2006-07-08T04:29:28Z</dc:date>
    </item>
  </channel>
</rss>

