Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Unable to close file

tjt
Beginner
514 Views
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


0 Kudos
1 Reply
Steven_L_Intel1
Employee
514 Views
Do you somehow expect the value of three_is_open to automatically change without doing another INQUIRE?
0 Kudos
Reply