- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is my code, work in windows but not in linux:
program circle
CHARACTER*1 A
INTEGER IOS
OPEN(UNIT = 789,
& FILE= 'charlie.dem',
& FORM = 'FORMATTED',
& ACCESS = 'DIRECT',
& RECL = 1,
& STATUS = 'OLD',
& ERR = 93)
READ(789, REC = 1) A
READ(789, REC = 3, IOSTAT=IOS) A
write (*,*) 'IOS=',IOS,' A=',A
93 write (*,*) 'you have passed...'
stop
end
The file charlie.dem is normal text file you can create by youself.
But in linux I get following error:
forrtl: severe (257): formatted I/O to unit open for unformatted transfers, unit 789, file /home/rong/carmenrt_building/aermap/430/charlie.dem
Image PC Routine Line Source
debugme 080948AF Unknown Unknown Unknown
debugme 08093ECF Unknown Unknown Unknown
debugme 08076F76 Unknown Unknown Unknown
debugme 08069C92 Unknown Unknown Unknown
debugme 0806992D Unknown Unknown Unknown
debugme 080533EA Unknown Unknown Unknown
debugme 08049C3C Unknown Unknown Unknown
debugme 08049B31 Unknown Unknown Unknown
libc.so.6 00740AD4 Unknown Unknown Unknown
debugme 08049A61 Unknown&n bsp; Unknown Unknown
Build this program using: ifort -o debug.exe debug.for.
Please help!!!
program circle
CHARACTER*1 A
INTEGER IOS
OPEN(UNIT = 789,
& FILE= 'charlie.dem',
& FORM = 'FORMATTED',
& ACCESS = 'DIRECT',
& RECL = 1,
& STATUS = 'OLD',
& ERR = 93)
READ(789, REC = 1) A
READ(789, REC = 3, IOSTAT=IOS) A
write (*,*) 'IOS=',IOS,' A=',A
93 write (*,*) 'you have passed...'
stop
end
The file charlie.dem is normal text file you can create by youself.
But in linux I get following error:
forrtl: severe (257): formatted I/O to unit open for unformatted transfers, unit 789, file /home/rong/carmenrt_building/aermap/430/charlie.dem
Image PC Routine Line Source
debugme 080948AF Unknown Unknown Unknown
debugme 08093ECF Unknown Unknown Unknown
debugme 08076F76 Unknown Unknown Unknown
debugme 08069C92 Unknown Unknown Unknown
debugme 0806992D Unknown Unknown Unknown
debugme 080533EA Unknown Unknown Unknown
debugme 08049C3C Unknown Unknown Unknown
debugme 08049B31 Unknown Unknown Unknown
libc.so.6 00740AD4 Unknown Unknown Unknown
debugme 08049A61 Unknown&n bsp; Unknown Unknown
Build this program using: ifort -o debug.exe debug.for.
Please help!!!
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The error message is backwards - it should say "unformatted I/O to unit open for formatted transfers". You opened unit 789 FORMATTED but are doing unformatted READs from it. Can't do that. My suggestion is that you probably wanted the OPEN to say UNFORMATTED.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By the way, it doesn't work on Windows either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I solve this in Linux by:
IOS= 0 A=c
you have passed...
program circleD:aermap_testcase430 un>circle.exe
CHARACTER*1 A
INTEGER IOS
OPEN(UNIT = 789,
& FILE= 'charlie.dem',
& FORM = 'FORMATTED',
& ACCESS = 'DIRECT',
& RECL = 1,
& STATUS = 'OLD',
& ERR = 93)
READ(789, 6, REC = 1) A
6 format(a1) ---- specify format
READ(789, 7, REC = 3, IOSTAT=IOS) A
7 format(a1) ----- specify format
write (*,*) 'IOS=',IOS,' A=',A
93 write (*,*) 'you have passed...'
stop
end
But the old code do work in windows, I build with compaq virtual fortran 6.6, here it is output
in windows:
IOS= 0 A=c
you have passed...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok. It does not work using Intel Fortran on Windows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe that means inter-compiler is more strong-typed than microsoft compiler...:)
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