Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

unit 99 - debug?

davidgraham
Beginner
593 Views
I'm calling the "Print_Unit" routine in fortran_Winprint.f90.
I have opened file 99 with open (99,FILE='c:grade est eport.log')
In "Print_Unit" on line - read (unit,'(Q,A)',end=80000) line_len, line
I get he error file not found 'c:grade estfort.99'

It works OK on most computers (including mine) but not on one or two others.

Somewhere unit 99 must be getting currupted.
How can I debug it to find out when unit 99 is changed.
How can I print out the value of unit 99?

Thanks,
David
0 Kudos
3 Replies
Steven_L_Intel1
Employee
593 Views
You can use:

CHARACTER(255) filename
...
INQUIRE (UNIT=99,NAME=filename)
PRINT *, trim(filename)

Does the OPEN statement really look the way you show it or are you using a variable to construct the filename? It seems as if the path was there nut not the 'report.log' part.
0 Kudos
davidgraham
Beginner
593 Views
Thanks for the help. I can now track the problem a bit more. The PrintDlg routine is causing the filename to be lost.

open (98,FILE="c:	empdebug.txt")

INQUIRE (UNIT=unit,NAME=filename)
write (98,'(2A)') "1",trim(filename)

Last_Error = PrintDlg (PRINTDLG_Struct)


INQUIRE (UNIT=unit,NAME=filename)
write (98,'(2A)') "2",trim(filename)

When I print debug.txt I get the following
1C:GradedataTest eport.log
2

Any ideas what could be causing the problem? It is OK on some computers but not on others.
David






0 Kudos
Steven_L_Intel1
Employee
593 Views
Can you provide a short but complete program that shows the problem? (No need to include the module source.unless you have edited it.)
0 Kudos
Reply