<?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 Q re purtting variables in Format statements in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798761#M36609</link>
    <description>Ok, I will try that. Thanks ! !</description>
    <pubDate>Tue, 19 Jun 2012 19:51:56 GMT</pubDate>
    <dc:creator>WSinc</dc:creator>
    <dc:date>2012-06-19T19:51:56Z</dc:date>
    <item>
      <title>Q re purtting variables in Format statements</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798759#M36607</link>
      <description>Suppose I have a stiuation like this:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt; integer q(1:20),nq,nx &lt;BR /&gt; realx(1:20) &lt;BR /&gt; print 101,x(1:nx), q(1:nq)&lt;BR /&gt;101 format("x=",4F20.12," q=",4I10)&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;This works fine as long as nx=4, and nq is &amp;lt;= 4.&lt;BR /&gt;But if those values &lt;STRONG&gt;change&lt;/STRONG&gt;, I want the FORMAT statement to reflect that.&lt;BR /&gt;&lt;BR /&gt;The way I now handle that is to modify the FORMAT statment at &lt;STRONG&gt;execution time&lt;/STRONG&gt; by&lt;BR /&gt;putting it in a CHARACTER array.&lt;BR /&gt;&lt;BR /&gt;Has Fortran come up with a &lt;STRONG&gt;cleaner way&lt;/STRONG&gt; to do this? I couldn't find anything.</description>
      <pubDate>Tue, 19 Jun 2012 16:53:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798759#M36607</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2012-06-19T16:53:34Z</dc:date>
    </item>
    <item>
      <title>Q re purtting variables in Format statements</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798760#M36608</link>
      <description>The Fortran standard doesn't have a cleaner way of doing what you want. In some circumstances, the Fortran 2008 "unlimited group repeat count" feature can help, but not here.&lt;BR /&gt;&lt;BR /&gt;Intel Fortran supports an old extension that does what you want, called Variable Format Expressions. The syntax would be:&lt;BR /&gt;&lt;BR /&gt;101 format("x=".&lt;NX&gt;F20.12,"q=",&lt;NQ&gt;I10)&lt;BR /&gt;&lt;BR /&gt;This extension is widely implemented, but not universally so.&lt;/NQ&gt;&lt;/NX&gt;</description>
      <pubDate>Tue, 19 Jun 2012 19:34:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798760#M36608</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-06-19T19:34:23Z</dc:date>
    </item>
    <item>
      <title>Q re purtting variables in Format statements</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798761#M36609</link>
      <description>Ok, I will try that. Thanks ! !</description>
      <pubDate>Tue, 19 Jun 2012 19:51:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798761#M36609</guid>
      <dc:creator>WSinc</dc:creator>
      <dc:date>2012-06-19T19:51:56Z</dc:date>
    </item>
    <item>
      <title>Q re purtting variables in Format statements</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798762#M36610</link>
      <description>No - what goes inside the &amp;lt;&amp;gt; is just an ordinary expression.</description>
      <pubDate>Tue, 19 Jun 2012 20:35:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798762#M36610</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-06-19T20:35:12Z</dc:date>
    </item>
    <item>
      <title>Q re purtting variables in Format statements</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798763#M36611</link>
      <description>For your specific example you could do something like the following, without having to resort to extensions:&lt;BR /&gt;&lt;BR /&gt;[bash]   WRITE (*, "('x=',*F20.12)", ADVANCE='NO') x(:nq)
   WRITE (*, "(' q=',*I10)") q(:nq)[/bash]</description>
      <pubDate>Tue, 19 Jun 2012 21:18:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798763#M36611</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2012-06-19T21:18:36Z</dc:date>
    </item>
    <item>
      <title>Q re purtting variables in Format statements</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798764#M36612</link>
      <description>Dang - I should have thought of that! Thanks, Ian!</description>
      <pubDate>Wed, 20 Jun 2012 00:36:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Q-re-purtting-variables-in-Format-statements/m-p/798764#M36612</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-06-20T00:36:36Z</dc:date>
    </item>
  </channel>
</rss>

