<?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 Steve, Yes the line: read (9, in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019293#M107793</link>
    <description>&lt;P&gt;Steve, Yes the line: read (9,*) skipped the line and this fixed the error. Thank you very much for pointing this out for me. My intention was to read all the sets of numbers corresponding to the 11 years, I understand that I could do this by keeping this read statement with in a do-loop, and also do the same for the write statement.&lt;/P&gt;

&lt;P&gt;I had two questions in accomplishing this:&lt;/P&gt;

&lt;P&gt;(i) Since the years are contiguous, I am trying to store just the start year and the number of years, what would be syntax for accomplishing this, for the integer array for year "yr"&lt;/P&gt;

&lt;P&gt;(ii) If I place the iteration statement for the 11 years (as it may be suggested in (i) above), elsewhere other than within the read or write statements would it still read and write all the 11 values (assuming that both the read and write statements are both enclosed by just "do", and "endo").&lt;/P&gt;

&lt;P&gt;As always thank you very much for your valuable suggestions.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Feb 2015 05:20:04 GMT</pubDate>
    <dc:creator>bhvj</dc:creator>
    <dc:date>2015-02-24T05:20:04Z</dc:date>
    <item>
      <title>List Directed I/O Error</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019291#M107791</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;As can be seen in the attached program, when I am trying to open, read and write data into an array, I am getting an error which says as follows:&lt;/P&gt;

&lt;P&gt;"forrtl: severe (59): list-directed I/O syntax error".&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	Any suggestions or insight into this would be greatly helpful.&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 00:18:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019291#M107791</guid>
      <dc:creator>bhvj</dc:creator>
      <dc:date>2015-02-24T00:18:51Z</dc:date>
    </item>
    <item>
      <title>Your file has column headers</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019292#M107792</link>
      <description>&lt;P&gt;Your file has column headers which you need to skip. The line:&lt;/P&gt;

&lt;P&gt;read (9,*)&lt;/P&gt;

&lt;P&gt;will do it. But your program reads only one set of numbers - is that intentional?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 00:49:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019292#M107792</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2015-02-24T00:49:30Z</dc:date>
    </item>
    <item>
      <title>Steve, Yes the line: read (9,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019293#M107793</link>
      <description>&lt;P&gt;Steve, Yes the line: read (9,*) skipped the line and this fixed the error. Thank you very much for pointing this out for me. My intention was to read all the sets of numbers corresponding to the 11 years, I understand that I could do this by keeping this read statement with in a do-loop, and also do the same for the write statement.&lt;/P&gt;

&lt;P&gt;I had two questions in accomplishing this:&lt;/P&gt;

&lt;P&gt;(i) Since the years are contiguous, I am trying to store just the start year and the number of years, what would be syntax for accomplishing this, for the integer array for year "yr"&lt;/P&gt;

&lt;P&gt;(ii) If I place the iteration statement for the 11 years (as it may be suggested in (i) above), elsewhere other than within the read or write statements would it still read and write all the 11 values (assuming that both the read and write statements are both enclosed by just "do", and "endo").&lt;/P&gt;

&lt;P&gt;As always thank you very much for your valuable suggestions.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 05:20:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019293#M107793</guid>
      <dc:creator>bhvj</dc:creator>
      <dc:date>2015-02-24T05:20:04Z</dc:date>
    </item>
    <item>
      <title>You've still got a couple of</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019294#M107794</link>
      <description>&lt;P&gt;You've still got a couple of fundamental Fortran concepts to understand.&lt;/P&gt;

&lt;P&gt;You've declared your real array as having the indices (11,3), which means the first index ranges from 1-&amp;gt;11, the second from 1-&amp;gt;3.&lt;/P&gt;

&lt;P&gt;Unfortunately, inside the DO loop, you're using the year as an index, which is accessing quite outside of the range of the array.&amp;nbsp;&amp;nbsp; It's like saying that you want to read page 1964 of a book that only has 11 pages.&lt;/P&gt;

&lt;P&gt;Second, you've declared the year variable as an array, and so the list-directed I/O is trying to fill that array before it goes on to find the values for the real array.&lt;/P&gt;

&lt;P&gt;To answer your other questions, if you just want the START and END (or number of) years, there are many ways to do that.&amp;nbsp;&amp;nbsp; Probably the least clever way is to have a variable named START that's initialized to an invalid number (negative?&amp;nbsp; zero?) and then give it the first value of YR.&lt;/P&gt;

&lt;P&gt;I'm sure you can figure a way to count iterations.&lt;/P&gt;

&lt;P&gt;I don't understand the second question.&lt;/P&gt;

&lt;P&gt;Here's a modified version of your first program, with a 'print' statement to help illustrate it.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROGRAM rctbl&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPLICIT NONE&lt;BR /&gt;
	! Declarations&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER :: yr&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER :: i,j&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REAL&amp;nbsp;&amp;nbsp;&amp;nbsp; :: param(11,3)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character*80 header&lt;BR /&gt;
	! Opening input file&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OPEN (9,file='rc_tbl.txt',status='old')&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; read (9, *) header&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DO i=1,11&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; READ(9,*,END=101)yr, (param(i,j), j=1,3)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print *, "year is", yr, "params are ", param(i,1), param(i,2), param(i,3)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END DO&lt;BR /&gt;
	101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLOSE (9)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WRITE (*,*) param(4,2)&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; END PROGRAM rctbl&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 11:42:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019294#M107794</guid>
      <dc:creator>Lorri_M_Intel</dc:creator>
      <dc:date>2015-02-24T11:42:45Z</dc:date>
    </item>
    <item>
      <title>Thank you very much Lorri,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019295#M107795</link>
      <description>&lt;P&gt;Thank you very much Lorri,&lt;/P&gt;

&lt;P&gt;Your detailed response helped me thoroughly understand&lt;BR /&gt;
	to read my table into an array and then and then write the appropriate values from this&lt;BR /&gt;
	table.&lt;/P&gt;

&lt;P&gt;As regards my other questions:&lt;/P&gt;

&lt;P&gt;(i) I am trying to use this program as a lookup table in order to retrieve a&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; table value based on the year value as an index, that corresponds to a&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; specified header, in order to use it in an equation. Any suggestions as regards&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; an efficient way to do this would be greatly helpful.&lt;BR /&gt;
	(ii) My second question in my previous post was about the instances where we can use&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the "Do" and "END DO" without the indices and still achieve the objective of going through the iterations, if the indices are mentioned elsewhere in the program.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank very much once again for your valuable responses.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 16:18:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/List-Directed-I-O-Error/m-p/1019295#M107795</guid>
      <dc:creator>bhvj</dc:creator>
      <dc:date>2015-02-24T16:18:52Z</dc:date>
    </item>
  </channel>
</rss>

