<?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 Many Thanks! Now everything in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-some-matrices-from-file/m-p/1158346#M142224</link>
    <description>&lt;P&gt;&lt;SPAN style="color: rgb(33, 33, 33); font-family: arial, sans-serif; font-size: 16px; white-space: pre-wrap;"&gt;&lt;STRONG&gt;Many Thanks!&lt;/STRONG&gt; Now everything works. This looks so easy when you know how!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Jul 2017 21:18:34 GMT</pubDate>
    <dc:creator>chri</dc:creator>
    <dc:date>2017-07-31T21:18:34Z</dc:date>
    <item>
      <title>Reading some matrices from file</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-some-matrices-from-file/m-p/1158344#M142222</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I am pretty &lt;EM&gt;new to Fortran&lt;/EM&gt; and fail since a few days to a initial problem.&lt;BR /&gt;
	I am not able to bring data given by a xml file to my Fortran program.(Matrices)&lt;/P&gt;

&lt;P&gt;I have data provided in an XML file.&amp;nbsp;&lt;BR /&gt;
	It is structured something like:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&amp;lt;FIELDNAME&amp;gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ROWS&amp;gt;?&amp;lt;/ROWS&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;COLS&amp;gt;?&amp;lt;/COLS&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;DATA&amp;gt;?&amp;lt;/DATA&amp;gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;
	&lt;SPAN style="font-size: 1em;"&gt;&lt;STRONG&gt;&amp;lt;/FIELDNAME&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;
	...then comes the next &lt;STRONG&gt;&amp;lt;FIELDNAME&amp;gt;&lt;/STRONG&gt; ... ... ... ? represents a double(kind=8)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;I have written a parser in vb.net and now i am able to create a *.dat file in every way i like it.&lt;BR /&gt;
	My newest attempt is simply structured like:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;FIELDNAME&lt;/STRONG&gt; as character(10)&lt;BR /&gt;
	&lt;STRONG&gt;NUMBER OF ROWS&lt;/STRONG&gt; as character(10)&lt;BR /&gt;
	&lt;STRONG&gt;NUMBER OF COLUMNS&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;as character(10)&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;STRONG&gt;?(1,1)&lt;/STRONG&gt;&lt;BR /&gt;
	&lt;STRONG&gt;?(2,1)&lt;/STRONG&gt;&lt;BR /&gt;
	... ... ... till the next FIELDNAME&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;... ... ... ? represents a double(kind=8)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;In the file it looks like:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;MATRIX1&lt;BR /&gt;
	3.0&lt;BR /&gt;
	3.0&lt;BR /&gt;
	1.0E-18&lt;BR /&gt;
	2.0&lt;BR /&gt;
	3&lt;BR /&gt;
	4.0E+5&lt;BR /&gt;
	5.0&lt;BR /&gt;
	6.0&lt;BR /&gt;
	7.0&lt;BR /&gt;
	8.0&lt;BR /&gt;
	9.0&lt;BR /&gt;
	MATRIX2&lt;BR /&gt;
	...&lt;BR /&gt;
	...&lt;/STRONG&gt;&lt;BR /&gt;
	...&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;The FIELDNAMEs are always the same ~30 Fieldnames in the same order containing Martices.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I thought it would be easy to bring the data into my program cause i can format it as i wish in vb.net but i fail. I also fail when i try to do it with vb.net and try to pass the arrays to fortran as such(I don't want to do it this way anymore cause all description i found in the internet are done like kidding me.) Using FoX compiled under VisualStudio to read from the input.xml itself also was not possible.&lt;STRONG&gt; I've wastet several days to this.&lt;/STRONG&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Has someone an Code example or something similar for me how this, in this case "initial step" can be done?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;
	&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: rgb(33, 33, 33); font-family: arial, sans-serif; font-size: 16px; white-space: pre-wrap;"&gt;I would be very glad if someone could help me!&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 19:15:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-some-matrices-from-file/m-p/1158344#M142222</guid>
      <dc:creator>chri</dc:creator>
      <dc:date>2017-07-31T19:15:07Z</dc:date>
    </item>
    <item>
      <title>I will not bother with XML or</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-some-matrices-from-file/m-p/1158345#M142223</link>
      <description>&lt;P&gt;I will not bother to comment on XML data files or the use of VB programs to convert XML to simpler text files, but you may want to consult available XML libraries if you want to do this.&lt;/P&gt;

&lt;P&gt;Assuming that you have the data in the format that you showed, we can do the following. First, show the matrix size using integers rather than real numbers. That is, your second and third lines should contain "3", not "3.0". Flesh out and run the Fortran program below, and make it read your formatted data file as standard input.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program readmat
implicit none
integer :: nrows,ncols
real, dimension(:,:), allocatable :: M1, M2
character(10) :: matname
!
read(*,'(A)')matname
read(*,*)nrows
read(*,*)ncols
!
allocate(M1(nrows,ncols))
read(*,*)M1
!&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 20:34:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-some-matrices-from-file/m-p/1158345#M142223</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2017-07-31T20:34:00Z</dc:date>
    </item>
    <item>
      <title>Many Thanks! Now everything</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-some-matrices-from-file/m-p/1158346#M142224</link>
      <description>&lt;P&gt;&lt;SPAN style="color: rgb(33, 33, 33); font-family: arial, sans-serif; font-size: 16px; white-space: pre-wrap;"&gt;&lt;STRONG&gt;Many Thanks!&lt;/STRONG&gt; Now everything works. This looks so easy when you know how!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jul 2017 21:18:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Reading-some-matrices-from-file/m-p/1158346#M142224</guid>
      <dc:creator>chri</dc:creator>
      <dc:date>2017-07-31T21:18:34Z</dc:date>
    </item>
  </channel>
</rss>

