Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
5 Views

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

Jump to solution

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

Accepted Solutions
Highlighted
Black Belt
5 Views

Reading from unit 0, stderr,

Jump to solution

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.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran

View solution in original post

0 Kudos
9 Replies
Highlighted
Valued Contributor II
5 Views

You do not give us much to go

Jump to solution

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
Highlighted
Beginner
5 Views

Quote:Arjen Markus wrote:

Jump to solution

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
Highlighted
Valued Contributor II
5 Views

One possibility - though it

Jump to solution

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
Highlighted
Beginner
5 Views

Quote:Arjen Markus wrote:

Jump to solution

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
Highlighted
Black Belt
6 Views

Reading from unit 0, stderr,

Jump to solution

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.

Steve (aka "Doctor Fortran") - https://stevelionel.com/drfortran

View solution in original post

0 Kudos
Highlighted
Beginner
5 Views

Quote:Steve Lionel (Ret.)

Jump to solution

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
Highlighted
Valued Contributor II
5 Views

Configuration Properties >

Jump to solution

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
Highlighted
Beginner
5 Views

Quote:andrew_4619 wrote:

Jump to solution

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
Highlighted
Beginner
5 Views

I fix it! it was an

Jump to solution

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

0 Kudos