Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing to multiple devices 1

Status
Not open for further replies.

FiascoBurnett

Programmer
May 25, 2015
6
ZA
Is it possible to write to stdout and multiple logical units with one write statement?
 
No but you could create a subroutine to do it. That is what I normally do for writing to stdout, a test log and an output file.
 
Some years ago, I needed to produce two output files, one in SI units and another in USCS...I made my calculations ahead of writing anything (do not want to calculate twice) and grouped all WRITE statements in a loop

SI output file unit 41
USCS outpuf file unit 42
conversion factor array (1) = 1.0
conversion factor array (2) = SI-to-USCS conversion factor for given quantity

Code:
do i = 1, 2
    iout=40+i
    write(iout,*) 'Side length is: ', Lside*cf_m(i)
end do
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top