<?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: Reading from data file fortran in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251574#M154179</link>
    <description>&lt;P&gt;In addition to the books recommended by FortranFan, Google is your friend.&lt;/P&gt;
&lt;P&gt;e.g. Fortran read statement&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
    <pubDate>Sat, 30 Jan 2021 14:07:29 GMT</pubDate>
    <dc:creator>jimdempseyatthecove</dc:creator>
    <dc:date>2021-01-30T14:07:29Z</dc:date>
    <item>
      <title>Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251275#M154155</link>
      <description>&lt;P&gt;I have a .txt file containing 1 column and 101 rows. For example the first 4 rows are as follows:&lt;BR /&gt;0.00000E+00&lt;BR /&gt;6.28215E+15&lt;BR /&gt;1.25581E+16&lt;BR /&gt;1.88217E+16&lt;/P&gt;
&lt;P&gt;I want to read the values in and store them for use in calculations.&lt;/P&gt;
&lt;P&gt;How would I tackle this?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 11:48:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251275#M154155</guid>
      <dc:creator>95pdempsey</dc:creator>
      <dc:date>2021-01-29T11:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251277#M154156</link>
      <description>&lt;P&gt;This is a very basic question. Is it a homework assignment?&lt;/P&gt;
&lt;P&gt;Any textbook on Fortran ought to give you the clues for solving this "problem". But here are some clues:&amp;nbsp; use an array and the open and read statements&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 11:53:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251277#M154156</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2021-01-29T11:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251284#M154157</link>
      <description>I’m doing an introductory fortran course.&lt;BR /&gt;It’s just an example I’ve been asked to do but can’t figure it out.&lt;BR /&gt;I’ve managed to open the file and read it by using:&lt;BR /&gt;read (10,*)a,b &lt;BR /&gt;but that only reads the first 2 lines. Is there a way to read all lines and assign all values to something without typing out 101 different variables?</description>
      <pubDate>Fri, 29 Jan 2021 12:07:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251284#M154157</guid>
      <dc:creator>95pdempsey</dc:creator>
      <dc:date>2021-01-29T12:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251288#M154158</link>
      <description>&lt;P&gt;Ah, that explains it :). Well, certainly there is. There is a wide variety of possibilities actually.&lt;/P&gt;
&lt;P&gt;Since you are doing an introductory course, try the following (without giving you a ready-made solution by the way):&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Declare a real array of size 101, call it, for instance, mydata&lt;/LI&gt;
&lt;LI&gt;Use the read statement to read in the entire array&lt;/LI&gt;
&lt;LI&gt;If you want to know a single value, you can do so by:&lt;/LI&gt;
&lt;/UL&gt;
&lt;LI-CODE lang="fortran"&gt;write(*,*) mydata(10)   ! Print the tenth element&lt;/LI-CODE&gt;
&lt;P&gt;This is a straightforward way to read the data, but it assumes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;you know the number of data beforehand&lt;/LI&gt;
&lt;LI&gt;the file contains the data in the form you specified (one value per line) or as a number of values on a line, as long as there are spaces between the data and no text etc. in between&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If these conditions are not met, you will get a run-time error.&lt;/P&gt;
&lt;P&gt;If you need to make your program more robust or more flexible, there is more work involved, but the above sketch should get you going.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 12:19:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251288#M154158</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2021-01-29T12:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251293#M154159</link>
      <description>&lt;P&gt;Thanks very much I'll give this a go and see how it goes.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 12:44:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251293#M154159</guid>
      <dc:creator>95pdempsey</dc:creator>
      <dc:date>2021-01-29T12:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251297#M154160</link>
      <description>&lt;P&gt;My code is as follows:&lt;/P&gt;
&lt;P&gt;program list&lt;/P&gt;
&lt;P&gt;integer :: err&lt;BR /&gt;character(256) :: err_msg&lt;BR /&gt;real, dimension(101) :: flux&lt;/P&gt;
&lt;P&gt;open(10, file='flux.txt', status='old', iostat=err, iomsg=err_msg)&lt;BR /&gt;if(err /= 0) then&lt;BR /&gt;write (*,*) 'Error ', trim(err_msg)&lt;BR /&gt;stop&lt;BR /&gt;endif&lt;/P&gt;
&lt;P&gt;read (10,*)&lt;/P&gt;
&lt;P&gt;print(*,*) flux(10)&lt;/P&gt;
&lt;P&gt;end&lt;/P&gt;
&lt;P&gt;but this error message is showing:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;print(*,*) flux(10)&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Error: Syntax error in PRINT statement at (1)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What am I doing wrong?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 13:00:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251297#M154160</guid>
      <dc:creator>95pdempsey</dc:creator>
      <dc:date>2021-01-29T13:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251306#M154161</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/149845"&gt;@95pdempsey&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Can you please share here just what kind on instructional material (textbook(s) and/or lecture notes and/or blogs or videos?) do you have for this introductory course in Fortran?&amp;nbsp; Have you gone through such material with a thoroughness the instructor would expect of anyone taking the course?&amp;nbsp; Because you're asking the most basic questions.&amp;nbsp; The material you have should show the following is invalid:&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;print (*,*) !&amp;lt;-- Invalid syntax&lt;/LI-CODE&gt;
&lt;P&gt;Re: each statements in Fortran (or any other learning for that matter), why not adopt the RTFM approach? e.g., consult the information available at your fingertips such as Intel documentation online.&amp;nbsp; Here it is for PRINT statement:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://software.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/language-reference/a-to-z-reference/o-to-p/print.html" target="_blank"&gt;https://software.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/language-reference/a-to-z-reference/o-to-p/print.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In case you find your instructional material inadequate, you can start with some free stuff online to get&amp;nbsp; you going immediately like the following from UNLV:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.egr.unlv.edu/~ed/fortran.html" target="_blank"&gt;http://www.egr.unlv.edu/~ed/fortran.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Or, you can look into getting your hands on a formal textbook such as this one:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.amazon.com/Fortran-Scientists-Engineers-Stephen-Chapman-ebook/dp/B06XCTY8KR" target="_blank"&gt;https://www.amazon.com/Fortran-Scientists-Engineers-Stephen-Chapman-ebook/dp/B06XCTY8KR&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 13:28:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251306#M154161</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2021-01-29T13:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251330#M154164</link>
      <description>&lt;P&gt;Look at your read statement from your first attempt&lt;BR /&gt;and compare it to the read statement from your second attempt.&lt;/P&gt;
&lt;P&gt;What is missing?&lt;BR /&gt;And more important, what is the relationship between the read and what is missing?&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 15:41:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251330#M154164</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2021-01-29T15:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251549#M154175</link>
      <description>&lt;P&gt;Due to Covid everything has been online so the teaching hasn't been great. I have been given 5 PowerPoints each with about 10 slides on so haven't been given much information to go off. I haven't been given access to a manual so I'm sure you can see that a RTFM approach could be quite difficult without a manual.&lt;/P&gt;
&lt;P&gt;The manual you have given me here seems excellent though so thank you very much for that it will be a great help. I will go through this today and hopefully that will solve the problems I am having.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2021 10:41:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251549#M154175</guid>
      <dc:creator>95pdempsey</dc:creator>
      <dc:date>2021-01-30T10:41:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251550#M154176</link>
      <description>&lt;P&gt;Thanks for your response. I'm about to start working on my code again now so hopefully I can solve my problem.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2021 10:42:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251550#M154176</guid>
      <dc:creator>95pdempsey</dc:creator>
      <dc:date>2021-01-30T10:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251569#M154177</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/149845"&gt;@95pdempsey&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;As part of your studies, note if you're interested in computing generally and also the upcoming fields in "data sciences" and numerical programming, you can get a book bundle for $12 that includes a good book on "modern Fortran" as well:&amp;nbsp;&lt;A href="https://www.humblebundle.com/books/math-for-programmers-manning-publications-books" target="_blank"&gt;https://www.humblebundle.com/books/math-for-programmers-manning-publications-books&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In terms of readily accessible resources online, do keep in mind the Fortran Wiki site:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://fortranwiki.org/fortran/show/HomePage" target="_blank"&gt;http://fortranwiki.org/fortran/show/HomePage&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2021 13:46:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251569#M154177</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2021-01-30T13:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251570#M154178</link>
      <description>&lt;P&gt;Ok thanks for this I will make sure to check them out.&lt;/P&gt;
&lt;DIV class="page" title="Page 1"&gt;
&lt;DIV class="layoutArea"&gt;
&lt;DIV class="column"&gt;
&lt;P&gt;&lt;SPAN&gt;The "Introduction to Programming&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;using Fortran 95/2003/2008" pdf you sent me has been brilliant so far I have learnt more from this in the past hour or so than I have across the entire course I am on so thanks a lot for that I would highly recommend it for beginners.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 30 Jan 2021 13:51:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251570#M154178</guid>
      <dc:creator>95pdempsey</dc:creator>
      <dc:date>2021-01-30T13:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251574#M154179</link>
      <description>&lt;P&gt;In addition to the books recommended by FortranFan, Google is your friend.&lt;/P&gt;
&lt;P&gt;e.g. Fortran read statement&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2021 14:07:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1251574#M154179</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2021-01-30T14:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reading from data file fortran</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1252016#M154185</link>
      <description>&lt;P&gt;You can download the Intel Fortran manuals - search for the PDF versions, there are simple examples available to anyone with each reference example in the manual.&amp;nbsp; These help more than most textbooks.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have hit the right place, but to ensure you learn, these guys will make you work for it, but they mean well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I learnt lisp alone from the reference manual -- I can remember one line took a week to debug.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are in world class company - so good luck --&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 17:48:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-from-data-file-fortran/m-p/1252016#M154185</guid>
      <dc:creator>JohnNichols</dc:creator>
      <dc:date>2021-02-01T17:48:43Z</dc:date>
    </item>
  </channel>
</rss>

