Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26743 Discussions

forte (39): error during read unit 0, file conout$

Giulio_P_
Beginner
323 Views

Hi,

​I'm working on a code developed in Visual Studio. If I run the cose in debug mode the code works. If I run the code in release mode there is an error:

 forrtl: The handle is invalid

 forte (39): error during read unit 0, file conout$

How can I fix it?

0 Kudos
1 Solution
Steve_Lionel
Black Belt Retired Employee
323 Views

Reading from unit 0, stderr, is very unusual. I would agree with Arjen that uninitialized variables are likely, though in release mode I would not expect it to use unit zero.

You can enable the traceback option in the Release mode (Fortran > Run-Time > Generate traceback), and then when you get the error it will tell you at which line the error occurred. That should give you a head start.

View solution in original post

9 Replies
Arjen_Markus
Valued Contributor III
323 Views

You do not give us much to go on - like the code that exhibits this problem. So we can only speculate.

This type of things - different behaviour between the Debug and Release version, or even running within or without the debugger - is often an indication of uninitialised variables. Apparently, your program is reading from one or more files. I would check the LU-numbers for these files and see whether the variables used all have proper values assigned to them. Beyond that advice, it is best to provide us with a small program that demostrates the problem.

Giulio_P_
Beginner
323 Views

Arjen Markus wrote:

You do not give us much to go on - like the code that exhibits this problem. So we can only speculate.

This type of things - different behaviour between the Debug and Release version, or even running within or without the debugger - is often an indication of uninitialised variables. Apparently, your program is reading from one or more files. I would check the LU-numbers for these files and see whether the variables used all have proper values assigned to them. Beyond that advice, it is best to provide us with a small program that demostrates the problem.

Thank you for you reply. The code is too large and I can not attached. Maybe there is some uninitialised variables. Is there a way to find them? 

 

Arjen_Markus
Valued Contributor III
323 Views

One possibility - though it may not be 100% foolproof - is to add the compiler option /RTCu which will report the use of uninitialised variables.

Giulio_P_
Beginner
323 Views

Arjen Markus wrote:

One possibility - though it may not be 100% foolproof - is to add the compiler option /RTCu which will report the use of uninitialised variables.

Thanks again. Do you know how can I do it in Visual Studio? 

Steve_Lionel
Black Belt Retired Employee
324 Views

Reading from unit 0, stderr, is very unusual. I would agree with Arjen that uninitialized variables are likely, though in release mode I would not expect it to use unit zero.

You can enable the traceback option in the Release mode (Fortran > Run-Time > Generate traceback), and then when you get the error it will tell you at which line the error occurred. That should give you a head start.

View solution in original post

Giulio_P_
Beginner
323 Views

Steve Lionel (Ret.) wrote:

Reading from unit 0, stderr, is very unusual. I would agree with Arjen that uninitialized variables are likely, though in release mode I would not expect it to use unit zero.

You can enable the traceback option in the Release mode (Fortran > Run-Time > Generate traceback), and then when you get the error it will tell you at which line the error occurred. That should give you a head start.

Thank you so much Mr. Lionel. Could you tell me more about Generate traceback? I can't find it. I use Visual Studio 2015. 

Thank you again.

andrew_4619
Honored Contributor I
323 Views

Configuration Properties > Fortran > Run-Time > Generate Traceback Information >  Yes (/traceback)

https://msdn.microsoft.com/en-us/library/z15yzzew.aspx ;

"How to: Modify Project Properties and Configuration Settings"

 

Giulio_P_
Beginner
323 Views

andrew_4619 wrote:

Configuration Properties > Fortran > Run-Time > Generate Traceback Information >  Yes (/traceback)

https://msdn.microsoft.com/en-us/library/z15yzzew.aspx 

"How to: Modify Project Properties and Configuration Settings"

 

Thanks. I activated it. But I'm not able to find the breakpoint yet. Is it showed automatically or should I go in some windows to watch it?

Giulio_P_
Beginner
323 Views

I fix it! it was an initialised variable. Thank you to everyone! 

Reply