Re: closing unit=5 and unit=6 and print *



Hello,

See INPUT_UNIT, OUTPUT_UNIT, ERROR_UNIT in ISO_FORTRAN_ENV.

Arjen Markus wrote:
beliav...@xxxxxxx schreef:

It is convenient to have a subroutine that can write to a file or print
to the console, depending on what unit number is passed to it. It is
less convenient to wrap IF statements around all WRITE statements to
choose between unit=* and unit=some_number. If a code assumes that 6 is
the unit for standard output, a PARAMETER should be declared and used
for this, to make this assumption clear.

Yes, but isn't that included in Fortran 2003? (I do not have the
standard
near me, so I can not check, but I remember something like that).
Otherwise, I think it is one of the things Dan Nagle's portability
project takes care of.

Regards,

Arjen



--
Cheers!

Dan Nagle
Purple Sage Computing Solutions, Inc.
.



Relevant Pages

  • Re: closing unit=5 and unit=6 and print *
    ... It is convenient to have a subroutine that can write to a file or print ... to the console, depending on what unit number is passed to it. ... the unit for standard output, a PARAMETER should be declared and used ...
    (comp.lang.fortran)
  • Re: test whether stdout is redirected
    ... I.e. my program myProg needs to ... do something else depending on whether it is called this way: ... You can check if the standard output is a terminal with isatty. ...
    (comp.unix.programmer)