- #1
falcon0311
- 29
- 0
I know this isn't really physics related, but I was wondering if anyone here knows Fortran.
I'm trying to read a list of integers from a file and sort them. Well, I'm reading them and sorting them, but my problem is the list looks something like:
23
253
23
45
75
4
856
45
234
54
34
12
21
It's printing the total number of items as being 10, then it's printing this list:
0
165584
1633955692
1668244013
1697591601
1702047597
0
1731162226
0
925854305
Then it won't even write to the new file.
Here's my open statement,
open( unit = unitnum, file = infile, status = "old", action = "read", &
form = "binary", iostat = status )
I don't feel right about it, and if I try to change the form=, the program doesn't read the file altogether. Any help is much appreciated, and if you need to see anything else, by all means, let me know. Thank you.
I'm trying to read a list of integers from a file and sort them. Well, I'm reading them and sorting them, but my problem is the list looks something like:
23
253
23
45
75
4
856
45
234
54
34
12
21
It's printing the total number of items as being 10, then it's printing this list:
0
165584
1633955692
1668244013
1697591601
1702047597
0
1731162226
0
925854305
Then it won't even write to the new file.
Here's my open statement,
open( unit = unitnum, file = infile, status = "old", action = "read", &
form = "binary", iostat = status )
I don't feel right about it, and if I try to change the form=, the program doesn't read the file altogether. Any help is much appreciated, and if you need to see anything else, by all means, let me know. Thank you.