- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am currently working on my final year project related to fortran 77.
I encounter some binary (sequential) files created by Fortran 77 in UNIX system, I try to read the file using my Compaq Visual Fortran 6.1A in PC but there are always error while reading the file.
As I do not have access to UNIX system, is there any way for me to convert the file to a text file in pc or read it using fortran 77 in pc?
Thank you for your help
I encounter some binary (sequential) files created by Fortran 77 in UNIX system, I try to read the file using my Compaq Visual Fortran 6.1A in PC but there are always error while reading the file.
As I do not have access to UNIX system, is there any way for me to convert the file to a text file in pc or read it using fortran 77 in pc?
Thank you for your help
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ops, I think I made some mistake.
What I really mean is how to convert a fortran 77 binary file created in UNIX system to a text file or Fortran 77 binary file for Window 98.
What I really mean is how to convert a fortran 77 binary file created in UNIX system to a text file or Fortran 77 binary file for Window 98.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which UNIX system? Which Fortran 77 on UNIX? Most UNIX Fortran compilers create unformatted files in a method that is compatible with that used by Visual Fortran, but if the UNIX system is "big-endian" (Sun, IBM, HP, SGI), you'll need to open the file with CONVERT='BIG_ENDIAN' to do the length and data conversion.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve, in fact I'm not 100% sure this is the source of the problem. The following is the error I get:
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
forrtl: severe <257>: formatted I/O to unit open for unformatted transfers, unit 20, file d:@fypTPXO.5h_TPXO.T.1.ot
Image pc routine line source
program1.exe 00409b79 unknown unknown unknown
...
...
kernel32.dll bff7b9e4 unknown unknown unknown
kernel32.dll bff7b896 unknown unknown unknown
kernel32.dll bff7a24f unknown unknown unknown
Stack trace terminated abnormally
Incrementally linked image--PC correlation disabled.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
I tried to use "form=formatted" to open the file, there was no error but I could only saw those binary symbols.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
forrtl: severe <257>: formatted I/O to unit open for unformatted transfers, unit 20, file d:@fypTPXO.5h_TPXO.T.1.ot
Image pc routine line source
program1.exe 00409b79 unknown unknown unknown
...
...
kernel32.dll bff7b9e4 unknown unknown unknown
kernel32.dll bff7b896 unknown unknown unknown
kernel32.dll bff7a24f unknown unknown unknown
Stack trace terminated abnormally
Incrementally linked image--PC correlation disabled.
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
I tried to use "form=formatted" to open the file, there was no error but I could only saw those binary symbols.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This has nothing to do with the file. Your Fortran code is doing formatted I/O to the unit, but you want unformatted. Remove the format specifier.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Steve. I got it now, that's quite stupid i think.
So when will I know that the unformatted sequential file can't be open by CONVERT='NATIVE' ? Cos I keep getting forrtl <22> now, but even if I set the recl = a very big number like 60000000, i still get the error.
So when will I know that the unformatted sequential file can't be open by CONVERT='NATIVE' ? Cos I keep getting forrtl <22> now, but even if I set the recl = a very big number like 60000000, i still get the error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to know what system wrote the file and whether it is compatible with PCs and CVF. I don't know of any automatic way to find out.
Steve
Steve
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page