PDA

View Full Version : Unit 6 and screen output


N Fitzpatrick
10-21-2003, 08:22 PM
We have a bit of a conflict with a particular piece of code. The input files are built by a GUI from a vendor, and for one particular file, it insists on always using Unit 6. This means, however, that we compile the code in Lahey, both the writes to (6,*) and (*,*) are ending up going to the file connected to Unit 6; rather than the writes to (6,*) going to Unit 6; and (*,*) going to the screen. At least when compiled with Lahey 5.6g.

There is nothing in the code we can change (as the 6 is in the input file). We are constantly changing input files on the fly; but this always adds an extra step. Are there any compile options, or anything else I haven't thought of, that would allow us to get writes to (6,*) to the file; and (*,*) to the screen?

(and yes, I am working on the vendor, to change his unit numbers!)

Nick

tzeis
10-22-2003, 06:03 PM
We have a runtime option that will allow you to change the unit number used for standard output. The runtime options are described in the User's Guide. The one you are interested in is the "p" runtime option. In your case, you should set the FORT90L environment variable to the value "-Wl,pnn" where "nn" is the unit number you want to be standard out. Unit 6 should then act like an ordinary file unit.

N Fitzpatrick
10-22-2003, 08:30 PM
Ah, great!

It works as an environment variable.

But if used on the command line (which would be by far the easier way to do it), I notice that it interferes with the passing of command line arguments. Section 12 of (Revision C) of the Fortran 95 User's Guide notes that it will not interfere with the expected results of either the GETCL() or GETARG() functions ... and it seems to interfere with both. Am I missing something here?

Nick

tzeis
10-23-2003, 06:55 PM
Hmmm. I see what you mean. I suspect that the documentation is wrong. I will sort this one out and get back to you.