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

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

Giulio_P_
Beginner
1,620 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
Honored Contributor III
1,620 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

0 Kudos
9 Replies
Arjen_Markus
Honored Contributor I
1,620 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.

0 Kudos
Giulio_P_
Beginner
1,620 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? 

 

0 Kudos
Arjen_Markus
Honored Contributor I
1,620 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.

0 Kudos
Giulio_P_
Beginner
1,620 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? 

0 Kudos
Steve_Lionel
Honored Contributor III
1,621 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.

0 Kudos
Giulio_P_
Beginner
1,620 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.

0 Kudos
andrew_4619
Honored Contributor II
1,620 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"

 

0 Kudos
Giulio_P_
Beginner
1,620 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?

0 Kudos
Giulio_P_
Beginner
1,620 Views

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

0 Kudos
Reply