University Computing & Communications The University of New Orleans Home  
     
 
Home | Accounts | Blackboard | Contact Us | Documentation | Frequently Asked Questions
Faculty Staff Resource Center | Help Desk | Instructional Media & Technology
Mail Services | Peoplesoft Training | ResNet | Sharepoint Training | Telephone Services | Training | Web Services

FORTRAN (output) to HTML

May 2003

Normally the output files produced by a FORTRAN program (i.e., files with a carriage control character or "ccc" in the first position of each line) are not interpreted properly on typical printers today: the carriage control characters are visible rather than interpreted. To remedy this situation, the program f2html accepts a typical FORTRAN output file and produces a corresponding HTML file that can be rendered by a browser (either Netscape or Internet Explorer) to interpret the carriage control characters visually.

For example, if project.out is an output file from a FORTRAN program, then the following Command-Prompt (i.e., DOS) command will produce an HTML file (in this case, named project.htm) suitable for rendering by a browser:

f2html  <project.out  >project.htmTo see the final result, activate the browser, use File > Open or File > Open File, locate the file (i.e., project.htm) and then click OK or Open to have the file contents rendered through the browser. Once the results are visible, they can be printed

Since HTML files cannot completely control the placement of individual lines on the screen or divide the image into pages, the following accommodations are made for f2html:

*a new page (i.e., ccc of 1) is interpreted as a horizontal rule (or line) across the page.
*overstriking (i.e., ccc of +) is interpreted as bolding on the original line. For example, the two FORTRAN output lines 

this is fun! 
+       fun
 

would be displayed as

this is fun!

Hence, the word "fun" is bolded and the introductory blank used as the ccc is not part of the rendered result. 

Narrow vs. wide output files

 It must be noted that the f2html program can accommodate FORTRAN output files that are approximately 80 characters "wide". To display files that are up to 140 characters wide, use the companion program f2html (where the "w" stands for "wide" files, up to 140 characters). This latter program, f2htmlw is used in exactly the same manner as the f2html program. In the case of the output, however, the wide version has extra HTML commands to reduce the size of the font so that 140 columns are displayed properly. However, the resulting HTML file must be printed in landscape mode.

 

 

The University of New Orleans • 2000 Lakeshore Drive, New Orleans, LA 70148
(504) 280-6000 • Toll-Free at (888) 514-4275