<?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 It was legal if you had a in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038555#M112387</link>
    <description>&lt;P&gt;It was legal if you had a good lawyer on your side.&lt;/P&gt;

&lt;P&gt;Variable Format Expressions is a vendor extension. You probably have specified /stand:f03 as a compiler option somewhere, causing such extensions to be disallowed.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Mar 2015 12:43:00 GMT</pubDate>
    <dc:creator>mecej4</dc:creator>
    <dc:date>2015-03-06T12:43:00Z</dc:date>
    <item>
      <title>Format syntax for a defined number of values on a line</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038554#M112386</link>
      <description>&lt;P&gt;Back in my day this was legal:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;        write(52,'(a,&amp;lt;nc&amp;gt;e20.10)') '  Recombined_Comp  :', (Recombined_Comp(i), i=1,nc)&lt;/PRE&gt;

&lt;P&gt;It still works but I get:&lt;/P&gt;

&lt;P&gt;warning #6923: Fortran 2008 does not allow an expression to be used as part of the format list. &amp;nbsp; [NC]&lt;/P&gt;

&lt;P&gt;How is this done these days?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 10:44:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038554#M112386</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2015-03-06T10:44:16Z</dc:date>
    </item>
    <item>
      <title>It was legal if you had a</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038555#M112387</link>
      <description>&lt;P&gt;It was legal if you had a good lawyer on your side.&lt;/P&gt;

&lt;P&gt;Variable Format Expressions is a vendor extension. You probably have specified /stand:f03 as a compiler option somewhere, causing such extensions to be disallowed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 12:43:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038555#M112387</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-06T12:43:00Z</dc:date>
    </item>
    <item>
      <title>So how does Fortran 2008</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038556#M112388</link>
      <description>&lt;P&gt;So how does Fortran 2008 handle it?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 12:50:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038556#M112388</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2015-03-06T12:50:19Z</dc:date>
    </item>
    <item>
      <title>The Fortran standard does not</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038557#M112389</link>
      <description>&lt;P&gt;The Fortran standard does not specify non-standard extensions. The vendors do, at their pleasure and their customer's request. Therefore, if you want to use an extension, don't specify that the compiler should check for standard-compliance, at least for those source files that do use such extensions.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 13:08:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038557#M112389</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-06T13:08:46Z</dc:date>
    </item>
    <item>
      <title>Yes I understand this.  That</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038558#M112390</link>
      <description>&lt;P&gt;Yes I understand this. &amp;nbsp;That isn't my question. &amp;nbsp;I was wondering if the Fortran 2008 standard allows for variable format length, perhaps with a different format. &amp;nbsp;eg "$" has been replaced with "advance='no'"&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 13:13:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038558#M112390</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2015-03-06T13:13:53Z</dc:date>
    </item>
    <item>
      <title>The standard way of doing</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038559#M112391</link>
      <description>&lt;P&gt;The standard way of doing what you want is to create or alter the format string before using that format to output to an external file.&lt;/P&gt;

&lt;P&gt;For example, you could do:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;character(len=12) :: fmtstr = '(a,nce20.10)'
..
write(fmtstr(4:),'(I2)') nc
..
write(52,fmtstr) ' Recombined_Comp  :', (Recombined_Comp(i), i=1,nc)&lt;/PRE&gt;

&lt;P&gt;Note, however, that you are not required to use an internal WRITE as I did. You can build up the format string as a character expression in any convenient way, including reading it from an input file.&lt;/P&gt;

&lt;P&gt;If the repeated edit specification is the last item in the format, you could simply use a large enough repeat prefix. For example, if you know that nc will never exceed 15, you could write 15E20.10. If, at the time the format is used, nc is smaller, the extra instances of E20.10 would just get ignored.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 13:28:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038559#M112391</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-06T13:28:00Z</dc:date>
    </item>
    <item>
      <title>Yes although &lt;nc&gt; is more</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038560#M112392</link>
      <description>&lt;P&gt;Yes although &amp;lt;nc&amp;gt; is more elegant, maybe that will get into the standard one day...&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 14:17:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038560#M112392</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2015-03-06T14:17:17Z</dc:date>
    </item>
    <item>
      <title>Fortran 2008 handles this</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038561#M112393</link>
      <description>&lt;P&gt;Fortran 2008 handles this case as follows:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;write(52,'(a,*(e20.10))') '  Recombined_Comp  :', (Recombined_Comp(i), i=1,nc)&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 15:58:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038561#M112393</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-06T15:58:47Z</dc:date>
    </item>
    <item>
      <title>Wow excellent, I didn't know</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038562#M112394</link>
      <description>&lt;P&gt;Wow excellent, I didn't know this.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 16:49:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038562#M112394</guid>
      <dc:creator>Adrian_F_1</dc:creator>
      <dc:date>2015-03-06T16:49:41Z</dc:date>
    </item>
    <item>
      <title>Nice to know; I checked, and</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038563#M112395</link>
      <description>&lt;P&gt;Nice to know; I checked, and find that the feature was available even in the 14.0 compiler.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2015 17:02:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038563#M112395</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-06T17:02:45Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038564#M112396</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thanks Steve for the clarification. However, what happen if there are several implicit loops ? How the compiler is identifying which part of the format to use? does it use the type of the variables or does it analyzes the content of the expression to print ?&lt;/P&gt;

&lt;P&gt;what happen in such a case ?&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;    write(52,'(a,*(i2),*(a),*(1pg13.6))') 'Indexes, names, composition : ', &amp;amp;
                                          (Ind(i), i=1,nc), (name(i),i=1,nc), (x(i),i=1,nc)
   
 &lt;/PRE&gt;

&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 08:19:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038564#M112396</guid>
      <dc:creator>netphilou31</dc:creator>
      <dc:date>2015-03-07T08:19:00Z</dc:date>
    </item>
    <item>
      <title>There are no rules to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038565#M112397</link>
      <description>&lt;P&gt;There are no rules to associate format edit descriptors with I/O list items grouped by implied loops in the latter. If there were such rules, your problem would be solved if the edit descriptors and list items were perfectly matched, but formatted I/O would become severely restricted otherwise. Rather, think of the I/O list being expanded completely by repeating the implied loops. Only after the list has been expanded in this way to a simple serial list is the I/O conversion performed under control of the format items.&lt;/P&gt;

&lt;P&gt;I do not see any way to resolve the issue that you raised other than by breaking up the WRITE statements using ADVANCE='NO' clauses, or to output the pieces to an array or list of character variables using internal writes, followed by writing out those character variables.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I wonder if the following idea would work: the colon format descriptor has been available in Fortran for a long time and is part of the standard. Its effect is to discard the remainder of the format list, if any, and immediately terminate output if all the items in the I/O list have been processed. Its meaning/effect could be extended by specifying that when a colon descriptor appears &lt;EM&gt;within an&lt;/EM&gt; &lt;EM&gt;unlimited-format-item&lt;/EM&gt;, output control moves to the next item in the format string, if any.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 13:13:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038565#M112397</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-07T13:13:51Z</dc:date>
    </item>
    <item>
      <title>I'd like to offer some sense,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038566#M112398</link>
      <description>&lt;P&gt;I'd like to offer some sense, or nonsense, on this subject.&lt;/P&gt;

&lt;P&gt;From my understanding the purpose of the * formatting is to provide a means of indicating that at compile time it is unknown as to the number of instances of a type that will be required. The argument(s) list for say *(i2) could be:&lt;/P&gt;

&lt;P&gt;(Ind(i), i=1,nc)&lt;BR /&gt;
	Ind(1:nc)&lt;BR /&gt;
	Ind(:)&lt;BR /&gt;
	9&lt;/P&gt;

&lt;P&gt;Or other construct where one expression/value fulfills the *. Although in the case of the 9 above, you know the count of integers and then you would not use * formatting.&lt;/P&gt;

&lt;P&gt;Using this rule, quote #11 would work. As to if his is how it is implemented, I cannot say.&lt;/P&gt;

&lt;P&gt;More complex expressions for a single * could be written using an array constructor.&lt;/P&gt;

&lt;P&gt;Jim Demspey&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 13:41:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038566#M112398</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2015-03-07T13:41:15Z</dc:date>
    </item>
    <item>
      <title>Jim, here is the explanation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038567#M112399</link>
      <description>&lt;P&gt;Jim, here is the explanation from F2008 (draft):&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;The effect of an unlimited-format-item is as if its enclosed list were preceded by a very large repeat count.&lt;BR /&gt;
	There is no file positioning implied by unlimited-format-item reversion. This may be used to write what is&lt;BR /&gt;
	commonly called a comma separated value record.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;For example,&amp;nbsp;WRITE( 10, '( "IARRAY =", *( I0, :, ","))') IARRAY&amp;nbsp;produces a single record with a header and a comma separated list of integer values.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;If there are items in the I/O list that come after the preceding items that were intended to be used with the *(...) format, and their type is unsuitable for the edit descriptors in the unlimited-format-item, a run time error would occur. I don't see how the standard allows anything other than control items and character strings to come after a *() group. In other words, there can only be a single *() item in a format string, and that one cannot be followed by other edit descriptors, if my reading of the standard is not mistaken.&lt;/P&gt;

&lt;P&gt;Incidentally, note the use of the colon in the example (from the standard, quoted above) to prevent a terminal comma from being output to the CSV file.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 14:03:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038567#M112399</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-07T14:03:09Z</dc:date>
    </item>
    <item>
      <title>mecej4 has it right. It isn't</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038568#M112400</link>
      <description>&lt;P&gt;mecej4 has it right. It isn't called "unlimited format item" for nothing. It isn't a universal replacement for variable format expressions, but it does the job for the majority of uses. For the cases it doesn't work, the standard solution, one that goes back to F77, is to write the format to a character variable, with the count inserted for the repeat count, and then use the variable as the format.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 15:51:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038568#M112400</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-07T15:51:00Z</dc:date>
    </item>
    <item>
      <title>Steve, can you enlighten us</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038569#M112401</link>
      <description>&lt;P&gt;Steve, can you enlighten us on why VFE-s did not eventually find a place in the Fortran standard? Using chevrons (angle-brackets) as they do, they do not clash with any other Fortran feature, and provide a nice solution to a common problem.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 16:12:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038569#M112401</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-07T16:12:39Z</dc:date>
    </item>
    <item>
      <title>Mecej4,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038570#M112402</link>
      <description>&lt;P&gt;Mecej4,&lt;/P&gt;

&lt;P&gt;If you look at the example given in your #14, there is a single *, and a single "expression" that is substitutable for an array constructor. This leaves the question as to which would you prefer:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;WRITE( 10, '( "DATA =", *( I0, :, ","))') IARRAY, JARRAY

or

WRITE( 10, '( "DATA =", *( I0, ","), *( I0, :, ","))') IARRAY, JARRAY&lt;/PRE&gt;

&lt;P&gt;If your predilection is to only use one type then the former would be preferred. However, consider ramification for the latter and:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;WRITE( 10, '( "DATA =", *( I0, ","), *( F0, :, ","))') IARRAY, ARRAY&lt;/PRE&gt;

&lt;P&gt;This is what post #11 was querying about.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2015 17:32:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038570#M112402</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2015-03-07T17:32:29Z</dc:date>
    </item>
    <item>
      <title>The compiler confirms the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038571#M112403</link>
      <description>&lt;P&gt;The compiler confirms the suspicions that I expressed in #14:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;chkio.f90(4): error #8416: Unlimited format item shall be specified ONLY once.   [,*]
WRITE( 10, '( "DATA =", *( I0, ","), *( F0, :, ","))') IARRAY, ARRAY
-----------------------------------^&lt;/PRE&gt;

&lt;P&gt;Since you are not allowed to use more than one UFI (unlimited format item) in a format string, there is no need to discuss how two UFIs should be interpreted.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2015 00:32:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038571#M112403</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2015-03-08T00:32:08Z</dc:date>
    </item>
    <item>
      <title>V FEs are universally</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038572#M112404</link>
      <description>&lt;P&gt;V FEs are universally detested by implementors - the semantics are exceedlingly strange for Fortran. I don't think anyone ever considered making them standard. We don't particularly care for them ourselves, and we invented them! (Back in the DEC PDP-11 days, before my time.)&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2015 01:09:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Format-syntax-for-a-defined-number-of-values-on-a-line/m-p/1038572#M112404</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-03-08T01:09:02Z</dc:date>
    </item>
  </channel>
</rss>

