Professional Documents
Culture Documents
Formatting output in FORTRAN is incredibly flexible and can be complicated. We will not utilize most of the capabilities. Instead, we will concentrate on the most useful basics. This handout is designed to give you the basics of formatting input and output in your FORTRAN programs. A thorough reading of Chapter 5 in the text may be needed to solidify your understanding and use of these statements. It will also give you some more advanced understanding of items not covered in this handout.
I/O Descriptors
The following descriptors are used to properly format our data. I F E ES L A X T / integer output real output real output (exponential notation) real output (scientific notation) logical output (T or F) character output space output tab output (we wont cover beyond this) slash descriptor used to insert blank lines
(This table is from the textbook p.178) Theses symbols will be referenced in the next two tables.
farther to the right. This is a result of using the 10x descriptor in the format statement. Good programming states that you should always start your output at least one space to the right of the margin. This is not going to happen with the WRITE(*,*). We dont want to confuse or overwhelm you with the plethora of options available so we will limit our discussion to what we have covered. Be aware that you will see many variations in the text book and elsewhere. If you cant figure out what the format statements are doing come to office hours or talk to your lab instructor for further assistance.