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

Fortran run-time error 38 during write?

Darrell
Beginner
3,316 Views
The good news is that Project > Properties > Fortran > Run-time > Generate Traceback information allows the compiler to tell me right where it hurts so we can quickly remove the offending debug prints below.

I'm still confused as to what this error message quoted below means?
I'm even more confused on how it doesn't occur on our build and test lab machines but does occur on the customer's machines. We all have the same version of the same IVF 11.1 runtime libraries with Microsoft Visual Studio 2008?

  • Any ideas on what run-time error 38 below means?
  • Any ideas on why an unformatted write doesn't work as shown below?

My only conspiracy theory is that they have redirected the java standard out (unit 6) and standard error (unit 7) and that the DLL doesn't have a console to write to on their end. We're running from Eclipse and watching the prints go by in the console log? The log file they created has the java prints but not the Fortran ones?

Intel Visual Fortran run-time error:
x forrtl: severe (38): error during write, unit 6, file CONOUT$
Image PC Routine Line Source
a.dll line 666 a.f
Stack trace terminated abnormally.
OK

[fxfortran]c the next line is the first example of this error
write(6,*)'mldexp= ',mldexp(1,:)
write(6,*)'msldxp= ',msldxp(1,:)

c the next line is the second example of this error
write(6,*)'*** START OF AWFI EXECUTION ***'
write(6,*)''
[/fxfortran]
0 Kudos
1 Solution
DavidWhite
Valued Contributor II
3,316 Views
Wayne, This thread discusses writing to stdout in a mixed language context, it may be helpful for you. http://software.intel.com/en-us/forums/showthread.php?t=70404&o=a&s=lr Regards, David

View solution in original post

0 Kudos
3 Replies
DavidWhite
Valued Contributor II
3,316 Views
I think that under some circumstances (QuickWin?) the console is not automatically connected to Unit 6.

Try using Write(*,*) instead of Write(6,*), or actually connect Unit 6 to CONOUT$.

Regards,


David
0 Kudos
Darrell
Beginner
3,316 Views

CONOUT$ is a Windows-specific non-portable identifier--I really don't want to put open & close CONOUT$ in the code for portability--we'll just put if (DEBUG) arount them so they go away when there is no console in Releae mode.

Our java program (not quickwin) calls C++ wrapped Fortran DLLs via JNI. We never got this error with Compaq VF6 DLLs so I'll add it to the upgrading to Intel VF11 list of differences.

Compare:

[fxfortran]Write (6,*) test1
Write (*,*) test2
Print *,test3
[/fxfortran]

I found an Intel Environmental variable:
Set FOR_PRINT=c:\temp\fortran.log
that claims to work for write (*,*) so that the code can be change from 6 to * and the Windows users can externally set the variable to prevent the crash. I wonder if I can set it to /dev/null or nul?
0 Kudos
DavidWhite
Valued Contributor II
3,317 Views
Wayne, This thread discusses writing to stdout in a mixed language context, it may be helpful for you. http://software.intel.com/en-us/forums/showthread.php?t=70404&o=a&s=lr Regards, David
0 Kudos
Reply