Question: HELP WITH FORTRAN CODE User needs to type in a filename to read in the data. (Your program will ask the user to type in

HELP WITH FORTRAN CODE

User needs to type in a filename to read in the data. (Your program will ask the user to type in the data file name.)

Read in the data into an array. Your array that stores the data will be allocatable. Only allocate enough memory to store the number of values indicated by the first number. Properly deallocate memory before your program quits.

Once you set up everything I want to be able to type in a file name then the code reads what's in the file and prints it out. In this case it prints out all the numbers in the Numbers.txt file.

The file is a txt file. this is what's in the txt file: ( name of the file is Numbers.txt)

60000 0.164270401 262.293457 367.711670 131.652710 188.111908 98.1428604 487.936859 256.158936 265.224457 128.550766 53.5435677

This is my code so far but it's not working.

program numbers implicit none

character filename*100

print *, 'Enter filename' read '(A)', filename open(10, file=filename) read(10,*) filename print*, filename close(10)

end program numbers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!