- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Does anybody know any reason why it would be imnpossible to close a file?
Compiled using Intel Fortran 11.1 on Windows XP 64 bit.
I am a little bit stuck...
logical three_is_open
inquire(unit=3,OPENED=three_is_open)
print*,' checking 3'
if(three_is_open) then
print*,' three_is_open = ',three_is_open
close(3)
print*,' 3 is closed '
endif
print*,' checking 3 again'
if(three_is_open) then
print*,' three_is_open = ',three_is_open
close(3)
print*,' 3 is closed '
endif
call close_file_3()
print*,' checking 3 yet again'
if(three_is_open) then
print*,' three_is_open = ',three_is_open
close(3)
print*,' 3 is closed '
endif
c ---------------------------------------------------------------------
c ---------------------------------------------------------------------
subroutine close_file_3()
c ---------------------------------------------------------------------
close(3)
c ---------------------------------------------------------------------
return
end
Screen output:
checking 3
three_is_open = T
3 is closed
checking 3 again
three_is_open = T
3 is closed
checking 3 yet again
three_is_open = T
3 is closed
Does anybody know any reason why it would be imnpossible to close a file?
Compiled using Intel Fortran 11.1 on Windows XP 64 bit.
I am a little bit stuck...
logical three_is_open
inquire(unit=3,OPENED=three_is_open)
print*,' checking 3'
if(three_is_open) then
print*,' three_is_open = ',three_is_open
close(3)
print*,' 3 is closed '
endif
print*,' checking 3 again'
if(three_is_open) then
print*,' three_is_open = ',three_is_open
close(3)
print*,' 3 is closed '
endif
call close_file_3()
print*,' checking 3 yet again'
if(three_is_open) then
print*,' three_is_open = ',three_is_open
close(3)
print*,' 3 is closed '
endif
c ---------------------------------------------------------------------
c ---------------------------------------------------------------------
subroutine close_file_3()
c ---------------------------------------------------------------------
close(3)
c ---------------------------------------------------------------------
return
end
Screen output:
checking 3
three_is_open = T
3 is closed
checking 3 again
three_is_open = T
3 is closed
checking 3 yet again
three_is_open = T
3 is closed
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you somehow expect the value of three_is_open to automatically change without doing another INQUIRE?

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