Open WATCOM User's Guide
Total Page:16
File Type:pdf, Size:1020Kb
this document downloaded from... Use of this document the wings of subject to the terms and conditions as flight in an age stated on the website. of adventure for more downloads visit our other sites Positive Infinity and vulcanhammer.net chet-aero.com Open Watcom FORTRAN 77 User's Guide Version 1.8 Notice of Copyright Copyright 2002-2008 the Open Watcom Contributors. Portions Copyright 1984-2002 Sybase, Inc. and its subsidiaries. All rights reserved. Any part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of anyone. For more information please visit http://www.openwatcom.org/ ii Preface The Open Watcom FORTRAN 77 Optimizing Compiler (Open Watcom F77) is an implementation of the American National Standard programming language FORTRAN, ANSI X3.9-1978, commonly referred to as FORTRAN 77. The language level supported by this compiler includes the full language definition as well as significant extensions to the language. Open Watcom F77 evolved out of the demands of our users for a companion optimizing compiler to Open Watcom's WATFOR-77 "load-and-go" compiler. The "load-and-go" approach to processing FORTRAN programs emphasizes fast compilation rates and quick placement into execution of FORTRAN applications. This type of compiler is used heavily during the debugging phase of the application. At this stage of application development, the "load-and-go" compiler optimizes the programmer's time ... not the program's time. However, once parts of the application have been thoroughly debugged, it may be advantageous to turn to a compiler which will optimize the execution time of the executable code. Open Watcom F77 is a highly optimizing compiler based on the code generation technology that was developed for Open Watcom's highly-praised C and C++ optimizing compilers. Open Watcom F77 is a traditional compiler in the sense that it creates object files which must be linked into an executable program. The Open Watcom FORTRAN 77 User's Guide describes how to use Open Watcom FORTRAN 77 with DOS, OS/2, Windows 3.x, Windows NT, and Windows 95. Acknowledgements This book was produced with the Open Watcom GML electronic publishing system, a software tool developed by WATCOM. In this system, writers use an ASCII text editor to create source files containing text annotated with tags. These tags label the structural elements of the document, such as chapters, sections, paragraphs, and lists. The Open Watcom GML software, which runs on a variety of operating systems, interprets the tags to format the text into a form such as you see here. Writers can produce output for a variety of printers, including laser printers, using separately specified layout directives for such things as font selection, column width and height, number of columns, etc. The result is type-set quality copy containing integrated text and graphics. We would like to thank IMSL of Houston, Texas for providing us with copies of their Mathematics and Statistics libraries. The IMSL Math Library is a collection of subprograms for mathematical problem solving and the Statistics Library is a collection of subprograms for statistical analysis. The self test procedures provided with these libraries proved to be an immense help in testing Open Watcom F77 on the personal computer. We also used the "FORTRAN Compiler Validation System, Version 2.0" to test the conformance of Open Watcom F77 with the full FORTRAN 77 language standard. This package is provided by the National Technical Information Service of the U.S. Department of Commerce in Springfield, Virginia. The validation system was developed by the Federal Software Testing Center. If you find problems in the documentation or have some good suggestions, we would like to hear from you. July, 1997. iii Trademarks Used in this Manual AutoCAD Development System is a trademark of Autodesk, Inc. DOS/4G is a trademark of Tenberry Software, Inc. IBM Developer's WorkFrame/2, Presentation Manager, and OS/2 are trademarks of International Business Machines Corp. IBM is a registered trademark of International Business Machines Corp. Intel and Pentium are registered trademarks of Intel Corp. Microsoft, Windows and Windows 95 are registered trademarks of Microsoft Corp. Windows NT is a trademark of Microsoft Corp. NetWare, NetWare 386, and Novell are registered trademarks of Novell, Inc. Phar Lap, 286|DOS-Extender, and 386|DOS-Extender are trademarks of Phar Lap Software, Inc. QNX is a trademark of QNX Software Systems Ltd. WATCOM is a trademark of Sybase, Inc. and its subsidiaries. iv Table of Contents Open Watcom FORTRAN 77 User's Guide ................................................................................................... 1 1 About This Manual ........................................................................................................................... 3 2 Open Watcom FORTRAN 77 Compiler Options ............................................................................. 5 2.1 Open Watcom F77 Options Summary ............................................................................... 5 2.2 Compiler Options ............................................................................................................... 8 3 The Open Watcom FORTRAN 77 Compiler ................................................................................... 23 3.1 Open Watcom FORTRAN 77 Command Line Format ..................................................... 23 3.2 WFC/WFC386 Environment Variables ............................................................................. 24 3.3 Open Watcom FORTRAN 77 Command Line Examples ................................................. 24 3.4 Compiler Diagnostics ......................................................................................................... 25 3.5 Open Watcom FORTRAN 77 INCLUDE File Processing ................................................ 27 4 The Open Watcom FORTRAN 77 Libraries .................................................................................... 29 4.1 Open Watcom FORTRAN 77 80x87 Emulator Libraries .................................................. 31 4.2 The "NO87" Environment Variable ................................................................................... 32 5 Open Watcom FORTRAN 77 Compiler Directives ......................................................................... 33 5.1 Introduction ........................................................................................................................ 33 5.2 The EJECT Compiler Directive ......................................................................................... 33 5.3 The INCLUDE Compiler Directive ................................................................................... 34 5.4 The PRAGMA Compiler Directive ................................................................................... 35 5.5 The DEFINE Compiler Directive ...................................................................................... 35 5.6 The UNDEFINE Compiler Directive ................................................................................. 36 5.7 The IFDEF, IFNDEF and ENDIF Compiler Directive ...................................................... 36 5.8 The ELSE Compiler Directive ........................................................................................... 37 5.9 The ELSEIFDEF and ELSEIFNDEF Compiler Directive ................................................. 37 5.10 Debugging statements ("D" in Column 1) ....................................................................... 37 5.11 General Notes About Compiler Directives ...................................................................... 38 6 Open Watcom FORTRAN 77 File Handling ................................................................................... 39 6.1 Record Access .................................................................................................................... 39 6.2 Record Format .................................................................................................................... 39 6.2.1 FORMATTED Records ....................................................................................... 40 6.2.2 UNFORMATTED Records ................................................................................. 40 6.2.3 Files with no Record Structure ............................................................................ 41 6.3 Attributes of Files ............................................................................................................... 41 6.3.1 Record Type ........................................................................................................ 42 6.3.2 Record Size .......................................................................................................... 43 6.3.3 Print File Attributes ............................................................................................. 43 6.3.4 Input/Output Buffer Size ..................................................................................... 44 6.3.5 File Sharing .......................................................................................................... 44 6.4 File Names in the FAT File System ................................................................................... 45 6.4.1 Special DOS Device Names ...............................................................................