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

Redirect IMSL console and error messages

gernot_ebel
Beginner
667 Views
Hello there,
I have a dll called by C++ that contains several Fortran-subroutines. Some of them use IMSL routines. Some of these like to give from time to time some informative output or some error output.
So I redirected both kinds of messages to the fileunit imsl_mess by using the IMSL routine UMACH:
errors: call umach(-3,imsl_mess)
info : call umach(-2,imsl_mess).
However, not unexpectedly, this slows down the code immensely, because I have to open and to close the unit inside each subroutine that uses IMSL.
My question:
Is there a way to redirect the IMSL messages to a buffer located in memory? Or even better: Is there a way to forbid IMSL-routines their talkative behaviour at all?

Thanks in advance,
Gernot
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
667 Views
See ERSET (or ERRSET?) IMSL routine -- it controls the behaviour of error messages.

Re general issues of console output redirection -- see [url=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/creating_a_child_process_with_redirected_input_and_output.asp]this MSDN article.

Jugoslav
0 Kudos
gernot_ebel
Beginner
667 Views
Thank you,
Jugoslav, ERSET is able to mute IMSL-messages.
fine!

Gernot
0 Kudos
Reply