[TRNSYS-users] Question on WRITE statement in Fortran

Jeff Thornton thornton at tess-inc.com
Sat Aug 1 09:57:03 PDT 2009


<I would like to write the values of internal parameters and variables in
Fortran to the screen or to a file.
I tried the following:

WRITE(*,*) = 'Parameter P = ', P     (print to screen)
or
WRITE(7,*) = 'Parameter P = ', P     (print to file)>

Logical unit 6 is the list file, so Write(6,*) 'Hello'  would write Hello
into the list file when that unit was called.  Logical Unit 7 is the file
which contains the units information (Units.lab) so you may want to check
to make sure you haven't destroyed that file with your messages.  Any unit
under 10 - with the exception of the list file at 6, should never be
written to.  Writing to the screen shouldn't be done either.

Jeff


Jeff Thornton
President - TESS, LLC

22 North Carroll Street - Suite 370
Madison WI 53703 USA

Phone: 608-274-2577
Fax: 608-278-1475
E-mail: thornton at tess-inc.com
Web: www.tess-inc.com




More information about the TRNSYS-users mailing list