Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

STOP statement write to terminal window

Glynn_H_
Beginner
550 Views

The FORTRAN code I'm working on writes its main output to unit 6. It also uses a number of STOP statements when trapping for errors. 

When I previously used the Lahey compiler the strings associated with the STOP statements were written to the terminal window, not unit 6. However, since moving to Intel the STOP strings are written to unit 6 instead of the terminal window.

Any ideas of how I can revert to the STOP strings being written to the terminal window?

0 Kudos
3 Replies
Steven_L_Intel1
Employee
550 Views

In Intel Fortran, STOP writes to the "standard error" stream. By default that's going to be the same console that is open on unit 6.

Are you explicitly opening unit 6? My experiment is that if you do that, the STOP output still goes to the console.

0 Kudos
Glynn_H_
Beginner
550 Views

Yes, I'm explicitly opening unit 6. 

0 Kudos
Steven_L_Intel1
Employee
550 Views

Not seeing it.

[sblionel@f90srv35 ~/project]$ cat U508724.f90
open (unit=6,file='test.txt',form='formatted')
write (6,*) "This is unit 6"
stop "The World"
end
[sblionel@f90srv35 ~/project]$ ifort -V U508724.f90
Intel(R) Fortran Compiler XE for applications running on IA-32, Version 14.0.0.080 Build 20130728
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.
 
 Intel(R) Fortran 14.0-1565
GNU ld version 2.17.50.0.6-20.el5 20061020
[sblionel@f90srv35 ~/project]$ ./a.out
The World
[sblionel@f90srv35 ~/project]$ cat test.txt
 This is unit 6
[sblionel@f90srv35 ~/project]$ 

 

0 Kudos
Reply