Reading Data from File into Array - Fortran

liunx

Guest
Hi,<br /><br />I cannot seem to figure out how to read in data from a file into an array.<br /><br />I used<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->open(unit=1, file="input.dat", status = "new", form = "formatted")<!--c2--></div><!--ec2--><br /><br />to open the file. However, I am unsure as what to do from there.<br /><br />Here is part of the data file:<br /><br />101<br />0.00000 2.00000<br />0.100000 2.00500<br />0.200000 2.02000<br />0.300000 2.04500<br /><br />The first line has the integer (101) indicating the number of data points. Each line after than has one pair of values (x,y) representing each data point.<br /><br />Any guidance would be much appreciated.<br /><br />Thanks!
</div>
 
Top