<?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 File position inquiry with non-advancing formatted stream access and sheep in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/File-position-inquiry-with-non-advancing-formatted-stream-access/m-p/1077445#M120902</link>
    <description>&lt;P&gt;I've never been good at poetry... so I've started using Fortran to help me.&amp;nbsp; Getting the right number of syllables in each line has always been tricky, so sometimes I skip over bits, and then fill them in later.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;PROGRAM poetic_streaming
  IMPLICIT NONE
  
  INTEGER :: unit
  INTEGER :: pos
  
  OPEN(  &amp;amp;
      NEWUNIT=unit,  &amp;amp;
      FILE='poetry.txt',  &amp;amp;
      FORM='FORMATTED',  &amp;amp;
      ACCESS='STREAM',  &amp;amp;
      ACTION='WRITE',  &amp;amp;
      STATUS='REPLACE' )
  
  WRITE (unit, "(A)", ADVANCE='NO') 'Mary had a '
  ! Remember where we are and leave a placeholder for now.
  INQUIRE(unit, POS=pos) ; print *, pos
  WRITE (unit, "(A7)", ADVANCE='NO') ''
  WRITE (unit, "(A)") ' processor'
  
  WRITE (unit, "(A)") 'ifort was its name'
  WRITE (unit, "(A)") 'but support for querying the file position after non-advancing formatted stream access output was broken'
  WRITE (unit, "(A)") 'so she had to rethink her game'
  
  WRITE (unit, "(A7)", POS=pos, ADVANCE='NO') 'Fortran'
  
  CLOSE(unit)
END PROGRAM poetic_streaming
&lt;/PRE&gt;

&lt;P&gt;Alas...&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;&amp;gt;ifort /check:all /warn:all /standard-semantics "2015-11-21 poetic_streaming.f90" &amp;amp;&amp;amp; "2015-11-21 poetic_streaming.exe" &amp;amp;&amp;amp; type poetry.txt
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0 Build 20151021
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

"-out:2015-11-21 poetic_streaming.exe"
-subsystem:console
"2015-11-21 poetic_streaming.obj"
 1
Fortran
a         processor
ifort was its name
but support for querying the file position after non-advancing formatted stream access output was broken
so she had to rethink her game&lt;/PRE&gt;

&lt;P&gt;I think I spy a stray newline in there too.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Nov 2015 20:55:48 GMT</pubDate>
    <dc:creator>IanH</dc:creator>
    <dc:date>2015-11-20T20:55:48Z</dc:date>
    <item>
      <title>File position inquiry with non-advancing formatted stream access and sheep</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/File-position-inquiry-with-non-advancing-formatted-stream-access/m-p/1077445#M120902</link>
      <description>&lt;P&gt;I've never been good at poetry... so I've started using Fortran to help me.&amp;nbsp; Getting the right number of syllables in each line has always been tricky, so sometimes I skip over bits, and then fill them in later.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;PROGRAM poetic_streaming
  IMPLICIT NONE
  
  INTEGER :: unit
  INTEGER :: pos
  
  OPEN(  &amp;amp;
      NEWUNIT=unit,  &amp;amp;
      FILE='poetry.txt',  &amp;amp;
      FORM='FORMATTED',  &amp;amp;
      ACCESS='STREAM',  &amp;amp;
      ACTION='WRITE',  &amp;amp;
      STATUS='REPLACE' )
  
  WRITE (unit, "(A)", ADVANCE='NO') 'Mary had a '
  ! Remember where we are and leave a placeholder for now.
  INQUIRE(unit, POS=pos) ; print *, pos
  WRITE (unit, "(A7)", ADVANCE='NO') ''
  WRITE (unit, "(A)") ' processor'
  
  WRITE (unit, "(A)") 'ifort was its name'
  WRITE (unit, "(A)") 'but support for querying the file position after non-advancing formatted stream access output was broken'
  WRITE (unit, "(A)") 'so she had to rethink her game'
  
  WRITE (unit, "(A7)", POS=pos, ADVANCE='NO') 'Fortran'
  
  CLOSE(unit)
END PROGRAM poetic_streaming
&lt;/PRE&gt;

&lt;P&gt;Alas...&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;&amp;gt;ifort /check:all /warn:all /standard-semantics "2015-11-21 poetic_streaming.f90" &amp;amp;&amp;amp; "2015-11-21 poetic_streaming.exe" &amp;amp;&amp;amp; type poetry.txt
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0 Build 20151021
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

"-out:2015-11-21 poetic_streaming.exe"
-subsystem:console
"2015-11-21 poetic_streaming.obj"
 1
Fortran
a         processor
ifort was its name
but support for querying the file position after non-advancing formatted stream access output was broken
so she had to rethink her game&lt;/PRE&gt;

&lt;P&gt;I think I spy a stray newline in there too.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 20:55:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/File-position-inquiry-with-non-advancing-formatted-stream-access/m-p/1077445#M120902</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2015-11-20T20:55:48Z</dc:date>
    </item>
    <item>
      <title>Baaaa-d. We'll haul out the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/File-position-inquiry-with-non-advancing-formatted-stream-access/m-p/1077446#M120903</link>
      <description>&lt;P&gt;Baaaa-d. We'll haul out the shepherd's crook for this if need be.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2015 23:05:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/File-position-inquiry-with-non-advancing-formatted-stream-access/m-p/1077446#M120903</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-11-20T23:05:57Z</dc:date>
    </item>
  </channel>
</rss>

