0 Replies - 6066 Views - Last Post: 05 November 2007 - 11:59 AM Rate Topic: -----

#1 scothoward  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 5
  • Joined: 17-October 07

Reading Data from File into Array - Fortran

Post icon  Posted 05 November 2007 - 11:59 AM

Hi,

I cannot seem to figure out how to read in data from a file into an array.

I used
open(unit=1, file="input.dat", status = "new", form = "formatted")


to open the file. However, I am unsure as what to do from there.

Here is part of the data file:

101
0.00000 2.00000
0.100000 2.00500
0.200000 2.02000
0.300000 2.04500

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.

Any guidance would be much appreciated.

Thanks!

Is This A Good Question/Topic? 1

Page 1 of 1