home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft_Programmers_Library.7z / MPL / fortran / frtlref.txt < prev    next >
Encoding:
Text File  |  2013-11-08  |  1.0 MB  |  28,584 lines

Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
  1.  Microsoft FORTRAN Language Reference
  2.  
  3.  VERSION 5.0
  4.  
  5.  FOR MS(R) OS/2 AND MS-DOS(R) OPERATING SYSTEMS
  6.  
  7.  MICROSOFT CORPORATION
  8.  
  9.  Information in this document is subject to change without notice and does
  10.  not represent a commitment on the part of Microsoft Corporation. The
  11.  software described in this document is furnished under a license agreement
  12.  or nondisclosure agreement. The software may be used or copied only in
  13.  accordance with the terms of the agreement. It is against the law to copy
  14.  the software on any medium except as specifically allowed in the license or
  15.  nondisclosure agreement. No part of this manual may be reproduced or
  16.  transmitted in any form or by any means, electronic or mechanical, including
  17.  photocopying and recording, for any purpose without the express written
  18.  permission of Microsoft.
  19.  
  20.  (c)Copyright Microsoft Corporation, 1987-1989. All rights reserved.
  21.  
  22.  Printed and bound in the United States of America.
  23.  
  24.  Microsoft, MS, MS-DOS, and CodeView are registered trademarks of Microsoft
  25.  Corporation.
  26.  
  27.  DEC is a registered trademark of Digital Equipment Corporation.
  28.  
  29.  IBM is a registered trademark of International Business Machines
  30.  Corporation.
  31.  
  32.  Intel is a registered trademark of Intel Corporation.
  33.  
  34.  VAX is a registered trademark of Digital Equipment Corporation.
  35.  
  36.  Document No.  LN0818-500-R00-0289
  37.  Part No. 06383
  38.  10  9 8 7 6 5 4 3 2 1
  39.  
  40.  
  41.  Table of Contents
  42.  
  43.  Introduction
  44.  
  45.  About This Manual
  46.  Document Conventions
  47.  Books about FORTRAN Programming
  48.  Requesting Assistance
  49.  
  50.  Part 1  Language Reference
  51.  
  52.  Chapter 1  Elements of FORTRAN
  53.  
  54.  1.1  Characters
  55.  1.2  Names
  56.        1.2.1  Global and Local Names
  57.        1.2.2  Undeclared Names
  58.  1.3  Data Types
  59.        1.3.1  Integer Data Types
  60.        1.3.2  The Single-Precision IEEE Real Data Type
  61.        1.3.3  The Double-Precision IEEE Real Data Type
  62.        1.3.4  Complex Data Types
  63.        1.3.5  Logical Data Types
  64.        1.3.6  The Character Data Type
  65.  1.4  «Records»
  66.  1.5  Arrays
  67.  1.6  «Attributes»
  68.        1.6.1   «ALLOCATABLE»
  69.        1.6.2   «ALIAS»
  70.        1.6.3   «C»
  71.        1.6.4   «EXTERN»
  72.        1.6.5   «FAR»
  73.        1.6.6   «HUGE»
  74.        1.6.7   «LOADDS»
  75.        1.6.8   «NEAR»
  76.        1.6.9   «PASCAL»
  77.        1.6.10  «REFERENCE»
  78.        1.6.11  «VALUE»
  79.        1.6.12  «VARYING»
  80.  1.7  Expressions
  81.        1.7.1  Arithmetic Expressions
  82.        1.7.2  Character Expressions
  83.        1.7.3  Relational Expressions
  84.        1.7.4  Logical Expressions
  85.        1.7.5  «Array Expressions»
  86.        1.7.6  Precedence of Operators
  87.  
  88.  Chapter 2  Program Structure
  89.  
  90.  2.1   Lines
  91.  2.2   Statement Labels
  92.  2.3   «Free-Form Source Code»
  93.  2.4   Order of Statements «and Metacommands»
  94.  2.5   Arguments
  95.  2.6   Program Units
  96.  2.7   Main Programs
  97.  2.8   Subroutines
  98.  2.9   Block-Data Subprograms
  99.  2.10  Functions
  100.         2.10.1  External Functions
  101.         2.10.2  Statement Functions
  102.  
  103.  Chapter 3  The Input/Output System
  104.  
  105.  3.1  The FORTRAN I/O System
  106.  3.2  I/O Statements
  107.        3.2.1   File Names (FILE=)
  108.        3.2.2   Units (UNIT=)
  109.        3.2.3   File Access Method (ACCESS=)
  110.        3.2.4   «Input/Output Buffer Size (BLOCKSIZE=)»
  111.        3.2.5   The Edit List
  112.        3.2.6   Error and End-of-File Handling (IOSTAT=, ERR=, END=)
  113.        3.2.7   Format Specifier (FMT=)
  114.        3.2.8   «Namelist Specifier (NML=)»
  115.        3.2.9   File Structure (FORM=)
  116.        3.2.10  Input/Output List
  117.        3.2.11  «File Sharing (MODE=, SHARE=)»
  118.        3.2.12  Record Number (REC=)
  119.  3.3  Choosing File Types
  120.  3.4  File Position
  121.  3.5  Internal Files
  122.  3.6  Carriage Control
  123.  3.7  Formatted I/O
  124.        3.7.1  Nonrepeatable Edit Descriptors
  125.        3.7.2  Repeatable Edit Descriptors
  126.        3.7.3  Interaction between Format and I/O List
  127.  3.8  List-Directed I/O
  128.        3.8.1  List-Directed Input
  129.        3.8.2  List-Directed Output
  130.  3.9  «Namelist-Directed I/O»
  131.  
  132.  Chapter 4  Statements
  133.  
  134.  4.1  Categories of Statements
  135.  4.2  Statement Directory
  136.        «ALLOCATE»
  137.        ASSIGN (Label Assignment)
  138.        Assignment (Computational)
  139.        «AUTOMATIC»
  140.        BACKSPACE
  141.        BLOCK DATA
  142.        CALL
  143.        «CASE»
  144.        CHARACTER
  145.        CLOSE
  146.        COMMON
  147.        COMPLEX
  148.        CONTINUE
  149.        «CYCLE»
  150.        DATA
  151.        «DEALLOCATE»
  152.        DIMENSION
  153.        DO
  154.        «DO WHILE»
  155.        «DOUBLE COMPLEX»
  156.        DOUBLE PRECISION
  157.        ELSE
  158.        ELSE IF
  159.        END
  160.        «END DO»
  161.        END IF
  162.        ENDFILE
  163.        ENTRY
  164.        EQUIVALENCE
  165.        «EXIT»
  166.        EXTERNAL
  167.        FORMAT
  168.        FUNCTION (External)
  169.        GOTO (Assigned GOTO)
  170.        GOTO (Computed GOTO)
  171.        GOTO (Unconditional GOTO)
  172.        IF (Arithmetic IF)
  173.        IF (Logical IF)
  174.        IF THEN ELSE (Block IF)
  175.        IMPLICIT
  176.        «INCLUDE»
  177.        INQUIRE
  178.        INTEGER
  179.        «INTERFACE TO»
  180.        INTRINSIC
  181.        «LOCKING»
  182.        LOGICAL
  183.        «MAP...END MAP»
  184.        «NAMELIST»
  185.        OPEN
  186.        PARAMETER
  187.        PAUSE
  188.        PRINT
  189.        PROGRAM
  190.        READ
  191.        REAL
  192.        «RECORD»
  193.        RETURN
  194.        REWIND
  195.        SAVE
  196.        «SELECT CASE...END SELECT»
  197.        Statement Function
  198.        STOP
  199.        «STRUCTURE...END STRUCTURE»
  200.        SUBROUTINE
  201.        Type
  202.        «UNION...END UNION»
  203.        WRITE
  204.  
  205.  Chapter 5  Intrinsic Functions and Additional Procedures
  206.  
  207.  5.1  Using Intrinsic Functions
  208.        5.1.1   Data-Type Conversion
  209.        5.1.2   «Data-Type Information»
  210.        5.1.3   Truncating and Rounding
  211.        5.1.4   Absolute Value and Sign Transfer
  212.        5.1.5   Remainders
  213.        5.1.6   Positive Differences
  214.        5.1.7   Maximums and Minimums
  215.        5.1.8   Double-Precision Products
  216.        5.1.9   Complex Functions
  217.        5.1.10  Square Roots
  218.        5.1.11  Exponents and Logarithms
  219.        5.1.12  Trigonometric Functions
  220.        5.1.13  Character Functions
  221.        5.1.14  «End-of-File Function»
  222.        5.1.15  «Address Functions»
  223.        5.1.16  «Bit-Manipulation Functions»
  224.  5.2  Alphabetical Function List
  225.  5.3  Additional Procedures
  226.        5.3.1  Time and Date Procedures
  227.        5.3.2  Run-Time-Error Procedures
  228.        5.3.3  Command-Line-Argument Procedures
  229.        5.3.4  Random Number Procedures
  230.  
  231.  Part 2  Compiling and Linking
  232.  
  233.  «Chapter 6»  «Metacommands»
  234.  
  235.  6.1  Using Conditional-Compilation Metacommands
  236.  6.2  Metacommand Directory
  237.        $DEBUG and $NODEBUG
  238.        $DECLARE and $NODECLARE
  239.        $DEFINE and $UNDEFINE
  240.        $DO66
  241.        $ELSE
  242.        $ELSEIF
  243.        $ENDIF
  244.        $FLOATCALLS and $NOFLOATCALLS
  245.        $FREEFORM and $NOFREEFORM
  246.        $IF
  247.        $INCLUDE
  248.        $LARGE and $NOTLARGE
  249.        $LINESIZE
  250.        $LIST and $NOLIST
  251.        $LOOPOPT
  252.        $MESSAGE
  253.        $PACK
  254.        $PAGE
  255.        $PAGESIZE
  256.        $STORAGE
  257.        $STRICT and $NOTSTRICT
  258.        $SUBTITLE
  259.        $TITLE
  260.        $TRUNCATE and $NOTRUNATE
  261.  
  262.  Chapter 7  The FL Command
  263.  
  264.  7.1  The Basics: Compiling, Linking, and Running FORTRAN Files
  265.        7.1.1  Compiling and Linking with FL
  266.        7.1.2  Using FL Options
  267.        7.1.3  The FL Environment Variable
  268.        7.1.4  Specifying the Next Compiler Pass
  269.        7.1.5  Stopping FL
  270.        7.1.6  Using the FL Command (Specific Examples)
  271.        7.1.7  Running Your FORTRAN Program
  272.  7.2  Getting Help with FL Options (/HELP)
  273.  7.3  Floating-Point Options (/FP)
  274.  7.4  Memory-Model Options (/A, /M)
  275.  7.5  OS/2 Library Options (/Lp, /Lr, /Lc)
  276.  7.6  Data Threshold Option (/Gt)
  277.  7.7  Naming and Organizing Segments (/ND, /NM, /NT)
  278.  7.8  Creating Bound Program Files (/Fb)
  279.  7.9  FORTRAN-Specific Options (/4Y, /4N)
  280.        7.9.1  Controlling Optional Language Features (/4Ys, /4Yi, /4Yv)
  281.        7.9.2  Controlling Source-File Syntax (/4Yf, /4Nf, /4Yt, /4Nt, /4Y6, /
  282.        7.9.3  Automatic Variables
  283.        7.9.4  Setting the Default Integer Size (/4I2, /4I4)
  284.        7.9.5  Conditional Compilation (/4cc, /D)
  285.  7.10  Specifying Source Files (/Tf, /Ta)
  286.  7.11  Compiling without Linking (/c)
  287.  7.12  Naming the Object File (/Fo)
  288.  7.13  Naming the Executable File (/Fe)
  289.  7.14  Creating Listing Files (/F)
  290.  7.15  Special File Names
  291.  7.16  Line Size (/Sl) and Page Size (/Sp)
  292.  7.17  Titles (/St) and Subtitles (/Ss)
  293.  7.18  Formats for Listings
  294.  7.19  Searching for Include Files (/I, /X)
  295.  7.20  Handling Warnings and Errors
  296.         7.20.1  Understanding Error Messages
  297.         7.20.2  The Warning-Level Option (/W)
  298.  7.21  Syntax Errors (/Zs)
  299.  7.22  Preparing for Debugging (/Zi, /Od, /Zd)
  300.  7.23  Using an 80186, 80188, 80286, or 80386 Processor (/G0, /G1, /G2)
  301.  7.24  Optimizing (/O and /Zp)
  302.  7.25  Enabling and Disabling Stack Probes (/Ge, /Gs)
  303.  7.26  Suppressing Automatic Library Selection (/Zl)
  304.  7.27  Setting the Stack Size (/F)
  305.  7.28  Restricting the Length of External Names (/H)
  306.  7.29  Labeling the Object File (/V)
  307.  7.30  Linking with Libraries
  308.  7.31  Creating Overlays
  309.  7.32  Using FL to Link without Compiling
  310.  7.33  Specifying Assembler Options (/MA)
  311.  
  312.  Appendix A  ASCII Character Codes
  313.  
  314.  Appendix B  Differences from Previous Versions
  315.  
  316.  B.1  Changes from Version 4.1 to Version 5.0
  317.        B.1.1  Alphabetical Summary
  318.        B.1.2  New Microsoft FORTRAN Functions and Procedures
  319.        B.1.3  Microsoft FORTRAN Language Extensions
  320.        B.1.4  OS/2
  321.        B.1.5  Graphics
  322.  B.2  Changes from Version 4.0 to Version 4.1
  323.        B.2.1  OS/2 Support
  324.        B.2.2  Enhanced FL Utility
  325.        B.2.3  Extended Control Over Default Libraries (Linker Options)
  326.  B.3  Changes from Versions 3.2 and 3.3 to Version 4.0
  327.        B.3.1   Changes for ANSI Full-Language Standard
  328.        B.3.2   Source Compatibility
  329.        B.3.3   Attributes in Array Declarations
  330.        B.3.4   Blanks in Formatted Files
  331.        B.3.5   MODE and STATUS Options in OPEN Statement
  332.        B.3.6   Temporary Scratch-File Names
  333.        B.3.7   Binary Direct Files
  334.        B.3.8   Precision of Floating-Point Operations
  335.        B.3.9   Exponentiation Exceptions
  336.        B.3.10  List-Directed Output
  337.        B.3.11  DO-Loop Ranges
  338.        B.3.12  Object Compatibility
  339.        B.3.13  Library Compatibility
  340.        B.3.14  Mixing Version 4.0 and Version 3.3 Modules
  341.        B.3.15  Mixing Version 4.0 and Version 3.2 Modules
  342.  B.4  Changes for Version 4.0
  343.        B.4.1  Enhancements and Additions to the Compiler and Linker
  344.        B.4.2  Run-Time Library Changes
  345.        B.4.3  Changes to the Language
  346.        B.4.4  New Language Features
  347.  
  348.  Appendix C  Compiler and Linker Limits
  349.  
  350.  C.1  Compiler Limits
  351.        C.1.1  Limits on Number of Names
  352.        C.1.2  Limits on Complicated Expressions
  353.        C.1.3  Limits on Character Expressions
  354.  C.2  Linker Limits
  355.  C.3  Run-Time Limits
  356.        C.3.1  Increasing the Maximum Number of Open Files
  357.        C.3.2  Using the Modified Files
  358.        C.3.3  Multithread and Dynamic Link Applications
  359.  
  360.  Appendix D  Error Messages
  361.  
  362.  D.1  Command-Line Error Messages
  363.  D.2  Compiler Error Messages
  364.        D.2.1  Compiler Fatal Error Messages
  365.        D.2.2  Compilation Error Messages
  366.  
  367.        D.2.3  Recoverable Error Messages
  368.  D.2.4  Warning Error Messages
  369.  D.3  Run-Time Error Messages
  370.        D.3.1  Run-Time-Library Error Messages
  371.        D.3.2  Other Run-Time Error Messages
  372.  
  373.  Glossary
  374.  
  375.  
  376.  Figures and Tables
  377.  
  378.   Figure 2.1  Order of Statements «and Metacommands»
  379.  
  380.   Table 1.1   Memory Requirements
  381.   Table 1.2   Integers
  382.  «Table 1.3   C String Escape Sequences»
  383.  «Table 1.4   Objects to Which Attributes Can Refer»
  384.   Table 1.5   Arithmetic Operators
  385.   Table 1.6   Arithmetic Type Conversion
  386.   Table 1.7   Relational Operators
  387.   Table 1.8   Logical Operators
  388.   Table 1.9   Values of Logical Expressions
  389.  
  390.   Table 3.1   I/O Statements
  391.   Table 3.2   I/O Options
  392.   Table 3.3   Errors and End-of-File Records When Reading
  393.  «Table 3.4   Mode and Share Values»
  394.   Table 3.5   Carriage-Control Characters
  395.   Table 3.6   Nonrepeatable Edit Descriptors
  396.   Table 3.7   Forms of Exponents for the E Edit Descriptor
  397.   Table 3.8   Interpretation of G Edit Descriptor
  398.   Table 3.9   Interpretation of GE Edit Descriptor
  399.   Table 3.10  Forms of Exponents for the D Edit Descriptor
  400.  
  401.   Table 4.1   Categories of FORTRAN Statements
  402.   Table 4.2   Specification Statements
  403.   Table 4.3   Control Statements
  404.   Table 4.4   I/O Statements
  405.   Table 4.5   Repeatable Edit Descriptors
  406.  
  407.   Table 5.1   Abbreviations Used to Describe Intrinsic Functions
  408.   Table 5.2   Intrinsic Functions: Type Conversion
  409.  «Table 5.3   Intrinsic Functions: Data-Type Information»
  410.   Table 5.4   Intrinsic Functions: Truncation and Rounding
  411.   Table 5.5   Intrinsic Functions: Absolute Values and Sign Transfer
  412.   Table 5.6   Intrinsic Functions: Remainders
  413.   Table 5.7   Intrinsic Functions: Positive Difference
  414.   Table 5.8   Intrinsic Functions: Maximums and Minimums
  415.   Table 5.9   Intrinsic Functions: Double-Precision Product
  416.   Table 5.10  Intrinsic Functions: Complex Operators
  417.   Table 5.11  Intrinsic Functions: Square Roots
  418.   Table 5.12  Intrinsic Functions: Exponents and Logarithms
  419.   Table 5.13  Intrinsic Functions: Trigonometric Functions
  420.   Table 5.14  Restrictions on Arguments and Results
  421.   Table 5.15  Intrinsic Functions: Character Functions
  422.  «Table 5.16  Intrinsic Functions: End-of-File Function»
  423.  «Table 5.17  Intrinsic Functions: Addresses»
  424.  «Table 5.18  Intrinsic Functions: Bit Manipulation»
  425.  «Table 5.19  Bit-Manipulation Examples»
  426.   Table 5.20  Intrinsic Functions
  427.   Table 5.21  Time and Date Procedures
  428.  
  429.   Table 6.1   Metacommands
  430.  
  431.   Table 7.1   FL Options and Default Libraries
  432.   Table 7.2   Segment-Naming Conventions
  433.   Table 7.3   Default File Names and Extensions
  434.   Table 7.4   Arguments to Listing Options
  435.  
  436.   Table B.1   Negative INTEGER or REAL Raised to a REAL Power
  437.   Table B.2   Zero Raised to a Negative Power
  438.   Table B.3   COMPLEX Zero Raised to a COMPLEX Power
  439.   Table B.4   Zero Raised to the Zero Power
  440.  
  441.   Table C.1   Limits Imposed by the Microsoft FORTRAN Compiler
  442.   Table C.2   Limits Imposed by the Microsoft Segmented-Executable Linker
  443.  
  444.  
  445.  Introduction
  446.  ───────────────────────────────────────────────────────────────────────────
  447.  
  448.  Microsoft(R) FORTRAN Version 5.0 improves on the already popular Microsoft
  449.  FORTRAN programming language by adding several important new features. The
  450.  language is now fully compatible with the Systems Application Architecture
  451.  (SAA) FORTRAN extensions and many of the VAX(R) extensions. It supports new
  452.  constructs such as compound data types (structures) and SELECT CASE
  453.  decision-making blocks. New compiler directives allow advanced features like
  454.  conditional compilation of specific pieces of program code. Also, the FL
  455.  compiling and linking command has several new options and improvements to
  456.  existing options.
  457.  
  458.  This new version of Microsoft FORTRAN offers enhanced OS/2 systems support,
  459.  including the use of dynamic-link libraries and multiple threads of
  460.  execution. For complete flexibility, programs can be designed to run under
  461.  DOS, OS/2, or both operating systems. In addition, an extensive graphics
  462.  library lets data and figures become an integral part of any FORTRAN
  463.  application.
  464.  
  465.  This chapter introduces the Microsoft FORTRAN Reference, describes the
  466.  document conventions used in the manual, and gives additional sources of
  467.  information about FORTRAN.
  468.  
  469.  For discussions of memory models, calling non-FORTRAN subroutines and
  470.  functions from a Microsoft FORTRAN program (mixed-language programming),
  471.  programming under OS/2, and the use of graphics, see  Microsoft FORTRAN
  472.  Advanced Topics. To find out how to use the Microsoft CodeView(R)
  473.  Window-Oriented Debugger to debug your programs, see the Microsoft CodeView
  474.  and Utilities User's Guide.
  475.  
  476.  
  477.  About This Manual
  478.  
  479.  The Microsoft FORTRAN Reference defines the FORTRAN language as implemented
  480.  by the Microsoft FORTRAN Optimizing Compiler, Version 5.0. It is intended as
  481.  a reference for programmers who have experience in the FORTRAN language.
  482.  This manual does not teach you how to program in FORTRAN; for a list of
  483.  texts on FORTRAN, see "Books about FORTRAN Programming" at the end of this
  484.  introduction.
  485.  
  486.  Microsoft documentation uses the term "OS/2" to refer to the OS/2
  487.  systems──Microsoft Operating System/2 (MS(R) OS/2) and IBM(R) OS/2.
  488.  Similarly, the term "DOS" refers to both the MS-DOS(R) and IBM Personal
  489.  Computer DOS operating systems. The name of a specific operating system is
  490.  used when it is necessary to note features that are unique to the system.
  491.  
  492.  Microsoft FORTRAN conforms to the American National Standard Programming
  493.  Language FORTRAN 77, as described in the American National Standards
  494.  Institute (ANSI) X3.9-1978 standard.
  495.  
  496.  ───────────────────────────────────────────────────────────────────────────
  497.  «NOTE»
  498.     «The Microsoft FORTRAN language contains many extensions to the full
  499.     ANSI standard language. In this manual, information on all Microsoft
  500.     extensions is indentified by chevron characters ('«' and '»')»
  501.  ───────────────────────────────────────────────────────────────────────────
  502.  
  503.  Chapter 1 discusses the elements of the FORTRAN programming language.
  504.  Chapter 2 explains the structure of FORTRAN programs. Chapter 3 gives the
  505.  details of FORTRAN's input/output (I/O) system. Chapter 4 is a detailed
  506.  description of all FORTRAN statements. Chapter 5 explains all of FORTRAN's
  507.  intrinsic functions. «Chapter 6 covers Microsoft FORTRAN's metacommands»,
  508.  and Chapter 7 discusses the FL command. The following list shows where to
  509.  look for information on specific topics:
  510.  
  511.  Topic                                      Location of Information
  512.  
  513.  Characters, names, data types,             Chapter 1, "Elements of FORTRAN"
  514.  «attributes,» and expressions in
  515.  FORTRAN
  516.  
  517.  Formatting lines in your source            Chapter 2, "Program Structure"
  518.  program; subroutines, functions,
  519.  and arguments; and structuring
  520.  your FORTRAN programs
  521.  
  522.  Input and output in FORTRAN                Chapter 3, "The Input/Output
  523.                                             System"
  524.  
  525.  FORTRAN statements, listed                 Chapter 4, "Statements"
  526.  alphabetically
  527.  
  528.  FORTRAN intrinsic functions,               Chapter 5, "Intrinsic Functions"
  529.  listed alphabetically
  530.  
  531.  «Compiler directives, called               «Chapter 6, "Metacommands"»
  532.  metacommands, listed
  533.  alphabetically»
  534.  
  535.  FL command                                 Chapter 7, "The FL Command"
  536.  
  537.  Table of the American Standard             Appendix A, "ASCII Character
  538.  Code for Information Interchange           Codes"
  539.  (ASCII) character set
  540.  
  541.  Selected terms used in this                "Glossary"
  542.  documentation
  543.  
  544.  
  545.  Document Conventions
  546.  
  547.  This manual uses the following typographic conventions. (Note that, in most
  548.  cases, blanks are not significant in FORTRAN).
  549.  
  550.  Example                              Description
  551.  of Convention                        of Convention
  552.  
  553.  «Extensions to the ANSI standard     «Text enclosed by the chevron charcters
  554.  language»                            indicates features that are extensions t
  555.                                       the ANSI FORTRAN 77 full-language
  556.                                       standard. These extensions may or
  557.                                       may not be implemented by other
  558.                                       compilers that conform to the
  559.                                       full-language standard.»
  560.  
  561.  OUT.TXT, ANOVA.EXE, COPY, LINK,      Uppercase (capital) letters
  562.  FL                                   indicate file names and DOS-level
  563.                                       commands. Uppercase is also used
  564.                                       for command-line options (unless
  565.                                       the application accepts only
  566.                                       lowercase).
  567.  
  568.  C       Comment line                 This kind of type is used for
  569.          WRITE (*,*) 'Hello           program examples, program output,
  570.          +World                       DOS-level commands, and error
  571.                                       messages within the text. A
  572.                                       capital C marks the beginning of
  573.                                       a comment in sample programs.
  574.                                       Continuation lines are indicated
  575.                                       by a plus sign (+) in column 6.
  576.  
  577.  AUTOMATIC, INTRINSIC, WRITE          Bold capital letters indicate
  578.                                       language-specific keywords with
  579.                                       special meaning to FORTRAN.
  580.                                       Keywords are a required part of
  581.                                       statement syntax, unless enclosed
  582.                                       in double brackets as explained
  583.                                       below. In programs you write,
  584.                                       FORTRAN keywords are entered in
  585.                                       all-uppercase (capital) letters,
  586.                                       or any combination of uppercase
  587.                                       «and lowercase» letters.
  588.  
  589.  other keywords                       Bold lowercase letters are used
  590.                                       for keywords of other languages.
  591.  
  592.                                       In the sentence, «"The value that
  593.                                       is returned by LOCNEAR is
  594.                                       equivalent to a near function or
  595.                                       data pointer in Microsoft C or an
  596.                                       ADR type in Microsoft Pascal,"»
  597.                                       the word «LOCNEAR» is a FORTRAN
  598.                                       keyword, and the words near and
  599.                                       ADR are keywords of Microsoft C
  600.                                       and Microsoft Pascal,
  601.                                       respectively.
  602.  
  603.  Apostrophes: '''                     In Microsoft FORTRAN, an
  604.                                       apostrophe is entered as a single
  605.                                       right quotation mark ('), not a
  606.                                       single left quotation mark (`).
  607.                                       Note that in the typeface used in
  608.                                       examples, such as 'string',
  609.                                       apostrophes look like this: '.
  610.  
  611.  expression                           Words in italics indicate
  612.                                       placeholders for information that
  613.                                       you must supply. A file name is
  614.                                       an example of this kind of
  615.                                       information. Italics are also
  616.                                       occasionally used in the text for
  617.                                       emphasis.
  618.  
  619.  «optional item»                      Items inside bolded chevrons
  620.                                       ('«', '») brackets are optional.
  621.  
  622.  {choice1|choice2}                    Braces and a vertical bar
  623.                                       indicate a choice among two or
  624.                                       more items. You must choose one
  625.                                       of the items unless all of the
  626.                                       items are also enclosed in double
  627.                                       square brackets.
  628.  
  629.  Repeating elements...                Three dots following an item
  630.                                       indicate that more items having
  631.                                       the same form may be entered.
  632.  
  633.  CALL GetNum (i, *1O)                 A column of three dots indicates
  634.  .                                    that part of the example has
  635.  .                                    intentionally been  omitted.
  636.  .
  637.  SUBROUTINE GetNum (i, *)
  638.  
  639.  KEY NAMES                            Capital letters are used
  640.                                       for the names of keys and key
  641.                                       sequences, such as ENTER and
  642.                                       CTRL+C.
  643.  
  644.                                       A plus (+) indicates a
  645.                                       combination of keys. For example,
  646.                                       CTRL+E means to hold down the
  647.                                       CTRL key while pressing the E
  648.                                       key.
  649.  
  650.                                       The carriage-return key is referred to
  651.                                       as ENTER.
  652.  
  653.                                       The cursor movement ("arrow")
  654.                                       keys on the numeric keypad are
  655.                                       called DIRECTION keys. Individual
  656.                                       DIRECTION keys are referred to by
  657.                                       the direction of the arrow on the
  658.                                       key top (LEFT, RIGHT, UP, DOWN)
  659.                                       or the name on the key top (PGUP,
  660.                                       PGDN).
  661.  
  662.                                       The key names used in this manual
  663.                                       correspond to the name on the IBM
  664.                                       Personal Computer keys. Other
  665.                                       machines may use different names.
  666.  
  667.  "defined term"                       Quotation marks usually indicate
  668.                                       a new term defined in the text.
  669.  
  670.  Video Graphics Array (VGA)           Acronyms are usually spelled out
  671.                                       the first time they are used.
  672.  
  673.  
  674.  Example
  675.  
  676.  The following example shows how this manual's typographic conventions are
  677.  used to indicate the syntax of the EXTERNAL statement:
  678.  
  679.       EXTERNAL name «« [attrs] »» «, name «« [attrs] »» »...
  680.  
  681.  This syntax listing shows that when using the EXTERNAL statement, you must
  682.  first enter the word EXTERNAL followed by a name that you specify. «Then,
  683.  you can optionally enter a left bracket ([), followed by attributes (attrs)
  684.  that you specify, followed by a right bracket (]).» If you want to specify
  685.  more names, «optionally followed by attributes (attrs),» you must enter a
  686.  comma, followed by a name, «optionally followed by a left bracket,
  687.  attributes, and a right bracket.» Because the «, name « « [attrs] »» »
  688.  sequence is followed by three dots (...), you can enter as many of those
  689.  sequences (a comma, followed by a name, «optionally followed by attributes
  690.  in brackets») as you want.
  691.  
  692.  
  693.  Books about FORTRAN Programming
  694.  
  695.  Agelhoff, Roy, and Richard Mojena. Applied FORTRAN 77 featuring Structured
  696.  Programming. Belmont, CA: Wadsworth, 1981.
  697.  
  698.  Ashcroft, J., R. H. Eldridge, R. W. Paulson, and G. A. Wilson. Programming
  699.  with FORTRAN 77. Dobbs Ferry, NY: Sheridan House, 1981.
  700.  
  701.  Friedman, Frank, and E. Koffman. Problem Solving and Structured Programming
  702.  in FORTRAN. 2d ed. Reading, MA: Addison-Wesley, 1981.
  703.  
  704.  Kernighan, Brian W., and P. J. Plauger. The Elements of Programming Style.
  705.  New York, NY: McGraw-Hill, 1978.
  706.  
  707.  Ledgard, Henry F., and L. Chmura. FORTRAN with Style. Rochelle Park, NJ:
  708.  Hayden, 1978.
  709.  
  710.  Wagener, Jerrold L. FORTRAN 77: Principles of Programming. New York, NY:
  711.  Wiley, 1980.
  712.  
  713.  These books are listed for your convenience. Microsoft Corporation does not
  714.  endorse these books or recommend them over others on the same subject.
  715.  
  716.  
  717.  Requesting Assistance
  718.  
  719.  If you need help or feel you have discovered a problem in the software,
  720.  please provide the following information to help us locate the problem:
  721.  
  722.    ■  The version of DOS you are running (use the DOS VER command)
  723.  
  724.    ■  Your system configuration:
  725.  
  726.         1. Make and model of your computer
  727.  
  728.         2. Total memory and total free memory at compiler execution time (use
  729.            the DOS CHKDSK command to obtain these values)
  730.  
  731.         3. Any other information you think might be useful
  732.  
  733.    ■  The compiler command line used (or the link command line if the problem
  734.       occurred during linking)
  735.  
  736.    ■  Any object files or libraries you linked with if the problem occurred
  737.       at link time
  738.  
  739.  If your program is large, please try to reduce it to the smallest possible
  740.  program that still produces the problem.
  741.  
  742.  Use the Product Assistance Request form at the back of this manual to send
  743.  this information to Microsoft.
  744.  
  745.  If you have comments or suggestions regarding any of the manuals
  746.  accompanying this product, please indicate them on the Document Feedback
  747.  card at the back of this manual.
  748.  
  749.  If you are not already a registered Microsoft FORTRAN owner, you should fill
  750.  out and return the Registration Card. This enables Microsoft to keep you
  751.  informed of updates and other information.
  752.  
  753.  
  754.  Part 1  Language Reference
  755.  
  756.  This section describes Version 5.0 of the Microsoft FORTRAN lanuage──both
  757.  its ANSI-standard features and the special Microsoft extensions, which are
  758.  indentified by the chevron characters '«' and '»'. The first three chapters
  759.  introduce the language by reviewing the elements of FORTRAN (Chapter 1),
  760.  giving an overview of the FORTRAN program structure (Chapter 2), and
  761.  discussing the FORTRAN input/ouptput system (Chapter 3).
  762.  
  763.  The remaining two chapters provide the information you will need to put
  764.  these features to work. Chapter 4 is an alphabetical statement reference,
  765.  with information on syntax and usage for each Microsoft FORTRAN statement.
  766.  Chapter 5 provides information on intrinsic functions and additional
  767.  procedures supplied with this package.
  768.  
  769.  
  770.  Chapter 1  Elements of FORTRAN
  771.  ───────────────────────────────────────────────────────────────────────────
  772.  
  773.  This chapter explains the building blocks of FORTRAN programs: special
  774.  characters, the scope and naming of FORTRAN identifiers, the data types that
  775.  are available, and the rules that govern their use. The basic arithmetic and
  776.  logical functions available are also covered.
  777.  
  778.  
  779.  1.1  Characters
  780.  
  781.  FORTRAN source files can contain any printable characters in the ASCII
  782.  character set. When character constants or character variables are logically
  783.  compared, the collating sequence for the FORTRAN character set is the ASCII
  784.  sequence. The ASCII character set, listed in Appendix A, "ASCII Character
  785.  Codes," includes the following:
  786.  
  787.    ■  The 52 uppercase and lowercase alphabetic characters (A through Z and a
  788.       through z).
  789.  
  790.       «The Microsoft FORTRAN Compiler interprets lowercase letters as
  791.       uppercase letters in all contexts except character constants and
  792.       Hollerith fields.» In character constants and Hollerith fields, case is
  793.       significant. For example, «the statements WRITE (*, *) and write (*, *)
  794.       are identical, but» the character constants 'ijk' and 'IjK' are
  795.       different.
  796.  
  797.       «There is one exception to case sensitivity in character constants.
  798.       Character constants that are a part of the FORTRAN statements listed in
  799.       Chapter 4, "Statements," are not case sensitive unless the $STRICT
  800.       metacommand is specified. For more information, see Chapter 6,
  801.       "Metacommands."»
  802.  
  803.       «When using the CLOSE statement, for example, you can enter a character
  804.       constant to specify whether to keep or delete a file. The syntax of
  805.       this option is «,STATUS=status», and the acceptable values of status
  806.       are 'KEEP' and 'DELETE'. As long as the $STRICT metacommand is not set,
  807.       setting STATUS equal to 'KEEP' is equivalent to setting STATUS equal to
  808.       'keep' or 'KeEp'.»
  809.  
  810.    ■  The 10 digits (0 through 9). Digits can be included in user-defined
  811.       names; however, a digit may not be the first character.
  812.  
  813.    ■  All other printable characters in the ASCII character set, the blank
  814.       character, and the TAB character.
  815.  
  816.  «In Microsoft FORTRAN, the dollar sign ($) and the underscore (_) can be
  817.  included in user-defined names. The underscore, however, cannot be the first
  818.  character in a name.»
  819.  
  820.  The blank character has no significance in a FORTRAN source file (except as
  821.  listed below) so you can insert blanks to make your programs easier to read.
  822.  The exceptions are the following:
  823.  
  824.    ■  Blanks in character constants or Hollerith fields are significant.
  825.  
  826.    ■  A blank or 0 in column 6 indicates an initial line (see Section 2.1,
  827.       "Lines," for an explanation of initial lines).
  828.  
  829.  «The tab character's interpretation depends on which column it is in:»
  830.  
  831.  «Column                                 Interpretation»
  832.  
  833.  «1-5»                                   «The character following the tab
  834.                                          character in the source line is
  835.                                          interpreted as being in column
  836.                                          7.»
  837.  
  838.  «6-72»                                  «The tab character is interpreted
  839.                                          as a single blank, unless it is
  840.                                          in a character or Hollerith
  841.                                          constant (described in Section
  842.                                          3.7.1.2). A tab character in a
  843.                                          character or Hollerith constant
  844.                                          is interpreted as a tab
  845.                                          character.»
  846.  
  847.  
  848.  1.2  Names
  849.  
  850.  All variables, arrays, functions, programs, and subprograms are identified
  851.  by names. A name is a sequence of alphanumeric characters and must follow
  852.  these guidelines:
  853.  
  854.    ■  The first character in a name must be alphabetic; the rest of the
  855.       characters must be alphanumeric. «Microsoft FORTRAN allows the dollar
  856.       sign ($) as an alphabetic character that follows Z in the IMPLICIT
  857.       collating sequence for names. The underscore may also appear in names,
  858.       but it may not be the first character.»
  859.  
  860.    ■  Blanks are ignored. Variable names like low  volt   age  and lowvoltage
  861.       are identical to the compiler.
  862.  
  863.    ■  «Names may be up to 31 characters long; all characters are
  864.       significant.» Only the first six alphanumeric characters are
  865.       significant and the rest are ignored. «(This limitation does not apply
  866.       to Microsoft FORTRAN unless the $STRICT or $TRUNCATE metacommand is in
  867.       effect.)» Blank characters do not count. For example, the names
  868.       delicate and d eli cat e  are both interpreted as delica «if $TRUNCATE
  869.       or $STRICT is set.»
  870.  
  871.    ■  Your operating system or linker may impose other limits on name
  872.       lengths.
  873.  
  874.  FORTRAN keywords are not reserved as in other languages. The compiler
  875.  recognizes keywords by their context. For example, a program can have an
  876.  array named IF, read, or Goto. Using keyword names for variables, however,
  877.  makes programs harder to read and understand. For readability, and to reduce
  878.  the possibility of hard-to-find bugs, programmers should avoid using names
  879.  that look like parts of FORTRAN statements.
  880.  
  881.  Another type of error occurs when a typographical error causes the compiler
  882.  to interpret a FORTRAN keyword as part of a variable name. Consider the
  883.  following two statements:
  884.  
  885.             DO 5 INC = 1,20
  886.             DO 5 INC = 1.20
  887.  
  888.  The first statement is the beginning of a DO loop. The second statement
  889.  assigns the value 1.20 to a variable named DO5INC. The only difference
  890.  between the two statements is that the first contains a comma and the second
  891.  contains a period. The compiler cannot catch this type of error. The
  892.  terminating line for the DO loop (a subsequent line labeled 5) is no
  893.  different from any other line in the program, so the compiler has no way to
  894.  recognize that an intended DO statement is missing.
  895.  
  896.  «Because the compiler reserves the following three predefined names, they
  897.  cannot be used to name a program:»
  898.  
  899.    1. «_main, which is the external name for main programs. (The use of
  900.       "main" is permitted under certain conditions, but is not recommended.
  901.       See Section 2.7, "Main Program," for more information.)»
  902.  
  903.    2. «COMMQQ, which is the system name for blank common blocks.»
  904.  
  905.    3. «BLKDQQ, which is the default system name for block-data subprograms.»
  906.  
  907.  «Also, all names beginning with two underscore characters (__) or ending
  908.  with QQ, such as __main  or MAINQQ, are reserved by the compiler. If you
  909.  must use a name beginning with two underscore characters or ending with QQ,
  910.  use the ALIAS attribute to provide an acceptable external name for the
  911.  variable.»
  912.  
  913.  
  914.  1.2.1  Global and Local Names
  915.  
  916.  There are two basic types of names: global and local.
  917.  
  918.  Global names are recognized anywhere in a program, so they can have only one
  919.  global definition anywhere within that program. All subroutine, function,
  920.  program, and common-block names are global. For example, if you use a
  921.  subroutine named Sort in one program, you cannot also have a function named
  922.  Sort in that program.
  923.  
  924.  You can, however, use Sort as a local name (described below) in a different
  925.  program unit, provided you do not reference the global name Sort within that
  926.  unit. For example, a program containing a function named Sort can also
  927.  contain a subroutine that declares a variable named Sort, as long as the
  928.  subroutine does not call the function Sort.
  929.  
  930.  Common-block names are a special case of global names. You can use the same
  931.  name for a common block and a local name in the same program. This is
  932.  permitted because common-block names are always enclosed in slashes,
  933.  distinguishing them from other names. For example, if your program includes
  934.  a common block named /distance/, you can also name an array in that program
  935.  distance (arrays have local names).
  936.  
  937.  Local names have meaning only in a single program unit. In another program
  938.  unit of the same program, the same name can be used again to refer to the
  939.  same program object or to a different object.
  940.  
  941.  All variables, arrays, arguments, and statement functions have local names.
  942.  
  943.  Arguments to statement functions are a special case of local names. These
  944.  arguments have meaning only in the statement-function statement. If,
  945.  however, the arguments' names are used outside of the statement-function
  946.  statement, the local variables in the enclosing subprogram must have the
  947.  same data type as the statement function arguments with the same name. See
  948.  the Statement Function entry in Section 4.2 for more information.
  949.  
  950.  
  951.  1.2.2  Undeclared Names
  952.  
  953.  If a name is not explicitly defined, the compiler classifies the name
  954.  according to the context in which it is first encountered. «If IMPLICIT NONE
  955.  has been declared, an error message is generated at the first use of any
  956.  variable that has not been explicitly typed. If the $DECLARE metacommand is
  957.  in effect, a warning message is generated at the first use of any variable
  958.  that has not been given a value in a DATA, PARAMETER, or assignment
  959.  statement.» The following list explains how undeclared names are classified:
  960.  
  961.  Use of Name                                Classification
  962.  
  963.  As a variable or in a function             The first letter of a variable or
  964.  reference                                  function determines its type. By
  965.                                             default, variable names starting
  966.                                             with I, J, K, L, M, or
  967.                                             (uppercase «or lowercase») are
  968.                                             given the type INTEGER, while
  969.                                             variable names starting with any
  970.                                             other letter or with a dollar
  971.                                             sign are given the type REAL. You
  972.                                             can use the IMPLICIT statement to
  973.                                             change the association between
  974.                                             type and first alphabetic
  975.                                             character «(including the dollar
  976.                                             sign)».
  977.  
  978.  As the target of a CALL statement          The compiler assumes the name is
  979.                                             the name of a subroutine. A
  980.                                             subroutine does not return a
  981.                                             value through its name, so no
  982.                                             typing occurs.
  983.  
  984.  
  985.  1.3  Data Types
  986.  
  987.  The six basic data types in FORTRAN are described in this section. They are
  988.  
  989.    1. Integer (INTEGER, «INTEGER*1, INTEGER*2, and INTEGER*4»)
  990.  
  991.    2. Real (REAL, DOUBLE PRECISION, «REAL*4, or REAL*8»)
  992.  
  993.    3. Complex (COMPLEX, «COMPLEX*8, DOUBLE COMPLEX, and COMPLEX*16»)
  994.  
  995.    4. Logical (LOGICAL, «LOGICAL*1, LOGICAL*2, and LOGICAL*4»)
  996.  
  997.    5. Character (CHARACTER[«*n», where 1 <= n <= 32,767)
  998.  
  999.    6. «Record (variables defined with STRUCTURE types)»
  1000.  
  1001.  The data type of a variable, array, symbolic constant, or function can be
  1002.  declared in a specification statement. If its type is not declared, the
  1003.  compiler determines a name's type by its first letter (as described in
  1004.  Section 1.2.2, "Undeclared Names"). A type statement can also dimension an
  1005.  array variable. «In Microsoft FORTRAN a type statement can initialize
  1006.  variables and arrays.» See Chapter 4, "Statements," for detailed
  1007.  descriptions of type statements.
  1008.  
  1009.  The following sections describe each data type individually. Memory
  1010.  requirements are shown in Table 1.1.
  1011.  
  1012.  Table 1.1  Memory Requirements
  1013.  
  1014.  Type                       Bytes             Notes
  1015.  
  1016.  INTEGER                    «2 or» 4          «Defaults to 4 bytes. The
  1017.                                               setting of the $STORAGE
  1018.                                               metacommand determines the size
  1019.                                               of INTEGER and LOGICAL values.»
  1020.  «INTEGER*1                 1
  1021.  «INTEGER*2                 2
  1022.  «INTEGER*4                 4
  1023.  
  1024.  REAL                       4                 «Same as REAL*4.»
  1025.  «REAL*4                    4»
  1026.  
  1027.  DOUBLE PRECISION           8                 «Same as REAL*8.»
  1028.  «REAL*8                    8»
  1029.  
  1030.  COMPLEX                    8                 «Same as COMPLEX*8.»
  1031.  «COMPLEX*8                 8»
  1032.  «DOUBLE COMPLEX            16»               «Same as COMPLEX*16.»
  1033.  «COMPLEX*16                16»
  1034.  
  1035.  LOGICAL                    «2 or» 4          «Defaults to 4 bytes. The
  1036.                                               setting of the $STORAGE
  1037.                                               metacommand determines the size
  1038.                                               of INTEGER and LOGICAL values.»
  1039.  «LOGICAL*1                 1»
  1040.  «LOGICAL*2                 2»
  1041.  «LOGICAL*4                 4»
  1042.  
  1043.  CHARACTER                  1                 CHARACTER and CHARACTER*1 are
  1044.                                               the same.
  1045.  
  1046.  CHARACTER*n                n                 Maximum n is 32,767.
  1047.  
  1048.  «RECORD»                   «Size of          «Maximum 65,535 bytes; affected
  1049.                             structure         by $PACK metacommand.»
  1050.                             type»
  1051.  
  1052.  
  1053.  1.3.1  Integer Data Types
  1054.  
  1055.  An integer value is an exact representation of the corresponding integer.
  1056.  Table 1.2 shows the different types of integers, how many bytes of memory
  1057.  each type occupies, and the range of each type. «Note that variables and
  1058.  functions declared «as INTEGER are allocated as INTEGER*4, unless the
  1059.  $STORAGE metacommand is used to specify a 2-byte memory allocation. The
  1060.  $STORAGE metacommand also determines the default storage size of integer
  1061.  constants. If the $STORAGE:2 metacommand is specified, for example, integer
  1062.  constants are two bytes long, by default. However, a constant outside the
  1063.  INTEGER*2 range is given 4 bytes of storage.»
  1064.  
  1065.  Table 1.2  Integers
  1066.  
  1067.  Data Type                  Bytes            Range
  1068.  
  1069.  «INTEGER*1»                1                «-128 to 127»
  1070.  «INTEGER*2»                2                «-32,768 to 32,767»
  1071.  
  1072.  «INTEGER*4»                4                «-2,147,483,648 to
  1073.                                              2,147,483,647»
  1074.  
  1075.  INTEGER                    «2 or» 4         «Depends on setting of $STORAGE»
  1076.  
  1077.  «Although an INTEGER*4 constant or variable can take any value in its full
  1078.  32-bit range, it cannot be assigned its smallest negative value
  1079.  (-2,147,483,648) when that value is expressed as a numeric constant. For
  1080.  example, the statement varname = -2147483648 causes a compiler overflow
  1081.  error. If you wish to give a four-byte integer this value, the right side of
  1082.  the assignment statement must be a mathematical expression.»
  1083.  
  1084.  
  1085.  Syntax
  1086.  
  1087.  Constants are interpreted in base 10. To specify a constant «that is not in
  1088.  base 10,» use the following syntax:
  1089.  
  1090.  «sign»««base»#»constant
  1091.  
  1092.  The optional sign is a plus or minus sign. «The base can be any integer from
  1093.  2 through 36. If base is omitted but # is specified, the integer is
  1094.  interpreted in base 16. If both base and # are omitted, the integer is
  1095.  interpreted in base 10. For bases 11 through 36, the letters A through Z
  1096.  represent numbers greater than 9. For base 36, for example, A represents 10,
  1097.  B represents 11, C represents 12, and so on, through Z, which represents 35.
  1098.  The case of the letters is not significant.»
  1099.  
  1100.  
  1101.  Example
  1102.  
  1103.  The following seven integers are all assigned a value equal to 3,994,575
  1104.  decimal:
  1105.  
  1106.       «I = 2#1111001111001111001111
  1107.       m = 7#45644664
  1108.       J = +8#17171717
  1109.       K = #3CF3CF
  1110.       n = +17#2DE110»
  1111.       L = 3994575
  1112.       «index = 36#2DM8F»
  1113.  
  1114.  A decimal point is not allowed in an integer constant.
  1115.  
  1116.  Integer constants must also be in the ranges specified above. «However, for
  1117.  numbers with a radix that is other than 10, the compiler reads out-of-range
  1118.  numbers up to 2^(32). They are interpreted as the negative numbers with the
  1119.  corresponding internal representation. For example, 16#FFFFFFFF results in
  1120.  an arithmetic value of -1. If the $DEBUG metacommand is in effect, a
  1121.  compile-time range error occurs instead.»
  1122.  
  1123.  
  1124.  1.3.2  The Single-Precision IEEE Real Data Type
  1125.  
  1126.  A single-precision real value (REAL «or REAL*4») is usually an approximation
  1127.  of the real number desired and occupies 4 bytes of memory. The precision of
  1128.  this data type is between six and seven decimal digits. You can specify more
  1129.  than six digits, but only the first six are significant. The range of
  1130.  single-precision real values includes the negative numbers from
  1131.  approximately -3.4028235E+38 to -1.1754944E-38, the number 0, and the
  1132.  positive numbers from approximately +1.1754944E-38 to +3.4028235E+38.
  1133.  
  1134.  
  1135.  Syntax
  1136.  
  1137.  A real constant has the following form:
  1138.  
  1139.       «sign»«integer» «.«fraction»»«Eexponent»
  1140.  
  1141.  Parameter                                  Value
  1142.  
  1143.  sign                                       A sign (+ or -).
  1144.  
  1145.  integer                                    An integer part, consisting of
  1146.                                             one or more decimal digits.
  1147.                                             Either integer or fraction may be
  1148.                                             omitted, but not both.
  1149.  
  1150.  .                                          A decimal point.
  1151.  
  1152.  fraction                                   A fraction part, consisting of
  1153.                                             one or more decimal digits.
  1154.                                             Either fraction or integer may be
  1155.                                             omitted, but not both.
  1156.  
  1157.  Eexponent                                  An exponent part, consisting of
  1158.                                             an optionally signed one- or
  1159.                                             two-digit integer constant. An
  1160.                                             exponent indicates that the value
  1161.                                             preceding the exponent is to be
  1162.                                             multiplied by 10 raised to the
  1163.                                             value exponent.
  1164.  
  1165.  
  1166.  Example
  1167.  
  1168.  The following real constants all represent the same real number (1.23):
  1169.  
  1170.       +1.2300E0      .012300E2      1.23E0          123E-2
  1171.       +1.2300        123.0E-2       .000123E+4      1230E-3
  1172.  
  1173.  
  1174.  1.3.3  The Double-Precision IEEE Real Data Type
  1175.  
  1176.  A double-precision real value (DOUBLE PRECISION «or REAL*8») is usually an
  1177.  approximation of the real number desired, and occupies 8 bytes of memory.
  1178.  The precision is between 15 and 16 decimal digits. You can specify more
  1179.  digits, but only the first 15 are significant. The range of double-precision
  1180.  real values includes the number 0 and the negative numbers from
  1181.  approximately -1.797693134862316D+308 to -2.225073858507201D-308. It also
  1182.  includes the positive numbers from approximately +2.225073858507201D-308 to
  1183.  +1.797693134862316D+308.
  1184.  
  1185.  A double-precision real constant has the same form as a single-precision
  1186.  real constant, except that the letter D is used for exponents instead of the
  1187.  letter E, and an exponent part is mandatory. If the exponent is omitted, the
  1188.  number is interpreted as a single-precision constant.
  1189.  
  1190.  
  1191.  Example
  1192.  
  1193.  The following double-precision real constants all represent fifty-two
  1194.  one-thousandths:
  1195.  
  1196.       5.2D-2    +.00052D+2    .052D0    52.000D-3    52D-3
  1197.  
  1198.  
  1199.  1.3.4  Complex Data Types
  1200.  
  1201.  The COMPLEX «or COMPLEX*8» data type is an ordered pair of single-precision
  1202.  real numbers. «The DOUBLE COMPLEX or COMPLEX*16 data type is an ordered pair
  1203.  of double-precision real numbers.» The first number in the pair is the real
  1204.  part of a complex number, and the second number in the pair is the imaginary
  1205.  part. Both the real and imaginary components of a COMPLEX «or COMPLEX*8»
  1206.  number are REAL*4 numbers, so COMPLEX «or COMPLEX*8» numbers occupy 8 bytes
  1207.  of memory. «Both the real and imaginary components of a DOUBLE COMPLEX or
  1208.  COMPLEX*16 number are REAL*8 numbers, so DOUBLE COMPLEX and COMPLEX*16
  1209.  numbers occupy 16 bytes of memory.»
  1210.  
  1211.  
  1212.  Syntax
  1213.  
  1214.       ««sign»»(real, imag)
  1215.  
  1216.  Parameter                                  Value
  1217.  
  1218.  «sign»                                     «A sign (+ or -). If specified,
  1219.                                             the sign applies to both real and
  1220.                                             imag.»
  1221.  
  1222.  real                                       A real number «or an integer»,
  1223.                                             representing the real part.
  1224.  
  1225.  imag                                       A real number «or an integer»,
  1226.                                             representing the imaginary part.
  1227.  
  1228.  For example, the ordered pair (7,3.2) represents the complex number
  1229.  7.0+3.2i. «The ordered pair -(-.11E2,#5F) represents the complex number
  1230.  11.0-95.0i.»
  1231.  
  1232.  
  1233.  1.3.5  Logical Data Types
  1234.  
  1235.  The logical data type consists of two logical values, .TRUE. and .FALSE. A
  1236.  LOGICAL variable occupies «2 or» 4 bytes of memory«, depending on the
  1237.  setting of the $STORAGE metacommand. The default is 4 bytes. The value (true
  1238.  or false) of a logical variable is unaffected by the $STORAGE metacommand.»
  1239.  
  1240.  «LOGICAL*1 values occupy a single byte, which is either 0 (.FALSE.) or 1
  1241.  (.TRUE.). LOGICAL*2 values occupy 2 bytes: the least significant (first)
  1242.  byte contains a LOGICAL*1 value and the most significant byte is undefined.
  1243.  LOGICAL*4 variables occupy two words: the least significant (first) word
  1244.  contains a LOGICAL*2 value; the most significant word is undefined.»
  1245.  
  1246.  
  1247.  1.3.6  The Character Data Type
  1248.  
  1249.  Character variables occupy one byte of memory for each character and are
  1250.  assigned to contiguous bytes, independent of word boundaries. «However, when
  1251.  character and noncharacter variables are allocated in the same common block,
  1252.  the compiler places noncharacter variables that follow character variables
  1253.  on word boundaries. See the COMMON entry in Section 4.2, "Statement
  1254.  Directory," for more information on character variables in common blocks.»
  1255.  
  1256.  The length of a character variable, character array element, structure
  1257.  element, character function, or character constant with a symbolic name must
  1258.  be between 1 and 32,767. The length can be specified by the following:
  1259.  
  1260.    ■  An integer constant in the range 1-32,767
  1261.  
  1262.    ■  An expression (in parentheses) that evaluates to an integer in the
  1263.       range 1-32,767
  1264.  
  1265.    ■  An asterisk, which indicates the length of the string may vary
  1266.  
  1267.  
  1268.  Examples
  1269.  
  1270.  The following examples show proper usage:
  1271.  
  1272.             CHARACTER*32 string
  1273.             CHARACTER string*32
  1274.             CHARACTER string*(const*5)
  1275.             CHARACTER string*(*)
  1276.             CHARACTER*(*) string
  1277.  
  1278.  See the CHARACTER entry in Section 4.2, "Statement Directory," for more
  1279.  information.
  1280.  
  1281.  A character constant is a sequence of one or more of the printable ASCII
  1282.  characters enclosed in a pair of apostrophes (') «or quotes (")». The
  1283.  apostrophes «or quotes» that delimit the string are not stored with the
  1284.  string. To represent an apostrophe within a string delimited by apostrophes,
  1285.  specify two consecutive apostrophes with no blanks between them. «To
  1286.  represent a quotation mark within a string delimited by quotation marks,
  1287.  specify two consecutive quotation marks with no blanks between them.»
  1288.  
  1289.  ───────────────────────────────────────────────────────────────────────────
  1290.  NOTE
  1291.     An apostrophe is a single right quotation mark ('), not a single left
  1292.     quotation mark (`). In the typeface used in examples, such as 'string',
  1293.     apostrophes look like this: '.
  1294.  ───────────────────────────────────────────────────────────────────────────
  1295.  
  1296.  Blank characters and tab characters are permitted in character constants and
  1297.  are significant. The case of alphabetic characters is also significant. «You
  1298.  can use C strings (as described in Section 1.3.6.1) to define strings with
  1299.  nonprintable characters, or to specify the null string.»
  1300.  
  1301.  The length of a character constant is equal to the number of characters
  1302.  between the apostrophes «or quotation marks». (A pair of apostrophes in a
  1303.  string delimited by apostrophes counts as a single character. «A pair of
  1304.  quotation marks in a string delimited by quotation marks counts as a single
  1305.  character.»)
  1306.  
  1307.  Some sample character constants are listed below:
  1308.  
  1309.  String                                     Constant
  1310.  
  1311.  'String'                                   String
  1312.  
  1313.  '1234!@#$'                                 1234!@#$
  1314.  
  1315.  'Blanks count'                             Blanks count
  1316.  
  1317.  ''''''                                     ''
  1318.  
  1319.  'Case Is Significant'                      Case Is Significant
  1320.  
  1321.  «"''"»                                     «''»
  1322.  
  1323.  «"""Double"" quotes count as               «"Double" quotes count as one»
  1324.  one"»
  1325.  
  1326.  FORTRAN source lines are 72 characters long (characters in columns 73-80 are
  1327.  ignored by the compiler), and lines with less than 72 characters are padded
  1328.  with blanks. Therefore, when a character constant extends across a line
  1329.  boundary, its value includes any blanks added to the lines. Consider the
  1330.  following FORTRAN statement:
  1331.  
  1332.       C     Sample FORTRAN continuation line
  1333.             Heading (secondcolumn) =  'Acceleration of Particles
  1334.            +from Group A'
  1335.  
  1336.  That statement sets the array element heading (secondcolumn) to
  1337.  'Acceleration of Particles              from Group A'. There are 14 blanks
  1338.  between Particles and from because Particles ends in column 58, leaving
  1339.  14 blanks to be added to the string.
  1340.  
  1341.  
  1342.  1.3.6.1  «C Strings»
  1343.  
  1344.  «String values in the C language are terminated with null characters
  1345.  (CHAR(0)), and may contain nonprintable characters (such as newline and
  1346.  backspace). Nonprintable characters are specified using the backslash as an
  1347.  escape character, followed by a single character indicating the nonprintable
  1348.  character desired. This type of string is specified in Microsoft FORTRAN by
  1349.  using a standard string constant followed by the character C. The standard
  1350.  string constant is then interpreted as a C-language constant. Backslashes
  1351.  are treated as escapes, and a null character is automatically appended to
  1352.  the end of the string (even if the string already ends in a null character).
  1353.  Table 1.3 shows the valid escape sequences. If a string contains an escape
  1354.  sequence that isn't in this table (such as \z), the backslash is ignored.»
  1355.  
  1356.  «Table 1.3  C String Escape Sequences»
  1357.  
  1358.  «Sequence                  Character»
  1359.  
  1360.  «\a»                       «Bell»
  1361.  
  1362.  «\b»                       «Backspace»
  1363.  
  1364.  «\f»                       «Form feed»
  1365.  
  1366.  «\n»                       «Newline»
  1367.  
  1368.  «\r»                       «Carriage return»
  1369.  
  1370.  «\t»                       «Horizontal tab»
  1371.  
  1372.  «\v»                       «Vertical tab»
  1373.  
  1374.  «\xhh»                     «Hexadecimal bit pattern»
  1375.  
  1376.  «\'»                       «Single quote»
  1377.  
  1378.  «\"»                       «Double quote»
  1379.  
  1380.  «\\»                       «Backslash»
  1381.  
  1382.  «\ooo»                     «Octal bit pattern»
  1383.  
  1384.  «A C string must also be a valid FORTRAN string. Therefore, if the string is
  1385.  delimited by apostrophes, all apostrophes in the string itself must be
  1386.  represented by double apostrophes. The escape sequence \'a causes a compiler
  1387.  syntax error because FORTRAN interprets the quotation mark as the end of a
  1388.  string.
  1389.  
  1390.  «The correct form is \''a. (If the string is delimited with quotation marks,
  1391.  an apostrophe may be entered as a single character.) C strings and ordinary
  1392.  strings differ only in how you specify the value of the string. The compiler
  1393.  treates them identically.»
  1394.  
  1395.  «The sequences \ooo and \xhh allow any ASCII character to be given as a one-
  1396.  to three-digit octal or a one- to two-digit hexadecimal character code. The
  1397.  o digit must be in the range 0-7, and the h digit must be in the range 0-F.
  1398.  For example, the C strings '\010'C and '\x08'C both represent a backspace
  1399.  character followed by a null character.»
  1400.  
  1401.  «The C string '\\abcd'C is equivalent to the string  '\abcd'  with a null
  1402.  character appended. The string ''C represents the ASCII null character. Note
  1403.  that the character constant '' is illegal because it has a length of 0, but
  1404.  ''C is legal because it has a length of 1.»
  1405.  
  1406.  
  1407.  1.3.6.2  Character Substrings
  1408.  
  1409.  Character substrings are used to access a contiguous part of a character
  1410.  variable.
  1411.  
  1412.  
  1413.  Syntax
  1414.  
  1415.       variable («first»:«last»)
  1416.  
  1417.  Parameter                                  Description
  1418.  
  1419.  variable                                   A character variable or a
  1420.                                             character array element.
  1421.  
  1422.  first                                      An integer expression «or
  1423.                                             arithmetic expression» that
  1424.                                             defines the first (leftmost)
  1425.                                             character in the substring. The
  1426.                                             compiler truncates first to an
  1427.                                             integer value. The default for
  1428.                                             first is 1, so if first is
  1429.                                             unspecified, the substring starts
  1430.                                             with the first character in the
  1431.                                             string.
  1432.  
  1433.  last                                       An integer expression «or
  1434.                                             arithmetic expression» that
  1435.                                             defines the last (rightmost)
  1436.                                             character in the substring. The
  1437.                                             compiler truncates last to an
  1438.                                             integer value. The default for
  1439.                                             last is the length of the string,
  1440.                                             so if last is unspecified, the
  1441.                                             substring ends with the last
  1442.                                             character in the string.
  1443.  
  1444.  The length of the substring is last - first + 1. For example, if a 10-byte
  1445.  character variable name contains the string 'Jane Doe ', the following is
  1446.  true:
  1447.  
  1448.  Character Variable                         Equivalent String
  1449.  
  1450.  name(:5)                                   'Jane '
  1451.  
  1452.  name(6:)                                   'Doe '
  1453.  
  1454.  name(3:7)                                  'ne Do'
  1455.  
  1456.  name(:)                                    'Jane Doe '
  1457.  
  1458.  Note that name(:) is equivalent to name.
  1459.  
  1460.  If the character variable is of length characters, the following
  1461.  relationships must be true:
  1462.  
  1463.       1 <= first <= last <= length
  1464.  
  1465.  That is, both first and last must be greater than zero; last must be greater
  1466.  than or equal to first; and neither first nor last can be greater than
  1467.  length.
  1468.  
  1469.  For the 10-byte character variable name, the following substring
  1470.  specifications are illegal:
  1471.  
  1472.       name(0:4)
  1473.       name(6:5)
  1474.       name(11:12)
  1475.       name(0:)
  1476.       name(:11)
  1477.  
  1478.  «If the $DEBUG metacommand is in effect, a run-time error occurs if these
  1479.  relationships are not true. If $DEBUG is not in effect, the results are
  1480.  undefined.»
  1481.  
  1482.  
  1483.  Example
  1484.  
  1485.       C     This program writes the second half of
  1486.       C     the alphabet, followed by the first half.
  1487.             CHARACTER alpha*26
  1488.             alpha = 'abcdefghijklmnopqrstuvwxyz'
  1489.             WRITE (*, *) alpha(14:), alpha(:13)
  1490.             END
  1491.  
  1492.  
  1493.  Output
  1494.  
  1495.       nopqrstuvwxyzabcdefghijklm
  1496.  
  1497.  The use of a noninteger expression for the first and last parameters causes
  1498.  an error. «(This limitation does not apply to Microsoft FORTRAN unless the
  1499.  $STRICT metacommand is in effect.)»
  1500.  
  1501.  
  1502.  1.4  «Records»
  1503.  
  1504.  «A record is a "structure" variable. A structure is a user-defined compound
  1505.  data type that consists of variable type definitions and unions of maps as
  1506.  explained below. Each item within a structure is called a "structure
  1507.  element."»
  1508.  
  1509.  
  1510.  «Example»
  1511.  
  1512.  «The following example is a structure definition for a variable type that
  1513.  contains employee data:»
  1514.  
  1515.            «STRUCTURE /employee_data/
  1516.                CHARACTER*25  last_name
  1517.                CHARACTER*15  first_name
  1518.                CHARACTER*20  street_name
  1519.                INTEGER*2     street_number
  1520.                INTEGER*2     apt_number
  1521.                CHARACTER*20  city
  1522.                CHARACTER*2   state
  1523.                INTEGER*4     zip
  1524.                INTEGER*4     telephone
  1525.                INTEGER*2     date_of_birth
  1526.                INTEGER*2     date_of_hire
  1527.                INTEGER*2     social_security(3)
  1528.                LOGICAL*2     married
  1529.                INTEGER*2     dependents
  1530.             END STRUCTURE»
  1531.  
  1532.  «A structure specification is not a variable, but a variable type. Structure
  1533.  variables are defined with the RECORD statement. In a company with 200
  1534.  employees, the following statement would define an array of structure
  1535.  variables to hold employee data, using the previous structure definition:»
  1536.  
  1537.             «RECORD /employee_data/ employees(200)»
  1538.  
  1539.  «Structure elements are referenced by specifying the sequence of elements
  1540.  needed to reach the desired element. The elements are separated by a period.
  1541.  For example, the number of dependents of the ninety-ninth employee is
  1542.  specified by employees(99).dependents. The first letter of the name of the
  1543.  state where this employee lives is specified by employees(99).state(1:1).
  1544.  Note that the data type of a structure reference is the type of the element
  1545.  referenced. In the two examples given here, the first reference is of
  1546.  type INTEGER*2. The second reference is of type CHARACTER*2. Any intervening
  1547.  references are for identification only; they do not affect the data type.»
  1548.  
  1549.  «Because periods are used to delimit structure elements, an element may not
  1550.  have the name of a relational or logical operator (NOT, AND, OR, GE, EQ,
  1551.  etc.). If the name of a relational or logical operator is used, the compiler
  1552.  will try to interpret the name as a relational operator.»
  1553.  
  1554.  
  1555.  «Example»
  1556.  
  1557.  «A structure definition can contain structure variable declarations. For
  1558.  example, the employee's name and address could have been defined as
  1559.  individual structure types:»
  1560.  
  1561.            «STRUCTURE /employee_name/
  1562.                CHARACTER*25  last_name
  1563.                CHARACTER*15  first_name
  1564.             END STRUCTURE»
  1565.  
  1566.            «STRUCTURE /employee_addr/
  1567.                CHARACTER*20  street_name
  1568.                INTEGER*2     street_number
  1569.                INTEGER*2     apt_number
  1570.                CHARACTER*20  city
  1571.                CHARACTER*2   state
  1572.                INTEGER*4     zip
  1573.             END STRUCTURE»
  1574.  
  1575.  «These become structure variables within the employee_data  structure:»
  1576.  
  1577.            «STRUCTURE /employee_data/
  1578.                RECORD  /employee_name/  name
  1579.                RECORD  /employee_addr/  addr
  1580.                INTEGER*4  telephone
  1581.                INTEGER*2  date_of_birth
  1582.                INTEGER*2  date_of_hire
  1583.                INTEGER*2  social_security(3)
  1584.                LOGICAL*2  married
  1585.                INTEGER*2  dependents
  1586.             END STRUCTURE»
  1587.  
  1588.  «Note that the reference to the first letter of the ninety-ninth employee's
  1589.  state of residence would now be employees(99).addr.state(1:1).»
  1590.  
  1591.  «A structure definition can also contain unions of maps. A map specifies
  1592.  that one or more variables are positioned contiguously in memory. The
  1593.  variables may be of any type, including structures, as shown below:»
  1594.  
  1595.            «MAP
  1596.                INTEGER*4  manny, moe, jack
  1597.                CHARACTER*21  myname
  1598.             END MAP»
  1599.  
  1600.  «In the examples, the four-byte integers manny, moe, and jack  appear first
  1601.  in memory, followed immediately by the 21-character variable myname. The
  1602.  starting addresses of each variable (and whether or not any bytes are used)
  1603.  is determined by the setting of the $PACK metacommand or /Zp command-line
  1604.  option.» «Here is another example of a map:»
  1605.  
  1606.            «MAP
  1607.                CHARACTER*7  yourname
  1608.                REAL*4  meg, joe, amy, zelda
  1609.             END MAP»
  1610.  
  1611.  «Maps can only appear within a UNION statement. When maps are combined in a
  1612.  union, the variables overlay each other as they do in an EQUIVALENCE
  1613.  statement, as shown in the following example:»
  1614.  
  1615.            «UNION
  1616.                MAP
  1617.                   INTEGER*4  manny, moe, jack
  1618.                   CHARACTER*21  myname
  1619.                END MAP
  1620.                MAP
  1621.                   CHARACTER*7  yourname
  1622.                   REAL*4  meg, joe, amy, zelda
  1623.                END MAP
  1624.             END UNION»
  1625.  
  1626.  «Assuming that $PACK:1 is in effect, the seven bytes of yourname will
  1627.  overlay the four bytes of manny, and the first three bytes of moe. The first
  1628.  byte of meg will overlay the last byte of moe, and so forth. If $PACK:2 is
  1629.  in effect, yourname and manny plus moe will be overlaid as before, but the
  1630.  odd byte at the end of yourname will be left empty. Therefore, the first
  1631.  byte of meg will begin on the first byte of jack. For more information on
  1632.  the $PACK metacommand, see Chapter 6, "Metacommands."»
  1633.  
  1634.  «Although individual structure elements may be written to or read from a
  1635.  file, any attempt to write a structure variable as a whole causes a
  1636.  compile-time error.»
  1637.  
  1638.  «For more information, see the RECORD and STRUCTURE entries in Section 4.2,
  1639.  "Statement Directory."»
  1640.  
  1641.  
  1642.  1.5  Arrays
  1643.  
  1644.  «The number of elements in an array and the number of its dimensions are
  1645.  limited only by available memory. If the $STRICT metacommand is in effect,»
  1646.  a warning is generated if more than seven dimensions are specified. An array
  1647.  element is referenced with the following syntax:
  1648.  
  1649.       array (subscripts)
  1650.  
  1651.  Parameter                                  Value
  1652.  
  1653.  array                                      The name of the array. If the
  1654.                                             type of the array is not declared
  1655.                                             in a type statement, the array
  1656.                                             elements have the type indicated
  1657.                                             by the first letter of array.
  1658.  
  1659.  subscripts                                 Subscript expression(s). If there
  1660.                                             is more than one subscript
  1661.                                             expression, they must be
  1662.                                             separated by commas. The number
  1663.                                             of subscript expressions must
  1664.                                             equal the number of dimensions in
  1665.                                             the array declaration. For
  1666.                                             information on declaring arrays,
  1667.                                             see the DIMENSION entry in
  1668.                                             Section 4.2, "Statement
  1669.                                             Directory."
  1670.  
  1671.                                             Each subscript must be an
  1672.                                             arithmetic expression. The result
  1673.                                             of the expression is converted to
  1674.                                             an integer by truncation. Each
  1675.                                             subscript must be an integer
  1676.                                             expression. «(This limitation
  1677.                                             does not apply to Microsoft
  1678.                                             FORTRAN unless the $STRICT
  1679.                                             metacommand is in effect.)»
  1680.                                             Function, array-element, and
  1681.                                             statement-element references are
  1682.                                             allowed. A subscript value can be
  1683.                                             positive, negative, or 0.
  1684.  
  1685.  
  1686.  Examples
  1687.  
  1688.  The following are examples of array-element references:
  1689.  
  1690.             DIMENSION  a(3,2), b(0:2,0:3), c(4,5), d(5,6),
  1691.            +           v(10), q(3.2,4.5)
  1692.             EQUIVALENCE (x, v(1)), (y, v(2))
  1693.             d(i,j) = d(i+b(i,j),j) / pivot
  1694.             c(i+1,j) = c(i,j) + a(i**2,k) * b(k*j,j-24)
  1695.             READ (*, *) (v(n), n = 1, 10)
  1696.  
  1697.  Array elements are stored contiguously in memory so that array element n+1
  1698.  follows array element n, and so on. With multidimensional arrays, the
  1699.  elements are organized in a linear sequence because computer memory has only
  1700.  one dimension.
  1701.  
  1702.  In FORTRAN, array elements are arranged in "column-major order." This means
  1703.  the order of storage is determined by incrementing the leftmost subscript
  1704.  first, then the next subscript to the right, and so on. The elements of the
  1705.  variable array(3,4), are stored in the following sequence:
  1706.  
  1707.       array(1,1)    array(2,1)    array(3,1)
  1708.       array(1,2)    array(2,2)    array(3,2)
  1709.       array(1,3)    array(2,3)    array(3,3)
  1710.       array(1,4)    array(2,4)    array(3,4)
  1711.  
  1712.  In Microsoft FORTRAN, array storage space can be allocated dynamically. That
  1713.  is, the size of each dimension can be set at run-time, rather than during
  1714.  compilation. This is done with an "allocatable" array.
  1715.  
  1716.  «For an array to be allocatable, it must have been declared with the
  1717.  attribute  ALLOCATABLE, and the number of its dimensions specified. When the
  1718.  program runs, the ALLOCATE statement sets the size of each dimension. When
  1719.  the array is no longer needed, the DEALLOCATE statement returns the array's
  1720.  memory space to the common pool.»
  1721.  
  1722.  «The following example shows the correct usage of the ALLOCATABLE attribute
  1723.  and the ALLOCATE and DEALLOCATE statements:»
  1724.  
  1725.            «INTEGER  dataset[ALLOCATABLE](:,:,:)
  1726.             INTEGER  reactor, level, points, error
  1727.             DATA  reactor, level, points  / 10, 50, 100 /
  1728.             .
  1729.             .
  1730.             .
  1731.             ALLOCATE (dataset(reactor,level,points), STAT = error)
  1732.             .
  1733.             .
  1734.             .
  1735.             DEALLOCATE (dataset, STAT = error)»
  1736.  
  1737.  «A significant enhancement to Microsoft FORTRAN 5.0 is the ability to
  1738.  perform operations on arrays as if they were ordinary scalar quantities. See
  1739.  Section 1.7.1, "Arithmetic Expressions," for more information.»
  1740.  
  1741.  
  1742.  1.6  «Attributes»
  1743.  
  1744.  «Attributes specify additional information about a variable, variable type,
  1745.  subprogram, or subprogram formal argument. Attributes allow your FORTRAN
  1746.  program, for example, to use the calling conventions of Microsoft C or
  1747.  Pascal, pass arguments by value or by reference, use segmented or
  1748.  unsegmented addresses, specify that a formal argument can span more than one
  1749.  segment, or specify an external name for a subprogram or common block.
  1750.  Attributes can be used in subroutine and function definitions, in type
  1751.  declarations, and with the INTERFACE and ENTRY statements (see Section 4.2).
  1752.  Table 1.4 summarizes which attributes can be used with which objects. See
  1753.  Sections 1.6.1-1.6.12 for information on each attribute.»
  1754.  
  1755.  «Table 1.4   Objects to Which Attributes Can Refer»
  1756.  
  1757.                  «Subprogram
  1758.                   Variable and          Specification and
  1759.                   Array                 Common-               EXTERNAL
  1760.  Attribute        Declarations          Block Names           Statements»
  1761.  
  1762.  «ALIAS           Yes                   Yes                   Yes»
  1763.  «ALLOCATABLE     Yes (arrays only)     No                    No»
  1764.  «C               Yes                   Yes                   Yes»
  1765.  «EXTERN          Yes                   No                    No»
  1766.  «FAR             Yes                   Yes                   Yes»
  1767.  «HUGE            Yes                   No                    No»
  1768.  «LOADDS          No                    No                    Yes»
  1769.  «NEAR            Yes                   Yes                   Yes»
  1770.  «PASCAL          Yes                   Yes                   Yes»
  1771.  «REFERENCE       Yes                   No                    No»
  1772.  «VALUE           Yes                   No                    No»
  1773.  «VARYING         No                    No                    Yes»
  1774.  
  1775.  
  1776.  «Syntax»
  1777.  
  1778.       «object « [attrs] »»
  1779.  
  1780.  «Attributes follow the object they refer to. If more than one attribute is
  1781.  specified, they must be separated by commas.»
  1782.  
  1783.  
  1784.  «Examples»
  1785.  
  1786.  «In the following example, the integer x is passed by reference, using a
  1787.  short address (offset only):»
  1788.  
  1789.            «INTEGER intvar[REFERENCE, NEAR]»
  1790.  
  1791.  «In the following example, PasFunc is a Pascal function with arguments i,
  1792.  j, and k that are C integers. PasFunc also returns a C integer.»
  1793.  
  1794.            «INTERFACE TO INTEGER [C] FUNCTION PasFunc [PASCAL]
  1795.            +(i, j, k)
  1796.             INTEGER [C] i, j, k
  1797.             END»
  1798.  
  1799.  
  1800.  1.6.1  «ALLOCATABLE»
  1801.  
  1802.  «This attribute specifies that an array is "allocatable"; that is, the size
  1803.  of each dimension is established dynamically at run-time, not during
  1804.  compilation.»
  1805.  
  1806.  «The ALLOCATABLE attribute can appear either in a type declaration or in a
  1807.  DIMENSION statement. Each dimension of the allocatable array is indicated by
  1808.  a colon. If there is more than one dimension, the colons are separated by
  1809.  commas, as in this example which declares the allocatable array dynamic with
  1810.  three dimensions:»
  1811.  
  1812.            «REAL*8  dynamic [ALLOCATABLE] (:,:,:)»
  1813.  
  1814.  «The ALLOCATABLE attribute may not be applied to formal arguments, nor may
  1815.  it be used with the NEAR attribute. If you anticipate that an allocatable
  1816.  array's size will exceed 65,536 bytes, you must also declare the array with
  1817.  the HUGE attribute so the correct addressing will be generated.»
  1818.  
  1819.  «For information on the use of allocatable arrays, see the reference
  1820.  sections on the ALLOCATE and DEALLOCATE statements.»
  1821.  
  1822.  
  1823.  1.6.2  «ALIAS»
  1824.  
  1825.  «This attribute allows you to specify an external name for a subprogram or
  1826.  common block. The name may differ from the name used in the declaration.»
  1827.  
  1828.  
  1829.  «Syntax»
  1830.  
  1831.       «ALIAS: string»
  1832.  
  1833.  «Parameter                                 Description»
  1834.  
  1835.  «string»                                   «A character constant (can be a C
  1836.                                             string, as described in Section
  1837.                                             1.3.6.1).»
  1838.  
  1839.                                             «No transformations are performed
  1840.                                             on string. Lowercase letters, for
  1841.                                             example, are not converted to
  1842.                                             uppercase. This is useful when
  1843.                                             interfacing with case-sensitive
  1844.                                             languages, such as C.»
  1845.  
  1846.  «Within the source file, the subprogram can be referred to only by the name
  1847.  given in its declaration. Outside the source file, the subprogram can be
  1848.  referred to only by its ALIAS name.»
  1849.  
  1850.  «You can also use the ALIAS attribute on an INTERFACE statement to redefine
  1851.  the name of a subprogram in another source file you wish to call.»
  1852.  
  1853.  «The ALIAS attribute overrides the C attribute. If the C attribute is used
  1854.  on a subprogram along with the ALIAS attribute, the subprogram will be given
  1855.  the C calling convention, but not the C naming convention. It will instead
  1856.  receive the name given for the ALIAS, with no modifications.»
  1857.  
  1858.  «The ALIAS attribute cannot be applied to formal arguments.»
  1859.  
  1860.  
  1861.  «Example»
  1862.  
  1863.  «This SUBROUTINE statement gives the subroutine PasSub the name OtherName
  1864.  outside this source file.»
  1865.  
  1866.            «SUBROUTINE PasSub [ALIAS:'OtherName']»
  1867.  
  1868.  
  1869.  1.6.3  «C»
  1870.  
  1871.  «The C attribute can be applied to subprograms, common blocks, and types.
  1872.  When applied to a subprogram, the C attribute defines the subprogram as
  1873.  having the same calling conventions as a Microsoft C procedure. The
  1874.  following list describes the differences between FORTRAN calling conventions
  1875.  and C calling conventions:»
  1876.  
  1877.  «Difference                                Explanation»
  1878.  
  1879.  «Order in which parameters are             «Microsoft FORTRAN pushes
  1880.  pushed on the stack»                       parameters on the stack in the
  1881.                                             order in which they appear in the
  1882.                                             procedure declaration. Microsoft
  1883.                                             C, by default, pushes its
  1884.                                             parameters in the reverse order
  1885.                                             (to allow varying numbers of
  1886.                                             arguments).»
  1887.  
  1888.  «Location of code that restores            «In Microsoft FORTRAN this code
  1889.  the stack when a procedure                 is in the called procedure. This
  1890.  completes execution»                       generates less code than
  1891.                                             Microsoft C, in which this code
  1892.                                             follows the procedure call.»
  1893.  
  1894.  «Arguments to subprograms with the C attribute are passed by value unless
  1895.  the formal argument is specified with the REFERENCE attribute. (Note that
  1896.  the VARYING attribute can only be specified for subprograms that also have
  1897.  the C attribute.)»
  1898.  
  1899.  «The names of subprograms using the C attribute are modified automatically
  1900.  to make it easier to match naming conventions used in C. External names are
  1901.  changed to lowercase, and begin with an underscore (_). To use a name
  1902.  containing uppercase letters, use the ALIAS attribute (described in Section
  1903.  1.6.2).»
  1904.  
  1905.  «When an integer variable is given the C attribute, it becomes a C integer
  1906.  variable. The default size for C and FORTRAN integers depends on the
  1907.  microprocessor. For example, on the 8086, Microsoft FORTRAN assumes 32-bit
  1908.  integers by default, while C assumes 16-bit. On other machines, both
  1909.  languages may assume 32-bit integers. The C attribute allows you to control
  1910.  integer size for compatibility between your FORTRAN programs and C
  1911.  functions.»
  1912.  
  1913.  
  1914.  «Syntax»
  1915.  
  1916.  «The C attribute cannot be applied to formal arguments, except those of
  1917.  INTEGER type, as in the following syntax line:»
  1918.  
  1919.       «INTEGER[C]argument»
  1920.  
  1921.  «The ALIAS attribute overrides the C attribute.»
  1922.  
  1923.  
  1924.  1.6.4  «EXTERN»
  1925.  
  1926.  «The EXTERN attribute can be used in variable declarations. It indicates
  1927.  that the variable is allocated in another source file. EXTERN must be used
  1928.  when acces-sing variables declared in other languages, and must not be
  1929.  applied to formal arguments.»
  1930.  
  1931.  
  1932.  1.6.5  «FAR»
  1933.  
  1934.  «When used with formal arguments, the FAR attribute specifies that the
  1935.  argument is to be passed using a segmented address. When used with
  1936.  variables, it specifies that the variable is allocated in far data areas.»
  1937.  
  1938.  
  1939.  1.6.6  «HUGE»
  1940.  
  1941.  «The HUGE attribute is a convenient way to specify that a formal argument or
  1942.  an allocatable array may span more than one segment. (The $LARGE metacommand
  1943.  specifies the same thing.) The following two fragments behave identically:»
  1944.  
  1945.            «FUNCTION Func (a[HUGE])
  1946.             DIMENSION a(200)»
  1947.  
  1948.            «$LARGE: a
  1949.             FUNCTION Func (a)
  1950.             DIMENSION a(200)»
  1951.  
  1952.  «The compiler does not ensure that HUGE is specified for all arguments that
  1953.  span more than one segment. Versions 3.3 and earlier of Microsoft Pascal and
  1954.  Versions 3.0 and earlier of Microsoft C do not support parameters with HUGE
  1955.  attributes.»
  1956.  
  1957.  
  1958.  1.6.7  «LOADDS»
  1959.  
  1960.  «The LOADDS attribute is applied only to separately compiled subprograms and
  1961.  functions. It directs the compiler to create a separate data segment for the
  1962.  data within that procedure; the base address (DGROUP) of this new data
  1963.  segment is automatically loaded into DS when the procedure is called. The
  1964.  use of a separate data segment permits the procedure's data to be called
  1965.  with 16-bit NEAR references rather than 32-bit FAR references. This speeds
  1966.  up data access. The default data segment for the program is automatically
  1967.  reloaded when execution of the procedure terminates.»
  1968.  
  1969.  «The LOADDS attribute is applied primarily to user-written routines that are
  1970.  to be included in an OS/2 dynamic link library (DLL). It is not needed for
  1971.  procedures that run in DOS programs because the FL command-line option /ND
  1972.  (name data segment) automatically assures that the new data segment's base
  1973.  address is loaded. The following is an example of the LOADDS attribute:»
  1974.  
  1975.            «REAL*8 FUNCTION [LOADDS] GetNewData»
  1976.  
  1977.  
  1978.  1.6.8  «NEAR»
  1979.  
  1980.  «The NEAR attribute specifies that the actual argument is in the default
  1981.  data segment and that only its offset is passed to the subprogram. This
  1982.  attribute can also be used with common blocks. Common blocks having the NEAR
  1983.  attribute are mapped into the default data segment.»
  1984.  
  1985.  
  1986.  «Syntax»
  1987.  
  1988.       «COMMON «/«name» [NEAR] /»...»
  1989.  
  1990.  «The parameter name is the name of the common block. When no name is
  1991.  specified, all blank common blocks are put in the default data segment. NEAR
  1992.  must be specified for at least the first definition of the common block in
  1993.  the source file. You can, however, specify NEAR for any of the COMMON
  1994.  statements in a subprogram.»
  1995.  
  1996.  «To make a common block near, specifying NEAR for all definitions of the
  1997.  common block is good programming practice. If, however, you are modifying an
  1998.  existing program, it can be easier to add a subroutine at the beginning of
  1999.  your source file to make common blocks near in the remainder of the
  2000.  program.»
  2001.  
  2002.  «The advantage of putting common blocks in the default data segment is that
  2003.  you can specify addresses with offsets only. This generates smaller, more
  2004.  efficient code. If you do not specify NEAR, the compiler uses segmented
  2005.  addresses to refer to everything in common blocks.»
  2006.  
  2007.  «If a common block is specified as near in one compiland, but not in
  2008.  another, it will be mapped into the default data segment. The compiland
  2009.  which recognizes it as near will use short addresses, and the other
  2010.  compiland will use long addresses. While this practice is not recommended,
  2011.  it does provide compatibility with libraries compiled with Version 3.2 of
  2012.  the compiler.»
  2013.  
  2014.  «Actual arguments passed to a near formal argument must be in the default
  2015.  data segment. You cannot pass any of the following to a near argument:»
  2016.  
  2017.    ■  «Data in common blocks that are not specified using the NEAR attribute»
  2018.  
  2019.    ■  «Arrays specified using the HUGE attritute»
  2020.  
  2021.    ■  «Arrays defined while the $LARGE metacommand is in effect»
  2022.  
  2023.    ■  «Variables named in a $LARGE metacommand»
  2024.  
  2025.  
  2026.  1.6.9  «PASCAL»
  2027.  
  2028.  «The PASCAL attribute can be used with subprograms, common blocks, and
  2029.  formal argument type declarations (but not on formal arguments in the formal
  2030.  argument list). This attribute identifies an argument or subprogram as
  2031.  having the following characteristics of Microsoft Pascal:»
  2032.  
  2033.    ■  «The argument or the subprogram's arguments are passed by value (unless
  2034.       the REFERENCE attribute is specified)»
  2035.  
  2036.    ■  «Microsoft FORTRAN's calling conventions are still used»
  2037.  
  2038.  
  2039.  1.6.10  «REFERENCE»
  2040.  
  2041.  «The REFERENCE attribute can only be applied to formal arguments. It
  2042.  specifies that the argument's memory location is to be passed, rather than
  2043.  the argument's value. This is called "passing by reference."»
  2044.  
  2045.  
  2046.  1.6.11  «VALUE»
  2047.  
  2048.  «The VALUE attribute can only be applied to formal arguments. It specifies
  2049.  that the argument's value is to be passed, rather than the argument's memory
  2050.  location. This is called "passing by value."»
  2051.  
  2052.  «If either the C or PASCAL attribute is specified on the subprogram
  2053.  definition, all arguments are assumed to have the VALUE attribute, since C
  2054.  and Pascal normally pass by value. Character values, substrings,
  2055.  assumed-size arrays, and adjustable-size arrays cannot be passed by value.»
  2056.  
  2057.  «When a formal argument has the VALUE attribute, the actual argument passed
  2058.  to it can be of a different type. If type conversion is necessary, it is
  2059.  performed before the call, following the rules discussed in Section 1.7.1.2,
  2060.  "Type Conversion of Arithmetic Operands."»
  2061.  
  2062.  «When passing by value, values cannot be returned through the formal
  2063.  argument, since the formal argument now addresses a stack location
  2064.  containing the value of the actual argument, rather than addressing the
  2065.  actual argument itself.»
  2066.  
  2067.  «In C, arrays never pass by value. If you specify the C attribute and your
  2068.  subprogram has an array argument, the array will be passed as if it were a C
  2069.  data «structure (struct). To pass an array and have it treated as an array
  2070.  (instead of as a struct), you can do one of two things:»
  2071.  
  2072.    1. «Use the REFERENCE attribute on the formal argument.»
  2073.  
  2074.    2. «Pass the address returned by the LOC, LOCNEAR, or LOCFAR functions by
  2075.       value.»
  2076.  
  2077.  
  2078.  «Example»
  2079.  
  2080.  «Integer x is passed by value in the following example:»
  2081.  
  2082.            «SUBROUTINE Subr (x[VALUE])
  2083.             INTEGER x[VALUE]»
  2084.  
  2085.  
  2086.  1.6.12  «VARYING»
  2087.  
  2088.  «In FORTRAN, a formal argument must be defined for each actual argument.
  2089.  Other languages (such as C) allow actual arguments for which no formal
  2090.  arguments are defined. These actual arguments are assumed to be passed by
  2091.  value, with no automatic data-type conversion. When the C attribute is
  2092.  specified you can also apply the VARYING attribute, which permits the number
  2093.  of actual arguments to be different from the number of formal arguments.
  2094.  Actual arguments for which a formal argument is defined must still follow
  2095.  the type rules, however.»
  2096.  
  2097.  «When writing a FORTRAN procedure with the VARYING attribute, be sure the
  2098.  procedure only uses arguments you actually passed, or you will get undefined
  2099.  results.»
  2100.  
  2101.  «Note that the FORTRAN calling sequence cannot support varying numbers of
  2102.  arguments; the VARYING attribute has no effect unless you have also
  2103.  specified the C attribute on the subprogram.»
  2104.  
  2105.  
  2106.  1.7  Expressions
  2107.  
  2108.  An expression is a formula for computing a value. Expressions consist of
  2109.  operands and operators. The operands can be function references, variables,
  2110.  structure elements, constants, or other expressions. The operators specify
  2111.  the actions to be performed on the operands. In the following expression,
  2112.  for example, the slash (/) is an operator and chickens and coops are
  2113.  operands:
  2114.  
  2115.       chickens / coops
  2116.  
  2117.  There are four kinds of expressions in FORTRAN, as shown below:
  2118.  
  2119.  Expression                                 Result
  2120.  
  2121.  Arithmetic                                 Integer, real, or complex value
  2122.  
  2123.  Character                                  Character or string value
  2124.  
  2125.  Relational                                 Logical value
  2126.  
  2127.  Logical                                    Logical «or integer» value
  2128.  
  2129.  Expressions are components of statements. In the following example, the
  2130.  entire line is a statement, and the portion after the equal sign (=) is an
  2131.  expression:
  2132.  
  2133.             cost = 10.95 * chickens / coops
  2134.  
  2135.  Any variable, array, array element, «structure, structure element,» or
  2136.  function that is referred to in an expression must be defined at the time
  2137.  the reference is made, or the results are undefined. Integer variables must
  2138.  have a numerical value, rather than a statement-label value set by an ASSIGN
  2139.  statement.
  2140.  
  2141.  FORTRAN only guarantees that expressions generate correct values, not that
  2142.  all parts of expressions are evaluated. For example, if an expression
  2143.  multiplies (37.8 / scale**expo + factor) by zero, then (37.8 / scale**expo +
  2144.  factor) may not be evaluated. Similarly, if a false value and a logical
  2145.  expression are operands of the .AND. operator, the expression may not be
  2146.  evaluated. In the following example, the expression (SWITCH .EQ. on) may not
  2147.  be evaluated:
  2148.  
  2149.       ((3 .LE. 1) .AND. (SWITCH .EQ. on))
  2150.  
  2151.  «Microsoft FORTRAN permits expressions to use full arrays in the same way
  2152.  they would normally use single (scalar) arguments. For a complete
  2153.  explanation, see Section 1.7.5, "Array Expressions."»
  2154.  
  2155.  
  2156.  1.7.1  Arithmetic Expressions
  2157.  
  2158.  An arithmetic expression produces a value that is an integer, a real or
  2159.  complex number, or an array of those types. The basic operands used in
  2160.  arithmetic expressions are
  2161.  
  2162.    ■  Arithmetic constants
  2163.  
  2164.    ■  Symbolic names for arithmetic constants
  2165.  
  2166.    ■  Variable references
  2167.  
  2168.    ■  Array-element references
  2169.  
  2170.    ■  Function references
  2171.  
  2172.    ■  Array references
  2173.  
  2174.    ■  «Structure-element references»
  2175.  
  2176.  Other arithmetic expressions are built from the basic operands in the
  2177.  preceding list, cusing parentheses and the arithmetic operators shown in
  2178.  Table 1.5.
  2179.  
  2180.  Table 1.5  Arithmetic Operators
  2181.  
  2182.  Operator          Operation                  Precedence
  2183.  
  2184.   **               Exponentiation             1 (highest)
  2185.  
  2186.   /                Division                   2
  2187.  
  2188.   *                Multiplication             2
  2189.  
  2190.   -                Subtraction (binary)       3
  2191.                    or negation (unary)
  2192.  
  2193.   +                Addition (binary) or       3
  2194.                    identity (unary)
  2195.  
  2196.  All of the arithmetic operators are binary operators, appearing between two
  2197.  operands. The plus and minus operators can also be used as unary operators,
  2198.  which precede a single operand.
  2199.  
  2200.  When consecutive operations are of equal precedence, the leftmost operation
  2201.  is performed first. For example, the expression first/second*third  is
  2202.  equivalent to (first/second)*third. There is one exception to this rule:
  2203.  exponentiation. When there are two consecutive exponentiation operations,
  2204.  the rightmost operation is performed first. For example, the following
  2205.  expressions are equivalent:
  2206.  
  2207.       first**second**third
  2208.       first**(second**third)
  2209.  
  2210.  FORTRAN does not allow two arithmetic operators to appear consecutively. For
  2211.  example, FORTRAN prohibits first**-second, but permits first** (-second).
  2212.  
  2213.  The following list shows examples of the precedence of arithmetic operators:
  2214.  
  2215.  Expression                          Equivalent Expression
  2216.  
  2217.  3 * 7 + 5                           (3 * 7) + 5
  2218.  
  2219.  -one**two                           -(one**two)
  2220.  
  2221.  + x / y                             +(x / y)
  2222.  
  2223.  area / g - qu**2**fact              (area / g) - (qu**(2**fact))
  2224.  
  2225.  The following arithmetic operations are prohibited:
  2226.  
  2227.    ■  Division by zero
  2228.  
  2229.    ■  Raising a zero-value operand to a negative power
  2230.  
  2231.    ■  Raising a negative-value operand to a nonintegral real power
  2232.  
  2233.  
  2234.  1.7.1.1  Integer Division
  2235.  
  2236.  When one integer is divided by another, the truncated quotient of the two
  2237.  operands is returned. Thus, 7/3 evaluates to 2, (-7)/3 evaluates to -2, and
  2238.  both 9/10 and 9/(-10) evaluate to zero.
  2239.  
  2240.  For example, look at the following assignment statement:
  2241.  
  2242.             X = 1/4 + 1/4 + 1/4 + 1/4
  2243.  
  2244.  First, note that division has higher precedence than addition, so the
  2245.  expression is equivalent to (1/4) + (1/4) + (1/4) + (1/4). Then, take the
  2246.  quotient of 1/4 and truncate it. The result is 0. The assignment, therefore,
  2247.  sets X equal to zero.
  2248.  
  2249.  
  2250.  1.7.1.2  Type Conversion of Arithmetic Operands
  2251.  
  2252.  When all operands of an arithmetic expression are of the same data type, the
  2253.  value returned by the expression is also of that type. When the operands are
  2254.  of different data types, the type of the value returned by the expression is
  2255.  the type of the highest-ranked operand. The exception to the rule is
  2256.  operations involving both REAL*8 numbers and COMPLEX*8 numbers, which yield
  2257.  COMPLEX*16 results.
  2258.  
  2259.  The ranking of arithmetic operands is as follows:
  2260.  
  2261.    1. «DOUBLE COMPLEX or COMPLEX*16 (highest rank)»
  2262.  
  2263.    2. COMPLEX««*8»»
  2264.  
  2265.    3. DOUBLE PRECISION «or REAL*8»
  2266.  
  2267.    4. REAL««*4»
  2268.  
  2269.    5. INTEGER«*4»
  2270.  
  2271.    6. «INTEGER*2»
  2272.  
  2273.    7. «INTEGER*1 (lowest rank)»
  2274.  
  2275.  For example, when an operation is performed on an INTEGER«*2» operand and a
  2276.  REAL«*4» operand, the INTEGER«*2» operand is first converted to REAL«*4».
  2277.  The result of the operation is also a value of data type REAL«*4».
  2278.  Similarly, in an operation on a real number and a complex number, the real
  2279.  number is first converted to a complex number, and the result of the
  2280.  operation is also complex.
  2281.  
  2282.  The following examples show how expressions are interpreted. The variables
  2283.  i1 and i2 are integers, r1 and r2 are single-precision real numbers, and c1
  2284.  and c2 are COMPLEX«*8» numbers.
  2285.  
  2286.  Statement                                  Interpretation
  2287.  
  2288.  r2 = i1/i2*r1                              First, integer division (as
  2289.                                             described in Section 1.7.1.1) is
  2290.                                             performed on i1 and i2. The
  2291.                                             quotient is converted to a real
  2292.                                             number and real multiplication is
  2293.                                             performed on the resulting
  2294.                                             operand and r1.
  2295.  
  2296.  c1=c2+i1                                   The integer i1 is first converted
  2297.                                             to type COMPLEX«*8», then added
  2298.                                             to c2.
  2299.  
  2300.  «For expressions with integer operands, the type of the result is controlled
  2301.  by the types of the operands and the setting of the $STORAGE metacommand,
  2302.  the result is of whichever type is larger. For example, if you declare  j
  2303.  and k as INTEGER*2 variables, and use the $STORAGE:4 metacommand, the result
  2304.  of the expression j + k is of type INTEGER*4. (The same result occurs if the
  2305.  $STORAGE metacommand is omitted, since the default for $STORAGE:n is 4.)»
  2306.  
  2307.  «Note that the compiler usually removes higher-precision arithmetic when
  2308.  optimizing if it will not affect the result and if $DEBUG is not set. For
  2309.  example, the intermediate value obtained when adding j to k is probably
  2310.  16-bit, even if $STORAGE:4 were specified as in the following example:»
  2311.  
  2312.            «INTEGER*2  i, j, k
  2313.             i = j + k»
  2314.  
  2315.  «Using $STORAGE:4 does not affect INTEGER*2 expressions which have only the
  2316.  plus (+), minus (-), or multiplication (*) operators in them. The results
  2317.  are the same because conversion to an INTEGER*4 intermediate result does not
  2318.  prevent overflows in INTEGER*2 arithmetic. (Note that such overflows are not
  2319.  reported unless the $DEBUG metacommand is in effect.)»
  2320.  
  2321.  Table 1.6 shows how arithmetic operands are converted from one data type to
  2322.  another.
  2323.  
  2324.  Table 1.6  Arithmetic Type Conversion
  2325.  
  2326.                             Converting to the          Converting to the
  2327.  
  2328.                             Next-Highest-Ranked        Next-Lowest-Ranked
  2329.  
  2330.  Data Type                  Data Type                  Data Type
  2331.  
  2332.  «DOUBLE COMPLEX or         «(Highest rank.)»          «Convert imaginary and
  2333.  COMPLEX*16»                                           real parts,
  2334.                                                        individually, from
  2335.                                                        REAL*8 to REAL*4».
  2336.  
  2337.  COMPLEX«*8»                Convert imaginary and      Delete imaginary part.
  2338.                             real parts,
  2339.                             individually, from
  2340.                             REAL*4 to REAL*8.
  2341.  
  2342.  DOUBLE PRECISION           Convert to REAL*4, and     Round off
  2343.  «or REAL*8»                add a 0.0 imaginary        least-significant
  2344.                             part.                      part.
  2345.  
  2346.  REAL«*4»                   Store in the DOUBLE        Truncate.
  2347.                             PRECISION format.
  2348.  
  2349.  INTEGER«*4»                Add zero fractional        Use least-significant
  2350.                             part.                      part.
  2351.  
  2352.  «INTEGER*2»                «Use as                    «Use least-significant
  2353.                             least-significant          part.»
  2354.                             part, and set sign bit
  2355.                             in most-significant
  2356.                             part.»
  2357.  
  2358.  «INTEGER*1»                «Use as                    «(Lowest rank.)»
  2359.                             least-significant
  2360.                             part, and set sign bit
  2361.                             in most-significant
  2362.                             part.»
  2363.  
  2364.  
  2365.  1.7.2  Character Expressions
  2366.  
  2367.  A character expression produces a value that is of type character. There are
  2368.  six basic operands used in character expressions:
  2369.  
  2370.    1. Character constants
  2371.  
  2372.    2. Character variable references
  2373.  
  2374.    3. Character array-element references
  2375.  
  2376.    4. Character function references
  2377.  
  2378.    5. Character substrings
  2379.  
  2380.    6. «Character structure-element references»
  2381.  
  2382.  The concatenation operator (//) is the only character operator. It is used
  2383.  as follows:
  2384.  
  2385.       first//second
  2386.  
  2387.  This produces a character string consisting of the value of first
  2388.  concatenated on the right with the value of second and whose length is the
  2389.  sum of the lengths of first and second. For example, the following
  2390.  expression produces the string 'AB  CDE':
  2391.  
  2392.       'AB  ' // 'CDE'
  2393.  
  2394.  When two or more string variables are concatenated, the resulting string is
  2395.  as long as the declared lengths of the string variables. Leading and
  2396.  trailing blanks are not discarded. For example:
  2397.  
  2398.             CHARACTER*10  first
  2399.             CHARACTER*6  second
  2400.             first = 'heaven'
  2401.             second = ' sent'
  2402.             WRITE (*, *) first//second
  2403.  
  2404.  The result is the 16-character string 'heaven     sent '. Note that
  2405.  there is a total of five spaces between 'heaven' and 'sent'.
  2406.  
  2407.  «If you concatenate C strings, remember a null character (\0) is
  2408.  automatically appended to each C string. For example, the expression»
  2409.  
  2410.       «'hello 'C // 'world'C»
  2411.  
  2412.  «is equivalent to the following C string:»
  2413.  
  2414.       «'hello \0world'C»
  2415.  
  2416.  
  2417.  1.7.3  Relational Expressions
  2418.  
  2419.  Relational expressions compare the values of two arithmetic or character
  2420.  expressions. You cannot compare an arithmetic variable with a character
  2421.  variable.
  2422.  
  2423.  «In Microsoft FORTRAN, an arithmetic expression can be compared with a
  2424.  character expression. The arithmetic expression is treated as if it were a
  2425.  character expression (that is, a sequence of byte values). The two
  2426.  expressions must be identical on a byte-by-byte basis, or they are not
  2427.  equal.»
  2428.  
  2429.  «For example, if 'A' were assigned to a four-byte integer, the ASCII value
  2430.  of the letter A (hex 41) would be the variable's least-significant byte, and
  2431.  the other bytes would be zeros. If 'A' were assigned to a character variable
  2432.  four characters long, the ASCII value of the letter A (hex 41) would be the
  2433.  variable's most-significant byte because character variables are
  2434.  left-justified. Therefore, the two variables would not be equal, even though
  2435.  they held the same nominal value.»
  2436.  
  2437.  A relational expression produces a result of type LOGICAL (.TRUE. or
  2438.  .FALSE.). Relational expressions can use any of the operators shown in Table
  2439.  1.7 to compare values.
  2440.  
  2441.  Table 1.7  Relational Operators
  2442.  
  2443.  Operator      Operation
  2444.  .LT.          Less than
  2445.  .LE.          Less than or equal to
  2446.  .EQ.          Equal to
  2447.  .NE.          Not equal to
  2448.  .GT.          Greater than
  2449.  .GE.          Greater than or equal to
  2450.  
  2451.  All relational operators are binary operators and appear between their
  2452.  operands. A relational expression cannot contain another relational
  2453.  expression, so there is no relative precedence or associativity among the
  2454.  relational operands. The following program fragment is therefore invalid:
  2455.  
  2456.             REAL*4  a, b, c, d
  2457.             IF ((a .LT. b) .NE. c)  d = 12.0
  2458.  
  2459.  Assume that a is less than b. After the first part of the expression is
  2460.  evaluated, the expression is
  2461.  
  2462.       .TRUE. .NE. c
  2463.  
  2464.  However, c is an arithmetic expression, and you cannot compare an
  2465.  arithmetic expression to .TRUE.. To compare relational expressions and
  2466.  logical values, use the logical operators (as discussed in Section 1.7.4).
  2467.  
  2468.  Relational expressions with arithmetic operands may have one operand that is
  2469.  an integer and one that is a real number. In this case, the integer operand
  2470.  is converted to a real number before the relational expression is evaluated.
  2471.  You can also have a complex operand, in which case the other operand is
  2472.  first converted to complex. However, you can use only the .NE. and .EQ.
  2473.  operators with complex operands.
  2474.  
  2475.  Relational expressions with character operands compare the position of their
  2476.  operands in the ASCII collating sequence. One operand is less than another
  2477.  if it appears earlier in the collating sequence. For example, the expression
  2478.  ('apple'.LT.'banana') returns the value .TRUE., and the expression
  2479.  ('Keith' .GE. 'Susan') returns the value .FALSE.. If operands of unequal
  2480.  length are compared, the shorter operand is extended to the length of the
  2481.  longer operand by the addition of blanks on the right.
  2482.  
  2483.  
  2484.  1.7.4  Logical Expressions
  2485.  
  2486.  A logical expression produces a logical value. There are seven basic
  2487.  operands used in logical expressions:
  2488.  
  2489.    1. Logical constants
  2490.  
  2491.    2. Logical variable references
  2492.  
  2493.    3. Logical array-element references
  2494.  
  2495.    4. Logical function references
  2496.  
  2497.    5. Relational expressions
  2498.  
  2499.    6. Integer constants or variables
  2500.  
  2501.    7. «Logical structure-element references»
  2502.  
  2503.  Other logical expressions are constructed from the basic operands in the
  2504.  preceding list by using parentheses and the logical operators of Table 1.8.
  2505.  
  2506.  Table 1.8  Logical Operators
  2507.  
  2508.  Operator      Operation                   Precedence
  2509.  
  2510.  .NOT.         Negation                    1 (highest)
  2511.  .AND.         Conjunction                 2
  2512.  .OR.          Inclusive disjunction       3
  2513.  «.XOR.»       «Exclusive disjunction»     «4»
  2514.  .EQV.         Equivalence                 4
  2515.  .NEQV.        Nonequivalence              4
  2516.  
  2517.  The .AND., .OR., «.XOR.,» .EQV., and .NEQV. operators are binary operators
  2518.  and appear between their logical expression operands. The .NOT. operator is
  2519.  unary and precedes its operand. If switch is .TRUE., then (.NOT. switch) is
  2520.  .FALSE..
  2521.  
  2522.  Logical operators allow only arguments of the LOGICAL type. «Microsoft
  2523.  FORTRAN also permits integer arguments, which may be integer constants,
  2524.  integer variables, integer structure elements, or integer expressions.
  2525.  Operations are "bitwise." For example, the expression k .XOR. m performs an
  2526.  "exclusive-or" comparison on matching bits in the operands, and sets or
  2527.  clears the corresponding bit in the integer value it returns. If both
  2528.  operands are not of the same integer type, the lower-precision operand is
  2529.  converted to the higher-precision type.»
  2530.  
  2531.  «Note that the result of comparing two integer expressions with a logical
  2532.  operator is of INTEGER type, not LOGICAL.»
  2533.  
  2534.  When two consecutive operations are of equal precedence, the leftmost
  2535.  operation is performed first.
  2536.  
  2537.  Two .NOT. operators cannot be adjacent, but the .NOT. operator can appear
  2538.  next to any of the other logical operators. The following statement, for
  2539.  example, is allowed:
  2540.  
  2541.             logvar = a .AND. .NOT. b
  2542.  
  2543.  Logical operators have the same meaning as in standard mathematical
  2544.  semantics; the .OR. operator is nonexclusive. For example,
  2545.  
  2546.             .TRUE. .OR. .TRUE.
  2547.  
  2548.  evaluates to .TRUE.. Table 1.9 shows the values of logical expressions.
  2549.  
  2550.  Table 1.9  Values of Logical Expressions
  2551.  
  2552.                Then These Expressions Evaluate as Follows:
  2553.  
  2554.  If Operands                                                 «a .XOR. b» or
  2555.  a and b Are:      a .AND. b      a .OR. b     a .EQV. b      a .NEQV. b
  2556.  
  2557.  Both true         True           True         True           False
  2558.  
  2559.  One true,
  2560.  one false         False          True         False          True
  2561.  
  2562.  Both false        False          False        True           False
  2563.  
  2564.  
  2565.  Examples
  2566.  
  2567.  The following example demonstrates precedence in logical expressions:
  2568.  
  2569.             LOGICAL  stop, go, wait, a, b, c, d, e
  2570.  
  2571.       C     The following two statements are equivalent:
  2572.             stop =  a .AND. b  .AND. c
  2573.             stop = (a .AND. b) .AND. c
  2574.  
  2575.       C     The following two statements are equivalent:
  2576.             go =   .NOT. a  .OR. b  .AND. c
  2577.             go = ((.NOT. a) .OR. b) .AND. c
  2578.  
  2579.       C     The following two statements are equivalent:
  2580.             wait =   .NOT. a  .EQV.  b .OR. c   .NEQV.  d .AND. e
  2581.             wait = ((.NOT. a) .EQV. (b .OR. c)) .NEQV. (d .AND. e)
  2582.  
  2583.  «The following example demonstrates the use of integers in logical
  2584.  expressions to perform byte masking:»
  2585.  
  2586.            «INTEGER*2  lowerbyte, dataval, mask
  2587.             mask = #00FF       ! mask the most-significant byte
  2588.             dataval = #1234
  2589.             lowerbyte = (dataval .AND. mask)
  2590.             WRITE (*, '('' '', 2Z4)') dataval, lowerbyte»
  2591.  
  2592.  «The  output is as follows:»
  2593.  
  2594.       «1234  34»
  2595.  
  2596.  
  2597.  1.7.5  «Array Expressions»
  2598.  
  2599.  «Microsoft FORTRAN permits operations on full arrays that would normally
  2600.  only work with single arguments (scalars). For example, two arrays may be
  2601.  added element-by-element using only the addition operator (+). Every element
  2602.  in an array can be divided by a constant value. Two arrays of LOGICAL or
  2603.  INTEGER variables can be compared with logical operators such as .AND. or
  2604.  .GE., and so on. Arrays can also be passed to functions (both intrinsic and
  2605.  external), with the function operating on each element and returning an
  2606.  array of the results.»
  2607.  
  2608.  «When two or more array operands appear in an assignment statement or
  2609.  expression, they all must "conform." That is, they must have the same number
  2610.  of dimensions, and corresponding dimensions must be the same size and have
  2611.  the same upper and lower boundaries. For example, the arrays first(6,3) and
  2612.  second(3,2,3) do not conform. Although they take up the same amount of
  2613.  memory, their dimensions do not match. The arrays third(3,4) and
  2614.  fourth(-1:1,5:8) do not conform either. They have the same number of
  2615.  dimensions, and each is of the same size, but the dimension boundaries do
  2616.  not match. Any attempt to combine non-conforming arrays in an arithmetic
  2617.  expression, or assign one to another, results in a compile-time error. Note
  2618.  that a scalar quantity conforms to any array.»
  2619.  
  2620.  «If arrays are to conform, the sizes of their dimensions must be fully
  2621.  specified at compile time. Therefore, adjustable and allocatable arrays do
  2622.  not conform; they cannot be combined in expressions either with themselves
  2623.  or fixed arrays, even if their dimensions match.»
  2624.  
  2625.  «All operations that are permitted for scalar arguments are permitted for
  2626.  array arguments. An array expression may be the right-hand term of an
  2627.  assignment statement whose left-hand term is an array. Array expressions may
  2628.  only appear in assignment statements and as function arguments. For example,
  2629.  if array1, array2, array3, and logarray are conforming arrays, then all the
  2630.  following statements are legal:»
  2631.  
  2632.       «array1 = 42                    !Assign constant to each element.
  2633.       array3 = array 1 / array2       !Divide corresponding element.
  2634.       array2 = - array1               !Negate each array1 element.
  2635.       array1 = array2 - 3             !Subtract constant from each element.
  2636.       array1 = array2 - array3(7)     !Subtract value of array3(7) from each e
  2637.       array2 = array3 ** array1       !Raise each element to power of
  2638.                                       !corresponding element.
  2639.       array3 = MyFunc (array2)        !Apply MyFunc to each element.
  2640.       logarray = array1 .LT. array2   !Logically compare corresponding element
  2641.       logarray = .NOT. array2         !Invert bits of each array2 element.
  2642.       chararray2 = chararray2(5:8)//chararray2(1:4) !Rearrange character
  2643.                                                     !string.»
  2644.  
  2645.  
  2646.  «All intrinsic functions that take scalar arguments may also take array
  2647.  arguments. If you wish to pass array arguments to external functions that
  2648.  take scalar arguments, you must declare the external function in an
  2649.  INTERFACE TO statement. None of the function's formal arguments may be
  2650.  arrays.»
  2651.  
  2652.  ───────────────────────────────────────────────────────────────────────────
  2653.  «NOTE»
  2654.     «In processing array expressions, the compiler may generate a less
  2655.     efficient sequence of machine instructions than it would if the arrays
  2656.     were processed in a conventional DO loop. If execution speed is critical,
  2657.     it may be more efficient to handle arrays element-by-element.»
  2658.  ───────────────────────────────────────────────────────────────────────────
  2659.  
  2660.  
  2661.  1.7.6  Precedence of Operators
  2662.  
  2663.  When arithmetic, character, relational, and logical operators appear in the
  2664.  same expression, precedence is as follows:
  2665.  
  2666.    1. Arithmetic operators have the highest precedence.
  2667.  
  2668.    2. Character operators are evaluated next.
  2669.  
  2670.    3. Relational operators are evaluated next.
  2671.  
  2672.    4. Logical operators have the lowest precedence.
  2673.  
  2674.  
  2675.  Chapter 2  Program Structure
  2676.  ───────────────────────────────────────────────────────────────────────────
  2677.  
  2678.  This chapter explains the structure of FORTRAN programs: what can be
  2679.  included and in what sequence. Information on line types and statement
  2680.  labels is provided, and restrictions on the order of statements and
  2681.  metacommands are discussed. This chapter also includes information on
  2682.  arguments and on the program units processed by the FORTRAN compiler: main
  2683.  programs, subroutines, functions, and block-data subprograms.
  2684.  
  2685.  
  2686.  2.1  Lines
  2687.  
  2688.  The position of characters within FORTRAN lines is significant. The
  2689.  following list shows how column position determines character
  2690.  interpretation:
  2691.  
  2692.  Column                                  Character Interpretation
  2693.  
  2694.  1-5                                     Statement label. «A dollar sign
  2695.                                          ($) in column 1 indicates a
  2696.                                          metacommand.» An asterisk or an
  2697.                                          uppercase «or lowercase» C in
  2698.                                          column 1 indicates a comment
  2699.                                          line.
  2700.  
  2701.  6                                       Continuation character.
  2702.  
  2703.  7-72                                    FORTRAN statement.
  2704.  
  2705.  73 and above                            Ignored.
  2706.  
  2707.  Lines shorter than 72 characters are padded with blanks.
  2708.  
  2709.  There are five kinds of lines in Microsoft FORTRAN:
  2710.  
  2711.  Type                                    Description
  2712.  
  2713.  «Metacommand lines»                     «A metacommand line has a dollar
  2714.                                          sign ($) in column 1.»
  2715.  
  2716.                                          «Metacommands control operation
  2717.                                          of the Microsoft FORTRAN
  2718.                                          Compiler. (See Chapter 6 for more
  2719.                                          information.) The following lines
  2720.                                          are metacommands:»
  2721.  
  2722.                                         «$DEBUG:'pdq'
  2723.                                          $DECLARE
  2724.                                          $LINESIZE:132»
  2725.  
  2726.  Initial lines                           The first (or only) line of a
  2727.                                          FORTRAN statement is called the
  2728.                                          "initial line." An initial line
  2729.                                          has either a blank or a zero in
  2730.                                          column 6, and has either blanks
  2731.                                          or a statement label in columns 1
  2732.                                          through 5. (The only exception to
  2733.                                          this rule is the statement which
  2734.                                          follows a logical IF statement.)
  2735.                                          The following are initial lines:
  2736.  
  2737.                                             GOTO 100
  2738.                                          0002  CHARACTER*10 name
  2739.                                          100  0CONTINUE
  2740.                                            1000STOP ' '
  2741.  
  2742.  Continuation lines                      A continuation line has blanks in
  2743.                                          columns 1 through 5 and a
  2744.                                          character (other than a blank or
  2745.                                          a zero) in column 6. A
  2746.                                          continuation line increases the
  2747.                                          room available to write a
  2748.                                          statement. «A statement may be
  2749.                                          extended to include as many
  2750.                                          continuation lines as memory
  2751.                                          allows.» The compiler issues a
  2752.                                          warning if a statement has more
  2753.                                          than 19 continuation lines. The
  2754.                                          second line below is a
  2755.                                          continuation line «(this
  2756.                                          limitation does not apply to
  2757.                                          Microsoft FORTRAN unless the
  2758.                                          $STRICT metacommand is in
  2759.                                          effect)»:
  2760.  
  2761.                                          C   Sample Continuation line
  2762.                                              INTEGER*4  count, popu, local,
  2763.                                             +       ovrflo, incrs, provnc
  2764.  
  2765.  Comment lines                           A comment line generally has an
  2766.                                          uppercase «or lowercase» C or an
  2767.                                          asterisk (*) in column 1 or is
  2768.                                          entirely blank. «An exclamation
  2769.                                          point appearing as the first
  2770.                                          nonblank character also indicates
  2771.                                          a comment line in Microsoft
  2772.                                          FORTRAN. (A line with an
  2773.                                          exclamation point in column 6 is
  2774.                                          interpreted as a continuation
  2775.                                          line.)»
  2776.  
  2777.                                          Comment lines do not affect the
  2778.                                          execution of the FORTRAN program
  2779.                                          in any way. Comment lines can
  2780.                                          appear within statements that
  2781.                                          have continuation lines. «Debug
  2782.                                          lines (described below) are
  2783.                                          sometimes treated as comment
  2784.                                          lines. For more information, see
  2785.                                          the $DEBUG and $NODEBUG entry in
  2786.                                          Section 6.2, "Metacommand
  2787.                                          Directory." The following are
  2788.                                          examples of comment lines:»
  2789.  
  2790.                                          C     This is a comment line,
  2791.                                          *            and so is this,
  2792.                                               «!    as is this line.»
  2793.  
  2794.                                          «Comments can also be added to
  2795.                                          program lines, following the
  2796.                                          statement. In this case, the
  2797.                                          comment must begin with an
  2798.                                          exclamation point (!).»
  2799.  
  2800.                                      «hyp = SQR (a**2 + b**2) ! hypotenuse»
  2801.  
  2802.  «Debug lines»                           «In Microsoft FORTRAN, any line
  2803.                                          with an uppercase or lowercase
  2804.                                          letter in the first column is
  2805.                                          considered a comment line. When a
  2806.                                          letter (except C or c) is
  2807.                                          specified in a $DEBUG
  2808.                                          metacommand, that letter is
  2809.                                          removed from all succeeding lines
  2810.                                          that include it in column 1, and
  2811.                                          the remainder of the line is
  2812.                                          compiled. The case of the letter
  2813.                                          (either in the $DEBUG metacommand
  2814.                                          or the program) is not
  2815.                                          significant. See the $DEBUG and
  2816.                                          $NODEBUG entry in Section 6.2 for
  2817.                                          more information on debug lines.
  2818.                                          The following lines are examples
  2819.                                          of debug lines:»
  2820.  
  2821.                                         «B    RETURN 1
  2822.                                          z    WRITE(*, *) count»
  2823.  
  2824.  
  2825.  2.2  Statement Labels
  2826.  
  2827.  Any statement can start with a label; however, only the labels of executable
  2828.  or FORMAT statements can be referenced. A statement label is a sequence of
  2829.  one to five digits, at least one of which must be nonzero. A label may be
  2830.  placed anywhere in columns 1 through 5 of an initial line, and blanks are
  2831.  ignored. (For example, the labels 23 4 and 234 are identical.) A label may
  2832.  not be repeated.
  2833.  
  2834.  
  2835.  2.3  «Free-Form Source Code»
  2836.  
  2837.  «The $FREEFORM metacommand lets you enter source code without most of the
  2838.  restrictions imposed by the conventional FORTRAN format. Most of the rules
  2839.  in Section 2.1, "Lines," do not apply to the free-form format. See the
  2840.  $FREEFORM and $NOFREEFORM entry in Section 6.2, "Metacommand Directory," for
  2841.  more information on free-form format.»
  2842.  
  2843.  «The following rules define the free-form format:»
  2844.  
  2845.    ■  «A double quotation mark ( " ) in column 1, or an exclamation point as
  2846.       the first nonblank character, indicates a comment line.»
  2847.  
  2848.    ■  «Initial lines may start in any column.»
  2849.  
  2850.    ■  «An initial line may begin with a statement label of from one to five
  2851.       digits (blanks are ignored). Statement labels need not be followed by
  2852.       blanks to separate them from the statement; the first nonblank,
  2853.       nonnumeric character is the beginning of the statement.»  p
  2854.  
  2855.    ■  «If the last nonblank character of a line is a minus sign, it is
  2856.       discarded and the next line is considered a continuation line. The
  2857.       continuation line may start in any column.»
  2858.  
  2859.    ■  «Alphabetic characters and asterisks are not allowed as comment markers
  2860.       in column 1.»
  2861.  
  2862.  
  2863.  2.4  Order of Statements «and Metacommands»
  2864.  
  2865.  Statements describe, specify, and classify the elements of your program, as
  2866.  well as the actions your program will take. Chapter 4, "Statements," defines
  2867.  each Microsoft FORTRAN statement.
  2868.  
  2869.  The ANSI standard for FORTRAN prescribes the ordering of the statements and
  2870.  lines in a FORTRAN program unit. «Some of Microsoft FORTRAN's extensions
  2871.  have additional requirements.» Figure 2.1 shows which statements «and
  2872.  metacommands» must precede and which must follow any specific statement «or
  2873.  metacommand».
  2874.  
  2875.  Suppose your program contains program elements a and b. In
  2876.  Figure 2.1, if the box containing element a is above the box containing
  2877.  element b, then a must appear before b in your program. An IMPLICIT
  2878.  statement, for example, must appear before a COMMON, DATA, or END statement,
  2879.  and so on.
  2880.  
  2881.  If, in Figure 2.1, a is in a box that is to the left or right of b, then a
  2882.  and b can appear in any order relative to each other. FORMAT, for example,
  2883.  «is to the left of the box containing most of the metacommands, and» is to
  2884.  the right of the boxes with DATA, PARAMETER, IMPLICIT, COMMON, and
  2885.  statement-function statements, and so on. Any of those elements can appear
  2886.  before or after a FORMAT statement.
  2887.  
  2888.  The following rules summarize the required order of statements «and
  2889.  metacommands» shown in Figure 2.1:
  2890.  
  2891.    ■  Every program unit must have an END statement as its last line.
  2892.  
  2893.    ■  Comment lines can appear anywhere, except after the last END statement
  2894.       in a source file.
  2895.  
  2896.    ■  The BLOCK DATA, FUNCTION, «INTERFACE TO,» PROGRAM, and SUBROUTINE
  2897.       statements must precede all other statements. They do not have to
  2898.       precede metacommands.
  2899.  
  2900.    ■  All specification statements must precede all DATA statements,
  2901.       statement-function statements, and executable statements. See Section
  2902.       4.1, "Categories of Statements," for listings of specification
  2903.       statements and executable statements.
  2904.  
  2905.    ■  IMPLICIT statements must precede other specification statements, with
  2906.       the exception of the PARAMETER statement.
  2907.  
  2908.    ■  Statement-function statements must precede executable statements.
  2909.  
  2910.    ■  When a specification statement defines the type of a constant to be
  2911.       used in the PARAMETER statement, the PARAMETER statement must follow
  2912.       that specification statement. The PARAMETER statement must precede all
  2913.       other specification statements that use the symbolic constants it
  2914.       defines.
  2915.  
  2916.    ■  «INTERFACE TO statements must precede references to the subprograms
  2917.       they define.»
  2918.  
  2919.    ■  «The $DO66, $«NO»FLOATCALLS, $«NO»FREEFORM, and $STORAGE
  2920.       metacommands, if present, must appear before anything else. $LARGE and
  2921.       $NOTLARGE, when used without arguments, cannot appear within the
  2922.       executable-statement section. $LARGE and $NOTLARGE, when used with
  2923.       arguments, must appear in the declarations section. Other metacommands
  2924.       can appear anywhere.»
  2925.  
  2926.    ■  Block-data subprograms may not contain statement function statements,
  2927.       FORMAT statements, or executable statements.
  2928.  
  2929.  
  2930.  Figure 2.1  Order of Statements «and Metacommands»
  2931.  
  2932.  ┌────────────────────────────────────────────────────────┬────────────────┐
  2933.  │  «$DO66, $«NO»FLOATCALLS, $«NO»FREEFORM, $STORAGE»                      │
  2934.  ├────────────────────────────────────────────────────────┤                │
  2935.  │ BLOCK DATA, FUNCTION, «INTERFACE,» PROGRAM, SUBROUTINE                  │
  2936.  ├────────────────┬───────────────────┬──────────┬────────┤                │
  2937.  │                      IMPLICIT                                           │
  2938.  │                ├───────────────────┤          │        │                │
  2939.  │                 COMMON,                                 «$«NO»DEBUG,»   │
  2940.  │                │DIMENSION,         │          │        │«$«NO»DECLARE,» │
  2941.  │                 EQUIVALENCE,                            «$INCLUDE,»     │
  2942.  │«$[NOT]LARGE,   │EXTERNAL,          │PARAMETER │        │«$LINESIZE,»    │
  2943.  │when used        INTRINSIC,                              «$«NO»LIST,»    │
  2944.  │without         │SAVE; type         │          │        │«$MESSAGE,»     │
  2945.  │arguments»       statements; «also                       «$PAGE,»        │
  2946.  │                │$[NOT]LARGE,       │          │        │«$PAGESIZE,»    │
  2947.  │                 when used with                 ENTRY,   «$«NOT»STRICT,» │
  2948.  │                │arguments          │          │FORMAT  │«$SUBTITLE,»    │
  2949.  │                 ─────────────────── ──────────          «$TITLE,»       │
  2950.  │                │Statement-function │          │        │«$«NO»TRUNCATE» │
  2951.  │                 statments                                               │
  2952.  ├────────────────┴───────────────────┤  DATA    │        │                │
  2953.  │     Executable statements                              │                │
  2954.  ├────────────────────────────────────┴──────────┴────────┴────────────────┤
  2955.  │                                   END                                   │
  2956.  └─────────────────────────────────────────────────────────────────────────┘
  2957.  
  2958.  
  2959.  2.5  Arguments
  2960.  
  2961.  "Arguments" are the values passed to and from functions and subroutines. A
  2962.  "formal argument" is the name by which an argument is known within a
  2963.  function or subroutine. The "actual argument" is the specific variable,
  2964.  expression, array, function name, or other item passed to a subroutine or
  2965.  function when it is called.
  2966.  
  2967.  The number of actual arguments must be the same as the number of formal
  2968.  arguments «(unless the VARYING attribute is specified)», and the
  2969.  corresponding types must agree. If a procedure is called more than once in a
  2970.  program unit, the compiler checks that the number and types of actual
  2971.  arguments are the same in each call (consistency). If a procedure was
  2972.  defined prior to its first use, «or in an INTERFACE TO statement,» the
  2973.  compiler also checks that the number and types of the actual arguments match
  2974.  the number and types of the formal arguments (validity).
  2975.  
  2976.  Arguments normally pass values into and out of subroutines or functions by
  2977.  reference (they pass the memory address of the argument). «In Microsoft
  2978.  «FORTRAN, this is the default. You can use the VALUE attribute (described in
  2979.  Section 1.6.11) to pass arguments by value.»
  2980.  
  2981.  Upon entry to a subroutine or function, the actual arguments are associated
  2982.  with the formal arguments. This association remains in effect until the
  2983.  subroutine or function terminates execution. If the actual argument has been
  2984.  passed by reference «(the default)», assigning a value to a formal argument
  2985.  during execution of a subroutine or function alters the value of the
  2986.  corresponding actual argument.
  2987.  
  2988.  If an actual argument is a constant, a function reference, or an expression
  2989.  other than a single variable, assigning a value to the corresponding formal
  2990.  argument is not permitted and has unpredictable results. In the following
  2991.  program, for example, the actual argument header is a constant and
  2992.  corresponds to the formal argument title. In the subroutine report, a value
  2993.  is assigned to title.
  2994.  
  2995.       C     This program is incorrect and has unpredictable
  2996.       C     results:
  2997.             CHARACTER*20  header
  2998.             REAL*4  grav
  2999.             PARAMETER  (header = 'Specific Gravity')
  3000.             DATA  grav / 2.8327 /
  3001.             WRITE (*, *) header, grav
  3002.       C     Header is an actual argument:
  3003.             CALL Report (header, grav)
  3004.             WRITE (*, *) header, grav
  3005.             END
  3006.       C     The formal argument corresponding to header is title:
  3007.             SUBROUTINE  Report (title, data)
  3008.             CHARACTER*20  title
  3009.             REAL*4  data
  3010.       C     The following statement is illegal; it assigns a value
  3011.       C     to a formal argument that corresponds to a constant:
  3012.             title = 'Density (kg/cubic m)'
  3013.             WRITE (*, *) title, data
  3014.             END
  3015.  
  3016.  The output of the above program is unpredictable. To change the value of
  3017.  title in the subroutine, header should have been a variable.
  3018.  
  3019.  If an actual argument is an expression, it is evaluated before the
  3020.  association of formal and actual arguments. If an actual argument is an
  3021.  array element, its subscript expressions are evaluated before the
  3022.  association. The subscript expressions remain constant throughout the
  3023.  execution of the subroutine or function, even if they contain variables that
  3024.  receive new values during the execution of the subroutine or function. The
  3025.  following list shows how actual and formal arguments can be associated:
  3026.  
  3027.  Actual Argument                            Formal Argument
  3028.  
  3029.  A variable, an array element,              Variable name.
  3030.  «a structure element,» or an
  3031.  expression.
  3032.  
  3033.  An array or an array element. The          Array name.
  3034.  number and size of dimensions in
  3035.  a formal argument may be
  3036.  different from those of the
  3037.  actual argument, but any
  3038.  reference to the formal array
  3039.  must be within the limits of the
  3040.  memory sequence in the actual
  3041.  array. A reference to an
  3042.  out-of-bounds element is not
  3043.  detected as an error, and has
  3044.  unpredictable results.
  3045.  
  3046.  «An array. Each element of the             «A variable. Its procedure must
  3047.  array is passed to the procedure,          be declared in an INTERFACE TO
  3048.  one element at a time, and the             statement, or it must be an
  3049.  procedure is executed once for             intrinsic function, if arrays are
  3050.  each element.»                             to be passed to a scalar formal
  3051.                                             argument.»
  3052.  
  3053.  An alternate-return specifier              An asterisk (*) .
  3054.  (*label) in the CALL statement.
  3055.  The same label can be used in
  3056.  more than one alternate-return
  3057.  specifier.
  3058.  
  3059.  The name of an external                    Any unique name which is used in
  3060.  subroutine or function, or                 a subroutine call or function
  3061.  intrinsic function. The actual             reference within the procedure.
  3062.  argument must be an external
  3063.  subroutine or function, declared
  3064.  with the EXTERNAL statement, or
  3065.  an intrinsic function permitted
  3066.  to be associated with a formal
  3067.  subroutine argument or function
  3068.  argument. The intrinsic function
  3069.  must first be declared with an
  3070.  INTRINSIC statement in the
  3071.  program unit where it is used as
  3072.  an actual argument.
  3073.  
  3074.  The following intrinsic functions may not be associated with formal
  3075.  subroutine arguments or function arguments:
  3076.  
  3077.      «ALLOCATED»
  3078.       AMAX0
  3079.       AMAX1
  3080.       AMIN0
  3081.       AMIN1
  3082.       CHAR
  3083.       CMPLX
  3084.       DBLE
  3085.      «DCMPLX»
  3086.       DFLOAT
  3087.       DMAX1
  3088.       DMIN1
  3089.      «DREAL
  3090.       EOF»
  3091.      «EPSILON»
  3092.       FLOAT
  3093.      «HFIX»
  3094.      «HUGE»
  3095.       ICHAR
  3096.       IDINT
  3097.       IFIX
  3098.      «IMAG
  3099.       INT1
  3100.       INT2
  3101.       INT4
  3102.       INTC»
  3103.       INT
  3104.      «JFIX»
  3105.      «LEN_TRIM»
  3106.       LGE
  3107.       LGT
  3108.       LLE
  3109.       LLT
  3110.      «LOC
  3111.       LOCFAR
  3112.       LOCNEAR»
  3113.       LOG
  3114.       LOG10
  3115.       MAX
  3116.       MAX0
  3117.       MAX1
  3118.      «MAXEXPONENT»
  3119.       MIN
  3120.       MIN0
  3121.       MIN1
  3122.      «MINEXPONENT»
  3123.      «NEAREST»
  3124.      «PRECISION»
  3125.       REAL
  3126.      «SCAN»
  3127.       SNGL
  3128.      «TINY»
  3129.      «VERIFY»
  3130.  
  3131.  «When passing integer arguments by reference, an INTEGER*2 variable cannot
  3132.  be passed to an INTEGER*4 formal argument, and an INTEGER*4 variable cannot
  3133.  be passed to an INTEGER*2 formal argument. You must convert the data type
  3134.  using the intrinsic functions INT4 or INT2 (described in Chapter 5,
  3135.  "Intrinsic Functions and Additional Procedures"). Note that the result of
  3136.  the conversion is stored at a temporary memory location, so the subroutine
  3137.  can no longer assign a new value to the actual argument. Also note that when
  3138.  $STORAGE:4 (the default) is in effect, even expressions with only INTEGER*2
  3139.  arguments have a result with type INTEGER*4. The following program, for
  3140.  example, results in an error:»
  3141.  
  3142.       «C     This is incorrect and produces an error:
  3143.       $STORAGE:4
  3144.             INTEGER*2 j, k
  3145.             CALL Subr(j + k)
  3146.  
  3147.             SUBROUTINE Subr (n)
  3148.             INTEGER*2 n
  3149.             .
  3150.             .
  3151.             .
  3152.             END»
  3153.  
  3154.  «An error occurs because the result of the expression j+k is of the type
  3155.  INTEGER*4. You must write the subroutine call as»
  3156.  
  3157.            «CALL Subr (INT2(j + k))»
  3158.  
  3159.  «Integer arguments passed by value are not subject to the same restrictions.
  3160.  The conversion rules for value arguments are the same as the conversion
  3161.  rules described in Table 1.6, "Arithmetic Type Conversion." For example, you
  3162.  can pass a real value to an integer argument because the conversion is
  3163.  performed automatically.»
  3164.  
  3165.  
  3166.  2.6  Program Units
  3167.  
  3168.  The FORTRAN compiler processes program units. A program unit can be a main
  3169.  program, a subroutine, a function, or a block-data subprogram. You can
  3170.  compile any of these units separately and link them together later. It is
  3171.  not necessary to compile or recompile them as a whole. The following list
  3172.  summarizes the four types of program units (discussed in Sections 2.7
  3173.  through 2.10):
  3174.  
  3175.  Program Unit                               Description
  3176.  
  3177.  Main program                               Any program unit that does not
  3178.                                             have a SUBROUTINE, FUNCTION, or
  3179.                                             BLOCK DATA statement as its first
  3180.                                             statement. A main program can
  3181.                                             have a PROGRAM statement as its
  3182.                                             first statement, but this is not
  3183.                                             required.
  3184.  
  3185.  Subroutine                                 A program unit that is called
  3186.                                             from other program units with a
  3187.                                             CALL statement.
  3188.  
  3189.  Block-data subprogram                      A program unit that provides
  3190.                                             initial values for variables in
  3191.                                             named common blocks.
  3192.  
  3193.  Function                                   A program unit that can be
  3194.                                             referred to in an expression.
  3195.  
  3196.  The PROGRAM, SUBROUTINE, BLOCK DATA, FUNCTION, and Statement Function
  3197.  statements are described in detail in Section 4.2, "Statement Directory."
  3198.  Related information is provided in the entries for the CALL and RETURN
  3199.  statements.
  3200.  
  3201.  Subprograms make it easier to develop large, well-structured programs,
  3202.  especially in the following situations:
  3203.  
  3204.  Situation                                  Result
  3205.  
  3206.  You have a large program                   You can more easily develop,
  3207.                                             test, maintain, and compile a
  3208.                                             large program when it is divided
  3209.                                             into parts.
  3210.  
  3211.  You intend to include certain              You can create object files that
  3212.  subprograms in more than one               contain these subprograms and
  3213.  program                                    link them to the programs in
  3214.                                             which they are used.
  3215.  
  3216.  You anticipate altering a                  You can place the procedure in
  3217.  procedure's implementation                 its own file and compile it
  3218.                                             separately. You can change the
  3219.                                             procedure «or even rewrite it in
  3220.                                             assembly language, Microsoft
  3221.                                             Pascal, or Microsoft C». The rest
  3222.                                             of your program does not need to
  3223.                                             change.
  3224.  
  3225.  
  3226.  2.7  Main Programs
  3227.  
  3228.  A main program is any program unit that does not have a FUNCTION,
  3229.  SUBROUTINE, or BLOCK DATA statement as its first statement. The first
  3230.  statement of a main program may be a PROGRAM statement. Main programs are
  3231.  always assigned the global name _main. The name _main should not be used for
  3232.  anything else in a program. The name "main" is actually permitted as a
  3233.  common-block name, as a local variable in a subprogram outside the main
  3234.  program, or as a subprogram name in a module that does not contain a PROGRAM
  3235.  statement and is not referenced by a module that contains the main program.
  3236.  However, the use of "main" is likely to cause confusion and is not
  3237.  recommended. If the main program has a PROGRAM statement, the name specified
  3238.  in the PROGRAM statement is assigned in addition to the name _main.
  3239.  
  3240.  Program execution always begins with the first executable statement in the
  3241.  main program, so there must be exactly one main program unit in every
  3242.  executable program.
  3243.  
  3244.  For further information about programs, see the PROGRAM entry in Section
  3245.  4.2, "Statement Directory."
  3246.  
  3247.  
  3248.  2.8  Subroutines
  3249.  
  3250.  A subroutine is a program unit that can be called from other program units
  3251.  with a CALL statement. When invoked, a subroutine performs the set of
  3252.  actions defined by its executable statements. The subroutine then returns
  3253.  control to the statement immediately following the one that called it, or to
  3254.  a statement specified as an alternate return. See the CALL entry in Section
  3255.  4.2, "Statement Directory," for more information.
  3256.  
  3257.  A subroutine does not directly return a value. However, values can be passed
  3258.  back to the calling program unit through arguments or common variables.
  3259.  
  3260.  See the SUBROUTINE entry in Section 4.2, "Statement Directory," for further
  3261.  information.
  3262.  
  3263.  
  3264.  2.9  Block-Data Subprograms
  3265.  
  3266.  A block-data subprogram is a program unit that defines initial values for
  3267.  variables in named common blocks.
  3268.  
  3269.  Variables are normally initialized with DATA statements. Variables in
  3270.  named-common blocks can be initialized only in block-data subprograms.
  3271.  Variables in the blank-common block cannot be initialized in block-data
  3272.  subprograms. See the BLOCK DATA entry in Section 4.2, "Statement Directory,"
  3273.  for more information.
  3274.  
  3275.  
  3276.  2.10  Functions
  3277.  
  3278.  A function is referred to in an expression and returns a value that is used
  3279.  in the computation of that expression. Functions can also return values
  3280.  through arguments and common variables. There are three kinds of functions:
  3281.  
  3282.    1. External functions
  3283.  
  3284.    2. Statement functions
  3285.  
  3286.    3. Intrinsic functions
  3287.  
  3288.  External and statement functions are described in more detail below.
  3289.  Intrinsic functions are described in Chapter 5, "Intrinsic Functions and
  3290.  Additional Procedures".
  3291.  
  3292.  An arithmetic, character, or logical expression may reference a function.
  3293.  Executing the function reference evaluates the function, and the returned
  3294.  value is used as an operand in the expression with the function reference.
  3295.  Note that the length of a character function must be specified by an
  3296.  integer-constant expression.
  3297.  
  3298.  The syntax of a function reference is as follows:
  3299.  
  3300.       fname («argument-list»)
  3301.  
  3302.  Parameter                                  Value
  3303.  
  3304.  fname                                      Name of an external, intrinsic,
  3305.                                             or statement function.
  3306.  
  3307.  argument-list                              Actual arguments. If more than
  3308.                                             one argument is given, they must
  3309.                                             be separated by commas.
  3310.  
  3311.  Function arguments follow the same rules as those for subroutines (except
  3312.  that alternate returns are not allowed); these are described in the CALL
  3313.  entry in Section 4.2, "Statement Directory." Some additional restrictions
  3314.  specific to statement functions and intrinsic functions are described in
  3315.  Section 2.10.2, "Statement Functions," and Chapter 5, "Intrinsic Functions
  3316.  and Additional Procedures," respectively.
  3317.  
  3318.  
  3319.  2.10.1  External Functions
  3320.  
  3321.  External functions are user-defined functions (as opposed to FORTRAN's
  3322.  intrinsic functions). They may be included with the main program source code
  3323.  or in a separately compiled unit. They begin with a FUNCTION statement and
  3324.  conclude with an END statement.
  3325.  
  3326.  
  3327.  Example
  3328.  
  3329.       C     The following external function calculates
  3330.       C     the Simpson approximation of a definite integral:
  3331.  
  3332.             INTEGER FUNCTION  Simpson (delx, steps, y)
  3333.             INTEGER  delx, y(100), sum, steps, factor
  3334.             sum = 0
  3335.             DO 100  i = 0, steps
  3336.                IF ((i .EQ. 0) .OR. (i .EQ. steps)) THEN
  3337.                   factor = 1
  3338.                ELSE IF (MOD (i, 2) .EQ. 0) THEN
  3339.                   factor = 2
  3340.                ELSE
  3341.                   factor = 4
  3342.                END IF
  3343.                sum = factor * y(i) + sum
  3344.       100   CONTINUE
  3345.             Simpson = INT ((REAL (delx) /3.0) * REAL (sum))
  3346.             END
  3347.  
  3348.  
  3349.  2.10.2  Statement Functions
  3350.  
  3351.  A statement function is defined by a single statement and is similar in form
  3352.  to an assignment statement. The body of a statement function defines the
  3353.  statement function.
  3354.  
  3355.  A statement function must be the first nondeclaration statement in a program
  3356.  unit, but it is not executed at that point; it is a nonexecutable statement.
  3357.  It is executed, like other functions, by referencing it in an expression.
  3358.  
  3359.  For information on the syntax and use of a statement function statement, see
  3360.  the Statement Function entry in Section 4.2, "Statement Directory."
  3361.  
  3362.  
  3363.  Chapter 3  The Input/Output System
  3364.  ───────────────────────────────────────────────────────────────────────────
  3365.  
  3366.  This chapter explains FORTRAN's input/output (I/O) system. The chapter
  3367.  introduces FORTRAN's file types and summarizes the I/O statements available
  3368.  to manipulate data within them. Additional sections describe options
  3369.  available in FORTRAN I/O statements and the use of  control characters,
  3370.  formatted I/O, and edit descriptors. List-directed and namelist-directed I/O
  3371.  are also discussed.
  3372.  
  3373.  
  3374.  3.1  The FORTRAN I/O System
  3375.  
  3376.  In FORTRAN's I/O system, data is stored in files and can be transferred
  3377.  between files. There are two basic types of files:
  3378.  
  3379.  Type                                       Description
  3380.  
  3381.  External files                             A device, such as the screen, the
  3382.                                             keyboard, or a printer, or a file
  3383.                                             that is stored on a device, such
  3384.                                             as a file on a disk.
  3385.  
  3386.  Internal files                             A character variable, character
  3387.                                             array, character array element,
  3388.                                             «character structure element,»
  3389.                                             character substring, «or
  3390.                                             noncharacter array». For
  3391.                                             information on internal files,
  3392.                                             see Section 3.5.
  3393.  
  3394.  All files consist of records, which are sequences of characters or values.
  3395.  See Microsoft FORTRAN Advanced Topics for information on the format of
  3396.  records.
  3397.  
  3398.  Input is the transfer of data from a file to internal storage. Output is the
  3399.  transfer of data from internal storage to a file. You input data by reading
  3400.  from a file, and output data by writing to a file.
  3401.  
  3402.  
  3403.  3.2  I/O Statements
  3404.  
  3405.  I/O statements transfer data, manipulate files, or determine the properties
  3406.  of the connections to files. Table 3.1 lists the I/O statements.
  3407.  
  3408.  Table 3.1  I/O Statements
  3409.  
  3410.  Statement                  Function
  3411.  
  3412.  BACKSPACE                  Positions a file back one record
  3413.  CLOSE                      Disconnects a unit
  3414.  ENDFILE                    Writes an end-of-file record
  3415.  
  3416.  INQUIRE                    Determines properties of a unit or named file
  3417.  
  3418.  «LOCKING»                  «Controls access to information in specific
  3419.                             direct-access files and/or records»
  3420.  
  3421.  OPEN                       Associates a unit number with a file
  3422.  
  3423.  PRINT                      Outputs data to the asterisk (*) unit
  3424.  READ                       Inputs data
  3425.  
  3426.  REWIND                     Repositions a file to the beginning
  3427.  WRITE                      Outputs data
  3428.  
  3429.  ───────────────────────────────────────────────────────────────────────────
  3430.  «NOTE»
  3431.     «In addition to the I/O statements, Microsoft FORTRAN includes an I/O
  3432.     intrinsic function, EOF (unitspec), which is described in Section 5.1.14,
  3433.     "End-of-File Function." EOF returns a logical value that indicates
  3434.     whether there is data remaining in the file after the current position.»
  3435.  ───────────────────────────────────────────────────────────────────────────
  3436.  
  3437.  In I/O statements, you can specify a series of options. The following, for
  3438.  example, is the syntax of the CLOSE statement:
  3439.  
  3440.       CLOSE («UNIT=»unitspec
  3441.       «, ERR=errlabel»
  3442.       «, IOSTAT=iocheck»
  3443.       «, STATUS=status»)
  3444.  
  3445.  The three options of the CLOSE statement are «, ERR=errlabel», «, IOSTAT=
  3446.  iocheck», and «, STATUS=status». (Although the UNIT= descriptor is
  3447.  optional, the unitspec itself is not.)
  3448.  
  3449.  The ERR= and IOSTAT= options control error handling, and the STATUS= option
  3450.  specifies whether to keep or delete the file after disconnecting. The
  3451.  following statement closes the file connected to unit 2, transfers execution
  3452.  to the statement labeled 100 if there is an I/O error, and uses the default
  3453.  value of the STATUS= option:
  3454.  
  3455.             CLOSE (UNIT = 2, ERR = 100)
  3456.  
  3457.  Options used in only one statement are described in Section 4.2, "Statement
  3458.  Directory." Fourteen of the options in I/O statements, however, are used in
  3459.  more than one I/O statement. Table 3.2 lists these options, the I/O
  3460.  statements they are used in, and the section that describes each.
  3461.  
  3462.  Table 3.2  I/O Options
  3463.  
  3464.  Option                   I/O Statements                  Section
  3465.  
  3466.  ACCESS=access            INQUIRE, OPEN                   3.2.3, "File
  3467.                                                           Access Method"
  3468.  
  3469.  «BLOCKSIZE=blocksize»    «INQUIRE, OPEN»                 «3.2.4,
  3470.                                                           "Input/Output
  3471.                                                           Buffer Size"»
  3472.  
  3473.  editlist                 FORMAT, PRINT, READ, WRITE      3.2.5, "The Edit
  3474.                                                           List"
  3475.  
  3476.  ERR=errlabel             All except PRINT                3.2.6, "Error
  3477.                                                           and End-of-File
  3478.                                                           Handling"
  3479.  
  3480.  FILE=file                INQUIRE, OPEN                   3.2.1, "File
  3481.                                                           Names"
  3482.  
  3483.  «FMT=»formatspec         PRINT, READ, WRITE              3.2.7, "Format
  3484.                                                           Specifier"
  3485.  
  3486.  FORM=form                INQUIRE, OPEN                   3.2.9, "File
  3487.                                                           Structure"
  3488.  
  3489.  iolist                   PRINT, READ, WRITE              3.2.10,
  3490.                                                           "Input/Output
  3491.                                                           List"
  3492.  
  3493.  IOSTAT=iocheck           All except PRINT                3.2.6, "Error
  3494.                                                           and End-of-File
  3495.                                                           Handling"
  3496.  
  3497.  «MODE=mode»              «INQUIRE, OPEN»                 «3.2.11, "File
  3498.                                                           Sharing"»
  3499.  
  3500.  ««NML=»nmlspec»          «PRINT, READ, WRITE»            «3.2.8,
  3501.                                                           "Namelist
  3502.                                                           Specifier"»
  3503.  
  3504.  REC=rec                  LOCKING, READ, WRITE            3.2.12, "Record
  3505.                                                           Number"
  3506.  
  3507.  «SHARE=share»            «INQUIRE, OPEN»                 «3.2.11, "File
  3508.                                                           Sharing"»
  3509.  
  3510.  «UNIT=»unitspec          All except PRINT                3.2.2, "Units"
  3511.  
  3512.  The following list briefly summarizes the options listed in Table 3.2.
  3513.  Sections 3.2.1-3.2.12 provide a complete discussion of these options. The
  3514.  FILE=, UNIT=, and ACCESS= options are presented in the order you must use
  3515.  them, followed by the other options listed alphabetically.
  3516.  
  3517.  Option                                     Description
  3518.  
  3519.  ACCESS                                     Specifies the method of file
  3520.                                             access, which can be
  3521.                                             'SEQUENTIAL', 'DIRECT', «or
  3522.                                             'APPEND'». Returns the method of
  3523.                                             file access, which can be
  3524.                                             'SEQUENTIAL' or 'DIRECT'.
  3525.  
  3526.  «BLOCKSIZE»                                «Specifies or returns the
  3527.                                             internal buffer size used in
  3528.                                             I/O.»
  3529.  
  3530.  editlist                                   Lists edit descriptors. Used in
  3531.                                             FORMAT statements and format
  3532.                                             specifiers (the FMT=formatspec
  3533.                                             option) to describe the format of
  3534.                                             data.
  3535.  
  3536.  END                                        Transfers control to the
  3537.                                             statement with the label in the
  3538.                                             END= option when end-of-file is
  3539.                                             encountered.
  3540.  
  3541.  ERR                                        Controls I/O error handling.
  3542.                                             Specifies the label of an
  3543.                                             executable statement where
  3544.                                             execution is transferred after an
  3545.                                             error.
  3546.  
  3547.  IOSTAT                                     Controls I/O error handling.
  3548.                                             Specifies a variable whose value
  3549.                                             indicates whether an error has
  3550.                                             occurred.
  3551.  
  3552.  FILE                                       Specifies the name of a file.
  3553.  
  3554.  FMT                                        Specifies an editlist to use to
  3555.                                             format data.
  3556.  
  3557.  FORM                                       Specifies a file's format, which
  3558.                                             can be either  'FORMATTED',
  3559.                                             'UNFORMATTED'«, or 'BINARY'».
  3560.  
  3561.  iolist                                     Specifies items to be input or
  3562.                                             output.
  3563.  
  3564.  «MODE»                                     «Controls how other processes can
  3565.                                             access a file on networked
  3566.                                             systems. The MODE= option can be
  3567.                                             set to 'READWRITE', 'READ', or
  3568.                                             'WRITE'.»
  3569.  
  3570.  «NML»                                      «Specifies a namelist group to be
  3571.                                             input or output.»
  3572.  
  3573.  REC                                        Specifies the first (or only)
  3574.                                             record of a file to be locked,
  3575.                                             read from, or written to.
  3576.  
  3577.  «SHARE»                                    «Controls how other processes can
  3578.                                             simultaneously access a file on
  3579.                                             networked systems. The SHARE=
  3580.                                             option can be set to 'COMPAT',
  3581.                                             'DENYNONE', 'DENYWR', 'DENYRD',
  3582.                                             or 'DENYRW'.»
  3583.  
  3584.  UNIT                                       Specifies the unit to which a
  3585.                                             file is connected.
  3586.  
  3587.  
  3588.  3.2.1  File Names (FILE=)
  3589.  
  3590.  File names must follow the rules listed in Section 1.2, "Names." The name of
  3591.  an internal file is the name of the character variable, character array,
  3592.  character array element, «character structure element,» character substring,
  3593.  «or noncharacter array» that makes up the file. The name of an external file
  3594.  must be a character string that the operating system recognizes as a file
  3595.  name. The operating system assumes the file is in the current working
  3596.  directory if you do not specify a path. External file names must follow the
  3597.  file-naming conventions of your operating system, as well as the rules
  3598.  listed in Section 1.2, "Names." Wild-card specifications are not permitted.
  3599.  
  3600.  An external file can be connected to a FORTRAN unit number by any one of the
  3601.  following methods:
  3602.  
  3603.    ■  If the file is opened with an OPEN statement, the name can be specified
  3604.       in the OPEN statement.
  3605.  
  3606.    ■  If the file is opened with an OPEN statement for a unit other than one
  3607.       of the preconnected units (0, 5, or 6) and no name is specified in the
  3608.       OPEN statement, the file is considered a scratch or temporary file, and
  3609.       a default name is used.
  3610.  
  3611.    ■  «If the file is opened with an OPEN statement and the name is specified
  3612.       as all blanks, the name can be read from the command line or can be
  3613.       entered by the user, as described in the OPEN entry in Section 4.2,
  3614.       "Statement Directory."»
  3615.  
  3616.    ■  «If the file is referred to in a READ or WRITE statement before it has
  3617.       been opened, an implicit open operation is performed, as described in
  3618.       the READ and WRITE entries in Section 4.2, "Statement Directory." The
  3619.       implicit open operation is equivalent to executing an OPEN statement
  3620.       with a name specified as all blanks. Therefore the name is read from
  3621.       the command line or can be input by the user, as described in the OPEN
  3622.       entry in Section 4.2, "Statement Directory ."»
  3623.  
  3624.  
  3625.  3.2.2  Units (UNIT=)
  3626.  
  3627.  For most I/O operations, a file must be identified by a unit specifier. The
  3628.  unit specifier for an internal file is the name of that internal file (see
  3629.  Section 3.5 for information on internal files). For an external file, a file
  3630.  is connected to a unit specifier with the OPEN statement. Some external unit
  3631.  specifiers, listed below, are preconnected to certain devices and do not
  3632.  have to be opened. External units that you connect are disconnected when
  3633.  program execution terminates or when the unit is closed by a CLOSE
  3634.  statement.
  3635.  
  3636.  The unit specifier is required for all I/O statements except PRINT (which
  3637.  always writes to standard output), a READ statement that contains only an
  3638.  I/O list and format specifier (which always reads from standard input), and
  3639.  an INQUIRE by file (which specifies the file name, rather than the unit to
  3640.  which the file is connected).
  3641.  
  3642.  An external unit specifier must be either an integer expression or an
  3643.  asterisk (*). The integer expression must be in the range -32,767 to 32,767.
  3644.  The following example connects the external file UNDAMP to unit 10 and
  3645.  writes to it:
  3646.  
  3647.             OPEN (UNIT = 10, FILE = 'undamp')
  3648.             WRITE (10, *) ' Undamped Motion:'
  3649.  
  3650.  The asterisk (*) unit specifier is preconnected and cannot be connected by
  3651.  an OPEN statement. It is the only unit specifier that cannot be reconnected
  3652.  to another file. The asterisk unit specifier specifies the keyboard when
  3653.  reading and the screen when writing. The following example uses the asterisk
  3654.  unit specifier to write to the screen:
  3655.  
  3656.             WRITE (*, '(1X, ''Begin output.'')')
  3657.  
  3658.  Microsoft FORTRAN has four external units:
  3659.  
  3660.  External Unit                              Description
  3661.  
  3662.  Asterisk (*)                               Always represents the keyboard
  3663.                                             and screen
  3664.  
  3665.  0                                          Initially represents the keyboard
  3666.                                             and screen
  3667.  
  3668.  5                                          Initially represents the keyboard
  3669.  
  3670.  6                                          Initially represents the screen
  3671.  
  3672.  The asterisk (*) unit cannot be connected to any other file, and attempting
  3673.  to close this unit causes a compile-time error. Units 0, 5, and 6, however,
  3674.  can be connected to any file with the OPEN statement. «If you close unit 0,
  3675.  5, or 6, it is automatically reconnected to the keyboard and screen, the
  3676.  keyboard, or the screen, respectively.»
  3677.  
  3678.  If you read or write to a unit that has been closed, the file is opened
  3679.  implicitly, as described in the READ and WRITE entries in Section 4.2,
  3680.  "Statement Directory."
  3681.  
  3682.  
  3683.  Examples
  3684.  
  3685.  In the following program, the character variable fname is an internal file:
  3686.  
  3687.       C     The output of this program is FM004.DAT
  3688.             CHARACTER*14 fname
  3689.             ifile = 4
  3690.             WRITE (fname, 100) ifile
  3691.       100   FORMAT ('FM', I3.3, '.DAT')
  3692.             WRITE (*, *) fname
  3693.             END
  3694.  
  3695.  «The following example writes to the preconnected unit 6 (the screen), then
  3696.  reconnects unit 6 to an external file and writes to it, and finally
  3697.  reconnects unit 6 to the screen and writes to it.»
  3698.  
  3699.            «REAL a, b
  3700.       C     Write to the screen (preconnected unit 6):
  3701.             WRITE(6, '('' This is unit 6'')')
  3702.       C     Use the OPEN statement to connect unit 6
  3703.       C     to an external file named 'COSINES':
  3704.             OPEN (UNIT = 2*3, FILE = 'COSINES', STATUS = 'NEW')
  3705.             DO 200 a = 0.1, 6.3, 0.1
  3706.                b = COS (a)»
  3707.  
  3708.       «C     Write to the file 'COSINES':
  3709.                WRITE  (6, 100) a, b
  3710.       100      FORMAT (F3.1, F5.2)
  3711.       200   CONTINUE
  3712.       C     Reconnect unit 6 to the screen, by closing it:
  3713.             CLOSE (6, STATUS = 'KEEP')
  3714.       C     Write to the screen:
  3715.             WRITE(6,' ('' Cosines completed'')')
  3716.             END»
  3717.  
  3718.  
  3719.  3.2.3  File Access Method (ACCESS=)
  3720.  
  3721.  The following sections describe the three methods of file access:
  3722.  sequential, direct, and appended. Sequential files contain data recorded in
  3723.  the order in which it was written to the file; direct files are
  3724.  random-access files.
  3725.  
  3726.  
  3727.  3.2.3.1  Sequential File Access
  3728.  
  3729.  The records in a sequential file appear in the order in which they were
  3730.  written to the file.
  3731.  
  3732.  All internal files use sequential access. You must also use sequential
  3733.  access for files associated with "sequential devices." A sequential device
  3734.  is a device that does not allow explicit motion (other than reading or
  3735.  writing). The keyboard, screen, and printer are all sequential devices.
  3736.  
  3737.  It is not possible to access a particular sequential record directly because
  3738.  all the preceding records must be read through first. Direct operations to
  3739.  files opened for sequential access are not allowed. «An existing sequential
  3740.  file can be opened in 'APPEND' mode. The file is positioned immediately
  3741.  after the last record and before the end-of-file mark.»
  3742.  
  3743.  
  3744.  3.2.3.2  Direct File Access
  3745.  
  3746.  Direct files are random-access files whose records can be read or written to
  3747.  in any order. Direct-access files must reside on disk. You cannot associate
  3748.  a direct-access file with a sequential device, such as the keyboard, screen,
  3749.  or printer.
  3750.  
  3751.  Records are numbered sequentially, with the first record numbered 1. All
  3752.  records have the same length, specified by the RECL=option in the OPEN
  3753.  statement. One record is written for each unformatted READ or WRITE
  3754.  statement. A formatted READ or WRITE statement can transfer more than one
  3755.  record using the slash (/) edit descriptor.
  3756.  
  3757.  «Except for binary files,» the number of bytes written to a record must be
  3758.  less than or equal to the record length. «For binary files, a single READ or
  3759.  WRITE statement reads or writes as many records as needed to accommodate the
  3760.  number of bytes being transferred.» On output, incomplete formatted records
  3761.  are padded with spaces. Incomplete unformatted «and binary records» are
  3762.  padded with undefined bytes (zeros).
  3763.  
  3764.  In a direct-access file, it is possible to write records out of order (for
  3765.  example, 9, 5, and 11, in that order) without writing the records in
  3766.  between. It is not possible to delete a record once written; however, a
  3767.  record can be overwritten with a new value.
  3768.  
  3769.  Positioning a direct-access file past the end-of-file marker and attempting
  3770.  to read from it can cause a run-time error. Reading an unwritten record from
  3771.  a direct-access file is also illegal and can cause a run-time error. If a
  3772.  record is written beyond the old terminating file boundary, the operating
  3773.  system attempts to extend direct-access files. This works only if there is
  3774.  room available on the physical device.
  3775.  
  3776.  Each READ or WRITE operation on a direct-access file must explicitly specify
  3777.  the record to be accessed. «Microsoft FORTRAN also permits sequential
  3778.  operations on files opened for direct access; the operation takes place on
  3779.  the next record.»
  3780.  
  3781.  «The following statements read the third and fourth records of the file
  3782.  xxx:»
  3783.  
  3784.            «OPEN (1, FILE = 'xxx', ACCESS = 'DIRECT', RECL = 15
  3785.            +         FORM = 'FORMATTED')
  3786.             READ (1, '(3I5)', REC = 3) i, j, k
  3787.             READ (1, '(3I5)') l, m, n»
  3788.  
  3789.  «A file created as a direct-access file and opened in 'APPEND' mode defaults
  3790.  to sequential access.»
  3791.  
  3792.  
  3793.  3.2.4  «Input/Output Buffer Size (BLOCKSIZE=)»
  3794.  
  3795.  «Many programs are "I/O bound," meaning their speed of execution is largely
  3796.  determined by the speed of I/O operations. I/O speed, in turn, is influenced
  3797.  by the size of the I/O buffer. In general, the larger the buffer, the faster
  3798.  the I/O, since a large buffer reduces the total number of reads and writes
  3799.  needed to transfer a given amount of data.»
  3800.  
  3801.  «The value of BLOCKSIZE is an integer expression specifying the internal
  3802.  buffer size for use in I/O. See Microsoft FORTRAN Advanced Topics for
  3803.  specific information about block sizes and using the BLOCKSIZE= option.»
  3804.  
  3805.  
  3806.  3.2.5  The Edit List
  3807.  
  3808.  Edit lists describe the format of data. They are used in FORMAT statements
  3809.  and format specifiers.
  3810.  
  3811.  The edit list (including the outer parentheses) is a character constant, and
  3812.  is enclosed in apostrophes when it appears in a READ or WRITE statement. «In
  3813.  Microsoft FORTRAN, the edit list may be enclosed in quotes.» There are no
  3814.  apostrophes around the edit list when it appears in a FORMAT statement.
  3815.  
  3816.  The edit list is a series of formatting descriptors separated by commas.
  3817.  «You may omit the comma between two items if the resulting edit list is not
  3818.  ambiguous. For example, you can usually omit the comma after a P edit
  3819.  descriptor or before or after the slash (/) edit descriptor without any
  3820.  resulting ambiguity.»
  3821.  
  3822.  There are three types of editing descriptors:
  3823.  
  3824.    1. Nonrepeatable edit descriptors (nonrepeatable)
  3825.  
  3826.    2. Repeatable edit descriptors optionally preceded by a repeat
  3827.       specification (n-repeatable)
  3828.  
  3829.    3. An edit list, enclosed in parentheses, optionally preceded by a repeat
  3830.       specification (n(editlist))
  3831.  
  3832.  A repeat specification is a nonzero, unsigned integer constant. Edit
  3833.  descriptors are described in Sections 3.7.1, "Nonrepeatable Edit
  3834.  Descriptors," and 3.7.2, "Repeatable Edit Descriptors." The following list
  3835.  gives examples of each type of editing descriptor:
  3836.  
  3837.  Editing Descriptor              Examples
  3838.  
  3839.  nonrepeatable                   'Total = '
  3840.                                  3Hyes
  3841.                                  SP
  3842.                                  BN
  3843.                                  1X
  3844.  
  3845.  n-repeatable                    I5
  3846.                                  2I5
  3847.                                  10F8.2
  3848.                                  3A10
  3849.                                  E12.7E2
  3850.  
  3851.  n(editlist)                     2(1X, 2I5)
  3852.                                  (1X, 'Total = ', E12.7E2)
  3853.                                  (3A10, 10F8.2)
  3854.                                  920(10F8.2) 2(13(2I5), SP, 'Total =', F8.2)
  3855.  
  3856.  Up to 16 levels of nested parentheses are permitted within the outermost
  3857.  level of parentheses in an editlist.
  3858.  
  3859.  
  3860.  Examples
  3861.  
  3862.  The following program contains two examples of editlist:
  3863.  
  3864.             INTEGER a, b
  3865.             REAL x, y
  3866.             DATA a /52/, b /9/, x /5832.67/, y /1.02781/
  3867.             WRITE (*, 100) a, b
  3868.       C     The editlist in the next FORMAT statement is below the
  3869.       C     hyphens:   -----------------------
  3870.       100   FORMAT (' A = ', I5, 'B = ', I5)
  3871.             WRITE (*, 200) x, y
  3872.       C     The editlist in the next FORMAT statement is below the
  3873.       C     hyphens:   -----------------
  3874.       200   FORMAT (' ', 2(F8.3, 1Hm))
  3875.             END
  3876.  
  3877.  The program above produces the following output:
  3878.  
  3879.       A =    52B =     9
  3880.       5832.670m   1.028m
  3881.  
  3882.  Note that each formatted WRITE statement writes an initial blank to the
  3883.  terminal device as a carriage-control character.
  3884.  
  3885.  
  3886.  3.2.6  Error and End-of-File Handling (IOSTAT=, ERR=, END=)
  3887.  
  3888.  If an error occurs or the end-of-file record is encountered during an I/O
  3889.  operation, the action taken depends on the presence and definition of the
  3890.  ERR= errlabel, IOSTAT=iocheck, and END=endlabel options. Note that the READ
  3891.  statement is the only I/O statement that does not consider reaching an
  3892.  end-of-file record as an error.
  3893.  
  3894.  Since the PRINT statement does not allow any of these options to be
  3895.  specified, an error during execution of a PRINT statement always causes a
  3896.  run-time error.
  3897.  
  3898.  Table 3.3 indicates what action is taken when an error or end-of-file record
  3899.  is encountered by a READ statement. Note that any time an error occurs
  3900.  during a READ statement, all items in iolist become undefined.
  3901.  
  3902.  Table 3.3  Errors and End-of-File Records When Reading
  3903.  
  3904.  IOSTAT       END      ERR      End-of-File               Error, or Error and
  3905.  Set          Set      Set      Occurs                    End-of-File, Occurs
  3906.  
  3907.  No           No       No       Run-time error occurs.    Run-time error
  3908.                                                           occurs.
  3909.  
  3910.  No           No       Yes      Program terminates.       Go to errlabel.
  3911.                                 Go to errlabel.
  3912.  
  3913.  No           Yes      No       Go to endlabel.           Run-time error
  3914.                                                           occurs.
  3915.  
  3916.  No           Yes      Yes      Go to endlabel.           Go to errlabel.
  3917.  
  3918.  Yes          No       No       Set iocheck = -1 and      Set iocheck =
  3919.                                 continue.                 run-time error
  3920.                                                           number and
  3921.                                                           continue.
  3922.  
  3923.  Yes          No       Yes      Set iocheck = -1 and      Set iocheck =
  3924.                                 continue.                 run-time error
  3925.                                                           number and go to
  3926.                                                           errlabel.
  3927.  
  3928.  Yes          Yes      No       Set iocheck = -1 and      Set iocheck =
  3929.                                 go to endlabel.           run-time error
  3930.                                                           number and
  3931.                                                           continue.
  3932.  
  3933.  Yes          Yes      Yes      Set iocheck = -1 and      Set iocheck =
  3934.                                 go to endlabel.           run-time error
  3935.                                                           number and go to
  3936.                                                           errlabel.
  3937.  
  3938.  The following list shows what happens when an error (including encountering
  3939.  an end-of-file record) occurs during any I/O statement other than READ or
  3940.  PRINT:
  3941.  
  3942.  Situation                                  Result
  3943.  
  3944.  Neither errlabel nor iocheck is            The program is terminated, and a
  3945.  present                                    run-time error message is given.
  3946.  
  3947.  Only errlabel is present                   Control is transferred to the
  3948.                                             statement at errlabel.
  3949.  
  3950.  Only iocheck is present                    The value of iocheck is set to
  3951.                                             the run-time error number and
  3952.                                             control is returned as if the
  3953.                                             statement had executed without
  3954.                                             error.
  3955.  
  3956.  Both errlabel and iocheck are              The value of iocheck is set to
  3957.  present                                    the run-time error number and
  3958.                                             control is transferred to the
  3959.                                             statement at errlabel.
  3960.  
  3961.  If an I/O statement terminates without encountering either an error or
  3962.  end-of-file record, and if iocheck is specified, iocheck is set to zero.
  3963.  
  3964.  
  3965.  Examples
  3966.  
  3967.  In the following program, none of the available options (ERR=, IOSTAT=, or
  3968.  END=) are set. Therefore, if an invalid value is entered for i, a run-time
  3969.  error is produced:
  3970.  
  3971.             INTEGER i
  3972.             WRITE (*, *) 'Please enter i'
  3973.             READ  (*, *) i
  3974.             WRITE (*, *) 'This is i:', i
  3975.             END
  3976.  
  3977.  The following program uses the ERR= option to prompt the user to enter a
  3978.  valid number:
  3979.  
  3980.             INTEGER i
  3981.             WRITE (*, *) 'Please enter i:'
  3982.        50   READ  (*, *, ERR = 100) i
  3983.             WRITE (*, *) 'This is i:', i
  3984.             STOP ' '
  3985.       100   WRITE (*, *) 'Invalid value. Please enter new i:'
  3986.             GOTO 50
  3987.             END
  3988.  
  3989.  The following program uses both the ERR= and IOSTAT= options to handle
  3990.  invalid input:
  3991.  
  3992.             INTEGER i, j
  3993.             WRITE (*, *) 'Please enter i:'
  3994.       50    READ  (*, *, ERR = 100, IOSTAT = j) i
  3995.             WRITE (*, *) 'This is i:', i, ' iostat = ', j
  3996.             STOP ' '
  3997.       100   WRITE (*, *) 'iostat = ', j, ' Please enter new i:'
  3998.             GOTO 50
  3999.             END
  4000.  
  4001.  
  4002.  3.2.7  Format Specifier (FMT=)
  4003.  
  4004.  Format specifiers either contain an edit list or specify the statement label
  4005.  of the format to be used. Format specifiers are used in PRINT, READ, and
  4006.  WRITE statements.
  4007.  
  4008.  The following sections show the seven acceptable types of format specifiers
  4009.  and provide an example of how each format specifier can be used.
  4010.  
  4011.  
  4012.  3.2.7.1  FORMAT Statement Label
  4013.  
  4014.  A format specifier can be the label of a FORMAT statement. The edit list in
  4015.  the FORMAT statement becomes the format for the data. The following syntax
  4016.  shows how a FORMAT statement label can specify an edit list for a WRITE
  4017.  statement:
  4018.  
  4019.             WRITE (*, label) iolist
  4020.       label FORMAT (editlist)
  4021.  
  4022.  
  4023.  3.2.7.2  Integer-Variable Name
  4024.  
  4025.  An ASSIGN statement can be used to associate an integer variable with the
  4026.  label of a FORMAT statement. The integer variable can then be used as a
  4027.  format specifier, as follows:
  4028.  
  4029.             ASSIGN label TO var
  4030.       label FORMAT (editlist)
  4031.             WRITE (*, var) iolist
  4032.  
  4033.  In the WRITE statement, the integer-variable name var refers to the FORMAT
  4034.  statement label, as assigned just before the FORMAT statement. For further
  4035.  information, see the ASSIGN entry in Section 4.2, "Statement Directory."
  4036.  
  4037.  
  4038.  3.2.7.3  Character Expression
  4039.  
  4040.  An edit list can be written as a character expression, and that character
  4041.  expression can be used as a format specifier, as follows:
  4042.  
  4043.       WRITE (*, '(editlist)')iolist
  4044.  
  4045.  The character expression can be a character constant. The expression cannot
  4046.  include concatenation of an operand whose length specifier is an asterisk in
  4047.  parentheses, unless that operand is the symbolic name of a constant.
  4048.  
  4049.  
  4050.  3.2.7.4  Character Variable
  4051.  
  4052.  An edit list can be written as a character expression, and that expression
  4053.  can be assigned to a character variable. The character variable is then used
  4054.  as the format specifier, as follows:
  4055.  
  4056.       CHARACTER*n var
  4057.       var = '(editlist)'
  4058.       WRITE (*, var) iolist
  4059.  
  4060.  
  4061.  3.2.7.5  Asterisk ( *)
  4062.  
  4063.  When an asterisk (*) is used as a format specifier, list-directed I/O is
  4064.  performed, as shown in the following syntax line:
  4065.  
  4066.       WRITE (6, *) iolist
  4067.  
  4068.  In this statement, the asterisk indicates a list-directed transfer. For more
  4069.  information, see Section 3.8, "List-Directed I/O."
  4070.  
  4071.  
  4072.  3.2.7.6  Character «or Noncharacter» Array Name
  4073.  
  4074.  An edit list can be written as a character expression, and that expression
  4075.  can be assigned to an array. The array is then used as the format specifier,
  4076.  as follows:
  4077.  
  4078.       CHARACTER*bytes array(dim)
  4079.       DATA array /'(editlist)'/...
  4080.       WRITE (*, array) iolist
  4081.  
  4082.  The array is interpreted as all the elements of the array concatenated in
  4083.  column-major order (see the DIMENSION entry in Section 4.2, "Statement
  4084.  Directory,"  for information on order of array elements).
  4085.  
  4086.  «A noncharacter array can also be specified where the elements of the array
  4087.  are treated as equivalent character variables of the same length.»
  4088.  
  4089.  If a Hollerith constant is used to specify an edit list, the edit list
  4090.  cannot contain an apostrophe edit descriptor or another Hollerith constant.
  4091.  
  4092.  
  4093.  Example
  4094.  
  4095.  The following example uses a character array, char, «and two real arrays,
  4096.  real1 and real2,» to print a header ( The results are:) and the values of
  4097.  two integer arrays, three times:
  4098.  
  4099.       «$NOTSTRICT»
  4100.             INTEGER  array1(6), array2(4)
  4101.             CHARACTER*8  char(4)
  4102.             «REAL*8  real1(4), real2(4)»
  4103.        C    format is   ==>   (" The results are: ", 6I6, 4I6)
  4104.             DATA char  /  "(' The r", "esults a", "re: ', 6",
  4105.            +              "I6, 4I6)" /
  4106.            «DATA real1 /  "(' The r", "esults a", "re: ', 6",
  4107.            +              "I6, 4I6)" /
  4108.             DATA real2 / 8H(' The r, 8Hesults a, 8Hre: ', 6,
  4109.            +             8HI6, 4I6)  /»
  4110.             WRITE (*, char ) array1, array2
  4111.            «WRITE (*, real1) array1, array2
  4112.             WRITE (*, real2) array1, array2»
  4113.  
  4114.  
  4115.  3.2.7.7  Character Array Element
  4116.  
  4117.  An edit list can be written as a character expression and that expression
  4118.  assigned to a character array element. The character array element is then
  4119.  used as the format specifier, as follows:
  4120.  
  4121.       CHARACTER*bytes array(dim)
  4122.       array(n) = '(editlist)'
  4123.       WRITE (*, array(n)) iolist
  4124.  
  4125.  In this example, the WRITE statement uses the character array element
  4126.  array(n) as the format specifier for data transfer.
  4127.  
  4128.  
  4129.  3.2.8  «Namelist Specifier (NML=)»
  4130.  
  4131.  «Within a WRITE statement, a namelist specifier causes the names and values
  4132.  of all the variables in the namelist to be written to the specified unit.
  4133.  Within a READ statement, a namelist specifier prompts the user to enter a
  4134.  value for one or more of the variables in the namelist. For more
  4135.  information, see Section 3.9, "Namelist-Directed I/O."»
  4136.  
  4137.  
  4138.  3.2.9  File Structure (FORM=)
  4139.  
  4140.  The structure of a file is determined by the file's access, set by the
  4141.  ACCESS= option described in Section 3.2.3, and the form of the data the file
  4142.  contains.
  4143.  
  4144.  A file is structured in one of three ways:
  4145.  
  4146.  Form         Structure
  4147.  
  4148.  Formatted    A file is a sequence of formatted records. Formatted records
  4149.               are a series of ASCII characters terminated by an end-of-record
  4150.               mark (a carriage-return and line-feed sequence). The records in
  4151.               a formatted sequential file can have varying lengths. All the
  4152.               records in a formatted direct file must be the same length. All
  4153.               internal files must be formatted.
  4154.  
  4155.  Unformatted  A file is a sequence of unformatted records. Unformatted
  4156.               records are a sequence of values. Unformatted direct files
  4157.               contain only this data, and each record is padded to a fixed
  4158.               length with undefined bytes. Unformatted sequential files also
  4159.               contain information that indicates the boundaries of each
  4160.               record.
  4161.  
  4162.  «Binary»     «Binary sequential files are sequences of bytes with no
  4163.               internal structure. There are no records. The file contains
  4164.               only the information specified as I/O list items in WRITE
  4165.               statements referring to the file.»
  4166.  
  4167.               «Binary direct files have very little structure. A record
  4168.               length is assigned by the RECL= option of the OPEN statement.
  4169.               This establishes record boundaries, which are used only for
  4170.               repositioning and padding before and after read and write
  4171.               operations and during BACKSPACE operations. These record
  4172.               boundaries do not, however, restrict the number of bytes that
  4173.               can be transferred during a read or write operation. If an I/O
  4174.               operation attempts to read or write more values than are
  4175.               contained in a record, the read or write operation is continued
  4176.               on the next record. I/O operations that can be performed on
  4177.               unformatted direct files produce the same results when applied
  4178.               to binary direct files.»
  4179.  
  4180.  See Microsoft FORTRAN Advanced Topics for information on how records are
  4181.  represented on your system.
  4182.  
  4183.  
  4184.  3.2.10  Input/Output List
  4185.  
  4186.  The input/output list, iolist, specifies the items to be input or output.
  4187.  See Section 3.7.3 for an explanation of how the iolist and editlist
  4188.  interact.
  4189.  
  4190.  The following items can be in an iolist:
  4191.  
  4192.    ■  No entry
  4193.  
  4194.       An iolist can be empty. The resulting record is either of zero length
  4195.       or contains only padding characters.
  4196.  
  4197.       C     An empty iolist:
  4198.             WRITE (unit, '(10I8)')
  4199.  
  4200.    ■  A variable name, an array-element name, «a structure-element name,» or
  4201.       a character-substring name
  4202.  
  4203.       These elements specify that the variable, array element, «structure
  4204.       element,» or character substring should be input or output.
  4205.  
  4206.       C     A variable and array element in iolist:
  4207.             READ (*, 500) n, bahb(n)
  4208.  
  4209.    ■  An array name
  4210.  
  4211.       An unsubscripted array name specifies in column-major order all the
  4212.       elements of the array. See the DIMENSION  entry in Section 4.2,
  4213.       "Statement Directory," for an explanation of how arrays are arranged in
  4214.       memory.
  4215.  
  4216.       C     An array in the iolist:
  4217.             INTEGER  handle(5)
  4218.             DATA  handle / 5*0 /
  4219.             WRITE (*, 99) handle
  4220.       99    FORMAT (1X, 5I5)
  4221.  
  4222.    ■  Any expression
  4223.  
  4224.       Output lists in WRITE and PRINT statements can contain arbitrary
  4225.       expressions, either numeric, logical, or character.
  4226.  
  4227.    ■  An implied-DO list
  4228.  
  4229.       Implied-DO lists have the following form:
  4230.  
  4231.       (iolist, dovar = start, stop «, inc»)
  4232.  
  4233.       Here, iolist is an input/output list (which can contain any of the
  4234.       items in this list, including another implied-DO list). The other
  4235.       variables are as described for implied-DO lists in the DATA entry in
  4236.       Section 4.2, "Statement Directory."
  4237.  
  4238.       An implied-DO list is analogous to an ordinary DO loop. The start,
  4239.       stop, and inc parameters determine the number of iterations, and dovar
  4240.       (where appropriate) can be used as an array element specifier.
  4241.  
  4242.       In a READ statement, the DO variable dovar (or other variables
  4243.       associated with dovar) must not appear in the iolist in the implied-DO
  4244.       list. The variable dovar can, however, be read in the same READ
  4245.       statement before the implied-DO list.
  4246.  
  4247.       C     Input and output with an implied-do list in iolist:
  4248.             INTEGER c, handle(10), n
  4249.             WRITE  (*, *) ' Enter c
  4250.       (<=10) and'
  4251.             WRITE  (*, *) ' handle(1)
  4252.       to handle(c)'
  4253.             READ   (*, 66) c,
  4254.       (handle(n), n = 1, c)
  4255.       66    FORMAT (I5, 10(:, /, I5))
  4256.             WRITE  (*, 99) c,
  4257.       (handle(n), n = 1, c)
  4258.       99    FORMAT (1X, 2I5)
  4259.             END
  4260.  
  4261.  
  4262.  3.2.11  «File Sharing (MODE=, SHARE=)»
  4263.  
  4264.  «In systems that use networking or allow multitasking, more than one program
  4265.  can attempt to access the same file at the same time. Two options (MODE= and
  4266.  SHARE=) in the OPEN statement control file access. These options are also
  4267.  available in the INQUIRE statement so you can determine the access status of
  4268.  a file.»
  4269.  
  4270.  «Option                                    Specification»
  4271.  
  4272.  «MODE=mode»                                «How the first process to open a
  4273.                                             file can use that file.»
  4274.  
  4275.                                             «The file can be opened for
  4276.                                             reading ('READ'), writing
  4277.                                             ('WRITE'), or both
  4278.                                             ('READWRITE').»
  4279.  
  4280.  «SHARE=share»                              «How subsequent processes are
  4281.                                             allowed to access the file (while
  4282.                                             that file is still open).»
  4283.  
  4284.                                             «Subsequent processes can be
  4285.                                             allowed to read ('DENYWR'), to
  4286.                                             write ('DENYRD'), to both read
  4287.                                             and write ('DENYNONE'), or to
  4288.                                             neither read nor write
  4289.                                             ('DENYRW'). In addition, all
  4290.                                             processes (except the process
  4291.                                             that originally opened the file)
  4292.                                             can be prohibited from opening
  4293.                                             the file ('COMPAT').»
  4294.  
  4295.  «Table 3.4, below, indicates the restrictions on opening a file that has
  4296.  already been opened with a particular value of mode and share.»
  4297.  
  4298.  «Table 3.4  Mode and Share Values»
  4299.  
  4300.  «Original           Original          Concurrent           Concurrent
  4301.  Process             Process           Processes Can        Processes Can
  4302.  Opened with         Opened with       Be Opened with       Be Opened with
  4303.  MODE=               SHARE=            MODE=                SHARE=»
  4304.  
  4305.  «'READWRITE' or     «'COMPAT'»        «'READWRITE'         «'COMPAT' by
  4306.  'READ' or 'WRITE'»                    'READ' or            original process
  4307.                                        'WRITE'»             only»
  4308.  
  4309.  «'READWRITE' or     «'DENYRW'»         «Cannot be opened
  4310.  'READ' or 'WRITE'                      concurrently»
  4311.  »
  4312.  «'READWRITE'        'DENYWR'          'READ'               'DENYNONE'»
  4313.  
  4314.  «'READ'»            «'DENYWR'»        «'READ'»             «'DENYNONE' or
  4315.                                                             'DENYWR'»
  4316.  
  4317.  «'WRITE'»           «'DENYWR'»        «'READ'»             «'DENYNONE' or
  4318.                                                             'DENYRD'»
  4319.  «'READWRITE'        'DENYRD'          'WRITE'              'DENYNONE'»
  4320.  
  4321.  «'READ'»            «'DENYRD'»        «'WRITE'»            «'DENYNONE' or
  4322.                                                             'DENYWR'»
  4323.  
  4324.  «'WRITE'»           «'DENYRD'»        «'WRITE'»            «'DENYNONE' or
  4325.                                                             'DENYRD'»
  4326.  
  4327.  «'READWRITE'»       «'DENYNONE'»      «'READWRITE'         «'DENYNONE'»
  4328.                                        or 'READ' or
  4329.                                        'WRITE'»
  4330.  
  4331.  «'READ'»            «'DENYNONE'»      «'READWRITE'         «'DENYNONE' or
  4332.                                        or 'READ' or         'DENYWR'»
  4333.                                        'WRITE'»
  4334.  
  4335.  «'WRITE'»           «'DENYNONE'»      «'READWRITE'         «'DENYNONE' or
  4336.                                        or 'READ' or         'DENYRD'»
  4337.                                        'WRITE'»
  4338.  
  4339.  «If, for example, a file is opened with MODE='READ' and SHARE='DENYRD', that
  4340.  file can also be opened with MODE='WRITE' and SHARE='DENYNONE' or
  4341.  SHARE='DENYWR'.»
  4342.  
  4343.  «Suppose, for example, you want several processes to read a file and you
  4344.  want to ensure that no process updates the file while those processes are
  4345.  reading it. First, determine what type of access to the file you want to
  4346.  allow the original process. In the example above, you want the original
  4347.  process to read the file only. Therefore, the original process should open
  4348.  the file with MODE='READ'. Next, determine what type of access the original
  4349.  process should allow other processes: in this case, other processes should
  4350.  only be able to read the file. The first process should open the file with
  4351.  SHARE='DENYWR'. Now, as indicated in Table 3.4, other processes can also
  4352.  open the same file with MODE='READ' and SHARE='DENYWR'.»
  4353.  
  4354.  
  4355.  3.2.12  Record Number (REC=)
  4356.  
  4357.  The REC=recnum option specifies a record number. «In the LOCKING statement,
  4358.  recnum specifies the first record to be locked or unlocked.» In the READ and
  4359.  WRITE statements, recnum specifies the first record to be read or written.
  4360.  The first record in a file is record number 1.
  4361.  
  4362.  
  4363.  3.3  Choosing File Types
  4364.  
  4365.  The available file properties can be combined to create many kinds of files.
  4366.  Two common file types are listed below:
  4367.  
  4368.    1. Sequential, formatted files associated with the asterisk (*) unit
  4369.       (which represents the keyboard and screen).
  4370.  
  4371.       When reading from the asterisk unit (the keyboard), lines must be
  4372.       terminated by pressing ENTER. To correct typing mistakes, follow the
  4373.       conventions of your operating system.
  4374.  
  4375.    2. A named, sequential, formatted external file.
  4376.  
  4377.  
  4378.  Example
  4379.  
  4380.  The following example uses the two types of files described above:
  4381.  
  4382.       C     Copy a file with three columns of integers, each 7
  4383.       C     columns wide, from a file whose name is entered by
  4384.       C     the user, to another file named OUT.TXT, reversing
  4385.       C     the positions of the first and second columns.
  4386.  
  4387.             PROGRAM  ColSwp
  4388.             CHARACTER*64  fname
  4389.  
  4390.       C     prompt for and read the file name:
  4391.             WRITE  (*, 900)
  4392.       900   FORMAT (' enter FILE NAME - ' \)
  4393.             READ   (*, '(A)') fname
  4394.  
  4395.       C     use unit 3 for input from external file:
  4396.             OPEN   (3, FILE = fname)
  4397.  
  4398.       C     use unit 4 for output to second external file:
  4399.             OPEN   (4, FILE = 'OUT.TXT')
  4400.  
  4401.       C     read and write until end of file:
  4402.       100   READ   (3, 920, END = 200) i, j, k
  4403.             WRITE  (4, 920) j, i, k
  4404.       920   FORMAT (3I7)
  4405.             GOTO 100
  4406.       200   WRITE  (*, '(A)') 'Done'
  4407.             END
  4408.  
  4409.  The file type you choose depends on your application. The following is a
  4410.  list of situations when file types other than formatted/sequential are used:
  4411.  
  4412.  Situation                                  File-Type Consideration
  4413.  
  4414.  You need random access I/O                 Use direct-access files. A common
  4415.                                             example of this type of
  4416.                                             application is a data base. The
  4417.                                             form can be «binary,» formatted,
  4418.                                             or unformatted.
  4419.  
  4420.  Your data is accessed only by              Accessing «binary and»
  4421.  Microsoft FORTRAN, and speed is            unformatted files is faster than
  4422.  important                                  accessing formatted files.
  4423.  
  4424.  Data must be transferred without           «Binary or» unformatted I/O is
  4425.  any system interpretation                  most practical.
  4426.  
  4427.  All 256 possible byte values               «Binary or» unformatted I/O is
  4428.  (ASCII 0-255) are to be                    necessary.
  4429.  transferred
  4430.  
  4431.  You are controlling a device with          «Binary or» unformatted I/O is
  4432.  a one-byte (binary) interface              necessary. In this situation,
  4433.                                             formatted I/O would interpret
  4434.                                             certain characters (such as the
  4435.                                             ASCII representation for
  4436.                                             carriage-return/line-feed)
  4437.                                             instead of passing them through
  4438.                                             to the program unaltered. «The
  4439.                                             binary format is preferable,
  4440.                                             since the file contains no
  4441.                                             record-structure information.»
  4442.  
  4443.  Data must be transferred without           «Binary format is recommended.
  4444.  any system interpretation, and             Unformatted files are blocked
  4445.  will be read by non-FORTRAN                internally, so the non-FORTRAN
  4446.  programs                                   program must be compatible with
  4447.                                             this format to interpret the data
  4448.                                             correctly. Binary files contain
  4449.                                             only the data written to them.»
  4450.  
  4451.  You are reading a file that was            «Binary I/O is recommended.
  4452.  not created by a Microsoft                 Non-FORTRAN files usually have a
  4453.  FORTRAN program                            different structure than FORTRAN
  4454.                                             files. Opening a file as
  4455.                                             FORM=BINARY and ACCESS=DIRECT
  4456.                                             with RECL=1 lets you move to any
  4457.                                             position and read an arbitrary
  4458.                                             sequence of values. Incomplete
  4459.                                             records don't cause undefined
  4460.                                             values because the record size is
  4461.                                             1.»
  4462.  
  4463.  
  4464.  3.4  File Position
  4465.  
  4466.  Opening a sequential file positions the file at its beginning «(unless the
  4467.  file was opened with ACCESS = 'APPEND')». If you write to the file, all
  4468.  records after the current record are discarded. The file position after
  4469.  sequential WRITE statements is at, but not beyond, the end-of-file record.
  4470.  
  4471.  Executing the ENDFILE statement inserts an end-of-file marker at the file's
  4472.  current position, then positions the file after the end-of-file marker. A
  4473.  BACKSPACE statement must be executed to position the file in front of the
  4474.  end-of-file marker. Any data past this position is lost.
  4475.  
  4476.  Executing a READ statement at the end of the file positions the file beyond
  4477.  the end-of-file record and produces an error unless you have specified the
  4478.  END=, ERR=, or IOSTAT= option in a READ statement.
  4479.  
  4480.  
  4481.  3.5  Internal Files
  4482.  
  4483.  An external file is a physical device, such as a printer or a screen, or is
  4484.  a file that is known to the operating system. An internal file is a
  4485.  character variable, character array, character array element, «character
  4486.  structure element,» character substring«, or noncharacter array».
  4487.  
  4488.  There are two basic types of internal files:
  4489.  
  4490.  Type                                       Properties
  4491.  
  4492.  Character variable, character              The file has exactly one record,
  4493.  array element, «character                  which is the same length as the
  4494.  structure element,» character              variable, array element,
  4495.  substring, «or noncharacter                substring«, or noncharacter
  4496.  array»                                     array. Noncharacter arrays are
  4497.                                             allowed for compatibility with
  4498.                                             older versions of FORTRAN.»
  4499.  
  4500.  Character array                            The file is a sequence of
  4501.                                             character array elements, each of
  4502.                                             which is a record. The order of
  4503.                                             records is the same as the order
  4504.                                             of array elements. All records
  4505.                                             are the same length: the length
  4506.                                             of array elements.
  4507.  
  4508.  You must follow these rules when using internal files:
  4509.  
  4510.    1. Use only formatted, sequential I/O.
  4511.  
  4512.    2. Use only the READ and WRITE statements.
  4513.  
  4514.    3. Don't use list-directed formatting.
  4515.  
  4516.  Before an I/O statement is executed, internal files are positioned at the
  4517.  beginning of the file. With internal files, you can use the formatting
  4518.  capabilities of the I/O system to convert values between external character
  4519.  representations and FORTRAN internal memory representations. That is,
  4520.  reading from an internal file converts the ASCII values into numeric,
  4521.  logical, or character values, and writing to an internal file converts
  4522.  values into their ASCII representations.
  4523.  
  4524.  If less than an entire record is written to an internal file, the rest of
  4525.  the record is filled with blanks.
  4526.  
  4527.  ───────────────────────────────────────────────────────────────────────────
  4528.  NOTE
  4529.     The FORTRAN 66 DECODE statement has been replaced by the internal READ
  4530.     function. The ENCODE statement has been replaced by the internal WRITE
  4531.     function.
  4532.  ───────────────────────────────────────────────────────────────────────────
  4533.  
  4534.  
  4535.  Example
  4536.  
  4537.  The following example prompts for a 3-digit file identification and uses an
  4538.  internal file to create a file name:
  4539.  
  4540.             CHARACTER fname*64
  4541.             fname = 'FILE   .DAT'
  4542.             WRITE (*, *) 'Enter 1-3 digit file identifier'
  4543.             READ  (*, *) id
  4544.             WRITE (fname(5:7), '(I3.3)') id
  4545.             OPEN  (1, FILE = fname, STATUS = 'NEW')
  4546.             .
  4547.             .
  4548.             .
  4549.             END
  4550.  
  4551.  
  4552.  3.6  Carriage Control
  4553.  
  4554.  When formatted I/O is used to transfer a record to a terminal device, such
  4555.  as the screen or a printer, the first character of that record is
  4556.  interpreted as a carriage-control character, and is not printed. The
  4557.  characters 0, 1, +, and the blank character, have the effects indicated in
  4558.  Table 3.5 below. Any other character is treated like the blank character. If
  4559.  the first character of your record does not print, make sure it is not being
  4560.  interpreted as the carriage-control character. In the following program
  4561.  fragment, for example, the number 2  is interpreted as a carriage-control
  4562.  character, and is treated like the space character:
  4563.  
  4564.             WRITE  (*, 100)
  4565.       100   FORMAT ('25 years')
  4566.  
  4567.  The example above produces the following output:
  4568.  
  4569.       5 years
  4570.  
  4571.  In list-directed I/O, the first character is not treated as a
  4572.  carriage-control character. In the following example of unformatted I/O, the
  4573.  full string is displayed:
  4574.  
  4575.             WRITE (*, *) '25 years'
  4576.  
  4577.  The following output is produced:
  4578.  
  4579.       25 years
  4580.  
  4581.  The effects of the characters 0, 1, +, and the blank character are listed in
  4582.  Table 3.5.
  4583.  
  4584.  Table 3.5  Carriage-Control Characters
  4585.  
  4586.  Character         Effect
  4587.  
  4588.  Blank             Advances one line.
  4589.  
  4590.  0                 Advances two lines.
  4591.  
  4592.  1                 Advances to top of next page. The screen behaves as if
  4593.                    this carriage-control character were ignored.
  4594.  
  4595.  +                 Does not advance. Permits overprinting.
  4596.  
  4597.  When writing to the screen or printer, the end-of-record mark (a
  4598.  carriage-return and line-feed sequence) is normally not sent until the next
  4599.  record is written. However, if a write to the screen is followed by a read
  4600.  from the keyboard, a new-line character is automatically emitted and the
  4601.  input line is positioned below the output line.
  4602.  
  4603.  «To suppress the new-line character and display the user's input on the same
  4604.  line as the previous output, add the backslash (\) edit descriptor at the
  4605.  end of the WRITE statement's edit list. The input then appears at the end of
  4606.  the last line written.» Since input lines are always terminated by the user
  4607.  with a new-line character, the next write operation always begins on a new
  4608.  line. Therefore, if the next operation to the console is a write operation,
  4609.  carriage control is adjusted to write one less end-of-record mark.
  4610.  
  4611.  Note that the plus (+) carriage-control character has no effect if the
  4612.  previous console operation was a read operation.
  4613.  
  4614.  
  4615.  3.7  Formatted I/O
  4616.  
  4617.  If a READ or WRITE statement includes a format specifier (other than an
  4618.  asterisk), the I/O statement is called a formatted I/O statement. The
  4619.  remainder of this section discusses the elements of format specifiers and
  4620.  the interaction between format specifiers and the I/O list. See Section
  4621.  3.2.7 for information on format specifiers.
  4622.  
  4623.  
  4624.  3.7.1  Nonrepeatable Edit Descriptors
  4625.  
  4626.  Table 3.6 summarizes the nonrepeatable edit descriptors. A discussion of
  4627.  edit descriptors follows.
  4628.  
  4629.  Table 3.6  Nonrepeatable Edit Descriptors
  4630.  
  4631.                                                      Used for  Used for
  4632.  Form       Name            Use                      Input     Output
  4633.  
  4634.  string     Apostrophe      Transmits string to      No        Yes
  4635.             editing         output unit
  4636.  
  4637.  nH         Hollerith       Transmits next n         No        Yes
  4638.             editing         characters to output
  4639.                             unit
  4640.  
  4641.  Tc, TLc,   Positional      Specifies position in    Yes       Yes
  4642.  TRc        editing         record
  4643.  
  4644.  nX         Positional      Specifies position in    Yes       Yes
  4645.             editing         record
  4646.  
  4647.  SP, SS, S  Optional-plus   Controls output of       No        Yes
  4648.             editing         plus signs
  4649.  
  4650.  /          Slash editing   Positions to next        Yes       Yes
  4651.                             record or writes
  4652.                             end-of-record mark
  4653.  
  4654.  «\»        «Backslash      «Continues same record»  «No»      «Yes (to
  4655.             editing»                                           terminal and
  4656.                                                                printer only)»
  4657.  
  4658.  :          Format          If no more items in      No        Yes
  4659.             control         iolist, terminates
  4660.             termination     statement
  4661.  
  4662.  kP         Scale-factor    Sets scale for           Yes       Yes
  4663.             editing         exponents in
  4664.                             subsequent F and E
  4665.                             (repeatable) edit
  4666.                             descriptors
  4667.  
  4668.  BN, BZ     Blank           Specifies                Yes       No
  4669.             interpretation  interpretation of
  4670.                             blanks in numeric
  4671.                             fields
  4672.  
  4673.  Sections 3.7.1.1-3.7.1.10 describe each nonrepeatable edit descriptor.
  4674.  
  4675.  
  4676.  3.7.1.1  Apostrophe Editing
  4677.  
  4678.  If a format specifier contains a character constant, string, that string is
  4679.  transmitted to the output unit. Embedded blanks are significant.
  4680.  
  4681.  Two adjacent apostrophes must be used to represent a single apostrophe
  4682.  within a character constant. Each additional level of nested apostrophes
  4683.  requires twice as many apostrophes as the previous level to resolve the
  4684.  ambiguity of the apostrophe's meaning. Note how in the second WRITE
  4685.  statement in the example below, the set of apostrophes that delimit the
  4686.  output string within the FORMAT statement are doubled, and four apostrophes
  4687.  are required within the output string itself to specify a single output
  4688.  apostrophe.
  4689.  
  4690.  
  4691.  Example
  4692.  
  4693.       C     These WRITE statements both output ABC'DEF
  4694.       C     (The leading blank is a carriage-control character)
  4695.             WRITE  (*, 970)
  4696.       970   FORMAT (' ABC''DEF')
  4697.             WRITE  (*, '('' ABC''''DEF'')')
  4698.       C     The following WRITE also outputs ABC'DEF. No carriage-
  4699.       C     control character is necessary for list-directed I/O
  4700.             WRITE (*, *) 'ABC''DEF'
  4701.  
  4702.  Apostrophe editing cannot be used with READ statements.
  4703.  
  4704.  
  4705.  3.7.1.2  Hollerith Editing (H)
  4706.  
  4707.  The nH edit descriptor transmits the next n characters, including blanks, to
  4708.  the output unit. Hollerith editing can be used in every context where
  4709.  character constants can be used.
  4710.  
  4711.  The n characters transmitted are called a "Hollerith constant."
  4712.  
  4713.  
  4714.  Example
  4715.  
  4716.       C     These WRITE statements both output ABC'DEF
  4717.       C     (The leading blank is a carriage-control character)
  4718.             WRITE (*, '(8H ABC''DEF)')
  4719.             WRITE (*, 960)
  4720.       960   FORMAT (8H ABC'DEF)
  4721.  
  4722.  
  4723.  3.7.1.3  Positional Editing: Tab, Tab Left, Tab Right (T, TL, TR)
  4724.  
  4725.  The T, TL, and TR edit descriptors specify the position in the record to
  4726.  which or from which the next character will be transmitted. The new position
  4727.  may be in either direction from the current position. This allows a record
  4728.  to be processed more than once on input. Note that moving the position
  4729.  backward more than 512 bytes (characters) is not recommended.
  4730.  
  4731.  The Tc edit descriptor specifies absolute tabbing; the transmission of the
  4732.  next character is to occur at the character position c. The TRc edit
  4733.  descriptor specifies relative tabbing to the right; the transmission of the
  4734.  next character is to occur c characters beyond the current position. The TLc
  4735.  edit descriptor specifies relative tabbing to the left; the transmission of
  4736.  the next character is to occur c characters prior to the current position.
  4737.  
  4738.  If TLc specifies a position before the first position of the current record,
  4739.  TLc editing causes transmission to or from position 1.
  4740.  
  4741.  Left tabbing is legal within records written to devices. However, if the
  4742.  record that is written is longer than the buffer associated with the device,
  4743.  you cannot left-tab to a position corresponding to the previous buffer.
  4744.  
  4745.  For example, the buffer associated with the console is 132 bytes. If a
  4746.  record of 140 bytes is written to the console, left tabbing is allowed for
  4747.  only eight bytes, since the first 132 bytes of the record have been sent to
  4748.  the device and are no longer accessible.
  4749.  
  4750.  If one of these edit descriptors is used to move to a position to the right
  4751.  of the last data item transmitted and another data item is then written, the
  4752.  space between the previous end of data in the record and the new position is
  4753.  filled with spaces. For example, consider the following:
  4754.  
  4755.             WRITE (*, '('' '', 3(''1234567890''))')
  4756.             WRITE (*, 100) 5, 9
  4757.         100 FORMAT (I5, 20X, TL10, I5)
  4758.  
  4759.  This example produces the following output:
  4760.  
  4761.       123456789012345678901234567890
  4762.           5              9
  4763.  
  4764.  «Be careful when using these edit descriptors if you read data from files
  4765.  that use commas as field delimiters. If you move backwards in a record using
  4766.  TLc or Tc (where c is less than the current position in the record), commas
  4767.  are disabled as field delimiters. If the format controller encounters a
  4768.  comma after you have moved backward in a record with TLc or Tc, a run-time
  4769.  error occurs. If you want to move backward in a record without disabling
  4770.  commas as field delimiters, advance to the end-of-record mark, then use the
  4771.  BACKSPACE statement to move to the beginning of the record.»
  4772.  
  4773.  
  4774.  3.7.1.4  Positional Editing (X)
  4775.  
  4776.  The nX edit descriptor advances the file position n characters. On output,
  4777.  if the nX edit descriptor moves past the end of data in the record, and if
  4778.  there are further items in the iolist, blanks are output, as described for
  4779.  the Tc and TRc edit descriptors.
  4780.  
  4781.  
  4782.  Example
  4783.  
  4784.       C     This writes 1   5   10   15 on the screen:
  4785.             WRITE  (*, 100)
  4786.       100   FORMAT (1X, '1', 3X, '5', 3X, '10', 3X, '15')
  4787.  
  4788.       C     This writes "zogoZOGozogo     !" on the screen:
  4789.             WRITE  (*, 200)
  4790.       200   FORMAT (1X, 'zogozogozogo', TL8, 'ZOG', 10X, '!')
  4791.  
  4792.  
  4793.  3.7.1.5  Optional-Plus Editing (SP, SS, S)
  4794.  
  4795.  The SP, SS, and S edit descriptors control optional-plus characters in
  4796.  numeric output fields. SP causes output of the plus sign in all subsequent
  4797.  positions that the processor recognizes as optional-plus fields. SS causes
  4798.  plus-sign suppression in all subsequent positions that the processor
  4799.  recognizes as optional-plus fields. S restores SS, the default.
  4800.  
  4801.  
  4802.  Example
  4803.  
  4804.       C     The following statements write: 251 +251  251 +251
  4805.       C     251
  4806.             INTEGER i
  4807.             i = 251
  4808.             WRITE  (*, 100) i, i, i, i, i
  4809.       100   FORMAT (1X, I5, SP, I5, SS, I5, SP, I5, S, I5)
  4810.  
  4811.       C     The following statements write:
  4812.       C     .673E+4+.673E+4 .673E+4+.673E+4 .673E+4
  4813.             REAL r
  4814.             r = 67.3E2
  4815.             WRITE  (*, 200) r, r, r, r, r
  4816.       200   FORMAT (1X, E8.3E1, SP, E8.3E1, SS, E8.3E1, SP,
  4817.            +            E8.3E1, S,  E8.3E1)
  4818.  
  4819.  
  4820.  3.7.1.6  Slash Editing (/)
  4821.  
  4822.  The slash indicates the end of data transfer on the current record. On
  4823.  input, the file is positioned to the beginning of the next record. On
  4824.  output, an end-of-record mark is written, and the file is positioned to
  4825.  write at the beginning of the next record.
  4826.  
  4827.  
  4828.  Example
  4829.  
  4830.       C     The following statements write a column and a row:
  4831.             WRITE  (*, 100)
  4832.       100   FORMAT (' c row', /, ' o', /, ' l', /, ' u',
  4833.            +                  /, ' m', /, ' n')
  4834.  
  4835.  The output from this example is shown below:
  4836.  
  4837.       c row
  4838.       o
  4839.       l
  4840.       u
  4841.       m
  4842.       n
  4843.  
  4844.  
  4845.  3.7.1.7  «Backslash Editing (\)»
  4846.  
  4847.  «The backslash edit descriptor is used only for formatted output to terminal
  4848.  devices, such as the screen or a printer. It is ignored in all other
  4849.  situations.»
  4850.  
  4851.  «When the format controller terminates a transmission to the terminal, it
  4852.  writes an end-of-record mark (a carriage-return and line-feed sequence). If
  4853.  the last edit descriptor encountered by the format controller is a backslash
  4854.  (\), no end-of-record mark is written, so the next I/O statement will
  4855.  continue writing on the same line.»
  4856.  
  4857.  «This mechanism can be used to write a prompt to the screen and then read a
  4858.  response from the same line, as in the following example:»
  4859.  
  4860.             «WRITE (*, '(A \)') 'enter an integer --> '
  4861.             READ  (*, '(BN, I6)') j»
  4862.  
  4863.  
  4864.  3.7.1.8  Terminating Format Control (:)
  4865.  
  4866.  The colon (:) edit descriptor terminates format control if there are no more
  4867.  items in the iolist. This feature is used to suppress output when some of
  4868.  the edit descriptors in the format do not have corresponding data in the
  4869.  iolist.
  4870.  
  4871.  
  4872.  Example
  4873.  
  4874.       C     The following example writes a= 3.20 b=  .99
  4875.             REAL  a, b, c, d
  4876.             DATA  a /3.2/, b /.9871515/
  4877.             WRITE  (*, 100) a, b
  4878.       100   FORMAT (' a=', F5.2, :, ' b=', F5.2, :,
  4879.            +        ' c=', F5.2, :, ' d=', F5.2)
  4880.             END
  4881.  
  4882.  
  4883.  3.7.1.9  Scale-Factor Editing (P)
  4884.  
  4885.  The kP edit descriptor sets the scale factor for all subsequent F and E edit
  4886.  descriptors (for information on F and E, see Section 3.7.2, "Repeatable Edit
  4887.  Descriptors") until another kP edit descriptor is encountered. At the start
  4888.  of each I/O statement, the scale factor is initialized to zero. The scale
  4889.  factor affects format editing in the following ways:
  4890.  
  4891.    ■  On input, with F and E editing, if there is no explicit exponent, the
  4892.       value read in is divided by 10^(k) before it is assigned to a variable.
  4893.       If there is an explicit exponent, the scale factor has no effect.
  4894.  
  4895.    ■  On output, with F editing, the value to be written out is multiplied by
  4896.       10^(k) before it is displayed.
  4897.  
  4898.    ■  On output, with E editing, the real part of the value to be displayed
  4899.       is multiplied by 10^(k), and its exponent is reduced by k. This alters
  4900.       the column position of the decimal point but not the value of the
  4901.       number.
  4902.  
  4903.  
  4904.  Examples
  4905.  
  4906.  The following fragment uses scale-factor editing when reading:
  4907.  
  4908.             READ (*, 100) a, b, c, d
  4909.        100  FORMAT (F10.6, 1P, F10.6, F10.6, -2P, F10.6)
  4910.  
  4911.             WRITE  (*, 200) a, b, c, d
  4912.        200  FORMAT (4F11.3)
  4913.  
  4914.  Assume the following data is entered:
  4915.  
  4916.       12340000  12340000  12340000  12340000
  4917.          12.34     12.34     12.34     12.34
  4918.        12.34e0   12.34e0   12.34e0   12.34e0
  4919.        12.34e3   12.34e3   12.34e3   12.34e3
  4920.  
  4921.  The program outputs the following:
  4922.  
  4923.           12.340      1.234      1.234   1234.000
  4924.           12.340      1.234      1.234   1234.000
  4925.           12.340     12.340     12.340     12.340
  4926.        12340.000  12340.000  12340.000  12340.000
  4927.  
  4928.  The following example uses scale-factor editing when writing:
  4929.  
  4930.             a = 12.34
  4931.  
  4932.             WRITE  (*, 100) a, a, a, a, a, a
  4933.       100   FORMAT (1X, F9.4, E11.4E2, 1P, F9.4, E11.4E2,
  4934.            +           -2P, F9.4, E11.4E2)
  4935.  
  4936.  This program outputs the following:
  4937.  
  4938.       12.3400  .1234E+02 123.4000 1.2340E+01    .1234  .0012E+04
  4939.  
  4940.  
  4941.  3.7.1.10  Blank Interpretation (BN, BZ)
  4942.  
  4943.  The edit descriptors BN and BZ control the interpretation of blanks in
  4944.  numeric input fields.
  4945.  
  4946.  The BN edit descriptor ignores blanks; it takes all the nonblank characters
  4947.  in the field and right-justifies them. For example, if an input field
  4948.  formatted for six integers contains ' 23 4 ', it is interpreted as '  234'.
  4949.  
  4950.  The BZ edit descriptor makes blanks identical to zeros. Trailing blanks in
  4951.  the field become zeros. Interspersed blanks also become zeros. In the
  4952.  previous example, the input field ' 23 4 ' would be interpreted as
  4953.  ' 23040'. If ' 23 4' were entered, the formatter would add one blank to pad
  4954.  the input to the six-integer format, but this extra space would be ignored,
  4955.  and the input would be interpreted as ' 2304 '. Note that the blanks
  4956.  following the E or D in real-number input are ignored, whatever form of
  4957.  blank interpretation is in effect.
  4958.  
  4959.  The default, BN, is set at the beginning of each I/O statement, unless the
  4960.  BLANK= option was specified in the OPEN statement. If you specify a BZ edit
  4961.  descriptor, BZ editing is in effect until the BN edit descriptor is
  4962.  specified.
  4963.  
  4964.  For example, look at the following program fragment:
  4965.  
  4966.             READ (*, 100) n
  4967.       100   FORMAT (BN, I6)
  4968.  
  4969.  If you enter any one of the following three records and terminate by
  4970.  pressing ENTER, the READ statement interprets that record as the value 123:
  4971.  
  4972.          123
  4973.       123
  4974.       123   456
  4975.  
  4976.  Because the repeatable edit descriptor associated with the I/O list item n
  4977.  is I6, only the first six characters of each record are read (three blanks
  4978.  followed by 123 for the first record, and 123 followed by three blanks for
  4979.  the last two records). Because blanks are ignored, all three records are
  4980.  interpreted as  123.
  4981.  
  4982.  The following example shows the effect of BN editing with an input record
  4983.  that has fewer characters than the number of characters specified by the
  4984.  edit descriptors and iolist. Suppose you enter 502, followed by ENTER, in
  4985.  response to the following READ statement:
  4986.  
  4987.             READ (*, '(I5)') n
  4988.  
  4989.  The I/O system is looking for five characters that it will try to interpret
  4990.  as an integer number. You have only entered three, so the first thing the
  4991.  I/O system does is to pad the record 502 on the right with two blanks. If BZ
  4992.  editing were in effect, those two blanks would be interpreted as zeros, and
  4993.  the record would be equal to 50200. However, with BN editing in effect (the
  4994.  default), the nonblank characters (502) are right-justified, so the record
  4995.  is equal to 502.
  4996.  
  4997.  
  4998.  3.7.2  Repeatable Edit Descriptors
  4999.  
  5000.  The I (integer), «Z (hexadecimal),» F (single-precision real), E (real with
  5001.  exponent), G (real with optional exponent), and D (double-precision real)
  5002.  edit descriptors are used for I/O of numeric data. The following rules apply
  5003.  to all of these numeric edit descriptors:
  5004.  
  5005.    ■  On input, fields that are all blanks are always interpreted as zero.
  5006.       The interpretation of trailing and interspersed blanks is controlled by
  5007.       the BN and BZ editing descriptors. Plus signs are optional. «The blanks
  5008.       supplied by the file system to pad a record to the required size are
  5009.       not significant.»
  5010.  
  5011.    ■  On input with F, E, G, and D editing, an explicit decimal point in the
  5012.       input field overrides any edit-descriptor specification of the
  5013.       decimal-point position.
  5014.  
  5015.    ■  On output, the characters generated are right-justified in the field
  5016.       and padded by leading blanks, if necessary.
  5017.  
  5018.    ■  On output, if the number of characters produced exceeds the field width
  5019.       or if the exponent exceeds its specified width, the entire field is
  5020.       filled with asterisks. If a real number contains more digits after the
  5021.       decimal point than are allowed in the field, the number is rounded.
  5022.  
  5023.    ■  «When reading with I, Z, F, E, G, D, or L edit descriptors, the input
  5024.       field may contain a comma that terminates the field. The next field
  5025.       starts at the character following the comma. The missing characters are
  5026.       not significant. For example, consider the following READ statement:»
  5027.  
  5028.           «READ (*, '(BZ 3I5)') i, j, k»
  5029.  
  5030.       «Entering the following data results in i = 1, j = 20, and k = 3:»
  5031.  
  5032.           «1, 2 ,  3,»
  5033.  
  5034.       «Do not use this feature when you use explicit positional editing (the
  5035.       T, TL, TR, or nX edit descriptors).»
  5036.  
  5037.    ■  Two successively interpreted edit descriptors of the types F, E, G, and
  5038.       D are required to format complex numbers. Two different descriptors may
  5039.       be used. The first edit descriptor specifies the real part of the
  5040.       complex number, and the second specifies the imaginary part.
  5041.  
  5042.    ■  Nonrepeatable edit descriptors may appear between repeatable edit
  5043.       descriptors.
  5044.  
  5045.  The following sections describe each repeatable edit descriptor.
  5046.  
  5047.  
  5048.  3.7.2.1  Integer Editing (I)
  5049.  
  5050.  
  5051.  Syntax
  5052.  
  5053.       Iw«.m»
  5054.  
  5055.  On input, any value entered that is associated with an I edit descriptor
  5056.  must have the form of an integer (it may not contain a decimal point or
  5057.  exponent), or a run-time error occurs. On output, the I/O list item
  5058.  associated with an I edit descriptor must have an integer value, or a
  5059.  run-time error occurs.
  5060.  
  5061.  The field is w characters wide. On input, an optional sign may appear in the
  5062.  field. If the optional unsigned integer m is specified, input is the same as
  5063.  Iw, but output is padded with leading zeros up to width m. For example,
  5064.  consider this statement:
  5065.  
  5066.             WRITE (*, '(1X, I5, I5.3)') 7, 7
  5067.  
  5068.  The following output is produced:
  5069.  
  5070.       7  007
  5071.  
  5072.  
  5073.  3.7.2.2  «Hexadecimal Editing (Z)»
  5074.  
  5075.  
  5076.  «Syntax»
  5077.  
  5078.       «Z«w»»
  5079.  
  5080.  «Hexadecimal editing converts between external data in hexadecimal form (the
  5081.  hexadecimal digits 0 through 9 and A through F) and internal four-bit binary
  5082.  data (0000 through 1111). Each byte of internal data corresponds to two
  5083.  four-bit hexadecimal characters. For example, the ASCII character "m," which
  5084.  is 01101101 in binary, is output as the hexadecimal characters 6D.
  5085.  Similarly, an INTEGER*4 value is output in its eight-hexadecimal-character
  5086.  form.»
  5087.  
  5088.  «The optional field width, w, specifies the number of hexadecimal characters
  5089.  to be read or written. If w is omitted, the field width defaults to 2*n,
  5090.  where n is the length of the iolist item in bytes. For example, an INTEGER*2
  5091.  value is represented by four hexadecimal characters.»
  5092.  
  5093.  «On output, character data types are written in the same order they appear
  5094.  in memory. For numeric and logical types, bytes are output in order of
  5095.  significance,  from the most significant on the left to the least
  5096.  significant on the right. The INTEGER*2 value 10, for example, will be
  5097.  output as 000A, although the order of bytes in memory on an 8086-based
  5098.  machine is actually 0A00.»
  5099.  
  5100.  «The following rules of truncation and padding apply. The value n is the
  5101.  length of the iolist item in bytes:»
  5102.  
  5103.  «Operation     Rule»
  5104.  
  5105.  «Output»       «If w > 2*n, the 2*n hexadecimal characters are right-
  5106.                 justified and leading zeros are added to make the external
  5107.                 field width equal to w.»
  5108.  
  5109.                 «If w <= 2*n, the w rightmost hexadecimal characters are
  5110.                 output.»
  5111.  
  5112.  «Input»        «If w >= 2*n, the rightmost 2*n hexadecimal characters are
  5113.                 taken from the input field.»
  5114.  
  5115.                 «If w < 2*n, the first w hexadecimal characters are read
  5116.                 from the external field. Enough leading zeros are added to
  5117.                 make the width equal to 2*n.»
  5118.  
  5119.  «Blanks in an input field are treated as zeros.»
  5120.  
  5121.  «Hexadecimal editing differs from conventional decimal editing in two
  5122.  significant ways. If there are more hex characters to be output than the
  5123.  field width can accommodate, the field is not filled with asterisks.
  5124.  Instead, w right-hand characters are displayed.»
  5125.  
  5126.  «The left-hand padding of short input fields does not take into account the
  5127.  sign bit of the entered value. For example, in a 8-character input field
  5128.  where only FFFF is entered, the entry is interpreted as 65,535, not -1.»
  5129.  
  5130.  «To edit complex numbers, two Z edit descriptors must be used. The first
  5131.  edit descriptor specifies the real part of the complex number, and the
  5132.  second specifies the imaginary part.»
  5133.  
  5134.  
  5135.  «Examples»
  5136.  
  5137.  «The following example demonstrates hexadecimal editing for output:»
  5138.  
  5139.             «CHARACTER*2 alpha
  5140.             INTEGER*2   num
  5141.  
  5142.             alpha = 'YZ'
  5143.             num   =  4096
  5144.  
  5145.             WRITE (*, '(1X, Z, 1X, Z2, 1X, Z6)') alpha, alpha,
  5146.            +alpha
  5147.             WRITE (*, '(1X, Z, 1X, Z2, 1X, Z6)') num,   num,   num»
  5148.  
  5149.  «This example produces the following  output:»
  5150.  
  5151.       «595A 5A 00595A
  5152.       1000 00 001000»
  5153.  
  5154.  «As an example of input, suppose the input record is 595A (hexadecimal
  5155.  characters), and the iolist item has CHARACTER*2 type. The record would be
  5156.  read as follows:»
  5157.  
  5158.  «Edit Descriptor                Value Read»
  5159.  
  5160.  «Z                               YZ»
  5161.  
  5162.  «Z2                              0Y»
  5163.  
  5164.  «Z6                              YZ»
  5165.  
  5166.  
  5167.  3.7.2.3  Real Editing without Exponents (F)
  5168.  
  5169.  
  5170.  Syntax
  5171.  
  5172.       Fw.d
  5173.  
  5174.  On output, the I/O list item associated with an F edit descriptor must be a
  5175.  single- or double-precision number, or a run-time error occurs. On input,
  5176.  the number entered may have any integer or real form, as long as its value
  5177.  is within the range of the associated variable.
  5178.  
  5179.  The field is w characters wide, with a fractional part d digits wide. The
  5180.  input field begins with an optional sign followed by a string of digits that
  5181.  may contain an optional decimal point. If the decimal point is present, it
  5182.  overrides the d specified in the edit descriptor; otherwise, the rightmost d
  5183.  digits of the string are interpreted as following the decimal point (with
  5184.  leading blanks converted to zeros, if necessary). Appearing after these
  5185.  digits is an optional exponent that must be one of the following:
  5186.  
  5187.    ■  + (plus) or - (minus) followed by an integer
  5188.  
  5189.    ■  E followed by zero or more blanks, followed by an optional sign,
  5190.       followed by an integer
  5191.  
  5192.  An example is the following READ statement:
  5193.  
  5194.             READ (*, '(F8.3)') xnum
  5195.  
  5196.  The above statement reads a given input record as follows:
  5197.  
  5198.  Input                            Number Read
  5199.  
  5200.  5                                .005
  5201.  
  5202.  2468                             2.468
  5203.  
  5204.  -24680                           -24.680
  5205.  
  5206.  -246801                          -246.801
  5207.  
  5208.  56789                            5.678
  5209.  
  5210.  -28E2                            -2.800
  5211.  
  5212.  The output field occupies w characters. One character is a decimal point,
  5213.  leaving w-1 characters available for digits. If the sign is negative, it
  5214.  must be included, leaving only w-2 characters available. Out of these w-1 or
  5215.  w-2 characters, d characters will be used for digits to the right of the
  5216.  decimal point. The remaining characters will be blanks or digits, as needed,
  5217.  in order to represent the digits to the left of the decimal point.
  5218.  
  5219.  The value output is controlled both by the iolist item and the current scale
  5220.  factor. The output value is rounded rather than truncated.
  5221.  
  5222.  
  5223.  Example
  5224.  
  5225.             REAL*4 g, h, e, r, k, i, n
  5226.             DATA  g /12345.678/, h /12345678./, e /-4.56E+1/, r
  5227.            +/-365./
  5228.             WRITE  (*, 100) g, h, e, r
  5229.       100   FORMAT (1X, F8.2)
  5230.             WRITE  (*, 200) g, h, e, r
  5231.       200   FORMAT (1X, 4F10.1)
  5232.  
  5233.  
  5234.  The program above produces the following output:
  5235.  
  5236.       12345.68
  5237.       ********
  5238.         -45.60
  5239.        -365.00
  5240.          12345.712345680.0     -45.6    -365.0
  5241.  
  5242.  
  5243.  3.7.2.4  Real Editing with Exponents (E)
  5244.  
  5245.  
  5246.  Syntax
  5247.  
  5248.       Ew.d«Ee»
  5249.  
  5250.  On output, the I/O list item associated with an E edit descriptor must be a
  5251.  single- or double-precision number, or a run-time error occurs. On input,
  5252.  the number entered may have any integer or real form, as long as its value
  5253.  is within the range of the associated variable.
  5254.  
  5255.  The field is w characters wide. The e parameter is ignored in input
  5256.  statements. The input field for the E edit descriptor is identical to that
  5257.  described by an F edit descriptor with the same w and d.
  5258.  
  5259.  The form of the output field depends on the scale factor (set by the P edit
  5260.  descriptor) in effect. For a scale factor of 0, the output field is a minus
  5261.  sign (if necessary), followed by a decimal point, followed by a string of
  5262.  digits, followed by an exponent field for exponent exp, having one of the
  5263.  forms shown in Table 3.7.
  5264.  
  5265.  Table 3.7  Forms of Exponents for the E Edit Descriptor
  5266.  
  5267.                             Absolute Value
  5268.  Edit Descriptor            of Exponent                Form of Exponent
  5269.  
  5270.  Ew.d                       |exp| <= 99                E followed by plus or
  5271.                                                        minus, followed by the
  5272.                                                        two-digit exponent
  5273.  
  5274.  Ew.d                       99 < |exp| <= 999          Plus or minus,
  5275.                                                        followed by the
  5276.                                                        three-digit exponent
  5277.  
  5278.  Ew.dEe                     |exp| <= (10^(e))-1        E followed by plus or
  5279.                                                        minus, followed by e
  5280.                                                        digits, which are the
  5281.                                                        exponent (with
  5282.                                                        possible leading
  5283.                                                        zeros)
  5284.  
  5285.  The form Ew.d must not be used if the absolute value of the exponent to be
  5286.  printed exceeds 999.
  5287.  
  5288.  The scale factor controls the decimal normalization of the printed E field.
  5289.  If the scale factor k is greater than -d and less than or equal to 0, then
  5290.  the output field contains exactly k leading zeros after the decimal point
  5291.  and d + k significant digits after this. If (0<k<d+2), the output field
  5292.  contains exactly k significant digits to the left of the decimal point and
  5293.  (d-k-1) places after the decimal point. Other values of k are errors.
  5294.  
  5295.  
  5296.  3.7.2.5  Real Editing-Wide Range (G)
  5297.  
  5298.  Syntax
  5299.  
  5300.       Gw.d«Ee»
  5301.  
  5302.  On output, the I/O list item associated with a G edit descriptor must be a
  5303.  single- or double-precision number, or a run-time error occurs. On input,
  5304.  the number entered may have any integer or real form, as long as its value
  5305.  is within the range of the associated variable.
  5306.  
  5307.  For either form, the input field is w characters wide, with a fractional
  5308.  part consisting of d digits. If the scale factor is greater than 1, the
  5309.  exponent part consists of e digits.
  5310.  
  5311.  G input editing is the same as F input editing. G output editing corresponds
  5312.  to either E or F editing, depending on the magnitude of the data. Tables 3.8
  5313.  and 3.9 show how the G edit descriptor is interpreted.
  5314.  
  5315.  Table 3.8  Interpretation of G Edit Descriptor
  5316.  
  5317.  Data Magnitude                                    Interpretation
  5318.  
  5319.  m < 0.1                                           Gw.d=Ew.d
  5320.  0.1 <= m < 1                                      Gw.d=F(w-4).d,4(' ')
  5321.  1 <= m < 10 (i.e., 10^(d-d) <= m < 10^(d-(d-1))   Gw.d=F(w-4).(d-1),4(' ')
  5322.  10^(d-2) <= m < 10^(d-1)                      Gw.d=F(w-4).1,4(' ')
  5323.  10^(d-2) <= m < 10^(d)                             Gw.d=F(w-4).0,4(' ')
  5324.  10^(d) <= m                                       Gw.d=Ew.d
  5325.  
  5326.  
  5327.  Table 3.9  Interpretation of GE Edit Descriptor
  5328.  
  5329.  Data Magnitude                                    Interpretation
  5330.  
  5331.  m < 0.1                                           Gw.dEe=Ew.d
  5332.  0.1 <= m < 1                                      Gw.dEe=F(w-e-2).d,(e+2)(' '
  5333.  1 <= m < 10 (i.e., 10^(d-d) <= m < 10^(d-(d-1))   Gw.dEe=F(w-e-2).(d-1),(e+2)
  5334.  
  5335.  
  5336.  
  5337.  
  5338.  
  5339.  
  5340.  
  5341.  
  5342.  
  5343.  10^(d-2) <= m < 10^(d-1)                          Gw.dEe=F(w-e-2).1,(e+2)(' '
  5344.  10^(d-1) <= m < 10^(d)                            Gw.dEe=F(w-e-2).0,(e+2)(' '
  5345.  10^(d) <= m                                       Gw.dEe=Ew.d
  5346.  
  5347.  
  5348.  3.7.2.6  Double-Precision Real Editing (D)
  5349.  
  5350.  Syntax
  5351.  
  5352.       Dw.d
  5353.  
  5354.  On output, the I/O list item associated with a D edit descriptor must be a
  5355.  single- or double-precision number, or a run-time error occurs. On input,
  5356.  the number entered may have any integer or real form, as long as its value
  5357.  is within the range of the associated variable. All parameters and rules for
  5358.  the E descriptor apply to the D descriptor.
  5359.  
  5360.  The field is w characters wide. The input field for the D edit descriptor is
  5361.  identical to that described by an F edit descriptor with the same w and d.
  5362.  
  5363.  The form of the output field depends on the scale factor (set by the P edit
  5364.  descriptor) in effect. For a scale factor of 0, the output field is a minus
  5365.  sign (if necessary), followed by a decimal point, followed by a string of
  5366.  digits, followed by an exponent field for exponent exp, in one of the forms
  5367.  shown in Table 3.10.
  5368.  
  5369.  Table 3.10  Forms of Exponents for the D Edit Descriptor
  5370.  
  5371.                             Absolute Value
  5372.  Edit Descriptor            of Exponent                Form of Exponent
  5373.  
  5374.  Dw.d                       |exp| <=  99               D followed by plus or
  5375.                                                        minus, followed by the
  5376.                                                        two-digit exponent
  5377.  
  5378.  Dw.d                       99 < |exp| <=  999         Plus or minus,
  5379.                                                        followed by the
  5380.                                                        three-digit exponent
  5381.  
  5382.  The form Dw.d must not be used if the absolute value of the exponent to be
  5383.  printed exceeds 999.
  5384.  
  5385.  The scale factor controls the decimal normalization of the printed D field.
  5386.  If the scale factor, k, is greater than -d and less than or equal to 0, then
  5387.  the output field contains exactly k leading zeros after the decimal point
  5388.  and d+k significant digits after this. If (0 < k < d+2), then the output
  5389.  field contains exactly k significant digits to the left of the decimal point
  5390.  and (d-k-1) places after the decimal point. Other values of k are errors.
  5391.  
  5392.  
  5393.  3.7.2.7  Logical Editing (L)
  5394.  
  5395.  
  5396.  Syntax
  5397.  
  5398.       Lw
  5399.  
  5400.  The field is w characters wide. On output, the iolist element associated
  5401.  with an L edit descriptor must be of type logical or a run-time error
  5402.  occurs. On input, the field consists of optional blanks, followed by an
  5403.  optional decimal point, followed by T (for true) or F (for false). Any
  5404.  further characters in the field are ignored, but accepted on input, so that
  5405.  .TRUE. and .FALSE. are also valid inputs. On output, w-1 blanks are followed
  5406.  by either T or F, as appropriate.
  5407.  
  5408.  
  5409.  3.7.2.8  Character Editing (A)
  5410.  
  5411.  
  5412.  Syntax
  5413.  
  5414.       A«w»
  5415.  
  5416.  If w is omitted, the field width defaults to the number of characters in the
  5417.  iolist associated item. The iolist item may be of any type. If it is not of
  5418.  the CHARACTER type, it is assumed to have one character per byte.
  5419.  
  5420.  «When the iolist item is of type INTEGER, REAL, or LOGICAL, Hollerith data
  5421.  types can be used. On input, the iolist item becomes defined with Hollerith
  5422.  data. On output, the iolist item must be defined with Hollerith data.»
  5423.  
  5424.  If the number of characters input is less than w, the input field is padded
  5425.  with blanks. If the number of characters input is greater than w, the input
  5426.  field is truncated on the right to the length of w. Only after these
  5427.  adjustments have been made will the input field be transmitted to the iolist
  5428.  item. For example, look at the following program fragment:
  5429.  
  5430.              CHARACTER*10 char
  5431.              READ (*, '(A15)') char
  5432.  
  5433.  Assume the following 13 characters are typed in at the keyboard:
  5434.  
  5435.       ABCDEFGHIJKLM
  5436.  
  5437.  The following two steps occur:
  5438.  
  5439.    1. Blanks are added to pad the input field to 15 characters:
  5440.  
  5441.       'ABCDEFGHIJKLM  '
  5442.  
  5443.    2. The rightmost 10 characters are transmitted to the iolist element char:
  5444.  
  5445.       'FGHIJKLM  '
  5446.  
  5447.  On output, if w exceeds the number of characters produced by the iolist
  5448.  item, leading blanks are provided. Otherwise, the leftmost w characters of
  5449.  the iolist item are output.
  5450.  
  5451.  
  5452.  3.7.3  Interaction between Format and I/O List
  5453.  
  5454.  If an iolist contains one or more items, at least one repeatable edit
  5455.  descriptor must exist in the format specification. The empty edit
  5456.  specification, ( ), can be used only if no items are specified in the
  5457.  iolist. A formatted WRITE statement with an empty edit specification writes
  5458.  a carriage return and line feed. A READ statement with an empty edit
  5459.  specification skips to the next record.
  5460.  
  5461.  «If you read a record in which the total number of characters is less than
  5462.  the number of characters specified by the edit descriptors and iolist, the
  5463.  following occurs:»
  5464.  
  5465.    1. «The record is padded with blanks on the right to the required length.»
  5466.  
  5467.    2. «Any blanks entered by the user are interpreted according to the
  5468.       blank-editing descriptor in effect (BN or BZ).»
  5469.  
  5470.  «For example, consider the following READ statement that uses BZ editing:»
  5471.  
  5472.             «READ (*, '(BZ, I5)') n»
  5473.  
  5474.  «Assume you enter the following in response:»
  5475.  
  5476.        «5»
  5477.  
  5478.  «The total number of characters in the input record is two (a blank followed
  5479.  by a 5). The record is padded on the right with three blanks, but these
  5480.  additional blanks added by the formatter are ignored. The input record is
  5481.  thus interpreted as 5, rather than 5000.»
  5482.  
  5483.  Each item in the iolist is associated with a repeatable edit descriptor
  5484.  during the I/O statement execution. Each COMPLEX item in the iolist requires
  5485.  two edit descriptors in the FORMAT statement or format descriptor.
  5486.  Nonrepeatable edit descriptors are not associated with items in the iolist.
  5487.  
  5488.  During the formatted I/O process, the format controller scans and processes
  5489.  the format items from left to right. Following is a list detailing
  5490.  situations the format controller may encounter and their explanations:
  5491.  
  5492.    ■  A repeatable edit descriptor is encountered, and a corresponding item
  5493.       appears in the iolist.
  5494.  
  5495.       The item and the edit descriptor are associated, and I/O of that item
  5496.       proceeds under the format control of the edit descriptor.
  5497.  
  5498.    ■  A repeatable edit descriptor is encountered, and no corresponding item
  5499.       appears in the iolist.
  5500.  
  5501.       The format controller terminates I/O. For the following statements, for
  5502.       example:
  5503.  
  5504.       i = 5
  5505.             WRITE (*, 100) i
  5506.       100   FORMAT (1X, 'I= ', I5, ' J= ',
  5507.            +I5, ' K= ', I5)
  5508.  
  5509.       the output would look like this:
  5510.  
  5511.       I=     5 J=
  5512.  
  5513.       The output terminates after J= because no corresponding item for the
  5514.       second I5 appears in the iolist.
  5515.  
  5516.    ■  The matching final right parenthesis of the format specification is
  5517.       encountered, and there are no further items in the iolist.
  5518.  
  5519.       The format controller terminates I/O.
  5520.  
  5521.    ■  A colon (:) edit descriptor is encountered, and there are no further
  5522.       items in the iolist.
  5523.  
  5524.       The format controller terminates I/O.
  5525.  
  5526.    ■  A colon (:) edit descriptor is encountered, but there are further items
  5527.       in the iolist.
  5528.  
  5529.       The colon edit descriptor is ignored.
  5530.  
  5531.    ■  The matching final right parenthesis of the format specification is
  5532.       encountered, and there are further items in the iolist.
  5533.  
  5534.       The file is positioned at the beginning of the next record and the
  5535.       format controller starts over at the beginning of the format
  5536.       specification terminated by the last preceding right parenthesis.
  5537.  
  5538.       If there is no such preceding right parenthesis, the format controller
  5539.       rescans the format from the beginning. Within the portion of the format
  5540.       rescanned, there must be at least one repeatable edit descriptor.
  5541.  
  5542.       If the rescan of the format specification begins with a repeated nested
  5543.       format specification, the repeat factor indicates the number of times
  5544.       to repeat that nested format specification. The rescan does not change
  5545.       the previously set scale factor or the BN or BZ blank control in
  5546.       effect.
  5547.  
  5548.  When the format controller terminates on input, any remaining characters of
  5549.  the record are ignored. When the format controller terminates on output, an
  5550.  end-of-record mark is written.
  5551.  
  5552.  For units connected to terminal devices, the end-of-record mark is not
  5553.  written until the next record is written to the unit. «If the device is the
  5554.  screen, you can use the backslash (/) edit descriptor to suppress the
  5555.  end-of-record mark.»
  5556.  
  5557.  
  5558.  3.8  List-Directed I/O
  5559.  
  5560.  A list-directed record is a sequence of values and value separators. Each
  5561.  value in a list-directed record must be one of the following:
  5562.  
  5563.    ■  A constant, optionally multiplied by an unsigned-nonzero-integer
  5564.       constant. For example, 5, or 2*5 (two successive fives) are both
  5565.       acceptable.
  5566.  
  5567.    ■  A null value, optionally multiplied by an unsigned-nonzero-integer
  5568.       constant. For example, 5* is five successive null values.
  5569.  
  5570.  Except in string constants, none of these may have embedded blanks.
  5571.  
  5572.  Each value separator in a list-directed record must be one of the following:
  5573.  
  5574.    ■  A comma (,).
  5575.  
  5576.    ■  A slash (/).
  5577.  
  5578.       A slash encountered as a value separator during execution of a
  5579.       list-directed input statement stops execution of that statement after
  5580.       assignment of the previous value. Any further items in the input list
  5581.       are treated as if they were null values.
  5582.  
  5583.    ■  One or more contiguous blanks between two constants or after the last
  5584.       constant.
  5585.  
  5586.       Blanks next to value separators are ignored. For example,  5  ,  6  /
  5587.       7  is equivalent to 5,6/7.
  5588.  
  5589.  ───────────────────────────────────────────────────────────────────────────
  5590.  NOTE
  5591.     List-directed I/O to or from internal files is prohibited by the ANSI
  5592.     standard.
  5593.  ───────────────────────────────────────────────────────────────────────────
  5594.  
  5595.  
  5596.  3.8.1  List-Directed Input
  5597.  
  5598.  In most cases, all the input forms available for formatted I/O are also
  5599.  available for list-directed formatting. This section describes all the
  5600.  exceptions to this rule.
  5601.  
  5602.  The following rules apply to list-directed input for all values:
  5603.  
  5604.    ■  The form of the input value must be acceptable for the type of input
  5605.       list item.
  5606.  
  5607.    ■  Blanks are always treated as separators and never as zeros.
  5608.  
  5609.    ■  Embedded blanks can only appear within character constants, as
  5610.       specified in the list below.
  5611.  
  5612.       Note that the end-of-record mark has the same effect as a blank, except
  5613.       when it appears within a character constant.
  5614.  
  5615.  In addition to the rules above, the following restrictions apply to the
  5616.  specified values:
  5617.  
  5618.  Type of Value        Restrictions
  5619.  
  5620.  Single- or           A real or double-precision constant must be a numeric
  5621.  double-precision     input field (a field suitable for F editing). It is
  5622.  real constants       assumed to have no fractional digits unless there is a
  5623.                       decimal point within the field.
  5624.  
  5625.  Complex constants    A complex constant is an ordered pair of real «or
  5626.                       integer» constants separated by a comma and surrounded
  5627.                       by opening and closing parentheses. The first constant
  5628.                       of the pair is the real part of the complex constant,
  5629.                       and the second is the imaginary part.
  5630.  
  5631.  Logical Constants    A logical constant must not include either slashes or
  5632.                       commas among the optional characters permitted for L
  5633.                       editing.
  5634.  
  5635.  Character Constants  A character constant is a nonempty string of characters
  5636.                       enclosed in apostrophes. Each apostrophe within a
  5637.                       character constant delimited by apostrophes must be
  5638.                       represented by two apostrophes, with no intervening
  5639.                       blanks.
  5640.  
  5641.                       Character constants may be continued from the end of
  5642.                       one record to the beginning of the next; the end of the
  5643.                       record doesn't cause a blank or other character to
  5644.                       become part of the constant. The constant may be
  5645.                       continued on as many records as needed and may include
  5646.                       the blank, comma, and slash characters.
  5647.  
  5648.                       If the length n of the list item is less than or equal
  5649.                       to the length m of the character constant, the leftmost
  5650.                       n characters of the latter are transmitted to the list
  5651.                       item.
  5652.  
  5653.                       If n is greater than m, the constant is transmitted to
  5654.                       the leftmost m characters of the list item. The
  5655.                       remaining n minus m characters of the list item are
  5656.                       filled with blanks. The effect is the same as if the
  5657.                       constant were assigned to the list item in a character
  5658.                       assignment statement.
  5659.  
  5660.  Null Values          You can specify a null value in one of three ways:
  5661.  
  5662.                       1. No characters between successive value separators
  5663.  
  5664.                       2. No characters preceding the first value separator in
  5665.                          the first record read by each execution of a list-
  5666.                          directed input statement
  5667.  
  5668.                       3. The r* form (for example, 10* is equivalent to 10
  5669.                          null values)
  5670.  
  5671.                       A null value has no effect on the current definition of
  5672.                       the corresponding input list item. If the input list
  5673.                       item is defined, it retains its previous value; if it
  5674.                       is undefined, it remains so.
  5675.  
  5676.                       A slash encountered as a value separator during
  5677.                       execution of a list-directed input statement stops
  5678.                       execution of that statement after the assignment of the
  5679.                       previous value. Any further items in the input list are
  5680.                       treated as if they were null values.
  5681.  
  5682.  Blanks               All blanks in a list-directed input record are
  5683.                       considered to be part of some value separator, except
  5684.                       for the following:
  5685.  
  5686.                       ■  Blanks embedded in a character constant
  5687.  
  5688.                       ■  Leading blanks in the first record read by each
  5689.                          execution of a list-directed input statement unless
  5690.                          immediately followed by a slash or comma
  5691.  
  5692.  
  5693.  Example
  5694.  
  5695.  The following example uses list-directed input and output:
  5696.  
  5697.             REAL    a
  5698.             INTEGER i
  5699.             COMPLEX c
  5700.             LOGICAL up, down
  5701.             DATA a /2358.2E-8/, i /91585/, c /(705.60,819.60)/
  5702.             DATA up /.TRUE./, down /.FALSE./
  5703.             OPEN   (UNIT = 9, FILE = 'listout', STATUS = 'NEW')
  5704.             WRITE  (9, *) a, i
  5705.             WRITE  (9, *) c, up, down
  5706.             REWIND (9)
  5707.             READ   (9, *) a, i
  5708.             READ   (9, *) c, up, down
  5709.             WRITE  (*, *) a, i
  5710.             WRITE  (*, *) c, up, down
  5711.             END
  5712.  
  5713.  This program produces the following output:
  5714.  
  5715.       2.358200E-005        91585
  5716.       (705.6000000,819.6000000) T F
  5717.  
  5718.  
  5719.  3.8.2  List-Directed Output
  5720.  
  5721.  The form of the values produced by list-directed output is the same as the
  5722.  form of values required for input, except as noted in this section. The
  5723.  list-directed line length is 79 columns.
  5724.  
  5725.  New records are created as necessary, but neither the end of a record nor
  5726.  blanks can occur within a constant (except in character constants). To
  5727.  provide carriage control when the record is printed, each output record
  5728.  automatically begins with a blank character.
  5729.  
  5730.  In addition, the following rules apply for the specified types of data:
  5731.  
  5732.  Type of Data             Characteristics
  5733.  
  5734.  Logical constants        Output as T for the value true and F for the value
  5735.                           false.
  5736.  
  5737.  Integer constants        Output in the format of an I11 edit descriptor.
  5738.  
  5739.  Single- and double-      Output in the format of either an F or E edit
  5740.  precision real           descriptor, depending on the value of the constant.
  5741.  constants
  5742.                           If:                     Then:
  5743.  
  5744.                           1 <= constant and       The constant
  5745.                           constant < 10^(7)       is output
  5746.                                                   using a 0PF15.6 edit
  5747.                                                   descriptor for
  5748.                                                   single-precision, or a
  5749.                                                   0PF24.15 edit descriptor
  5750.                                                   for double-precision.
  5751.  
  5752.                           constant < 1 or         The constant is
  5753.                           constant <= 10^(7)      output using
  5754.                                                   a 1PE15.6E2 edit descriptor
  5755.                                                   for single-precision, or a
  5756.                                                   1PE24.15E3 edit descriptor
  5757.                                                   for double-precision.
  5758.  
  5759.  Character constants      Not delimited by apostrophes. They are neither
  5760.                           preceded nor followed by a value separator.
  5761.  
  5762.                           Each internal apostrophe is represented by one
  5763.                           externally. A blank character is inserted at the
  5764.                           start of any record that begins with the
  5765.                           continuation of a character constant from the
  5766.                           preceding record.
  5767.  
  5768.  Slashes as value         Not produced by list-directed formatting.
  5769.  separators
  5770.  
  5771.  Null values              Not produced by list-directed formatting.
  5772.  
  5773.  
  5774.  Example
  5775.  
  5776.  The following example uses list-directed output:
  5777.  
  5778.             INTEGER i, j
  5779.             REAL    a, b
  5780.             LOGICAL on, off
  5781.             CHARACTER*20  c
  5782.             DATA i /123456/, j /500/, a /28.22/, b /.0015555/
  5783.             DATA on /.TRUE./, off/.FALSE./
  5784.             DATA c /'Here''s a string'/
  5785.             WRITE (*, *) i, j
  5786.             WRITE (*, *) a, b, on, off
  5787.             WRITE (*, *) c
  5788.             END
  5789.  
  5790.  The example above produces the following output:
  5791.  
  5792.              123456          500
  5793.               28.2200000  1.555500E-003 T F
  5794.       Here's a string
  5795.  
  5796.  
  5797.  3.9  «Namelist-Directed I/O»
  5798.  
  5799.  «Namelist-directed I/O is a powerful method for reading data in or writing
  5800.  data out to a file (or the terminal). By specifying one or more variables in
  5801.  a namelist group, you can read or write the values of all of them with a
  5802.  single I/O statement.»
  5803.  
  5804.  «A namelist-directed input statement scans the input file for the group
  5805.  name. Once found, the statement then scans for assignment statements that
  5806.  give values to one or more of the variables in the group. Namelist-directed
  5807.  input is terminated with a slash. A namelist-directed output statement
  5808.  writes the name of the namelist, followed by the name of each variable in
  5809.  the namelist, an equal sign, and the variable's current value.
  5810.  Namelist-directed output is terminated with a slash.»
  5811.  
  5812.  «A namelist group is created with the NAMELIST statement. It takes the
  5813.  form:»
  5814.  
  5815.  «NAMELIST / namelist / variablelist»
  5816.  
  5817.  «where namelist is an identifying name for the group, and variablelist is a
  5818.  list of variables and array names.»
  5819.  
  5820.  «The values of the namelist variables are written to a file or the screen
  5821.  with a WRITE statement in which namelist appears instead of a format
  5822.  specifier. Note that no iolist is needed or permitted.»
  5823.  
  5824.  «WRITE (*, NML = namelist)»
  5825.  
  5826.  «NML= is optional, and is only required if other keywords (such as END=) are
  5827.  used.»
  5828.  
  5829.  «The first output record is an ampersand (&), immediately followed by the
  5830.  namelist group name, in uppercase. Succeeding records list all variable
  5831.  names in the group and their values. Each output record begins with a blank
  5832.  character to provide carriage control if the record is printed. Values take
  5833.  the output format they would have in list-directed I/O, with one exception:
  5834.  character strings are delimited by apostrophes. This permits the file
  5835.  created to be read by a namelist-directed READ statement, which requires
  5836.  apostrophes as string delimiters. The last output record is a slash.»
  5837.  
  5838.  
  5839.  «Example»
  5840.  
  5841.  «The following example declares a number of variables which are placed in a
  5842.  namelist, initialized, then written to the screen with namelist I/O:»
  5843.  
  5844.            «INTEGER    int1*1, int2*2, int4*4, array(3)
  5845.             LOGICAL    log1*1, log2*2, log4*4
  5846.             REAL       real4*4, real8*8
  5847.             COMPLEX    z8*8, z16*16
  5848.             CHARACTER  char1*1, char10*10
  5849.  
  5850.             NAMELIST /example/ int1, int2, int4, log1, log2, log4,
  5851.            +          real4, real8, z8, z16, char1, char10, array
  5852.  
  5853.             int1     =  11
  5854.             int2     =  12
  5855.             int4     =  14
  5856.             log1     = .TRUE.
  5857.             log2     = .TRUE.
  5858.             log4     = .TRUE.
  5859.             real4    =  24.0
  5860.             real8    =  28.0d0
  5861.             z8       = (38.0,0.0)
  5862.             z16      = (316.0d0,0.0d0)
  5863.             char1    = 'A'
  5864.             char10   = '0123456789'
  5865.             array(1) = 41
  5866.             array(2) = 42
  5867.             array(3) = 43
  5868.  
  5869.             WRITE (*, example)»
  5870.  
  5871.  
  5872.  «Output»
  5873.  
  5874.       «&EXAMPLE
  5875.       INT1 =         11
  5876.       INT2 =         12
  5877.       INT4 =         14
  5878.       LOG1 = T
  5879.       LOG2 = T
  5880.       LOG4 = T
  5881.       REAL4 =     24.000000
  5882.       REAL8 =     28.000000000000000
  5883.       Z8 =           (38.000000,0.000000E+00)
  5884.       Z16 =         (316.000000000000000,0.000000000000000E+000)
  5885.       CHAR1 = 'A'
  5886.       CHAR10 = '0123456789'
  5887.       ARRAY =            41          42          43
  5888.       /»
  5889.  
  5890.  «The operation of a namelist-directed READ statement is almost the reverse
  5891.  of a WRITE operation. The statement first scans the file (either at the
  5892.  terminal or on disk) from its current position until it finds an ampersand
  5893.  immediately followed by the namelist group name, or until it reaches the end
  5894.  of the file. (Ampersands followed by other names are ignored.) There must be
  5895.  at least one blank or carriage return following the group name to separate
  5896.  it from the following value-assignment pairs.»
  5897.  
  5898.  «A value-assignment pair (optional) consists of a variable name, array
  5899.  element, or substring followed by an equal sign and one or more values and
  5900.  value separators. The equal sign may be preceded or followed by any number
  5901.  of blanks (including no blanks). A value separator is a single comma or one
  5902.  or more blanks. A comma that is not preceded by a value is treated as a null
  5903.  value, and the corresponding variable or array element is not altered.»
  5904.  
  5905.  «Variables may appear in any order. The same variable may appear in more
  5906.  than one assignment pair. Its final value is the value it received in its
  5907.  last assignment. All the variables in a namelist do not need to be assigned
  5908.  values; those which do not appear, or which are associated with null values,
  5909.  keep their current values. A variable name in the input file that is not in
  5910.  the namelist group causes a run-time error.»
  5911.  
  5912.  «If an array name appears without a qualifying subscript, the first value in
  5913.  the assignment statement is given to the first array element, the second to
  5914.  the second element, and so forth. Assignment to arrays is by row-major
  5915.  order.»
  5916.  
  5917.  «You may not assign more values than there are elements in an array. For
  5918.  example, you may not specify 101 values for a 100-element array. However, an
  5919.  array need not have values assigned to all its elements. Any missing values
  5920.  are treated as nulls, and the corresponding array elements are not altered.
  5921.  Individual values may also be assigned to subscripted array elements.»
  5922.  
  5923.  «A value may be repeated by placing a repeat factor and an asterisk in front
  5924.  of the value. For example, 7*'Hello'  assigns 'Hello'  to the next seven
  5925.  elements in an array or variable list. A repeat factor and asterisk without
  5926.  a value indicates multiple null values. The corresponding variables are not
  5927.  altered. Given the array matrix(0:101), the following statements assign 10
  5928.  to element 0, assign 25 to the elements 1 through 50, leave 51 through 100
  5929.  alone, assign -101 to element 101, then change the value of matrix(42) to
  5930.  63:»
  5931.  
  5932.             «matrix = 10, 50*25, 50*, -101
  5933.             matrix(42) = 63»
  5934.  
  5935.  «Character strings must be delimited by apostrophes.»
  5936.  
  5937.  «A namelist-directed READ statement is successfully terminated by a slash or
  5938.  by reaching the end of the file (in which case, an error results). Slashes
  5939.  must not be used as value separators unless it is desired to prematurely
  5940.  terminate the read.»
  5941.  
  5942.  «Suppose the preceding program wanted to read new values for some of the
  5943.  variables in namelist example. If a file connected to unit four contained
  5944.  the following namelist specifier and assignment statements:»
  5945.  
  5946.             «&example
  5947.             z8 = (99.0,0.0)
  5948.             INT1=99
  5949.             array(1)=99
  5950.             real4 = 99.0
  5951.             CHAR1='Z'
  5952.             char10(5:9) = 'GrUMp'
  5953.             log1=F
  5954.             /»
  5955.  
  5956.  «then the following namelist-directed READ statement would assign new values
  5957.  to the specified variables:»
  5958.  
  5959.             «READ (UNIT = 4, example)»
  5960.  
  5961.  «A second WRITE (*, example) statement would display their changed values as
  5962.  follows:»
  5963.  
  5964.       «&EXAMPLE
  5965.       INT1 =         99
  5966.       INT2 =         12
  5967.       INT4 =         14
  5968.       LOG1 = F
  5969.       LOG2 = T
  5970.       LOG4 = T
  5971.       REAL4 =     99.000000
  5972.       REAL8 =     28.000000000000000
  5973.       Z8 =           (99.000000,0.000000E+00)
  5974.       Z16 =         (316.000000000000000,0.000000000000000E+000)
  5975.       CHAR1 = 'Z'
  5976.       CHAR10 = '0123GrUMp9'
  5977.       ARRAY =            99          42          43
  5978.       /»
  5979.  
  5980.  
  5981.  Chapter 4  Statements
  5982.  ───────────────────────────────────────────────────────────────────────────
  5983.  
  5984.  The first part of this chapter describes the kinds of statements available
  5985.  in Microsoft FORTRAN. The second part of the chapter contains a directory of
  5986.  the Microsoft FORTRAN statements, listed alphabetically.
  5987.  
  5988.  A FORTRAN statement consists of an initial line, optionally followed by up
  5989.  to 19 continuation lines. «In Microsoft FORTRAN, the number of continuation
  5990.  lines is limited only by available memory.» Statements are written in
  5991.  columns 7 through 72. They perform actions such as computing, storing the
  5992.  results of computations, altering the flow of control, reading and writing
  5993.  files, and providing information for the compiler.
  5994.  
  5995.  
  5996.  4.1  Categories of Statements
  5997.  
  5998.  There are two basic types of statements in FORTRAN: executable and
  5999.  nonexecutable. An executable statement causes an action to be performed.
  6000.  Nonexecutable statements describe, classify, or specify the format of
  6001.  program elements, such as entry points, data, or program units.
  6002.  
  6003.  Table 4.1 summarizes the FORTRAN statements.
  6004.  
  6005.  Table 4.1  Categories of FORTRAN Statements
  6006.  
  6007.  Category                   Type                       Description
  6008.  
  6009.  Assignment statements      Executable                 Assign a value to a
  6010.                                                        variable or an array
  6011.                                                        element. See the
  6012.                                                        ASSIGN and
  6013.                                                        Assignment entries in
  6014.                                                        Section 4.2,
  6015.                                                        "Statement Directory,"
  6016.                                                        for more
  6017.                                                        information.
  6018.  
  6019.  BLOCK DATA, ENTRY,         Nonexecutable              Define the start of a
  6020.  FUNCTION,                                             program unit and
  6021.  «INTERFACE TO,»                                       specify its formal
  6022.  PROGRAM, and                                          arguments.
  6023.  SUBROUTINE
  6024.  statements
  6025.  
  6026.  Control statements         Executable                 Control the order of
  6027.                                                        execution of
  6028.                                                        statements. See Table
  6029.                                                        4.3.
  6030.  
  6031.  DATA statement             Nonexecutable              Assigns initial values
  6032.                                                        to variables.
  6033.  
  6034.  FORMAT statement           Nonexecutable              Provides data-editing
  6035.                                                        information.
  6036.  
  6037.  I/O statements             Executable                 Transfer data and
  6038.                                                        manipulate files and
  6039.                                                        records. See Table 4.4
  6040.                                                        and Chapter 3, "The
  6041.                                                        Input/Output
  6042.                                                        System."
  6043.  
  6044.  Specification              Nonexecutable              Define the attributes
  6045.  statements                                            of variables, arrays,
  6046.                                                        and subprograms. See
  6047.                                                        Table 4.2.
  6048.  
  6049.  Statement-function         Nonexecutable              Define simple, locally
  6050.  statements                                            used functions.
  6051.  
  6052.  Table 4.2 summarizes the specification statements.
  6053.  
  6054.  Table 4.2  Specification Statements
  6055.  
  6056.  Statement                           Purpose
  6057.  
  6058.  «AUTOMATIC»                         «Declares a variable on the stack,
  6059.                                      rather than at a static memory
  6060.                                      location»
  6061.  
  6062.  COMMON                              Shares variables between two or more
  6063.                                      program units
  6064.  
  6065.  DIMENSION                           Identifies a variable as an array and
  6066.                                      specifies the number of elements
  6067.  
  6068.  EQUIVALENCE                         Specifies that two or more variables or
  6069.                                      arrays share the same memory location
  6070.  
  6071.  EXTERNAL                            Allows a user-defined subroutine or
  6072.                                      function to be passed as an argument
  6073.  
  6074.  IMPLICIT                            Changes the default typing for real and
  6075.                                      integer variables and functions
  6076.  
  6077.  INTRINSIC                           Allows a predefined function to be
  6078.                                      passed as an argument
  6079.  
  6080.  «MAP...END MAP»                     «Within a UNION statement, delimits a
  6081.                                      group of variable type declarations that
  6082.                                      are to be ordered contiguously within
  6083.                                      memory»
  6084.  
  6085.  «NAMELIST»                          «Declares a group name for set of
  6086.                                      variables to be read or written in a
  6087.                                      single statement»
  6088.  
  6089.  PARAMETER                           Equates a constant expression with a
  6090.                                      name
  6091.  
  6092.  «RECORD»                            «Declares one or more variables of a
  6093.                                      user-
  6094.                                      defined structure type»
  6095.  
  6096.  SAVE                                Causes variables to retain their values
  6097.                                      between invocations of the procedure in
  6098.                                      which they are defined
  6099.  
  6100.  «STRUCTURE...END STRUCTURE»         «Defines a new variable type, composed
  6101.                                      of a collection of other variable types»
  6102.  
  6103.  Type:                               Specifies the type of user-defined names
  6104.  CHARACTER«*n»
  6105.  COMPLEX««*bytes»»
  6106.  «DOUBLE COMPLEX»
  6107.  DOUBLE PRECISION
  6108.  INTEGER««*bytes»»
  6109.  LOGICAL««*bytes»»
  6110.  REAL««*bytes»»
  6111.  «RECORD /struct-name/»
  6112.  «STRUCTURE /struct-name/»
  6113.  
  6114.  «UNION...END UNION»                 «Within a STRUCTURE statement, causes
  6115.                                      the variables in two or more maps to
  6116.                                      occupy the same memory location»
  6117.  
  6118.  Table 4.3 summarizes the control statements.
  6119.  
  6120.  Table 4.3  Control Statements
  6121.  
  6122.  Statement                  Purpose
  6123.  
  6124.  «ALLOCATE»                 «Dynamically establishes allocatable array
  6125.                             dimensions»
  6126.  
  6127.  CALL                       Executes a subroutine
  6128.  
  6129.  «CASE»                     «Within a SELECT CASE structure, marks a block of
  6130.                             statements that are executed if an associated
  6131.                             value matches the SELECT CASE expression»
  6132.  
  6133.  CONTINUE                   Has no effect; often used as target of GOTO or as
  6134.                             the terminal statement in a DO loop
  6135.  
  6136.  «CYCLE»                    «Advances control to the end statement of a DO
  6137.                             loop; the intervening loop statements are not
  6138.                             executed»
  6139.  
  6140.  «DEALLOCATE»               «Frees the storage space previously reserved in
  6141.                             an ALLOCATE statement»
  6142.  
  6143.  DO                         Evaluates statements in the DO loop, through and
  6144.                             including the ending statement, a specific number
  6145.                             of times
  6146.  
  6147.  «DO WHILE»                 «Evaluates statements in the DO WHILE loop,
  6148.                             through and including the ending statement, until
  6149.                             a logical condition becomes false»
  6150.  
  6151.  ELSE                       Introduces an ELSE block
  6152.  
  6153.  ELSE IF                    Introduces an ELSE IF block
  6154.  
  6155.  END                        Ends execution of a program unit
  6156.  
  6157.  «END DO»                   «Marks the end of a series of statements
  6158.                             following a DO or DO WHILE statement»
  6159.  
  6160.  END IF                     Marks the end of a series of statements following
  6161.                             a block IF statement
  6162.  
  6163.  «END SELECT»               «Marks the end of a SELECT CASE  statement»
  6164.  
  6165.  EXIT                       Leaves a DO loop; execution continues with the
  6166.                             first statement following
  6167.  
  6168.  GOTO                       Transfers control to another part of the program
  6169.  
  6170.  «INCLUDE»                  «Inserts contents of a specified file into the
  6171.                             source file»
  6172.  
  6173.  IF                         Controls conditional execution of other
  6174.                             statement(s)
  6175.  
  6176.  PAUSE                      Suspends program execution «and, optionally,
  6177.                             executes operating-system commands»
  6178.  
  6179.  RETURN                     Returns control to the program unit that called a
  6180.                             subroutine or function
  6181.  
  6182.  «SELECT CASE»              «Transfers program control to a selected block of
  6183.                             statements, based on value of a controlling
  6184.                             expression»
  6185.  
  6186.  STOP                       Terminates a program
  6187.  
  6188.  Table 4.4 summarizes the I/O statements.
  6189.  
  6190.  Table 4.4  I/O Statements
  6191.  
  6192.  Statement                  Purpose
  6193.  
  6194.  BACKSPACE                  Positions a file to the beginning of the previous
  6195.                             record
  6196.  
  6197.  CLOSE                      Disconnects the specified unit
  6198.  
  6199.  ENDFILE                    Writes an end-of-file record
  6200.  
  6201.  INQUIRE                    Returns values indicating the properties of a
  6202.                             file or unit
  6203.  
  6204.  «LOCKING»                  «Locks direct-access files and records»
  6205.  
  6206.  OPEN                       Associates a unit number with an external device
  6207.                             or file
  6208.  
  6209.  PRINT                      Displays data on the screen
  6210.  
  6211.  READ                       Transfers data from a file to the items in an I/O
  6212.                             list
  6213.  
  6214.  REWIND                     Repositions a file to its first record
  6215.  
  6216.  WRITE                      Transfers data from the items in an I/O list to a
  6217.                             file
  6218.  
  6219.  
  6220.  4.2  Statement Directory
  6221.  
  6222.  The rest of this chapter is an alphabetical listing of all Microsoft FORTRAN
  6223.  statements. Each statement is described using the following format:
  6224.  
  6225.  Heading                                    Information
  6226.  
  6227.  Action                                     Summary of what the statement
  6228.                                             does.
  6229.  
  6230.  Syntax                                     Statement syntax, and description
  6231.                                             of statement parameters.
  6232.  
  6233.  Remarks                                    Use of the statement.
  6234.  
  6235.  Example                                    Sample programs or program
  6236.                                             fragments that illustrate the use
  6237.                                             of the statement. This section
  6238.                                             does not appear with every
  6239.                                             reference entry.
  6240.  
  6241.  The syntax of statements that do not fit on one line is shown on more than
  6242.  one line, as in the following example:
  6243.  
  6244.       CLOSE («UNIT=»unitspec
  6245.       «, ERR=errlabel»
  6246.       «, IOSTAT=iocheck»
  6247.       «, STATUS=status»)
  6248.  
  6249.  When you use these statements, you must still follow the formatting rules
  6250.  described in Section 2.1, "Lines." «If the $FREEFORM metacommand is
  6251.  specified, follow the formatting rules given in Section 2.3, "Free-Form
  6252.  Source Code."» The program fragment below, for example, is illegal:
  6253.  
  6254.             CLOSE (UNIT = 2,
  6255.             ERR = 100,
  6256.             IOSTAT = errvar)
  6257.  
  6258.  Either of the following two statements, however, is correct:
  6259.  
  6260.             CLOSE (UNIT = 2, ERR = 100, IOSTAT = errvar)
  6261.  
  6262.             CLOSE (UNIT = 2,
  6263.            +       ERR = 100,
  6264.            +       IOSTAT = errvar)
  6265.  
  6266.  
  6267.  ALLOCATE
  6268.  
  6269.  
  6270.  ■  «Action»
  6271.  
  6272.  «Dynamically sizes an array that has previously been declared with the
  6273.  ALLOCATABLE attribute»
  6274.  
  6275.  
  6276.  ■  «Syntax»
  6277.  
  6278.       «ALLOCATE (array(«l:»u«,«l:»u ...») «, STAT = ierr») ...»
  6279.  
  6280.  «Parameter                                 Description»
  6281.  
  6282.  «array»                                    «Name of allocatable array»
  6283.  
  6284.  «ierr»                                     «Integer variable that returns
  6285.                                             status of allocation attempt»
  6286.  
  6287.  «l»                                        «Integer expression that sets the
  6288.                                             lower bound of the array»
  6289.  
  6290.  «u»                                        «Integer expression that sets the
  6291.                                             upper bound of the array»
  6292.  
  6293.  
  6294.  ■  «Remarks»
  6295.  
  6296.  «Allocatable arrays may be dynamically allocated and deallocated at run
  6297.  time. An array must have previously been declared ALLOCATABLE, and the
  6298.  number of its dimensions declared (with colons only; no bounds may be
  6299.  specified). The ALLOCATE statement establishes the upper and lower bounds of
  6300.  each dimension and reserves sufficient memory.»
  6301.  
  6302.  «More than one allocatable array name may appear in an ALLOCATE statement,
  6303.  separated by commas. The STAT= parameter must appear last.»
  6304.  
  6305.  «Allocatable arrays may not have the NEAR attribute. If the array is to be
  6306.  larger than 65,536 bytes, you must specify the HUGE attribute so the array
  6307.  elements are correctly addressed. Allocatable arrays may not appear in
  6308.  AUTOMATIC, COMMON, DATA, or EQUIVALENCE statements.»
  6309.  
  6310.  «Attempting to reallocate a previously allocated array causes a run-time
  6311.  error.»
  6312.  
  6313.  «Any allocation failure causes a run-time error, unless the STAT= option is
  6314.  present. The ierr variable returns a value of zero if the allocation was
  6315.  successful, and the number of the run-time error if the allocation failed.»
  6316.  
  6317.  
  6318.  ■  «Example»
  6319.  
  6320.            «.
  6321.             .
  6322.             .
  6323.             INTEGER  dataset[ALLOCATABLE](:,:),
  6324.            +         results[ALLOCATABLE, HUGE](:,:,:)
  6325.             INTEGER  reactor, level, calcs, error
  6326.             DATA  reactor, level, calcs  / 10, 50, 100 /
  6327.  
  6328.             ALLOCATE (dataset(reactor,level),
  6329.            +          results(reactor,level,calcs), STAT = error)
  6330.  
  6331.             IF (error .NE. 0)
  6332.            +    STOP 'Not enough storage for data; aborting...'
  6333.             .
  6334.             .
  6335.             .»
  6336.  
  6337.  
  6338.  ■  «See also»
  6339.  
  6340.  «DEALLOCATE»
  6341.  
  6342.  
  6343.  ASSIGN (Label Assignment)
  6344.  
  6345.  
  6346.  ■  Action
  6347.  
  6348.  Assigns the value of a format or statement label to an integer variable
  6349.  
  6350.  
  6351.  ■  Syntax
  6352.  
  6353.       ASSIGN label TO variable
  6354.  
  6355.  Parameter                                  Description
  6356.  
  6357.  label                                      A format label or statement
  6358.                                             label. The label must appear in
  6359.                                             the same program unit.
  6360.  
  6361.  variable                                   An integer variable.
  6362.  
  6363.  
  6364.  ■  Remarks
  6365.  
  6366.  Variables with label values are used in the following situations:
  6367.  
  6368.  Situation                                  Use
  6369.  
  6370.  An assigned GOTO statement                 The assigned GOTO statement
  6371.                                             requires a variable with the
  6372.                                             value of the label of an
  6373.                                             executable statement.
  6374.  
  6375.  A format specifier                         Input/output statements can
  6376.                                             accept a variable which specifies
  6377.                                             the label of a FORMAT statement.
  6378.  
  6379.  The value of a label is not the same as the label number; the label is
  6380.  instead identified by a number assigned by the compiler. For example, the
  6381.  value of IVBL in the following example is not 400:
  6382.  
  6383.             ASSIGN 400 TO IVBL
  6384.  
  6385.  Therefore, variables used in ASSIGN statements are not defined as integers.
  6386.  If you want to use a variable defined by an ASSIGN statement in an
  6387.  arithmetic expression, you must first define the variable by a computational
  6388.  assignment statement or by a READ statement.
  6389.  
  6390.  «If you use INTEGER*1 variables for variable, note that INTEGER*1 variables
  6391.  can only be used for the first 128 ASSIGN statements in a subprogram.»
  6392.  
  6393.  
  6394.  ■  Example
  6395.  
  6396.       C     Assign statement label 100 to the integer variable ivar
  6397.             ASSIGN 100 TO ivar
  6398.       C     Use ivar as a FORMAT statement label
  6399.             WRITE (*, ivar)
  6400.       C     Assign statement label 200 to ivar
  6401.             ASSIGN 200 TO ivar
  6402.       C     Use ivar as the target label of an assigned GOTO statement
  6403.             GOTO ivar
  6404.             WRITE (*, *)' This is never written'
  6405.         200 CONTINUE
  6406.             WRITE (*, *)' This is written'
  6407.         100 FORMAT (' This is format 100')
  6408.             END
  6409.  
  6410.  
  6411.  Assignment (Computational)
  6412.  
  6413.  
  6414.  ■  Action
  6415.  
  6416.  Evaluates an expression and assigns the resulting value to the specified
  6417.  variable or array element
  6418.  
  6419.  
  6420.  ■  Syntax
  6421.  
  6422.       variable = expression
  6423.  
  6424.  Parameter                                  Description
  6425.  
  6426.  variable                                   A variable, array, array-element,
  6427.                                             or structure-element reference
  6428.  
  6429.  expression                                 Any expression
  6430.  
  6431.  
  6432.  ■  Remarks
  6433.  
  6434.  The variable, array, array-element, «or structure-element type» and the
  6435.  expression type must be compatible:
  6436.  
  6437.    ■  If expression is numeric, then variable must be numeric, and the
  6438.       statement is an arithmetic assignment statement. If the data types of
  6439.       expression and variable are not identical, expression is converted to
  6440.       the data type of variable.
  6441.  
  6442.       Section 1.7.1.2, "Type Conversion of Arithmetic Operands," explains how
  6443.       integer, real, and complex numbers are converted.
  6444.  
  6445.    ■  If expression is logical, then variable must be logical, and the
  6446.       statement is a logical assignment statement.
  6447.  
  6448.       «Logical expressions of any byte size can be assigned to logical
  6449.       variables of any byte size without changing the value of expression.»
  6450.  
  6451.       Note that integer and real expressions may not be assigned to logical
  6452.       variables, nor may logical expressions be assigned to integer or real
  6453.       variables.
  6454.  
  6455.    ■  If expression has the type CHARACTER, the statement is a character
  6456.       assignment statement. Both variable and expression must have type
  6457.       CHARACTER. «If the $NOTSTRICT metacommand (the default) is in effect,
  6458.       then a character expression can be assigned to a noncharacter variable,
  6459.       and a noncharacter variable or array element (but not an expression)
  6460.       can be assigned to a character variable.»
  6461.  
  6462.       For character assignment statements, if the length of expression does
  6463.       not match the size of variable, expression is adjusted as follows:
  6464.  
  6465.         ■  If variable is longer than expression, then expression is padded
  6466.            with blanks on the right.
  6467.  
  6468.         ■  If variable is shorter than expression, then characters on the
  6469.            right of expression are ignored.
  6470.  
  6471.         ■  If variable is an array, then array assignment occurs as described
  6472.            in Section 1.7.5, "Array Expressions."
  6473.  
  6474.  
  6475.  ■  Examples
  6476.  
  6477.  The following program demonstrates assignment statements:
  6478.  
  6479.             REAL         a, b, c
  6480.             LOGICAL      abigger
  6481.             CHARACTER*5  assertion
  6482.  
  6483.             c = .01
  6484.             a = SQRT (c)
  6485.             b = c**2
  6486.  
  6487.             assertion = 'a > b'
  6488.             abigger   = (a .GT. b)
  6489.  
  6490.             WRITE (*, 100) a, b
  6491.        100  FORMAT (' a =', F7.4, '    b =', F7.4)
  6492.  
  6493.             IF (abigger) THEN
  6494.                 WRITE (*, *) assertion, ' is true.'
  6495.                 ELSE
  6496.                 WRITE (*, *) assertion, ' is false.'
  6497.             END IF
  6498.             END
  6499.  
  6500.  The program above has the following output:
  6501.  
  6502.       a =  .1000    b =  .0001
  6503.       a > b is true.
  6504.  
  6505.  The following fragment demonstrates legal and illegal assignment statements:
  6506.  
  6507.             INTEGER  i, int
  6508.             REAL  rone(4), rtwo(4), x, y
  6509.             COMPLEX  z      CHARACTER  char6*6, char8*8
  6510.  
  6511.             i       =  4
  6512.             x       =  2.0
  6513.             z       = (3.0, 4.0)
  6514.             rone(1) =  4.0
  6515.             rone(2) =  3.0
  6516.             rone(3) =  2.0
  6517.             rone(4) =  1.0
  6518.             char8   = 'Hello,'
  6519.  
  6520.       C     The following assignment statements are legal:
  6521.             i     = rone(2)
  6522.             int   = rone(i)
  6523.             int   = x
  6524.             y     = x
  6525.             y     = z
  6526.             y     = rone(3)
  6527.             rtwo  = rone
  6528.             rtwo  = 4.7
  6529.             char6 = char8
  6530.  
  6531.       C     The following assignment statements are illegal:
  6532.             char6 = x + 1.0
  6533.             int   = char8//'test'
  6534.             y     = rone
  6535.  
  6536.  
  6537.  AUTOMATIC
  6538.  
  6539.  
  6540.  ■  «Action»
  6541.  
  6542.  «Declares specified variables to be on the stack, rather than at a static
  6543.  memory location»
  6544.  
  6545.  
  6546.  ■  «Syntax»
  6547.  
  6548.  «AUTOMATIC «names»»
  6549.  
  6550.  «Parameter                                 Description»
  6551.  
  6552.  «names»                                    «A list of variables or array
  6553.                                             names to be made automatic. If
  6554.                                             there is more than one variable,
  6555.                                             they must be separated by
  6556.                                             commas.»
  6557.  
  6558.  
  6559.  ■  «Remarks»
  6560.  
  6561.  «In Microsoft FORTRAN, all variables are static by default. A variable
  6562.  declared as "automatic" has no fixed memory location; a section of stack
  6563.  memory is allocated for the variable as needed. Automatic variables within
  6564.  procedures are discarded when the procedure completes execution. Therefore,
  6565.  such variables cannot be guaranteed to have the same value on the next
  6566.  invocation of the procedure.»
  6567.  
  6568.  «If an AUTOMATIC statement contains no variable names, all the variables
  6569.  within that program unit (the main program, or an individual subprogram)
  6570.  that can legally be automatic are implicitly automatic.»
  6571.  
  6572.  «Common-block names and variables are not allowed in an AUTOMATIC statement.
  6573.  A variable cannot appear in both a SAVE statement and an AUTOMATIC
  6574.  statement.»
  6575.  
  6576.  «Variables with the ALLOCATABLE, EXTERNAL, FAR, or HUGE attribute cannot be
  6577.  automatic. A variable that has been explicitly declared automatic may not
  6578.  appear in a DATA statement. Variables that are implicitly automatic and
  6579.  appear in a DATA statement will be initialized and placed in static memory.
  6580.  A variable may appear in an AUTOMATIC statement only once. Formal arguments
  6581.  and procedure names may not appear in an AUTOMATIC statement.»
  6582.  
  6583.  «The ability to declare automatic variables has been added to support OS/2
  6584.  multithread applications.»
  6585.  
  6586.  
  6587.  ■  «Example»
  6588.  
  6589.      «C     In this example, all variables within the program unit
  6590.       C     are automatic, except for "clark" and "lois"; these are
  6591.       C     explicitly declared in a SAVE statement, and thus have
  6592.       C     static memory locations:
  6593.  
  6594.             INTEGER FUNCTION  Fibonacci (clark, lois)
  6595.             AUTOMATIC
  6596.             SAVE  clark, lois»
  6597.  
  6598.  
  6599.  BACKSPACE
  6600.  
  6601.  
  6602.  ■  Action
  6603.  
  6604.  Positions the file connected to the specified unit at the beginning of the
  6605.  preceding record
  6606.  
  6607.  
  6608.  ■  Syntax
  6609.  
  6610.       BACKSPACE {unitspec |
  6611.       («UNIT=»unitspec
  6612.       «, ERR=errlabel»
  6613.       «, IOSTAT=iocheck»)}
  6614.  
  6615.  If UNIT= is omitted, unitspec must be the first parameter. The parameters
  6616.  can otherwise appear in any order.
  6617.  
  6618.  Parameter                                  Description
  6619.  
  6620.  unitspec                                   An integer expression that
  6621.                                             specifies an external unit. If
  6622.                                             unitspec is not open, a run-time
  6623.                                             error occurs.
  6624.  
  6625.  errlabel                                   The label of an executable
  6626.                                             statement in the same program
  6627.                                             unit. If errlabel is specified,
  6628.                                             an I/O error causes transfer of
  6629.                                             control to the statement at
  6630.                                             errlabel. If errlabel is omitted,
  6631.                                             the effect of an I/O error is
  6632.                                             determined by the presence or
  6633.                                             absence of iocheck.
  6634.  
  6635.  iocheck                                    An integer variable, array
  6636.                                             element, «or structure element»
  6637.                                             that returns a value of zero if
  6638.                                             no error occurs, or the number of
  6639.                                             the run-time error message if an
  6640.                                             error does occur. For more
  6641.                                             information on error handling,
  6642.                                             see Section 3.2.6, "Error and
  6643.                                             End-of-File Handling."
  6644.  
  6645.  
  6646.  ■  Remarks
  6647.  
  6648.  The BACKSPACE statement backs up by exactly one record, except in the
  6649.  following special cases:
  6650.  
  6651.  Special Case                               Result
  6652.  
  6653.  No preceding record                        The file position is not changed
  6654.  
  6655.  Preceding record is end-of-file            The file is positioned before the
  6656.  record                                     end-of-file record
  6657.  
  6658.  File position is in middle of              The file is positioned to the
  6659.  record                                     start of that record
  6660.  
  6661.  If a parameter of the BACKSPACE statement is an expression that calls a
  6662.  function, that function must not cause an I/O statement «or the EOF
  6663.  intrinsic function» to be executed, because the results are unpredictable.
  6664.  
  6665.  
  6666.  ■  Examples
  6667.  
  6668.             BACKSPACE 5
  6669.             BACKSPACE (5)
  6670.             BACKSPACE lunit
  6671.             BACKSPACE (UNIT = lunit, ERR = 30, IOSTAT = ios)
  6672.  
  6673.  
  6674.  BLOCK DATA
  6675.  
  6676.  
  6677.  ■  Action
  6678.  
  6679.  Identifies a block-data subprogram, where variables and array elements in
  6680.  named common blocks can be initialized
  6681.  
  6682.  
  6683.  ■  Syntax
  6684.  
  6685.       BLOCK DATA «blockdataname»
  6686.  
  6687.  Parameter                                  Description
  6688.  
  6689.  blockdataname                              A global symbolic name for the
  6690.                                             subprogram.
  6691.  
  6692.                                             This name must not be the same as
  6693.                                             any of the names for local
  6694.                                             variables or array elements
  6695.                                             defined in the subprogram labeled
  6696.                                             by blockdataname, and it must not
  6697.                                             be the same as any of the names
  6698.                                             given to the main program,
  6699.                                             external procedures, common
  6700.                                             blocks, or other block-data
  6701.                                             subprograms.
  6702.  
  6703.  
  6704.  ■  Remarks
  6705.  
  6706.  The BLOCK DATA statement must be the first statement in a block-data
  6707.  subprogram.
  6708.  
  6709.  Only one unnamed block-data subprogram may appear in an executable program.
  6710.  Otherwise, the default name will be defined twice, causing an error.
  6711.  
  6712.  The following restrictions apply to the use of block-data subprograms:
  6713.  
  6714.    ■  The only statements that may be used in a block-data subprogram are
  6715.       BLOCK DATA, COMMON, DATA, END, DIMENSION, EQUIVALENCE, IMPLICIT, «MAP,»
  6716.       PARAMETER, «RECORD,» SAVE, «STRUCTURE, UNION,» and type statements. No
  6717.       executable statements are permitted.
  6718.  
  6719.    ■  Only an entity defined in a named common block may be initially defined
  6720.       in a block-data subprogram.
  6721.  
  6722.    ■  All the constituents of a named common block must be specified in that
  6723.       block-data subprogram, even if not all of the constituents are
  6724.       initialized. This is because the length of the named common block must
  6725.       be the same in all subprograms.
  6726.  
  6727.  
  6728.  ■  Examples
  6729.  
  6730.       C     The following block-data subprogram initializes
  6731.       C     the named common block /greatlakes/:
  6732.       C
  6733.             BLOCK DATA Lakes
  6734.             COMMON /greatlakes/ erie, huron, michigan, ontario, superior
  6735.             DATA erie, huron, michigan, ontario, superior /1, 2, 3, 4, 5/
  6736.             END
  6737.       C
  6738.       C     Using the same common block, /greatlakes/, the
  6739.       C     following block-data subprogram is NOT allowed;
  6740.       C     not all the members of /greatlakes/ are specified.
  6741.  
  6742.             BLOCK DATA GrLaks
  6743.             COMMON /greatlakes/ erie, huron, ontario, superior
  6744.             DATA erie, huron, ontario, superior /1, 2, 4, 5/
  6745.             END
  6746.  
  6747.  
  6748.  CALL
  6749.  
  6750.  
  6751.  ■  Action
  6752.  
  6753.  Invokes a subroutine
  6754.  
  6755.  
  6756.  ■  Syntax
  6757.  
  6758.       CALL sub «(«actuals»)»
  6759.  
  6760.  Parameter                                  Description
  6761.  
  6762.  sub                                        The name of the subroutine to be
  6763.                                             executed.
  6764.  
  6765.  actuals                                    One or more actual arguments.
  6766.  
  6767.                                             If there is more than one
  6768.                                             argument, they are separated by
  6769.                                             commas. Each argument can be an
  6770.                                             alternate-return specifier
  6771.                                             (*label); a constant, variable,
  6772.                                             or expression; an array or array
  6773.                                             element; the name of a subroutine
  6774.                                             or external function; the name of
  6775.                                             an intrinsic function that can be
  6776.                                             passed as an argument«; or a
  6777.                                             Hollerith constant».
  6778.  
  6779.  
  6780.  ■  Remarks
  6781.  
  6782.  Execution of a CALL statement proceeds as follows:
  6783.  
  6784.    1. Arguments that are expressions are evaluated.
  6785.  
  6786.    2. Actual arguments are associated with their corresponding formal
  6787.       arguments.
  6788.  
  6789.    3. The body of the specified subroutine is executed.
  6790.  
  6791.    4. Control returns to the calling program or procedure, either to a
  6792.       statement specified by an alternate return or to the statement
  6793.       following the CALL statement.
  6794.  
  6795.  A subroutine can be called from any program unit.
  6796.  
  6797.  A CALL statement must contain as many actual arguments as there are formal
  6798.  arguments in the corresponding SUBROUTINE statement «(unless the C and
  6799.  VARYING attributes were used in declaring the subroutine)».
  6800.  
  6801.  If a SUBROUTINE statement contains no formal arguments, a CALL statement
  6802.  referencing that subroutine must not include any actual arguments. However,
  6803.  an empty pair of parentheses can follow sub.
  6804.  
  6805.  Formal arguments and their corresponding actual arguments must have the same
  6806.  data type (except for Hollerith constants). «When the actual argument is a
  6807.  Hollerith constant, the formal argument need not be the same type, as long
  6808.  as it is of type INTEGER, REAL, or LOGICAL.»
  6809.  
  6810.  For all arguments passed by reference «(see Section 1.6.11, "VALUE," for
  6811.  information on passing arguments by value)», the compiler assumes the type
  6812.  of the formal argument is the same as the type of the corresponding actual
  6813.  argument. If the type of the formal argument is known, it is used only to
  6814.  check that the arguments have the same data type.
  6815.  
  6816.  If a subroutine call appears more than once in a program unit, the compiler
  6817.  checks that the number and types of actual arguments passed are the same in
  6818.  each call (i.e., consistency).
  6819.  
  6820.  The compiler also checks that the actual arguments used in calls to a
  6821.  subroutine correspond in number and type to its formal arguments (i.e.,
  6822.  validity). In order to do this, the SUBROUTINE statement «(or an INTERFACE
  6823.  TO statement defining the subroutine)» must appear in the same source file
  6824.  as any calls to it, and it must precede those calls. The compiler will then
  6825.  ensure that all actual arguments agree with the formal arguments. If the
  6826.  actual arguments are not checked in this way, and if they do not agree with
  6827.  the formal arguments, the result of calling a subroutine is unpredictable.
  6828.  
  6829.  ───────────────────────────────────────────────────────────────────────────
  6830.  «NOTE»
  6831.     «When passing integer and logical arguments, you must pay attention to
  6832.     type agreement. The $STORAGE metacommand controls how integer and logical
  6833.     arguments are passed. When the default ($STORAGE:4) is in effect, all
  6834.     actual arguments that are integer or logical constants or expressions are
  6835.     assigned to INTEGER*4 or LOGICAL*4 temporary variables. When $STORAGE:2
  6836.     is in effect, all actual arguments that are integer or logical constants
  6837.     or expressions are assigned to temporary variables of type INTEGER*2 or
  6838.     LOGICAL*2.»
  6839.  
  6840.     «Therefore, if an integer or logical formal argument is of a different
  6841.     type than the default storage type, you must convert the actual argument
  6842.     to the same type. Use the INT2 and INT4 intrinsic functions within the
  6843.     actual argument list, as described in Section 5.1.1, "Data-Type
  6844.     Conversion."»
  6845.  ───────────────────────────────────────────────────────────────────────────
  6846.  
  6847.  The alternate-return feature lets you specify the statement to which a
  6848.  subroutine should return control. To use the alternate-return feature,
  6849.  follow these steps:
  6850.  
  6851.    1. Choose the statements in the calling routine to which you wish to
  6852.       return control. Enter the labels of these statements, preceded by
  6853.       asterisks, in the actual argument list of the CALL statement, as in
  6854.       this statement:
  6855.  
  6856.         CALL INVERT (row, column, *100, *200, *500)
  6857.  
  6858.    2. In the corresponding SUBROUTINE statement, enter asterisks for the
  6859.       formal arguments corresponding to the *label actual arguments in the
  6860.       CALL statement, as in the following SUBROUTINE statement:
  6861.  
  6862.         SUBROUTINE INVERT (r, c, *, *, *)
  6863.  
  6864.    3. In the subroutine, have at least one RETURN statement for each
  6865.       alternate return. As arguments for these RETURN statements, specify a 1
  6866.       for the RETURN statement that should return control to the first
  6867.       statement label in the CALL statement; a 2 for the RETURN statement
  6868.       that should return control to the second statement label in the CALL
  6869.       statement; and so on.
  6870.  
  6871.       For example, if the statement RETURN 1 is reached in the program
  6872.       containing the two statements in steps 1 and 2 above, control returns
  6873.       to the statement at label 100 in the calling routine; if RETURN 2 is
  6874.       reached, control returns to the statement at label 200; and if RETURN 3
  6875.       is reached, control returns to the statement at label 500. If a RETURN
  6876.       statement without any number is reached (RETURN), or a RETURN statement
  6877.       that has a number for which there is no corresponding return label is
  6878.       reached (such as RETURN 4, in this example), control returns to the
  6879.       statement following the CALL statement in the calling routine.
  6880.  
  6881.       A "recursive" subroutine is one that calls itself, or calls another
  6882.       subprogram which in turn calls the first subroutine before the first
  6883.       subroutine has completed execution. FORTRAN does not support recursive
  6884.       subroutine calls.
  6885.  
  6886.  
  6887.  ■  Examples
  6888.  
  6889.             .
  6890.             .
  6891.             .
  6892.             IF (ierr .NE. 0)  CALL Error (ierr)
  6893.             END
  6894.       C
  6895.             SUBROUTINE Error (ierrno)
  6896.             WRITE (*, 200) ierrno
  6897.         200 FORMAT (1X, 'error', I5, ' detected')
  6898.             END
  6899.  
  6900.       C     This example illustrates the alternate return feature:
  6901.           1 CALL Boomerang (count, *10, j, *20, *30)
  6902.             WRITE (*, *) 'normal return'
  6903.             GOTO 40
  6904.          10 WRITE (*, *) 'returned to 10'
  6905.             GOTO 40
  6906.          20 WRITE (*, *) 'returned to 20'
  6907.             GOTO 40
  6908.          30 WRITE (*, *) 'returned to 30'
  6909.          40 CONTINUE
  6910.             .
  6911.             .
  6912.             .
  6913.             SUBROUTINE Boomerang (i, *, j, *, *)
  6914.             IF (i .EQ. 10)  RETURN 1
  6915.             IF (i .EQ. 20)  RETURN 2
  6916.             IF (i .EQ. 30)  RETURN 3
  6917.             RETURN
  6918.  
  6919.  
  6920.  CASE
  6921.  
  6922.  
  6923.  ■  «Action»
  6924.  
  6925.  «Marks the beginning of a block of statements executed if an item in a list
  6926.  of expressions matches the test expression»
  6927.  
  6928.  
  6929.  ■  «Syntax»
  6930.  
  6931.       «CASE {DEFAULT | (expressionlist)}
  6932.                     statementblock»
  6933.  
  6934.  «Parameter                                 Description»
  6935.  
  6936.  «DEFAULT»                                  «The keyword indicating that the
  6937.                                             following statement block is to
  6938.                                             be executed if none of the
  6939.                                             expressions in any other CASE
  6940.                                             statements match the test
  6941.                                             expression in the SELECT CASE
  6942.                                             statement.»
  6943.  
  6944.  «expressionlist»                           «A list of values and ranges of
  6945.                                             values, which must be constant
  6946.                                             and must match the data type of
  6947.                                             the test expression in the SELECT
  6948.                                             CASE statement. The values must
  6949.                                             be of type INTEGER, LOGICAL, or
  6950.                                             CHARACTER*1. If testexpr matches
  6951.                                             one of the values, the following
  6952.                                             block of statements is executed.»
  6953.  
  6954.  «statementblock»                           «One or more executable
  6955.                                             statements. The block may also be
  6956.                                             empty.»
  6957.  
  6958.  
  6959.  ■  «Remarks»
  6960.  
  6961.  «The CASE statement may only appear within the SELECT CASE...END CASE
  6962.  construct.»
  6963.  
  6964.  «There are two ways to include values in the expressionlist. The first is to
  6965.  give a list of individual values, separated by commas. The second is to
  6966.  specify an inclusive range of values, separated by a colon, such as 5:10. If
  6967.  the lower bound is omitted (such as :10), then all values less than or equal
  6968.  to the upper bound match. If the upper bound is omitted (such as 5:), then
  6969.  all values greater than or equal to the lower bound match. Ranges of
  6970.  printable ASCII characters may be included, such as 'I':'N' or ' ':'/' .
  6971.  Both individual values and ranges of values may be included in the same
  6972.  expressionlist. You cannot specify a range of values when testexpr is of
  6973.  type LOGICAL. A given value (even when specified implicitly as part of a
  6974.  range) can only appear in one expressionlist.»
  6975.  
  6976.  «A statementblock need not contain executable statements. Empty blocks can
  6977.  be used to make it clear that no action is to be taken for a particular set
  6978.  of expression values.»
  6979.  
  6980.  «The CASE DEFAULT statement is optional. You can include only one CASE
  6981.  DEFAULT statement in a SELECT CASE block.»
  6982.  
  6983.  «If the value of testexpr does not match any value in any expressionlist,
  6984.  execution passes beyond the SELECT CASE construct to the next executable
  6985.  statement.»
  6986.  
  6987.  
  6988.  ■  «Example»
  6989.  
  6990.            «CHARACTER*1  cmdchar
  6991.  
  6992.             SELECT CASE (cmdchar)
  6993.             CASE ('0')
  6994.             WRITE (*, *) "Must retrieve one to nine files"
  6995.             CASE ('1':'9')
  6996.             CALL RetrieveNumFiles (cmdchar)
  6997.             CASE ('A', 'd')
  6998.             CALL AddEntry
  6999.             CASE ('D', 'd')
  7000.             CALL DeleteEntry
  7001.             CASE ('H', 'h')
  7002.             CALL Help
  7003.             CASE ('R':'T', 'r':'t')
  7004.             WRITE (*, *) "REDUCE, SPREAD and TRANSFER commands ",
  7005.            +                          "not yet supported"
  7006.             CASE DEFAULT
  7007.             WRITE (*, *) "Command not recognized; please re-enter"
  7008.             END SELECT»
  7009.  
  7010.  
  7011.  ■  «See also»
  7012.  
  7013.  «SELECT CASE...END SELECT»
  7014.  
  7015.  
  7016.  CHARACTER
  7017.  
  7018.  
  7019.  ■  Action
  7020.  
  7021.  Specifies the CHARACTER type for user-defined names
  7022.  
  7023.  
  7024.  ■  Syntax
  7025.  
  7026.       CHARACTER«*chars» vname ««[attrs]»»«*length»«(dim)»
  7027.       ««/values/»»«, vname ««[attrs]»»«*length»«(dim)»»
  7028.       ««/values/»»...
  7029.  
  7030.  The order of the dim and length parameters can be reversed.
  7031.  
  7032.  Parameter                                  Description
  7033.  
  7034.  chars                                      An unsigned integer constant in
  7035.                                             the range 1 through 32,767; an
  7036.                                             integer constant expression
  7037.                                             (evaluating to an integer between
  7038.                                             1 and 32,767) in parentheses; or
  7039.                                             an asterisk (*) (see REMARKS,
  7040.                                             below) in parentheses. The chars
  7041.                                             parameter specifies the length,
  7042.                                             in characters, of the items
  7043.                                             specified in the CHARACTER
  7044.                                             statement. This value can be
  7045.                                             overridden by the length
  7046.                                             parameter.
  7047.  
  7048.  vname                                      The symbolic name of a constant,
  7049.                                             variable, array, external
  7050.                                             function, statement function, or
  7051.                                             intrinsic function; or a function
  7052.                                             subprogram or an array
  7053.                                             declarator. The parameter vname
  7054.                                             cannot be the name of a
  7055.                                             subroutine or main program.
  7056.  
  7057.  «attrs»                                    «A list of attributes, separated
  7058.                                             by commas. The attrs describe
  7059.                                             vname. The following attributes
  7060.                                             can be used with vname: ALIAS,
  7061.                                             ALLOCATABLE, C, EXTERN, FAR,
  7062.                                             HUGE, NEAR, PASCAL, REFERENCE,
  7063.                                             VALUE.»
  7064.  
  7065.  length                                     An unsigned integer constant in
  7066.                                             the range 1 through 32,767; an
  7067.                                             integer constant expression
  7068.                                             (evaluating to an integer between
  7069.                                             1 and 32,767) in parentheses; or
  7070.                                             an asterisk (*) in parentheses.
  7071.                                             The length parameter specifies
  7072.                                             the length, in characters, of the
  7073.                                             vname immediately preceding it.
  7074.                                             This value, if specified,
  7075.                                             overrides the length indicated by
  7076.                                             chars.
  7077.  
  7078.  dim                                        A dimension declarator.
  7079.                                             Specifying dim declares vname as
  7080.                                             an array.
  7081.  
  7082.  «values»                                   «A list of constants and repeated
  7083.                                             constants, separated by commas. A
  7084.                                             repeated constant is written in
  7085.                                             the form n*constant, where n is a
  7086.                                             positive integer constant, and is
  7087.                                             equivalent to constant repeated n
  7088.                                             times. The /values/ option, if
  7089.                                             specified, initializes vname. The
  7090.                                             following statement declares word
  7091.                                             of type CHARACTER, and sets word
  7092.                                             equal to 'start':»
  7093.  
  7094.                                                «CHARACTER*5 word /'start'/»
  7095.  
  7096.  
  7097.  ■  Remarks
  7098.  
  7099.  A CHARACTER statement confirms or overrides the implicit type of vname. The
  7100.  name vname is defined for the entire program unit and cannot be defined by
  7101.  any other type statement in that program unit.
  7102.  
  7103.  An asterisk in parentheses ((*)) as a length specifier indicates that the
  7104.  length is specified elsewhere. An asterisk length specifier is allowed in
  7105.  the following cases:
  7106.  
  7107.    1. Character constants defined by PARAMETER statements. The actual length
  7108.       is determined by the length of the character string assigned to the
  7109.       parameter.
  7110.  
  7111.    2. Formal character arguments. The actual length is determined by the
  7112.       length of the actual argument.
  7113.  
  7114.    3. Character functions that are defined in one program unit, and
  7115.       referenced in another. The actual length is determined by a type
  7116.       declaration in the program unit that references the function.
  7117.  
  7118.  If neither length nor chars is specified, the length defaults to one.
  7119.  
  7120.  CHARACTER statements must precede all executable statements.
  7121.  
  7122.  
  7123.  ■  Examples
  7124.  
  7125.             CHARACTER  wt*10, city*80, ch
  7126.  
  7127.             CHARACTER  name(10)*20, eman*20(10)
  7128.  
  7129.             CHARACTER*20  tom, dick, harry*12, tarzan, jane*34
  7130.  
  7131.  
  7132.  CLOSE
  7133.  
  7134.  
  7135.  ■  Action
  7136.  
  7137.  Disconnects a specified unit
  7138.  
  7139.  
  7140.  ■  Syntax
  7141.  
  7142.       CLOSE («UNIT=»unitspec
  7143.       «, ERR=errlabel»
  7144.       «, IOSTAT=iocheck»
  7145.       «, STATUS=status»)
  7146.  
  7147.  If UNIT= is omitted, unitspec must be the first parameter. The parameters
  7148.  can otherwise appear in any order.
  7149.  
  7150.  Parameter                                  Description
  7151.  
  7152.  unitspec                                   An integer expression that
  7153.                                             specifies an external unit. No
  7154.                                             error occurs if the unit is not
  7155.                                             open.
  7156.  
  7157.  errlabel                                   The label of an executable
  7158.                                             statement in the same program
  7159.                                             unit. If errlabel is specified,
  7160.                                             an I/O error causes transfer of
  7161.                                             control to the statement at
  7162.                                             errlabel. If errlabel is omitted,
  7163.                                             the effect of an I/O error is
  7164.                                             determined by the presence or
  7165.                                             absence of iocheck.
  7166.  
  7167.  iocheck                                    An integer variable, array
  7168.                                             element, «or structure element»
  7169.                                             that returns a value of zero if
  7170.                                             there is no error, or the number
  7171.                                             of the run-time error if an error
  7172.                                             occurs. For more information on
  7173.                                             error handling, see Section
  7174.                                             3.2.6, "Error and End-of-File
  7175.                                             Handling."
  7176.  
  7177.  status                                     A character expression that
  7178.                                             evaluates to either 'KEEP' or
  7179.                                             'DELETE'.
  7180.  
  7181.                                             Files opened without a file name
  7182.                                             are "scratch" files. For these
  7183.                                             files, the default for status is
  7184.                                             'DELETE'. Scratch files are
  7185.                                             temporary, and are always deleted
  7186.                                             upon normal program termination;
  7187.                                             specifying STATUS='KEEP' for
  7188.                                             scratch files causes a run-time
  7189.                                             error. The default for status for
  7190.                                             all other files is 'KEEP'.
  7191.  
  7192.  
  7193.  ■  Remarks
  7194.  
  7195.  Opened files do not have to be explicitly closed. Normal termination of a
  7196.  program will close each file according to its default status.
  7197.  
  7198.  «Closing unit 0 automatically reconnects unit 0 to the keyboard and screen.
  7199.  Closing units 5 and 6 automatically reconnects those units to the keyboard
  7200.  or screen, respectively.» Closing the asterisk (*) unit causes a
  7201.  compile-time error.
  7202.  
  7203.  If a parameter of the CLOSE statement is an expression that calls a
  7204.  function, that function must not cause an I/O operation «or the EOF
  7205.  intrinsic function» to be executed, because the results are unpredictable.
  7206.  
  7207.  
  7208.  ■  Example
  7209.  
  7210.       C     Close and discard file:
  7211.             CLOSE (7, STATUS = 'DELETE')
  7212.  
  7213.  
  7214.  COMMON
  7215.  
  7216.  
  7217.  ■  Action
  7218.  
  7219.  Allows two or more program units to directly share variables, without having
  7220.  to pass them as arguments
  7221.  
  7222.  
  7223.  ■  Syntax
  7224.  
  7225.       COMMON «/«cname»««[attrs]»»/» nlist ««,»/«cname»
  7226.       ««[attrs]»»/nlist»...
  7227.  
  7228.  Parameter                                  Description
  7229.  
  7230.  cname                                      A name for the common block. If
  7231.                                             none is given, the block is said
  7232.                                             to be "blank common." Omitting
  7233.                                             cname specifies that all elements
  7234.                                             in the nlist that follows are in
  7235.                                             the blank common block.
  7236.  
  7237.  «attrs»                                    «A list of attributes, separated
  7238.                                             by commas. The attributes
  7239.                                             describe cname. Only ALIAS, C,
  7240.                                             FAR, NEAR, and PASCAL can be used
  7241.                                             with common-block names.»
  7242.  
  7243.  nlist                                      A list of variable names, array
  7244.                                             names, and array declarators,
  7245.                                             separated by commas.
  7246.  
  7247.                                             Formal-argument names, function
  7248.                                             names, «automatic variables, and
  7249.                                             allocatable arrays» cannot appear
  7250.                                             in a COMMON statement. In each
  7251.                                             COMMON statement, all variables
  7252.                                             and arrays appearing in each
  7253.                                             nlist following a common-block
  7254.                                             name are declared to be in that
  7255.                                             common block.
  7256.  
  7257.  
  7258.  ■  Remarks
  7259.  
  7260.  Any common block can appear more than once in the same program unit. The
  7261.  list of elements in a particular common block is treated as a continuation
  7262.  of the list in the previous common block with the same name. For this
  7263.  reason, a given name can appear only once in all the common blocks of a
  7264.  program unit. Consider the following COMMON statements:
  7265.  
  7266.             COMMON /ralph/ ed, norton, trixie
  7267.             COMMON /     / fred, ethel, lucy
  7268.             COMMON /ralph/ audrey, meadows
  7269.             COMMON /jerry/ mortimer, tom, mickey
  7270.             COMMON         melvin, purvis
  7271.  
  7272.  They are equivalent to these COMMON statements:
  7273.  
  7274.             COMMON /ralph/ ed, norton, trixie, audrey, meadows
  7275.             COMMON         fred, ethel, lucy, melvin, purvis
  7276.             COMMON /jerry/ mortimer, tom, mickey
  7277.  
  7278.  All items in a common block must be only character or only noncharacter
  7279.  items. «Microsoft FORTRAN permits both character and noncharacter items in
  7280.  the same common block.»
  7281.  
  7282.  Microsoft FORTRAN normally starts all variables and arrays (including
  7283.  character variables and arrays) on even-byte addresses. If a single
  7284.  (non-array) character variable has an «»odd length, the next variable in
  7285.  memory (regardless of type) begins at the next even-byte address.«
  7286.  
  7287.  There are, however,  two exceptions. In an array of character variables,
  7288.  each element immediately follows the preceding element, without regard for
  7289.  even or odd addresses. Within a common block, a character variable that
  7290.  follows another character variable always begins on the next available byte.
  7291.  (Noncharacter variables still begin on an even byte.)
  7292.  
  7293.  «This can cause problems if a common block contains odd-length character
  7294.  variables interspersed with noncharacter variables. If the matching common
  7295.  block in another program unit contains only noncharacter variables (in
  7296.  effect, equivalencing the variables), there will be holes in the equivalence
  7297.  due to unused bytes in the block with the odd-length character variables.»
  7298.  
  7299.  The length of a common block equals the number of bytes of memory required
  7300.  to hold all elements in that common block. If several distinct program units
  7301.  refer to the same named common block, the common block must be the same
  7302.  length in each program unit. The blank common block, however, can have a
  7303.  different length in different program units. The blank common block is as
  7304.  long as the longest blank common block in any of the the program units.
  7305.  
  7306.  A variable that appears in a common block may not be initialized in a DATA
  7307.  statement unless that DATA statement is part of a block data subprogram. «In
  7308.  Microsoft FORTRAN, common-block variables may be initialized in DATA
  7309.  statements in any program unit.»
  7310.  
  7311.  «An item that appears in nlist cannot be initialized in a type statement.
  7312.  The following example causes a compile-time error:»
  7313.  
  7314.            «INTEGER i /1/
  7315.             COMMON i»
  7316.  
  7317.  
  7318.  ■  Example
  7319.  
  7320.             PROGRAM MyProg
  7321.             COMMON i, j, x, k(10)
  7322.             COMMON /mycom/ a(3)
  7323.             .
  7324.             .
  7325.             .
  7326.             END
  7327.  
  7328.             SUBROUTINE MySub
  7329.             COMMON pe, mn, z, idum(10)
  7330.             COMMON /mycom/ a(3)
  7331.             .
  7332.             .
  7333.             .
  7334.             END
  7335.  
  7336.  
  7337.  COMPLEX
  7338.  
  7339.  
  7340.  ■  Action
  7341.  
  7342.  Specifies the COMPLEX type for user-defined names
  7343.  
  7344.  
  7345.  ■  Syntax
  7346.  
  7347.       COMPLEX««*bytes»» vname««[attrs]»«*length»»«(dim)»
  7348.       ««/values/»»«,vname««[attrs]»«*length»»
  7349.       «(dim)»««/values/»»»...
  7350.  
  7351.  The order of the length and dim parameters can be reversed.
  7352.  
  7353.  Parameter                                  Description
  7354.  
  7355.  «bytes»                                    «Must be 8 or 16. The bytes
  7356.                                             parameter specifies the length,
  7357.                                             in bytes, of the items specified
  7358.                                             by the COMPLEX statement. This
  7359.                                             value can be overridden by the
  7360.                                             length parameter.»
  7361.  
  7362.  vname                                      The symbolic name of a constant,
  7363.                                             variable, array, external
  7364.                                             function, statement function,
  7365.                                             intrinsic function, function
  7366.                                             subprogram, or array declarator.
  7367.                                             The vname parameter cannot be the
  7368.                                             name of a subroutine or a main
  7369.                                             program.
  7370.  
  7371.  «attrs»                                    «A list of attributes separated
  7372.                                             by commas. The attrs describe
  7373.                                             vname. The following attributes
  7374.                                             can be used with vname: ALIAS,
  7375.                                             ALLOCATABLE, C, EXTERN, FAR,
  7376.                                             HUGE, NEAR, PASCAL, REFERENCE,
  7377.                                             VALUE.»
  7378.  
  7379.  «length»                                   «Must be 8 or 16. Specifies
  7380.                                             length of associated vname, in
  7381.                                             bytes. If length is given, it
  7382.                                             overrides the length specified by
  7383.                                             bytes.»
  7384.  
  7385.  dim                                        A dimension declarator.
  7386.                                             Specifying dim declares vname as
  7387.                                             an array.
  7388.  
  7389.  «values»                                   «A list of constants and repeated
  7390.                                             constants, separated by commas. A
  7391.                                             repeated constant is written in
  7392.                                             the form n*constant, where n is a
  7393.                                             positive integer constant, and is
  7394.                                             equivalent to the constant
  7395.                                             constant repeated n times. The
  7396.                                             /values/ option, if specified,
  7397.                                             initializes vname. The following
  7398.                                             statement declares that vector is
  7399.                                             of type complex, and sets vector
  7400.                                             equal to (32.0,10.0):»
  7401.  
  7402.                                              «COMPLEX vector / (32.0,10.0) /»
  7403.  
  7404.  
  7405.  ■  Remarks
  7406.  
  7407.  A COMPLEX statement confirms or overrides the implicit type of vname. The
  7408.  name vname is defined for the entire program unit and cannot be defined by
  7409.  any other type statement in that program unit.
  7410.  
  7411.  COMPLEX statements must precede all executable statements.
  7412.  
  7413.  «DOUBLE COMPLEX and COMPLEX*16 represent the same data type.»
  7414.  
  7415.  
  7416.  ■  Examples
  7417.  
  7418.             COMPLEX  ch, zdif«*8», xdif«*16»
  7419.  
  7420.             COMPLEX«*8»  zz
  7421.  
  7422.             «COMPLEX*16  ax, by»
  7423.  
  7424.             COMPLEX  «x*16», y(10)«*8», «z*16(10)»
  7425.  
  7426.  
  7427.  CONTINUE
  7428.  
  7429.  
  7430.  ■  Action
  7431.  
  7432.  Does not have any effect
  7433.  
  7434.  
  7435.  ■  Syntax
  7436.  
  7437.       CONTINUE
  7438.  
  7439.  
  7440.  ■  Remarks
  7441.  
  7442.  The CONTINUE statement is a convenient place for a statement label,
  7443.  especially as the terminal statement in a DO «or DO WHILE» loop.
  7444.  
  7445.  
  7446.  ■  Example
  7447.  
  7448.             DIMENSION narray(10)
  7449.             DO 100, n = 1, 10
  7450.                narray(n) = 120
  7451.         100 CONTINUE
  7452.  
  7453.  
  7454.  CYCLE
  7455.  
  7456.  
  7457.  ■  «Action»
  7458.  
  7459.  «Within a loop, advances control to the terminating statement of a DO or DO
  7460.  WHILE loop»
  7461.  
  7462.  
  7463.  ■  «Syntax»
  7464.  
  7465.  «CYCLE»
  7466.  
  7467.  
  7468.  ■  «Remarks»
  7469.  
  7470.  «The CYCLE statement skips over the remaining part of a DO or DO WHILE loop.
  7471.  By combining a CYCLE statement with a logical IF statement, you can control
  7472.  whether the subsequent code executes.»
  7473.  
  7474.  
  7475.  ■  «Example»
  7476.  
  7477.  «Suppose you wanted to print a table of relativistic time-dilation factors
  7478.  for every velocity from 0 to the speed of light, in steps of 100 km/second.
  7479.  Perhaps you do not want to calculate these factors for speeds less than 10
  7480.  percent of the speed of light. The following example computes the
  7481.  time-dilation factors accordingly, putting them in the array timedilation.
  7482.  You can use the WRITE statement to print out the array.»
  7483.  
  7484.  «Time-dilation factor:  1 / √(1 - (v/c)^(2))»
  7485.  
  7486.            «INTEGER sub        ! subscript for timedilation array
  7487.             REAL timedilation(0:300)
  7488.             speedolight = 300000e3        ! 300000 km per second
  7489.             speedstep = 100e3             ! 100 km per second
  7490.  
  7491.                sub = speedolight / speedstep
  7492.             DO velocity = 1, speedolight, speedstep
  7493.                timedilation(sub) = 1.0
  7494.                IF (velocity .LT. (0.1 * speedolight))   CYCLE
  7495.                timedilation(sub) =
  7496.            +   1.0 / SQRT (1.0 - (velocity / speedolight)**2)
  7497.             END DO»
  7498.  
  7499.  
  7500.  DATA
  7501.  
  7502.  
  7503.  ■  Action
  7504.  
  7505.  Assigns initial values to variables
  7506.  
  7507.  
  7508.  ■  Syntax
  7509.  
  7510.       DATA nlist /clist/ ««,» nlist /clist/»...
  7511.  
  7512.  Parameter                                  Description
  7513.  
  7514.  nlist                                      A list of variables, array
  7515.                                             elements, array names, substring
  7516.                                             names, «structure elements,» and
  7517.                                             implied-DO lists, separated by
  7518.                                             commas. Implied-DO lists are
  7519.                                             discussed in the REMARKS section
  7520.                                             below.
  7521.  
  7522.                                             Each subscript in nlist must be
  7523.                                             an integer constant expression,
  7524.                                             except for implied-DO variables.
  7525.                                             Each substring specifier in nlist
  7526.                                             must be an integer constant
  7527.                                             expression.
  7528.  
  7529.  clist                                      A list of constants and/or
  7530.                                             repeated constants «and/or
  7531.                                             Hollerith constants», separated
  7532.                                             by commas. A repeated constant is
  7533.                                             written in the form n*c, where
  7534.                                             the repeat factor n is a positive
  7535.                                             integer constant, and c is the
  7536.                                             constant to be repeated. The
  7537.                                             repeated constant 3*10, for
  7538.                                             example, is equivalent to the
  7539.                                             clist 10,10,10.
  7540.  
  7541.                                             «A Hollerith constant is written
  7542.                                             in the form nHdata, where n is a
  7543.                                             positive integer constant, and
  7544.                                             data is a string of n
  7545.                                             characters.»
  7546.  
  7547.                                             There must be the same number of
  7548.                                             values in each clist as there are
  7549.                                             variables or array elements in
  7550.                                             the corresponding nlist. The
  7551.                                             appearance of an array in an
  7552.                                             nlist is equivalent to a list of
  7553.                                             all elements in that array in
  7554.                                             column-major order. Array
  7555.                                             elements can be indexed only by
  7556.                                             constant subscripts.
  7557.  
  7558.  
  7559.  ■  Remarks
  7560.  
  7561.  «Structure variables and variables explicitly declared as automatic may not
  7562.  appear in DATA statements. However, structure elements may appear in DATA
  7563.  statements.»
  7564.  
  7565.  Each noncharacter element in clist is converted to the data type of the
  7566.  corresponding element in nlist, if necessary.
  7567.  
  7568.  If a character element in clist is shorter than its corresponding variable
  7569.  or array element, it is extended to the length of the variable by adding
  7570.  blank characters to the right. If a character element is longer than its
  7571.  variable or array element, it is truncated. A single character constant
  7572.  defines a single variable or array element. A repeat count can be used.
  7573.  
  7574.  «If the $STRICT metacommand is not specified, a character element in clist
  7575.  can initialize a variable of any type.»
  7576.  
  7577.  Only local variables, arrays, and array elements can appear in a DATA
  7578.  statement. Formal arguments, variables in blank common blocks, and function
  7579.  names cannot be assigned initial values in a DATA statement. Variables in
  7580.  named common blocks may not appear in a DATA statement unless the DATA
  7581.  statement is in a block-data subprogram. «In Microsoft FORTRAN, elements in
  7582.  named common blocks can be assigned initial values using a DATA statement in
  7583.  a main program, function, or subroutine; the DATA statement does not have to
  7584.  be in a block-data subprogram.»
  7585.  
  7586.  The form of an implied-DO list is as follows:
  7587.  
  7588.       (dolist, dovar = start, stop «, inc»)
  7589.  
  7590.  Parameter                                  Description
  7591.  
  7592.  dolist                                     A list of array-element names and
  7593.                                             implied-DO lists.
  7594.  
  7595.  dovar                                      The name of an integer variable
  7596.                                             called the implied-DO variable.
  7597.  
  7598.  start, stop, and inc                       The integer-constant expressions.
  7599.                                             Each expression can contain
  7600.                                             implied-DO variables (dovar) of
  7601.                                             other implied-DO lists that have
  7602.                                             this implied-DO list within their
  7603.                                             ranges.
  7604.  
  7605.  For example, the following are implied-DO lists:
  7606.  
  7607.       (count(i), i = 5, 15, 2)
  7608.       ((array(sub,low), low = 1, 12), sub = 1, 2)
  7609.       ((result(first,second), first = 1, max), second = 1, upper)
  7610.  
  7611.  The number of iterations and the values of the implied-DO variable are
  7612.  established from start, stop, and inc exactly as for a DO loop except that
  7613.  the iteration count must be positive. See the DO entry in this section for
  7614.  more information. When an implied-DO list appears in a DATA statement, the
  7615.  list items in dolist are initialized once for each iteration of the
  7616.  implied-DO  list. The range of an implied-DO list is dolist. If the program
  7617.  contains another variable with the same name as dovar, that variable is not
  7618.  affected by the use of dovar in a DATA statement.
  7619.  
  7620.  
  7621.  ■  Examples
  7622.  
  7623.             INTEGER n, order, alpha, list(100)
  7624.             REAL  coef(4), eps(2), pi(5), x(5,5)
  7625.             CHARACTER*12  help
  7626.  
  7627.             DATA  n /0/, order /3/
  7628.             DATA  alpha /'A'/
  7629.             DATA  coef /1.0, 2*3.0, 1.0/, eps(1) /.00001/
  7630.  
  7631.       C     The following example initializes diagonal and below in
  7632.       C     a 5x5 matrix:
  7633.             DATA  ((x(j,i), i=1,j), j=1,5) / 15*1.0 /
  7634.             DATA  pi / 5*3.14159 /
  7635.             DATA  list / 100*0 /
  7636.             DATA  help(1:4), help(5:8), help(9:12) /3*'HELP'/
  7637.  
  7638.  
  7639.  DEALLOCATE
  7640.  
  7641.  
  7642.  ■  «Action»
  7643.  
  7644.  «Frees the array storage space previously reserved in an ALLOCATE statement»
  7645.  
  7646.  
  7647.  ■  «Syntax»
  7648.  
  7649.       «DEALLOCATE (arraylist «, STAT = ierr»)»
  7650.  
  7651.  «Parameter                                 Description»
  7652.  
  7653.  «arraylist»                                «A list of allocatable array
  7654.                                             names; if more than one exists,
  7655.                                             they must be separated by
  7656.                                             commas.»
  7657.  
  7658.  «ierr»                                     «The integer variable that
  7659.                                             returns status of deallocation
  7660.                                             attempt.»
  7661.  
  7662.  
  7663.  ■  «Remarks»
  7664.  
  7665.  «The STAT= parameter must appear last.»
  7666.  
  7667.  «Attempting to deallocate an array that was not allocated causes a run-time
  7668.  error.»
  7669.  
  7670.  «Any deallocation failure causes a run-time error, unless the STAT=
  7671.  parameter is present. The ierr variable returns a value of zero if the
  7672.  deallocation was successful, and the number of the run-time error if the
  7673.  deallocation failed.»
  7674.  
  7675.  «If an allocatable array is referenced when it is not currently allocated,
  7676.  the results are unpredictable.»
  7677.  
  7678.  
  7679.  ■  «Example»
  7680.  
  7681.            «INTEGER  dataset[ALLOCATABLE](:,:,:)
  7682.             INTEGER  reactor, level, points, error
  7683.             DATA  reactor, level, points  / 10, 50, 10 /
  7684.  
  7685.             ALLOCATE (dataset(1:reactor,1:level,1:points), STAT = error)
  7686.  
  7687.             DEALLOCATE (dataset, STAT = error)»
  7688.  
  7689.  
  7690.  DIMENSION
  7691.  
  7692.  
  7693.  ■  Action
  7694.  
  7695.  Declares that a variable is an array, and specifies the number of dimensions
  7696.  and their bounds
  7697.  
  7698.  
  7699.  ■  Syntax
  7700.  
  7701.       DIMENSION array ««[attrs]»» («{»«lower:»upper «| :}»
  7702.       «,«{»«lower:»upper «| :}»...»)
  7703.  
  7704.  Parameter                                  Description
  7705.  
  7706.  array                                      The name of an array. More than
  7707.                                             one array may be declared in a
  7708.                                             single DIMENSION statement.
  7709.                                             Multiple names are separated by
  7710.                                             commas.
  7711.  
  7712.  «attrs»                                    «A list of attributes separated
  7713.                                             by commas. The attrs describe
  7714.                                             array. The following attributes
  7715.                                             can be used with array: ALIAS,
  7716.                                             ALLOCATABLE, C, EXTERN, FAR,
  7717.                                             HUGE, NEAR, PASCAL, REFERENCE,
  7718.                                             VALUE.»
  7719.  
  7720.  lower                                      The lower dimension bound, which
  7721.                                             can be positive, negative, or
  7722.                                             zero. The default for lower is
  7723.                                             one.
  7724.  
  7725.  upper                                      The upper dimension bound, which
  7726.                                             can be positive, negative, zero,
  7727.                                             or an asterisk. It must be
  7728.                                             greater than or equal to lower.
  7729.  
  7730.  
  7731.  ■  Remarks
  7732.  
  7733.  The specification array(«{»«lower:» upper «| :}») is called an "array
  7734.  declarator." The «lower»upper specifier «or the : specifier» is called a
  7735.  "dimension declarator." An array has as many dimensions as it has dimension
  7736.  declarators. You may specify no more than seven dimensions. «In Microsoft
  7737.  FORTRAN, the number of dimensions and their sizes are limited only by
  7738.  available memory.»
  7739.  
  7740.  «When an array is specified as allocatable, the dimension declarator
  7741.  consists only of a colon for each dimension. The single-colon specifier may
  7742.  be used only when an array is specified as allocatable.»
  7743.  
  7744.  You are free to specify both the upper and lower dimension bounds. If, for
  7745.  example, one array contains data from experiments numbered 28 through 112,
  7746.  you could dimension the array as follows:
  7747.  
  7748.             DIMENSION exprmt(28:112)
  7749.  
  7750.  Then, to refer to the data from experiment 72, you would reference
  7751.  exprmt(72).
  7752.  
  7753.  You can use any of the following as dimension bounds:
  7754.  
  7755.  Bound                                      Description
  7756.  
  7757.  An arithmetic constant                     If all array dimensions are
  7758.                                             specified by arithmetic
  7759.                                             constants, the array has a
  7760.                                             constant size. The arithmetic
  7761.                                             value is truncated to an integer.
  7762.  
  7763.  A nonarray-integer formal                  The dimension size is the initial
  7764.  argument or a nonarray-integer             value of the variable upon entry
  7765.  variable in a common block in the          to the subprogram at execution
  7766.  same program unit as the                   time. If a dimension bound of
  7767.  DIMENSION statement                        array is an integer formal
  7768.                                             argument or an integer variable
  7769.                                             in a common block, the array is
  7770.                                             an "adjustable-size array." The
  7771.                                             variable must be given a value
  7772.                                             before the subprogram containing
  7773.                                             the adjustable-size array is
  7774.                                             called.
  7775.  
  7776.  An arithmetic expression                   Expressions cannot contain
  7777.                                             references to functions or array
  7778.                                             elements. Expressions can contain
  7779.                                             variables only in adjustable-size
  7780.                                             arrays. The result of the
  7781.                                             expression is truncated to an
  7782.                                             integer.
  7783.  
  7784.  An asterisk (*)                            Only upper can be an asterisk,
  7785.                                             and an asterisk can only be used
  7786.                                             for upper in the last dimension
  7787.                                             of array. If upper is an
  7788.                                             asterisk, then array is an
  7789.                                             "assumed-size array." For an
  7790.                                             assumed-size array, the
  7791.                                             subprogram array is defined at
  7792.                                             execution time to be the same
  7793.                                             size as the array in the calling
  7794.                                             program. The following DIMENSION
  7795.                                             statement defines an assumed-size
  7796.                                             array in a subprogram:
  7797.  
  7798.                                               DIMENSION data (19,*)
  7799.  
  7800.                                             At execution time, the array data
  7801.                                             is given the size of the
  7802.                                             corresponding array in the
  7803.                                             calling program.
  7804.  
  7805.  Within noncharacter arrays, all elements begin on even-byte (word)
  7806.  addresses. Within character arrays «(and arrays of INTEGER*1 or LOGICAL*1
  7807.  variables)», elements always begin at the next available byte (odd or even).
  7808.  
  7809.  All adjustable- and assumed-size arrays, as well as the bounds for
  7810.  adjustable-size arrays, must be formal arguments to the program unit in
  7811.  which they appear. «Allocatable arrays must not be formal arguments.»
  7812.  
  7813.  Array elements are stored in column-major order: the leftmost subscript is
  7814.  incremented first when the array is mapped into contiguous memory addresses.
  7815.  For example, look at the following statements:
  7816.  
  7817.             INTEGER*2 a(2, 0:2)
  7818.             DATA a /1, 2, 3, 4, 5, 6/
  7819.  
  7820.  If a is placed at location 1000 in memory, the preceding DATA statement
  7821.  produces the following mapping:
  7822.  
  7823.  
  7824.  Array Element              Address                    Value
  7825.  
  7826.  a(1,0)                      1000                      1
  7827.  
  7828.  a(2,0)                      1002                      2
  7829.  
  7830.  a(1,1)
  7831.  
  7832.  a(2,1)                      1006                      4
  7833.  
  7834.  a(1,2)                      1008                      5
  7835.  
  7836.  a(2,2)                      100A                      6
  7837.  
  7838.  
  7839.  ■  Examples
  7840.  
  7841.  The following program dimensions two arrays:
  7842.  
  7843.             DIMENSION a(2,3), v(10)
  7844.             CALL Subr (a, 2, v)
  7845.             .
  7846.             .
  7847.             .
  7848.             SUBROUTINE Subr (matrix, rows, vector)
  7849.             REAL MATRIX, VECTOR
  7850.             INTEGER ROWS
  7851.             DIMENSION MATRIX (ROWS,*), VECTOR (10),
  7852.            +  LOCAL (2,4,8)
  7853.             MATRIX (1,1) = VECTOR (5)
  7854.             .
  7855.             .
  7856.             .
  7857.             END
  7858.  
  7859.  The following program uses assumed- and adjustable-size arrays:
  7860.  
  7861.             REAL     magnitude, minimum
  7862.             INTEGER  vecs, space, vec
  7863.  
  7864.       C     Array data values are assigned in column-major order
  7865.             DIMENSION  vecs(3, 4)
  7866.             DATA       vecs /1,1,1,2, 1,0,3,4, 7,-2,2,1 /
  7867.  
  7868.       C     Find minimum magnitude
  7869.             minimum = 1E10
  7870.             DO 100 vec = 1, 4
  7871.  
  7872.       C     Call the function magnitude to calculate the magnitude of
  7873.       C     vector vec.
  7874.                minimum = AMIN1(minimum, magnitude(vecs, 3, vec))
  7875.        100  CONTINUE
  7876.  
  7877.             WRITE (*, 110) minimum
  7878.        110  FORMAT (' Vector closest to origin has a magnitude of',
  7879.            +          F12.6)
  7880.             END
  7881.  
  7882.  
  7883.       C     Function returns the magnitude of the j-th column vec in a
  7884.       C     matrix. Note that, because of the assumed-size array, the
  7885.       C     subroutine does not need to know the number of columns in
  7886.       C     the matrix. It only requires that the specified column
  7887.       C     vector be a valid column in the matrix. The number of rows
  7888.       C     must be passed so the function can do the sum.
  7889.  
  7890.             REAL FUNCTION Magnitude (matrix, rows, j)
  7891.  
  7892.             REAL       sum
  7893.             INTEGER    matrix, rows, i, j
  7894.             DIMENSION  matrix (rows,*)
  7895.  
  7896.             sum = 0.0
  7897.             DO 100 i = 1, rows
  7898.             sum = sum + matrix(i,j)**2
  7899.        100  CONTINUE
  7900.             magnitude = SQRT (sum)
  7901.             END
  7902.  
  7903.  
  7904.  DO
  7905.  
  7906.  
  7907.  ■  Action
  7908.  
  7909.  Repeatedly executes the statements following the DO statement through the
  7910.  statement which marks the end of the loop
  7911.  
  7912.  
  7913.  ■  Syntax
  7914.  
  7915.       DO «label «,» » dovar = start, stop «, inc»
  7916.  
  7917.  Parameter                                  Description
  7918.  
  7919.  label                                      The statement label of an
  7920.                                             executable statement.
  7921.  
  7922.  dovar                                      An integer, real, or
  7923.                                             double-precision variable, called
  7924.                                             the DO variable.
  7925.  
  7926.  start, stop                                The integer, real, or
  7927.                                             double-precision expressions.
  7928.  
  7929.  inc                                        An integer, real, or
  7930.                                             double-precision expression. The
  7931.                                             parameter inc cannot equal zero;
  7932.                                             inc defaults to one.
  7933.  
  7934.  
  7935.  ■  Remarks
  7936.  
  7937.  «The label is optional.» If label is used, the loop terminates with the
  7938.  labeled statement. «If label is not used, the loop is terminated with an END
  7939.  DO statement.»
  7940.  
  7941.  If you use a labeled terminating statement, it must follow the DO statement
  7942.  and be in the same program unit. This statement must not be an unconditional
  7943.  or assigned GOTO, a block or arithmetic IF, «CASE, CYCLE,» DO, ELSE, ELSE
  7944.  IF, END, END IF, «END SELECT CASE,» «EXIT,» RETURN, «SELECT CASE,» or STOP
  7945.  statement.
  7946.  
  7947.  The terminal statement may be a logical IF statement.
  7948.  
  7949.  The range of a DO loop begins with the statement immediately following the
  7950.  DO statement and includes the terminal statement of the DO loop.
  7951.  
  7952.  Execution of a CALL statement that is in the range of a DO loop does not
  7953.  terminate the DO loop unless an alternate-return specifier in a CALL
  7954.  statement returns control to a statement outside the DO loop.
  7955.  
  7956.  The following restrictions apply to DO loops:
  7957.  
  7958.    ■  If a DO loop appears within another DO «or DO WHILE» loop, its range
  7959.       must be entirely within the range of the enclosing loop.
  7960.  
  7961.    ■  If a DO statement appears within an IF, ELSE IF, or ELSE block, the DO
  7962.       loop must be contained within the block.
  7963.  
  7964.    ■  If a block IF statement appears within a DO loop, its associated END IF
  7965.       statement must also be within that DO loop.
  7966.  
  7967.    ■  The loop variable dovar may not be modified by statements within the
  7968.       loop.
  7969.  
  7970.    ■  Jumping into a DO loop from outside its range is not permitted.
  7971.       «However, a special feature added for compatibility with earlier
  7972.       versions of FORTRAN permits extended-range DO loops. See the $DO66
  7973.       entry in Section 6.2, "Metacommand Directory," for more information.»
  7974.  
  7975.    ■  «Two or more DO or DO WHILE loops may share one labeled terminal
  7976.       statement. An END DO statement may terminate only one DO or DO WHILE
  7977.       loop.»
  7978.  
  7979.    ■  «If a SELECT CASE statement appears within a DO loop, its associated
  7980.       END SELECT CASE statement must also appear within that DO loop.»
  7981.  
  7982.  Note that the number of iterations in a DO loop is limited to the maximum
  7983.  possible value of the loop variable. «For example, DO loops that use
  7984.  INTEGER*2 variables as the DO variable and bounds cannot be evaluated more
  7985.  than 32,767 times. When the $DEBUG metacommand is used, a run-time error
  7986.  occurs if a DO variable overflows. When $DEBUG is not used, the results of
  7987.  an overflow are unpredictable. In the following fragment the number of
  7988.  iterations is 64,001, and the DO variable i can only be evaluated 32,767
  7989.  times:»
  7990.  
  7991.       «$DEBUG
  7992.       C     This causes an error:
  7993.             INTEGER*2 i
  7994.             DO 10 i = -32000, 32000, 1
  7995.          10 CONTINUE»
  7996.  
  7997.  A DO statement is executed in the following sequence:
  7998.  
  7999.    1. The expressions start, stop, and inc are evaluated. If necessary, type
  8000.       conversion is performed. The DO variable dovar is set to the value of
  8001.       start.
  8002.  
  8003.    2. The iteration count for the loop is tested.
  8004.  
  8005.       The iteration count for the loop is calculated using the following
  8006.       formula:
  8007.  
  8008.       MAX(INT((stop - start + inc) / inc), 0)
  8009.  
  8010.       The iteration count is zero if either of the following is true:
  8011.  
  8012.         ■  start > stop and inc > 0
  8013.  
  8014.         ■  start < stop and inc < 0
  8015.  
  8016.    3. If the iteration count is greater than zero, the statements in the
  8017.       range of the DO loop are executed; if not, execution continues with the
  8018.       first statement following the DO loop.
  8019.  
  8020.       «If the $DO66 metacommand is in effect, the statements in the range of
  8021.       the DO loop are executed at least once, regardless of the value of the
  8022.       iteration count.» «
  8023.  
  8024.    4. After the execution of the terminal statement of the DO loop, the value
  8025.       of the DO variable dovar is increased by the value of inc that was
  8026.       computed when the DO statement was executed.
  8027.  
  8028.    5. The iteration count is decreased by one.
  8029.  
  8030.    6. The iteration count is tested. If the iteration count is greater than
  8031.       zero, the statements in the range of the DO loop are executed again.
  8032.  
  8033.  ───────────────────────────────────────────────────────────────────────────
  8034.  NOTE
  8035.     The iteration count is computed using two-byte precision (the default).
  8036.     If the iteration count overflows this precision, the results are
  8037.     unpredictable. The following example causes an iteration overflow:
  8038.  
  8039.       IMPLICIT INTEGER*2 (A-Z)
  8040.             stop = 32000
  8041.             step = 12000
  8042.             DO 100  n = 0, stop, step
  8043.             WRITE (*, *) 'N = ', n
  8044.         100 CONTINUE
  8045.  ───────────────────────────────────────────────────────────────────────────
  8046.  
  8047.  ■  Examples
  8048.  
  8049.  The following two program fragments are examples of DO statements:
  8050.  
  8051.       C     Initialize the even elements of a 20-element real array
  8052.             DIMENSION array(20)
  8053.             DO 100 j = 2, 20, 2
  8054.         100 array(j) = 12.0
  8055.  
  8056.       C     Perform a function 11 times
  8057.             DO 200,  k = -30, -60, -3
  8058.                int =  j / 3
  8059.                isb = -9 - k
  8060.                array(isb) = MyFunc (int)
  8061.         200 CONTINUE
  8062.  
  8063.  The following shows the final value of a DO variable (in this case 11):
  8064.  
  8065.             DO 200 j = 1, 10
  8066.         200 WRITE (*, '(I5)') j
  8067.             WRITE (*, '(I5)') j
  8068.  
  8069.  
  8070.  
  8071.  DO WHILE
  8072.  
  8073.  
  8074.  ■  «Action»
  8075.  
  8076.  «Executes a block of statements repeatedly while a logical condition remains
  8077.  true»
  8078.  
  8079.  
  8080.  ■  «Syntax»
  8081.  
  8082.  «DO «label «, » » WHILE (logicalexpr)»
  8083.  
  8084.  «Parameter                                 Description»
  8085.  
  8086.  «label»                                    «A label of executable statement
  8087.                                             or CONTINUE statement»
  8088.  
  8089.  «logicalexpr»                              «A test expression which
  8090.                                             evaluates to true or false»
  8091.  
  8092.  
  8093.  ■  «Remarks»
  8094.  
  8095.  «The label is optional. If label is used, the loop terminates with the
  8096.  labeled statement. If label is not used, the loop is terminated with an END
  8097.  DO statement.»
  8098.  
  8099.  «A terminating statement must follow the DO WHILE statement and be in the
  8100.  same program unit. This statement must not be an unconditional or assigned
  8101.  GOTO, a block or arithmetic IF, CASE, CYCLE, DO, ELSE, ELSE IF, END, END IF,
  8102.  END SELECT CASE, EXIT, RETURN, SELECT CASE, or STOP statement.»
  8103.  
  8104.  «The terminal statement may be a logical IF statement.»
  8105.  
  8106.  «The range of a DO WHILE loop begins with the statement immediately
  8107.  following the DO WHILE statement and includes the terminal statement of the
  8108.  DO WHILE loop.»
  8109.  
  8110.  «Execution of a CALL statement that is in the range of a DO WHILE loop does
  8111.  not terminate the DO WHILE loop unless an alternate-return specifier in a
  8112.  CALL statement returns control to a statement outside the DO WHILE loop.»
  8113.  
  8114.  «The following steps occur when a DO WHILE statement is executed:»
  8115.  
  8116.    1. «The logical expression is evaluated.»
  8117.  
  8118.    2. «If the expression is false, none of the statements within the range of
  8119.       the loop are executed. Execution jumps to the statement following the
  8120.       terminating statement.»
  8121.  
  8122.    3. «If the expression is true, the statements within the loop are
  8123.       executed, starting with the first statement following the DO WHILE
  8124.       statement.»
  8125.  
  8126.    4. «When the terminating statement is reached, execution returns to the DO
  8127.       WHILE statement. The logical expression is evaluated, and the cycle
  8128.       repeats.»
  8129.  
  8130.  «The following restrictions apply to DO WHILE loops:»
  8131.  
  8132.    ■  «If a DO WHILE loop appears within another DO or DO WHILE loop, its
  8133.       range must be entirely within the range of the enclosing loop.»
  8134.  
  8135.    ■  «Two or more DO or DO WHILE loops may share one labeled terminal
  8136.       statement. An END DO statement may terminate only one DO or DO WHILE
  8137.       loop.»
  8138.  
  8139.    ■  «If a DO WHILE statement appears within an IF, ELSE IF, or ELSE block,
  8140.       the range of the DO WHILE loop must be entirely within the block.»
  8141.  
  8142.    ■  «If a block IF statement appears within a DO WHILE loop, its associated
  8143.       END IF statement must also be within that DO WHILE loop.»
  8144.  
  8145.    ■  «If a SELECT CASE statement appears within the range of a DO WHILE
  8146.       loop, its associated END SELECT CASE statement must also be within that
  8147.       DO WHILE loop.»
  8148.  
  8149.    ■  «Jumping into the range of a DO WHILE loop is not permitted. However, a
  8150.       special feature added for compatibility with earlier versions of
  8151.       FORTRAN permits extended-range DO WHILE loops. See the $DO66 entry in
  8152.       Section 6.2, "Metacommand Directory," for more information.»
  8153.  
  8154.  
  8155.  ■  «Example»
  8156.  
  8157.             «CHARACTER*1 input
  8158.  
  8159.             input = ' '
  8160.  
  8161.             DO WHILE ((input .NE. 'n') .AND. (input .NE. 'y'))
  8162.             WRITE (*, '(A)') 'Enter y or n: '
  8163.             READ  (*, '(A)') input
  8164.             END DO»
  8165.  
  8166.  
  8167.  DOUBLE COMPLEX
  8168.  
  8169.  
  8170.  ■  «Action»
  8171.  
  8172.  «Specifies the DOUBLE COMPLEX type for user-defined names»
  8173.  
  8174.  
  8175.  ■  «Syntax»
  8176.  
  8177.       «DOUBLE COMPLEX vname « [attrs] » «(dim)» «/values/»
  8178.       «, vname« [attrs] » «(dim)» «/values/»»...»
  8179.  
  8180.  «Parameter                                 Description»
  8181.  
  8182.  «vname»                                    «The symbolic name of a constant,
  8183.                                             variable, array, external
  8184.                                             function, statement function,
  8185.                                             intrinsic function, FUNCTION
  8186.                                             subprogram, or array declarator.
  8187.                                             The vname parameter cannot be the
  8188.                                             name of a subroutine or a main
  8189.                                             program.»
  8190.  
  8191.  «attrs»                                    «A list of attributes, separated
  8192.                                             by commas. The attrs describe
  8193.                                             vname. The following attributes
  8194.                                             can be used with vname: ALIAS,
  8195.                                             ALLOCATABLE, C, EXTERN, FAR,
  8196.                                             HUGE, NEAR, PASCAL, REFERENCE,
  8197.                                             VALUE.»
  8198.  
  8199.  «dim»                                      «A dimension declarator.
  8200.                                             Specifying dim declares vname as
  8201.                                             an array.»
  8202.  
  8203.  «values»                                   «A list of constants and repeated
  8204.                                             constants, separated by commas. A
  8205.                                             repeated constant is written in
  8206.                                             the form n*constant, where n is a
  8207.                                             positive integer constant, and is
  8208.                                             equivalent to the constant
  8209.                                             constant repeated n times. The
  8210.                                             /values/ option, if specified,
  8211.                                             initializes vname. The following
  8212.                                             statement declares that vector is
  8213.                                             of type DOUBLE COMPLEX, and sets
  8214.                                             vector equal to (32.0,10.0):»
  8215.  
  8216.                                            «DOUBLE COMPLEX vector/(32.798d2,
  8217.                                             +10.985d3) /»
  8218.  
  8219.  
  8220.  ■  «Remarks»
  8221.  
  8222.  «A DOUBLE COMPLEX statement confirms or overrides the implicit type of
  8223.  vname. The name vname is defined for the entire program unit and cannot be
  8224.  defined by any other type of statement in that program unit.»
  8225.  
  8226.  «DOUBLE COMPLEX statements must precede all executable statements.»
  8227.  
  8228.  «DOUBLE COMPLEX and COMPLEX*16 are the same data type.»
  8229.  
  8230.  
  8231.  ■  «Examples
  8232.  
  8233.             «DOUBLE COMPLEX  vector, arrays(7,29)»
  8234.  
  8235.             «DOUBLE COMPLEX  pi, 2pi /3.141592654,6.283185308/»
  8236.  
  8237.  
  8238.  DOUBLE PRECISION
  8239.  
  8240.  
  8241.  ■  Action
  8242.  
  8243.  Specifies the DOUBLE PRECISION type for user-defined names
  8244.  
  8245.  
  8246.  ■  Syntax
  8247.  
  8248.       DOUBLE PRECISION vname «« [attrs] »» «(dim)» ««/values/»»
  8249.       «, vname«« [attrs] »» «(dim)» ««/values/»»»...
  8250.  
  8251.  Parameter                                  Description
  8252.  
  8253.  vname                                      The symbolic name of a constant,
  8254.                                             variable, array, external
  8255.                                             function, statement function,
  8256.                                             intrinsic function, FUNCTION
  8257.                                             subprogram, or array declarator.
  8258.                                             The vname parameter cannot be the
  8259.                                             name of a subroutine or main
  8260.                                             program.
  8261.  
  8262.  «attrs»                                    «An optional list of attributes,
  8263.                                             separated by commas. The attrs
  8264.                                             describe vname. The following
  8265.                                             attributes can be used with
  8266.                                             vname: ALIAS, ALLOCATABLE, C,
  8267.                                             EXTERN, FAR, HUGE, NEAR, PASCAL,
  8268.                                             REFERENCE, VALUE.»
  8269.  
  8270.  dim                                        A dimension declarator.
  8271.                                             Specifying dim declares vname as
  8272.                                             an array.
  8273.  
  8274.  «values»                                   «A list of constants and repeated
  8275.                                             constants, separated by commas. A
  8276.                                             repeated constant is written in
  8277.                                             the form n*constant, where n is a
  8278.                                             positive integer constant, and is
  8279.                                             equivalent to constant repeated n
  8280.                                             times. The /values/ option, if
  8281.                                             specified, initializes vname. The
  8282.                                             following statement declares that
  8283.                                             pi  is of type DOUBLE PRECISION,
  8284.                                             and sets num equal to
  8285.                                             3.141592654:»
  8286.  
  8287.                                            «DOUBLE PRECISION pi/3.141592654/»
  8288.  
  8289.  
  8290.  ■  Remarks
  8291.  
  8292.  A DOUBLE PRECISION statement confirms or overrides the implicit type of
  8293.  vname. The name vname is defined for the entire program unit, and cannot be
  8294.  defined by any other type statement in that program unit.
  8295.  
  8296.  DOUBLE PRECISION statements must precede all executable statements.
  8297.  
  8298.  A DOUBLE PRESICION variable is accurate to 14 or 15 decimal digits.
  8299.  
  8300.  DOUBLE PRECISION and «REAL*8» are the same data type.
  8301.  
  8302.  
  8303.  ■  Example
  8304.  
  8305.             DOUBLE PRECISION  varnam
  8306.  
  8307.  
  8308.  ELSE
  8309.  
  8310.  
  8311.  ■  Action
  8312.  
  8313.  Marks the beginning of an ELSE block
  8314.  
  8315.  
  8316.  ■  Syntax
  8317.  
  8318.       ELSE
  8319.  
  8320.  
  8321.  ■  Remarks
  8322.  
  8323.  An ELSE block consists of any executable statements between the ELSE
  8324.  statement and the next END IF statement at the same IF level. The matching
  8325.  END IF statement must appear before any ELSE or ELSE IF statements of the
  8326.  same IF level.
  8327.  
  8328.  Control may not be transferred into an ELSE block from outside that block.
  8329.  
  8330.  
  8331.  ■  Example
  8332.  
  8333.             CHARACTER c
  8334.             .
  8335.             .
  8336.             .
  8337.             READ (*, '(A)') C
  8338.             IF (c .EQ. 'A') THEN
  8339.               CALL Asub
  8340.             ELSE
  8341.               CALL Other
  8342.             END IF
  8343.             .
  8344.             .
  8345.             .
  8346.  
  8347.  
  8348.  ■  See also
  8349.  
  8350.  ELSE IF
  8351.  END IF
  8352.  IF THEN ELSE (Block IF)
  8353.  
  8354.  
  8355.  ELSE IF
  8356.  
  8357.  
  8358.  ■  Action
  8359.  
  8360.  Causes execution of a block of statements if expression is true
  8361.  
  8362.  
  8363.  ■  Syntax
  8364.  
  8365.       ELSE IF (expression) THEN
  8366.  
  8367.  Parameter                                  Description
  8368.  
  8369.  expression                                 A logical expression
  8370.  
  8371.  
  8372.  ■  Remarks
  8373.  
  8374.  The associated ELSE IF block consists of any executable statements between
  8375.  the ELSE IF statement and the next ELSE IF, ELSE, or END IF statement at the
  8376.  same IF level.
  8377.  
  8378.  When the ELSE IF statement is executed, expression is evaluated, and the
  8379.  following steps are performed:
  8380.  
  8381.  If expression is:                          Then the next statement executed i
  8382.  
  8383.  True, and there is at least one            The first statement of the ELSE
  8384.  executable statement in the ELSE           IF block
  8385.  IF block
  8386.  
  8387.  True, and there are no executable          The next END IF statement at the
  8388.  statements in the ELSE IF block            same IF level as the ELSE IF
  8389.                                             statement
  8390.  
  8391.  False                                      The next ELSE IF, ELSE, or END IF
  8392.                                             statement that has the same IF
  8393.                                             level as the ELSE IF statement
  8394.  
  8395.  After the last statement in the ELSE IF block has been executed, the next
  8396.  statement executed is the next END IF statement at the same IF level as that
  8397.  ELSE IF statement.
  8398.  
  8399.  Control may not be transferred into an ELSE IF block from outside that
  8400.  block.
  8401.  
  8402.  
  8403.  ■  Example
  8404.  
  8405.             CHARACTER char
  8406.             READ (*, '(A)') char
  8407.             IF (char .EQ. 'L') THEN
  8408.               CALL Lsub
  8409.             ELSE IF (char .EQ. 'X') THEN
  8410.               CALL Xsub
  8411.             ELSE
  8412.               CALL Other
  8413.             END IF
  8414.  
  8415.  
  8416.  ■  See also
  8417.  
  8418.  ELSE
  8419.  END IF
  8420.  IF THEN ELSE (Block IF)
  8421.  
  8422.  
  8423.  END
  8424.  
  8425.  
  8426.  ■  Action
  8427.  
  8428.  Terminates execution of the main program, or returns control from a
  8429.  subprogram
  8430.  
  8431.  
  8432.  ■  Syntax
  8433.  
  8434.       END
  8435.  
  8436.  
  8437.  ■  Remarks
  8438.  
  8439.  The END statement marks the end of the program unit in which it appears, and
  8440.  it must be the last statement in every program unit. Comment lines may
  8441.  follow an END statement.
  8442.  
  8443.  An END statement must appear by itself on an unlabeled initial line (not a
  8444.  continuation line). No continuation lines may follow an END statement. No
  8445.  FORTRAN statement may have an initial line that appears to be an END
  8446.  statement (such as splitting an END IF statement over two lines).
  8447.  
  8448.  In a subprogram, the END statement has the same effect as a RETURN
  8449.  statement.
  8450.  
  8451.  
  8452.  ■  Example
  8453.  
  8454.       C     An END statement must be the last statement in a program
  8455.       C     unit:
  8456.             PROGRAM MyProg
  8457.             WRITE (*, '("Hello, world!")')
  8458.             END
  8459.  
  8460.  
  8461.  END DO
  8462.  
  8463.  
  8464.  ■  «Action»
  8465.  
  8466.  «Terminates a DO or DO WHILE loop»
  8467.  
  8468.  
  8469.  ■  «Syntax»
  8470.  
  8471.       «END DO»
  8472.  
  8473.  
  8474.  ■  «Remarks»
  8475.  
  8476.  «There must be a matching END DO statement for every DO or DO WHILE
  8477.  statement that does not contain a label reference.»
  8478.  
  8479.  «An END DO statement may terminate only one DO or DO WHILE statement.»
  8480.  
  8481.  
  8482.  ■  «Examples»
  8483.  
  8484.  «The following examples produce the same output.»
  8485.  
  8486.            «DO ivar = 1, 10»
  8487.               «PRINT ivar»
  8488.            «END DO»
  8489.  
  8490.            «ivar = 0»
  8491.            «DO WHILE (ivar .LT. 10)»
  8492.               «ivar = ivar + 1»
  8493.               «PRINT *«, ivar»
  8494.            «END DO»
  8495.  
  8496.  
  8497.  END IF
  8498.  
  8499.  
  8500.  ■  Action
  8501.  
  8502.  Terminates a block IF statement
  8503.  
  8504.  
  8505.  ■  Syntax
  8506.  
  8507.       END IF
  8508.  
  8509.  
  8510.  ■  Remarks
  8511.  
  8512.  There must be a matching END IF statement for every block IF statement in a
  8513.  program unit. Execution of an END IF statement has no effect on the program.
  8514.  
  8515.  
  8516.  ■  Example
  8517.  
  8518.             IF (n .LT. 0) THEN
  8519.               x = -n
  8520.               y = -n
  8521.             END IF
  8522.  
  8523.  
  8524.  ENDFILE
  8525.  
  8526.  
  8527.  ■  Action
  8528.  
  8529.  Writes an end-of-file record to the specified unit
  8530.  
  8531.  
  8532.  ■  Syntax
  8533.  
  8534.       ENDFILE {unitspec |
  8535.       («UNIT=»unitspec
  8536.       «, ERR=errlabel»
  8537.       «, IOSTAT=iocheck»)}
  8538.  
  8539.  If UNIT= is omitted, unitspec must be the first parameter. The parameters
  8540.  can otherwise appear in any order.
  8541.  
  8542.  Parameter                                  Description
  8543.  
  8544.  unitspec                                   An integer expression that
  8545.                                             specifies an external unit. If
  8546.                                             unitspec has not been opened, a
  8547.                                             run-time error occurs.
  8548.  
  8549.  errlabel                                   The label of an executable
  8550.                                             statement in the same program
  8551.                                             unit. If errlabel is specified,
  8552.                                             an I/O error causes transfer of
  8553.                                             control to the statement at
  8554.                                             errlabel. If errlabel is omitted,
  8555.                                             the effect of an I/O error is
  8556.                                             determined by the presence or
  8557.                                             absence of iocheck.
  8558.  
  8559.  iocheck                                    An integer variable, array
  8560.                                             element, «or structure element»
  8561.                                             that returns the value zero if
  8562.                                             there is no error, or the error
  8563.                                             number if an error occurs. For
  8564.                                             more information on error
  8565.                                             handling, see Section 3.2.6.
  8566.  
  8567.  
  8568.  ■  Remarks
  8569.  
  8570.  After writing the end-of-file record, the ENDFILE statement positions the
  8571.  file after the end-of-file record. Further sequential data transfer is
  8572.  prohibited unless you execute either a BACKSPACE or REWIND statement.
  8573.  
  8574.  When ENDFILE operates on a direct-access file, all records beyond the new
  8575.  end-of-file record are erased.
  8576.  
  8577.  If a parameter of the ENDFILE statement is an expression that calls a
  8578.  function, that function must not cause an I/O statement «or the EOF
  8579.  intrinsic function» to be executed, because unpredictable results can occur.
  8580.  
  8581.  
  8582.  ■  Example
  8583.  
  8584.             WRITE (6, *) x
  8585.             ENDFILE 6
  8586.             REWIND 6
  8587.             READ (6, *) y
  8588.  
  8589.  
  8590.  ENTRY
  8591.  
  8592.  
  8593.  ■  Action
  8594.  
  8595.  Specifies an entry point to a subroutine or external function
  8596.  
  8597.  
  8598.  ■  Syntax
  8599.  
  8600.      ENTRY ename «« [eattrs] »»  «(«formal«« [attrs]»»
  8601.      «,formal« [attrs] »»...»)»
  8602.  
  8603.  Parameter                                  Description
  8604.  
  8605.  ename                                      The name of the entry point. If
  8606.                                             ename is an entry point for a
  8607.                                             user-defined function, ename must
  8608.                                             be given a data type by:
  8609.  
  8610.                                             ■  The default rules used in
  8611.                                                determining type; or
  8612.  
  8613.                                             ■  The type specified in an
  8614.                                                IMPLICIT
  8615.                                                statement; or
  8616.  
  8617.                                             ■  A declaration in the user-
  8618.                                                defined function's type-
  8619.                                                declaration section.
  8620.  
  8621.  «eattrs»                                   «A list of attributes, separated
  8622.                                             by commas. The eattrs describe
  8623.                                             ename. The following attributes
  8624.                                             can be used with ename: ALIAS, C,
  8625.                                             LOADDS, PASCAL, VARYING.»
  8626.  
  8627.  formal                                     A variable name, array name,
  8628.                                             «structure variable name,» or
  8629.                                             formal procedure name. If the
  8630.                                             ENTRY statement is in a
  8631.                                             subroutine, formal can be an
  8632.                                             asterisk.
  8633.  
  8634.  «attrs»                                    «A list of attributes, separated
  8635.                                             by commas. The attrs describe
  8636.                                             formal. The following attributes
  8637.                                             can be used with formal: FAR,
  8638.                                             HUGE, NEAR, REFERENCE, VALUE.»
  8639.  
  8640.  
  8641.  ■  Remarks
  8642.  
  8643.  To begin executing a subroutine or function at the first executable
  8644.  statement after an ENTRY statement, replace the name of the subprogram with
  8645.  the name of the entry point:
  8646.  
  8647.  Type of Call                               Form of Call
  8648.  
  8649.  Subroutine                                 CALL ename « («actual1«,actual2»..
  8650.  
  8651.  Function                                   ename («actual1«,actual2»...»
  8652.  
  8653.  Parentheses are required when calling a function entry point, even if the
  8654.  function has no formal arguments.
  8655.  
  8656.  Entry points cannot be called recursively. That is, a subprogram may not
  8657.  directly or indirectly call an entry point within that subprogram.
  8658.  
  8659.  There is no defined limit on the number of ENTRY statements you can use in a
  8660.  subprogram. The following restrictions apply to use of the ENTRY statement:
  8661.  
  8662.    ■  Within a subprogram, ename cannot have the same name as a formal
  8663.       argument in a FUNCTION, SUBROUTINE, ENTRY, or EXTERNAL statement.
  8664.  
  8665.    ■  Within a function, ename cannot appear in any statement other than a
  8666.       type statement until after ename has been defined in an ENTRY
  8667.       statement.
  8668.  
  8669.    ■  If one ename in a function is of character type, all the enames in that
  8670.       function that must be of character type, and all the enames must be the
  8671.       same length.
  8672.  
  8673.    ■  A formal argument cannot appear in an executable statement that occurs
  8674.       before the ENTRY statement containing the formal argument unless the
  8675.       formal argument also appears in a FUNCTION, SUBROUTINE, or ENTRY
  8676.       statement that precedes the executable statement.
  8677.  
  8678.    ■  An ENTRY statement cannot appear between a block IF statement and the
  8679.       corresponding END IF statement, or between a DO statement and the
  8680.       terminal statement of its  DO loop.
  8681.  
  8682.  
  8683.  ■  Example
  8684.  
  8685.       C     This fragment writes a message indicating
  8686.       C     whether num is positive or negative
  8687.             IF (num .GE. 0) THEN
  8688.                 CALL Positive
  8689.             ELSE
  8690.                 CALL Negative
  8691.             END IF
  8692.             .
  8693.             .
  8694.             .
  8695.             END
  8696.  
  8697.             SUBROUTINE Sign
  8698.             ENTRY Positive
  8699.             WRITE (*, *) 'It''s positive.'
  8700.             RETURN
  8701.             ENTRY Negative
  8702.             WRITE (*, *) 'It''s negative.'
  8703.             RETURN
  8704.             END
  8705.  
  8706.  
  8707.  EQUIVALENCE
  8708.  
  8709.  
  8710.  ■  Action
  8711.  
  8712.  Causes two or more variables or arrays to occupy the same memory location
  8713.  
  8714.  
  8715.  ■  Syntax
  8716.  
  8717.       EQUIVALENCE (nlist) «, (nlist)»...
  8718.  
  8719.  Parameter                                  Description
  8720.  
  8721.  nlist                                      A list of at least two variables,
  8722.                                             arrays, or array elements,
  8723.                                             separated by commas.
  8724.  
  8725.                                             The list may not include formal
  8726.                                             arguments «or allocatable
  8727.                                             arrays.» Subscripts must be
  8728.                                             integer constants and must be
  8729.                                             within the bounds of the array
  8730.                                             they index. An unsubscripted
  8731.                                             array name refers to the first
  8732.                                             element of the array.
  8733.  
  8734.  
  8735.  ■  Remarks
  8736.  
  8737.  An EQUIVALENCE statement causes all elements in nlist to have the same first
  8738.  memory location. Variable names are said to be associated if they refer to
  8739.  the same memory location.
  8740.  
  8741.  There is no automatic type conversion among the elements in nlist; they
  8742.  simply occupy the same memory space.
  8743.  
  8744.  Associated character entities may overlap, as in the following example:
  8745.  
  8746.             CHARACTER  a*4, b*4, c(2)*3
  8747.             EQUIVALENCE (a, c(1)), (b, c(2))
  8748.  
  8749.  The preceding example can be graphically illustrated as follows:
  8750.  
  8751.       |01|02|03|04|05|06|07|
  8752.  
  8753.       |-----a-----|
  8754.                |-----b-----|
  8755.       |--c(1)--|--c(2)--|
  8756.  
  8757.  The following rules restrict how you may associate elements:
  8758.  
  8759.    ■  A variable cannot be forced to occupy more than one memory location,
  8760.       nor can you force two or more elements of the same array to occupy the
  8761.       same memory location. The following statement would force r to occupy
  8762.       two different memory locations or s(1)  and s(2) to occupy the same
  8763.       memory location:
  8764.  
  8765.      C     this causes an error:
  8766.            REAL r, s(10)
  8767.            EQUIVALENCE (r, s(1))
  8768.            EQUIVALENCE (r, s(2))
  8769.  
  8770.    ■  Consecutive array elements must be stored in sequential order. The
  8771.       following is not permitted:
  8772.  
  8773.       C     this causes another error:
  8774.             REAL r(10), s(10)
  8775.             EQUIVALENCE (r(1), s(1))
  8776.             EQUIVALENCE (r(5), s(7))
  8777.  
  8778.       The compiler always aligns noncharacter entities on even-byte (word)
  8779.       boundaries. The following example causes a compile-time error, since
  8780.       variables a and b cannot be word-aligned simultaneously:
  8781.  
  8782.       CHARACTER*1 c1(10)
  8783.       REAL a, b
  8784.       EQUIVALENCE (a, c1(1))
  8785.       EQUIVALENCE (b, c1(2))
  8786.  
  8787.    ■  Character and noncharacter entities cannot be associated. «Microsoft
  8788.       FORTRAN permits character and noncharacter entities to be associated,
  8789.       but not in such a way that noncharacter entities start on an odd-byte
  8790.       boundary. If necessary, the compiler will adjust the storage location
  8791.       of the character entity so the noncharacter entity begins on an even
  8792.       byte. The following example causes a compile-time error because it is
  8793.       not possible to reposition the character array such that both
  8794.       noncharacter entities start on an even byte address:»
  8795.  
  8796.             «CHARACTER*«1  char1(10)»
  8797.             «REAL  reala, realb»
  8798.             «EQUIVALENCE  (reala, char1(1))»
  8799.             «EQUIVALENCE  (realb, char1(2))»
  8800.  
  8801.    ■  «An item that appears in nlist cannot be initialized in a type
  8802.       statement. The following example causes an error:»
  8803.  
  8804.       «INTEGER i /1/»
  8805.       «EQUIVALENCE (i, j)»
  8806.  
  8807.    ■  An EQUIVALENCE statement cannot share memory between two different
  8808.       common blocks.
  8809.  
  8810.    ■  An EQUIVALENCE statement can extend a common block by adding memory
  8811.       elements following the common block, as long as the EQUIVALENCE
  8812.       statement does not make a named common block's length different from
  8813.       the length of the same named common block in other program units.
  8814.  
  8815.    ■  An EQUIVALENCE statement cannot extend a common block by adding memory
  8816.       elements preceding the common block, as in the following example:
  8817.  
  8818.       C     This causes an error:
  8819.             COMMON /abcde/ r(10)
  8820.             REAL s(10)
  8821.             EQUIVALENCE (r(1), s(7))
  8822.  
  8823.  «Unless the $STRICT metacommand is in effect, only the first subscript of a
  8824.  multi-dimensional array is required in EQUIVALENCE statements.  This makes
  8825.  it easier to port FORTRAN 66 programs.»
  8826.  
  8827.  «For example, the array declaration var(3,3), var(4) could appear in an
  8828.  EQUIVALENCE statement. The reference is to the fourth element of the array
  8829.  (var(1,2)), not to the beginning of the fourth row or column.»
  8830.  
  8831.  
  8832.  ■  Example
  8833.  
  8834.             CHARACTER  name, first, middle, last
  8835.             DIMENSION  name(60), first(20), middle(20), last(20)
  8836.             EQUIVALENCE (name(1), first(1)), (name(21), middle(1))
  8837.             EQUIVALENCE (name(41), last(1))
  8838.  
  8839.  
  8840.  EXIT
  8841.  
  8842.  
  8843.  ■  «Action»
  8844.  
  8845.  «Transfers control from within a DO or DO WHILE loop to the first executable
  8846.  statement following the end of the loop»
  8847.  
  8848.  
  8849.  ■  «Syntax»
  8850.  
  8851.       «EXIT»
  8852.  
  8853.  
  8854.  ■  «Remarks»
  8855.  
  8856.  «Normally, a DO loop executes a fixed number of times. The EXIT statement
  8857.  lets you terminate the loop early if some specified condition warrants it.»
  8858.  
  8859.  «For example, you could set a loop to collect a maximum of 1,000 data
  8860.  points, while still being able to terminate the loop if there were fewer
  8861.  than 1,000 points.»
  8862.  
  8863.  
  8864.  ■  «Example»
  8865.  
  8866.       «C     Loop terminates early if one of the data points is zero:
  8867.  
  8868.             INTEGER numpoints, point
  8869.             REAL datarray(1000), sum
  8870.  
  8871.             sum = 0.0
  8872.             DO point = 1, 1000
  8873.                numpoints = point
  8874.                sum = sum + datarray(point)
  8875.                IF (datarray(point+1) .EQ. 0.0)  EXIT
  8876.             END DO»
  8877.  
  8878.  
  8879.  EXTERNAL
  8880.  
  8881.  
  8882.  ■  Action
  8883.  
  8884.  Identifies a user-defined name as an external subroutine or function
  8885.  
  8886.  
  8887.  ■  Syntax
  8888.  
  8889.       EXTERNAL name «« [attrs]»» «,name«« [attrs]»» »...
  8890.  
  8891.  Parameter                                  Description
  8892.  
  8893.  name                                       The name of an external
  8894.                                             subroutine or function.
  8895.                                             Statement-function (single-line
  8896.                                             function) names are not allowed.
  8897.  
  8898.  «attrs»                                    «A list of attributes, separated
  8899.                                             by commas. The attrs describe
  8900.                                             name. The following attributes
  8901.                                             can be used with name: ALIAS, C,
  8902.                                             FAR, LOADDS, NEAR, PASCAL,
  8903.                                             VARYING.»
  8904.  
  8905.  
  8906.  ■  Remarks
  8907.  
  8908.  The EXTERNAL statement is primarily used to specify that a particular
  8909.  user-defined name is a subroutine or function to be used as a procedural
  8910.  parameter. The EXTERNAL statement can also replace an intrinsic function
  8911.  with a user-defined function of the same name.
  8912.  
  8913.  If an intrinsic-function name appears in an EXTERNAL statement, that name
  8914.  becomes the name of an external procedure, and the corresponding intrinsic
  8915.  function can no longer be called from that program unit. A user name can
  8916.  only appear once in an EXTERNAL statement in any given program unit.
  8917.  
  8918.  FORTRAN assumes that the name of any subroutine or function referred to in a
  8919.  compilation unit (but not defined there) is defined externally.
  8920.  
  8921.  
  8922.  ■  Examples
  8923.  
  8924.             EXTERNAL MyFunc, MySub
  8925.       C     MyFunc and MySub are arguments to Calc
  8926.             CALL Calc (MyFunc, MySub)
  8927.  
  8928.       C     Example of a user-defined function replacing an
  8929.             intrinsic EXTERNAL SIN
  8930.             x = SIN (a, 4.2, 37)
  8931.  
  8932.  
  8933.  FORMAT
  8934.  
  8935.  
  8936.  ■  Action
  8937.  
  8938.  Sets the format in which data is written to or read from a file
  8939.  
  8940.  
  8941.  ■  Syntax
  8942.  
  8943.       FORMAT («editlist»)
  8944.  
  8945.  Parameter                                  Description
  8946.  
  8947.  editlist                                   A list of editing descriptions
  8948.  
  8949.  
  8950.  ■  Remarks
  8951.  
  8952.  FORMAT statements must be labeled.
  8953.  
  8954.  Invalid editlist strings generate error messages; some during compilation,
  8955.  others at run-time.
  8956.  
  8957.  Table 3.6 summarizes the nonrepeatable edit descriptors. Table 4.5
  8958.  summarizes the repeatable edit descriptors. See Section 3.7, "Formatted
  8959.  I/O," for further information on edit descriptors and formatted I/O.
  8960.  
  8961.  Table 4.5  Repeatable Edit Descriptors
  8962.  
  8963.  Descriptor       Use
  8964.  
  8965.  Iw«.m»            Integer values
  8966.  «Zw                 Hexadecimal values»
  8967.  Fw.d                Real values
  8968.  Ew.d«Ee»          Real values with exponents
  8969.  Gw.d«Ee»          Real values, extended range
  8970.  Dw.d                Double-precision real values
  8971.  Lw                  Logical values
  8972.  A«w»              Character values
  8973.  
  8974.  
  8975.  FUNCTION (External)
  8976.  
  8977.  
  8978.  ■  Action
  8979.  
  8980.  Identifies a program unit as a function, and supplies its name, data type,
  8981.  and optional formal parameters
  8982.  
  8983.  
  8984.  ■  Syntax
  8985.  
  8986.       «type»FUNCTION func ««[fattrs]»» («formal ««[attrs]»»»
  8987.       «,formal««[attrs]»»»...)
  8988.  
  8989.  Parameter                                  Description
  8990.  
  8991.  type                                       Declares the data type of the
  8992.                                             value returned by the function.
  8993.                                             The type parameter must be one of
  8994.                                             the following:
  8995.  
  8996.                                             CHARACTER
  8997.                                             CHARACTER*n
  8998.                                             COMPLEX
  8999.                                             «COMPLEX*8»
  9000.                                             «COMPLEX*16»
  9001.                                             «DOUBLE COMPLEX»
  9002.                                             DOUBLE PRECISION
  9003.                                             INTEGER
  9004.                                             «INTEGER*1»
  9005.                                             «INTEGER*2»
  9006.                                             «INTEGER*4»
  9007.                                             «INTEGER[C]»
  9008.                                             LOGICAL
  9009.                                             «LOGICAL*1»
  9010.                                             «LOGICAL*2»
  9011.                                             «LOGICAL*4»
  9012.                                             REAL
  9013.                                             «REAL*4»
  9014.                                             «REAL*8»
  9015.  
  9016.                                             If type is omitted, the
  9017.                                             function's type is determined by
  9018.                                             the applicable IMPLICIT
  9019.                                             statements. If there are none,
  9020.                                             the function's type is
  9021.                                             established by FORTRAN's default
  9022.                                             typing. «If IMPLICIT NONE or the
  9023.                                             $DECLARE metacommand is in
  9024.                                             effect, the function's type must
  9025.                                             be given in the function
  9026.                                             declaration or in a type
  9027.                                             declaration.»
  9028.  
  9029.                                             If type is specified, the
  9030.                                             function name cannot appear in a
  9031.                                             type statement.
  9032.  
  9033.  func                                       The name of the function. The
  9034.                                             name func cannot appear in
  9035.                                             «AUTOMATIC,» COMMON, DATA,
  9036.                                             EQUIVALENCE,  INTRINSIC,
  9037.                                             «NAMELIST,» or SAVE statements.
  9038.  
  9039.  «fattrs»                                   «A list of attributes, separated
  9040.                                             by commas. The fattrs describe
  9041.                                             func. The following attributes
  9042.                                             can be used with the func name:
  9043.                                             ALIAS, C, FAR, NEAR, PASCAL,
  9044.                                             VARYING.»
  9045.  
  9046.  formal                                     A formal-argument name. If more
  9047.                                             than one is specified, they must
  9048.                                             be separated by commas.
  9049.                                             Alternate-return specifiers are
  9050.                                             not allowed in FUNCTION
  9051.                                             statements.
  9052.  
  9053.  «attrs»                                    «A list of attributes, separated
  9054.                                             by commas. The attrs describe
  9055.                                             formal. The following attributes
  9056.                                             can be used with formal: FAR,
  9057.                                             HUGE, NEAR, REFERENCE, VALUE.»
  9058.  
  9059.  
  9060.  ■  Remarks
  9061.  
  9062.  A function begins with a FUNCTION statement and ends with the next END
  9063.  statement. A function can contain any statement except a BLOCK DATA,
  9064.  FUNCTION, «INTERFACE TO,» PROGRAM, or SUBROUTINE statement.
  9065.  
  9066.  The length specifier for the function type may follow the function name. For
  9067.  example, the following two declarations are equivalent:
  9068.  
  9069.              INTEGER*4  FUNCTION  FuncX   (var)
  9070.              INTEGER    FUNCTION  FuncX*4 (var)
  9071.  
  9072.  Within the calling program, func is global, and may not be used for any
  9073.  other variable or subprogram.
  9074.  
  9075.  The formal-argument list sets the number of arguments for that function. The
  9076.  argument types are set by any IMPLICIT, EXTERNAL, DIMENSION, or type
  9077.  statements within the function itself (or they default to implicit FORTRAN
  9078.  types). The argument types are not set by the calling program, even if the
  9079.  function appears in the calling program's source file. Formal-argument names
  9080.  cannot appear in «AUTOMATIC,» COMMON, DATA,  EQUIVALENCE, INTRINSIC, or SAVE
  9081.  statements.
  9082.  
  9083.  When a function is referenced, the actual arguments that are passed must
  9084.  agree with corresponding formal arguments in the FUNCTION statement in
  9085.  order, in number «(except when the C and VARYING attributes are specified)»,
  9086.  and in type or kind.
  9087.  
  9088.  The compiler will check for correspondence if the formal arguments are
  9089.  known. See the CALL entry in this section for more information on checking
  9090.  arguments for correspondence.
  9091.  
  9092.  The function name func acts as if it were a variable within the function
  9093.  definition. At some point in the execution of a function, a value must be
  9094.  assigned to the function name. It is this value that is returned to the
  9095.  calling program through the function's name. This value is usually assigned
  9096.  at the end of the function (but any number of assignments may be made), with
  9097.  RETURN statements terminating the function at the appropriate points.
  9098.  
  9099.  In addition to returning the value of the function, an external function can
  9100.  return values by assignment to any formal argument whose corresponding
  9101.  actual argument was passed by reference.
  9102.  
  9103.  A "recursive" function is one that calls itself, or calls another
  9104.  subprogram, which in turn calls the first function before the first function
  9105.  has completed execution. FORTRAN does not support recursive function calls.
  9106.  A function may otherwise be called from any unit.
  9107.  
  9108.  
  9109.  ■  Example
  9110.  
  9111.     C     GetNo is a function that
  9112.     reads a number from unit i
  9113.           i = 2
  9114.           10 IF (GetNo(i) .EQ. 0.0)
  9115.     GOTO 10
  9116.           END
  9117.     C
  9118.           FUNCTION GetNo (nounit)
  9119.           READ (nounit, '(F10.5)') r
  9120.           GetNo = r
  9121.           END
  9122.  
  9123.  
  9124.  GOTO (Assigned GOTO)
  9125.  
  9126.  
  9127.  ■  Action
  9128.  
  9129.  Transfers execution to the statement label assigned to variable
  9130.  
  9131.  
  9132.  ■  Syntax
  9133.  
  9134.       GOTO variable ««,» (labels)»
  9135.  
  9136.  Parameter                                  Description
  9137.  
  9138.  variable                                   An integer variable. The variable
  9139.                                             must have been assigned the label
  9140.                                             of an executable statement in the
  9141.                                             same program unit.
  9142.  
  9143.  labels                                     A list of one or more statement
  9144.                                             labels of executable statements
  9145.                                             in the same program unit. If more
  9146.                                             than one label is specified, the
  9147.                                             labels are separated by commas.
  9148.  
  9149.                                             A label may appear more than once
  9150.                                             in a list.
  9151.  
  9152.  
  9153.  ■  Remarks
  9154.  
  9155.  «If you specify the $DEBUG metacommand, a run-time error occurs if the label
  9156.  assigned to name is not one of the labels specified in the label list.»
  9157.  
  9158.  Jumping into a DO, IF, ELSE IF, or ELSE block from outside the block is not
  9159.  normally permitted. «A special feature, extended-range DO loops, does permit
  9160.  entry into a DO block. See the $DO66 entry in Section 6.2, "Metacommand
  9161.  Directory," for more information.»
  9162.  
  9163.  
  9164.  ■  Examples
  9165.  
  9166.             ASSIGN 10 TO n
  9167.             GOTO n
  9168.          10 CONTINUE
  9169.  
  9170.  The following example uses an assigned GOTO statement to check the value of
  9171.  clearance:
  9172.  
  9173.       «$DEBUG»
  9174.  
  9175.             INTEGER  view, clearance
  9176.       C     Assign an appropriate label to view:
  9177.             IF (clearance .EQ. 1) THEN
  9178.                ASSIGN 200 TO view
  9179.             ELSE IF (clearance .EQ. 2) THEN
  9180.                ASSIGN 400 TO view
  9181.             ELSE
  9182.                ASSIGN 100 TO view
  9183.             END IF
  9184.  
  9185.       C     Show user appropriate view of data depending on
  9186.       C     security clearance.
  9187.             GOTO view (100, 200, 400)
  9188.  
  9189.       «C     If view had not been assigned one of the valid labels»
  9190.       «C     (100, 200, or 400), a run-time error would have occurred.»
  9191.  
  9192.        100  CONTINUE
  9193.             .
  9194.             .
  9195.             .
  9196.        200  CONTINUE
  9197.             .
  9198.             .
  9199.             .
  9200.        400  CONTINUE
  9201.             .
  9202.             .
  9203.             .
  9204.             END
  9205.  
  9206.  
  9207.  GOTO (Computed GOTO)
  9208.  
  9209.  
  9210.  ■  Action
  9211.  
  9212.  Transfers control to the statement at the nth label in the list
  9213.  
  9214.  
  9215.  ■  Syntax
  9216.  
  9217.       GOTO (labels) «,» n
  9218.  
  9219.  Parameter                                  Description
  9220.  
  9221.  labels                                     One or more statement labels of
  9222.                                             executable statements in the same
  9223.                                             program unit. If there is more
  9224.                                             than one label, the labels are
  9225.                                             separated by commas.
  9226.  
  9227.                                             The same statement label may
  9228.                                             appear more than once in the
  9229.                                             list.
  9230.  
  9231.  n                                          An integer expression. Control is
  9232.                                             transferred to the nth label in
  9233.                                             the list.
  9234.  
  9235.  
  9236.  ■  Remarks
  9237.  
  9238.  If there are j labels in the list and n is out of range (that is, n > j or n
  9239.  < 1), the computed GOTO statement acts like a CONTINUE statement.
  9240.  
  9241.  Jumping into a DO, IF, ELSE IF, or ELSE block from outside the block is not
  9242.  normally permitted. «A special feature, extended-range DO loops, does permit
  9243.  entry into a DO block. See the $DO66 entry in Section 6.2,"Metacommand
  9244.  Directory," for more information.
  9245.  
  9246.  
  9247.  ■  Example
  9248.  
  9249.             next = 1
  9250.       C     The following statement transfers control to statement 10:
  9251.             GOTO (10, 20) next
  9252.             .
  9253.             .
  9254.             .
  9255.          10 CONTINUE
  9256.             .
  9257.             .
  9258.             .
  9259.          20 CONTINUE
  9260.  
  9261.  
  9262.  GOTO (Unconditional GOTO)
  9263.  
  9264.  
  9265.  ■  Action
  9266.  
  9267.  Transfers control to a labeled statement
  9268.  
  9269.  
  9270.  ■  Syntax
  9271.  
  9272.       GOTO label
  9273.  
  9274.  Parameter                                  Description
  9275.  
  9276.  label                                      The statement label of an
  9277.                                             executable statement in the same
  9278.                                             program unit
  9279.  
  9280.  
  9281.  ■  Remarks
  9282.  
  9283.  If the program unit does not contain a statement with the label specified in
  9284.  the GOTO statement, a compile-time error occurs.
  9285.  
  9286.  Jumping into a DO, IF, ELSE IF, or ELSE block from outside the block is not
  9287.  normally permitted. «A special feature, extended-range DO loops, does permit
  9288.  entry into a DO block. See the $DO66 entry in Section 6.2, "Metacommand
  9289.  Directory," for more information.»
  9290.  
  9291.  
  9292.  ■  Example
  9293.  
  9294.             GOTO 4077
  9295.             .
  9296.             .
  9297.             .
  9298.        4077 CONTINUE
  9299.  
  9300.  
  9301.  IF (Arithmetic IF)
  9302.  
  9303.  
  9304.  ■  Action
  9305.  
  9306.  Transfers control to one of three statement labels, depending on the value
  9307.  of expression
  9308.  
  9309.  
  9310.  ■  Syntax
  9311.  
  9312.       IF (expression) label1, label2, label3
  9313.  
  9314.  Parameter                                  Description
  9315.  
  9316.  expression                                 An integer expression or a
  9317.                                             single- or double-precision real
  9318.                                             expression.
  9319.  
  9320.  label1, label2, label3                     The statement labels of
  9321.                                             executable statements in the same
  9322.                                             program unit. The same statement
  9323.                                             label may appear more than once.
  9324.  
  9325.  
  9326.  ■  Remarks
  9327.  
  9328.  The arithmetic IF statement transfers control as follows:
  9329.  
  9330.  If expression is:                          The next statement executed is:
  9331.  
  9332.  < 0                                        The statement at label1.
  9333.  
  9334.  = 0                                        The statement at label2.
  9335.  
  9336.  > 0                                        The statement at label3.
  9337.  
  9338.  Jumping into a DO, IF, ELSE IF, or ELSE block from outside the block is not
  9339.  normally permitted. «A special feature, extended-range DO loops, does permit
  9340.  entry into a DO block. See the $DO66 entry in Section 6.2,"Metacommand
  9341.  Directory," for more information.»
  9342.  
  9343.  
  9344.  ■  Example
  9345.  
  9346.             DO 40 j = -1, 1
  9347.             n = j
  9348.       C     The following statement transfers control to statement 10
  9349.       C     for j = -1, to statement 20 for j = 0, and to statement 30
  9350.       C     for j = +1.
  9351.             IF (n) 10, 20, 30
  9352.          10 CONTINUE
  9353.             .
  9354.             .
  9355.             .
  9356.          20 CONTINUE
  9357.             .
  9358.             .
  9359.             .
  9360.          30 CONTINUE
  9361.             .
  9362.             .
  9363.             .
  9364.          40 CONTINUE
  9365.  
  9366.  
  9367.  IF (Logical IF)
  9368.  
  9369.  
  9370.  ■  Action
  9371.  
  9372.  If expression is true, statement is executed; if expression is false,
  9373.  program execution continues with the next executable statement
  9374.  
  9375.  
  9376.  ■  Syntax
  9377.  
  9378.       IF (expression) statement
  9379.  
  9380.  Parameter                                  Description
  9381.  
  9382.  expression                                 A logical expression.
  9383.  
  9384.  statement                                  Any executable statement except a
  9385.                                             «CASE,» DO, ELSE, ELSE IF, END,
  9386.                                             END IF, «END SELECT CASE, SELECT
  9387.                                             CASE,» block IF, or another
  9388.                                             logical IF statement. Note that
  9389.                                             the statement can be an
  9390.                                             arithmetic IF.
  9391.  
  9392.  
  9393.  ■  Examples
  9394.  
  9395.             IF (i .EQ. 0)  j = 2
  9396.  
  9397.             IF (x .GT. 2.3)  GOTO 100
  9398.             .
  9399.             .
  9400.             .
  9401.         100 CONTINUE
  9402.  
  9403.  
  9404.  IF THEN ELSE (Block IF)
  9405.  
  9406.  
  9407.  ■  Action
  9408.  
  9409.  If expression is true, statements in the IF block are executed; if
  9410.  expression is false, control is transferred to the next ELSE, ELSE IF, or
  9411.  END IF statement at the same IF level
  9412.  
  9413.  
  9414.  ■  Syntax
  9415.  
  9416.       IF (expression) THEN
  9417.  
  9418.  Parameter                                  Description
  9419.  
  9420.  expression                                 A logical expression
  9421.  
  9422.  
  9423.  ■  Remarks
  9424.  
  9425.  The associated IF block consists of all the executable statements (possibly
  9426.  none) between the IF statement and the next ELSE IF, ELSE, or END IF
  9427.  statement at the same IF level as this block IF statement. (IF levels are
  9428.  defined below.)
  9429.  
  9430.  The block IF statement transfers control as follows:
  9431.  
  9432.  If expression is:                          Then the next statement executed i
  9433.  
  9434.  True, and the IF block has no              The next END IF statement at the
  9435.  executable statements                      same IF level as the block IF
  9436.                                             statement
  9437.  
  9438.  True, and there is at least one            The first executable statement in
  9439.  executable statement in the IF             the IF block
  9440.  block
  9441.  
  9442.  False                                      The next ELSE IF, ELSE, or END IF
  9443.                                             statement at the same IF level as
  9444.                                             the block IF statement
  9445.  
  9446.  After execution of the last statement in the IF block, the next statement
  9447.  executed is the next END IF statement at the same IF level as the block IF
  9448.  statement.
  9449.  
  9450.  Transfer of control into an IF block from outside that block is not
  9451.  permitted.
  9452.  
  9453.  The IF level of a program statement is if minus endif, where if is the
  9454.  number of block IF statements from the beginning of the program unit in
  9455.  which the statement occurs, up to and including that statement, and endif is
  9456.  the number of END IF statements from the beginning of the program unit up
  9457.  to, but not including, that statement.
  9458.  
  9459.  Item                                       Required IF-Level Value
  9460.  
  9461.  Block IF, ELSE IF, ELSE, and END           Greater than 0 and less than
  9462.  IF                                         approximately 50
  9463.  
  9464.  END                                        0
  9465.  
  9466.  Other statements                           Greater than or equal to 0 and
  9467.                                             less than approximately 50
  9468.  
  9469.  
  9470.  ■  Examples
  9471.  
  9472.       C     Simple block IF that skips a group of statements
  9473.       C     if the expression is false:
  9474.             IF (i .LT. 10) THEN
  9475.       C     the next two statements are only executed if i is < 10
  9476.                j = i
  9477.                slice = TAN (angle)
  9478.             END IF
  9479.  
  9480.       C     Block IF with ELSE IF statements:
  9481.  
  9482.             IF (j .GT. 1000) THEN
  9483.       C     Statements here are executed only if J > 1000
  9484.             ELSE IF (j .GT. 100) THEN
  9485.       C     Statements here are executed only if J > 100 and j <= 1000
  9486.             ELSE IF (j .GT. 10) THEN
  9487.       C     Statements here are executed only if J > 10 and j <= 100
  9488.             ELSE
  9489.       C     Statements here are executed only if j <= 10
  9490.             END IF
  9491.  
  9492.       C     Nesting of constructs and use of an ELSE statement following
  9493.       C     a block IF without intervening ELSE IF statements:
  9494.  
  9495.             IF (i .LT. 100) THEN
  9496.       C     Statements here are executed only if i < 100
  9497.                IF (j .LT. 10) THEN
  9498.       C     Statements here are executed only if i < 100 and j < 10
  9499.                END IF
  9500.       C     Statements here are executed only if i < 100
  9501.             ELSE
  9502.       C     Statements here are executed only if i >= 100
  9503.                IF (j .LT. 10) THEN
  9504.       C     Statements here are executed only if i >= 100 and j < 10
  9505.                END IF
  9506.       C     Statements here are executed only if i >= 100
  9507.             END IF
  9508.  
  9509.  
  9510.  ■  See also
  9511.  
  9512.  ELSE
  9513.  ELSE IF
  9514.  END IF
  9515.  
  9516.  
  9517.  IMPLICIT
  9518.  
  9519.  
  9520.  ■  Action
  9521.  
  9522.  Defines the default type for user-declared names
  9523.  
  9524.  
  9525.  ■  Syntax
  9526.  
  9527.       IMPLICIT «{» type (letters) «, type (letters)»... «| NONE }»
  9528.  
  9529.  Parameter                                  Description
  9530.  
  9531.  type                                       One of the following types:
  9532.  
  9533.                                             CHARACTER
  9534.                                             CHARACTER*n
  9535.                                             COMPLEX
  9536.                                             «COMPLEX*8»
  9537.                                             «COMPLEX*16»
  9538.                                             «DOUBLE»
  9539.                                             «COMPLEX»
  9540.                                             DOUBLE PRECISION
  9541.                                             INTEGER
  9542.                                             «INTEGER*1»
  9543.                                             «INTEGER*2»
  9544.                                             «INTEGER*4»
  9545.                                             «INTEGER[C]»
  9546.                                             LOGICAL
  9547.                                             «LOGICAL*1»
  9548.                                             «LOGICAL*2»
  9549.                                             «LOGICAL*4»
  9550.                                             REAL
  9551.                                             «REAL*4»
  9552.                                             «REAL*8»
  9553.  
  9554.  letters                                    A list of single letters and
  9555.                                             ranges of letters. If more than
  9556.                                             one letter or range is listed,
  9557.                                             they must be separated by commas.
  9558.                                             Case is not significant.
  9559.  
  9560.                                             A range of letters is indicated
  9561.                                             by the first and last letters in
  9562.                                             the range, separated by a minus
  9563.                                             sign. The letters for a range
  9564.                                             must be in alphabetical order.
  9565.                                             «In this context, Microsoft
  9566.                                             FORTRAN allows the use of the
  9567.                                             dollar sign ($) as an alphabetic
  9568.                                             character that follows the letter
  9569.                                             Z.»
  9570.  
  9571.  
  9572.  ■  Remarks
  9573.  
  9574.  An IMPLICIT statement establishes the default type for all user-defined
  9575.  names that begin with any of the specified letters. An IMPLICIT statement
  9576.  applies only to the program unit in which it appears and does not change the
  9577.  type of any intrinsic function.
  9578.  
  9579.  «If IMPLICIT NONE is specified, then all user-defined names must be
  9580.  explicitly typed. An untyped name causes a compile-time error.» An explicit
  9581.  type statement can confirm or override the type established by an IMPLICIT
  9582.  statement. An explicit type in a FUNCTION statement also overrides the type
  9583.  indicated by an IMPLICIT statement. If the type in question is a character
  9584.  type, the length may be overridden by a later type definition.
  9585.  
  9586.  A program unit can have more than one IMPLICIT statement. However, all
  9587.  IMPLICIT statements must precede all other specification statements in that
  9588.  program unit. A particular letter cannot appear in more than one IMPLICIT
  9589.  statement in the same program unit.
  9590.  
  9591.  «A program unit can have only one IMPLICIT NONE statement. No other IMPLICIT
  9592.  statements may appear in a program unit that contains an IMPLICIT NONE
  9593.  statement.»
  9594.  
  9595.  
  9596.  ■  Example
  9597.  
  9598.             IMPLICIT INTEGER (a - b)
  9599.             IMPLICIT CHARACTER*10 (n)
  9600.       C     The following statement overrides the implicit
  9601.       C     INTEGER type for the variable anyname:
  9602.             CHARACTER*20 anyname
  9603.             age = 10
  9604.             name = 'PAUL'
  9605.  
  9606.  
  9607.  INCLUDE
  9608.  
  9609.  
  9610.  ■  «Action»
  9611.  
  9612.  «Inserts the contents of a specified text file at the location of the
  9613.  INCLUDE statement»
  9614.  
  9615.  
  9616.  ■  «Syntax»
  9617.  
  9618.       «INCLUDE 'filename'»
  9619.  
  9620.  «Parameter                                 Description»
  9621.  
  9622.  «filename»                                 «The name of the FORTRAN text
  9623.                                             file to include in the program,
  9624.                                             surrounded by apostrophes.
  9625.  
  9626.  
  9627.  ■  «Remarks»
  9628.  
  9629.  «The argument filename must be a valid text file specification for your
  9630.  operating system.»
  9631.  
  9632.  «The compiler considers the contents of the include file to be part of the
  9633.  program file and compiles them immediately. At the end of the include file,
  9634.  the compiler resumes processing the original source file at the line
  9635.  following the INCLUDE statement.»
  9636.  
  9637.  «Include files are primarily used for data or program units that appear in
  9638.  more than one program. Include files most often contain subroutines and
  9639.  functions, common block declarations, and EXTERNAL, INTERFACE, and INTRINSIC
  9640.  statements.»
  9641.  
  9642.  «Include files can also contain other INCLUDE statements and $INCLUDE
  9643.  metacommands; this is called "nesting" included files. The compiler allows
  9644.  you to nest any combination of up to ten INCLUDE statements or $INCLUDE
  9645.  metacommands. Your operating system may impose further restrictions.»
  9646.  
  9647.  
  9648.  ■  «Example»
  9649.  
  9650.  «This program implements a stack by declaring the common stack data in an
  9651.  include file. The contents of the file STKVARS.FOR (shown below in the
  9652.  following program) are inserted in the source code in place of every INCLUDE
  9653.  statement. This guarantees that all references to common storage for stack
  9654.  variables are consistent.»
  9655.  
  9656.           «INTEGER i
  9657.            REAL    x
  9658.            INCLUDE 'stkvars.for'
  9659.  
  9660.       C     read in five real numbers:
  9661.            DO 100 i = 1, 5
  9662.               READ (*, '(F10.5)') x
  9663.               CALL Push (x)
  9664.            100 CONTINUE
  9665.  
  9666.       C     write out the numbers in reverse order:
  9667.            WRITE (*, *) ' '
  9668.            DO 200 i = 1, 5
  9669.               CALL Pop (x)
  9670.               WRITE (*, *) x
  9671.            200 CONTINUE
  9672.            END
  9673.            SUBROUTINE Push (x)
  9674.       C     Pushes an element x onto the top of the stack.
  9675.  
  9676.            REAL x
  9677.            INCLUDE 'stkvars.for'
  9678.  
  9679.            top = top + 1
  9680.            IF (top .GT. stacksize)  STOP 'Stack overflow'
  9681.            stack(top) = x
  9682.            END
  9683.  
  9684.            SUBROUTINE pop(x)
  9685.       C     Pops an element from the top of the stack into x.
  9686.  
  9687.            REAL x
  9688.            INCLUDE 'stkvars.for'
  9689.  
  9690.            IF (top .LE. 0)  STOP 'Stack underflow'
  9691.               x   = stack(top)
  9692.               top = top - 1
  9693.            END»
  9694.  
  9695.  «The following is the text file STKVARS.FOR:»
  9696.  
  9697.      «C     This file contains the declaration of the common block
  9698.       C     for a stack implementation. Because this file contains an
  9699.       C     assignment statement, it must be included only after all
  9700.       C     other specification statements in each program unit.
  9701.  
  9702.            REAL     stack(500)
  9703.            INTEGER  top, stacksize
  9704.  
  9705.            COMMON  /stackbl/ stack, top
  9706.  
  9707.            stacksize = 500»
  9708.  
  9709.  
  9710.  INQUIRE
  9711.  
  9712.  
  9713.  ■  Action
  9714.  
  9715.  Returns the properties of a unit or external file
  9716.  
  9717.  
  9718.  ■  Syntax
  9719.  
  9720.       INQUIRE ({«UNIT=»unitspec | FILE=file}
  9721.       «, ACCESS=access»
  9722.      ««, BINARY=binary»»
  9723.       «, BLANK=blank»
  9724.      ««, BLOCKSIZE=blocksize»»
  9725.       «, DIRECT=direct»
  9726.       «, ERR=errlabel»
  9727.       «, EXIST=exist»
  9728.       «, FORM=form»
  9729.       «, FORMATTED=formatted»
  9730.       «, IOSTAT=iocheck»
  9731.      ««, MODE=mode»»
  9732.       «, NAME=name»
  9733.       «, NAMED=named»
  9734.       «, NEXTREC=nextrec»
  9735.       «, NUMBER=num»
  9736.       «, OPENED=opened»
  9737.       «, RECL=recl»
  9738.       «, SEQUENTIAL=seq»
  9739.      ««, SHARE=share»»
  9740.       «, UNFORMATTED=unformatted»)
  9741.  
  9742.  If UNIT= is omitted, unitspec must be the first parameter. The parameters
  9743.  can otherwise appear in any order.
  9744.  
  9745.  Parameter                                  Description
  9746.  
  9747.  unitspec                                   The unitspec parameter can be
  9748.                                             either an integer expression or
  9749.                                             an asterisk (*). If UNIT = * is
  9750.                                             specified, you may not include
  9751.                                             the NUMBER= option, or a run-time
  9752.                                             error occurs.
  9753.  
  9754.                                             Exactly one unitspec or file must
  9755.                                             be specified, but not both. If
  9756.                                             unitspec is given, the inquiry is
  9757.                                             an "inquire-by-unit" operation.
  9758.  
  9759.  file                                       A character expression that the
  9760.                                             operating system recognizes as
  9761.                                             the name of the file you are
  9762.                                             interested in. Exactly one
  9763.                                             unitspec or file must be
  9764.                                             specified, but not both. If file
  9765.                                             is given, the inquiry is an
  9766.                                             "inquire-by-file" operation.
  9767.  
  9768.  access                                     A character variable, array
  9769.                                             element, «or structure element».
  9770.                                             Returns 'SEQUENTIAL' if the
  9771.                                             specified unit or file is open
  9772.                                             for appending data. Returns
  9773.                                             'SEQUENTIAL' if the specified
  9774.                                             unit or file is connected for
  9775.                                             sequential access. Returns
  9776.                                             'DIRECT' if the specified unit or
  9777.                                             file is connected for direct
  9778.                                             access. In an inquire-by-unit
  9779.                                             operation, if no file is
  9780.                                             connected to unitspec, access is
  9781.                                             undefined.
  9782.  
  9783.  «binary»                                   «A character variable, array
  9784.                                             element, or structure element.
  9785.                                             Returns 'YES' if binary is among
  9786.                                             the allowable forms for the
  9787.                                             specified file or unit. Returns
  9788.                                             'NO' or 'UNKNOWN' otherwise.»
  9789.  
  9790.  blank                                      A character variable, array
  9791.                                             element, «or structure element».
  9792.                                             Returns 'NULL' if the BN edit
  9793.                                             descriptor is in effect, and
  9794.                                             returns 'ZERO' if BZ is in
  9795.                                             effect.
  9796.  
  9797.  «blocksize»                                «An integer variable, array
  9798.                                             element, or structure element. If
  9799.                                             the unitspec or file is
  9800.                                             connected, blocksize returns the
  9801.                                             I/O buffer size. If unitspec or
  9802.                                             file is not connected, blocksize
  9803.                                             is undefined.»
  9804.  
  9805.  direct                                     A character variable, array
  9806.                                             element, «or structure element».
  9807.                                             Returns 'YES' if direct is among
  9808.                                             the allowable access modes for
  9809.                                             the specified file or unit.
  9810.                                             Returns 'NO' or 'UNKNOWN'
  9811.                                             otherwise.
  9812.  
  9813.  errlabel                                   The label of an executable
  9814.                                             statement in the same program
  9815.                                             unit. If errlabel is specified,
  9816.                                             an I/O error causes transfer of
  9817.                                             control to the statement at
  9818.                                             errlabel. If errlabel is omitted,
  9819.                                             the effect of an I/O error is
  9820.                                             determined by the presence or
  9821.                                             absence of iocheck.
  9822.  
  9823.  exist                                      A logical variable, array
  9824.                                             element, «or structure element».
  9825.                                             Returns .TRUE. if the specified
  9826.                                             unit or file exists; returns
  9827.                                             .FALSE. otherwise.
  9828.  
  9829.  form                                       A character variable or array
  9830.                                             element. Returns  'FORMATTED' if
  9831.                                             the specified unit or file is
  9832.                                             connected for formatted I/O;
  9833.                                             returns 'UNFORMATTED' for
  9834.                                             unformatted I/O; «returns
  9835.                                             'BINARY' for binary I/O».
  9836.  
  9837.  formatted                                  A character variable, array
  9838.                                             element, «or structure element».
  9839.                                             Returns 'YES' if formatted is
  9840.                                             among the allowable forms for the
  9841.                                             specified file or unit; returns
  9842.                                             'NO' or 'UNKNOWN' otherwise.
  9843.  
  9844.  iocheck                                    An integer variable, array
  9845.                                             element, «or structure element»
  9846.                                             that returns a value of zero if
  9847.                                             there is no error, or the number
  9848.                                             of the error message if an error
  9849.                                             occurs. For more information on
  9850.                                             error handling, see Section
  9851.                                             3.2.6, "Error and End-of-File
  9852.                                             Handling."
  9853.  
  9854.  «mode»                                      «A character variable, array
  9855.                                             element, or structure element
  9856.                                             that returns the current mode
  9857.                                             status of the specified file or
  9858.                                             unit. The returned modes are the
  9859.                                             same as those specified in the
  9860.                                             OPEN statement: 'READ', 'WRITE',
  9861.                                             and 'READWRITE'. In an
  9862.                                             inquire-by-unit operation, if no
  9863.                                             file is connected to  unitspec,
  9864.                                             mode is undefined.»
  9865.  
  9866.  name                                       A character variable, array
  9867.                                             element, «or structure element».
  9868.                                             In an inquire-by-unit operation,
  9869.                                             returns the name of the file
  9870.                                             connected to unitspec. If no file
  9871.                                             is connected to unitspec, or if
  9872.                                             the file connected to unitspec
  9873.                                             does not have a name, name is
  9874.                                             undefined. In an inquire-by-file
  9875.                                             operation, returns the name
  9876.                                             specified for file.
  9877.  
  9878.  named                                      A logical variable, array
  9879.                                             element, «or structure element».
  9880.                                             Returns .FALSE. if the file
  9881.                                             specified by file or attached to
  9882.                                             unitspec is not open or if it is
  9883.                                             a scratch file; returns .TRUE.
  9884.                                             otherwise.
  9885.  
  9886.  nextrec                                    An integer variable, array
  9887.                                             element, «or structure element»
  9888.                                             that returns the record number of
  9889.                                             the next record in a
  9890.                                             direct-access file. (The first
  9891.                                             record in a direct-access file
  9892.                                             has record number 1.)
  9893.  
  9894.  num                                        An integer variable, array
  9895.                                             element, «or structure element».
  9896.                                             In an inquire-by-file operation,
  9897.                                             returns the number of the unit
  9898.                                             connected to file. If no unit is
  9899.                                             connected to file, num is
  9900.                                             undefined. In an inquire-by-unit
  9901.                                             operation, returns the number
  9902.                                             given in unitspec. If you specify
  9903.                                             UNIT = *, do not include the
  9904.                                             option NUMBER=, or a run-time
  9905.                                             error occurs.
  9906.  
  9907.  opened                                     A logical variable, array
  9908.                                             element, «or structure element».
  9909.                                             In an inquire-by-unit operation,
  9910.                                             returns .TRUE. if any file is
  9911.                                             currently connected to unitspec;
  9912.                                             returns .FALSE. otherwise. In an
  9913.                                             inquire-by-file operation,
  9914.                                             returns .TRUE. if file is
  9915.                                             currently connected to any unit;
  9916.                                             returns .FALSE. otherwise.
  9917.  
  9918.  recl                                       An integer variable, element
  9919.                                             name, «or structure element» that
  9920.                                             returns the length (in bytes) of
  9921.                                             each record in a direct-access
  9922.                                             file. If the file is connected
  9923.                                             for unformatted I/O, the value is
  9924.                                             in processor-dependent units.
  9925.                                             «(In Microsoft FORTRAN, this is
  9926.                                             also the number of bytes.)»
  9927.  
  9928.  seq                                        A character variable, array
  9929.                                             element, «or structure element».
  9930.                                             Returns 'YES' if sequential is
  9931.                                             among the allowable access modes
  9932.                                             for the specified file or unit;
  9933.                                             returns 'NO' or 'UNKNOWN'
  9934.                                             otherwise.
  9935.  
  9936.  «share»                                     «A character variable, array
  9937.                                             element, or structure element.
  9938.                                             Returns the current share status
  9939.                                             of the specified file or unit.
  9940.                                             The returned values are the same
  9941.                                             as those specified in the OPEN
  9942.                                             statement: 'COMPAT', 'DENYRW',
  9943.                                             'DENYWR', 'DENYRD', and
  9944.                                             'DENYNONE'. In an inquire-by-unit
  9945.                                             operation, if no file is
  9946.                                             connected to unitspec, share is
  9947.                                             undefined.»
  9948.  
  9949.  unformatted                                A character variable, array
  9950.                                             element, «or structure element».
  9951.                                             Returns 'YES' if unformatted is
  9952.                                             among the allowable forms for the
  9953.                                             specified file or unit; returns
  9954.                                             'NO' or 'UNKNOWN' otherwise.
  9955.  
  9956.  
  9957.  ■  Remarks
  9958.  
  9959.  The INQUIRE statement returns the values of the various attributes with
  9960.  which a file was opened. Note that the INQUIRE statement cannot return the
  9961.  properties of an unopened file, and it cannot distinguish between attributes
  9962.  that are specified by you and attributes that are set by default.
  9963.  
  9964.  You can execute the INQUIRE statement at any time. It returns the values
  9965.  that are current at the time of the call.
  9966.  
  9967.  If a parameter of the INQUIRE statement is an expression that calls a
  9968.  function, that function must not execute an I/O statement «or the EOF
  9969.  intrinsic function» because the results are unpredictable.
  9970.  
  9971.  
  9972.  ■  Example
  9973.  
  9974.       C     This program prompts for the name of a data file. The INQUIRE
  9975.       C     statement then determines whether or not the file exists.
  9976.       C     If it does not, the program prompts for another file name.
  9977.  
  9978.             CHARACTER*12  fname
  9979.             LOGICAL       exists
  9980.  
  9981.       C     Get the name of a file:
  9982.             100 WRITE (*, '(1X, A\)') 'Enter the file name: '
  9983.             READ  (*, '(A)') fname
  9984.  
  9985.       C     INQUIRE about file's existence:
  9986.             INQUIRE (FILE = fname, EXIST = exists)
  9987.  
  9988.             IF (.NOT. exists) THEN
  9989.                WRITE (*,'(2A/)') ' > Cannot find file ', fname
  9990.                GOTO 100
  9991.             END IF
  9992.             .
  9993.             .
  9994.             .
  9995.             END
  9996.  
  9997.  
  9998.  INTEGER
  9999.  
  10000.  
  10001.  ■  Action
  10002.  
  10003.  Specifies the INTEGER type for user-defined names
  10004.  
  10005.  
  10006.  ■  Syntax
  10007.  
  10008.      INTEGER«{« *bytes» |  « [C] »}» »vname ««[attrs] »
  10009.      « *length»»«*length»»«(dim)»««/values/»
  10010.      «, vname ««[attrs] »«*length»»«(dim)»«« /values/»»»...
  10011.  
  10012.  The order of the length and dim parameters can be reversed.
  10013.  
  10014.  Parameter                                  Description
  10015.  
  10016.  «bytes»                                    «Must be 1, 2, or 4. Specifies
  10017.                                             the length, in bytes, of the
  10018.                                             names in the INTEGER statement.
  10019.                                             This value can be overridden by
  10020.                                             the length parameter.»
  10021.  
  10022.  vname                                      The symbolic name of a constant,
  10023.                                             variable, array, external
  10024.                                             function, statement function, or
  10025.                                             intrinsic function; or, a
  10026.                                             function subprogram or an array
  10027.                                             declarator. The vname parameter
  10028.                                             cannot be the name of a
  10029.                                             subroutine or main program.
  10030.  
  10031.  «attrs»                                    «A list of attributes, separated
  10032.                                             by commas. The attrs describe
  10033.                                             vname. These attributes can be
  10034.                                             used with vname: ALIAS,
  10035.                                             ALLOCATABLE, C, EXTERN, FAR,
  10036.                                             HUGE, NEAR, PASCAL, REFERENCE,
  10037.                                             VALUE.»
  10038.  
  10039.  «length»                                   «Must be 1, 2, or 4. Gives vname
  10040.                                             the specified length. The length
  10041.                                             parameter overrides the length
  10042.                                             specified by bytes.»
  10043.  
  10044.  dim                                        A dimension declarator.
  10045.                                             Specifying dim declares vname as
  10046.                                             an array.
  10047.  
  10048.  «values»                                   «A list of constants and repeated
  10049.                                             constants, separated by commas. A
  10050.                                             repeated constant takes the form
  10051.                                             n*constant, where n is a positive
  10052.                                             integer constant. The /values/
  10053.                                             option initializes vname. The
  10054.                                             following statement declares that
  10055.                                             num is of type INTEGER, and sets
  10056.                                             num equal to 10:»
  10057.  
  10058.                                                  «INTEGER num / 10 /»
  10059.  
  10060.  
  10061.  ■  Remarks
  10062.  
  10063.  An INTEGER statement confirms or overrides the implicit type of vname. The
  10064.  name vname is defined for the entire program unit, and cannot be defined by
  10065.  any other type statement in that program unit.
  10066.  
  10067.  «If both the bytes and length parameters are omitted, the variable's length
  10068.  defaults to the value given in the $STORAGE metacommand.»
  10069.  
  10070.  INTEGER statements must precede all executable statements.
  10071.  
  10072.  
  10073.  ■  Examples
  10074.  
  10075.             INTEGER count, matrix(4, 4), «sum*2»
  10076.            «INTEGER*22 q, m12*24, ivec(10)*24, z*24(10)»
  10077.  
  10078.  
  10079.  INTERFACE TO
  10080.  
  10081.  
  10082.  ■  «Action»
  10083.  
  10084.  «Specifies the name of a subroutine or function, its attributes and formal
  10085.  argument types»
  10086.  
  10087.  
  10088.  ■  «Syntax»
  10089.  
  10090.       «INTERFACE TO {function-statement | subroutine-statement}
  10091.       «(Formal-parameter-declaration(s))»
  10092.       «END»
  10093.  
  10094.  «Parameter                                 Description»
  10095.  
  10096.  «function-statement»                       «A function declaration
  10097.                                             statement»
  10098.  
  10099.  «subroutine-statement»                     «A subroutine declaration
  10100.                                             statement»
  10101.  
  10102.  
  10103.  ■  «Remarks»
  10104.  
  10105.  «An interface has two parts. The first is the INTERFACE TO statement
  10106.  followed by a FUNCTION or SUBROUTINE declaration statement. The second is a
  10107.  list of declarations for all the procedure's formal arguments. Only type,
  10108.  DIMENSION, EXTERNAL,  INTRINSIC, and END statements can appear in the second
  10109.  part.»
  10110.  
  10111.  «The INTERFACE TO statement confirms the correctness of subprogram calls.
  10112.  The compiler verifies that the number and types of arguments in a subprogram
  10113.  call are consistent with those in the interface. (Note that the interface
  10114.  must appear prior to any subprogram references for the checking to work.)»
  10115.  
  10116.  «The attributes in an interface override the default definitions in the
  10117.  subprogram definition. However, if you use an attribute in the subprogram
  10118.  declaration or its arguments, the same attribute must also appear in the
  10119.  INTERFACE TO statement.»
  10120.  
  10121.  
  10122.  ■  «Example»
  10123.  
  10124.            «INTERFACE TO INTEGER FUNCTION Func (p, d, q)
  10125.             INTEGER*2 p
  10126.             REAL d[C]         ! required; appears in function definition
  10127.             REAL*8 q[FAR]     ! overrides default in function definition
  10128.             END»
  10129.  
  10130.  «The interface above describes the following function to the calling unit:»
  10131.  
  10132.            «INTEGER FUNCTION Func (r, s, t)
  10133.             INTEGER*2 r
  10134.             REAL s[C]
  10135.             REAL*8 t
  10136.             .
  10137.             .
  10138.             .
  10139.             END»
  10140.  
  10141.  
  10142.  INTRINSIC
  10143.  
  10144.  
  10145.  ■  Action
  10146.  
  10147.  Declares that a name is an intrinsic function
  10148.  
  10149.  
  10150.  ■  Syntax
  10151.  
  10152.       INTRINSIC names
  10153.  
  10154.  Parameter                                  Description
  10155.  
  10156.  names                                      One or more intrinsic-function
  10157.                                             names. If more than one name is
  10158.                                             specified, the names must be
  10159.                                             separated by commas.
  10160.  
  10161.  
  10162.  ■  Remarks
  10163.  
  10164.  You must specify the name of an intrinsic function in an INTRINSIC statement
  10165.  if you wish to pass that intrinsic function as an argument.
  10166.  
  10167.  A name may appear only once in an INTRINSIC statement. A name appearing in
  10168.  an  INTRINSIC statement cannot also appear in an EXTERNAL statement. All
  10169.  names used in an INTRINSIC statement must be system-defined intrinsic
  10170.  functions. For a list of these functions, see Chapter 5, "Intrinsic
  10171.  Functions and Additional Procedures."
  10172.  
  10173.  
  10174.  ■  Example
  10175.  
  10176.             INTRINSIC SIN, COS
  10177.       C     SIN and COS are arguments to Calc2:
  10178.             result = Calc2 (SIN, COS)
  10179.  
  10180.  
  10181.  LOCKING
  10182.  
  10183.  
  10184.  ■  «Action»
  10185.  
  10186.  «Locks direct-access files and records to prevent access by other users in a
  10187.  network environment»
  10188.  
  10189.  
  10190.  ■  «Syntax»
  10191.  
  10192.       «LOCKING («UNIT=»unitspec
  10193.       «, ERR=errlabel»
  10194.       «, IOSTAT=iocheck»
  10195.       «, LOCKMODE=lockmode»
  10196.       «, REC=rec»
  10197.       «, RECORDS=recnum»)»
  10198.  
  10199.  «If UNIT= is omitted, unitspec must be the first parameter. The parameters
  10200.  can otherwise appear in any order.»
  10201.  
  10202.  «Parameter                                 Description»
  10203.  
  10204.  «unitspec»                                 «An integer expression for the
  10205.                                             unit to be locked. The file
  10206.                                             attached to unitspec must have
  10207.                                             been opened for direct access.»
  10208.  
  10209.  «errlabel»                                 «The label of an executable
  10210.                                             statement in the same program
  10211.                                             unit. If errlabel is specified,
  10212.                                             an I/O error causes transfer of
  10213.                                             control to the statement at
  10214.                                             errlabel. If errlabel is omitted,
  10215.                                             the effect of an I/O error is
  10216.                                             determined by the presence or
  10217.                                             absence of iocheck.»
  10218.  
  10219.  «iocheck»                                  «An integer variable, array
  10220.                                             element, or structure element
  10221.                                             that returns the value zero if
  10222.                                             there is no error, or the number
  10223.                                             of the error message if an error
  10224.                                             occurs. For more information on
  10225.                                             error handling, see Section
  10226.                                             3.2.6, "Error and End-of-File
  10227.                                             Handling."»
  10228.  
  10229.  «lockmode»                                 «A character expression with one
  10230.                                             of the following values:»
  10231.  
  10232.                                             «Value    Description»
  10233.  
  10234.                                             «'NBLCK'  Locks the specified
  10235.                                                       region for reading and
  10236.                                                       writing. If any of the
  10237.                                                       records are already
  10238.                                                       locked by a different
  10239.                                                       process, a run-time
  10240.                                                       error occurs. This non-
  10241.                                                       blocking lock is the
  10242.                                                       default.»
  10243.  
  10244.                                             «'LOCK'   Locks the specified
  10245.                                                       region for reading and
  10246.                                                       writing. Waits for any
  10247.                                                       part of the region
  10248.                                                       locked by a different
  10249.                                                       process to become
  10250.                                                       available.»
  10251.  
  10252.                                             «'NBRLCK' Locks the specified
  10253.                                                       region for reading;
  10254.                                                       records may still be
  10255.                                                       written. This non-
  10256.                                                       blocking read lock is
  10257.                                                       otherwise the same as
  10258.                                                       'NBLCK'.»
  10259.  
  10260.                                             «'RLCK'   Locks the specified
  10261.                                                       region for reading;
  10262.                                                       records may still be
  10263.                                                       written. This read lock
  10264.                                                       is other-wise the same
  10265.                                                       as 'LOCK'.»
  10266.  
  10267.                                             «'UNLCK'  Unlocks the specified
  10268.                                                       region.»
  10269.  
  10270.  «rec»                                      «An integer expression that is
  10271.                                             the number of the first record in
  10272.                                             a group of records to be locked
  10273.                                             or unlocked. If rec is omitted,
  10274.                                             the next record (the one that
  10275.                                             would be read by a sequential
  10276.                                             read) is locked.»
  10277.  
  10278.  «recnum»                                   «An integer expression that is
  10279.                                             the number of records to be
  10280.                                             locked. It defaults to one.»
  10281.  
  10282.  
  10283.  ■  «Remarks»
  10284.  
  10285.  «The LOCKING statement has no effect when used with versions of MS-DOS
  10286.  before 3.0.»
  10287.  
  10288.  «If a parameter of the LOCKING statement is an expression that calls a
  10289.  function, that function must not cause an I/O statement or the EOF intrinsic
  10290.  function to be executed, because the results are unpredictable.»
  10291.  
  10292.  
  10293.  LOGICAL
  10294.  
  10295.  
  10296.  ■  Action
  10297.  
  10298.  Specifies the LOGICAL type for user-defined names
  10299.  
  10300.  
  10301.  ■  Syntax
  10302.  
  10303.  LOGICAL ««*bytes»»vname ««[attrs]»«*length»»«(dim)»
  10304.  ««/values/»»«, vname««[attrs]»«*length»»«(dim»
  10305.  ««/values»»»»»...
  10306.  
  10307.  Parameter                                  Description
  10308.  
  10309.  «bytes»                                    «Must be 1, 2, or 4. Specifies
  10310.                                             the length, in bytes, of the
  10311.                                             names in the LOGICAL statement.
  10312.                                             This value can be overridden by
  10313.                                             the length parameter.»
  10314.  
  10315.  vname                                      The symbolic name of a constant,
  10316.                                             variable, array, external
  10317.                                             function, statement function, or
  10318.                                             intrinsic function; or, a
  10319.                                             function subprogram or an array
  10320.                                             declarator. The vname parameter
  10321.                                             cannot be the name of a
  10322.                                             subroutine or main program.
  10323.  
  10324.  «attrs»                                    «A list of attributes, separated
  10325.                                             by commas. The attrs describe
  10326.                                             vname. These attributes can be
  10327.                                             used with vname: ALIAS,
  10328.                                             ALLOCATABLE, C, EXTERN, FAR,
  10329.                                             HUGE, NEAR,  PASCAL, REFERENCE,
  10330.                                             VALUE.»
  10331.  
  10332.  «length»                                   «Must be 1, 2, or 4. Gives vname
  10333.                                             the specified length. The length
  10334.                                             parameter overrides the length
  10335.                                             specified by bytes.»
  10336.  
  10337.  dim                                        A dimension declarator.
  10338.                                             Specifying dim declares vname as
  10339.                                             an array.
  10340.  
  10341.  «values»                                   «A list of constants and repeated
  10342.                                             constants, separated by commas. A
  10343.                                             repeated constant takes the form
  10344.                                             n*constant, where n is a
  10345.                                             positive-nonzero-integer
  10346.                                             constant, and is equivalent to
  10347.                                             constant repeated n times. The
  10348.                                             /values/ option initializes
  10349.                                             vname. The following statement
  10350.                                             declares that switch is of type
  10351.                                             LOGICAL, and sets switch  equal
  10352.                                             to .TRUE.:»
  10353.  
  10354.                                              «LOGICAL switch /.TRUE./»
  10355.  
  10356.  
  10357.  ■  Remarks
  10358.  
  10359.  A LOGICAL statement confirms or overrides the implicit type of vname. The
  10360.  name vname is defined for the entire program unit, and it cannot be defined
  10361.  by any other type statement in that program unit.
  10362.  
  10363.  «If both the bytes and length parameters are omitted, the variable's length
  10364.  defaults to the value given in the $STORAGE metacommand.»
  10365.  
  10366.  LOGICAL statements must precede all executable statements.
  10367.  
  10368.  
  10369.  ■  Example
  10370.  
  10371.             LOGICAL  switch
  10372.            «LOGICAL*1  flag»
  10373.  
  10374.  
  10375.  MAP...END MAP
  10376.  
  10377.  
  10378.  ■  «Action»
  10379.  
  10380.  «Delimits a group of variable type declarations within a STRUCTURE
  10381.  statement»
  10382.  
  10383.  
  10384.  ■  «Syntax»
  10385.  
  10386.       «MAP
  10387.              type-declaration(s)
  10388.              .
  10389.              .
  10390.              .
  10391.       END MAP»
  10392.  
  10393.  «Parameter                                 Description»
  10394.  
  10395.  «type-declaration»                         «A variable declaration; can be
  10396.                                             any conventional type (INTEGER,
  10397.                                             REAL*8, CHARACTER, etc.), or a
  10398.                                             RECORD declaration of a structure
  10399.                                             type
  10400.  
  10401.  
  10402.  ■  «Remarks»
  10403.  
  10404.  «A MAP...END MAP block must appear within a UNION...END UNION block.»
  10405.  
  10406.  «Any number of variables may appear within a map, and they may be a mixture
  10407.  of types. Variables are stored in memory contiguously, in the same order
  10408.  they appear in the MAP statement.»
  10409.  
  10410.  «There are always at least two maps within a union. The purpose of a union
  10411.  is to assign two or more maps to the same memory location. Unlike the
  10412.  FORTRAN EQUIVALENCE statement which overlays single variables or arrays, the
  10413.  MAP statement allows groups of variables to overlay other groups in the same
  10414.  union.»
  10415.  
  10416.  «For example, the two maps in the following union each contain three REAL*8
  10417.  variables. The variable manny shares the same memory space as meg, moe, and
  10418.  jo , and so forth.»
  10419.  
  10420.            «UNION
  10421.                MAP
  10422.                   REAL*8  meg, jo, amy
  10423.                END MAP
  10424.                MAP
  10425.                   REAL*8  manny, moe, jack
  10426.                END MAP
  10427.             END UNION»
  10428.  
  10429.  
  10430.  ■  «Examples»
  10431.  
  10432.  «Within a structure, maps can contain variables of intrinsic type:»
  10433.  
  10434.            «UNION
  10435.                MAP
  10436.                   CHARACTER*20 string
  10437.                END MAP
  10438.                MAP
  10439.             INTEGER*2 number(10)
  10440.                END MAP
  10441.             END UNION»
  10442.  
  10443.  «Or they can contain variables with types defined in previous STRUCTURE
  10444.  statements:»
  10445.  
  10446.            «UNION
  10447.                MAP
  10448.                   RECORD /Cartesian/ xcoord, ycoord
  10449.                END MAP
  10450.                MAP
  10451.                   RECORD /Polar/ length, angle
  10452.                END MAP
  10453.             END UNION»
  10454.  
  10455.  
  10456.  ■  «See also»
  10457.  
  10458.  «STRUCTURE...END STRUCTURE
  10459.  UNION...END UNION»
  10460.  
  10461.  
  10462.  NAMELIST
  10463.  
  10464.  
  10465.  ■  «Action»
  10466.  
  10467.  «Declares a group name for a set of variables so they may be read or written
  10468.  with a single namelist-directed READ or WRITE statement»
  10469.  
  10470.  
  10471.  ■  «Syntax»
  10472.  
  10473.       «NAMELIST /namlst/ varlist «/namlst/ varlist»»
  10474.  
  10475.  «Parameter                                 Description»
  10476.  
  10477.  «namlst»                                   «The name for a group of
  10478.                                             variables
  10479.  
  10480.  «varlist»                                  «A list of variable names and
  10481.                                             array names; may not include
  10482.                                             structure variables and formal
  10483.                                             arguments
  10484.  
  10485.  
  10486.  ■  «Remarks»
  10487.  
  10488.  «The same variable name may appear in more than one namelist.»
  10489.  
  10490.  «Any namelist can appear more than once in the same program unit. The list
  10491.  of elements in a particular namelist is treated as a continuation of the
  10492.  list in the previous namelist with the same name.»
  10493.  
  10494.  «If the namelist is used in a WRITE statement, the list of variable names
  10495.  followed by their values is written to a file or displayed.»
  10496.  
  10497.  «If the namelist is used in a READ statement, the file connected to unit or
  10498.  the user's input is scanned for the names in the namelist and their
  10499.  corresponding values. The order in which the names appear is not important,
  10500.  nor do all the names in the namelist have to appear.»
  10501.  
  10502.  «Although a namelist is limited to single variables and complete arrays, a
  10503.  file to be read may include the names of individual array elements and
  10504.  character variable substrings.»
  10505.  
  10506.  «Note that when you use a namelist in a» «READ» «statement, the program
  10507.  expects the variable names you enter to exactly match the names you gave in
  10508.  the NAMELIST statement. However, when the $TRUNCATE metacommand is used, the
  10509.  compiler truncates all variable names to six characters. In this
  10510.  circumstance, the program may not recognize the original, untruncated name;
  10511.  you must enter the shortened version of the name.»
  10512.  
  10513.  «For example, if one of your NAMELIST variables is impedance and you use the
  10514.  $TRUNCATE metacommand, a READ statement using the namelist expects impeda,
  10515.  not impedance.»
  10516.  
  10517.  
  10518.  ■  «Example»
  10519.  
  10520.            «INTEGER    i1*1, i2*2, i4*4, iarray(3)
  10521.             LOGICAL    11*1, l2*2, l4*4
  10522.             REAL       r4*4, r8*8
  10523.             COMPLEX    z8*8, z16*16
  10524.             CHARACTER  c1*1, c10*10
  10525.  
  10526.             NAMELIST /example/ i1, i2, i4, 11, l2, l4, r4, r8,
  10527.            +                   z8, z16, c1, c10, iarray
  10528.  
  10529.             i1  =  11
  10530.             i2  =  12
  10531.             i4  =  14
  10532.             11  = .TRUE.
  10533.             l2  = .TRUE.
  10534.             l4  = .TRUE.
  10535.             r4  =  24.0
  10536.             r8  =  28.0d0
  10537.             z8  = (38.0, 0.0)
  10538.             z16 = (316.0d0, 0.0d0)
  10539.             c1  = 'A'
  10540.             c10 = '0123456789'
  10541.             iarray(1) = 41
  10542.             iarray(2) = 42
  10543.             iarray(3) = 43
  10544.  
  10545.             WRITE (*, example)»
  10546.  
  10547.  «The following output is produced:»
  10548.  
  10549.       «&EXAMPLE
  10550.       I1 =           11
  10551.       I2 =           12
  10552.       I4 =           14
  10553.       L1 =  T
  10554.       L2 =  T
  10555.       L4 =  T
  10556.       R4 =        24.000000
  10557.       R8 =        28.000000000000000
  10558.       Z8 =           (38.000000, 0.000000E+00)
  10559.       Z16 =         (316.000000000000000, 0.000000000000000E+000)
  10560.       C1 = 'A'
  10561.       C10 = '0123456789'
  10562.       IARRAY =           41          42          43»
  10563.  
  10564.  «If a namelist-directed read is performed using READ (*, example) with the
  10565.  following input:»
  10566.  
  10567.       «&example
  10568.       I1=99
  10569.       L1=F
  10570.       R4=99.0
  10571.       Z8=(99.0, 0.0)
  10572.       C1='Z'
  10573.       IARRAY(1)=99
  10574.       /»
  10575.  
  10576.  «a second WRITE (*, example) statement produces the following output:»
  10577.  
  10578.       «&EXAMPLE
  10579.       I1 =           99
  10580.       I2 =           12
  10581.       I4 =           14
  10582.       L1 =  F
  10583.       L2 =  T
  10584.       L4 =  T
  10585.       R4 =        99.000000
  10586.       R8 =        28.000000000000000
  10587.       Z8 =           (99.000000, 0.000000E+00)
  10588.       Z16 =         (316.000000000000000, 0.000000000000000E+000)
  10589.       C1 = 'Z'
  10590.       C10 = '0123456789'
  10591.       IARRAY =           99          42          43
  10592.       /»
  10593.  
  10594.  
  10595.  OPEN
  10596.  
  10597.  
  10598.  ■  Action
  10599.  
  10600.  Associates a unit number with an external file or device
  10601.  
  10602.  
  10603.  ■  Syntax
  10604.  
  10605.       OPEN («UNIT=»unitspec
  10606.       «, ACCESS=access»
  10607.       «, BLANK=blanks»
  10608.      ««, BLOCKSIZE=blocksize»»
  10609.       «, ERR=errlabel»
  10610.       «, FILE=file»
  10611.       «, FORM=form»
  10612.       «, IOSTAT=iocheck»
  10613.      ««, MODE=mode»»
  10614.       «, RECL=recl»
  10615.      ««, SHARE=share»»
  10616.       «, STATUS=status»)
  10617.  
  10618.  If UNIT= is omitted, unitspec must be the first parameter. The parameters
  10619.  can otherwise appear in any order.
  10620.  
  10621.  Parameter                                  Description
  10622.  
  10623.  unitspec                                   An integer expression that
  10624.                                             specifies an external unit.
  10625.  
  10626.  access                                     A character expression that
  10627.                                             evaluates to «'APPEND',»
  10628.                                             'DIRECT', or 'SEQUENTIAL' (the
  10629.                                             default).
  10630.  
  10631.  blanks                                     A character expression that
  10632.                                             evaluates to 'NULL' or 'ZERO'.
  10633.                                             Set to 'NULL' (the default) to
  10634.                                             ignore blanks (same as BN edit
  10635.                                             descriptor, unless overridden by
  10636.                                             an explicit BZ in the READ
  10637.                                             statement). Set to 'ZERO' to
  10638.                                             treat blanks as zeros (same as BZ
  10639.                                             edit descriptor, unless
  10640.                                             overridden by an explicit BN in
  10641.                                             the READ statement).
  10642.  
  10643.  «blocksize»                                «An integer expression specifying
  10644.                                             internal buffer size for the
  10645.                                             unit. See Section 3.2.4,
  10646.                                             "Input/Output Buffer Size."»
  10647.  
  10648.  errlabel                                   The label of an executable
  10649.                                             statement in the same program
  10650.                                             unit. If errlabel is specified,
  10651.                                             an I/O error causes transfer of
  10652.                                             control to the statement at
  10653.                                             errlabel. If errlabel is omitted,
  10654.                                             the effect of an I/O error is
  10655.                                             determined by the presence or
  10656.                                             absence of iocheck.
  10657.  
  10658.  file                                       A character expression. If file
  10659.                                             is omitted, the compiler creates
  10660.                                             a scratch file unique to the
  10661.                                             specified unit. The scratch file
  10662.                                             is deleted when it is either
  10663.                                             explicitly closed or the program
  10664.                                             terminates normally.
  10665.  
  10666.                                             «If the file name specified is
  10667.                                             blank (FILE=' '), the following
  10668.                                             steps are taken:»
  10669.  
  10670.                                             1. «The program reads a file name
  10671.                                                from the list of arguments (if
  10672.                                                any) in the command line that
  10673.                                                invoked the program. If the
  10674.                                                argument is a null string
  10675.                                                (''), the user is prompted for
  10676.                                                the corresponding file name.
  10677.                                                Each succeeding nameless OPEN
  10678.                                                statement reads a successive
  10679.                                                command-line argument.»
  10680.  
  10681.                                             2. «If there are more nameless
  10682.                                                OPEN statements than command-
  10683.                                                line arguments, the program
  10684.                                                prompts for additional file
  10685.                                                names.»
  10686.  
  10687.                                             «Assume the following command
  10688.                                             line has invoked the program
  10689.                                             MYPROG:»
  10690.  
  10691.                                             «myprog first.fil " " third.txt»
  10692.  
  10693.                                             «MYPROG contains four OPEN
  10694.                                             statements with blank file names,
  10695.                                             in the following order:»
  10696.  
  10697.                                             «OPEN (2,  FILE = ' ')
  10698.                                              OPEN (4,  FILE = ' ')
  10699.                                              OPEN (5,  FILE = ' ')
  10700.                                              OPEN (10, FILE = ' ')»
  10701.  
  10702.                                             «Unit 2 is associated with the
  10703.                                             file FIRST.FIL. Since a null
  10704.                                             argument was specified on the
  10705.                                             command line for the second file
  10706.                                             name, the OPEN statement for unit
  10707.                                             4 produces the following prompt:»
  10708.  
  10709.                                             «File name missing or blank
  10710.                                             -Please enter name UNIT 4?»
  10711.  
  10712.                                             «Unit 5 is associated with the
  10713.                                             file THIRD.TXT. As no fourth file
  10714.                                             was specified on the command
  10715.                                             line, the OPEN statement for unit
  10716.                                             10 produces the following
  10717.                                             prompt:»
  10718.  
  10719.                                             «File name missing or blank
  10720.                                             -Please enter name UNIT 10?»
  10721.  
  10722.  form                                       A character expression that
  10723.                                             evaluates to 'FORMATTED',
  10724.                                             'UNFORMATTED'«, or 'BINARY'».
  10725.  
  10726.                                             If access is sequential, the
  10727.                                             default for form is 'FORMATTED';
  10728.                                             if access is direct, the default
  10729.                                             is 'UNFORMATTED'.
  10730.  
  10731.  iocheck                                    An integer variable, array
  10732.                                             element, «or structure element»
  10733.                                             that returns a value of zero if
  10734.                                             no error occurs, a negative
  10735.                                             integer if an end-of-file record
  10736.                                             is encountered, or the number of
  10737.                                             the error message if an error
  10738.                                             occurs. See Section 3.2.6, "Error
  10739.                                             and End-of-File Handling."
  10740.  
  10741.  «mode»                                     «A character expression that
  10742.                                             evaluates to 'READ' (the process
  10743.                                             can only read the file), 'WRITE'
  10744.                                             (the process can only write to
  10745.                                             the file), or 'READWRITE' (the
  10746.                                             process can both read from and
  10747.                                             write to the file).»
  10748.  
  10749.                                             «If mode is not specified, the
  10750.                                             FORTRAN run-time system attempts
  10751.                                             to open the file with a mode of
  10752.                                             'READWRITE'. If this open
  10753.                                             operation fails, the run-time
  10754.                                             system tries to open the file
  10755.                                             again, first using 'READ', then
  10756.                                             using 'WRITE'.»
  10757.  
  10758.                                             «Note that this action is not the
  10759.                                             same as specifying
  10760.                                             MODE='READWRITE'. If you specify
  10761.                                             the option MODE='READWRITE', and
  10762.                                             the file cannot be opened for
  10763.                                             both read and write access, the
  10764.                                             attempt to open the file fails.
  10765.                                             The default behavior (trying
  10766.                                             'READWRITE', then 'READ', then
  10767.                                             'WRITE') is more flexible (though
  10768.                                             you may have to use the INQUIRE
  10769.                                             statement to determine the actual
  10770.                                             access mode selected). The value
  10771.                                             of the STATUS= option does not
  10772.                                             affect mode.»
  10773.  
  10774.  recl                                       An integer expression that
  10775.                                             specifies the length of each
  10776.                                             record in bytes. This parameter
  10777.                                             is required for direct-access
  10778.                                             files, and is ignored for
  10779.                                             sequential files.
  10780.  
  10781.  «share»                                    «A character expression. The
  10782.                                             acceptable values of share are:»
  10783.  
  10784.                                             «Value      Description»
  10785.  
  10786.                                             «'COMPAT'   Compatibility mode
  10787.                                                         (the default mode in
  10788.                                                         DOS). While a file is
  10789.                                                         open in compatibility
  10790.                                                         mode, the original
  10791.                                                         user (the process
  10792.                                                         that opened the file)
  10793.                                                         may open the file in
  10794.                                                         compatibility mode
  10795.                                                         any number of times.
  10796.                                                         No other user may
  10797.                                                         open the file.»
  10798.  
  10799.                                                         A file that is
  10800.                                                         already open in a
  10801.                                                         mode other than
  10802.                                                         compatibility mode
  10803.                                                         cannot be opened in
  10804.                                                         compatibility mode.»
  10805.  
  10806.                                             «'DENYRW'   Deny-read/write mode.
  10807.                                                         While a file is open
  10808.                                                         in deny-read/write
  10809.                                                         mode, no other
  10810.                                                         process may open the
  10811.                                                         file.»
  10812.  
  10813.                                             «'DENYWR'   Deny-write mode.
  10814.                                                         While a file is open
  10815.                                                         in deny-write mode,
  10816.                                                         no process may open
  10817.                                                         the file with write
  10818.                                                         access.»
  10819.  
  10820.                                             «'DENYRD'   Deny-read mode. While
  10821.                                                         a file is open in
  10822.                                                         deny-read mode, no
  10823.                                                         process may open the
  10824.                                                         file with read
  10825.                                                         access.»
  10826.  
  10827.                                             «'DENYNONE' Deny-none mode (the
  10828.                                                         default mode in
  10829.                                                         OS/2). While a file
  10830.                                                         is open in deny-none
  10831.                                                         mode, any process may
  10832.                                                         open the file in any
  10833.                                                         mode (except
  10834.                                                         compatibility mode).»
  10835.  
  10836.                                                         See Section 3.2.11
  10837.                                                         for information on
  10838.                                                         file sharing.»
  10839.  
  10840.  status                                     A character expression that
  10841.                                             evaluates to 'OLD', 'NEW',
  10842.                                             'UNKNOWN' (default), or
  10843.                                             'SCRATCH'.
  10844.  
  10845.                                             The following list describes the
  10846.                                             four values of status:
  10847.  
  10848.                                             Value     Description
  10849.  
  10850.                                             'OLD'     The file must already
  10851.                                                       exist. If the file
  10852.                                                       exists, it is opened.
  10853.                                                       If it does not exist,
  10854.                                                       an I/O error occurs.
  10855.  
  10856.                                                       If you open an existing
  10857.                                                       sequential file and
  10858.                                                       write to it or close it
  10859.                                                       without first moving to
  10860.                                                       the end, you overwrite
  10861.                                                       the file. (Opening with
  10862.                                                       ACCESS = 'APPEND'
  10863.                                                       automatically positions
  10864.                                                       the file at the end.)
  10865.  
  10866.                                             'NEW'     The file must not
  10867.                                                       already exist. If the
  10868.                                                       file does not exist, it
  10869.                                                       is created. If it
  10870.                                                       exists, an I/O error
  10871.                                                       occurs.
  10872.  
  10873.                                                       If you open a file with
  10874.                                                       the option
  10875.                                                       STATUS='NEW', and close
  10876.                                                       it with STATUS='KEEP',
  10877.                                                       or if the program
  10878.                                                       terminates without
  10879.                                                       explicitly closing the
  10880.                                                       file, a permanent file
  10881.                                                       is created.
  10882.  
  10883.                                             'SCRATCH' If you omit the fname
  10884.                                                       parameter when opening
  10885.                                                       a file, the value of
  10886.                                                       status defaults to
  10887.                                                       'SCRATCH'. Scratch
  10888.                                                       files are temporary.
  10889.                                                       They are deleted when
  10890.                                                       explicitly closed or
  10891.                                                       when the program
  10892.                                                       terminates. You can
  10893.                                                       also open a named file
  10894.                                                       with the explicit
  10895.                                                       option STATUS=
  10896.                                                       'SCRATCH'. The file is
  10897.                                                       deleted at program
  10898.                                                       termination.
  10899.  
  10900.                                             'UNKNOWN' If you open a file with
  10901.                                                       the STATUS='UNKNOWN'
  10902.                                                       option, the FORTRAN
  10903.                                                       run-time system first
  10904.                                                       attempts to open the
  10905.                                                       file with status equal
  10906.                                                       to 'OLD', then with
  10907.                                                       status equal to 'NEW'.
  10908.                                                       Therefore, if the file
  10909.                                                       exists, it is opened;
  10910.                                                       if it does not exist,
  10911.                                                       it is created.
  10912.  
  10913.                                                       The 'UNKNOWN' status
  10914.                                                       avoids any run-time
  10915.                                                       errors associated with
  10916.                                                       opening an existing
  10917.                                                       file with STATUS='NEW'
  10918.                                                       or opening a non-
  10919.                                                       existent file with
  10920.                                                       STATUS='OLD'.
  10921.  
  10922.                                             Status values affect only disk
  10923.                                             files. When devices such as the
  10924.                                             keyboard or the printer are
  10925.                                             opened, the STATUS= option is
  10926.                                             ignored.
  10927.  
  10928.  
  10929.  ■  Remarks
  10930.  
  10931.  Opening a file for unit* has no effect, because unit* is permanently
  10932.  connected to the keyboard and screen. «You can, however, use the OPEN
  10933.  statement to connect the other preconnected units (0, 5, and 6) to a file.»
  10934.  
  10935.  If you open a file using a unit number that is already connected to another
  10936.  file, the already-open file is automatically closed first, then the new file
  10937.  name is connected to the unit; no error occurs. However, you cannot connect
  10938.  a single file to more than one unit at a time.
  10939.  
  10940.  «If you have not explicitly opened a file, and the first operation is a READ
  10941.  or WRITE, the FORTRAN run-time system attempts to open a file as if a blank
  10942.  name were specified, as described with the file parameter.»
  10943.  
  10944.  If a parameter of the OPEN statement is an expression that calls a function,
  10945.  that function must not cause an I/O statement «or the EOF intrinsic
  10946.  function» to be executed, because the results are unpredictable.
  10947.  
  10948.  «For more information on choosing values of share and mode when sharing
  10949.  files, see Section 3.2.11, "File Sharing."»
  10950.  
  10951.  
  10952.  ■  Examples
  10953.  
  10954.  The following example opens a new file:
  10955.  
  10956.       C     Prompt user for a file name and read it:
  10957.             CHARACTER*64 filename
  10958.             WRITE (*, '(A\)') ' enter file name '
  10959.             READ  (*, '(A)') filename
  10960.       C     Open the file for formatted sequential access as unit 7.
  10961.       C     Note that the specified access need not have been specified,
  10962.       C     since it is the default (as is "formatted").
  10963.             OPEN (7, FILE = filename, ACCESS = 'SEQUENTIAL',
  10964.            +      STATUS = 'NEW')
  10965.  
  10966.  The following example opens an existing file:
  10967.  
  10968.       C     Open a file created by an editor, "DATA3.TXT", as unit 3:
  10969.             OPEN (3, FILE = 'DATA3.TXT')
  10970.  
  10971.  
  10972.  PARAMETER
  10973.  
  10974.  
  10975.  ■  Action
  10976.  
  10977.  Gives a constant a symbolic name
  10978.  
  10979.  
  10980.  ■  Syntax
  10981.  
  10982.       PARAMETER (name=expression «, name=expression»...)
  10983.  
  10984.  Parameter                                  Description
  10985.  
  10986.  name                                       A symbolic name.
  10987.  
  10988.  expression                                 An expression. The expression can
  10989.                                             include symbolic names only if
  10990.                                             those names were defined in a
  10991.                                             previous PARAMETER statement in
  10992.                                             the program unit.
  10993.  
  10994.                                             If the expression is a character
  10995.                                             constant, it may contain no more
  10996.                                             than 1,957 bytes.
  10997.  
  10998.  
  10999.  ■  Remarks
  11000.  
  11001.  If expression is of a different numerical type than name, any needed
  11002.  conversion is performed automatically.
  11003.  
  11004.  Unlike the DATA statement (which declares an initial value for a variable),
  11005.  the PARAMETER statement sets fixed values for symbolic constants. Any
  11006.  attempt to change a symbolic constant with an assignment statement or a READ
  11007.  statement causes a compile-time error.
  11008.  
  11009.  A symbolic constant «cannot be of a structure type, and it» may not appear
  11010.  in a format specification.
  11011.  
  11012.  
  11013.  ■  Examples
  11014.  
  11015.       C     Example 1
  11016.             PARAMETER (nblocks = 10)
  11017.  
  11018.       C     Example 2
  11019.             REAL mass
  11020.             PARAMETER (mass = 47.3, pi = 3.14159)
  11021.  
  11022.       C     Example 3
  11023.             IMPLICIT REAL (L-M)
  11024.             PARAMETER (loads = 10.0, mass = 32.2)
  11025.  
  11026.       C     Example 4
  11027.             CHARACTER*(*) bigone
  11028.             PARAMETER (bigone = 'This constant is larger than 40
  11029.            +characters')
  11030.  
  11031.  
  11032.  PAUSE
  11033.  
  11034.  
  11035.  ■  Action
  11036.  
  11037.  Temporarily suspends program execution «and allows you to execute operating
  11038.  system commands during the suspension»
  11039.  
  11040.  
  11041.  ■  Syntax
  11042.  
  11043.       PAUSE «prompt»
  11044.  
  11045.  Parameter                                  Description
  11046.  
  11047.  prompt                                     Either a character constant or an
  11048.                                             integer from 0 to 99,999
  11049.  
  11050.  
  11051.  ■  Remarks
  11052.  
  11053.  «If prompt is not specified, the following default prompt appears:»
  11054.  
  11055.       «'Please enter a blank line (to continue) or a system command.'»
  11056.  
  11057.  If prompt is a number, the number appears on the screen preceded by PAUSE -.
  11058.  If prompt is a string, only the string is displayed.
  11059.  
  11060.  The following are possible responses to the prompt and their results:
  11061.  
  11062.  If the user enters:                        Then:
  11063.  
  11064.  A blank line                               Control returns to the program.
  11065.  
  11066.  «A command»                                «The command is executed and
  11067.                                             control returns to the program.»
  11068.  
  11069.  «The word "COMMAND" (uppercase or          «The user can carry out a
  11070.  lowercase)»                                sequence of commands. To return
  11071.                                             control to the program, enter
  11072.                                             EXIT (uppercase or lowercase).»
  11073.  
  11074.  
  11075.  ■  Examples
  11076.  
  11077.             SUBROUTINE SetDrive ( )
  11078.                PAUSE 'Please select default drive.'
  11079.  
  11080.  One of the following outputs is produced:
  11081.  
  11082.       Please select default drive.
  11083.       .
  11084.       .
  11085.       .
  11086.  
  11087.       PAUSE 999.
  11088.       .
  11089.       .
  11090.       .
  11091.  
  11092.  
  11093.       PAUSE- 999
  11094.  
  11095.  
  11096.  PRINT
  11097.  
  11098.  
  11099.  ■  Action
  11100.  
  11101.  Displays output on the screen
  11102.  
  11103.  
  11104.  ■  Syntax
  11105.  
  11106.       PRINT { *, | formatspec | «namelist» } «,iolist»
  11107.  
  11108.  Parameter                                  Description
  11109.  
  11110.  formatspec                                 A format specifier
  11111.  
  11112.  «namelist»                                 «A namelist specifier»
  11113.  
  11114.  iolist                                     A list specifying the data to be
  11115.                                             transferred
  11116.  
  11117.  
  11118.  ■  Remarks
  11119.  
  11120.  If *, replaces formatspec, output is list-directed.
  11121.  
  11122.  «If a namelist specifier is used, no iolist may appear.»
  11123.  
  11124.  The PRINT statement writes only to unit*.
  11125.  
  11126.  «The iolist may not contain structure variables, only structure elements.»
  11127.  
  11128.  If a parameter of the PRINT statement is an expression that calls a
  11129.  function, that function must not execute an I/O statement «or the EOF
  11130.  intrinsic function», because the results are unpredictable.
  11131.  
  11132.  
  11133.  ■  Example
  11134.  
  11135.       C     The two following statements are equivalent:
  11136.             PRINT     '(A11)', 'Abbottsford'
  11137.             WRITE (*, '(A11)') 'Abbottsford'
  11138.  
  11139.  
  11140.  PROGRAM
  11141.  
  11142.  
  11143.  ■  Action
  11144.  
  11145.  Identifies the program unit as a main program and gives it a name
  11146.  
  11147.  
  11148.  ■  Syntax
  11149.  
  11150.       PROGRAM program-name
  11151.  
  11152.  Parameter                                  Description
  11153.  
  11154.  program-name                               The name you have given to your
  11155.                                             main program.
  11156.  
  11157.                                             The program name is global.
  11158.                                             Therefore, it cannot be the name
  11159.                                             of a user-defined procedure or
  11160.                                             common block. It is also a local
  11161.                                             name and must not conflict with
  11162.                                             any name local to the main
  11163.                                             program.
  11164.  
  11165.  
  11166.  ■  Remarks
  11167.  
  11168.  The PROGRAM statement may only appear as the first statement of a main
  11169.  program.
  11170.  
  11171.  The main program is always assigned the system name of _main, in addition to
  11172.  any name specified by the PROGRAM statement.
  11173.  
  11174.  
  11175.  ■  Example
  11176.  
  11177.             PROGRAM Gauss
  11178.             .
  11179.             .
  11180.             .
  11181.             END
  11182.  
  11183.  
  11184.  READ
  11185.  
  11186.  
  11187.  ■  Action
  11188.  
  11189.  Transfers data from the file associated with unitspec to the items in the
  11190.  iolist until all read operations have been completed, the end-of-file is
  11191.  reached, or an error occurs
  11192.  
  11193.  
  11194.  ■  Syntax
  11195.  
  11196.       READ { «{» formatspec, «| nmlspec }» |
  11197.       («UNIT=»unitspec
  11198.       «, ««{»«FMT=»formatspec» «| «NML=»nmlspec}»»
  11199.       «, END=endlabel»
  11200.       «, ERR=errlabel»
  11201.       «, IOSTAT=iocheck»
  11202.       «, REC=rec»)}
  11203.       iolist
  11204.  
  11205.  If UNIT= is omitted, unitspec must be the first parameter. If FMT= «or NML=»
  11206.  is omitted, fmtspec «or nmlspec» must be the second parameter. The
  11207.  parameters can otherwise appear in any order.
  11208.  
  11209.  Parameter                                  Description
  11210.  
  11211.  unitspec                                   A unit specifier.
  11212.  
  11213.                                             When reading from an internal
  11214.                                             file, unitspec is a character
  11215.                                             substring, character variable,
  11216.                                             character array element,
  11217.                                             character array, «noncharacter
  11218.                                             array, or structure element».
  11219.                                             When reading from an external
  11220.                                             file, unitspec is an integer
  11221.                                             expression that specifies a
  11222.                                             unit.
  11223.  
  11224.                                             «If unitspec has not been
  11225.                                             explicitly associated with a
  11226.                                             file, an "implicit open," using
  11227.                                             the following syntax is
  11228.                                             performed:»
  11229.  
  11230.                                             «OPEN (unitspec, FILE = ' ',
  11231.                                             STATUS = 'OLD', ACCESS =
  11232.                                             'SEQUENTIAL', FORM = form)»
  11233.  
  11234.                                             «where form is 'FORMATTED' for a
  11235.                                             formatted read operation or
  11236.                                             'UNFORMATTED' for an unformatted
  11237.                                             read operation.»
  11238.  
  11239.                                             If you included a file name on
  11240.                                             the command line that executed
  11241.                                             this program, that name will be
  11242.                                             used for the file. If you did not
  11243.                                             include a file name, you will be
  11244.                                             prompted for one. For more
  11245.                                             information, see Chapter 3, "The
  11246.                                             Input/Output System."
  11247.  
  11248.  formatspec                                 A format specifier. It can be the
  11249.                                             label of a FORMAT statement, or
  11250.                                             the format specification itself.
  11251.  
  11252.                                             The formatspec argument is
  11253.                                             required for a formatted read,
  11254.                                             and must not appear in an
  11255.                                             unformatted read. If a READ
  11256.                                             statement omits the UNIT=, END=,
  11257.                                             ERR=, and REC= options, and
  11258.                                             specifies only a formatspec and
  11259.                                             iolist, that statement reads from
  11260.                                             the asterisk unit (the keyboard).
  11261.  
  11262.  «nmlspec»                                  «A namelist group specifier. If
  11263.                                             given, iolist must be omitted.
  11264.                                             Namelist-directed I/O may be
  11265.                                             performed only on files opened
  11266.                                             for sequential access.»
  11267.  
  11268.  endlabel                                   The label of a statement in the
  11269.                                             same program unit.
  11270.  
  11271.                                             If endlabel is present, reading
  11272.                                             the end-of-file record transfers
  11273.                                             control to the executable
  11274.                                             statement at endlabel. If
  11275.                                             endlabel is omitted, reading past
  11276.                                             the end-of-file record causes a
  11277.                                             run-time error, unless either
  11278.                                             errlabel or iocheck is specified.
  11279.  
  11280.  errlabel                                   The label of an executable
  11281.                                             statement in the same program
  11282.                                             unit.
  11283.  
  11284.                                             If errlabel is specified, an I/O
  11285.                                             error causes transfer of control
  11286.                                             to the statement at errlabel. If
  11287.                                             errlabel is omitted, the effect
  11288.                                             of an I/O error is determined by
  11289.                                             the presence or absence of
  11290.                                             iocheck.
  11291.  
  11292.  iocheck                                    An integer variable, array
  11293.                                             element, «or structure element»
  11294.                                             that returns a value of zero if
  11295.                                             there is no error, -1 if
  11296.                                             end-of-file is encountered, or
  11297.                                             the number of the error message
  11298.                                             if an error occurs. For more
  11299.                                             information on error handling,
  11300.                                             see Section 3.2.6, "Error and
  11301.                                             End-of-File Handling."
  11302.  
  11303.  rec                                        An integer expression that
  11304.                                             evaluates to a positive number,
  11305.                                             called the record number. It is
  11306.                                             specified for direct-access files
  11307.                                             only. If rec is specified for a
  11308.                                             sequential-access or an internal
  11309.                                             file, an I/O error occurs.
  11310.  
  11311.                                             The file is positioned to record
  11312.                                             number rec before data is read
  11313.                                             from it. (The first record in the
  11314.                                             file is record number 1.) The
  11315.                                             default for rec is the current
  11316.                                             position in the file.
  11317.  
  11318.  iolist                                     A list of entities into which
  11319.                                             values are transferred from the
  11320.                                             file. An iolist may not contain
  11321.                                             structure variables, but it may
  11322.                                             contain structure elements.
  11323.  
  11324.  
  11325.  ■  Remarks
  11326.  
  11327.  «If the file were opened with MODE='READWRITE' (the default), you could read
  11328.  and write to the same file without having to reopen it to reset the access
  11329.  mode.»
  11330.  
  11331.  If you attempt to read an unwritten record that has not been written to from
  11332.  a direct file, the results are undefined.
  11333.  
  11334.  If a parameter of the READ statement is an expression that calls a function,
  11335.  that function must not execute an I/O statement «or the EOF intrinsic
  11336.  function», because the results are unpredictable.
  11337.  
  11338.  
  11339.  ■  Example
  11340.  
  11341.       C     Define a two-dimensional array:
  11342.             DIMENSION ia(10,20)
  11343.       C     Read in the bounds for the array. These bounds should
  11344.       C     be less than or equal to 10 and 20, respectively.
  11345.       C     Then read in the array in nested implied-DO lists
  11346.       C     with input format of 8 columns of width 5 each.
  11347.             READ   (3, 990) il, jl, ((ia(i,j), j = 1, jl), i =1, il)
  11348.         990 FORMAT (2I5, /, (8I5))
  11349.  
  11350.  
  11351.  REAL
  11352.  
  11353.  
  11354.  ■  Action
  11355.  
  11356.  Specifies the REAL type for user-defined names
  11357.  
  11358.  
  11359.  ■  Syntax
  11360.  
  11361.       REAL««*bytes»»
  11362.       vname««[attrs]»«*length»»«(dim)»««/values/»»
  11363.       «, vname««[attrs]»«*length»»«(dim)»««/values/»» »...
  11364.  
  11365.  The order of the length and dim parameters can be reversed.
  11366.  
  11367.  Parameter                                  Description
  11368.  
  11369.  «bytes»                                    «Must be 4 or 8. Specifies the
  11370.                                             length, in bytes, of the names in
  11371.                                             the REAL statement. This value
  11372.                                             can be overridden by the length
  11373.                                             parameter.»
  11374.  
  11375.  vname                                      The symbolic name of a constant,
  11376.                                             variable, array, external
  11377.                                             function, statement function,
  11378.                                             intrinsic function, FUNCTION
  11379.                                             subprogram or an array
  11380.                                             declarator. The vname parameter
  11381.                                             cannot be the name of a
  11382.                                             subroutine or main program.
  11383.  
  11384.  «attrs»                                    «A list of attributes, separated
  11385.                                             by commas. The attrs describe
  11386.                                             vname. These attributes can be
  11387.                                             used with vname: ALIAS,
  11388.                                             ALLOCATABLE, C, EXTERN, FAR,
  11389.                                             HUGE, NEAR, PASCAL, REFERENCE,
  11390.                                             VALUE.»
  11391.  
  11392.  «length»                                   «Must be 4 or 8. Gives vname the
  11393.                                             specified length. The length
  11394.                                             parameter overrides the length
  11395.                                             specified by bytes.»
  11396.  
  11397.  dim                                        A dimension declarator.
  11398.                                             Specifying dim declares vname as
  11399.                                             an array.
  11400.  
  11401.  «values»                                   «A list of constants and repeated
  11402.                                             constants, separated by commas. A
  11403.                                             repeated constant takes the form
  11404.                                             n*constant, where n is a positive
  11405.                                             integer constant. The /values/
  11406.                                             option, if specified, initializes
  11407.                                             vname. The following statement
  11408.                                             declares that numis of type REAL,
  11409.                                             and sets num  equal to 10.0:»
  11410.  
  11411.                                              «REAL num /10.0/»
  11412.  
  11413.  
  11414.  ■  Remarks
  11415.  
  11416.  A REAL statement confirms or overrides the implicit type of vname. The name
  11417.  vname is defined for the entire program unit, and it cannot be defined by
  11418.  any other type statement in that program unit.
  11419.  
  11420.  «If both the bytes and length parameters are omitted, the default length is
  11421.  four bytes.»
  11422.  
  11423.  REAL statements must precede all executable statements.
  11424.  
  11425.  «REAL*8» and DOUBLE PRECISION are the same data type.
  11426.  
  11427.  
  11428.  ■  Examples
  11429.  
  11430.             REAL goof, abs
  11431.            «REAL*4 wx1, wx3*8, wx5, wx6*8»
  11432.  
  11433.  
  11434.  RECORD
  11435.  
  11436.  
  11437.  ■  «Action»
  11438.  
  11439.  «Specifies a user-defined structure type for user-defined names»
  11440.  
  11441.  
  11442.  ■  «Syntax»
  11443.  
  11444.       «RECORD /type_name/
  11445.       vname « [attrs] » «(dim)»
  11446.       «, vname « [attrs] » «(dim)» »...
  11447.  
  11448.  «Parameter                                 Description»
  11449.  
  11450.  «type_name»                                «The name of user-defined
  11451.                                             structure type.»
  11452.  
  11453.  «vname»                                    «A variable, array, or array
  11454.                                             declarator, which will be of this
  11455.                                             structure type.»
  11456.  
  11457.  «attrs»                                    «A list of attributes, separated
  11458.                                             by commas. The attrs describe
  11459.                                             vname.»
  11460.  
  11461.  «dim»                                      «A dimension declarator.
  11462.                                             Specifying dim declares vname as
  11463.                                             an array.»
  11464.  
  11465.  
  11466.  ■  «Remarks»
  11467.  
  11468.  «The STRUCTURE statement defines a new data type. The RECORD statement
  11469.  assigns this new data type to a variable. The type-name must be defined
  11470.  prior to its appearance in a RECORD statement.»
  11471.  
  11472.  «RECORD statements must precede all executable statements.»
  11473.  
  11474.  
  11475.  ■  «Example»
  11476.  
  11477.            «STRUCTURE /address/
  11478.               LOGICAL*2    house_or_apt
  11479.               INTEGER*2    apt
  11480.               INTEGER*2    housenumber
  11481.               CHARACTER*30 street
  11482.               CHARACTER*20 city
  11483.               CHARACTER*2  state
  11484.               INTEGER*4    zip
  11485.             END STRUCTURE
  11486.  
  11487.             RECORD /address/ mailing_addr[NEAR](20), shipping_addr(20)»
  11488.  
  11489.  
  11490.  ■  «See also»
  11491.  
  11492.  «STRUCTURE»
  11493.  
  11494.  
  11495.  RETURN
  11496.  
  11497.  
  11498.  ■  Action
  11499.  
  11500.  Returns control to the calling program unit
  11501.  
  11502.  
  11503.  ■  Syntax
  11504.  
  11505.       RETURN «ordinal»
  11506.  
  11507.  Parameter                                  Description
  11508.  
  11509.  ordinal                                    An integer constant. Specifies
  11510.                                             the position of an
  11511.                                             alternate-return label in the
  11512.                                             formal argument list for the
  11513.                                             subroutine. See the CALL entry in
  11514.                                             this section for information on
  11515.                                             alternate returns.
  11516.  
  11517.  
  11518.  ■  Remarks
  11519.  
  11520.  The RETURN statement terminates execution of the enclosing subroutine or
  11521.  function. If the RETURN statement is in a function, the function's value is
  11522.  equal to the current value of the function return variable. The END
  11523.  statement in a function or subroutine has the same effect as a RETURN
  11524.  statement.
  11525.  
  11526.  If the actual arguments of the CALL statement contain alternate-return
  11527.  specifiers, the  RETURN statement can return control to a specific statement
  11528.  via ordinal. The RETURN ordinal statement must appear only in a subroutine;
  11529.  it may not appear in a function.
  11530.  
  11531.  A RETURN statement in the main program is treated as a STOP statement with
  11532.  no  message parameter.
  11533.  
  11534.  
  11535.  ■  Examples
  11536.  
  11537.       C     This subroutine loops until you type "Y":
  11538.             SUBROUTINE Loop
  11539.             CHARACTER in
  11540.  
  11541.          10 READ (*, '(A)') in
  11542.             IF (in .EQ. 'Y') RETURN
  11543.             GOTO 10
  11544.       C     RETURN implied by the following statement:
  11545.             END
  11546.  
  11547.  The following example demonstrates the alternate-return feature:
  11548.  
  11549.          01 CALL AltRet (i, *10, j, *20, *30)
  11550.             WRITE (*, *) 'normal return'
  11551.             GOTO 40
  11552.          10 WRITE (*, *) 'I = 10'
  11553.             GOTO 40
  11554.          20 WRITE (*, *) 'I = 20'
  11555.             GOTO 40
  11556.          30 WRITE (*, *) 'I = 30'
  11557.          40 CONTINUE
  11558.  
  11559.  
  11560.             .
  11561.             .
  11562.             .
  11563.             SUBROUTINE AltRet (i, *, j, *, *)
  11564.             IF (i .EQ. 10)  RETURN 1
  11565.             IF (i .EQ. 20)  RETURN 2
  11566.             IF (i .EQ. 30)  RETURN 3
  11567.             RETURN
  11568.  
  11569.  In this example, RETURN 1 specifies the list's first alternate-return label,
  11570.  which is a symbol for the actual argument *10 in the CALL statement. RETURN
  11571.  2 specifies the second alternate-return label, and RETURN 3 specifies the
  11572.  third alternate-return label.
  11573.  
  11574.  
  11575.  REWIND
  11576.  
  11577.  
  11578.  ■  Action
  11579.  
  11580.  Repositions a file to its first record
  11581.  
  11582.  
  11583.  ■  Syntax
  11584.  
  11585.       REWIND { unitspec |
  11586.       («UNIT=»unitspec
  11587.       «, ERR=errlabel»
  11588.       «, IOSTAT=iocheck»)}
  11589.  
  11590.  If UNIT= is omitted, unitspec must be the first parameter. The parameters
  11591.  can otherwise appear in any order.
  11592.  
  11593.  Parameter                                  Description
  11594.  
  11595.  unitspec                                   An integer expression that
  11596.                                             specifies an external unit. If
  11597.                                             unitspec has not been opened,
  11598.                                             REWIND has no effect.
  11599.  
  11600.  errlabel                                   The label of an executable
  11601.                                             statement. If errlabel is
  11602.                                             specified, an I/O error causes
  11603.                                             transfer of control to the
  11604.                                             statement at  errlabel. If
  11605.                                             errlabel is omitted, the effect
  11606.                                             of an I/O error is determined by
  11607.                                             the presence or absence of
  11608.                                             iocheck.
  11609.  
  11610.  iocheck                                    An integer variable, array
  11611.                                             element, «or structure element»
  11612.                                             that returns a value of zero if
  11613.                                             there is no I/O error, or the
  11614.                                             number of the error message if an
  11615.                                             error is encountered. See Section
  11616.                                             3.2.6, "Error and End-of-File
  11617.                                             Handling."
  11618.  
  11619.  
  11620.  ■  Remarks
  11621.  
  11622.  If a parameter of the REWIND statement is an expression that calls a
  11623.  function, that function must not execute an I/O statement «or the EOF
  11624.  intrinsic function», because the results are unpredictable.
  11625.  
  11626.  
  11627.  ■  Example
  11628.  
  11629.             INTEGER int(80)
  11630.             .
  11631.             .
  11632.             .
  11633.             WRITE (7, '(80I1)') int
  11634.             .
  11635.             .
  11636.             .
  11637.             REWIND 7
  11638.             .
  11639.             .
  11640.             .
  11641.             READ  (7, '(80I1)') int
  11642.  
  11643.  
  11644.  SAVE
  11645.  
  11646.  
  11647.  ■  Action
  11648.  
  11649.  Causes variables to retain their values between invocations of the procedure
  11650.  in which they are defined
  11651.  
  11652.  
  11653.  ■  Syntax
  11654.  
  11655.       SAVE «names»
  11656.  
  11657.  Parameter                                  Description
  11658.  
  11659.  names                                      One or more names of common
  11660.                                             blocks (enclosed in slashes),
  11661.                                             variables, or arrays. If more
  11662.                                             than one name is specified, they
  11663.                                             must be separated by commas. If
  11664.                                             no names are specified, all
  11665.                                             allowable items in the program
  11666.                                             unit are saved.
  11667.  
  11668.  
  11669.  ■  Remarks
  11670.  
  11671.  The SAVE statement does not allow the following:
  11672.  
  11673.    ■  Repeated appearances of an item
  11674.  
  11675.    ■  Formal argument names
  11676.  
  11677.    ■  Procedure names
  11678.  
  11679.    ■  Names of entities in a common block
  11680.  
  11681.    ■  «Names that appear in an AUTOMATIC statement»
  11682.  
  11683.  Within a program, a common block that is saved in one subprogram must be
  11684.  saved in every subprogram containing that common block.
  11685.  
  11686.  ───────────────────────────────────────────────────────────────────────────
  11687.  «NOTE»
  11688.     «Microsoft FORTRAN saves all variables by default. The SAVE statement
  11689.     simplifies porting code, and can specify variables that are not to be
  11690.     made automatic.»
  11691.  ───────────────────────────────────────────────────────────────────────────
  11692.  
  11693.  
  11694.  ■  Example
  11695.  
  11696.             SAVE /mycom/, myvar
  11697.  
  11698.  
  11699.  ■  See also
  11700.  
  11701.  «AUTOMATIC»
  11702.  
  11703.  
  11704.  SELECT CASE...END SELECT
  11705.  
  11706.  
  11707.  ■  «Action»
  11708.  
  11709.  «Transfers program control to a selected block of statements, determined by
  11710.  the value of a controlling expression»
  11711.  
  11712.  
  11713.  ■  «Syntax»
  11714.  
  11715.       «SELECT CASE (testexpr)
  11716.  
  11717.         CASE (expressionlist)
  11718.             «statementblock»
  11719.  
  11720.         CASE (expressionlist)
  11721.             «statementblock»
  11722.            .
  11723.            .
  11724.            .
  11725.         «CASE DEFAULT
  11726.         «statementblock»»
  11727.  
  11728.         END SELECT»
  11729.  
  11730.  «Parameter                                 Description»
  11731.  
  11732.  «testexpr»                                 «An INTEGER, LOGICAL, or
  11733.                                             CHARACTER*1 expression.»
  11734.  
  11735.  «expressionlist»                           «A list of values, which must be
  11736.                                             constant and must match the data
  11737.                                             type of testexpr. The values must
  11738.                                             be of type INTEGER, LOGICAL, or
  11739.                                             CHARACTER*1. If testexpr matches
  11740.                                             one of the values, the following
  11741.                                             statementblock is executed.»
  11742.  
  11743.  «statementblock»                           «One or more executable
  11744.                                             statements.»
  11745.  
  11746.  
  11747.  ■  «Remarks»
  11748.  
  11749.  «There are two ways to include values in the expressionlist. The first is to
  11750.  give a list of individual values, separated by commas. The second is to
  11751.  specify an inclusive range of values, separated by a colon, such as 5:10 or
  11752.  'I':'N'. The lower bound must be less than the upper bound. If the values
  11753.  are characters, the first character must appear before the second in the
  11754.  ASCII collating sequence.»
  11755.  
  11756.  «If the lower bound is omitted (such as :10), then all values less than or
  11757.  equal to the upper bound match. If the upper bound is omitted (such as 5:),
  11758.  then all values greater than or equal to the lower bound must match. Both
  11759.  individual values and ranges of values may be included in the same
  11760.  expressionlist. You cannot specify a range of values when»  «testexpr is of
  11761.  type LOGICAL. A value (even when specified implicitly as part of a colon
  11762.  range) can only appear in one expressionlist.»
  11763.  
  11764.  «A statementblock need not contain executable statements. Empty blocks can
  11765.  be used to make it clear that no action is to be taken for a particular set
  11766.  of expression values.»
  11767.  
  11768.  «The CASE DEFAULT statement is optional. You can include only one CASE
  11769.  DEFAULT statement in a SELECT CASE block.»
  11770.  
  11771.  «If the value of testexpr does not match any value in any expressionlist,
  11772.  execution passes beyond the SELECT CASE construct to the next executable
  11773.  statement.»
  11774.  
  11775.  «SELECT CASE blocks may be nested. Each block must have its own END SELECT
  11776.  statement; you may not terminate more than one block with a single END
  11777.  SELECT statement.»
  11778.  
  11779.  «If a SELECT CASE statement appears within a DO or DO WHILE loop, or within
  11780.  an IF, ELSE, or ELSE IF structure, the terminating END SELECT statement must
  11781.  appear within the range of that loop or structure.»
  11782.  
  11783.  «It is illegal to branch into a SELECT CASE block from outside, or to branch
  11784.  from one CASE section to another. Any attempt to do so causes a compile-time
  11785.  error.»
  11786.  
  11787.  
  11788.  ■  «Example»
  11789.  
  11790.      «CHARACTER*1  cmdchar
  11791.       .
  11792.       .
  11793.       .
  11794.       SELECT CASE (cmdchar)
  11795.         CASE ('0')
  11796.            WRITE (*, *) "Must retrieve one to nine files"
  11797.         CASE ('1':'9')
  11798.            CALL RetrieveNumFiles (cmdchar)
  11799.         CASE ('A', 'd')
  11800.              CALL AddEntry
  11801.         CASE ('D', 'd')
  11802.            CALL DeleteEntry
  11803.         CASE ('H', 'h')
  11804.            CALL Help
  11805.         CASE ('R':'T', 'r':'t')
  11806.            WRITE (*, *) "REDUCE, SPREAD and TRANSFER commands ",
  11807.           +    "not yet supported"
  11808.         CASE DEFAULT
  11809.            WRITE (*, *) "Command not recognized; please
  11810.           +re-enter"
  11811.       END SELECT»
  11812.  
  11813.  
  11814.  Statement Function
  11815.  
  11816.  
  11817.  ■  Action
  11818.  
  11819.  Defines a function in a single statement
  11820.  
  11821.  
  11822.  ■  Syntax
  11823.  
  11824.       fname («formals»)=expression
  11825.  
  11826.  Parameter                                  Description
  11827.  
  11828.  fname                                      The name of the statement
  11829.                                             function.
  11830.  
  11831.                                             The name fname is local to the
  11832.                                             enclosing program unit and must
  11833.                                             not be used otherwise, except as
  11834.                                             the name of a common block or as
  11835.                                             the name of a formal argument to
  11836.                                             another statement function. If
  11837.                                             fname is used as a formal
  11838.                                             argument to another statement
  11839.                                             function, fname must have the
  11840.                                             same data type every time it is
  11841.                                             used.
  11842.  
  11843.  formals                                    A list of formal arguments. If
  11844.                                             there is more than one name, the
  11845.                                             names must be separated by
  11846.                                             commas.
  11847.  
  11848.                                             The scope of formal-argument
  11849.                                             names is the statement function.
  11850.                                             Therefore, formal-argument names
  11851.                                             can be reused as other
  11852.                                             user-defined names in the rest of
  11853.                                             the program unit enclosing the
  11854.                                             statement-function definition.
  11855.  
  11856.                                             If formal is the same as another
  11857.                                             local name, a reference to formal
  11858.                                             within the statement function
  11859.                                             always refers to the formal
  11860.                                             argument, never to the other
  11861.                                             local name. The data type of
  11862.                                             formal is determined by the data
  11863.                                             type of the local variable,
  11864.                                             because the compiler has no other
  11865.                                             way to establish a type for it.
  11866.  
  11867.  expression                                 Any legal expression.
  11868.  
  11869.                                             References to variables, formal
  11870.                                             arguments, other functions, array
  11871.                                             elements, and constants are
  11872.                                             permitted within the  expression.
  11873.                                             Statement-function references,
  11874.                                             however, must refer to statement
  11875.                                             functions defined prior to the
  11876.                                             statement function in which they
  11877.                                             appear. Statement functions
  11878.                                             cannot be called recursively,
  11879.                                             either directly or indirectly.
  11880.  
  11881.  
  11882.  ■  Remarks
  11883.  
  11884.  Like a regular function, a statement function is executed by referring to it
  11885.  in an expression.
  11886.  
  11887.  The type of expression and the type of fname must be compatible in the same
  11888.  way that  expression and variable must be compatible in assignment
  11889.  statements. The expression is converted to the same data type as fname. The
  11890.  actual arguments to the statement function are converted to the same type as
  11891.  the formal arguments.   A statement function can only be referenced in the
  11892.  program unit in which it is defined. The name of a statement function cannot
  11893.  appear in any specification statement, except in a type statement (which may
  11894.  not be an array definition) and in a COMMON statement (as the name of a
  11895.  common block).
  11896.  
  11897.  
  11898.  ■  Example
  11899.  
  11900.             DIMENSION x(10)
  11901.             Add (a, b) = a + b
  11902.  
  11903.             DO 100, n = 1, 10
  11904.             x(n) = Add (y, z)
  11905.         100 CONTINUE
  11906.  
  11907.  
  11908.  STOP
  11909.  
  11910.  
  11911.  ■  Action
  11912.  
  11913.  Terminates program execution
  11914.  
  11915.  
  11916.  ■  Syntax
  11917.  
  11918.       STOP «message»
  11919.  
  11920.  Parameter                                  Description
  11921.  
  11922.  message                                    A character constant or an
  11923.                                             integer from 0 to 99,999
  11924.  
  11925.  
  11926.  ■  Remarks
  11927.  
  11928.  If no message is specified, the following default message is displayed:
  11929.  
  11930.       STOP - Program terminated.
  11931.  
  11932.  If message is a character constant, it is displayed, and the program returns
  11933.  zero to the operating system, for use by program units that retrieve status
  11934.  information.
  11935.  
  11936.  If message is a number:
  11937.  
  11938.    1. The words Return code, followed by the number, are displayed. For
  11939.       example, the statement STOP 0400 produces the output  Return code 0400.
  11940.  
  11941.    2. The program returns the least-significant byte of that integer value (a
  11942.       value from 0 to 255) to the operating system, for use by program units
  11943.       that wish to check status.
  11944.  
  11945.  
  11946.  ■  Example
  11947.  
  11948.             IF (ierror .EQ. 0) GOTO 200
  11949.             STOP 'ERROR DETECTED!'
  11950.         200 CONTINUE
  11951.  
  11952.  
  11953.  «STRUCTURE...END STRUCTURE»
  11954.  
  11955.  
  11956.  ■  «Action»
  11957.  
  11958.  «Defines a new, compound variable type constructed from other variable
  11959.  types»
  11960.  
  11961.  
  11962.  ■  «Syntax»
  11963.  
  11964.       «STRUCTURE /type_name/»
  11965.           element_declaration(s)
  11966.           .
  11967.           .
  11968.           .
  11969.       END STRUCTURE»
  11970.  
  11971.  «Parameter                                 Description»
  11972.  
  11973.  «type_name»                                «The name for the new data type;
  11974.                                             follows standard naming
  11975.                                             conventions. It may not duplicate
  11976.                                             the name of another variable or
  11977.                                             an intrinsic function, and it may
  11978.                                             not be the name of an intrinsic
  11979.                                             data type, such as COMPLEX. It is
  11980.                                             a local name.»
  11981.  
  11982.  «element_declarations»                     «Any combination of one or more
  11983.                                             variable-typing statements and
  11984.                                             UNION constructs. Can include
  11985.                                             RECORD statements that use
  11986.                                             previously defined structure
  11987.                                             types.»
  11988.  
  11989.  
  11990.  ■  «Remarks»
  11991.  
  11992.  «The STRUCTURE statement defines a new variable type, called a "structure";
  11993.  it is not a declaration of a specific program variable. To declare a
  11994.  variable of a particular structure type, use the RECORD statement.»
  11995.  
  11996.  «A structure is made of elements.  The simplest element is a conventional
  11997.  FORTRAN variable type with a dummy name, as in the following example:»
  11998.  
  11999.            «STRUCTURE /full_name/»
  12000.               «CHARACTER*15 first_name»
  12001.               «CHARACTER*20 last_name»
  12002.            «END STRUCTURE»
  12003.  
  12004.  «Elements cannot be declared with attributes. For example, INTEGER var[FAR]
  12005.  is not permitted.»
  12006.  
  12007.  «An element can also be a RECORD statement that references a previously
  12008.  defined structure type:»
  12009.  
  12010.           «STRUCTURE /full_address/
  12011.               RECORD /full_name/ personsname
  12012.               RECORD /address/   ship_to
  12013.               INTEGER*1          age
  12014.               INTEGER*4          phone
  12015.            END STRUCTURE»
  12016.  
  12017.  «An element can also be a union of several variable maps.»
  12018.  
  12019.  «Element names are local to the structure in which they appear. There is no
  12020.  conflict if the same element name appears in more than one structure. Nested
  12021.  structures may have elements with the same names.»
  12022.  
  12023.  «A particular element is specified by listing the sequence of elements
  12024.  required to reach the desired element, separated by a period (.). Suppose a
  12025.  structure variable, shippingaddress, were declared with the full_address
  12026.  structure declared in the previous example:»
  12027.  
  12028.             «RECORD /full_address/ shippingaddress»
  12029.  
  12030.  «The age element would then be specified by shippingaddress.age , the first
  12031.  name of the receiver by shippingaddress.personsname.first_name, and so on.
  12032.  An element is no different from any other variable having the same type.
  12033.  When a structure element appears in an expression, its type is the type of
  12034.  the element. When passed as an actual argument, it must match the formal
  12035.  argument in type, order, and dimension.»
  12036.  
  12037.  «A structure can be no longer than 65,536 bytes. This includes all the data,
  12038.  plus any padding bytes. The way structures are packed in memory is
  12039.  controlled by the $PACK metacommand and /Zp command-line option.»
  12040.  
  12041.  «Structures may look identical, but still be different. For two structures
  12042.  to be identical, they must have the same component types and names in the
  12043.  same sequence, and the packing must be the same.»
  12044.  
  12045.  
  12046.  ■  «See also»
  12047.  
  12048.  «MAP...END MAP»
  12049.  «RECORD»
  12050.  «UNION...END UNION»
  12051.  «$PACK»
  12052.  
  12053.  
  12054.  SUBROUTINE
  12055.  
  12056.  
  12057.  ■  Action
  12058.  
  12059.  Identifies a program unit as a subroutine, gives it a name, and identifies
  12060.  its formal arguments
  12061.  
  12062.  
  12063.  ■  Syntax
  12064.  
  12065.       SUBROUTINE subr ««sattrs]»»
  12066.       «(«formal ««[attrs]»»
  12067.       «,formal ««[attrs]»» »...»)»
  12068.  
  12069.  Parameter                                  Description
  12070.  
  12071.  subr                                       The global, external name of the
  12072.                                             subroutine. The name  subr cannot
  12073.                                             appear in «AUTOMATIC,» COMMON,
  12074.                                             DATA, EQUIVALENCE, INTRINSIC,
  12075.                                             «LOADDS,» SAVE, or type
  12076.                                             statements.
  12077.  
  12078.  «sattrs»                                   «A list of attributes, separated
  12079.                                             by commas. The sattrs describes
  12080.                                             subr. The following attributes
  12081.                                             can be used with subr: ALIAS, C,
  12082.                                             FAR, NEAR, PASCAL, VARYING.»
  12083.  
  12084.  formal                                     A formal-argument name. If more
  12085.                                             than one is specified, they must
  12086.                                             be separated by commas. A formal
  12087.                                             argument may be the name of a
  12088.                                             conventional variable, a
  12089.                                             structure variable, or an
  12090.                                             intrinsic function. A formal
  12091.                                             argument may also be an alternate
  12092.                                             return label (*).
  12093.  
  12094.                                             For an explanation of alternate
  12095.                                             return specifiers, see the CALL
  12096.                                             entry in this section.
  12097.  
  12098.  «attrs»                                    «A list of attributes, separated
  12099.                                             by commas. The attrs describes
  12100.                                             formal (except alternate-return
  12101.                                             specifiers). The following
  12102.                                             attributes can be used with
  12103.                                             formal: FAR, HUGE, NEAR,
  12104.                                             REFERENCE, VALUE.»
  12105.  
  12106.  
  12107.  ■  Remarks
  12108.  
  12109.  A subroutine begins with a SUBROUTINE statement and ends with the next END
  12110.  statement. A subroutine can contain any statement except a BLOCK DATA,
  12111.  FUNCTION, « INTERFACE TO,» PROGRAM, or SUBROUTINE statement.
  12112.  
  12113.  Within the calling program, subr is global, and may not be used for any
  12114.  other variable or subprogram.
  12115.  
  12116.  The formal-argument list sets the number of arguments for that subroutine.
  12117.  The argument types are set by any IMPLICIT, EXTERNAL, DIMENSION, or type
  12118.  statements within the subroutine itself (or they default to implicit FORTRAN
  12119.  types). The argument types are not set by the calling program, even if the
  12120.  subroutine appears in the calling program's source file. Formal-argument
  12121.  names cannot appear in «AUTOMATIC,» COMMON, DATA, EQUIVALENCE, INTRINSIC, or
  12122.  SAVE statements.
  12123.  
  12124.  In a CALL statement, the actual arguments that are passed must agree with
  12125.  corresponding formal arguments in the SUBROUTINE statement in order, in
  12126.  number «(except when the C and VARYING attributes are specified)», and in
  12127.  type or kind. The compiler checks for correspondence if the formal arguments
  12128.  are known.
  12129.  
  12130.  A "recursive" subroutine is one that calls itself, or calls another
  12131.  subprogram which in turn calls the first subroutine before the first
  12132.  subroutine has completed execution. FORTRAN does not support recursive
  12133.  subroutine calls. «When using Microsoft FORTRAN, any attempt at direct
  12134.  recursion results in a compile-time error. Indirect recursion, however, is
  12135.  not detected. The results of such indirect recursion are undefined and
  12136.  unpredictable.»
  12137.  
  12138.  
  12139.  ■  Example
  12140.  
  12141.             SUBROUTINE GetNum (num, unit)
  12142.             INTEGER num, unit
  12143.          10 READ (unit, '(I10)', ERR = 10) num
  12144.             END
  12145.  
  12146.  
  12147.  Type
  12148.  
  12149.  See the individual listings in this chapter for the CHARACTER, COMPLEX,
  12150.  «DOUBLE COMPLEX,» DOUBLE PRECISION, INTEGER, LOGICAL, REAL, «RECORD, and
  12151.  STRUCTURE...END STRUCTURE» statements.
  12152.  
  12153.  
  12154.  UNION...END UNION
  12155.  
  12156.  
  12157.  ■  «Action»
  12158.  
  12159.  «Causes two or more maps to occupy the same memory location»
  12160.  
  12161.  
  12162.  ■  «Syntax»
  12163.  
  12164.      «UNION»
  12165.       map-statement
  12166.       map-statement
  12167.       «map-statement»...
  12168.       END UNION»
  12169.  
  12170.  «Parameter                                 Description»
  12171.  
  12172.  «map-statement»                            «A map declaration. See the
  12173.                                             MAP..END MAP entry in this
  12174.                                             section for more information.»
  12175.  
  12176.  
  12177.  ■  «Remarks»
  12178.  
  12179.  «A UNION block may only appear within a STRUCTURE block. Each UNION block
  12180.  must be terminated with its own END UNION statement; a single END UNION
  12181.  statement may not be used to terminate more than one UNION block.»
  12182.  
  12183.  «UNION is similar to the EQUIVALENCE statement; both allocate the same
  12184.  memory area to more than one variable. However, maps can contain multiple,
  12185.  contiguous variables, which gives increased flexibility in assigning
  12186.  variables to the same memory location.»
  12187.  
  12188.  
  12189.  ■  «Example»
  12190.  
  12191.  «Note how the first 40 characters in the string2 array are assigned to
  12192.  four-byte integers, while the remaining 20 are assigned to two-byte
  12193.  integers:»
  12194.  
  12195.            «UNION»
  12196.               «MAP»
  12197.                  «CHARACTER*20 string1, CHARACTER*10 string2(6)»
  12198.               «END MAP»
  12199.               «MAP»
  12200.                  «INTEGER*2 number(10), INTEGER*4 var(10), INTEGER*2»
  12201.          «+       datum(10)»
  12202.               «END MAP»
  12203.            «END UNION»
  12204.  
  12205.  «The $PACK metacommand and /Zp command-line option control how variables in
  12206.  structures are assigned to beginning byte addresses. The particular packing
  12207.  option chosen may affect how particular variables are assigned to the same
  12208.  memory location. See the $PACK entry in Section 6.2, "Metacommand
  12209.  Directory," for more information.
  12210.  
  12211.  
  12212.  ■  «See also»
  12213.  
  12214.  «MAP...END MAP»
  12215.  «STRUCTURE...END STRUCTURE»
  12216.  «$PACK»
  12217.  
  12218.  
  12219.  WRITE
  12220.  
  12221.  
  12222.  ■  Action
  12223.  
  12224.  Transfers data from the iolist items to the file associated with unitspec
  12225.  
  12226.  
  12227.  ■  Syntax
  12228.  
  12229.       WRITE («UNIT=»unitspec
  12230.       «, ««{»«FMT=»formatspec»«|«NML=»nmlspec }»»
  12231.       «, ERR=errlabel»
  12232.       «, IOSTAT=iocheck»
  12233.       «, REC=rec»)
  12234.       iolist
  12235.  
  12236.  If UNIT= is omitted, unitspec must be the first parameter. If FMT= or NML=
  12237.  is omitted, fmtspec or nmlspec must be the second parameter. The parameters
  12238.  can otherwise appear in any order.
  12239.  
  12240.  Parameter                                  Description
  12241.  
  12242.  unitspec                                   When writing to an internal file,
  12243.                                             unitspec must be a character
  12244.                                             substring, variable, array, array
  12245.                                             element, «structure element, or
  12246.                                             noncharacter array». When writing
  12247.                                             to an external file, unitspec is
  12248.                                             an integer expression that
  12249.                                             specifies a unit.
  12250.  
  12251.                                             «If unitspec has not been
  12252.                                             explicitly associated with a
  12253.                                             file, an "implicit open," using
  12254.                                             the following syntax, is
  12255.                                             performed:»
  12256.  
  12257.                                             «OPEN (unitspec, FILE = ' ',»
  12258.                                             «STATUS = 'UNKNOWN',» «ACCESS =
  12259.                                             'SEQUENTIAL',» «FORM = form)»
  12260.  
  12261.                                             «where form is 'FORMATTED' for a
  12262.                                             formatted write operation and
  12263.                                             'UNFORMATTED' for an unformatted
  12264.                                             write operation.»
  12265.  
  12266.  formatspec                                 A format specifier. A format
  12267.                                             specifier is required for a
  12268.                                             formatted write; it must not
  12269.                                             appear in an unformatted write.
  12270.  
  12271.  «nmlspec»                                  «A namelist specifier. If
  12272.                                             specified, iolist must be
  12273.                                             omitted. Namelist-directed I/O
  12274.                                             may be performed only on files
  12275.                                             opened for sequential access.»
  12276.  
  12277.  errlabel                                   The label of an executable
  12278.                                             statement in the same program
  12279.                                             unit.
  12280.  
  12281.                                             If errlabel is specified, an I/O
  12282.                                             error causes transfer of control
  12283.                                             to the statement at errlabel. If
  12284.                                             errlabel is omitted, the effect
  12285.                                             of an I/O error is determined by
  12286.                                             the presence or absence of
  12287.                                             iocheck.
  12288.  
  12289.  iocheck                                    An integer variable, array
  12290.                                             element, «or structure element»
  12291.                                             that returns a value of zero if
  12292.                                             there is no error, or the number
  12293.                                             of the error message if an error
  12294.                                             occurs. See Section 3.2.6, "Error
  12295.                                             and End-of-File Handling."
  12296.  
  12297.  rec                                        A positive integer expression,
  12298.                                             called a record number, specified
  12299.                                             only for direct-access files
  12300.                                             (otherwise, an error results).
  12301.  
  12302.                                             The argument rec specifies the
  12303.                                             number of the record to be
  12304.                                             written. The first record in the
  12305.                                             file is record number 1. The
  12306.                                             default for rec is the current
  12307.                                             position in the file.
  12308.  
  12309.  iolist                                     A list of entities whose values
  12310.                                             are transferred by the WRITE
  12311.                                             statement. It may not contain
  12312.                                             structure variables, though
  12313.                                             structure elements are permitted.
  12314.  
  12315.  
  12316.  ■  Remarks
  12317.  
  12318.  «If the file were opened with MODE='READWRITE' (the default), you could
  12319.  alternately read and write to the same file without reopening it each time.»
  12320.  
  12321.  If you write to a sequential file, you delete any records that existed
  12322.  beyond the newly written record. Note that for sequential files, you are
  12323.  always effectively at the end of the file following a write operation, and
  12324.  you must backspace or rewind before the next read operation.
  12325.  
  12326.  If a parameter of the WRITE statement is an expression that calls a
  12327.  function, that function must not execute an I/O statement «or the EOF
  12328.  intrinsic function», because the results are unpredictable.
  12329.  
  12330.  
  12331.  ■  Example
  12332.  
  12333.       C     Generate a table of square and cube roots
  12334.       C     of the whole numbers from 1-100
  12335.             WRITE (*, 10) (n, SQRT(FLOAT(n)), FLOAT(n)**(1.0/3.0),
  12336.             +n = 1, 100)
  12337.             10 FORMAT (I5, F8.4, F8.5)
  12338.  
  12339.  
  12340.  
  12341.  Chapter 5  Intrinsic Functions and Additional Procedures
  12342.  
  12343.  ───────────────────────────────────────────────────────────────────────────
  12344.  
  12345.  Intrinsic functions are predefined by the Microsoft FORTRAN language. These
  12346.  functions carry out data-type conversions and return information about data
  12347.  types, perform operations on both numeric and character data, test for
  12348.  end-of-file, return addresses, and perform bit manipulation.
  12349.  
  12350.  The first part of this chapter is a detailed description of the intrinsic
  12351.  functions available in Microsoft FORTRAN. The second part of this chapter is
  12352.  an alphabetical tabular listing of all intrinsic functions. «The third part
  12353.  of this chapter describes other functions and subroutines supplied with
  12354.  Microsoft FORTRAN.»
  12355.  
  12356.  
  12357.  5.1  Using Intrinsic Functions
  12358.  
  12359.  An "intrinsic function" is a function that is part of the FORTRAN language.
  12360.  The compiler recognizes its name and knows that the object code for the
  12361.  function is in the language libraries. Intrinsic functions are automatically
  12362.  linked to the program without any additional effort on the programmer's
  12363.  part. (Functions written by the user are called "external" functions. If you
  12364.  wish to write your own function that has the same name as an intrinsic
  12365.  function, you must declare its name in an EXTERNAL statement.)
  12366.  
  12367.  Each function returns a value of integer, real, logical, or character, and
  12368.  therefore has a corresponding data type. For example, the ICHAR intrinsic
  12369.  function returns the ASCII value of a character string; it is therefore an
  12370.  integer function. Some intrinsic functions, such as INT, can take arguments
  12371.  of more than one type. Others, such as ABS, can return a value that has the
  12372.  same type as the argument.
  12373.  
  12374.  An IMPLICIT statement cannot change the type of an intrinsic function. For
  12375.  those generic intrinsic functions that allow several types of arguments, all
  12376.  arguments in a function call should be of the same type. The intrinsic
  12377.  function DIM, for example, takes two integer arguments and returns the
  12378.  positive difference. If you specify DIM (i,j), i and j must be of the same
  12379.  type.
  12380.  
  12381.  «If, however, two arguments are of different types, Microsoft FORTRAN first
  12382.  attempts to convert the arguments to the correct data type. For example, if
  12383.  i and j in the example above are real numbers, they are first converted to
  12384.  INTEGER type (see Table 1.6, "Arithmetic Type Conversion," for information
  12385.  on type conversion), and then the operation is performed. Or, if i  is of
  12386.  type INTEGER*2 and j is of type INTEGER*4, i is first converted to
  12387.  INTEGER*4, and then the operation is performed.»
  12388.  
  12389.  Intrinsic-function names, except those listed in Section 2.5, "Arguments,"
  12390.  can appear in an INTRINSIC statement. Intrinsic functions specified in
  12391.  INTRINSIC statements can be used as actual arguments in external procedure
  12392.  references. An intrinsic-function name can also appear in a type statement,
  12393.  but only if the type is the same as the standard type for that intrinsic
  12394.  function.
  12395.  
  12396.  Generic intrinsic functions, like ABS, let you use the same
  12397.  intrinsic-function name with more than one type of argument. Specific
  12398.  intrinsic functions, like IFIX, can only be used with one type of argument.
  12399.  
  12400.  An external procedure cannot have the same name as an intrinsic function,
  12401.  unless the EXTERNAL statement is used to tell the compiler the substitution
  12402.  has been made. (As a result, the intrinsic function of that name is no
  12403.  longer usable in the program unit where the EXTERNAL statement associated it
  12404.  with an external  procedure.) In the following statement, for example, sign,
  12405.  float, and index are the names of external procedures:
  12406.  
  12407.              EXTERNAL Sign, Float, Index
  12408.              SUBROUTINE Process (Sign, Float, Index)
  12409.  
  12410.  If you supply an argument that has no mathematically defined result or for
  12411.  which the result exceeds the numeric range of the processor, the result of
  12412.  the intrinsic function is undefined.
  12413.  
  12414.  Arguments must agree in order, number, and type with those specified in
  12415.  Tables 5.2-5.17. Arguments can also be expressions of the specified type.
  12416.  
  12417.  When logarithmic and trigonometric intrinsic functions act on a complex
  12418.  argument, they return the "principal value." The principal value of a
  12419.  complex number is the number whose argument (angle in radians) is less than
  12420.  or equal to p and greater than -p.
  12421.  
  12422.  «When the results of generic integer intrinsic functions are passed to
  12423.  subprograms, the $STORAGE setting determines the data type of the value to
  12424.  be passed.»
  12425.  
  12426.  ───────────────────────────────────────────────────────────────────────────
  12427.  «WARNING»
  12428.     «Microsoft FORTRAN contains several intrinsic functions whose names are
  12429.     longer than six characters (ALLOCATED, EPSILON, LEN_TRIM, LOCNEAR,
  12430.     MAXEXPONENT, MINEXPONENT, NEAREST, PRECISION). If the $TRUNCATE
  12431.     metacommand is enabled, the compiler considers any function name with the
  12432.     same first six characters to be one of these intrinsic functions.»
  12433.  ───────────────────────────────────────────────────────────────────────────
  12434.  
  12435.  Table 5.1 lists the abbreviations used in the tables of intrinsic functions
  12436.  in this chapter.
  12437.  
  12438.  Table 5.1  Abbreviations Used to Describe Intrinsic Functions
  12439.  
  12440.  Abbreviation      Data Type
  12441.  char              CHARACTER «*n»
  12442.  cmp               COMPLEX, «COMPLEX*8, DOUBLE COMPLEX, or COMPLEX*16»
  12443.  cmp8              COMPLEX«*8»
  12444.  cmp16             «DOUBLE COMPLEX or COMPLEX*16»
  12445.  dbl               DOUBLE PRECISION,«REAL*8»
  12446.  gen               More than one possible argument type; see "Argument Type"
  12447.                    column
  12448.  integer           INTEGER, «INTEGER*1, INTEGER*2, or INTEGER*4»
  12449.  «int1             INTEGER*1»
  12450.  «int2             INTEGER*2»
  12451.  int4              INTEGER«*4»
  12452.  log               LOGICAL, «LOGICAL*1, LOGICAL*2, or LOGICAL*4»
  12453.  log1              «LOGICAL*1»
  12454.  log2              «LOGICAL*2»
  12455.  log4              LOGICAL«*4»
  12456.  real              REAL, «REAL*4,» DOUBLE PRECISION«, or REAL*8»
  12457.  real4             REAL«*4»
  12458.  
  12459.  
  12460.  5.1.1  Data-Type Conversion
  12461.  
  12462.  This section describes the type-conversion intrinsic functions. Table 5.2
  12463.  summarizes the intrinsic functions that perform type conversion.
  12464.  
  12465.  Table 5.2  Intrinsic Functions: Type Conversion
  12466.  
  12467.                    Argument                   Function
  12468.  Name              Type                       Type
  12469.  
  12470.  INT (gen)         int, real, or cmp          int
  12471.  
  12472.  «INT1 (gen)»      «int, real, or cmp»        «INTEGER*1»
  12473.  
  12474.  «INT2 (gen)»      «int, real, or cmp»        «INTEGER*2»
  12475.  
  12476.  «INT4 (gen)»      «int, real, or cmp»        «INTEGER*4»
  12477.  
  12478.  «INTC (gen)»      «int, real, or cmp»        «INTEGER[C]»
  12479.  
  12480.  IFIX (real4)      REAL«*4»                   int
  12481.  
  12482.  «HFIX (gen)»      «int, real, or cmp»        «INTEGER*2»
  12483.  
  12484.  «JFIX (gen)»      «int, real, or cmp»        «INTEGER*4»
  12485.  
  12486.  IDINT (dbl)       DOUBLE PRECISION,          int
  12487.                    «REAL*8»
  12488.  
  12489.  REAL (gen)        int, real, or cmp          REAL«*4»
  12490.  
  12491.  «DREAL (cmp)»     «COMPLEX*16»               «REAL*8»
  12492.  
  12493.  FLOAT (int)       int                        REAL«*4»
  12494.  
  12495.  SNGL (dbl)        «REAL*8»                   REAL«*4»
  12496.  
  12497.  DBLE (gen)        int, real, or cmp          DOUBLE PRECISION
  12498.  
  12499.  DFLOAT (gen)      int, real, or cmp          DOUBLE PRECISION
  12500.  
  12501.  CMPLX (genA       int, real, or cmp          COMPLEX«*8»
  12502.  «, genB»)
  12503.  
  12504.  «DCMPLX (genA     «int, real, or cmp»        «COMPLEX*16»
  12505.  «, genB»)»
  12506.  
  12507.  ICHAR (char)      char                       int
  12508.  
  12509.  CHAR (int)        int                        char
  12510.  
  12511.  
  12512.  The INT intrinsic function converts arguments to integers. If the argument
  12513.  gen is an integer, then INT (gen) equals gen. If gen is real, then INT (gen)
  12514.  is the truncated value of gen. INT (1.9), for example, is equal to 1, and
  12515.  INT (-1.9) is equal to -1. If gen is complex, the real part of gen is taken,
  12516.  then truncated to an integer.
  12517.  
  12518.  «INT1 converts its arguments to INTEGER*1. INT2 and HFIX convert their
  12519.  arguments to INTEGER*2. INT4 and JFIX convert their arguments to INTEGER*4.
  12520.  They can be used to convert the data type of an expression or variable to an
  12521.  expression of the correct type for passing as an argument. INT2 can also be
  12522.  used to direct the compiler to use short arithmetic in expressions which
  12523.  would otherwise be long, and INT4 can specify long arithmetic in expressions
  12524.  which would otherwise be short.»
  12525.  
  12526.  «The INTC intrinsic function converts arguments to C integers. C integers
  12527.  are described in Section 1.6.3, "C."» The IFIX and IDINT intrinsic functions
  12528.  convert single- or double-precision arguments, respectively, to integers.
  12529.  
  12530.  The REAL intrinsic function converts numbers to the single-precision real
  12531.  data type. If gen is an integer, REAL(gen) is gen stored as a
  12532.  single-precision real number. If gen is a single-precision real number,
  12533.  REAL(gen) equals gen. If gen is complex, REAL(gen) equals the real part of
  12534.  gen. If gen is a double-precision number, REAL(gen) is the first six
  12535.  significant digits of gen.
  12536.  
  12537.  The DBLE intrinsic function converts numbers to the double-precision real
  12538.  data type. The FLOAT and SNGL intrinsic functions convert numbers to the
  12539.  single-precision real data type. They work like the REAL intrinsic function.
  12540.  «The DREAL intrinsic function converts COMPLEX*16 numbers to the
  12541.  double-precision real data type by deleting the imaginary part.»
  12542.  
  12543.  The CMPLX «and DCMPLX» intrinsic functions convert numbers to the complex
  12544.  data types. If only one argument, gen, is specified, gen can be an integer,
  12545.  a real, a double-precision, or a complex number. If gen is complex,
  12546.  CMPLX(gen) equals gen. If gen is an integer, a real, or a double-precision
  12547.  number, the real part of the result equals REAL(gen) and the imaginary part
  12548.  equals 0.0. If two arguments are specified, genA and genB must both have the
  12549.  same type, and they can be integers, real numbers, or double-precision
  12550.  numbers. In this case, the real part of the result equals REAL(genA), and
  12551.  the imaginary part of the result equals REAL(genB).
  12552.  
  12553.  The ICHAR intrinsic function translates ASCII characters into integers, and
  12554.  the CHAR intrinsic function translates integers into ASCII characters. (The
  12555.  ASCII character set is listed in Appendix A, "ASCII Character Codes.") Both
  12556.  the argument of the CHAR intrinsic function and the result of the ICHAR
  12557.  intrinsic function must be greater than or equal to 0, and less than or
  12558.  equal to 255. The argument of the ICHAR intrinsic function must be a single
  12559.  character.
  12560.  
  12561.  
  12562.  Example
  12563.  
  12564.  The following list shows examples of the type-conversion intrinsic
  12565.  functions:
  12566.  
  12567.  Function Reference                         Equivalent
  12568.  
  12569.  INT(-3.7)                                  -3
  12570.  
  12571.  INT(7.682)                                  7
  12572.  
  12573.  INT(0)                                      0
  12574.  
  12575.  INT((7.2,39.3))                             7
  12576.  
  12577.  
  12578.  5.1.2  «Data-Type Information»
  12579.  
  12580.  «This section describes the intrinsic functions that return information
  12581.  about data types. Except for the NEAREST function, the variables passed as
  12582.  arguments do not need to have been assigned a value; it is the data type of
  12583.  the argument that is significant. Table 5.3 summarizes these functions.»
  12584.  
  12585.  «Table 5.3  Intrinsic Functions: Data-Type Information»
  12586.  
  12587.  «Name                      Argument Type              Function Type»
  12588.  
  12589.  «ALLOCATED (gen)»          «array»                    «log»
  12590.  
  12591.  «EPSILON (real)»           «real»                     «real»
  12592.  
  12593.  «HUGE (gen)»               «int or real»              «Same as argument»
  12594.  
  12595.  «MAXEXPONENT (real)»       «real»                     «real»
  12596.  
  12597.  «MINEXPONENT (real)»       «real»                     «real»
  12598.  
  12599.  «NEAREST (real,            «real»                     «real»
  12600.   director)»
  12601.  
  12602.  «PRECISION (real)»         «real»                     «real»
  12603.  
  12604.  «TINY (real)»              «real»                     «real»
  12605.  
  12606.  
  12607.  «The ALLOCATED intrinsic function returns a logical value that is .TRUE. if
  12608.  memory is currently allocated to the array.»
  12609.  
  12610.  «The EPSILON intrinsic function returns the smallest increment that, when
  12611.  added to one, produces a number greater than one for the argument's data
  12612.  type. The increment is slightly larger than the best precision attainable
  12613.  for that data type. For example, a single-precision real can accurately
  12614.  represent some numbers to seven decimal places: EPSILON (real4) returns
  12615.  1.112093E-07.»
  12616.  
  12617.  «The EPSILON function makes it easy to select a delta for algorithms (such
  12618.  as root locators) that search until the calculation is within delta of an
  12619.  estimate. If delta is too small (smaller than the decimal resolution of the
  12620.  data type), the algorithm may never halt. By scaling the value returned by
  12621.  EPSILON to the estimate, you obtain a delta that ensures search
  12622.  termination.»
  12623.  
  12624.  «The HUGE intrinsic function returns the largest positive number that can be
  12625.  represented by the argument's data type.»
  12626.  
  12627.  «The MAXEXPONENT intrinsic function returns the largest positive decimal
  12628.  exponent that a number of the argument's data type can have. For example,
  12629.  MAXEXPONENT (real4) returns 38.»
  12630.  
  12631.  «The MINEXPONENT intrinsic function returns the largest negative decimal
  12632.  exponent that a number of the argument's data type can have. For example,
  12633.  MINEXPONENT (real8) returns -308.»
  12634.  
  12635.  «The NEAREST intrinsic function returns the nearest different number in the
  12636.  direction of director. (If director is positive, the value returned is
  12637.  larger than real. If director is negative, the value returned is smaller
  12638.  than real.) As with the EPSILON intrinsic function, NEAREST lets the program
  12639.  select an appropriate increment to guarantee a search terminates.»
  12640.  
  12641.  «The PRECISION intrinsic function returns the number of significant decimal
  12642.  digits for real's data type. It is useful in rounding off numbers.»
  12643.  
  12644.  «The TINY intrinsic function returns the smallest positive number that can
  12645.  be represented by the argument's data type.»
  12646.  
  12647.  
  12648.  5.1.3  Truncating and Rounding
  12649.  
  12650.  Table 5.4 summarizes the intrinsic functions that truncate and round.
  12651.  
  12652.  Table 5.4  Intrinsic Functions: Truncation and Rounding
  12653.  
  12654.                          Truncate          Argument          Function
  12655.  Name                    or Round          Type              Type
  12656.  
  12657.  AINT (real)             Truncate          real              Same as argument
  12658.  
  12659.  DINT (dbl)              Truncate          «REAL*8»          «REAL*8»
  12660.  
  12661.  ANINT (real)            Round             real              Same as argument
  12662.  
  12663.  DNINT (dbl)             Round             «REAL*8»          «REAL*8»
  12664.  
  12665.  NINT (real)             Round             real              int
  12666.  
  12667.  IDNINT (dbl)            Round             «REAL*8»          int
  12668.  
  12669.  
  12670.  The intrinsic functions AINT and DINT truncate their arguments. The
  12671.  intrinsic functions ANINT, DNINT, NINT, and IDNINT round their arguments and
  12672.  are evaluated as follows:
  12673.  
  12674.  Argument                                   Result
  12675.  
  12676.  Greater than zero                          INT(gen+0.5)
  12677.  
  12678.  Equal to zero                              Zero
  12679.  
  12680.  Less than zero                             INT(gen-0.5)
  12681.  
  12682.  
  12683.  Examples
  12684.  
  12685.  The following list shows examples of truncation and rounding:
  12686.  
  12687.  Function Reference                         Equivalent
  12688.  
  12689.  AINT(2.6)                                   2.0
  12690.  
  12691.  AINT(-2.6)                                 -2.0
  12692.  
  12693.  ANINT(2.6)                                  3.0
  12694.  
  12695.  ANINT(-2.6)                                -3.0
  12696.  
  12697.  The following example uses the ANINT intrinsic function to perform rounding:
  12698.  
  12699.       C     This program adds tax to a purchase amount
  12700.       C     and prints the total:
  12701.  
  12702.             REAL  amount, taxrate, tax, total
  12703.             taxrate = 0.081
  12704.             amount  = 12.99
  12705.       C     Calculate tax and round to nearest hundredth:
  12706.             tax = ANINT (amount * taxrate * 100.0) / 100.0
  12707.             total = amount + tax
  12708.             WRITE (*, 100) amount, tax, total
  12709.         100 FORMAT (1X, 'AMOUNT', F7.2 /
  12710.            +        1X, 'TAX   ', F7.2 /
  12711.            +        1X, 'TOTAL ', F7.2)
  12712.             END
  12713.  
  12714.  
  12715.  5.1.4  Absolute Value and Sign Transfer
  12716.  
  12717.  Table 5.5 summarizes the intrinsic functions that compute absolute values
  12718.  and perform sign transfers.
  12719.  
  12720.  The intrinsic functions ABS, IABS, DABS, CABS, and CDABS return the absolute
  12721.  value of their arguments. Note that for a complex number (real, imag), the
  12722.  absolute value equals the following:
  12723.  
  12724.      √(real^(2) + imag^(2)
  12725.  
  12726.  For two arguments (genA, genB), the intrinsic functions SIGN, ISIGN, and
  12727.  DSIGN return |genA| if genB is greater than or equal to zero, and -|genA| if
  12728.  genB is less than zero.
  12729.  
  12730.  Table 5.5  Intrinsic Functions: Absolute Values and Sign Transfer
  12731.  
  12732.                                                 Argument                   Fun
  12733.  Name                Definition                 Type                       Typ
  12734.  
  12735.  ABS (gen)           Absolute value             int, real, or cmp          Fun
  12736.                                                                            sam
  12737.                                                                            typ
  12738.                                                                            whe
  12739.                                                                            arg
  12740.                                                                            com
  12741.  
  12742.  IABS (int)          Absolute value             int                        int
  12743.  
  12744.  DABS (dbl)          Absolute value             «REAL*8»                   «RE
  12745.  
  12746.  CABS (cmp)          Absolute value             cmp                        rea
  12747.  
  12748.  «CDABS (cmp16)»     «Absolute value»           «COMPLEX*16»               «RE
  12749.  
  12750.  SIGN (genA, genB)   Sign transfer              int or real                Sam
  12751.                                                                            arg
  12752.  
  12753.  ISIGN (intA, intB)  Sign transfer              int                        int
  12754.  
  12755.  DSIGN (dblA, dblB)  Sign transfer              «REAL*8»                   «RE
  12756.  
  12757.  
  12758.  Examples
  12759.  
  12760.  The following program uses a sign-transfer intrinsic function:
  12761.  
  12762.             a = 5.2
  12763.             b = -3.1
  12764.  
  12765.       C     The following statement transfers the sign of b to a
  12766.       C     and assigns the result to c.
  12767.             c = SIGN (a, b)
  12768.  
  12769.       C     The output is -5.2:
  12770.             WRITE (*, *) c
  12771.             END
  12772.  
  12773.  The following program uses sign-transfer and absolute-value intrinsic
  12774.  functions:
  12775.  
  12776.       C     This program takes the square root of a vector
  12777.       C     magnitude. Since the sign in a vector represents
  12778.       C     direction, the square root of a negative value is not
  12779.       C     meant to produce complex results. This routine removes
  12780.       C     the sign, takes the square root, and then restores
  12781.       C     the sign.
  12782.             REAL  mag, sgn
  12783.  
  12784.             WRITE (*, '(A)') ' ENTER A MAGNITUDE:  '
  12785.             READ  (*, '(F10.5)') mag
  12786.       C     Store the sign of mag by transferring its sign to 1
  12787.       C     and storing the result in sgn:
  12788.             sgn = SIGN (1.0, mag)
  12789.  
  12790.       C     Calculate the square root of the absolute value
  12791.       C     of the magnitude:
  12792.             result = SQRT (ABS (mag))
  12793.  
  12794.       C     Restore the sign by multiplying the result by -1 or
  12795.       C     +1:
  12796.             result = result * sgn
  12797.             WRITE (*, *) result
  12798.             END
  12799.  
  12800.  
  12801.  5.1.5  Remainders
  12802.  
  12803.  Table 5.6 summarizes the intrinsic functions that return remainders.
  12804.  
  12805.  Table 5.6  Intrinsic Functions: Remainders
  12806.  
  12807.                             Argument          Function
  12808.  Name                       Type              Type
  12809.  
  12810.  MOD (genA, genB)           int or real       Same as argument
  12811.  
  12812.  AMOD (real4A, real4B)      REAL«*4»          REAL«*4»
  12813.  
  12814.  DMOD (dblA, dblB)          «REAL*8»          «REAL*8»
  12815.  
  12816.  
  12817.  The intrinsic functions MOD, AMOD, and DMOD return remainders as follows
  12818.  (AMOD and DMOD use exactly the same formula as MOD):
  12819.  
  12820.       MOD (genA, genB) = genA-(INT (genA / genB) * genB)
  12821.  
  12822.  If genB is 0, the result is undefined.
  12823.  
  12824.  
  12825.  5.1.6  Positive Differences
  12826.  
  12827.  Table 5.7 summarizes the intrinsic functions that return the positive
  12828.  difference between two arguments.
  12829.  
  12830.  Table 5.7  Intrinsic Functions: Positive Difference
  12831.  
  12832.                             Argument                   Function
  12833.  Name                       Type                       Type
  12834.  
  12835.  DIM (genA, genB)           int or real                Same as argument
  12836.  
  12837.  IDIM (intA, intB)          int                        int
  12838.  
  12839.  DDIM (dblA, dblB)          «REAL*8»                   «REAL*8»
  12840.  
  12841.  
  12842.  The intrinsic functions DIM, IDIM, and DDIM return the positive difference
  12843.  of two arguments as follows:
  12844.  
  12845.  Situation                                  Result
  12846.  
  12847.  genA <= genB                               DIM (genA,  genB) = 0
  12848.  
  12849.  genA > genB                                DIM (genA,  genB) = genA-genB
  12850.  
  12851.  
  12852.  Examples
  12853.  
  12854.  The following list shows examples of positive differences:
  12855.  
  12856.  Function Reference                         Equivalent
  12857.  
  12858.  DIM(10,5)                                  5
  12859.  
  12860.  DIM(5,10)                                  0
  12861.  
  12862.  DIM(10,-5)                                 15
  12863.  
  12864.  
  12865.  5.1.7  Maximums and Minimums
  12866.  
  12867.  Table 5.8 summarizes the functions that return the maximum or minimum of two
  12868.  or more values.
  12869.  
  12870.  Table 5.8  Intrinsic Functions: Maximums and Minimums
  12871.  
  12872.                                                        Argument          Funct
  12873.  Name                                Definition        Type              Type
  12874.  
  12875.  MAX (genA,genB«,genC»...)           Maximum           int or real       Same
  12876.                                                                          argum
  12877.  
  12878.  MAX0 (intA,intB«,intC»...)          Maximum           int               int
  12879.  
  12880.  AMAX1 (real4A,real4B«,real4C»...)   Maximum           REAL«*4»          REAL«
  12881.  
  12882.  AMAX0 (intA,intB«,intC»...)         Maximum           int               REAL«
  12883.  
  12884.  MAX1 (real4A,real4B«,real4C»...)    Maximum           REAL«*4»          int
  12885.  
  12886.  DMAX1(dblA,dblB«,dblC»...)          Maximum           «REAL*8»          «REAL
  12887.  
  12888.  MIN (genA,genB«,genC»...)           Minimum           int or real       Same
  12889.                                                                          argum
  12890.  
  12891.  MIN0 (intA,intB«,intC»...)          Minimum           int               int
  12892.  
  12893.  AMIN1 (real4A,real4B«,real4C»...)   Minimum           REAL«*4»          REAL«
  12894.  
  12895.  AMIN0 (intA,intB«,intC»...)         Minimum           int               REAL«
  12896.  
  12897.  MIN1 (real4A,real4B«,real4C»...)    Minimum           REAL«*4»          int
  12898.  
  12899.  DMIN1 (dblA,dblB«,dblC»...)         Minimum           «REAL*8»          «REAL
  12900.  
  12901.  
  12902.  The intrinsic functions MAX, MAX0, AMAX1, and DMAX1 return the maximum value
  12903.  in the argument list. The intrinsic functions AMAX0 and MAX1 return the
  12904.  maximum and also perform type conversion. Similarly, MIN, MIN0, AMIN1, and
  12905.  DMIN1 return minimums, while AMIN0 and MIN1 return the minimum and also
  12906.  perform type conversion.
  12907.  
  12908.  
  12909.  Examples
  12910.  
  12911.  The following list shows examples of maximums and minimums:
  12912.  
  12913.  Function Reference                         Equivalent
  12914.  
  12915.  MAX(5,6,7,8)                               8
  12916.  
  12917.  MAX(-5.,-6.,-7.)                           -5.
  12918.  
  12919.  MIN(-5,-6,-7)                              -7
  12920.  
  12921.  MIN(.1E12,.1E14,.1E19)                     .1E12
  12922.  
  12923.  The following program uses the MIN and MAX intrinsic functions:
  12924.  
  12925.       C     This program uses the MAX intrinsic function to find
  12926.       C     the maximum and minimum elements in a vector x.
  12927.  
  12928.             INTEGER   i
  12929.             REAL      x(10), small, large
  12930.  
  12931.             DATA x /12.5, 2.7, -6.2, 14.1, -9.1, 17.5, 2.0, -6.3,
  12932.            +        2.5, -12.2/
  12933.  
  12934.  
  12935.  
  12936.       C     Initialize small and large with arbitrarily large and
  12937.       C     small values:
  12938.             small =  1e20
  12939.             large = -1e2
  12940.  
  12941.             DO 100, i = 1,10
  12942.                small = MIN (small, x(i))
  12943.                large = MAX (large, x(i))
  12944.         100 CONTINUE
  12945.  
  12946.             WRITE (*, 200) small, large
  12947.         200 FORMAT (' The smallest number was ', F6.1/
  12948.            +        ' The largest number was  ', F6.1)
  12949.             END
  12950.  
  12951.  
  12952.  Output
  12953.  
  12954.       The smallest number was  -12.2
  12955.       The largest number was    17.5
  12956.  
  12957.  
  12958.  5.1.8  Double-Precision Products
  12959.  
  12960.  Table 5.9 lists the intrinsic function that returns a double-precision
  12961.  product.
  12962.  
  12963.  Table 5.9  Intrinsic Functions: Double-Precision Product
  12964.  
  12965.                                      Argument          Function
  12966.  Name                                Type              Type
  12967.  
  12968.  DPROD (real4A, real4B)              REAL«*4»          «REAL*8»
  12969.  
  12970.  
  12971.  The intrinsic function DPROD returns the double-precision product of two
  12972.  single-precision real arguments.
  12973.  
  12974.  The following example uses the DPROD intrinsic function:
  12975.  
  12976.             REAL  a, b
  12977.  
  12978.             a = 3.72382
  12979.             b = 2.39265
  12980.  
  12981.             WRITE (*, *) a*b, DPROD (a,b)
  12982.  
  12983.  
  12984.  The following output is produced:
  12985.  
  12986.       8.9097980         8.90979744044290
  12987.  
  12988.  
  12989.  5.1.9  Complex Functions
  12990.  
  12991.  Table 5.10 lists the intrinsic operations that perform various other
  12992.  operations on complex numbers.
  12993.  
  12994.  Table 5.10  Intrinsic Functions: Complex Operators
  12995.  
  12996.                                                     Argument              Func
  12997.  Name                    Definition                 Type                  Type
  12998.  
  12999.  AIMAG (cmp8)            Imaginary part of          COMPLEX«*8»           REAL
  13000.                          COMPLEX«*8» number
  13001.  
  13002.  «IMAG (cmp)»            «Imaginary part of cmp     «cmp»                 «If
  13003.                          number»                                          COMP
  13004.                                                                           func
  13005.                                                                           REAL
  13006.                                                                           argu
  13007.                                                                           COMP
  13008.                                                                           func
  13009.                                                                           REAL
  13010.  
  13011.  «DIMAG (cmp16)»         «Imaginary part of         «COMPLEX*16»          «REA
  13012.                          COMPLEX*16 number»
  13013.  
  13014.  CONJG (cmp8)            Conjugate of               COMPLEX«*8»           COMP
  13015.                          COMPLEX«*8» number
  13016.  
  13017.  «DCONJG (cmp16)»        «Conjugate of              «COMPLEX*16»          «COM
  13018.                          COMPLEX*16 number»
  13019.  
  13020.  
  13021.  The intrinsic function«s» AIMAG, «IMAG, and DIMAG» return the imaginary part
  13022.  of complex numbers. The intrinsic function«s» CONJG «and DCONJG» return the
  13023.  complex conjugates of complex numbers. Therefore, for a complex number
  13024.  complex equal to (real, imag), AIMAG(complex) equals imag, and
  13025.  CONJG(complex) equals (real, - imag). Note that the REAL «and DBLE»
  13026.  intrinsic function«s», described in Section 5.1.1, can be used to return the
  13027.  real part of COMPLEX«*8» «and COMPLEX*16» numbers, respectively.
  13028.  
  13029.  
  13030.  Example
  13031.  
  13032.  The following program uses complex intrinsic functions:
  13033.  
  13034.       C     This program applies the quadratic formula to a
  13035.       C     polynomial and allows for complex results.
  13036.  
  13037.             REAL  a, b, c
  13038.             COMPLEX  ans1, ans2, desc
  13039.             WRITE  (*, 100)
  13040.  
  13041.        100  FORMAT (' Enter a, b, and c of the ',
  13042.            +        'polynomial ax^2 + bx + c: ' \)
  13043.             READ   (*, '(3F10.5)') a, b, c
  13044.  
  13045.             desc = CSQRT (CMPLX (b**2 - 4.0*a*c))
  13046.             ans1 = (-b + desc) / (2.0 * a)
  13047.             ans2 = (-b - desc) / (2.0 * a)
  13048.  
  13049.             WRITE  (*, 200)
  13050.        200  FORMAT (/ ' The roots are:' /)
  13051.             WRITE  (*, 300) REAL(ans1), AIMAG(ans1),
  13052.            +                REAL(ans2), AIMAG(ans2)
  13053.        300  FORMAT (' X = ', F10.5, '  +', F10.5, 'i')
  13054.             END
  13055.  
  13056.  
  13057.  5.1.10  Square Roots
  13058.  
  13059.  Table 5.11 summarizes the intrinsic functions that return square roots.
  13060.  
  13061.  Table 5.11  Intrinsic Functions: Square Roots
  13062.  
  13063.                             Argument                   Function
  13064.  Name                       Type                       Type
  13065.  
  13066.  SQRT (gen)                 real or cmp                Same as argument
  13067.  
  13068.  DSQRT (dbl)                «REAL*8»                   «REAL*8»
  13069.  
  13070.  CSQRT (cmp8)               COMPLEX«*8»                COMPLEX«*8»
  13071.  
  13072.  «CDSQRT (cmp16)»           «COMPLEX*16»               «COMPLEX*16»
  13073.  
  13074.  
  13075.  The intrinsic functions SQRT, DSQRT, CSQRT«, and CDSQRT» return the square
  13076.  root of their respective arguments. The arguments to SQRT and DSQRT must be
  13077.  greater than or equal to zero. For a complex argument, SQRT, CSQRT«, and
  13078.  CDSQRT» return a complex number whose magnitude is the square root of the
  13079.  magnitude of the argument and whose angle is one-half the angle of the
  13080.  argument.
  13081.  
  13082.  
  13083.  Example
  13084.  
  13085.  The following program uses the SQRT intrinsic function:
  13086.  
  13087.       C     This program calculates the length of the hypotenuse
  13088.       C     of a right triangle from the lengths of the other two
  13089.       C     sides.
  13090.  
  13091.             REAL  sidea, sideb, hyp
  13092.  
  13093.             sidea = 3.0
  13094.             sideb = 4.0
  13095.  
  13096.             hyp = SQRT (sidea**2 + sideb**2)
  13097.  
  13098.             WRITE (*, 100) hyp
  13099.         100 FORMAT (/ ' The hypotenuse is ', F10.3)
  13100.  
  13101.             END
  13102.  
  13103.  
  13104.  5.1.11  Exponents and Logarithms
  13105.  
  13106.  Table 5.12 lists the intrinsic functions that return exponents or
  13107.  logarithms.
  13108.  
  13109.  Table 5.12  Intrinsic Functions: Exponents and Logarithms
  13110.  
  13111.                                                     Argument           Functio
  13112.  Name                    Definition                 Type               Type
  13113.  
  13114.  EXP (gen)               Exponent                   real or cmp        Same as
  13115.                                                                        argumen
  13116.  
  13117.  DEXP (dbl)              Exponent                   «REAL*8»           «REAL*8
  13118.  
  13119.  CEXP (cmp8)             Exponent                   COMPLEX«*8»        COMPLEX
  13120.  
  13121.  «CDEXP (cmp16)»         «Exponent»                 «COMPLEX*16»       «COMPLE
  13122.  
  13123.  LOG (gen)               Natural logarithm          real or cmp        Same as
  13124.                                                                        argumen
  13125.  
  13126.  ALOG (real4)            Natural logarithm          REAL«*4»           REAL«*4
  13127.  
  13128.  DLOG (dbl)              Natural logarithm          «REAL*8»           «REAL*8
  13129.  
  13130.  CLOG (cmp8)             Natural logarithm          COMPLEX«*8»        COMPLEX
  13131.  
  13132.  «CDLOG (cmp16)»         «Natural logarithm»        «COMPLEX*16»       «COMPLE
  13133.  
  13134.  LOG10 (real)            Common logarithm           real               Same as
  13135.                                                                        argumen
  13136.  
  13137.  ALOG10 (real4)          Common logarithm           REAL«*4»           REAL«*4
  13138.  
  13139.  DLOG10 (dbl)            Common logarithm           «REAL*8»           «REAL*8
  13140.  
  13141.  
  13142.  The intrinsic functions EXP, DEXP, CEXP«, and CDEXP» return e**gen.
  13143.  
  13144.  The intrinsic functions LOG, ALOG, DLOG, CLOG«, and CDLOG» return the
  13145.  natural logarithm of their respective arguments. LOG10, ALOG10, and DLOG10
  13146.  return the base-10 logarithm of their arguments.
  13147.  
  13148.  For all intrinsic logarithmic functions, real arguments must be greater than
  13149.  zero. The CLOG and CDLOG functions return the logarithm of a complex number.
  13150.  The real component is the natural logarithm of the magnitude of the complex
  13151.  number. The imaginary component is the principal value of the angle of the
  13152.  complex number, in radians.
  13153.  
  13154.  
  13155.  Example
  13156.  
  13157.  The following program uses the EXP intrinsic function:
  13158.  
  13159.       C     Given the initial size and growth rate of a colony,
  13160.       C     this program computes the size of the colony at a
  13161.       C     specified time. The growth rate is assumed to be
  13162.       C     proportional to the colony's size.
  13163.  
  13164.             REAL  sizei, sizef, time, rate
  13165.  
  13166.             sizei = 10000.0
  13167.             time  = 40.5
  13168.             rate  = 0.0875
  13169.  
  13170.             sizef = sizei * EXP (rate * time)
  13171.  
  13172.             WRITE (*, 100) sizef
  13173.         100 FORMAT (' THE FINAL SIZE IS ', E12.6)
  13174.             END
  13175.  
  13176.  
  13177.  5.1.12  Trigonometric Functions
  13178.  
  13179.  Table 5.13 summarizes the trigonometric intrinsic functions.
  13180.  
  13181.  Table 5.13  Intrinsic Functions: Trigonometric Functions
  13182.  
  13183.                                                     Argument               Fun
  13184.  Name                    Definition                 Type                   Typ
  13185.  
  13186.  SIN (gen)               Sine                       real or cmp            Sam
  13187.                                                                            arg
  13188.  
  13189.  DSIN (dbl)              Sine                       «REAL*8»               «RE
  13190.  
  13191.  CSIN (cmp8)             Sine                       COMPLEX«*8»            COM
  13192.  
  13193.  «CDSIN (cmp16)»         «Sine»                     «COMPLEX*16»           «CO
  13194.  
  13195.  COS (gen)               Cosine                     real or cmp            Sam
  13196.                                                                            arg
  13197.  
  13198.  DCOS (dbl)              Cosine                     «REAL*8»               «RE
  13199.  
  13200.  CCOS (cmp8)             Cosine                     COMPLEX«*8»            COM
  13201.  
  13202.  «CDCOS (cmp16)»         «Cosine»                   «COMPLEX*16»           «CO
  13203.  
  13204.  TAN (real)              Tangent                    real                   Sam
  13205.                                                                            arg
  13206.  
  13207.  DTAN (dbl)              Tangent                    «REAL*8»               «RE
  13208.  
  13209.  ASIN (real)             Arc sine                   real                   Sam
  13210.                                                                            arg
  13211.  
  13212.  DASIN (dbl)             Arc sine                   «REAL*8»               «RE
  13213.  
  13214.  ACOS (real)             Arc cosine                 real                   Sam
  13215.                                                                            arg
  13216.  
  13217.  DACOS (dbl)             Arc cosine                 «REAL*8»               «RE
  13218.  
  13219.  ATAN (real)             Arc tangent                real                   Sam
  13220.                                                                            arg
  13221.  
  13222.  DATAN (dbl)             Arc tangent                «REAL*8»               «RE
  13223.  
  13224.  ATAN2 (realA,           Arc tangent (realA /       real                   Sam
  13225.  realB)                  realB)                                            arg
  13226.  
  13227.  DATAN2 (dblA,           Arc tangent (dblA /        «REAL*8»               «RE
  13228.  dblB)                   dblB)
  13229.  
  13230.  «COTAN (real)»          «Cotangent»                «real»                 «Sa
  13231.                                                                            arg
  13232.  
  13233.  «DCOTAN (dbl)»          «Cotangent»                «REAL*8»               «RE
  13234.  
  13235.  SINH (real)             Hyperbolic sine            real                   Sam
  13236.                                                                            arg
  13237.  
  13238.  DSINH (dbl)             Hyperbolic sine            «REAL*8»              «REA
  13239.  
  13240.  COSH (real)             Hyperbolic cosine          real                   Sam
  13241.                                                                            arg
  13242.  
  13243.  DCOSH (dbl)             Hyperbolic cosine          «REAL*8»               «RE
  13244.  
  13245.  TANH (real)             Hyperbolic tangent         real                   Sam
  13246.                                                                            arg
  13247.  
  13248.  DTANH (dbl)             Hyperbolic tangent         «REAL*8»               «RE
  13249.  
  13250.  
  13251.  All angles in trigonometric intrinsic functions are specified in radians.
  13252.  Table 5.14 indicates some restrictions on the arguments to and results of
  13253.  trigonometric intrinsic functions.
  13254.  
  13255.  Table 5.14  Restrictions on Arguments and Results
  13256.  
  13257.                             Restrictions               Range of
  13258.  Function                   on Arguments               Results
  13259.  
  13260.  SIN, DSIN, COS, DCOS,      None                       All real numbers
  13261.  TAN, DTAN
  13262.  
  13263.  ASIN, DASIN                |arg| <= 1                 -p/2 <= result <= p/2
  13264.  
  13265.  ACOS, DACOS                |arg| <= 1                 0 <= result <= p
  13266.  
  13267.  ATAN, DATAN                None                       -p/2 <= result <= p/2
  13268.  
  13269.  ATAN2, DATAN2              Arguments cannot both      -p <= result <= p
  13270.                             be zero
  13271.  
  13272.  «COTAN»                    «Argument cannot be        «All real numbers»
  13273.                             zero»
  13274.  
  13275.  The range of the results of the intrinsic functions ATAN2 and DATAN2 is as
  13276.  follows:
  13277.  
  13278.  Arguments                                  Result
  13279.  
  13280.  genA > 0                                   result > 0
  13281.  
  13282.  genA = 0 and genB > 0                      result = 0
  13283.  
  13284.  genA = 0 and genB < 0                      result = p
  13285.  
  13286.  genA < 0                                   result < 0
  13287.  
  13288.  genB = 0                                   |result| = p/2
  13289.  
  13290.  
  13291.  Example
  13292.  
  13293.  The following program uses trigonometric intrinsic functions:
  13294.  
  13295.       C     This program prompts for a polar coordinate
  13296.       C     and converts it to a rectangular coordinate.
  13297.       C
  13298.             REAL  theta, radius, x, y
  13299.  
  13300.             WRITE  (*, *) ' Enter polar coordinate (radius,
  13301.            +                angle)'
  13302.             READ   (*, '(2F10.5)') radius, theta
  13303.  
  13304.             x = radius * COS (theta)
  13305.             y = radius * SIN (theta)
  13306.  
  13307.             WRITE  (*, 100) x, y
  13308.        100  FORMAT (/ ' (X,Y) = (', F7.3, ',', F7.3,')' )
  13309.             END
  13310.  
  13311.  
  13312.  5.1.13  Character Functions
  13313.  
  13314.  Table 5.15 summarizes the intrinsic functions that operate on character
  13315.  constants and variables.
  13316.  
  13317.  Table 5.15  Intrinsic Functions: Character Functions
  13318.  
  13319.                                                     Argument              Func
  13320.  Name                    Definition                 Type                  Type
  13321.  
  13322.  LGE (charA, charB)      charA >= charB             char                  log
  13323.  
  13324.  LGT (charA, charB)      charA > charB              char                  log
  13325.  
  13326.  LLE (charA, charB)      charA <= charB             char                  log
  13327.  
  13328.  LLT (charA, charB)      charA < charB              char                  log
  13329.  
  13330.  LEN (char)              Length of string           char                  int
  13331.  
  13332.  INDEX (charA, charB     Position of substring      char, «log»           int
  13333.  ««, log»»)              charB in string charA
  13334.  
  13335.  «LEN_TRIM (char)»       «Length of string,         «char»                «int
  13336.                          less trailing blanks»
  13337.  
  13338.  «SCAN (char,            «Element of charset in     «char, log»           «int
  13339.  «charset«, log»)»        char»
  13340.  
  13341.  «VERIFY (char,          «Element of charset        «char, log»           «log
  13342.  charset«, log»)»        not in char»
  13343.  
  13344.  
  13345.  The intrinsic functions LGE, LGT, LLE, and LLT use the ASCII collating
  13346.  sequence to determine whether a character argument is less than (precedes in
  13347.  the ASCII collating sequence), greater than (follows in the ASCII collating
  13348.  sequence), or equal to (identical in the ASCII collating sequence) another
  13349.  character argument. If two character arguments are not of equal length, the
  13350.  shorter operand is padded to the length of the larger operand by adding
  13351.  blanks.
  13352.  
  13353.  The argument to the LEN intrinsic function does not have to be assigned a
  13354.  value.
  13355.  
  13356.  The INDEX intrinsic function returns an integer specifying the position of
  13357.  charB in charA. If the length of charA is less than the length of charB, or
  13358.  if charB does not occur in charA, the index equals zero. If charB occurs
  13359.  more than once in charA, the position of the first occurrence of charB is
  13360.  returned. «The log parameter, when .TRUE., starts the comparison at the end
  13361.  of the string and moves toward the beginning.»
  13362.  
  13363.  «The LEN_TRIM function returns the length of the string argument, less the
  13364.  number of trailing blanks.»
  13365.  
  13366.  «The SCAN and VERIFY functions both compare a string with the group of
  13367.  characters in charset. SCAN returns the position of the first string
  13368.  character that matches a character in charset, while VERIFY returns the
  13369.  first position that does not match a character in charset. If there is no
  13370.  match, or the string is of zero length, SCAN returns zero. If there is no
  13371.  mismatch, or the string is of zero length, VERIFY returns zero. The log
  13372.  parameter, when .TRUE., starts the comparison at the end of the string and
  13373.  moves toward the beginning.»
  13374.  
  13375.  
  13376.  Example
  13377.  
  13378.  The following list shows examples of the character intrinsic functions:
  13379.  
  13380.  Function Reference                         Equivalent
  13381.  
  13382.  LLE ('A', 'B')                             .TRUE.
  13383.  
  13384.  LLT ('A', 'a')                             .TRUE.
  13385.  
  13386.  LEN ('abcdef')                             6
  13387.  
  13388.  LEN_TRIM ('abc   ')                        3
  13389.  
  13390.  INDEX ('banana', 'an', «.TRUE.)»           4
  13391.  
  13392.  «SCAN ('banana', 'nbc')»                   «1»
  13393.  
  13394.  «VERIFY ('banana', 'nbc')»                 «2»
  13395.  
  13396.  
  13397.  5.1.14  «End-of-File Function»
  13398.  
  13399.  «Table 5.16 summarizes the end-of-file intrinsic function.»
  13400.  
  13401.  «Table 5.16  Intrinsic Functions: End-of-File Function
  13402.  
  13403.  «                                                  Argument              Func
  13404.  «Name                   Definition                 Type                  Type
  13405.  
  13406.  «EOF(int)»              «End-of-file»              «int»                 «log
  13407.  
  13408.  
  13409.  «If the unit specified by its argument is at or past the end-of-file record,
  13410.  the value .TRUE. is returned by the intrinsic function EOF (int). Otherwise,
  13411.  EOF returns the value .FALSE..The value of int must be the unit specifier
  13412.  corresponding to an open file. The value of int cannot be zero, unless you
  13413.  have reconnected unit zero to a unit other than the screen or keyboard.»
  13414.  
  13415.  
  13416.  «Example»
  13417.  
  13418.  «The following program uses the EOF intrinsic function:»
  13419.  
  13420.       «C     This program reads a file of integers»
  13421.       «C     and prints their average.»
  13422.  
  13423.            «CHARACTER*64  fname»
  13424.            «INTEGER       total, count, value»
  13425.  
  13426.            «WRITE (*, '(a  )') ' Enter file name:  '»
  13427.            «READ  (*, '(a  )') fname»
  13428.  
  13429.       «C     Open unit 1 for input (any unit except * is ok).»
  13430.            «OPEN (1, FILE = fname)»
  13431.  
  13432.            «total = 0»
  13433.            «count = 0»
  13434.       «100  IF (.NOT. EOF (1)) THEN»
  13435.               «count = count + 1»
  13436.               «read (1, '(I7)') value»
  13437.               «total = total + value»
  13438.               «GOTO 100»
  13439.            «ENDIF»
  13440.            «IF (count .GE. 0) THEN»
  13441.               «WRITE (*, *) 'Average is:', FLOAT (total) / count»
  13442.            «ELSE»
  13443.               «WRITE (*, *) 'Input file is empty'»
  13444.            «ENDIF»
  13445.            «END»
  13446.  
  13447.  
  13448.  5.1.15  «Address Functions»
  13449.  
  13450.  «Table 5.17 lists the intrinsic functions that return addresses.»
  13451.  
  13452.  «Table 5.17  Intrinsic Functions: Addresses»
  13453.  
  13454.  «                                                  Argument          Function
  13455.  «Name                   Definition                 Type              Type»
  13456.  
  13457.  «LOCNEAR (gen)»         «Unsegmented address»      «Any»             «INTEGER
  13458.  
  13459.  «LOCFAR (gen)»          «Segmented address»        «Any»             «INTEGER
  13460.  
  13461.  «LOC (gen)»             «Address»                  «Any»             «INTEGER
  13462.                                                                       INTEGER*
  13463.  
  13464.  
  13465.  «These three intrinsic functions return the machine address of the variable
  13466.  passed as an actual argument.»
  13467.  
  13468.  «The following list shows how the address is returned for different types of
  13469.  arguments:»
  13470.  
  13471.  «Argument                                  Return Value»
  13472.  
  13473.  «Expression, function call, or             «A temporary variable is created
  13474.  constant»                                  to hold the result of the
  13475.                                             expression, function call, or
  13476.                                             constant. The address of the
  13477.                                             temporary variable is then
  13478.                                             returned.»
  13479.  
  13480.  «All other arguments»                      «The machine address of the
  13481.                                             actual argument is returned.»
  13482.  
  13483.  «The value returned by the LOCNEAR intrinsic function is equivalent to a
  13484.  near procedure or data pointer in Microsoft C or an ADR type in Microsoft
  13485.  Pascal. Similarly, the value returned by the LOCFAR intrinsic function is
  13486.  equivalent to a far data or function pointer in Microsoft C, or an ads,
  13487.  adsfunc, or adsproc type in Microsoft Pascal.»
  13488.  
  13489.  «LOCNEAR can only be used with NEAR procedures and with objects in the
  13490.  default data segment, such as objects in NEAR common blocks and objects not
  13491.  named in $LARGE metacommands. For example, LOCNEAR will not usually return
  13492.  the correct address of an argument unless that argument is explicitly in the
  13493.  default data segment. LOC returns either a near or a far pointer, depending
  13494.  on the memory model used to compile.»
  13495.  
  13496.  
  13497.  5.1.16  «Bit-Manipulation Functions»
  13498.  
  13499.  «Table 5.18 summarizes the functions that perform bit manipulation.»
  13500.  
  13501.  «Table 5.18  Intrinsic Functions: Bit Manipulation»
  13502.  
  13503.  «                                                  Argument          Function
  13504.  «Name                   Definition                 Type              Type»
  13505.  
  13506.  «IOR (intA, intB)»      «Inclusive or»             «int»             «Same as
  13507.                                                                       argument
  13508.  
  13509.  «ISHL (intA,            «Logical shift»            «int»             «Same as
  13510.  intB)»                                                               argument
  13511.  
  13512.  «ISHFT (intA,           «Logical shift»            «int»             «Same as
  13513.  intB)»                                                               argument
  13514.  
  13515.  «ISHA (intA, intB)»     «Arithmetic shift»         «int»             «Same as
  13516.                                                                       argument
  13517.  
  13518.  «ISHC (intA, intB)»     «Rotate»                   «int»             «Same as
  13519.                                                                       argument
  13520.  
  13521.  «IEOR (intA, intB)»     «Exclusive or»             «int»             «Same as
  13522.                                                                       argument
  13523.  
  13524.  «IAND (intA, intB)»     «Logical product»          «int»             «Same as
  13525.                                                                       argument
  13526.  
  13527.  «NOT (intA)»            «Logical complement»       «int»             «Same as
  13528.                                                                       argument
  13529.  
  13530.  «IBCLR (intA,           «Bit clear»                «int»             «Same as
  13531.  intB)»                                                               argument
  13532.  
  13533.  «IBSET (intA,           «Bit set»                  «int»             «Same as
  13534.  intB)»                                                               argument
  13535.  
  13536.  «IBCHNG (intA,          «Bit change»               «int»             «Same as
  13537.  intB)»                                                               argument
  13538.  
  13539.  «BTEST (intA,           «Bit test»                 «int»             «log»
  13540.  intB)»
  13541.  
  13542.  
  13543.  «All bit-manipulation intrinsic functions can be passed as actual arguments.
  13544.  These intrinsic functions work as follows:»
  13545.  
  13546.  «Function                                  Operation»
  13547.  
  13548.  «Inclusive or»                             «If the nth bit of either the
  13549.                                             first or second argument is 1,
  13550.                                             then the nth bit of the result is
  13551.                                             set to 1.»
  13552.  
  13553.  «Logical shift»                            «If intB is greater than or equal
  13554.                                             to zero, shift intA logically
  13555.                                             left by intB bits. If intB is
  13556.                                             less than zero, shift intA
  13557.                                             logically right by intB bits.»
  13558.  
  13559.  «Arithmetic shift»                         «If intB is greater than or equal
  13560.                                             to zero, shift intA
  13561.                                             arithmetically left by intB bits.
  13562.                                             If intB is less than zero, shift
  13563.                                             intA arithmetically right by intB
  13564.                                             bits.»
  13565.  
  13566.  «Rotate»                                   «If intB is greater than or equal
  13567.                                             to zero, rotate intA left intB
  13568.                                             bits. If intB is less than zero,
  13569.                                             rotate intA right intB bits.»
  13570.  
  13571.  «Exclusive or»                             «If the nth bits of the first and
  13572.                                             second arguments are not equal to
  13573.                                             each other, then the nth bit of
  13574.                                             the result is set to 1.
  13575.                                             Otherwise, the nth bit of the
  13576.                                             result is set to 0.»
  13577.  
  13578.  «Logical product»                          «If the nth bits of both the
  13579.                                             first and second arguments are 1,
  13580.                                             then the nth bit of the result is
  13581.                                             set to 1. Otherwise, the nth bit
  13582.                                             of the result is set to 0.»
  13583.  
  13584.  «Logical complement»                       «If the nth bit of the argument
  13585.                                             is 1, then the nth bit of the
  13586.                                             result is set to 0. Otherwise,
  13587.                                             the nth bit of the result is set
  13588.                                             to 1.»
  13589.  
  13590.  «Bit clear»                                «Clear intB bit in intA.»
  13591.  
  13592.  «Bit set»                                  «Set intB bit in intA.»
  13593.  
  13594.  «Bit change»                               «Reverse value of intB bit in
  13595.                                             intA.»
  13596.  
  13597.  «Bit test»                                 «Return .TRUE. if bit intB in
  13598.                                             intA is set to 1. Return .FALSE.
  13599.                                             otherwise.»
  13600.  
  13601.  
  13602.  «Examples»
  13603.  
  13604.  «The following three examples show the results of three bit-manipulation
  13605.  intrinsic functions:»
  13606.  
  13607.  «Function                                       Binary Representation»
  13608.  
  13609.  «IOR(240,90) = 250»                                          «11110000»
  13610.                                             «IOR»             «01011010»
  13611.                                                               «────────»
  13612.                                                               «11111010»
  13613.  
  13614.  «IEOR(240,90) = 170»                                         «11110000»
  13615.                                             «IEOR»            «01011010»
  13616.                                                               «────────»
  13617.                                                               «10101010»
  13618.  
  13619.  «IAND(240,90) = 80»                                          «11110000»
  13620.                                             «IAND»            «01011010»
  13621.                                                               «────────»
  13622.                                                               «01010000»
  13623.  
  13624.  «Table 5.19 shows the results of other bit-manipulation intrinsic
  13625.  functions.»
  13626.  
  13627.  «Table 5.19    Bit-Manipulation Examples»
  13628.  
  13629.  «Function Reference      IntA                  Result»
  13630.  «ISHFT(IntA,2)           10010000 11000101     01000011 00010100»
  13631.  «ISHFT(IntA,-2)          10010000 11000101     00100100 00110001»
  13632.  «ISHA(IntA,3)            10000000 11011000     00000110 11000000»
  13633.  «ISHA(IntA,-3)           10000000 11011000     11110000 00011011»
  13634.  «ISHC(IntA,3)            01110000 00000100     10000000 00100011»
  13635.  «ISHC(IntA,-3)           01110000 00000100     10001110 00000000»
  13636.  «NOT(IntA)               00011100 01111000     11100011 10000111»
  13637.  «IBCLR(IntA,4)           00011100 01111000     00011100 01101000»
  13638.  «IBSET(IntA,14)          00011100 01111000     01011100 01111000»
  13639.  «IBCHNG(IntA,5)          00011100 01111000     00011100 01011000»
  13640.  «BTEST(IntA,2)           00011100 01111000     .FALSE.»
  13641.  «BTEST(IntA,3)           00011100 01111000     .TRUE.»
  13642.  
  13643.  
  13644.  5.2  Alphabetical Function List
  13645.  
  13646.  What follows in Table 5.20 is an alphabetical listing of all intrinsic
  13647.  functions in Microsoft FORTRAN. See Table 5.1 for a list of the
  13648.  abbreviations used for data types.
  13649.  
  13650.  Table 5.20  Intrinsic Functions
  13651.  
  13652.                                                          Argument          Fun
  13653.  Name                                  Definition        Type              Typ
  13654.  
  13655.  ABS (gen)                             Absolute          int, real, or     Sam
  13656.                                        value             cmp               typ
  13657.                                                                            arg
  13658.                                                                            cmp
  13659.  
  13660.  ACOS (real)                           Arc cosine        real              Sam
  13661.                                                                            arg
  13662.  
  13663.  AIMAG (cmp8)                          Imaginary         cmp8              rea
  13664.                                        part of cmp8
  13665.                                        number
  13666.  
  13667.  AINT (real)                           Truncate          real              Sam
  13668.                                                                            arg
  13669.  
  13670.  «ALLOCATED (array)»                   «Allocation       «Any»             «lo
  13671.                                        status of
  13672.                                        array»
  13673.  
  13674.  ALOG (real4)                          Natural           real4             rea
  13675.                                        logarithm
  13676.  
  13677.  ALOG10 (real4)                        Common            real4             rea
  13678.                                        logarithm
  13679.  
  13680.  AMAX0 (intA, intB«, intC»...)         Maximum           int               rea
  13681.  
  13682.  AMAX1 (real4A, real4B«, real4C»...)   Maximum           real4             rea
  13683.  
  13684.  AMIN0 (intA, intB«, intC»...)         Minimum           int               rea
  13685.  
  13686.  AMIN1 (real4A, real4B«, real4C»...)   Minimum           real4             rea
  13687.  
  13688.  AMOD (real4A, real4B)                 Remainder         real4             rea
  13689.  
  13690.  ANINT (real)                          Round             real              Sam
  13691.                                                                            arg
  13692.  
  13693.  ASIN (real)                           Arc sine          real              Sam
  13694.                                                                            arg
  13695.  
  13696.  ATAN (real)                           Arc tangent       real              Sam
  13697.                                                                            arg
  13698.  
  13699.  ATAN2 (realA, realB)                  Arc tangent       real              Sam
  13700.                                        (realA/realB)                       arg
  13701.  
  13702.  «BTEST (intA,intB)»                   «Bit test»        «int»             «lo
  13703.  
  13704.  CABS (cmp)                            Absolute          cmp               rea
  13705.                                        value
  13706.  
  13707.  CCOS (cmp8)                           Cosine            cmp8              cmp
  13708.  
  13709.  «CDABS (cmp16)»                       «Absolute         «cmp16»           «db
  13710.                                        value»
  13711.  
  13712.  «CDCOS (cmp16)»                       «Cosine»          «cmp16»           «cm
  13713.  
  13714.  «CDEXP (cmp16)»                       «Exponent»        «cmp16»           «cm
  13715.  
  13716.  «CDLOG (cmp16)»                       «Natural          «cmp16»           «cm
  13717.                                        logarithm»
  13718.  
  13719.  «CDSIN (cmp16)»                       «Sine»            «cmp16»           «cm
  13720.  
  13721.  «CDSQRT (cmp16)»                      «Square           «cmp16»           «cm
  13722.                                        root»
  13723.  
  13724.  CEXP (cmp8)                           Exponent          cmp8              cmp
  13725.  
  13726.  CHAR (int)                            Data-type         int               cha
  13727.                                        conversion
  13728.  
  13729.  CLOG (cmp8)                           Natural           cmp8              cmp
  13730.                                        logarithm
  13731.  
  13732.  CMPLX (genA«, genB»)                  Data-type         int, real, or     cmp
  13733.                                        conversion        cmp
  13734.  
  13735.  CONJG (cmp8)                          Conjugate of      cmp8              cmp
  13736.                                        cmp8 number
  13737.  
  13738.  COS (gen)                             Cosine            real or cmp       Sam
  13739.                                                                            arg
  13740.  
  13741.  COSH (real)                           Hyperbolic        real              Sam
  13742.                                        cosine                              arg
  13743.  
  13744.  «COTAN (real)»                        «Cotangent»       «real»            «Sa
  13745.                                                                            arg
  13746.  
  13747.  CSIN (cmp8)                           Sine              cmp8              cmp
  13748.  
  13749.  CSQRT (cmp8)                          Square root       cmp8              cmp
  13750.  
  13751.  DABS (dbl)                            Absolute          dbl               dbl
  13752.                                        value
  13753.  
  13754.  DACOS (dbl)                           Arc cosine        dbl               dbl
  13755.  
  13756.  DASIN (dbl)                           Arc sine          dbl               dbl
  13757.  
  13758.  DATAN (dbl)                           Arc tangent       dbl               dbl
  13759.  
  13760.  DATAN2 (dblA, dblB)                   Arc tangent       dbl               dbl
  13761.                                        (dblA/dblB)
  13762.  
  13763.  DBLE (gen)                            Data-type         int, real, or     dbl
  13764.                                        conversion        cmp
  13765.  
  13766.  «DCMPLX (genA«, genB»)»               «Data-type        «int, real,       «cm
  13767.                                        conversion»       or cmp»
  13768.  
  13769.  «DCONJG (cmp16)»                      «Conjugate of     «cmp16»           «cm
  13770.                                        cmp16
  13771.                                        number»
  13772.  
  13773.  DCOS (dbl)                            Cosine            dbl               dbl
  13774.  
  13775.  DCOSH (dbl)                           Hyperbolic        dbl               dbl
  13776.                                        cosine
  13777.  
  13778.  DCOTAN (dbl)                          Cotangent         dbl               dbl
  13779.  
  13780.  DDIM (dblA, dblB)                     Positive          dbl               dbl
  13781.                                        difference
  13782.  
  13783.  DEXP (dbl)                            Exponent          dbl               dbl
  13784.  
  13785.  «DFLOAT (gen)»                        «Data-type        «int, real,       «db
  13786.                                        conversion»       or cmp»
  13787.  
  13788.  DIM (genA, genB)                      Positive          int or real       Sam
  13789.                                        difference                          arg
  13790.  
  13791.  DIMAG (cmp16)                         Imaginary         cmp16             dbl
  13792.                                        part of cmp16
  13793.                                        number
  13794.  
  13795.  DINT (dbl)                            Truncate          dbl               dbl
  13796.  
  13797.  DLOG (dbl)                            Natural           dbl               dbl
  13798.                                        logarithm
  13799.  
  13800.  DLOG10 (dbl)                          Common            dbl               dbl
  13801.                                        logarithm
  13802.  
  13803.  DMAX1 (dblA, dblB«, dblC»...)         Maximum           dbl               dbl
  13804.  
  13805.  DMIN1 (dblA, dblB«, dblC»...)         Minimum           dbl               dbl
  13806.  
  13807.  DMOD (dblA, dblB)                     Remainder         dbl               dbl
  13808.  
  13809.  DNINT (dbl)                           Round             dbl               dbl
  13810.  
  13811.  DPROD (real4A, real4B)                Double-           real4             dbl
  13812.                                        precision
  13813.                                        product
  13814.  
  13815.  «DREAL (cmp16)»                       «Data-type        «cmp16»           «db
  13816.                                        conversion»
  13817.  
  13818.  DSIGN (dblA, dblB)                    Sign transfer     dbl               dbl
  13819.  
  13820.  DSIN (dbl)                            Sine              dbl               dbl
  13821.  
  13822.  DSINH (dbl)                           Hyperbolic        dbl               dbl
  13823.                                        sine
  13824.  
  13825.  DSQRT (dbl)                           Square root       dbl               dbl
  13826.  
  13827.  DTAN (dbl)                            Tangent           dbl               dbl
  13828.  
  13829.  DTANH (dbl)                           Hyperbolic        dbl               dbl
  13830.                                        tangent
  13831.  
  13832.  «EOF (int)»                           «End-of-file»     «int»             «lo
  13833.  
  13834.  «EPSILON (gen)»                       «Smallest         «real»            «re
  13835.                                        increment
  13836.                                        over 1»
  13837.  
  13838.  EXP (gen)                             Exponent          real or cmp       Sam
  13839.                                                                            arg
  13840.  
  13841.  FLOAT (int)                           Data-type         int               rea
  13842.                                        conversion
  13843.  
  13844.  «HFIX (gen)»                          «Data-type        «int, real,       «in
  13845.                                        conversion»       or cmp»
  13846.  
  13847.  «HUGE (gen)»                          «Largest          «int or real      «Sa
  13848.                                        positive                            arg
  13849.                                        number»
  13850.  
  13851.  IABS (int)                            Absolute          int               int
  13852.                                        value
  13853.  
  13854.  «IAND (intA, intB)»                   «Logical          «int»             «Sa
  13855.                                        product»                            arg
  13856.  
  13857.  «IBCHNG (intA, intB)»                 «Bit change»      «int»             «Sa
  13858.                                                                            arg
  13859.  
  13860.  «IBCLR (intA, intB)»                  «Bit clear»       «int»             «Sa
  13861.                                                                            arg
  13862.  
  13863.  «IBSET (intA, intB)»                  «Bit set»         «int»             «Sa
  13864.                                                                            arg
  13865.  
  13866.  ICHAR (char                           Data-type         char              int
  13867.                                        conversion
  13868.  
  13869.  IDIM (intA, intB)                     Positive          int               int
  13870.                                        difference
  13871.  
  13872.  IDINT (dbl)                           Data-type         dbl               int
  13873.                                        conversion
  13874.  
  13875.  IDNINT (dbl)                          Round             dbl               int
  13876.  
  13877.  «IEOR (intA, intB)»                   «Exclusive        «int»             «Sa
  13878.                                        or»                                 arg
  13879.  
  13880.  IFIX (real4)                          Data-type         real4             int
  13881.                                        conversion
  13882.  
  13883.  «IMAG (cmp)»                          «Imaginary        «cmp»             «re
  13884.                                        part of cmp
  13885.                                        number»
  13886.  
  13887.  INDEX (charA, charB ««, log»»)        Location of       char, «log»       int
  13888.                                        substring
  13889.                                        charB in
  13890.                                        string charA
  13891.  
  13892.  «INT (gen)»                           «Data-type        «int, real,       «in
  13893.                                        conversion»       or cmp»
  13894.  
  13895.  «INT1 (gen)»                          «Data-type        «int, real,       «in
  13896.                                        conversion»       or cmp»
  13897.  
  13898.  «INT2 (gen)»                          «Data-type        «int, real,       «in
  13899.                                        conversion»       or cmp»
  13900.  
  13901.  «INT4 (gen)»                          «Data-type        «int, real,       «in
  13902.                                        conversion»       or cmp»
  13903.  
  13904.  «INTC (gen)»                          «Data-type       «int, real,        «IN
  13905.                                        conversion»       or cmp»
  13906.  
  13907.  «IOR (intA, intB)»                    «Inclusive or»    «int»             «Sa
  13908.                                                                            arg
  13909.  
  13910.  «ISHA (intA, intB)»                   «Arithmetic       «int»             «Sa
  13911.                                        shift»                              arg
  13912.  
  13913.  «ISHC (intA, intB)»                   «Rotate»          «int»             «Sa
  13914.                                                                            arg
  13915.  
  13916.  «ISHFT (intA, intB)»                  «Logical          «int»             «Sa
  13917.                                        shift»                              arg
  13918.  
  13919.  «ISHL (intA, intB)»                   «Logical          «int»             «Sa
  13920.                                        shift»                              arg
  13921.  
  13922.  ISIGN (intA, intB)                    Sign transfer     int               int
  13923.  
  13924.  «JFIX (gen)»                          «Data-type        «int, real,       «in
  13925.                                        conversion»       or cmp»
  13926.  
  13927.  LEN (char)                            Length of         char              int
  13928.                                        string
  13929.  
  13930.  «LEN_TRIM (char)»                     «Length of        «char»            «in
  13931.                                        string,
  13932.                                        excluding
  13933.                                        trailing
  13934.                                        blanks»
  13935.  
  13936.  LGE (charA, charB)                    charA>=charB      char              log
  13937.  
  13938.  LGT (charA, charB)                    charA>charB       char              log
  13939.  
  13940.  LLE (charA, charB)                    charA<=charB      char              log
  13941.  
  13942.  LLT (charA, charB)                    charA<charB       char              log
  13943.  
  13944.  «LOC (gen)»                           «Address»         «Any»             «in
  13945.  
  13946.  «LOCFAR (gen)»                        «Segmented        «Any»             «in
  13947.                                        address»
  13948.  
  13949.  «LOCNEAR (gen)»                       «Unsegmented      «Any»             «in
  13950.                                        address»
  13951.  
  13952.  LOG (gen)                             Natural           real or cmp       Sam
  13953.                                        logarithm                           arg
  13954.  
  13955.  LOG10 (real)                          Common            real              Sam
  13956.                                        logarithm                           arg
  13957.  
  13958.  MAX (genA, genB«, genC»...)           Maximum           int or real       Sam
  13959.                                                                            arg
  13960.  
  13961.  MAX0 (intA, intB«, intC»...)          Maximum           int               int
  13962.  
  13963.  MAX1 (real4A, real4B«, real4C»...)    Maximum           real4             int
  13964.  
  13965.  «MAXEXPONENT (real)»                  «Largest          «real»            «re
  13966.                                        positive
  13967.                                        exponent of
  13968.                                        data type»
  13969.  
  13970.  MIN (genA, genB«, genC»...)           Minimum           int or real       Sam
  13971.                                                                            arg
  13972.  
  13973.  MIN0 (intA, intB«, intC»...)          Minimum           int               int
  13974.  
  13975.  MIN1 (real4A, real4B«, real4C»...)    Minimum           real4             int
  13976.  
  13977.  «MINEXPONENT (real)»                  «Largest          «real»            «re
  13978.                                        negative
  13979.                                        exponent of
  13980.                                        data type»
  13981.  
  13982.  MOD (genA, genB)                      Remainder         int or real       Sam
  13983.                                                                            arg
  13984.  
  13985.  «NEAREST (real, director)»            «Nearest          «real»            «re
  13986.                                        value in
  13987.                                        direction of
  13988.                                        sign of
  13989.                                        director»
  13990.  
  13991.  NINT (real)                           Round             real              int
  13992.  
  13993.  «NOT (intA)»                          «Logical          «int»             «Sa
  13994.                                        complement»                         arg
  13995.  
  13996.  «PRECISION (gen)»                     «Number of        «real»            «re
  13997.                                        significant
  13998.                                        digits for
  13999.                                        data type»
  14000.  
  14001.  REAL (gen)                            Data-type         int, real, or     rea
  14002.                                        conversion        cmp
  14003.  
  14004.  «SCAN (charA, charB «,log»)»         «Position of       «char and         «in
  14005.                                        first             log»
  14006.                                        occurrence of
  14007.                                        character
  14008.                                        from charB in
  14009.                                        charA»
  14010.  
  14011.  SIGN (genA, genB)                     Sign transfer     int or real       Sam
  14012.                                                                            arg
  14013.  
  14014.  SIN (gen)                             Sine              real or cmp       Sam
  14015.                                                                            arg
  14016.  
  14017.  SINH (real)                           Hyperbolic        real              Sam
  14018.                                        sine                                arg
  14019.  
  14020.  SNGL (dbl)                            Data-type         dbl               rea
  14021.                                        conversion
  14022.  
  14023.  SQRT (gen)                            Square root       real or cmp       Sam
  14024.                                                                            arg
  14025.  
  14026.  TAN (real)                            Tangent           real              Sam
  14027.                                                                            arg
  14028.  
  14029.  TANH (real)                           Hyperbolic        real              Sam
  14030.                                        tangent                             arg
  14031.  
  14032.  «TINY (real)»                         «Returns          «real»            «re
  14033.                                        small-
  14034.                                        est positive
  14035.                                        number > 0
  14036.                                        for data
  14037.                                        type»
  14038.  
  14039.  «VERIFY (charA, charB «,log»)»        «Position of      «char and         «in
  14040.                                        first             log»
  14041.                                        occurrence of
  14042.                                        character not
  14043.                                        from charB in
  14044.                                        charA»
  14045.  
  14046.  
  14047.  5.3  Additional Procedures
  14048.  
  14049.  Microsoft FORTRAN contains additional procedures that control and access
  14050.  system time and date, get and reset run-time error-code information, return
  14051.  command-line arguments, and generate pseudorandom numbers. The following
  14052.  sections describe these procedures.
  14053.  
  14054.  These procedures are included in the FORTRAN run-time library, and are
  14055.  automatically linked to your program if called. However, they are not
  14056.  intrinsic functions. You may write other functions that appropriate these
  14057.  functions' names without having to reference the names in an EXTERNAL
  14058.  statement. Your own functions will be linked instead, as long as LINK
  14059.  references their object code before calling the FORTRAN library.
  14060.  
  14061.  ───────────────────────────────────────────────────────────────────────────
  14062.  NOTE
  14063.     Microsoft FORTRAN Advanced Topics discusses other functions in the
  14064.     FORTRAN libraries, including the C spawnlp and system functions (Chapter
  14065.     4), graphics and full-screen text functions (Chapters 8-11), and OS/2
  14066.     thread control functions (Chapter 3).
  14067.  ───────────────────────────────────────────────────────────────────────────
  14068.  
  14069.  
  14070.  5.3.1  Time and Date Procedures
  14071.  
  14072.  The functions SETTIM and SETDAT, and the subroutines GETTIM and GETDAT,
  14073.  allow you to use the system time and date in your programs. SETTIM and
  14074.  SETDAT set the system time and date; GETTIM and GETDAT return the time and
  14075.  date. Table 5.21 summarizes the time and date procedures.
  14076.  
  14077.  Table 5.21  Time and Date Procedures
  14078.  
  14079.                                                            Argument      Funct
  14080.  Name                                 Definition           Type          Type
  14081.  GETTIM (ihr, imin, isec, i100th)     Gets system time     INTEGER*2
  14082.  SETTIM (ihr, imin, isec, i100th)     Sets system time     INTEGER*2     LOGIC
  14083.  GETDAT (iyr, imon, iday)             Gets system date     INTEGER*2
  14084.  SETDAT (iyr, imon, iday)             Sets system date     INTEGER*2     LOGIC
  14085.  
  14086.  The arguments are defined as follows:
  14087.  
  14088.  Argument                                   Definition
  14089.  
  14090.  ihr                                        Hour (0-23)
  14091.  
  14092.  imin                                       Minute (0-59)
  14093.  
  14094.  isec                                       Second (0-59)
  14095.  
  14096.  i100th                                     Hundredth of a second (0-99)
  14097.  
  14098.  iyr                                        Year (xxxx AD)
  14099.  
  14100.  imon                                       Month (1-12)
  14101.  
  14102.  iday                                       Day of the month (1-31)
  14103.  
  14104.  Actual arguments used in calling GETTIM and GETDAT must be INTEGER*2
  14105.  variables, array elements, or structure elements. Because these subroutines
  14106.  redefine the values of their arguments, other kinds of expressions are
  14107.  prohibited.
  14108.  
  14109.  Actual arguments of the functions SETTIM and SETDAT can be any legal
  14110.  INTEGER*2 expression. SETTIM and SETDAT return .TRUE. if the system time or
  14111.  date is changed, or .FALSE. if no change is made.
  14112.  
  14113.  Refer to your operating system documentation for the range of permitted
  14114.  dates.
  14115.  
  14116.  
  14117.  Example
  14118.  
  14119.  The following program sets the date and time, then prints them on the
  14120.  screen:
  14121.  
  14122.       C     Warning: this program will reset
  14123.       C     your system date and time.
  14124.  
  14125.       $STORAGE:2
  14126.             CHARACTER*12  cdate, ctime
  14127.             LOGICAL  SETDAT, SETTIM
  14128.             DATA cdate / 'The date is ' /
  14129.             DATA ctime / 'The time is ' /
  14130.             IF (.NOT. (SETDAT (2001, 7, 4)))
  14131.            +     WRITE (*, *) 'SETDAT failed'
  14132.       C     sets the date to July 4th, 2001:
  14133.             IF (.NOT. (SETTIM (0, 0, 0, 0)))
  14134.            +     WRITE (*, *) 'SETTIM failed'
  14135.       C     sets the time to 00:00:00.00 (midnight)
  14136.             CALL GETDAT (iyr, imon, iday)
  14137.       C     gets the date from the system clock
  14138.             CALL GETTIM (ihr, imin, isec, i100th)
  14139.       C     gets the time of day from the system clock
  14140.             cdate, imon, iday, iyr
  14141.       C     writes the date
  14142.             WRITE (*, '(1X, A, I2.2, 1H:, I2.2, 1H:, I2.2, 1H.,
  14143.            +I2.2)') ctime, ihr, imin, isec, i100th
  14144.       C     writes the time in the format xx:xx:xx.xx
  14145.             END
  14146.  
  14147.  
  14148.  5.3.2  Run-Time-Error Procedures
  14149.  
  14150.  The IGETER function and the ICLRER subroutine are included for compatibility
  14151.  with previous versions of FORTRAN. Their functionality is provided in the
  14152.  current version by the IOSTAT= option. (See Section 3.2.6, "Error and
  14153.  End-of-File Handling," for more information about IOSTAT=.)
  14154.  
  14155.  IGETER is called after an I/O operation that includes the ERR= or IOSTAT=
  14156.  options. The significance of the value returned is explained in the
  14157.  following list:
  14158.  
  14159.  Return Value                               Description
  14160.  
  14161.  0                                          No error occurred.
  14162.  
  14163.  Negative value                             An end-of-file condition
  14164.                                             occurred, but no other error
  14165.                                             occurred.
  14166.  
  14167.  Positive value                             An error occurred. The return
  14168.                                             value is the error number.
  14169.  
  14170.  The IGETER calling interface has the following form:
  14171.  
  14172.             INTEGER*2 FUNCTION IGETER (iunit)
  14173.             INTEGER*2 iunit
  14174.             .
  14175.             .
  14176.             .
  14177.             END
  14178.  
  14179.  ICLRER resets the FORTRAN run-time-error code information after an error has
  14180.  been encountered and handled through ERR= and IOSTAT=. The ICLRER calling
  14181.  interface takes the following form:
  14182.  
  14183.             SUBROUTINE ICLRER (iunit)
  14184.             INTEGER*2 iunit
  14185.             .
  14186.             .
  14187.             .
  14188.             END
  14189.  
  14190.  
  14191.  5.3.3  Command-Line-Argument Procedures
  14192.  
  14193.  The NARGS function returns the total number of command-line arguments,
  14194.  including the command. The GETARG subroutine returns the nth command-line
  14195.  argument (where the command itself is argument number zero). The syntax of
  14196.  these procedures is shown below:
  14197.  
  14198.       numargs = NARGS ( )
  14199.       CALL GETARG (n, buffer, status)
  14200.  
  14201.  The NARGS function takes no arguments. It always returns an INTEGER*4 value,
  14202.  regardless of the $STORAGE setting.
  14203.  
  14204.  The GETARG subroutine takes three arguments. The first, of INTEGER*2 type,
  14205.  specifies the position of the desired argument. (The command itself is
  14206.  argument zero.)
  14207.  
  14208.  The buffer argument is a CHARACTER variable that returns the desired
  14209.  command-line argument. If the argument is shorter than buffer, GETARG pads
  14210.  buffer on the right with blanks. If the argument is longer than buffer,
  14211.  GETARG truncates the argument.
  14212.  
  14213.  The status argument is an INTEGER*2 type that returns a status value on
  14214.  completion. If there were no errors, status returns the number of characters
  14215.  in the command-line argument before truncation or blank-padding. (That is,
  14216.  status is the original number of characters in the command-line argument.)
  14217.  Errors include specifying an argument position less than zero or greater
  14218.  than the value returned by NARGS. For either of these errors, status returns
  14219.  a value of -1.
  14220.  
  14221.  The status argument is an INTEGER*2 type which returns a status value.
  14222.  
  14223.  If there were no errors, status contains the number of characters in the
  14224.  command-line argument before truncation or blank-padding. (That is, status
  14225.  is the original number of characters in the command-line argument.) Errors
  14226.  include passing a status less than one, or specifying an argument position
  14227.  less than zero or greater than the value returned by NARGS. For any of these
  14228.  errors, status returns a value of -1.
  14229.  
  14230.  
  14231.  Example
  14232.  
  14233.  Assume a command-line invocation of ANOVA -g -c -a, and that buffer is at
  14234.  least five characters long. The following GETARG statements return the
  14235.  corresponding arguments in the buffer:
  14236.  
  14237.  String                                     Length
  14238.  Statement                                  Returned          Returned
  14239.  
  14240.  CALL GETARG (0, buffer, status)            ANOVA             5
  14241.  
  14242.  CALL GETARG (1, buffer, status)            -g                2
  14243.  
  14244.  CALL GETARG (2, buffer, status)            -c                2
  14245.  
  14246.  CALL GETARG (3, buffer, status)            -a                2
  14247.  
  14248.  CALL GETARG (4, buffer, status)            undefined        -1
  14249.  
  14250.  
  14251.  5.3.4  Random Number Procedures
  14252.  
  14253.  The RANDOM subroutine returns a pseudorandom real value greater than or
  14254.  equal to zero and less than one. The SEED subroutine changes the starting
  14255.  point of the pseudorandom number generator. The syntax of these procedures
  14256.  is shown below:
  14257.  
  14258.       CALL RANDOM (ranval)
  14259.       CALL SEED (seedval)
  14260.  
  14261.  The RANDOM subroutine takes a single REAL*4 argument through which the
  14262.  random value is returned.
  14263.  
  14264.  The SEED subroutine takes a single INTEGER*2 argument. SEED uses this value
  14265.  to establish the starting point of the pseudorandom number generator. A
  14266.  given seed always produces the same sequence of values from RANDOM.
  14267.  
  14268.  If SEED is not called before the first call to RANDOM, RANDOM always begins
  14269.  with a seed value of one. If a program must have a different pseudorandom
  14270.  sequence each time it runs, use the GETTIM procedure to pick a seed value
  14271.  (the hundredth-of-a-second parameter is a good choice because it changes so
  14272.  rapidly).
  14273.  
  14274.  
  14275.  ───────────────────────────────────────────────────────────────────────────
  14276.  Part 2  Compiling and Linking
  14277.  
  14278.  The two chapters in this section provide information on using metacommands
  14279.  for compiler control and on using the FL command for compiling and linking.
  14280.  
  14281.  Chapter 6, which describes metacommands, includes overview material as well
  14282.  as an alphabetical metacommand directory. Chapter 7 shows how to use FL to
  14283.  compile and link FORTRAN programs in a single step. This chapter includes
  14284.  detailed information on available FL options.
  14285.  
  14286.  
  14287.  «Chapter 6  Metacommands»
  14288.  
  14289.  ───────────────────────────────────────────────────────────────────────────
  14290.  
  14291.  The first part of this chapter lists all Microsoft FORTRAN metacommands. The
  14292.  second part explains how the conditional-compilation metacommands are used
  14293.  to control which sections of your program are compiled. The third part is a
  14294.  directory of metacommands, arranged alphabetically.
  14295.  
  14296.  Metacommands tell the Microsoft FORTRAN Compiler how you want the source
  14297.  code compiled. Note that some command-line options, as described in
  14298.  Microsoft FORTRAN Advanced Topics, duplicate metacommand functions. If there
  14299.  is a conflict between a metacommand and a command-line switch, the
  14300.  metacommand takes precedence.
  14301.  
  14302.  Table 6.1 summarizes the Microsoft FORTRAN metacommands. Although some
  14303.  metacommands (such as $DO66 or $FREEFORM) can be used only once in a
  14304.  program, many can appear anywhere in the source code. This flexibility
  14305.  permits specific compilation features (such as loop optimization) to be
  14306.  enabled or disabled as desired.
  14307.  
  14308.  Table 6.1  Metacommands
  14309.  
  14310.  Metacommand             Instructions to Compiler                     Default
  14311.  
  14312.  $DEBUG«:string»         Turns on run-time checking for integer       $NODEBUG
  14313.                          arithmetic operations, assigned GOTO
  14314.                          values, subscript bounds, substrings,
  14315.                          and CASE selection. $NODEBUG turns off
  14316.                          checking. $DEBUG does not trigger or
  14317.                          suppress floating-point exceptions. $DEBUG
  14318.                          can also be used for conditional
  14319.                          compilation.
  14320.  
  14321.  $DECLARE                Generates warning messages for               $NODECLA
  14322.                          undeclared variables. $NODECLARE turns
  14323.                          off these messages.
  14324.  
  14325.  $DEFINE symbol-name     Creates (and optionally assigns a value      $UNDEFIN
  14326.  «= val»                 to) a variable whose existence may be
  14327.                          tested during conditional compilation.
  14328.                          $UNDEFINE removes a symbolic variable
  14329.                          name.
  14330.  
  14331.  $DO66                   Uses FORTRAN 66 semantics for DO             $DO66 no
  14332.                          statements.
  14333.  
  14334.  $ELSE                   Marks the beginning of a conditional         None
  14335.                          compilation block that is compiled if
  14336.                          the logical condition in the matching
  14337.                          $IF metacommand is .FALSE..
  14338.  
  14339.  $ELSEIF expr            Marks the beginning of a new conditional     None
  14340.                          compilation block that is compiled if
  14341.                          the logical condition in the matching
  14342.                          $IF metacommand is .FALSE. and expr is
  14343.                          .TRUE..
  14344.  
  14345.  $ENDIF                  Terminates $IF, $IF...$ELSE, or              None
  14346.                          $IF...$ELSEIF conditional compilation
  14347.                          blocks.
  14348.  
  14349.  $FLOATCALLS             Generates calls to subroutines in the        $NOFLOAT
  14350.                          emulator library. $NOFLOATCALLS causes
  14351.                          the compiler to generate in-line
  14352.                          interrupt
  14353.                          instructions.
  14354.  
  14355.  $FREEFORM               Uses free-form format for source code.       $NOFREEF
  14356.                          $NOFREEFORM uses fixed format.
  14357.  
  14358.  $IF expr                Marks the beginning of a conditional         None
  14359.                          compilation block. The succeeding
  14360.                          statements are compiled if the
  14361.                          conditional expression is .TRUE..
  14362.  
  14363.  $INCLUDE:'file'         Proceeds as if the contents of file were     None
  14364.                          inserted at this point in the current
  14365.                          source file.
  14366.  
  14367.  $LARGE«:name            Addresses the named array outside of the     None
  14368.  «, name»»...            DGROUP segment. $NOTLARGE disables
  14369.                          $LARGE for the named array. If name is
  14370.                          omitted, these metacommands affect all
  14371.                          arrays.
  14372.  
  14373.  $LINESIZE:n             Makes subsequent pages of listing n          $LINESIZ
  14374.                          columns wide. Minimum n equals 40;
  14375.                          maximum n equals 132.
  14376.  
  14377.  $LIST                   Begins generation of listing information     $LIST
  14378.  
  14379.                          that is sent to the listing file.
  14380.                          $NOLIST suppresses generation of listing
  14381.                          information.
  14382.  
  14383.  $LOOPOPT                $LOOPOPT optimizes loops in following        $LOOPOPT
  14384.                          code. $NOLOOPOPT disables loop
  14385.                          optimization.
  14386.  
  14387.  $MESSAGE:string         Sends a character string to the standard     None
  14388.                          output device.
  14389.  
  14390.  $PACK:n                 Sets number of bytes for packing width.      $PACK:2
  14391.                          n must be 1, 2, or 4.
  14392.  
  14393.  $PAGE                   Starts new page of listing.                  None
  14394.  
  14395.  $PAGESIZE:n             Makes subsequent pages of listing n          $PAGESIZ
  14396.                          lines long. Minimum n equals 15.
  14397.  
  14398.  $STORAGE:n              Allocates n bytes of memory (2 or 4) to      $STORAGE
  14399.                          all LOGICAL or INTEGER variables.
  14400.  
  14401.  $STRICT                 Disables Microsoft FORTRAN features          $NOTSTRI
  14402.                          not in 1977 full-language standard.
  14403.                          $NOTSTRICT enables them.
  14404.  
  14405.  $SUBTITLE:subtitle      Uses subtitle subtitle for subsequent        $SUBTITL
  14406.                          pages of listing.                            1
  14407.  
  14408.  $TITLE:title            Uses title title for subsequent pages of     $TITLE:'
  14409.                          listing.
  14410.  
  14411.  $TRUNCATE               Truncates variables to six characters.       $NOTRUNC
  14412.                          $NOTRUNCATE turns off truncation.
  14413.  
  14414.  
  14415.  Any line with a dollar sign ($) in column 1 is interpreted as a metacommand.
  14416.  A metacommand and its arguments (if any) must fit on a single source line;
  14417.  continuation lines are not permitted.
  14418.  
  14419.  
  14420.  6.1  Using Conditional-Compilation Metacommands
  14421.  
  14422.  In FORTRAN, the conditional-execution statements IF...THEN...ELSE, ELSE, and
  14423.  ELSE IF control the execution of statement blocks. In a similar fashion, the
  14424.  conditional-compilation metacommands control which sections of source code
  14425.  are compiled. These special metacommands make it easy to include or omit
  14426.  test code, customize code for specific applications by controlling which
  14427.  sections are included, or bypass incomplete code during development.
  14428.  
  14429.  Like all metacommands, conditional-compilation metacommands begin with a
  14430.  dollar sign and must start in column one. Otherwise, they look and work like
  14431.  their FORTRAN counterparts:
  14432.  
  14433.       $IF cond-expr
  14434.       $ELSE
  14435.       $ELSEIF cond-expr
  14436.       $ENDIF
  14437.  
  14438.  In conditional-compilation metacommands, conditional expressions
  14439.  (cond-exprs) can take several forms. The simplest is a FORTRAN logical
  14440.  value, .TRUE. or .FALSE..
  14441.  
  14442.       $IF .TRUE.
  14443.             WRITE (*, '('' This is compiled if .TRUE.'')')
  14444.       $ELSE
  14445.             WRITE (*, '('' This is compiled if .FALSE.'')')
  14446.       $ENDIF
  14447.  
  14448.  In the above example, the first block of code is compiled and the second is
  14449.  ignored. If .TRUE. were changed to .FALSE., the second block would be the
  14450.  only block compiled. However, the programmer must manually locate every
  14451.  .TRUE. or .FALSE. to be changed. An alternative is to create one or more
  14452.  symbolic names at the beginning of the program, using the $DEFINE
  14453.  metacommand:
  14454.  
  14455.  $DEFINE symbol-name
  14456.  
  14457.  The presence or absence of a particular definition is tested by using the
  14458.  DEFINED (symbol) conditional expression in the $IF metacommand. DEFINED
  14459.  (symbol) is .TRUE. if symbol appeared in a previous $DEFINE metacommand,
  14460.  without having been assigned a value. The advantage of this arrangement is
  14461.  the way the programmer can alter the meaning of a symbol throughout the
  14462.  program simply by adding or deleting a single metacommand. It is simpler and
  14463.  more reliable than changing every .TRUE. to .FALSE..
  14464.  
  14465.  For example, once the $DEFINE logicvar metacommand appears in a program, any
  14466.  subsequent $IF DEFINED (logicvar) metacommand evaluates to .TRUE.. If
  14467.  $DEFINE logicvar has not appeared, $IF DEFINED (logicvar) evaluates to
  14468.  .FALSE. as in the following examples:
  14469.  
  14470.       $DEFINE truthvar
  14471.  
  14472.       $IF DEFINED (truthvar)
  14473.             WRITE (*, '('' This is compiled if truthvar     DEFINED'')')
  14474.       $ELSE
  14475.             WRITE (*, '('' This is compiled if truthvar not DEFINED'')')
  14476.       $ENDIF
  14477.  
  14478.  Since the symbol truthvar appears in $DEFINE truthvar, DEFINED (truthvar)
  14479.  evaluates to .TRUE. and the first block of statements is compiled. If the
  14480.  $DEFINE truthvar metacommand were removed (or converted to a comment line),
  14481.  truthvar would not be defined, DEFINED (truthvar) would evaluate to .FALSE.,
  14482.  and the second block of statements would be compiled.
  14483.  
  14484.  The $UNDEFINE metacommand cancels a symbol definition. In the following
  14485.  example, the $UNDEFINE metacommand cancels truthvar, and DEFINED truthvar
  14486.  evaluates to .FALSE.. The compiler ignores the first statement block:
  14487.  
  14488.       $DEFINE truthvar
  14489.       $UNDEFINE truthvar
  14490.  
  14491.       $IF DEFINED (truthvar)
  14492.             WRITE (*, '('' This is compiled if truthvar     DEFINED'')')
  14493.       $ELSE
  14494.             WRITE (*, '('' This is compiled if truthvar not DEFINED'')')
  14495.       $ENDIF
  14496.  
  14497.  You may define as many symbolic names as you wish anywhere in the program.
  14498.  These symbols will not conflict with FORTRAN identifiers or variable names.
  14499.  You may use names like data, sin,  equivalence, or the name of an external
  14500.  procedure, if you wish.
  14501.  
  14502.  A $DEFINE metacommand can also give an integer value to a symbol name (any
  14503.  four-byte FORTRAN integer value is allowed):
  14504.  
  14505.       $DEFINE choice = 100000
  14506.  
  14507.       $IF choice .NE. 100000
  14508.             WRITE (*, '('' This is compiled if choice .NE. 100000'')')
  14509.       $ELSE
  14510.             WRITE (*, '('' This is compiled if choice .EQ. 100000'')')
  14511.       $ENDIF
  14512.  
  14513.  In the example above, choice .NE. 100000 evaluates to .FALSE., so the second
  14514.  statement block is compiled. (DEFINED (choice) would also evaluate to
  14515.  .FALSE., because choice was assigned a value.) This example also shows how a
  14516.  conditional expression can include any FORTRAN relational operator (.EQ.,
  14517.  .NE., .LT., .LE., .GT., or .GE.). The FORTRAN .NOT. operator can also be
  14518.  used:
  14519.  
  14520.       $DEFINE choice = 100000
  14521.       $DEFINE receiver = choice
  14522.  
  14523.       $IF .NOT. (receiver .NE. 100000)
  14524.             WRITE (*, '('' This is compiled if receiver .EQ. 100000'')')
  14525.       $ELSE
  14526.             WRITE (*, '('' This is compiled if receiver .NE. 100000'')')
  14527.       $ENDIF
  14528.  
  14529.  In the example above, the second $DEFINE metacommand gives the value of
  14530.  choice to receiver. (This assignment is not permitted unless choice has
  14531.  already been given an integer value.) The .NOT. operator reverses the
  14532.  logical value of receiver .NE. 100000, and the first statement block is
  14533.  compiled.
  14534.  
  14535.  The ability to assign integer variables to symbol names greatly increases
  14536.  the programmer's control over whether a statement block is compiled, as
  14537.  shown below:
  14538.  
  14539.       $DEFINE upper = 3
  14540.       $DEFINE lower = -1
  14541.  
  14542.       $IF upper .LT. 3
  14543.             WRITE (*, '('' Compiled if upper .LT. 3'')')
  14544.       $ELSEIF lower .GT. -2
  14545.             WRITE (*, '('' Compiled if upper .GE. 3 and lower .GT. -2'')')
  14546.       $ENDIF
  14547.  
  14548.  The FORTRAN conditional operators .AND. and .OR. can also be used in
  14549.  comparisons:
  14550.  
  14551.       $DEFINE upper
  14552.       $DEFINE lower = -1
  14553.  
  14554.       $IF (DEFINED (upper) .OR. (lower .LE. -2)) .AND. middle
  14555.             WRITE (*, '('' Compiled if all conditions met'')')
  14556.       $ENDIF
  14557.  
  14558.  In this example, upper is defined, but lower is not less than or equal to
  14559.  -2. However, the .OR. comparison is enclosed within parentheses, so the net
  14560.  evaluation of these two statements is .TRUE.. The symbol middle was not
  14561.  defined, so middle is .FALSE., making the full expression .FALSE. as well.
  14562.  The enclosed statement block is not compiled.
  14563.  
  14564.  Logical expressions may be as complex as desired, and may include
  14565.  parentheses wherever needed to clarify the logic or override precedence.
  14566.  (The rules of precedence and logical association are the same as in
  14567.  FORTRAN.) However, the expression must fit on one line.
  14568.  
  14569.  Comments may be added at the end of metacommand lines. Comments must begin
  14570.  with an exclamation point:
  14571.  
  14572.       $DEFINE test         ! controls compilation of test code
  14573.  
  14574.  Constantly editing a file to add or delete symbol declarations can be
  14575.  inconvenient. Therefore, you are also permitted to define symbols on the
  14576.  compiler command line using the /D command-line option. The option /Dsymbol
  14577.  defines symbol at the beginning of the compilation. (A subsequent $UNDEFINE
  14578.  metacommand within the program file can cancel the definition.) The option
  14579.  /Dsymbol=integer defines the symbol and gives it an integer value.
  14580.  
  14581.  Each /D option can define or assign only one symbol. However, several /D
  14582.  options can be included in one command line. The only real limit is the
  14583.  maximum length of a command line set by your operating system.
  14584.  
  14585.  
  14586.  6.2  Metacommand Directory
  14587.  
  14588.  The remainder of this chapter is an alphabetical directory of the Microsoft
  14589.  FORTRAN metacommands. Each metacommand is described using the following
  14590.  format:
  14591.  
  14592.  Heading                                    Information
  14593.  
  14594.  Action                                     Summary of what the metacommand
  14595.                                             does.
  14596.  
  14597.  Syntax                                     Correct syntax for the
  14598.                                             metacommand, and description of
  14599.                                             the metacommand's parameters.
  14600.  
  14601.  Remarks                                    Use of the metacommand.
  14602.  
  14603.  
  14604.  $DEBUG and $NODEBUG
  14605.  
  14606.  
  14607.  ■  Action
  14608.  
  14609.  $DEBUG directs the compiler to perform additional testing and expanded error
  14610.  handling, and can also be used for conditional compilation; $NODEBUG
  14611.  suppresses the additional testing and expanded error handling
  14612.  
  14613.  
  14614.  ■  Syntax
  14615.  
  14616.       $«NO»DEBUG«:string»
  14617.  
  14618.  
  14619.  ■  Remarks
  14620.  
  14621.  The default is $NODEBUG.
  14622.  
  14623.  These metacommands can appear anywhere in a program, enabling and disabling
  14624.  the debug features as desired.
  14625.  
  14626.  When $DEBUG is enabled, the compiler does the following:
  14627.  
  14628.    ■  Tests integer arithmetic for overflow.
  14629.  
  14630.    ■  Tests assigned GOTO values against the optional label list in an
  14631.       assigned GOTO statement.
  14632.  
  14633.    ■  Provides the run-time error-handling system with file names and line
  14634.       numbers. If run-time errors occur, the file name and line number are
  14635.       displayed on the console.
  14636.  
  14637.    ■  Checks range of subscripts and substrings.
  14638.  
  14639.    ■  Checks assignment range. This catches errors when larger integer
  14640.       variables are assigned to smaller integer variables, such as assigning
  14641.       an INTEGER*4 variable to an INTEGER*2 variable. If $DEBUG is not
  14642.       enabled, the variable is truncated, no error is reported, and the
  14643.       program returns unpredictable results. In the case of real numbers, an
  14644.       error is always reported.
  14645.  
  14646.    ■  Checks for a CASE DEFAULT statement. If there is no CASE DEFAULT in a
  14647.       SELECT CASE statement, and the value of the test expression does not
  14648.       match any value in any CASE expression list, program execution halts
  14649.       with an error message. (If you do not use $DEBUG, no error occurs, and
  14650.       execution passes beyond the SELECT CASE construct to the next
  14651.       executable statement.)
  14652.  
  14653.  ───────────────────────────────────────────────────────────────────────────
  14654.  NOTE
  14655.     $DEBUG has no effect on floating-point exception handling. See Microsoft
  14656.     FORTRAN Advanced Topics for information on exception handling on your
  14657.     system.
  14658.  ───────────────────────────────────────────────────────────────────────────
  14659.  
  14660.  This metacommand should be placed in each source file to be compiled.
  14661.  
  14662.  If the optional string is specified, the characters in string specify that
  14663.  lines with those characters in column 1 are to be compiled into the program.
  14664.  Case is not significant. Note that the letter C always indicates a comment
  14665.  line; therefore, if string contains a C, the C is ignored. If more than one
  14666.  $DEBUG:string metacommand is specified, each string overrides the previous
  14667.  string. $DEBUG can be used for conditional compilation only if the $FREEFORM
  14668.  metacommand has not been specified. If the $DEBUG:string metacommand appears
  14669.  after $FREEFORM, the compiler emits a warning message.
  14670.  
  14671.  
  14672.  ■  Example
  14673.  
  14674.       C     If the $FREEFORM metacommand has been specified,
  14675.       C     the next line produces an error message.
  14676.       $DEBUG:'ABCD'
  14677.       A    I = 1
  14678.       E    I = 2
  14679.       B    I = I + I
  14680.       F    I = I * I
  14681.       C     This is always a comment. I equals 2,
  14682.       C     because only statements A and B are executed.
  14683.  
  14684.  
  14685.  $DECLARE and $NODECLARE
  14686.  
  14687.  
  14688.  ■  Action
  14689.  
  14690.  $DECLARE generates warnings for variables that have not appeared in
  14691.  specification statements, and $NODECLARE disables these warnings
  14692.  
  14693.  
  14694.  ■  Syntax
  14695.  
  14696.       $«NO»DECLARE
  14697.  
  14698.  
  14699.  ■  Remarks
  14700.  
  14701.  The default is $NODECLARE. When $DECLARE is enabled, a warning message is
  14702.  generated at the first use of any variable that has not been assigned a
  14703.  value in a specification statement. The $DECLARE metacommand is primarily a
  14704.  debugging tool that locates variables that have not been properly
  14705.  initialized, or that have been defined but never used.
  14706.  
  14707.  
  14708.  ■  Example
  14709.  
  14710.       $DECLARE
  14711.       C     Since the variable z has not been assigned a value,
  14712.       C     its use in the statement labeled 100 causes an error:
  14713.  
  14714.             REAL x, y, z
  14715.             y = 1.0
  14716.       100   x = y + z
  14717.  
  14718.  
  14719.  
  14720.  $DEFINE and $UNDEFINE
  14721.  
  14722.  
  14723.  ■  Action
  14724.  
  14725.  $DEFINE creates a symbolic variable whose existence or value can be tested
  14726.  during conditional compilation; $UNDEFINE removes the symbol
  14727.  
  14728.  
  14729.  ■  Syntax
  14730.  
  14731.       $DEFINE symbol-name «= val»
  14732.       $UNDEFINE symbol-name
  14733.  
  14734.  Parameter                                  Description
  14735.  
  14736.  symbol-name                                An alphanumeric identifier of up
  14737.                                             to 31 characters. It may include
  14738.                                             the dollar sign and underline; it
  14739.                                             may not begin with a numeral or
  14740.                                             the underline.
  14741.  
  14742.  val                                        Any positive or negative
  14743.                                             INTEGER*4 value.
  14744.  
  14745.  
  14746.  ■  Remarks
  14747.  
  14748.  The default is $UNDEFINE, since any symbol name not specified in a $DEFINE
  14749.  metacommand tests .FALSE..
  14750.  
  14751.  The existence of a symbol-name is tested by the DEFINED (symbol-name)
  14752.  conditional expression. The value of a symbol-name is tested with a
  14753.  FORTRAN-style conditional expression. If a symbol-name has been assigned a
  14754.  value, it tests .FALSE. in a DEFINED conditional expression.
  14755.  
  14756.  Symbol names are local to the metacommands, and may duplicate FORTRAN
  14757.  keywords, intrinsic functions, or user-defined names, without conflict.
  14758.  
  14759.  The $DEFINE and $UNDEFINE metacommands can appear anywhere in a program,
  14760.  enabling symbol definitions as desired.
  14761.  
  14762.  
  14763.  ■  Examples
  14764.  
  14765.       $DEFINE  testflag
  14766.       $DEFINE  testval = 2
  14767.       .
  14768.       .
  14769.       .
  14770.       $UNDEFINE  testflag
  14771.  
  14772.  
  14773.  $DO66
  14774.  
  14775.  
  14776.  ■  Action
  14777.  
  14778.  $DO66 causes DO statements to conform to FORTRAN 66 semantics
  14779.  
  14780.  
  14781.  ■  Syntax
  14782.  
  14783.       $DO66
  14784.  
  14785.  
  14786.  ■  Remarks
  14787.  
  14788.  You must obey the following rules when using $DO66:
  14789.  
  14790.    ■  $DO66 must precede the first declaration or executable statement of the
  14791.       source file in which it occurs.
  14792.  
  14793.    ■  $DO66 may only be preceded by a comment line or another metacommand.
  14794.  
  14795.    ■  $DO66 may only appear once in the source file.
  14796.  
  14797.  When $DO66 is enabled, the following FORTRAN 66 semantics are used:
  14798.  
  14799.    ■  Statements within a DO loop are always executed at least once.
  14800.  
  14801.    ■  Extended range is permitted; control may transfer into the syntactic
  14802.       body of a DO statement. The range of the DO statement is thereby
  14803.       extended to include, logically, any statement that may be executed
  14804.       between a DO statement and its terminal statement. However, the
  14805.       transfer of control into the range of a DO statement prior to the
  14806.       execution of the DO statement or following the final execution of its
  14807.       terminal statement is invalid.
  14808.  
  14809.  Note how this differs from the default (FORTRAN 77) semantics, which are as
  14810.  follows:
  14811.  
  14812.    ■  DO statements will not be executed if the value of the initial control
  14813.       variable exceeds that of the final control variable (or the
  14814.       corresponding condition for a DO statement with negative increment).
  14815.  
  14816.  
  14817.  $ELSE
  14818.  
  14819.  
  14820.  ■  Action
  14821.  
  14822.  Marks the beginning of a $ELSE metacommand block
  14823.  
  14824.  
  14825.  ■  Syntax
  14826.  
  14827.       $ELSE
  14828.  
  14829.  
  14830.  ■  Remarks
  14831.  
  14832.  If the logical expression in the matching $IF or $ELSEIF metacommand
  14833.  evaluates to .FALSE., a $ELSE block is compiled.
  14834.  
  14835.  A $ELSE block consists of any statements between the $ELSE metacommand and
  14836.  the next $ENDIF metacommand at the same $IF level. The matching $ENDIF must
  14837.  appear before any $ELSE or $ELSEIF at the same $IF level.
  14838.  
  14839.  
  14840.  ■  Example
  14841.  
  14842.       $DEFINE flag
  14843.  
  14844.       $IF DEFINED (flag)
  14845.             WRITE (*, '('' This is compiled if flag
  14846.            +               DEFINED'')')
  14847.       $ELSE
  14848.             WRITE (*, '('' This is compiled if flag
  14849.            +               not DEFINED'')')
  14850.       $ENDIF
  14851.  
  14852.  
  14853.  
  14854.  
  14855.  $ELSEIF
  14856.  
  14857.  
  14858.  ■  Action
  14859.  
  14860.  Causes compilation of a block of statements if expression is .TRUE. and the
  14861.  matching $IF metacommand is .FALSE.
  14862.  
  14863.  
  14864.  ■  Syntax
  14865.  
  14866.       $ELSEIF (expression)
  14867.  
  14868.  Parameter                                  Description
  14869.  
  14870.  expression                                 A logical expression
  14871.  
  14872.  
  14873.  ■  Remarks
  14874.  
  14875.  The logical expression in a $ELSEIF metacommand can take two forms. One is
  14876.  the conditional-compilation operator DEFINED, followed by a symbol name in
  14877.  parentheses. If the symbol name has previously appeared in a $DEFINE
  14878.  metacommand without having been assigned a value, DEFINED (symbol_name)
  14879.  evaluates to .TRUE.. If (symbol_name) did not appear in a preceding $DEFINE
  14880.  metacommand, or did appear and was assigned a value, DEFINED (symbol_name)
  14881.  evaluates to .FALSE..
  14882.  
  14883.  The second form is a logical comparison, where the value of the symbol is
  14884.  compared with an integer constant or the value of another symbol using the
  14885.  FORTRAN .EQ., .NE., .GT., .LT., .GE., or .LE. operators. The results of such
  14886.  comparisons may further be evaluated with the FORTRAN .AND., .OR., .XOR.,
  14887.  and .NOT. operators. The usual rules of precedence apply, and parentheses
  14888.  may be used to control the order of evaluation.
  14889.  
  14890.  The associated $ELSEIF block consists of any executable statements between
  14891.  the $ELSEIF metacommand and the next $ELSEIF, $ELSE, or $ENDIF metacommand
  14892.  at the same $IF level.
  14893.  
  14894.  
  14895.  ■  Example
  14896.  
  14897.       $DEFINE flag
  14898.       $DEFINE testval = 3
  14899.  
  14900.       $IF (.NOT. DEFINED (flag))
  14901.             WRITE (*, '('' Compiled if flag not DEFINED'')')
  14902.       $ELSEIF (testval .GT. 3)
  14903.             WRITE (*, '('' Compiled if flag DEFINED .AND. testval
  14904.            +.GT. 3'')')
  14905.       $ELSE
  14906.             WRITE (*, '('' Compiled if flag DEFINED .AND. testval
  14907.            +.LE. 3'')')
  14908.       $ENDIF
  14909.       $ENDIF
  14910.  
  14911.  
  14912.  $ENDIF
  14913.  
  14914.  
  14915.  ■  Action
  14916.  
  14917.  Terminates a $IF metacommand block
  14918.  
  14919.  
  14920.  ■  Syntax
  14921.  
  14922.       $ENDIF
  14923.  
  14924.  
  14925.  ■  Remarks
  14926.  
  14927.  There must be a matching $ENDIF metacommand for every $IF metacommand in a
  14928.  program unit.
  14929.  
  14930.  
  14931.  ■  Example
  14932.  
  14933.       $DEFINE  flag
  14934.       $DEFINE  testval = 3
  14935.       $IF DEFINED (flag)
  14936.             WRITE (*, '('' Compiled if all conditions met'')')
  14937.       $ENDIF
  14938.       .
  14939.       .
  14940.       .
  14941.       $IF (testval .LT. 1) .AND. .NOT. DEFINED (flag)
  14942.             WRITE (*, '('' This is compiled if flag .EQ. 3'')')
  14943.       $ELSE
  14944.             WRITE (*, '('' This is compiled if flag .NE. 3'')')
  14945.       $ENDIF
  14946.  
  14947.  
  14948.  $FLOATCALLS and $NOFLOATCALLS
  14949.  
  14950.  
  14951.  ■  Action
  14952.  
  14953.  $FLOATCALLS causes floating-point operations to be processed by calls to
  14954.  library subroutines; $NOFLOATCALLS causes floating-point operations to be
  14955.  processed by compiler-generated, in-line coprocessor instructions
  14956.  
  14957.  
  14958.  ■  Syntax
  14959.  
  14960.       $«NO»FLOATCALLS
  14961.  
  14962.  
  14963.  ■  Remarks
  14964.  
  14965.  $NOFLOATCALLS is the default.
  14966.  
  14967.  See Microsoft FORTRAN Advanced Topics for a discussion of the advantages and
  14968.  disadvantages of floating-point operations for handling each method.
  14969.  
  14970.  
  14971.  ■  Example
  14972.  
  14973.       $FLOATCALLS
  14974.             REAL  x, sine
  14975.  
  14976.             WRITE  (*, 100)
  14977.        100     FORMAT (1X, 'ENTER x: '\)
  14978.             READ   (*, '(F10.5)') x
  14979.  
  14980.             WRITE  (*, 200) x, SINE (x, .00001)
  14981.        200     FORMAT (1X, 'THE SINE OF ', F10.5, ' = ', F9.6)
  14982.             END
  14983.  
  14984.       C     The function calculates the sine of X using a power series.
  14985.       C     Successive terms are calculated until less than eps.
  14986.  
  14987.       C     Library calls are generated instead of in-line instructions,
  14988.       C     letting this routine run on machines without a coprocessor.
  14989.  
  14990.             REAL FUNCTION SINE (x, eps)
  14991.  
  14992.             REAL x, y, z, next, i, eps
  14993.  
  14994.             z    = AMOD (x, 6.2831853)
  14995.             y    = z
  14996.             i    = 4.0
  14997.             next = -z * z * z / 6.0
  14998.        100  IF (ABS (next) .GE. eps) THEN
  14999.                y    =  y + next
  15000.                next = -next * z * z / (i * (i + 1.0))
  15001.                i    =  i + 2.0
  15002.                GOTO 100
  15003.            END IF
  15004.             SINE = y
  15005.             END
  15006.  
  15007.  
  15008.  $FREEFORM and $NOFREEFORM
  15009.  
  15010.  
  15011.  ■  Action
  15012.  
  15013.  $NOFREEFORM specifies that a source file is in standard FORTRAN format;
  15014.  $FREEFORM specifies that a source file is in free-form format
  15015.  
  15016.  
  15017.  ■  Syntax
  15018.  
  15019.       $«NO»FREEFORM
  15020.  
  15021.  
  15022.  ■  Remarks
  15023.  
  15024.  If this metacommand appears, it must precede any FORTRAN statements. The
  15025.  default, $NOFREEFORM, tells the compiler that your source code is in the
  15026.  standard FORTRAN format: labels are in columns 1-5, continuation characters
  15027.  are in column 6, statements are in columns 7-72, and characters beyond
  15028.  column 73 are ignored. The standard FORTRAN format is described in Section
  15029.  2.1, "Lines." $FREEFORM tells the compiler that your source code is in the
  15030.  following format:
  15031.  
  15032.    ■  A double quotation mark (") in column 1 indicates a comment line. An
  15033.       exclamation point outside a character or Hollerith constant indicates
  15034.       the beginning of an in-line comment.
  15035.  
  15036.    ■  Initial lines may start in any column.
  15037.  
  15038.    ■  The first nonblank character of an initial line may be a digit (the
  15039.       first digit in a statement number). The statement number may be from
  15040.       one to five decimal digits: blanks and leading zeros are ignored.
  15041.       Blanks are not required to separate the statement number from the first
  15042.       character of the statement.
  15043.  
  15044.    ■  If the last nonblank, noncomment character of a line is a minus sign,
  15045.       it is discarded and the next line is taken to be a continuation line.
  15046.       The continuation line may start in any column.
  15047.  
  15048.    ■  Alphabetic characters and asterisks are not allowed as comment markers
  15049.       in column 1.
  15050.  
  15051.  
  15052.  ■  Example
  15053.  
  15054.       $FREEFORM
  15055.  
  15056.       "The sine of the number x is calculated using a power series.
  15057.       "Successive terms are calculated until one is less than epsi.
  15058.  
  15059.       REAL x, epsi, z, sine, next
  15060.       epsi = 0.0001
  15061.  
  15062.             WRITE  (*, 100)
  15063.        100  FORMAT (1X, 'ENTER x: ' \)
  15064.             READ   (*, '(F10.5)') x
  15065.  
  15066.             z    =  AMOD (x, 6.2831853)
  15067.             sine =  z
  15068.             i    =  4.0
  15069.             next = -z * z * z / 6.0
  15070.  
  15071.        200  IF (ABS (next) .GE. epsi) THEN
  15072.                sine =  sine + next
  15073.                next = -next * z * z / (i * (i + 1.0))
  15074.                i    =  i + 2.0
  15075.                GOTO 200
  15076.             ENDIF
  15077.  
  15078.             WRITE  (*, 300) x, sine
  15079.        300  FORMAT (1X, 'THE SINE OF ', F10.5,
  15080.            +        ' = ', F12.10)
  15081.             END
  15082.  
  15083.  
  15084.  
  15085.  
  15086.  $IF
  15087.  
  15088.  
  15089.  ■  Action
  15090.  
  15091.  If expression is .TRUE., statements in the $IF block are compiled; if
  15092.  expression is .FALSE., control is transferred to the next $ELSE, $ELSEIF, or
  15093.  $ENDIF metacommand at the same $IF level
  15094.  
  15095.  
  15096.  ■  Syntax
  15097.  
  15098.       $IF expression
  15099.  
  15100.  Parameter                                  Description
  15101.  
  15102.  expression                                 A logical expression
  15103.  
  15104.  
  15105.  ■  Remarks
  15106.  
  15107.  The logical expression in a $IF metacommand can take two forms. One is the
  15108.  metacommand keyword DEFINED, followed by a symbol name in parentheses. If
  15109.  the symbol name has previously appeared in a $DEFINE metacommand without
  15110.  having been assigned a value, DEFINED (symbol_name) evaluates to .TRUE.. If
  15111.  (symbol_name) did not appear in a preceding $DEFINE metacommand, or did
  15112.  appear and was assigned a value, DEFINED (symbol_name) evaluates to .FALSE..
  15113.  
  15114.  The second form is a logical comparison, where the value of the symbol is
  15115.  compared with an integer constant or the value of another symbol using the
  15116.  FORTRAN .EQ., .NE., .GT., .LT., .GE., or .LE. operators. The results of such
  15117.  comparisons may further be evaluated with the FORTRAN .AND., .OR., .XOR.,
  15118.  and .NOT. operators. The usual rules of precedence apply, and parentheses
  15119.  may be used to control the order of evaluation.
  15120.  
  15121.  
  15122.  ■  Example
  15123.  
  15124.       $DEFINE flag
  15125.       $DEFINE testval = 3
  15126.       $IF DEFINED (flag)
  15127.             WRITE (*, '('' This is compiled if flag DEFINED'')')
  15128.       $ENDIF
  15129.       .
  15130.       .
  15131.       .
  15132.       $IF (testval .LT. 1) .AND. .NOT. DEFINED (flag)
  15133.             WRITE (*, '('' Testval .LT. 1 .AND. flag .NOT. DEFINED'')')
  15134.  
  15135.  
  15136.       $ELSE
  15137.             WRITE (*, '('' Testval .GE. 1 .OR.  flag       DEFINED'')')
  15138.       $ENDIF
  15139.  
  15140.  
  15141.  $INCLUDE
  15142.  
  15143.  
  15144.  ■  Action
  15145.  
  15146.  Inserts the contents of a specified text file at the location of the
  15147.  $INCLUDE metacommand
  15148.  
  15149.  
  15150.  ■  Syntax
  15151.  
  15152.       $INCLUDE:'filename'
  15153.  
  15154.  Parameter                                  Description
  15155.  
  15156.  filename                                   Name of the FORTRAN text file to
  15157.                                             include in the program
  15158.  
  15159.  
  15160.  ■  Remarks
  15161.  
  15162.  The argument filename must be a valid file specification for your operating
  15163.  system.
  15164.  
  15165.  The compiler considers the contents of the include file to be part of the
  15166.  program file and compiles them immediately. At the end of the included file,
  15167.  the compiler resumes processing the original source file at the line
  15168.  following the $INCLUDE metacommand.
  15169.  
  15170.  Include files are primarily used for data or program units that appear in
  15171.  more than one program. Include files most often contain subroutines and
  15172.  functions, common block declarations, and EXTERNAL, INTERFACE TO, and
  15173.  INTRINSIC statements.
  15174.  
  15175.  Include files can also contain other $INCLUDE metacommands and INCLUDE
  15176.  statements (nested included files). The compiler allows you to nest any
  15177.  combination of up to ten $INCLUDE metacommands or INCLUDE statements. Your
  15178.  operating system may impose further restrictions.
  15179.  
  15180.  
  15181.  ■  Example
  15182.  
  15183.  This program implements a stack by declaring the common stack data in an
  15184.  include file. The contents of the file STKVARS.FOR (shown below the
  15185.  following program) are inserted in the source code in place of every
  15186.  $INCLUDE metacommand. This guarantees all references to common storage for
  15187.  stack variables are consistent.
  15188.  
  15189.             INTEGER i
  15190.             REAL    x
  15191.       $INCLUDE:'stkvars.for'
  15192.  
  15193.       C     read in five real numbers:
  15194.             DO 100 i = 1, 5
  15195.                READ (*, '(F10.5)') x
  15196.                CALL Push (x)
  15197.         100 CONTINUE
  15198.  
  15199.       C     write out the numbers in reverse order:
  15200.             WRITE (*, *) ' '
  15201.             DO 200 i = 1,5
  15202.                CALL Pop (x)
  15203.                WRITE (*, *) x
  15204.         200 CONTINUE
  15205.             END
  15206.  
  15207.             SUBROUTINE Push (x)
  15208.       C     Pushes an element x onto the top of the stack.
  15209.  
  15210.             REAL x
  15211.       $INCLUDE:'stkvars.for'
  15212.  
  15213.             top = top + 1
  15214.             IF (top .GT. stacksize)  STOP 'Stack overflow'
  15215.             stack(top) = x
  15216.             END
  15217.  
  15218.             SUBROUTINE pop(x)
  15219.       C     Pops an element from the top of the stack into x.
  15220.  
  15221.             REAL x
  15222.       $INCLUDE:'stkvars.for'
  15223.  
  15224.             IF (top .LE. 0)  STOP 'Stack underflow'
  15225.                x   = stack(top)
  15226.                top = top - 1
  15227.             END
  15228.  
  15229.  The following is the file STKVARS.FOR:
  15230.  
  15231.       C     This file contains the declaration of the common block
  15232.       C     for a stack implementation. Because this file contains an
  15233.       C     assignment statement, it must be included only after all
  15234.       C     other specification statements in each program unit.
  15235.  
  15236.             REAL     stack(500)
  15237.             INTEGER  top, stacksize
  15238.  
  15239.             COMMON  /stackbl/ stack, top
  15240.  
  15241.             stacksize = 500
  15242.  
  15243.  
  15244.  $LARGE and $NOTLARGE
  15245.  
  15246.  
  15247.  ■  Action
  15248.  
  15249.  $LARGE specifies that an actual argument can span more than one segment
  15250.  (64K); $NOTLARGE specifies that an actual argument cannot span more than one
  15251.  segment
  15252.  
  15253.  
  15254.  ■  Syntax
  15255.  
  15256.       $«NOT»LARGE«:names»
  15257.  
  15258.  Parameter                                  Value
  15259.  
  15260.  names                                      One or more names of array
  15261.                                             variables or formal array
  15262.                                             arguments. If more than one name
  15263.                                             is specified, they must be
  15264.                                             separated by commas.
  15265.  
  15266.                                             When names is specified in the
  15267.                                             $LARGE metacommand, it indicates
  15268.                                             that the array or formal array
  15269.                                             argument specified can span more
  15270.                                             than one segment (it is addressed
  15271.                                             outside of DGROUP). When names is
  15272.                                             specified in the $NOTLARGE
  15273.                                             metacommand, it excludes the
  15274.                                             specified items from the effects
  15275.                                             of a $LARGE metacommand that has
  15276.                                             no arguments.
  15277.  
  15278.  
  15279.  ■  Remarks
  15280.  
  15281.  $NOTLARGE is the default.
  15282.  
  15283.  If the optional names parameter is specified, the metacommand must appear in
  15284.  the declarative section of a subprogram.
  15285.  
  15286.  If names is omitted, the metacommand affects all arrays in all subsequent
  15287.  subprograms in the source file until the $NOTLARGE metacommand is specified
  15288.  without any arguments. This form without arguments may appear anywhere
  15289.  except in the executable section of a subprogram.
  15290.  
  15291.  Arrays with explicit dimensions indicating they are bigger than 64K are
  15292.  automatically allocated to multiple segments outside the default data
  15293.  segment. You do not need to specify $LARGE for these arrays.
  15294.  
  15295.  Only one $LARGE or one $NOTLARGE metacommand without arguments can occur in
  15296.  a single program unit. The following code fragment, for example, is illegal:
  15297.  
  15298.       C     This is illegal:
  15299.       $LARGE
  15300.             SUBROUTINE MySub
  15301.       $NOTLARGE
  15302.             a=1.0
  15303.             .
  15304.             .
  15305.             .
  15306.  
  15307.  Note that use of the $LARGE metacommand on the entire program corresponds to
  15308.  the huge memory model. You can also use the HUGE attribute to specify that
  15309.  an actual argument can span more than one segment.
  15310.  
  15311.  
  15312.  $LINESIZE
  15313.  
  15314.  
  15315.  ■  Action
  15316.  
  15317.  $LINESIZE formats subsequent pages of the listing to a width of n columns
  15318.  
  15319.  
  15320.  ■  Syntax
  15321.  
  15322.       $LINESIZE:n
  15323.  
  15324.  Parameter                                  Value
  15325.  
  15326.  n                                          An integer between 80 and 132.
  15327.                                             The default for n is 80.
  15328.  
  15329.  
  15330.  ■  Example
  15331.  
  15332.       $LINESIZE:100
  15333.  
  15334.       C     The compiler listing of this program will be one hundred
  15335.       C     columns wide:
  15336.  
  15337.             REAL x
  15338.             x = 20
  15339.             WRITE (*, 100) x, SQRT(x)
  15340.         100 FORMAT(' The square root of ',f5.2,' is ',f7.4)
  15341.             END
  15342.  
  15343.  
  15344.  $LIST and $NOLIST
  15345.  
  15346.  
  15347.  ■  Action
  15348.  
  15349.  $LIST sends subsequent listing information to the listing file specified
  15350.  when starting the compiler; $NOLIST directs that subsequent listing
  15351.  information be discarded, until there is a subsequent appearance of the
  15352.  $LIST metacommand
  15353.  
  15354.  
  15355.  ■  Syntax
  15356.  
  15357.       $«NO»LIST
  15358.  
  15359.  
  15360.  ■  Remarks
  15361.  
  15362.  The default is $LIST.
  15363.  
  15364.  If no listing file is specified in response to the compiler prompt, the
  15365.  metacommand has no effect.
  15366.  
  15367.  $LIST and $NOLIST can appear anywhere in a source file.
  15368.  
  15369.  
  15370.  $LOOPOPT
  15371.  
  15372.  
  15373.  ■  Action
  15374.  
  15375.  $LOOPOPT turns on compiler loop optimization; $NOLOOPOPT disables it
  15376.  
  15377.  
  15378.  ■  Syntax
  15379.  
  15380.       $«NO»LOOPOPT
  15381.  
  15382.  
  15383.  ■  Remarks
  15384.  
  15385.  $LOOPOPT is the default. The $LOOPOPT metacommand reenables loop
  15386.  optimization after it has been disabled, either by the $NOLOOPOPT
  15387.  metacommand or by the /Od command-line option.
  15388.  
  15389.  Loop optimization consists of placing invariant expressions outside the
  15390.  loop, and simplifying computations within the loop to speed up loop
  15391.  calculations.
  15392.  
  15393.  Loop optimization is not always desirable. In the following example, the
  15394.  calculation of upper divided by lower is invariant, so loop optimization
  15395.  repositions it ahead of the loop. This means the IF statement can no longer
  15396.  check the value of the divisor before the division; if it is zero, a
  15397.  run-time error will occur.
  15398.  
  15399.             upper = result
  15400.             lower = quantity
  15401.  
  15402.             DO 200 n = 1, 100
  15403.  
  15404.             IF (lower .EQ. 0)
  15405.             GOTO 300 C
  15406.  
  15407.       C     Loop optimization moves the following statement outside
  15408.       C     the loop:
  15409.  
  15410.             factor = upper / lower
  15411.        200  CONTINUE
  15412.        300  CONTINUE
  15413.  
  15414.  Due to unanticipated interactions (such as the one just described), it is
  15415.  dangerous to turn loop optimization on and off locally. Loop optimization
  15416.  should be applied to, or removed from, entire programs or procedures.
  15417.  
  15418.  
  15419.  $MESSAGE
  15420.  
  15421.  
  15422.  ■  Action
  15423.  
  15424.  $MESSAGE sends a character string to the standard output device during the
  15425.  first compiler pass
  15426.  
  15427.  
  15428.  ■  Syntax
  15429.  
  15430.       $MESSAGE:string
  15431.  
  15432.  Parameter                                  Description
  15433.  
  15434.  string                                     A character constant
  15435.  
  15436.  
  15437.  ■  Remarks
  15438.  
  15439.  The string must be enclosed in quotes or apostrophes.
  15440.  
  15441.  
  15442.  ■  Example
  15443.  
  15444.       $MESSAGE:'Compiling program'
  15445.  
  15446.  
  15447.  $PACK
  15448.  
  15449.  
  15450.  ■  Action
  15451.  
  15452.  Controls the starting addresses of variables in structures
  15453.  
  15454.  
  15455.  ■  Syntax
  15456.  
  15457.       $PACK«:{1 | 2 | 4}»
  15458.  
  15459.  
  15460.  ■  Remarks
  15461.  
  15462.  If there is no $PACK metacommand in the file, structures are packed
  15463.  according to the following default rules: INTEGER*1, LOGICAL*1, and all
  15464.  CHARACTER variables begin at the next available byte, whether odd or even;
  15465.  and all other variables begin at the next even byte. This arrangement wastes
  15466.  some memory space, but gives the quickest access to structure elements.
  15467.  
  15468.  If $PACK:1 is specified, all variables begin at the next available byte,
  15469.  whether odd or even. Although this slightly increases access time, no memory
  15470.  space is wasted.
  15471.  
  15472.  If $PACK:2 is specified, packing follows the default rules described above.
  15473.  
  15474.  If $PACK:4 is specified, INTEGER*1, LOGICAL*1, and all CHARACTER variables
  15475.  begin at the next available byte, whether odd or even; all other variables
  15476.  begin on four-byte boundaries.
  15477.  
  15478.  If $PACK is specified (no colon or number), packing reverts to whatever mode
  15479.  was specified in the command-line /Zp option.
  15480.  
  15481.  The $PACK metacommand may appear anywhere in a program to change structure
  15482.  packing as desired.
  15483.  
  15484.  
  15485.  ■  Example
  15486.  
  15487.       $PACK
  15488.       .
  15489.       .
  15490.       .
  15491.       $PACK:1
  15492.  
  15493.  
  15494.  $PAGE
  15495.  
  15496.  
  15497.  ■  Action
  15498.  
  15499.  $PAGE starts a new page in the source-listing file
  15500.  
  15501.  
  15502.  ■  Syntax
  15503.  
  15504.       $PAGE
  15505.  
  15506.  
  15507.  ■  Remarks
  15508.  
  15509.  If the first character of a line of source text is the ASCII form-feed
  15510.  character (hexadecimal number 0C), it is the same as having a $PAGE
  15511.  metacommand before that line.
  15512.  
  15513.  
  15514.  ■  Example
  15515.  
  15516.       C     This is page one. The following metacommand starts
  15517.       C     a new page in the source listing file:
  15518.       $PAGE
  15519.       C     This is page two. The following line starts with the ASCII
  15520.       C     form-feed character, so it will also start a new page in the
  15521.       C     source listing file:
  15522.  
  15523.       C     This is page 3.
  15524.             STOP ' '
  15525.             END
  15526.  
  15527.  
  15528.  $PAGESIZE
  15529.  
  15530.  
  15531.  ■  Action
  15532.  
  15533.  $PAGESIZE formats subsequent pages of the source listing to a length of n
  15534.  lines
  15535.  
  15536.  
  15537.  ■  Syntax
  15538.  
  15539.       $PAGESIZE:n
  15540.  
  15541.  
  15542.  ■  Remarks
  15543.  
  15544.  The argument n must be at least 15. The default page size is 63 lines.
  15545.  
  15546.  
  15547.  ■  Example
  15548.  
  15549.       $PAGESIZE:60
  15550.  
  15551.  
  15552.  $STORAGE
  15553.  
  15554.  
  15555.  ■  Action
  15556.  
  15557.  $STORAGE allocates n bytes of memory for all variables declared as integer
  15558.  or logical variables
  15559.  
  15560.  
  15561.  ■  Syntax
  15562.  
  15563.       $STORAGE:n
  15564.  
  15565.  
  15566.  ■  Remarks
  15567.  
  15568.  The argument n must be either 2 or 4. The default is 4.
  15569.  
  15570.  ───────────────────────────────────────────────────────────────────────────
  15571.  NOTE
  15572.     On many microprocessors, the code required to perform 16-bit arithmetic
  15573.     is faster and more compact than the code required to perform 32-bit
  15574.     arithmetic. Therefore, unless you set the Microsoft FORTRAN $STORAGE
  15575.     metacommand to a value of 2, programs will default to 32-bit arithmetic
  15576.     and may run slower than expected. Setting the $STORAGE metacommand to 2
  15577.     allows programs to run faster and to be smaller.
  15578.  ───────────────────────────────────────────────────────────────────────────
  15579.  
  15580.  The $STORAGE metacommand does not affect the allocation of memory for
  15581.  variables declared with an explicit length specification, such as INTEGER*2
  15582.  or LOGICAL*4.
  15583.  
  15584.  If several files of a source program are compiled and linked together, be
  15585.  careful that they are consistent in their allocation of memory for variables
  15586.  (such as actual and formal parameters) referred to in more than one module.
  15587.  
  15588.  The $STORAGE metacommand must precede the first declaration statement of the
  15589.  source file in which it appears.
  15590.  
  15591.  The default allocation for INTEGER, LOGICAL, and REAL variables is 4 bytes.
  15592.  This results in INTEGER, LOGICAL, and REAL variables being allocated the
  15593.  same amount of memory, as required by the FORTRAN 77 standard.
  15594.  
  15595.  For information on how the $STORAGE metacommand affects arithmetic
  15596.  expressions, see Section 1.7.1.2, "Type Conversion of Arithmetic Operands."
  15597.  For information on how the $STORAGE metacommand affects the passing of
  15598.  integer arguments, see Section 2.5, "Arguments."
  15599.  
  15600.  
  15601.  ■  Example
  15602.  
  15603.       $STORAGE:2
  15604.  
  15605.       C     b and c are declared without a byte length, so they default
  15606.       C     to the $STORAGE value of 2 bytes. a and d will be 4 bytes.
  15607.  
  15608.             INTEGER*4 a, d
  15609.             INTEGER   b, c
  15610.  
  15611.             a = 65537
  15612.             b = 1024
  15613.  
  15614.       C     Since c is 2 bytes, it is assigned only the lower 2 bytes
  15615.       C     of a+b.
  15616.             c = a + b
  15617.             d = a + b
  15618.  
  15619.       C     The following statement produces:  1025        66561
  15620.             WRITE (*, *) c, d
  15621.             END
  15622.  
  15623.  
  15624.  $STRICT and $NOTSTRICT
  15625.  
  15626.  
  15627.  ■  Action
  15628.  
  15629.  $STRICT disables the specific Microsoft FORTRAN features not found in the
  15630.  FORTRAN 77 full-language standard, and $NOTSTRICT enables these features
  15631.  
  15632.  
  15633.  ■  Syntax
  15634.  
  15635.       $«NOT»STRICT
  15636.  
  15637.  
  15638.  ■  Remarks
  15639.  
  15640.  The default is $NOTSTRICT. $NOTSTRICT and $STRICT can appear anywhere in a
  15641.  source file, enabling and disabling the extensions as desired.
  15642.  
  15643.  All Microsoft FORTRAN features that are not in the FORTRAN 77 full-language
  15644.  standard are printed in blue. The $STRICT metacommand disables them.
  15645.  
  15646.  
  15647.  ■  Example
  15648.  
  15649.       $STRICT
  15650.       C     The following statement produces an error, because
  15651.       C     INTEGER*2 is not part of the FORTRAN 77 standard:
  15652.             INTEGER*2  i
  15653.  
  15654.       C     The variable name (balance) will be truncated to six
  15655.       C     characters:
  15656.             REAL  balance(500)
  15657.  
  15658.       C     The following statement produces an error, because the
  15659.       C     MODE= option is not part of the FORTRAN 77 standard:
  15660.             OPEN (2, FILE = 'BALANCE.DAT', MODE = 'READ')
  15661.  
  15662.             DO 100 i = 1, 500
  15663.       C     The following statement produces an error, because the EOF
  15664.       C     intrinsic function is not part of the FORTRAN 77 standard;
  15665.       C     (EOF is treated as a REAL function):
  15666.  
  15667.                IF (EOF (2))  GOTO 200
  15668.                READ (2, '(F7.2)') balance(i)
  15669.        100  CONTINUE
  15670.        200  CONTINUE
  15671.             END
  15672.  
  15673.  
  15674.  $SUBTITLE
  15675.  
  15676.  
  15677.  ■  Action
  15678.  
  15679.  $SUBTITLE assigns the specified subtitle for subsequent pages of the source
  15680.  listing
  15681.  
  15682.  
  15683.  ■  Syntax
  15684.  
  15685.       $SUBTITLE:subtitle
  15686.  
  15687.  Parameter                                  Description
  15688.  
  15689.  subtitle                                   Any valid character constant
  15690.  
  15691.  
  15692.  ■  Remarks
  15693.  
  15694.  If a program contains no $SUBTITLE metacommand, the subtitle is a null
  15695.  string. The value of the subtitle string is printed in the upper-left corner
  15696.  of the source-listing file pages, below the title, if any appears. For a
  15697.  subtitle to appear on a specific page of the source-listing file, the
  15698.  $SUBTITLE metacommand must be the first statement on that page.
  15699.  
  15700.  
  15701.  ■  Example
  15702.  
  15703.  The following program produces a listing in which each page is titled GAUSS
  15704.  (the name of the program). Each subprogram begins on a new page of the
  15705.  listing, and the name of the subprogram appears as a subtitle.
  15706.  
  15707.       $TITLE:'GAUSS'
  15708.  
  15709.       C     main program here...
  15710.             END
  15711.  
  15712.       $SUBTITLE:'Row Division'
  15713.       $PAGE
  15714.             SUBROUTINE divide (row, matrix, pivot)
  15715.       C     subroutine body...
  15716.                RETURN
  15717.             END
  15718.  
  15719.       $SUBTITLE:'Back Substitution'
  15720.       $PAGE
  15721.             SUBROUTINE BackSub (matrix)
  15722.       C     subroutine body...
  15723.                RETURN
  15724.             END
  15725.  
  15726.  
  15727.  $TITLE
  15728.  
  15729.  
  15730.  ■  Action
  15731.  
  15732.  $TITLE assigns the specified title for subsequent pages of the source
  15733.  listing (until overridden by another $TITLE metacommand)
  15734.  
  15735.  
  15736.  ■  Syntax
  15737.  
  15738.       $TITLE:title
  15739.  
  15740.  Parameter                                  Description
  15741.  
  15742.  title                                      Any valid character constant
  15743.  
  15744.  
  15745.  ■  Remarks
  15746.  
  15747.  If a program contains no $TITLE metacommand, the title is a null string.
  15748.  
  15749.  
  15750.  ■  Example
  15751.  
  15752.  The following program produces a listing in which each page is titled GAUSS
  15753.  (the name of the program). Each subprogram begins on a new page of the
  15754.  listing, and the name of the subprogram appears as a subtitle.
  15755.  
  15756.       $TITLE:'GAUSS'
  15757.  
  15758.       C     main program here...
  15759.             END
  15760.  
  15761.       $SUBTITLE:'Row Division'
  15762.       $PAGE
  15763.             SUBROUTINE divide(row, matrix, pivot)
  15764.       C     subroutine body...
  15765.                RETURN
  15766.             END
  15767.  
  15768.       $SUBTITLE:'Back Substitution'
  15769.       $PAGE
  15770.             SUBROUTINE backsub(matrix)
  15771.       C     subroutine body...
  15772.                RETURN
  15773.             END
  15774.  
  15775.  
  15776.  $TRUNCATE and $NOTRUNATE
  15777.  
  15778.  
  15779.  ■  Action
  15780.  
  15781.  $TRUNCATE truncates all variable and program/subprogram names to six
  15782.  characters; $NOTRUNCATE disables the default or a previous $TRUNCATE
  15783.  metacommand
  15784.  
  15785.  
  15786.  ■  Syntax
  15787.  
  15788.       $«NO»TRUNCATE
  15789.  
  15790.  
  15791.  ■  Remarks
  15792.  
  15793.  The default is $NOTRUNCATE. When the default is in effect, the first 31
  15794.  characters in a name are significant. (Your operating system may also
  15795.  restrict the length of names.)
  15796.  
  15797.  When $TRUNCATE or $STRICT is in effect, names longer than six characters
  15798.  generate warning messages. This can make it easier to port your code to
  15799.  other systems.
  15800.  
  15801.  
  15802.  ■  Example
  15803.  
  15804.       C     This program produces the following output:
  15805.       C
  15806.       C     74 Las Vegas Street
  15807.       C     74 Las Vegas Street
  15808.       C
  15809.       C     Barry Floyd
  15810.       C     3 Prospect Drive
  15811.  
  15812.  
  15813.             IMPLICIT CHARACTER*20 (s)
  15814.  
  15815.       $TRUNCATE
  15816.             studentname    = 'Enrique Pieras'
  15817.             studentaddress = '74 Las Vegas Street'
  15818.  
  15819.             WRITE (*, 100) studentname, studentaddress
  15820.  
  15821.       $NOTRUNCATE
  15822.             studentname    = 'Barry Floyd'
  15823.             studentaddress = '3 Prospect Drive'
  15824.  
  15825.             WRITE (*, 100) studentname, studentaddress
  15826.  
  15827.         100 FORMAT (/ 1X, A20, / 1X, A20)
  15828.  
  15829.             END
  15830.  
  15831.  
  15832.  Chapter 7  The FL Command
  15833.  
  15834.  ───────────────────────────────────────────────────────────────────────────
  15835.  
  15836.  The FL command automatically compiles and links your FORTRAN program in a
  15837.  single step. FL executes the three compiler passes, then calls LINK (the
  15838.  Microsoft Segmented-Executable Linker) to link the object files. Except for
  15839.  a few unusual situations, FL is the only command you need to compile and
  15840.  link your FORTRAN source files. This chapter explains how it is used.
  15841.  
  15842.  When used by itself, the FL command creates an .EXE file that runs on most
  15843.  PC-compatible computers. In addition, the FL command offers a wide range of
  15844.  options, with which you can do the following:
  15845.  
  15846.    1. Set the memory model
  15847.  
  15848.    2. Select how floating-point calculations are performed
  15849.  
  15850.    3. Control which FORTRAN language features are available
  15851.  
  15852.    4. Create overlay files
  15853.  
  15854.    5. Create programs that run under OS/2
  15855.  
  15856.    6. Optimize the program for minimum size or maximum speed
  15857.  
  15858.    7. Assemble and link machine-language routines automatically
  15859.  
  15860.    8. Establish the search path for files
  15861.  
  15862.    9. Switch compiler warning messages on and off
  15863.  
  15864.   10. Select the page format and headers for output listings
  15865.  
  15866.  This chapter explains what each option does and how it is used.
  15867.  
  15868.  ───────────────────────────────────────────────────────────────────────────
  15869.  NOTE
  15870.     This chapter assumes you have a basic knowledge of FORTRAN and know how
  15871.     to create and edit program files. For questions relating to the
  15872.     definition of the FORTRAN language, see  specific chapters in this
  15873.     manual. The Microsoft CodeView and Utilities User's Guide explains how to
  15874.     use the symbolic debugger provided with this package.
  15875.     For a quick introduction to running the compiler and linker with FL, see
  15876.     the Microsoft FORTRAN Getting Started manual.
  15877.  ───────────────────────────────────────────────────────────────────────────
  15878.  
  15879.  Section 7.1 explains how to use the FL command to produce an executable
  15880.  program from a FORTRAN source file. It also describes how to run the program
  15881.  and pass command-line arguments to it, if desired.
  15882.  
  15883.  The remainder of the chapter discusses commonly used FL options. The FL
  15884.  options that control floating-point operations and memory models are
  15885.  discussed in Microsoft FORTRAN Advanced Topics. A summary of the FL commands
  15886.  and all available options appears in the Microsoft FORTRAN Quick Reference
  15887.  Guide provided with this package.
  15888.  
  15889.  
  15890.  7.1  The Basics: Compiling, Linking, and Running FORTRAN Files
  15891.  
  15892.  This section explains how to use FL to compile and link FORTRAN files, and
  15893.  it discusses the rules and conventions that apply to the file names and
  15894.  options used with FL. It also explains how to run the executable program
  15895.  created by FL.
  15896.  
  15897.  
  15898.  7.1.1  Compiling and Linking with FL
  15899.  
  15900.  The FL command takes the following form:
  15901.  
  15902.       FL «option...» «filespec...» «option...» «filespec...»
  15903.       «/link «libfield» «linkoptions»» «/MA option »
  15904.  
  15905.  ───────────────────────────────────────────────────────────────────────────
  15906.  NOTE
  15907.     Syntax examples too long to fit on one line are continued on two or more
  15908.     lines.
  15909.  ───────────────────────────────────────────────────────────────────────────
  15910.  
  15911.  Each option is one of the command-line options described in this manual, and
  15912.  each filespec names a file to be processed. The FL command automatically
  15913.  specifies the appropriate library to be used during linking; however, you
  15914.  can use the /link option with the optional libfield and linkoptions to
  15915.  specify additional libraries and options to be used during linking. See
  15916.  Section 7.32, "Using FL to Link without Compiling," for more information.
  15917.  
  15918.  You can give any number of options and file names on the command line,
  15919.  provided the command line does not exceed 128 characters.
  15920.  
  15921.  The FL command can process source files, object files, or a combination of
  15922.  source and object files. It uses the file-name extension (the period plus
  15923.  any letters following it) to determine what kind of processing the file
  15924.  needs, as shown below:
  15925.  
  15926.    ■  If the file has a .FOR extension, FL compiles the file.
  15927.  
  15928.    ■  If the file has an .OBJ extension, FL invokes the linker.
  15929.  
  15930.    ■  If the extension is omitted or is anything other than .FOR or .OBJ, FL
  15931.       assumes the file is an object file unless the file name is part of a
  15932.       /Tf option. If the file name appears in a /Tf option, FL assumes the
  15933.       file is a FORTRAN source file. See Section 7.10 for a description of
  15934.       the /Tf option.
  15935.  
  15936.  FL also accepts files with the .LIB and .DEF extensions and passes them to
  15937.  the linker in the correct order. Files that end with the .ASM extension or
  15938.  that appear in a /Ta option are passed to MASM.
  15939.  
  15940.  You can use the DOS wild-card characters (* and ?) to process all files
  15941.  meeting the wild-card specification, as long as the files have the required
  15942.  extensions. See the DOS manual for more information on wild-card characters.
  15943.  
  15944.  Any filespec on the FL command line can include a full or partial path
  15945.  specification, allowing you to process files in different directories or on
  15946.  different drives. A full path specification starts with the drive name. A
  15947.  partial path specification gives one or more directory names before the name
  15948.  of the file, but does not give a drive name. If a full path is not given, FL
  15949.  assumes the path starts from the current working directory.
  15950.  
  15951.  File names can contain any combination of uppercase or lowercase letters.
  15952.  For example, the following three file names are equivalent:
  15953.  
  15954.       abcde.for
  15955.       ABCDE.FOR
  15956.       aBcDe.foR
  15957.  
  15958.  When FL compiles source files, it creates object files. By default, these
  15959.  object files have the same base names as the corresponding source files, but
  15960.  with the extension .OBJ instead of .FOR. (The base name of a file is the
  15961.  portion of the name preceding the period, but excluding the path and drive
  15962.  name, if any.) You can use the /Fo option to assign a different name to an
  15963.  object file.
  15964.  
  15965.  These object files, along with any .OBJ files given on the command line, are
  15966.  linked to form an executable program file. The executable file has the base
  15967.  name of the first file (source or object) on the command line, plus an .EXE
  15968.  extension. If only .OBJ files are given on the command line, the compilation
  15969.  stage is skipped altogether, and the files are simply linked.
  15970.  
  15971.  You can tell whether FL is compiling or linking by the messages on the
  15972.  screen. When FL invokes the compiler, a message similar to the following
  15973.  appears:
  15974.  
  15975.       Microsoft (R) FORTRAN Optimizing Compiler Version 5.00
  15976.       Copyright (C) Microsoft Corp 1989.  All rights reserved.
  15977.  
  15978.  As each source file on the command line is compiled, its name appears on the
  15979.  screen. When all source files have been compiled and the linker is invoked,
  15980.  a message similar to the following appears:
  15981.  
  15982.       Microsoft (R) Segmented-Executable Linker  Version 5.03
  15983.       Copyright (C) Microsoft Corp 1984-1989. All rights reserved.
  15984.  
  15985.  This message is followed by several lines showing Microsoft LINK prompts and
  15986.  the responses provided by FL. The FL command uses the response-file method
  15987.  of invoking Microsoft LINK.
  15988.  
  15989.  ───────────────────────────────────────────────────────────────────────────
  15990.  NOTE
  15991.     FL ignores case in the linking stage. For example, the linker regards
  15992.     Global and GLOBAL as the same symbol. If you do not wish to ignore case,
  15993.     you must include the option, /link  /NOI (NOIGNORECASE). See Chapter 13,
  15994.     "Linking Object Files with LINK," in the Microsoft CodeView and Utilities
  15995.     User's Guide for more information.
  15996.  ───────────────────────────────────────────────────────────────────────────
  15997.  
  15998.  
  15999.  7.1.2  Using FL Options
  16000.  
  16001.  The FL command offers many command-line options to control and modify the
  16002.  compiler's operation. Options begin with a slash (/) and contain one or more
  16003.  letters. You can use a dash (-) instead of a slash if you prefer. For
  16004.  example, /I and -I are both acceptable forms of the I option.
  16005.  
  16006.  ───────────────────────────────────────────────────────────────────────────
  16007.  NOTE
  16008.     Although file names can be either uppercase or lowercase, options must be
  16009.     given exactly as shown. For example, /Zd is a valid option, but /ZD and
  16010.     /zd are not.
  16011.  ───────────────────────────────────────────────────────────────────────────
  16012.  
  16013.  Options can appear anywhere on the FL command line. In general, an option
  16014.  applies to all files following it on the command line, and does not affect
  16015.  files preceding it. However, not all options obey this rule (see the
  16016.  discussion of a particular option for information on its behavior). Most FL
  16017.  options apply only to the compilation process. Unless otherwise noted,
  16018.  options do not affect object files on the command line.
  16019.  
  16020.  Some options take arguments, such as file names, strings, or numbers. In
  16021.  some cases, spaces are permitted between the option and its argument; check
  16022.  the syntax of each option to confirm this.
  16023.  
  16024.  Some options consist of more than one letter. When this is the case, no
  16025.  spaces are allowed between the letters of an option. For example, the /Sp
  16026.  option cannot appear as /S p or a command-line error occurs.
  16027.  
  16028.  Chapters 1 and 2 of Microsoft FORTRAN Advanced Topics describe FL options
  16029.  for floating-point operations and memory models, respectively. Additional
  16030.  linking options are explained in Chapter 13 of the Microsoft CodeView and
  16031.  Utilities User's Guide.
  16032.  
  16033.  
  16034.  7.1.3  The FL Environment Variable
  16035.  
  16036.  The FL environment variable is a convenient way to specify frequently used
  16037.  options and files without having to enter them manually. If the FL
  16038.  environment variable exists, the options specified in the variable are
  16039.  automatically added to the command line.
  16040.  
  16041.  Use the SET command to set the FL environment variable. It is usually easier
  16042.  to add the SET command to the AUTOEXEC.BAT file than to enter it manually
  16043.  when you reboot. For example, the following SET command sets FL so programs
  16044.  are compiled and linked for use with the Microsoft CodeView debugger:
  16045.  
  16046.       SET FL = /Zi /Od
  16047.  
  16048.  All options in the FL variable are processed before the options on the
  16049.  command line, with the exception of /link options. After all other options
  16050.  are processed, any /link options in the FL variable are processed, followed
  16051.  by the /link options on the command line. For example, if the FL environment
  16052.  variable is set to /Zi /Od /link /I, the following two commands are
  16053.  equivalent:
  16054.  
  16055.       FL         MAINPGM.FOR MODULE1.FOR /link    /NOP
  16056.       FL /Zi /Od MAINPGM.FOR MODULE1.FOR /link /I /NOP
  16057.  
  16058.  When conflicting options appear on the same command line, the last option
  16059.  usually takes precedence. Therefore, since options specified in the FL
  16060.  variable are processed first, they will be overridden by conflicting options
  16061.  on the com-mand line.
  16062.  
  16063.  
  16064.  7.1.4  Specifying the Next Compiler Pass
  16065.  
  16066.  If FL cannot locate the next compiler pass it needs (there are three), it
  16067.  prompts you for the complete path name. (This occurs when compiling from
  16068.  floppy disks, or if you have changed the file name of one of the passes.) If
  16069.  the pass is on another disk, insert it in any available drive. Type the full
  16070.  path name, then press ENTER.
  16071.  
  16072.  
  16073.  7.1.5  Stopping FL
  16074.  
  16075.  If you need to abort the compiling and linking session, press CTRL+C or
  16076.  CTRL+BREAK. You will be returned to the DOS command level, where you can
  16077.  restart FL.
  16078.  
  16079.  
  16080.  7.1.6  Using the FL Command (Specific Examples)
  16081.  
  16082.  The command line below compiles the files A.FOR and B.FOR, creating object
  16083.  files named A.OBJ and B.OBJ:
  16084.  
  16085.       FL  A.FOR  B.FOR  C.OBJ  D
  16086.  
  16087.  These object files are then linked with C.OBJ and D.OBJ to form an
  16088.  executable file named A.EXE (since the base name of the first file on the
  16089.  command line is A.) Note that the extension .OBJ is assumed for D since no
  16090.  extension is given on the command line.
  16091.  
  16092.  The command line below compiles all source files with the default extension
  16093.  (.FOR) in the current working directory:
  16094.  
  16095.       FL  *.FOR
  16096.  
  16097.  The resulting object files are linked to form an executable file whose base
  16098.  name is the same as the base name of the first file compiled.
  16099.  
  16100.  The command below links all object files with the default extension (.OBJ)
  16101.  in the current working directory, creating an executable file whose base
  16102.  name is the same as the base name of the first object file found.
  16103.  
  16104.       FL  *.OBJ
  16105.  
  16106.  This will usually be the first file listed in the disk directory, and not
  16107.  necessarily the first file alphabetically.
  16108.  
  16109.  
  16110.  7.1.7  Running Your FORTRAN Program
  16111.  
  16112.  Compiling and linking a program produces an executable file with the
  16113.  extension .EXE. This file can be run from the operating system. The PATH
  16114.  environment variable is used to find executable files. You can execute your
  16115.  program from any directory, as long as the executable program file is either
  16116.  in your current working directory or in one of the directories given in the
  16117.  PATH environment variable.
  16118.  
  16119.  The command line that executes the program can also include additional file
  16120.  names. These names are used to satisfy OPEN statements in your program that
  16121.  leave the file-name field blank. The first file name on the command line is
  16122.  used for the first such OPEN statement executed, the second file name is
  16123.  used for the second OPEN statement, and so on.
  16124.  
  16125.  These command-line file names and any other arguments are also available by
  16126.  calling the GETARG procedure. You can use the command-line file names in
  16127.  OPEN statements without filenames, and still retrieve them with GETARG. See
  16128.  Chapter 5, "Intrinsic Functions and Additional Procedures," for more
  16129.  information. There is no interaction between these uses, and none of the
  16130.  names are changed or deleted.
  16131.  
  16132.  ───────────────────────────────────────────────────────────────────────────
  16133.  NOTE
  16134.     If your program executes a READ or WRITE statement specifying a file that
  16135.     has not been opened, the effect is the same as that of an OPEN statement
  16136.     with a blank file name. Default values are assigned to the parameters
  16137.     normally given in the OPEN statement. This operation is called an
  16138.     "implicit OPEN."
  16139.  ───────────────────────────────────────────────────────────────────────────
  16140.  
  16141.  If the file names on the command line outnumber the OPEN statements with
  16142.  blank file names, the extra file names are ignored. However, the remaining
  16143.  arguments can still be accessed with the GETARG procedure.
  16144.  
  16145.  If more OPEN statements with blank file names are executed than there are
  16146.  file names on the command line, you will be prompted to enter a file name
  16147.  for each additional OPEN statement. You are also prompted if you give a null
  16148.  file name (see the example below).
  16149.  
  16150.  Each file name on the command line must be separated from the names around
  16151.  it by one or more spaces or tab characters. Each name can be enclosed in
  16152.  quotation marks ("filename") if desired, but this is not required. A null
  16153.  argument consists of an empty set of double quotation marks, with no file
  16154.  name enclosed ("").
  16155.  
  16156.  The following example runs the program MYPROG.EXE:
  16157.  
  16158.       MYPROG  ""  OUTPUT.DAT
  16159.  
  16160.  Since the first file-name argument is null, the first OPEN statement with a
  16161.  blank file-name field produces the following message:
  16162.  
  16163.       File name missing or blank - please enter file name
  16164.       UNIT number ?
  16165.  
  16166.  The number is the unit number specified in the OPEN statement. The file name
  16167.  OUTPUT.DAT is used for the second such OPEN statement executed. If
  16168.  additional OPEN statements with blank file-name fields are executed, you
  16169.  will be prompted for more file names.
  16170.  
  16171.  
  16172.  7.2  Getting Help with FL Options (/HELP)
  16173.  
  16174.  
  16175.  Option
  16176.  
  16177.       /HELP
  16178.       /help
  16179.  
  16180.  The /HELP option displays a list of the most commonly used FORTRAN options.
  16181.  (See the Microsoft FORTRAN Quick Reference Guide for a complete alphabetical
  16182.  listing of FL options.) For this option to work, the file containing the
  16183.  FORTRAN options, FL.HLP, must be in the current directory or in the path
  16184.  given in the PATH environment variable. If FL cannot find this file, it
  16185.  displays the following error message:
  16186.  
  16187.       cannot open help file, 'fl.hlp'
  16188.  
  16189.  This option is not case sensitive. Any combination of uppercase and
  16190.  lowercase letters will work.
  16191.  
  16192.  When the /HELP option appears on the FL command line, FL displays the list
  16193.  of options but does not take any other action, regardless of what other
  16194.  options appear on the command line. For example, if you give a source-file
  16195.  name along with the /HELP option, FL does not compile the source file.
  16196.  
  16197.  The help screen prompts you to press any key before returning to the
  16198.  operating system prompt. This keeps the top lines of the help screen in
  16199.  view. Once you press a key and return to the operating system prompt, the
  16200.  top lines scroll out of view.
  16201.  
  16202.  
  16203.  Examples
  16204.  
  16205.  The following examples show how you can save the help screen for future
  16206.  reference by sending it to a file or printer:
  16207.  
  16208.       FL  /HELP > HELP.DOC
  16209.  
  16210.       FL  /HELP >PRN
  16211.  
  16212.  The first example above saves the help screen in a file named HELP.DOC. In
  16213.  the second example, the screen output is sent directly to the printer
  16214.  device, PRN. (See Section 7.15, "Special File Names," or your operating
  16215.  system documentation for a list of device names that can be used in
  16216.  redirection.)
  16217.  
  16218.  Note that you may have to press ENTER several times to make sure that all
  16219.  help messages are saved or printed. Since the messages may be displayed on
  16220.  several separate screens, FL waits for you to enter a keystroke before
  16221.  displaying the next screenful of messages. Also, you must press an
  16222.  additional key (any key can be used, including ENTER) after giving the FL
  16223.  command, since the help screen requires you to press a key before returning
  16224.  to the operating system prompt.
  16225.  
  16226.  
  16227.  7.3  Floating-Point Options (/FP)
  16228.  
  16229.  The following options control the way your program handles floating-point
  16230.  operations:
  16231.  
  16232.  Option                          Effect
  16233.  
  16234.  /FPi                            Generates in-line instructions
  16235.                                  and selects the emulator math
  16236.                                  package
  16237.  
  16238.  /FPi87                          Generates in-line instructions
  16239.                                  and selects 8087/287/387 commands
  16240.  
  16241.  /FPc                            Generates floating-point calls
  16242.                                  and selects the emulator math
  16243.                                  package
  16244.  
  16245.  /FPc87                          Generates floating-point calls
  16246.                                  and selects 8087/80287 commands
  16247.  
  16248.  /FPa                            Generates floating-point calls
  16249.                                  and selects the alternate math
  16250.                                  package
  16251.  
  16252.  See Chapter 1, "Controlling Floating-Point Operations," in Microsoft FORTRAN
  16253.  Advanced Topics for a complete description of these options.
  16254.  
  16255.  By default, programs use the 8087/80287 coprocessor. If your computer does
  16256.  not have a coprocessor, you must specify a floating-point option that uses
  16257.  either the emulator or the alternate-math package. (The emulator package
  16258.  exactly duplicates the operations of the 8087/80287 coprocessor in software.
  16259.  The alternate-math package is not as accurate as the 8087/80287 emulation,
  16260.  nor does it adhere to the IEEE floating-point standards, but it does execute
  16261.  faster.)
  16262.  
  16263.  The Microsoft FORTRAN Compiler does not generate true in-line 8087/80287
  16264.  code when you use the /FPi87 option. Instead, the compiler inserts software
  16265.  interrupts to library code, which fixes each interrupt to use either the
  16266.  emulator or coprocessor, as appropriate. If you have force-linked the
  16267.  emulator code to your program, these interrupts will call the emulator if a
  16268.  math chip is not available.
  16269.  
  16270.  If your program is designed to run only with a coprocessor, you can speed up
  16271.  the program by assembling and linking the code below, which  eliminates the
  16272.  fix-up processing. In addition, all divide-by-zero errors will be masked.
  16273.  
  16274.       PUBLIC  FIARQQ, FICRQQ, FIDRQQ, FIERQQ, FISRQQ, FIWRQQ
  16275.       PUBLIC  FJARQQ, FJCRQQ, FJSRQQ
  16276.  
  16277.       FIARQQ    EQU  0
  16278.       FICRQQ    EQU  0
  16279.       FIDRQQ    EQU  0
  16280.       FIERQQ    EQU  0
  16281.       FISRQQ    EQU  0
  16282.       FIWRQQ    EQU  0
  16283.       FJARQQ    EQU  0
  16284.       FJCRQQ    EQU  0
  16285.       FJSRQQ    EQU  0
  16286.  
  16287.       extrn   __fpmath:for
  16288.       extrn   __fpsignal:for
  16289.       extrn   __fptaskdata:for
  16290.  
  16291.       CDATA   segment  word  common 'DATA'
  16292.               dw   0
  16293.               dw   __fpmath
  16294.               dw   __fpsignal
  16295.               dw   __fptaskdata
  16296.       CDATA   ends
  16297.  
  16298.       end
  16299.  
  16300.  
  16301.  7.4  Memory-Model Options (/A, /M)
  16302.  
  16303.  The /A option specifies the program's memory model. The memory model defines
  16304.  the rules the compiler uses to organize the program's code and data segments
  16305.  in memory. The following standard memory models are available:
  16306.  
  16307.  Option                          Effect
  16308.  
  16309.  /AL                             Chooses the large memory model
  16310.                                  (default)
  16311.  
  16312.  /AM                             Chooses the medium memory model
  16313.  
  16314.  /AH                             Chooses the huge memory model
  16315.  
  16316.  See Chapter 2, "Selecting a Memory Model," in Microsoft FORTRAN Advanced
  16317.  Topics for a more complete description of these options and the memory
  16318.  models they specify.
  16319.  
  16320.  The floating-point and memory-model options you choose determine the
  16321.  standard library name that FL places in the object file it creates. This
  16322.  library is the one the linker searches for by default. Table 7.1 shows each
  16323.  combination of memory-model and floating-point options and the corresponding
  16324.  library name that FL places in the object file.
  16325.  
  16326.  Table 7.1  FL Options and Default Libraries
  16327.  
  16328.  Floating-Point       Memory-Model     Default
  16329.  Option               Option           Library
  16330.  
  16331.  /FPi87 or /FPc87     /AL or /AH       LLIBFOR7.LIB
  16332.                       /AM              MLIBFOR7.LIB
  16333.  /FPi or /FPc         /AL or /AH       LLIBFORE.LIB
  16334.                       /AM              MLIBFORE.LIB
  16335.  /FPa                 /AL or /AH       LLIBFORA.LIB
  16336.                       /AM              MLIBFORA.LIB
  16337.  
  16338.  
  16339.  The /M option supports the use of dynamic-link and multithread applications
  16340.  in OS/2. These switches cannot be used with the /Am option since threads and
  16341.  dynamic-link libraries are not supported in medium model.
  16342.  
  16343.  Option                          Use
  16344.  
  16345.  /MT                             Multithread applications
  16346.  
  16347.  /MD                             Dynamic-link library and
  16348.                                  multithread applications
  16349.  
  16350.  When the /MT option is used, the program is automatically linked with
  16351.  LLIBFMT.LIB, regardless of the memory model. When the /MD option is used,
  16352.  all default libraries are overridden and you must create your own library,
  16353.  which is then specified on the command line (or when using LINK).
  16354.  
  16355.  Both the /MT and /MD option imply the /G2 (286 instruction set) option,
  16356.  since multithread and dynamic-link library programs run only under OS/2.
  16357.  They also imply the /FPi87 (math coprocessor) option. (This default may be
  16358.  overridden by any other floating-point option except /FPa, which, when used,
  16359.  causes a command-line error.) In addition, the compiler assumes that SS is
  16360.  not equal to DS (the stack may be in a segment other than the default data
  16361.  segment).
  16362.  
  16363.  Both the /MT and /MD options are incompatible with /Fb (bound) and /Lr or
  16364.  /Lc (real mode), since threaded and dynamic-link library applications are
  16365.  assumed to be unbound programs running in protected mode.
  16366.  
  16367.  ───────────────────────────────────────────────────────────────────────────
  16368.  NOTE
  16369.     If you renamed any of the libraries created while running SETUP, the
  16370.     library name embedded in the object file might not match the renamed
  16371.     library (as, for example, when you use the new default names). In these
  16372.     cases, you must explicitly specify the new library name to the linker.
  16373.     See Section 7.30, "Linking with Libraries," for more information.
  16374.  ───────────────────────────────────────────────────────────────────────────
  16375.  
  16376.  
  16377.  7.5  OS/2 Library Options (/Lp, /Lr, /Lc)
  16378.  
  16379.  If you set up the FORTRAN compiler to use DOS, or real-mode or
  16380.  protected-mode OS/2 (but not both modes), you do not need to specify the
  16381.  run-time library on the FL command line.
  16382.  
  16383.  If, however, you created FORTRAN libraries for both real- and protected-mode
  16384.  OS/2, you need to tell the FL command whether to use the real-mode or the
  16385.  protected-mode library.
  16386.  
  16387.  The following options are used to specify OS/2 libraries:
  16388.  
  16389.  Option                          Effect
  16390.  
  16391.  /Lp                             Specifies protected-mode
  16392.                                  libraries
  16393.  
  16394.  /Lr                             Specifies real-mode libraries
  16395.  
  16396.  /Lc                             Same as /Lr, but used by IBM C
  16397.                                  compiler; provided for
  16398.                                  compatibility
  16399.  
  16400.  The example below compiles and links the source file QSORT.FOR to create a
  16401.  real-mode program that can run under both DOS and the OS/2 compatibility
  16402.  box:
  16403.  
  16404.       FL  /Lr  QSORT.FOR
  16405.  
  16406.  (The /Lc option could have been used instead, with the same result.)
  16407.  
  16408.  The next example creates a protected-mode .EXE file that runs only under
  16409.  OS/2 protected mode:
  16410.  
  16411.       FL  /Lp  QSORT.FOR
  16412.  
  16413.  When you set up for only one operating system or system mode, SETUP creates
  16414.  only one library. The library has the same name, regardless of whether you
  16415.  set up for MS-DOS, OS/2 real mode, or OS/2 protected mode. The name has the
  16416.  following form:
  16417.  
  16418.  memory LIBFOR arith .LIB
  16419.  
  16420.  The memory argument is a single character indicating the memory model: L for
  16421.  large model, M for medium model, or H for huge model. The arith argument is
  16422.  a single character indicting the math option: 7 for math coprocessor
  16423.  arithmetic, A for arithmetic using the alternate-math package, or E for
  16424.  emulated coprocessor arithmetic. For example, the library LLIBFORA.LIB uses
  16425.  the large memory model and the alternate math package.
  16426.  
  16427.  When you set up for both OS/2 modes, SETUP creates two libraries, with names
  16428.  that have the following form:
  16429.  
  16430.  memory LIBF arith system .LIB
  16431.  
  16432.  The memory and arith arguments are the same as in the single operating
  16433.  system names. The system argument is a single character indicating the
  16434.  operating system mode R for OS/2 real-mode (real-mode libraries can also be
  16435.  used under DOS) and P for OS/2 protected-mode. A library for protected-mode
  16436.  OS/2 using the large memory model and the alternate-math package would have
  16437.  the name LLIBFAP.LIB.
  16438.  
  16439.  Remember that when you are set up for both real- and protected-mode OS/2,
  16440.  you must specify one of the /L options to be sure that the correct library
  16441.  is linked.
  16442.  
  16443.  ───────────────────────────────────────────────────────────────────────────
  16444.  NOTE
  16445.     There are other situations (besides being set up for dual-mode OS/2) when
  16446.     you must specify a link library other than the default library. Section
  16447.     7.30, "Linking with Libraries," explains how you can override the default
  16448.     library selection and specify another library.
  16449.  ───────────────────────────────────────────────────────────────────────────
  16450.  
  16451.  
  16452.  7.6  Data Threshold Option (/Gt)
  16453.  
  16454.  
  16455.  Option
  16456.  
  16457.  /Gt«number»
  16458.  
  16459.  The /Gt option sets the data threshold, a cutoff value the compiler uses
  16460.  when allocating data.
  16461.  
  16462.  In the medium memory model, the compiler allocates all static and global
  16463.  data items within the default data segment. In the large and huge models,
  16464.  the compiler allocates only initialized static and global data items to the
  16465.  default data segment.
  16466.  
  16467.  The /Gt option can be used only with large- and huge-model programs, since
  16468.  medium-model programs have only one data segment. This option is
  16469.  particularly useful with programs that have more than 64K of initialized
  16470.  static and global data as small data items.
  16471.  
  16472.  The /Gt option causes all data items whose size is greater than or equal to
  16473.  number bytes to be allocated to a new data segment outside the default data
  16474.  segment that is accessed with a far address. When the /Gt option is omitted,
  16475.  the default threshold value is 32,767 bytes. When the /Gt option is given,
  16476.  but no number is specified, the default threshold value is 256 bytes. When
  16477.  number is specified, it must immediately follow /Gt, with no intervening
  16478.  spaces.
  16479.  
  16480.  
  16481.  7.7  Naming and Organizing Segments (/ND, /NM, /NT)
  16482.  
  16483.  
  16484.  Options
  16485.  
  16486.  /NT textsegment /ND datasegment /NM textsegment
  16487.  
  16488.  An object-code file is sometimes referred to as a "module." A module can
  16489.  contain a main program, one or more procedures, or any combination of a main
  16490.  program and procedures.
  16491.  
  16492.  A "segment" is a contiguous block of code or data produced by the compiler.
  16493.  Every module has at least two segments: a text segment containing the
  16494.  program code (machine instructions), and a data segment containing the
  16495.  program data.
  16496.  
  16497.  All segments have names. Text segment and data segment names are normally
  16498.  created by the compiler. These default names depend on the memory model
  16499.  chosen. For example, in medium-model programs, the text segment from each is
  16500.  placed in a separate segment with a distinct name, formed from the module
  16501.  base name and the suffix _TEXT. The single data segment is named _DATA.
  16502.  
  16503.  In large- and huge-model programs, the text and data from each module are
  16504.  loaded into separate segments with distinct names. Each text segment is
  16505.  given the name of the module plus the suffix _TEXT. The data from each
  16506.  segment is placed in a private segment with a unique name (except for
  16507.  initialized global and static data that are placed in the default data
  16508.  segment). The naming conventions for text and data segments are summarized
  16509.  in Table 7.2.
  16510.  
  16511.  Table 7.2  Segment-Naming Conventions
  16512.  
  16513.  Model      Text            Data         Module
  16514.  Medium     module_TEXT     _DATA        filename
  16515.  Large      module_TEXT     _DATA       filename
  16516.  Huge       module_TEXT     _DATA       filename
  16517.  
  16518.  
  16519.  The linker uses segment names to define the order in which the segments of
  16520.  the program appear in memory when loaded for execution. (The segments in the
  16521.  group named DGROUP are an exception.) Segments with the same name (both
  16522.  module and suffix) are loaded into the same physical memory segment.
  16523.  
  16524.  The /NT (nametext) and /ND (namedata) options override the default names
  16525.  supplied by the compiler. This allows you, for example, to give two
  16526.  different modules the same text-segment name, ensuring that both are loaded
  16527.  into the same memory segment. This is useful when you wish to give a
  16528.  procedure the NEAR attribute, because it means the contents of the code
  16529.  segment (CS) register need not be changed when the procedure is called.
  16530.  
  16531.  If you change the name of the default data segment using /ND, there is no
  16532.  guarantee the data segment (DS) register will have the same value as the
  16533.  stack segment (SS) register. In this case, the compiler automatically
  16534.  generates code to load the DS register with the correct data-segment value
  16535.  on entry to the code and restores the previous value upon exit.
  16536.  
  16537.  The textsegment and datasegment arguments can be any combination of letters
  16538.  and digits.
  16539.  
  16540.  In previous versions of FL, the /NM option changed the name of a module. In
  16541.  the version supplied with FORTRAN 5.0, /NM is identical to the /NT option.
  16542.  
  16543.  
  16544.  7.8  Creating Bound Program Files (/Fb)
  16545.  
  16546.  Option                          Effect
  16547.  
  16548.  /Fb                             Creates a bound .EXE file with
  16549.                                  the source file base name
  16550.  
  16551.  /Fbfilename                     Creates a bound file named
  16552.                                  filename.EXE and a protected-mode
  16553.                                  .EXE file with the source file
  16554.                                  base name
  16555.  
  16556.  To create a bound program that can run under OS/2 or DOS, use a command of
  16557.  the following type:
  16558.  
  16559.       FL  /Lp  /Fb  QSORT.FOR
  16560.  
  16561.  To create both a protected-mode .EXE file and a bound .EXE file, specify a
  16562.  file name that is different from the base name of the source file:
  16563.  
  16564.       FL  /Lp  /FbQSORTB  QSORT.FOR
  16565.  
  16566.  In the preceding example, the protected-mode program QSORT.EXE is created
  16567.  first, then the bound program QSORTB.EXE is created. If the name given in
  16568.  the /Fb option is the same as the base name of the source file, the bound
  16569.  program file overwrites the protected-mode program that was created first.
  16570.  
  16571.  In order for the /Fb option to work, the files DOSCALLS.LIB, APILMR.OBJ, and
  16572.  API.LIB must be in the current directory or in one of the directories
  16573.  specified in the LIB environment variable.
  16574.  
  16575.  The file APILMR.OBJ is automatically bound with the program. If your
  16576.  medium-model program does not use allocatable arrays, and if you do not wish
  16577.  to reserve a full 64K DGROUP, run the BIND command manually, specifying the
  16578.  /n switch and omitting APILMR.OBJ. See the Microsoft CodeView and Utilities
  16579.  User's Guide for information about the BIND command.
  16580.  
  16581.  If you use the /Fm (map) option with the /Fb option, the resulting map file
  16582.  contains the map from BIND, rather than the linker map.
  16583.  
  16584.  When you bind mixed-language executable files that have non-Family API
  16585.  calls, you must execute the BIND command directly and specify the /n switch.
  16586.  See Chapter 4, "Mixed-Language Programming," of Microsoft FORTRAN Advanced
  16587.  Topics for more information.
  16588.  
  16589.  
  16590.  7.9  FORTRAN-Specific Options (/4Y, /4N)
  16591.  
  16592.  The following options begin with the numeral 4, indicating they are specific
  16593.  to FORTRAN 77. The letter Y (yes) indicates the option is enabled, and the
  16594.  letter N (no) indicates it is disabled.
  16595.  
  16596.  More than one /4 option may appear on the command line. An option applies to
  16597.  all the files succeeding it, until a conflicting or canceling option removes
  16598.  its effect for any remaining files. A contradictory metacommand within a
  16599.  file overrides the effect of a command-line option for that file only.
  16600.  
  16601.  The /4 options may be combined. For example, /4Ysfb disables all Microsoft
  16602.  FORTRAN extensions, permits free-form entry, and enables extended error
  16603.  handling. Note that groups of Y and N options must appear as separate
  16604.  command-line options; they cannot be mixed in a single option.
  16605.  
  16606.  
  16607.  7.9.1  Controlling Optional Language Features (/4Ys, /4Yi, /4Yv)
  16608.  
  16609.  Option                          Effect
  16610.  
  16611.  /4{Y | N}s                      Disables (Y) or enables (N) all
  16612.                                  Microsoft FORTRAN extensions
  16613.  
  16614.  /4{Y | N}i                      Enables (Y) only SAA extensions;
  16615.                                  disables (N) full Microsoft
  16616.                                  FORTRAN extensions
  16617.  
  16618.  /4{Y | N}v                      Enables (Y) only VAX extensions;
  16619.                                  disables (N) full Microsoft
  16620.                                  FORTRAN extensions
  16621.  
  16622.  Microsoft FORTRAN includes many optional features that are not part of
  16623.  ANSI-standard FORTRAN. All these extensions are normally available by
  16624.  default. To disable all of them, use the /4Ys command-line switch. Any
  16625.  language feature which is not part of the strict FORTRAN 77 definition is
  16626.  then tagged by the compiler as an error. (The /4Ys option is equivalent to
  16627.  the $STRICT metacommand at the beginning of the file.)
  16628.  
  16629.  The /4Ys option applies to all source-code files following it on the command
  16630.  line, unless the /4Ns option disables it for any of the remaining files. The
  16631.  $NOTSTRICT metacommand within a file overrides the /4Ys command option for
  16632.  that file only. The $STRICT metacommand within a file overrides the /4Ns
  16633.  command option for that file only.
  16634.  
  16635.  Many Microsoft FORTRAN extensions fall into one of two categories: IBM SAA
  16636.  (Systems Application Architecture) extensions, and DEC(R) VAX extensions.
  16637.  
  16638.  To simplify porting code from an SAA or VAX environment to a personal
  16639.  computer, you can disable all Microsoft FORTRAN extensions except the SAA
  16640.  extensions, or disable all Microsoft FORTRAN extensions except the VAX
  16641.  extensions. (The compiler recognizes only the strict FORTRAN 77 language
  16642.  plus either the SAA or the VAX extensions, but not both.)
  16643.  
  16644.  This is done with the /4Yi and /4Yv options, respectively. Either option
  16645.  applies to all files following it on the command line, until the /4Ni or
  16646.  /4Nv option reverts to using only Microsoft FORTRAN extensions.
  16647.  
  16648.  Microsoft FORTRAN includes all IBM SAA extensions, which are listed below:
  16649.  
  16650.    ■  31-character names
  16651.  
  16652.    ■  Bit-manipulation intrinsic
  16653.  
  16654.    ■  Case-insensitive source
  16655.  
  16656.    ■  COMMON allows character and noncharacter in same block
  16657.  
  16658.    ■  CONJG, HFIX, and IMAG intrinsic functions
  16659.  
  16660.    ■  Data initialization in type statements
  16661.  
  16662.    ■  EQUIVALENCE allows association of character and noncharacter
  16663.  
  16664.    ■  Functions IOR, IAND, NOT, IEOR, ISHFT, BTEST, IBSET, and IBCLR
  16665.  
  16666.    ■  IMPLICIT NONE
  16667.  
  16668.    ■  INCLUDE compiler directive
  16669.  
  16670.    ■  INTEGER*2, COMPLEX*16, and LOGICAL*1 data types
  16671.  
  16672.    ■  Optional length specifications in INTEGER, REAL, COMPLEX, and LOGICAL
  16673.       type statements
  16674.  
  16675.    ■  Use of underscore (_) in names
  16676.  
  16677.    ■  Z edit descriptor
  16678.  
  16679.  Microsoft FORTRAN includes many (but not all) VAX extensions, which are
  16680.  listed below:
  16681.  
  16682.    ■  31-character names
  16683.  
  16684.    ■  ACCESS selector 'APPEND' in the OPEN statement
  16685.  
  16686.    ■  Allowing integer arrays to contain FORMAT statements
  16687.  
  16688.    ■  BLOCKSIZE and NML I/O keywords
  16689.  
  16690.    ■  Debug comment lines
  16691.  
  16692.    ■  DO statements without specified labels
  16693.  
  16694.    ■  DO WHILE statement
  16695.  
  16696.    ■  END DO statement
  16697.  
  16698.    ■  EQUIVALENCE of character and noncharacter items
  16699.  
  16700.    ■  EQUIVALENCE to a multi-dimensioned array with only one subscript
  16701.  
  16702.    ■  Exponentiation of REAL and COMPLEX statements
  16703.  
  16704.    ■  IMPLICIT NONE
  16705.  
  16706.    ■  INCLUDE compiler directive
  16707.  
  16708.    ■  Initialization on the declaration line
  16709.  
  16710.    ■  In-line comments
  16711.  
  16712.    ■  Length specification within the FUNCTION statement
  16713.  
  16714.    ■  Length specifications within type declarations
  16715.  
  16716.    ■  Mixing of character and noncharacter items in COMMON statements
  16717.  
  16718.    ■  Noninteger alternate return values
  16719.  
  16720.    ■  Noninteger array subscripts
  16721.  
  16722.    ■  Numeric operands for .AND., .OR., etc.
  16723.  
  16724.    ■  Specified common-block variables in DATA statements outside a BLOCK
  16725.       DATA subroutine
  16726.  
  16727.    ■  STRUCTURE, UNION, MAP statements
  16728.  
  16729.    ■  Up to 99 continuation lines
  16730.  
  16731.    ■  Use of dollar sign ($) in names
  16732.  
  16733.    ■  .XOR. operator
  16734.  
  16735.  
  16736.  7.9.2  Controlling Source-File Syntax (/4Yf, /4Nf, /4Yt, /4Nt, /4Y6, /4N6)
  16737.  
  16738.  Option                          Effect
  16739.  
  16740.  /4{Y | N}f                      Enables (Y) or disables (N)
  16741.                                  free-form format
  16742.  
  16743.  /4{Y | N}t                      Enables (Y) or disables (N)
  16744.                                  truncation of variable names
  16745.  
  16746.  /4{Y | N}6                      Enables (Y) or disables (N)
  16747.                                  FORTRAN 66-style DO statements
  16748.  
  16749.  These options control the structure of a FORTRAN source file and two
  16750.  elements of FORTRAN syntax. They correspond to FORTRAN metacommands which
  16751.  are described in detail in Chapter 6, "Metacommands." The following list
  16752.  gives the metacommand corresponding to each option and identifies the
  16753.  option's default:
  16754.  
  16755.  Option                          Metacommand
  16756.  
  16757.  /4Yf                            $FREEFORM
  16758.  
  16759.  /4Nf (default)                  $NOFREEFORM
  16760.  
  16761.  /4Yt                            $TRUNCATE
  16762.  
  16763.  /4Nt (default)                  $NOTRUNCATE
  16764.  
  16765.  /4Y6                            $DO66
  16766.  
  16767.  /4N6 (default)                  None
  16768.  
  16769.  Each option has the same effect as placing the corresponding metacommand at
  16770.  the beginning of the source file. A conflicting metacommand in the source
  16771.  file overrides the command-line option for that file only. No error occurs
  16772.  if an option is used with a file that already contains the corresponding
  16773.  metacommand.
  16774.  
  16775.  
  16776.  Examples
  16777.  
  16778.       FL  /c  /4Yds  TEST.FOR  /4Nd  STABLE.FOR
  16779.  
  16780.  The command line above causes FL to compile TEST.FOR using truncation
  16781.  (disallowing all Microsoft extensions). The declare option is also enabled,
  16782.  so use of undeclared variables produces warning messages. When the second
  16783.  file, STABLE.FOR, is compiled, the truncation is still in effect, but the
  16784.  declare option is disabled.
  16785.  
  16786.       FL  /4Yf  /4Nt  *.FOR
  16787.  
  16788.  The command line above enables free-form format and disables truncation of
  16789.  variable names when compiling and linking all source files in the current
  16790.  working directory.
  16791.  
  16792.  
  16793.  7.9.2.1  The Debug Option
  16794.  
  16795.  
  16796.  Option
  16797.  
  16798.  /4{Y | N}b
  16799.  
  16800.  The debug option controls extended error handling at run time. It provides
  16801.  information to be used by the error-handling system in the program file. See
  16802.  the discussion of the $DEBUG metacommand in Chapter 6 for a description of
  16803.  the types of errors that are detected in extended error handling. When the
  16804.  debug option is enabled, loop optimization in the program is disabled.
  16805.  
  16806.  Debugging is enabled by giving the /4Yb option, and disabled with /4Nb. By
  16807.  default, debugging is disabled.
  16808.  
  16809.  The debug option has the same effect as a $DEBUG or $NODEBUG metacommand at
  16810.  the beginning of the source file being compiled. If a $DEBUG or $NODEBUG
  16811.  metacommand appears later in the file being compiled, debugging for that
  16812.  file is enabled or disabled, as appropriate.
  16813.  
  16814.  The /4Yb option does not accept a string argument for conditional
  16815.  compilation. Use the /4cc option, described in Section 7.9.5, instead.
  16816.  
  16817.  
  16818.  Examples
  16819.  
  16820.       FL  MAIN.FOR  /4Yb  /Fs  TEST.FOR
  16821.  
  16822.  The example above compiles and links two files. Debugging is enabled for
  16823.  TEST.FOR, and a source listing named TEST.LST is created. Neither the
  16824.  debugging option nor the source-listing option applies to MAIN.FOR.
  16825.  
  16826.       FL  /c  /4Ybd  ONE.FOR  /4Nd  TWO.FOR
  16827.  
  16828.  The example above compiles ONE.FOR with both the debug and declare options
  16829.  enabled. (The following section describes the declare option.) The declare
  16830.  option is disabled when compiling TWO.FOR, but the debug option is still in
  16831.  effect.
  16832.  
  16833.  ───────────────────────────────────────────────────────────────────────────
  16834.  NOTE
  16835.     The /4Yb and /Zi options are incompatible. See Section 7.22 for more
  16836.     information on /Zi .
  16837.  ───────────────────────────────────────────────────────────────────────────
  16838.  
  16839.  
  16840.  7.9.2.2  The Declare Option
  16841.  
  16842.  
  16843.  Option
  16844.  
  16845.  /4{Y | N}d
  16846.  
  16847.  The declare option controls warnings about undeclared variables. When the
  16848.  declare option is enabled, the compiler generates a warning message at the
  16849.  first use of any variable which has not been declared in a type statement.
  16850.  
  16851.  The /4Yd option enables the declare option and /4Nd disables it. The declare
  16852.  option is disabled by default (unless a $DECLARE metacommand is in the
  16853.  source file).
  16854.  
  16855.  The declare compiler option has the same effect as a $DECLARE metacom-mand
  16856.  or a $NODECLARE metacommand at the beginning of each source file. If
  16857.  $DECLARE or $NODECLARE metacommands appear later in the file, warnings are
  16858.  enabled or disabled, as appropriate. Note that if the source file contains a
  16859.  $DECLARE or $NODECLARE metacommand at the beginning, the /4Yd or /4Nd option
  16860.  has no effect.
  16861.  
  16862.  
  16863.  Examples
  16864.  
  16865.       FL  /4Ybd  *.FOR > DECLARE
  16866.  
  16867.  The example above compiles and links all source files with the default
  16868.  extension (.FOR) in the current working directory. The debug and declare
  16869.  options are both enabled. All messages (including warnings about undeclared
  16870.  variables) are redirected to the file DECLARE.
  16871.  
  16872.       FL  /4Yb  ONE.FOR  /4Yd  TWO.FOR
  16873.  
  16874.  The example above turns on debugging for both ONE.FOR and TWO.FOR; the
  16875.  declare option is also enabled for TWO.FOR.
  16876.  
  16877.  
  16878.  7.9.3  Automatic Variables
  16879.  
  16880.  
  16881.  Option
  16882.  
  16883.  /4{Y | N}a
  16884.  
  16885.  The /4Ya option causes all eligible variables in the succeeding files to be
  16886.  automatic. They are declared on the stack. (In Microsoft FORTRAN, the
  16887.  default is that all variables are static. They have defined memory
  16888.  locations.) The /4Na option disables automatic variables (except as declared
  16889.  within the program) for succeeding files. For more information, see the
  16890.  AUTOMATIC entry in Section 4.2, "Statement Directory."
  16891.  
  16892.  
  16893.  7.9.4  Setting the Default Integer Size (/4I2, /4I4)
  16894.  
  16895.  
  16896.  Option
  16897.  
  16898.  /4I{ 2 | 4}
  16899.  
  16900.  The /4I option allocates either 2 or 4 bytes of memory for all variables
  16901.  declared in the source file as INTEGER or LOGICAL variables. The default
  16902.  allocation is 4 bytes. The /4I option applies to the remainder of the
  16903.  command line or until another /4I option appears.
  16904.  
  16905.  
  16906.  Example
  16907.  
  16908.       FL  /4I2  /FeTESTPROG  *.FOR
  16909.  
  16910.  This example allocates 2 bytes of memory for INTEGER and LOGICAL variables
  16911.  when compiling and linking all source files in the current working
  16912.  directory. The executable file is named TESTPROG.EXE.
  16913.  
  16914.  The /4I option has the same effect as a $STORAGE metacommand at the top of
  16915.  each file that is being compiled. If a $STORAGE metacommand already appears
  16916.  in the file being compiled, the size given by the metacommand is used. The
  16917.  $STORAGE metacommand in a particular file affects only that file and does
  16918.  not change the effects of /4I on any other files on the command line. See
  16919.  Chapter 6,"Metacommands," for more information on the $STORAGE metacommand.
  16920.  
  16921.  
  16922.  7.9.5  Conditional Compilation (/4cc, /D)
  16923.  
  16924.  
  16925.  Options
  16926.  
  16927.  /4ccstring /Dsymbol«=val»
  16928.  
  16929.  The /4cc option permits conditional compilation of a source file. The string
  16930.  is a set of alphabetic characters controlling which lines in the source file
  16931.  are to be compiled.
  16932.  
  16933.  Any line with a letter in column 1 found in string is compiled; lines
  16934.  beginning with other letters are treated as comments. All lines not
  16935.  beginning with letters are compiled normally. Case is not significant. The
  16936.  letter must appear in column 1 of the source-file line.
  16937.  
  16938.  The string can be enclosed in quotation marks ("") if desired, but the
  16939.  quotation marks are not required.
  16940.  
  16941.  ───────────────────────────────────────────────────────────────────────────
  16942.  NOTE
  16943.     Program lines with the character C or c in column 1 are always treated as
  16944.     comments.
  16945.  ───────────────────────────────────────────────────────────────────────────
  16946.  
  16947.  
  16948.  Example
  16949.  
  16950.       FL  /c  /4ccXYZ  PRELIM.FOR
  16951.  
  16952.  In this example, all lines in the file PRELIM.FOR beginning with  X, Y, or Z
  16953.  are compiled.
  16954.  
  16955.  The /D option defines a symbolic name used by the conditional compilation
  16956.  metacommands. It is equivalent to the $DEFINE metacommand within the program
  16957.  file. The name must immediately follow /D, with no intervening space.
  16958.  
  16959.  An equal sign and integer value may be added. This assigns a specific value
  16960.  to the symbol that the conditional-compilation metacommands can check.
  16961.  
  16962.  
  16963.  Examples
  16964.  
  16965.       FL /Dtestprocs foo.for
  16966.       FL /Dwhichpart=4 foo.for
  16967.  
  16968.  In the first example, the symbol testprocs is defined. The compiler will
  16969.  then evaluate any DEFINED  (testprocs)  expression in the
  16970.  conditional-compilation metacommands as true (unless an  $UNDEFINE testprocs
  16971.  metacommand in the program file cancels the definition).
  16972.  
  16973.  In the second example, the symbol whichpart is defined and given the integer
  16974.  value four.
  16975.  
  16976.  
  16977.  7.10  Specifying Source Files (/Tf, /Ta)
  16978.  
  16979.  
  16980.  Options
  16981.  
  16982.  /Tf« »sourcefile /Ta« »sourcefile
  16983.  
  16984.  The FL command assumes that any filename ending in .FOR is a FORTRAN source
  16985.  file, and invokes the compiler. Likewise, the FL command assumes that any
  16986.  filename ending in .ASM is an assembly source file, and tries to invoke the
  16987.  Microsoft assembler. If your files do not have these identifying extensions,
  16988.  you can use the /Tf and /Ta options to specify that the following filename
  16989.  is a FORTRAN or assembly file, respectively.
  16990.  
  16991.  If you have to specify more than one source file with an extension other
  16992.  than .FOR or .ASM, it is safest to list each source file in a separate /Tf
  16993.  or /Ta option. Although a sourcefile with a wild-card character is legal,
  16994.  this use of wild-card characters may cause problems. If a sourcefile with a
  16995.  wild-card character represents a single file, then FL behaves as expected:
  16996.  it considers that single file to be a FORTRAN (or assembly-language) source
  16997.  file. However, if a sourcefile with a wild-card character represents more
  16998.  than one file, FL treats only the first file as a FORTRAN (or
  16999.  assembly-language) source file. It treats any other files that sourcefile
  17000.  represents as object files. Masm must be in the path where the FL command
  17001.  can find it.
  17002.  
  17003.  
  17004.  Examples
  17005.  
  17006.       FL  MAIN.FOR  /TfTEST.PRG  /TfCOLLATE.PRG  PRINT.PRG
  17007.  
  17008.  In the example above, the FL command compiles the three source files
  17009.  MAIN.FOR, TEST.PRG, and COLLATE.PRG. Since the file PRINT.PRG is given
  17010.  without a /Tf option, FL treats it as an object file. Thus, after compiling
  17011.  the three source files, FL links the object files MAIN.OBJ, TEST.OBJ,
  17012.  COLLATE.OBJ, and PRINT.PRG.
  17013.  
  17014.       FL  /TfTEST?.F
  17015.  
  17016.  For the example above, assume the files TEST1.F, TEST2.F, and TEST3.F all
  17017.  exist in the current directory. In this example, the FL command would
  17018.  compile TEST1.F as a FORTRAN program and then try to treat TEST2.F and
  17019.  TEST3.F as object files. The FL command shown above would have the same
  17020.  effect as the following FL command:
  17021.  
  17022.       FL  /TfTEST1.F  TEST2.F  TEST3.F
  17023.  
  17024.  If your program is compiled using the /Tf option, you must explicitly select
  17025.  the FORTRAN expression evaluator when using the CodeView debugger. CodeView
  17026.  only uses the FORTRAN evaluator as the default when the source file has the
  17027.  .FOR extension.
  17028.  
  17029.  The /Ta option is used with the /MA option. The /MA option specifies that
  17030.  the following file is a Microsoft Assembler (MASM) file, and the file is to
  17031.  be assembled and linked with the program. If the file name does not end in
  17032.  .ASM, you must use the /Ta option to specify the full file name. The space
  17033.  between /Ta and sourcefile is optional.
  17034.  
  17035.  
  17036.  7.11  Compiling without Linking (/c)
  17037.  
  17038.  
  17039.  Option
  17040.  
  17041.  /c
  17042.  
  17043.  The /c (compile-only) option suppresses linking. Source files are compiled,
  17044.  but the resulting object files are not linked, no executable file is
  17045.  created, and any object files specified are ignored. This option is useful
  17046.  when you are compiling individual source files that do not make up a
  17047.  complete program.
  17048.  
  17049.  The /c option applies to the entire FL command line, regardless of the
  17050.  option's position on the command line.
  17051.  
  17052.  
  17053.  Example
  17054.  
  17055.       FL  /c *.FOR
  17056.  
  17057.  This command line compiles, but does not link, all files with the extension
  17058.  .FOR in the current working directory.
  17059.  
  17060.  
  17061.  7.12  Naming the Object File (/Fo)
  17062.  
  17063.  
  17064.  Option
  17065.  
  17066.  /Foobjfile
  17067.  
  17068.  By default, FL gives each object file the same base name as the
  17069.  corresponding source file, plus the extension .OBJ. The /Fo option gives an
  17070.  object file a different name or creates it in a different directory.
  17071.  
  17072.  The objfile argument must appear immediately after the option, with no
  17073.  intervening spaces. The objfile argument can be a file specification, a
  17074.  drive name, or a path specification.
  17075.  
  17076.  If objfile is a file specification, the /Fo option applies only to the
  17077.  source file immediately following the option on the command line. The object
  17078.  file created by compiling that source file has the name given by objfile.
  17079.  
  17080.  If objfile is a drive name or path specification, the FL command creates
  17081.  object files in the given location for every source file following the /Fo
  17082.  option on the command line. The object files take their default names (each
  17083.  object file has the base name of the corresponding source file).
  17084.  
  17085.  ───────────────────────────────────────────────────────────────────────────
  17086.  NOTE
  17087.     When you give only a path specification, the objfile argument must end
  17088.     with a backslash ( \ ) so that FL can distinguish between it and an
  17089.     ordinary file name.
  17090.  ───────────────────────────────────────────────────────────────────────────
  17091.  
  17092.  You can use any name or extension you like for objfile. However, it is
  17093.  recommended that you use the conventional .OBJ extension because the FL
  17094.  command, as well as the LINK and LIB utilities, expects .OBJ when processing
  17095.  object files. If you choose an object-file name that lacks an extension, FL
  17096.  automatically adds the .OBJ extension. However, if you pick a name with a
  17097.  blank extension (a name ending in a period), FL does not add an extension.
  17098.  
  17099.  
  17100.  Examples
  17101.  
  17102.       FL  /c  /FoSUB\THAT  THIS.FOR
  17103.  
  17104.  The example above compiles the file THIS.FOR and creates an object file
  17105.  named THAT.OBJ in the subdirectory SUB. Note that FL automatically appends
  17106.  the .OBJ extension. Linking is suppressed because the /c option is given.
  17107.  
  17108.       FL  /FoB:\OBJECT\  *.FOR
  17109.  
  17110.  The example above compiles and links all source files with the extension
  17111.  .FOR in the current working directory. The option /FoB:\OBJECT\  tells FL to
  17112.  create all the object files in the directory named OBJECT on drive B. Each
  17113.  object file has the base name of the corresponding source file, plus the
  17114.  exten-sion .OBJ.
  17115.  
  17116.  
  17117.  7.13  Naming the Executable File (/Fe)
  17118.  
  17119.  
  17120.  Option
  17121.  
  17122.  /Feexefile
  17123.  
  17124.  By default, the executable file produced by the FL command is given the base
  17125.  name of the first file (source or object) on the command line, plus the
  17126.  extension .EXE. The /Fe option gives the executable file a different name or
  17127.  creates it in a different directory.
  17128.  
  17129.  Since only one executable file is created, it does not matter where the /Fe
  17130.  option appears on the command line. If the /Fe option appears more than
  17131.  once, the last name prevails.
  17132.  
  17133.  /Fe applies only during linking. If /c suppresses linking, /Fe has no
  17134.  effect.
  17135.  
  17136.  The exefile argument must appear immediately after the option, with no
  17137.  intervening spaces. The exefile argument can be a file specification, a
  17138.  drive name, or a path specification.
  17139.  
  17140.  If exefile is a file specification, the executable file is given the
  17141.  specified name. If exefile is a drive name or path specification, the FL
  17142.  command creates the executable file in the given location, using the default
  17143.  name (the base name of the first file plus .EXE).
  17144.  
  17145.  ───────────────────────────────────────────────────────────────────────────
  17146.  NOTE
  17147.     When you give a path specification as the exefile argument, the path
  17148.     specification must end with a backslash ( \ ) so that FL can distinguish
  17149.     it from an ordinary file name.
  17150.  ───────────────────────────────────────────────────────────────────────────
  17151.  
  17152.  You can give any name or extension you like for the exefile. If you give a
  17153.  file name without an extension, FL automatically appends the .EXE extension.
  17154.  If you pick a name with a blank extension (a name ending in a period), FL
  17155.  does not add an extension.
  17156.  
  17157.  
  17158.  Examples
  17159.  
  17160.       FL  /FeC:\BIN\PROCESS  *.FOR
  17161.  
  17162.  The example above compiles and links all source files in the current working
  17163.  directory with the extension .FOR. The resulting executable file is named
  17164.  PROCESS.EXE and is created in the directory C:\BIN.
  17165.  
  17166.       FL  /FeC:\BIN\  *.FOR
  17167.  
  17168.  The example above is similar to the first example except that the executable
  17169.  file, instead of being named PROCESS.EXE, is given the same base name as the
  17170.  first file compiled. The executable file is created in the directory C:\BIN.
  17171.  
  17172.  
  17173.  7.14  Creating Listing Files (/F)
  17174.  
  17175.  The FL command offers a number of listing options. You can create a source
  17176.  listing, a map listing, or one of several kinds of object listings. You can
  17177.  also set the title and subtitle of the source listing and control the length
  17178.  of source-listing lines and pages.
  17179.  
  17180.  The FL command optimizes by default, so object listings reflect the
  17181.  optimized code. Since optimization may involve rearranging the code, the
  17182.  correspondence between your source file and the machine instructions may not
  17183.  be clear, especially when you use the /Fc option to mingle the source and
  17184.  assembly code. To suppress optimization, use the /Od option, discussed in
  17185.  Section 7.22.
  17186.  
  17187.  ───────────────────────────────────────────────────────────────────────────
  17188.  NOTE
  17189.     Listings may contain names that begin with one or more underscores (for
  17190.     example, __chkstk) or that end with the suffix QQ. Names that use these
  17191.     conventions are reserved for internal use by the compiler.
  17192.  ───────────────────────────────────────────────────────────────────────────
  17193.  
  17194.  The following is a list of options that produce listings and control their
  17195.  appearances:
  17196.  
  17197.  Option                  Effect
  17198.  
  17199.  /Fs«listfile»           Produces source listing
  17200.  
  17201.  /Fl«listfile»           Produces object listing
  17202.  
  17203.  /Fa«listfile»           Produces assembly listing
  17204.  
  17205.  /Fc«listfile»           Produces combined source and
  17206.                          object listing
  17207.  
  17208.  /Fm«mapfile»            Produces map file that lists
  17209.                          segments in order
  17210.  
  17211.  This section describes how to use command-line options to create listings.
  17212.  For an example of each type of listing and a description of the information
  17213.  it contains, see Section 7.18, "Formats for Listings."
  17214.  
  17215.  The options in this section require the listfile or mapfile argument (if
  17216.  given) to follow the option immediately, with no intervening spaces. The
  17217.  listfile can be a file specification, a drive name, or a path specification.
  17218.  It can also be omitted.
  17219.  
  17220.  ───────────────────────────────────────────────────────────────────────────
  17221.  NOTE
  17222.     When you give only a path specification as the listfile argument, the
  17223.     path specification must end with a backslash ( \ ) so that FL can
  17224.     distinguish it from an ordinary file name.
  17225.  ───────────────────────────────────────────────────────────────────────────
  17226.  
  17227.  When you give a drive name or path specification as the argument to a
  17228.  listing option, or if you omit the argument altogether, FL uses the base
  17229.  name of the source file, plus the default extensions, to create a default
  17230.  file name. Table 7.3 lists the default file names and default extensions,
  17231.  which are used when you give a file-name argument that lacks an extension.
  17232.  
  17233.  Table 7.3  Default File Names and Extensions
  17234.  
  17235.                    Default           Default
  17236.  Option            Listing Type      File Name                 Extension
  17237.  
  17238.  /Fs               Source            Base name of source        .LST
  17239.                                      file plus .LST
  17240.  
  17241.  /Fl               Object            Base name of source        .COD
  17242.                                      file plus .COD
  17243.  
  17244.  /Fa               Assembly          Base name of source        .ASM
  17245.                                      file plus .ASM
  17246.  
  17247.  /Fc               Combined          Base name of source        .COD
  17248.                    source-object     file plus .COD
  17249.  
  17250.  /Fm               Map               Base name of first         .MAP
  17251.                                      source or object file
  17252.                                      on the command line
  17253.                                      plus .MAP
  17254.  
  17255.  
  17256.  Since you can process more than one file at a time with the FL command, the
  17257.  order in which you give listing options and the kind of argument you give
  17258.  for each option (file specification, path specification, or drive name) are
  17259.  significant. Table 7.4 summarizes the effects of each option with each type
  17260.  of argument.
  17261.  
  17262.  Table 7.4  Arguments to Listing Options
  17263.  
  17264.                 Drive-Name
  17265.                 File-Name                  or Path                    No
  17266.  Option         Argument                   Argument                  Argument
  17267.  
  17268.  /Fa, /Fc,      Creates a listing for      Creates listings in        Creates
  17269.  /Fl, /Fs       next source file on        the given location for     in the c
  17270.                 command line; uses         every source file          director
  17271.                 default extension if       listed after the           every so
  17272.                 no extension is            option on the command      file lis
  17273.                 supplied                   line; uses default         after th
  17274.                                            names                      on the c
  17275.                                                                       line; us
  17276.                                                                       default
  17277.  
  17278.  /Fm            Uses given file name       Creates map file in        Uses def
  17279.                 for the map file; uses     the given directory;       name
  17280.                 default extension if       uses default name
  17281.                 no extension is
  17282.                 supplied
  17283.  
  17284.  
  17285.  If a source file includes one or more $NOLIST metacommands, the portion of
  17286.  that source file between each $NOLIST metacommand and the following $LIST
  17287.  metacommand (if any) is omitted from the listing.
  17288.  
  17289.  Only one variation of the object or assembly listing can be produced for
  17290.  each source file. The /Fc option overrides the /Fa and /Fl options; whenever
  17291.  you use /Fc, a combined listing is produced. If you apply both the /Fa and
  17292.  the /Fl options to one source file, only the last listing specified is
  17293.  produced.
  17294.  
  17295.  The map file is produced during the linking stage. If linking is suppressed
  17296.  with the /c option, the /Fm option has no effect.
  17297.  
  17298.  
  17299.  7.15  Special File Names
  17300.  
  17301.  You can use the DOS device names listed below as file-name arguments to the
  17302.  listing options. These special names send listing files to your terminal or
  17303.  printer.
  17304.  
  17305.  Name                          Device
  17306.  
  17307.  AUX                           An auxiliary device.
  17308.  
  17309.  CON                           The console (terminal).
  17310.  
  17311.  PRN                           The printer.
  17312.  
  17313.  NUL                           Specifies a null (nonexistent)
  17314.                                file. Giving NUL as a file name
  17315.                                means that no file is created.
  17316.  
  17317.  Even if you add device designations or file-name extensions to these special
  17318.  file names, they remain associated with the devices listed above. For
  17319.  example, A:CON.tuv still refers to the console and is not the name of a disk
  17320.  file.
  17321.  
  17322.  ───────────────────────────────────────────────────────────────────────────
  17323.  NOTE
  17324.     When using device names, do not add a colon. The Microsoft FORTRAN
  17325.     Compiler does not recognize the colon. For example, use CON or PRN, not
  17326.     CON: or PRN:.
  17327.  ───────────────────────────────────────────────────────────────────────────
  17328.  
  17329.  
  17330.  7.16  Line Size (/Sl) and Page Size (/Sp)
  17331.  
  17332.  
  17333.  Options
  17334.  
  17335.  /Sl« »linesize /Sp« »pagesize
  17336.  
  17337.  The /Sl and /Sp options control the line size and page size of source
  17338.  listings, respectively. The default line size for source listings is 79
  17339.  columns, and the page size is 63 lines. These options are useful for
  17340.  preparing source listings that will be printed on a printer that uses
  17341.  nonstandard page sizes. They are valid only if you also specify the /Fs
  17342.  option on the FL command line. The space between /Sl and linesize, or /Sp
  17343.  and pagesize, is optional.
  17344.  
  17345.  The linesize argument gives the width of the listing line in columns (on
  17346.  line printers, columns usually correspond to characters). The number given
  17347.  must be a positive integer between 79 and 132, inclusive; any number outside
  17348.  this range produces an error message. Any line that exceeds the listing
  17349.  width is truncated.
  17350.  
  17351.  The pagesize argument gives the number of lines on each page of the listing.
  17352.  The minimum number is 15; if a smaller number is given, an error message
  17353.  appears and the default page size is used.
  17354.  
  17355.  The /Sl or /Sp option applies to the remainder of the command line or until
  17356.  the next occurrence of /Sl or /Sp on the command line. These options do not
  17357.  cause source listings to be created. They take effect only when the /Fs
  17358.  option is also given to create a source listing.
  17359.  
  17360.  You can use metacommands in the source file to override the /Sl and /Sp
  17361.  options. These options have the same effects as $LINESIZE and $PAGESIZE
  17362.  metacommands at the top of each file being compiled. If additional $LINESIZE
  17363.  or $PAGESIZE metacommands appear in the file being compiled, the line size
  17364.  or page size for that file is changed accordingly.
  17365.  
  17366.  The $LINESIZE or $PAGESIZE metacommands in a particular file affect only
  17367.  that file and do not change the effects of /Sl or /Sp on any other files on
  17368.  the command line.
  17369.  
  17370.  
  17371.  Examples
  17372.  
  17373.       FL  /c  /Fs  /Sl90  /Sp70  *.FOR
  17374.  
  17375.  The example above compiles all source files with the default extension
  17376.  (.FOR) in the current working directory, creating a source-listing file for
  17377.  each source file. Each page of the source listing is 90 columns wide and 70
  17378.  lines long.
  17379.  
  17380.       FL  /Fs  /Sp70  MAIN.FOR  /Sp63  SUB1.FOR  SUB2.FOR
  17381.  
  17382.  The example above compiles and links three source files, creating an
  17383.  executable file named MAIN.EXE. Three source listings are created: each page
  17384.  of MAIN.LST is 70 lines long, while each page of SUB1.LST and SUB2.LST is 63
  17385.  lines long.
  17386.  
  17387.  
  17388.  7.17  Titles (/St) and Subtitles (/Ss)
  17389.  
  17390.  
  17391.  Options
  17392.  
  17393.  /St« »"title"
  17394.  /Ss« »"subtitle"
  17395.  
  17396.  The /St and /Ss options set the title and subtitle, respectively, for source
  17397.  listings. The quotation marks around the title or subtitle argument can be
  17398.  omitted if the title or subtitle does not contain tabs or spaces. The space
  17399.  between /St and "title", or /Ss and "subtitle", is optional.
  17400.  
  17401.  The title appears in the upper-left corner of each page of the source
  17402.  listing. The subtitle appears below the title.
  17403.  
  17404.  The /St or /Ss option applies to the remainder of the command line or until
  17405.  the next occurrence of /St or /Ss on the command line. These options do not
  17406.  cause source listings to be created. They take effect only when the /Fs
  17407.  option is also used to create a source listing.
  17408.  
  17409.  Both the /St and /Ss options can be overridden by metacommands in the source
  17410.  file. These options have the same effect as $TITLE and $SUBTITLE
  17411.  metacommands at the beginning of the file being compiled. If additional
  17412.  $TITLE or $SUBTITLE metacommands appear in the file, the title or subtitle
  17413.  is changed accordingly.
  17414.  
  17415.  The $TITLE or $SUBTITLE metacommands in a particular file affect only that
  17416.  file and do not change the effects of /St or /Ss on any other files on the
  17417.  command line.
  17418.  
  17419.  
  17420.  Examples
  17421.  
  17422.       FL  /St"INCOME TAX"  /Ss15-APR  /Fs  TAX*.FOR
  17423.  
  17424.  The example above compiles and links all source files beginning with TAX and
  17425.  ending with the default extension (.FOR) in the current working directory.
  17426.  Each page of the source listing contains the title INCOME TAX in the
  17427.  upper-left corner. The subtitle 15-APR appears below the title on each page.
  17428.  
  17429.       FL  /c  /Fs  /St"CALC PROG"  /Ss"COUNT"  CT.FOR  /Ss"SORT"  SRT.FOR
  17430.  
  17431.  The example above compiles two source files and creates two source listings.
  17432.  Each source listing has a unique subtitle, but both listings have the title
  17433.  CALC PROG.
  17434.  
  17435.  
  17436.  7.18  Formats for Listings
  17437.  
  17438.  This section describes and gives examples of the five types of listings
  17439.  available with the FL command. See Section 7.14, "Creating Listing Files,"
  17440.  for information on how to create these listings.
  17441.  
  17442.  
  17443.  Source Listing
  17444.  
  17445.  Source listings are useful in debugging programs during development. These
  17446.  listings can also document the structure of a finished program.
  17447.  
  17448.  The source listing contains the numbered source-code lines of each procedure
  17449.  in the source file, along with expanded include files and any error
  17450.  messages. If the source file compiles with no errors more serious than
  17451.  warnings, the source listing also includes tables of local symbols, global
  17452.  symbols, and parameter symbols for each procedure. If the compiler is unable
  17453.  to finish compilation, it does not generate symbol tables.
  17454.  
  17455.  At the end of the source listing is a summary of segment sizes. This summary
  17456.  is useful when analyzing memory requirements.
  17457.  
  17458.  Error messages appear in the listing after the line that caused the error,
  17459.  as shown in the following example:
  17460.  
  17461.       9   hyp = SQRT ((sidea**2) + (sideb**2)
  17462.       ***** sqroot.for(9) : error F2115: syntax error
  17463.  
  17464.  The line number in the error message corresponds to the number of the source
  17465.  line immediately above the message in the source listing.
  17466.  
  17467.  The example below shows the source listing for a simple FORTRAN program:
  17468.  
  17469.       PAGE   1
  17470.  
  17471.       10-17-86
  17472.  
  17473.       18:20:36
  17474.  
  17475.         Line#  Source Line            Microsoft FORTRAN Compiler Version 5.00
  17476.  
  17477.             1   common a
  17478.             2   dimension a(10)
  17479.             3   real x
  17480.             4   complex c
  17481.             5   real *8 d
  17482.             6   complex *16 e
  17483.             7   character *50 f
  17484.             8   integer*2 j
  17485.             9   parameter (d=123456789.00056, e=-(.00000122, 1234354 e5))
  17486.            10   parameter (f='Note that character strings will be truncated')
  17487.            11   parameter (x=1.2345)
  17488.            12   parameter (c=(.12345, 123456.789), i = 123, j = 100)
  17489.            13   end
  17490.  
  17491.       main  Local Symbols
  17492.  
  17493.       Name                  Class   Type              Size   Offset
  17494.  
  17495.       A . . . . . . . . . . COMMQQ  REAL*4              40    0000
  17496.  
  17497.  
  17498.       Parameter Symbols        Type                Value
  17499.  
  17500.       X . . . . . . . . . . REAL*4            1.2345001E+000
  17501.       C . . . . . . . . . . COMPLEX*8       ( 1.2345000E-001,
  17502.                                               1.2345679E+005)
  17503.       D . . . . . . . . . . REAL*8            1.2345679E+008
  17504.       E . . . . . . . . . . COMPLEX*16      (-1.2199999E-006,-1.2343540E+011)
  17505.       F . . . . . . . . . . CHARACTER       Note that character
  17506.                                             strings will
  17507.       J . . . . . . . . . . INTEGER*2                     100
  17508.       I . . . . . . . . . . INTEGER*4                     123
  17509.  
  17510.  
  17511.  
  17512.       Global Symbols
  17513.  
  17514.       Name                      Class   Type              Size   Offset
  17515.  
  17516.       COMMQQ. . . . . . . . . . common                      40    0000
  17517.       main. . . . . . . . . . . FSUBRT  ***                ***    0000
  17518.  
  17519.       Code size = 0018 (24)
  17520.       Data size = 0000 (0)
  17521.       Bss size  = 0000 (0)
  17522.  
  17523.       No errors detected
  17524.  
  17525.  The Name column lists each global symbol, external symbol, and statically
  17526.  allocated variable declared in the source file. The  Parameter Symbols
  17527.  column lists each symbolic constant defined in a PARAMETER statement.
  17528.  
  17529.  For items other than functions and subroutines, the Class column contains
  17530.  either global, local, equiv, common, or extern, depending on how the symbol
  17531.  was defined. For functions and subroutines, the Class column contains the
  17532.  abbreviations in the following list:
  17533.  
  17534.  Type                                       Abbreviation
  17535.  
  17536.  Far function                               FFUNCT
  17537.  
  17538.  Near function                              NFUNCT
  17539.  
  17540.  Far subroutine                             FSUBRT
  17541.  
  17542.  Near subroutine                            NSUBRT
  17543.  
  17544.  The Type column lists a simplified version of the symbol's type as declared
  17545.  in the source file. The Type entry for functions is the type declared in the
  17546.  source file.
  17547.  
  17548.  The Size column is used only for variables. This column specifies the number
  17549.  of bytes allocated for the variable. Note that the allocation for an
  17550.  external array may be unknown, so its Size field may be undefined.
  17551.  
  17552.  The Offset column is used only for symbols with a global  or local entry in
  17553.  the Class field. For variables, the Offset column gives the variable's
  17554.  relative offset in the logical data segment for the program file. (Even if a
  17555.  program file contains more than one compilation unit, all data is allocated
  17556.  in the same data segment.) Since the linker generally combines several
  17557.  logical data segments into a physical segment, this number is useful only
  17558.  for determining a variable's relative storage position.
  17559.  
  17560.  The Value field appears only for parameter symbols. It lists the value of
  17561.  each symbolic constant. Character constants longer than 33 characters are
  17562.  truncated.
  17563.  
  17564.  The last table in the source listing shows the segments used and their size,
  17565.  as shown below:
  17566.  
  17567.       Code size = 0095 (149)
  17568.       Data size = 003c (60)
  17569.       Bss size  = 0000 (0)
  17570.  
  17571.  The byte size of each segment is given first in hexadecimal, and then in
  17572.  decimal (in parentheses). For information on specific segment usage by
  17573.  different memory models, see Chapter 2, "Selecting a Memory Model," in
  17574.  Microsoft FORTRAN Advanced Topics.
  17575.  
  17576.  
  17577.  Object-Listing File
  17578.  
  17579.  The object-listing file contains the machine instructions and assembly code
  17580.  for your program. The line numbers appear as comments, as shown below:
  17581.  
  17582.       SQRT_TEXT      SEGMENT
  17583.       ; Line 6
  17584.            PUBLIC    _main
  17585.       _main     PROC FAR
  17586.            *** 000000     55                  push bp
  17587.            *** 000001     8b ec               mov  bp,sp
  17588.            *** 000003     b8 02 00            mov  ax,2
  17589.            *** 000006     9a 00 00 00 00      call __chkstk
  17590.            *** 00000b     9b d9 06 00 00      fld  $T20002
  17591.            *** 000010     9b d9 1e 02 00      fstp $S14_SIDEA
  17592.       ; Line 7
  17593.            *** 000015     9b d9 06 04 00      fld  $T20003
  17594.            *** 00001a     9b d9 1e 06 00      fstp $S15_SIDEB
  17595.       ; Line 9
  17596.            *** 00001f     9b d9 06 08 00      fld  $T20004
  17597.            *** 000024     9a 00 00 00 00      call __FIsqrt
  17598.            *** 000029     9b d9 1e 0a 00      fstp $S16_HYP
  17599.            *** 00002e     90 9b               fwait
  17600.  
  17601.  
  17602.  Assembly-Listing File
  17603.  
  17604.  The assembly-listing file contains the assembly code corresponding to your
  17605.  program file, as shown below:
  17606.  
  17607.       SQRT_TEXT      SEGMENT
  17608.       ; Line 6
  17609.            PUBLIC    _main
  17610.       _main     PROC FAR
  17611.            push bp
  17612.            mov  bp,sp
  17613.            mov  ax,2
  17614.            call __chkstk
  17615.            fld  $T20002
  17616.            fstp $S14_SIDEA
  17617.       ; Line 7
  17618.            fld  $T20003
  17619.            fstp $S15_SIDEB
  17620.       ; Line 9
  17621.            fld  $T20004
  17622.            call __FIsqrt
  17623.            fstp $S16_HYP
  17624.            fwait
  17625.       .
  17626.       .
  17627.       .
  17628.       _main     ENDP
  17629.       SQRT_TEXT ENDS
  17630.       END
  17631.  
  17632.  Note that this sample shows the same code as the object listing sample,
  17633.  except the machine instructions are omitted. This ensures the listing is
  17634.  suitable as input for the Microsoft Macro Assembler (MASM).
  17635.  
  17636.  
  17637.  Combined Source and Object Listing
  17638.  
  17639.  The combined source and object listing shows one line of your source program
  17640.  followed by the corresponding line (or lines) of machine instructions, as in
  17641.  the following sample:
  17642.  
  17643.       SQRT_TEXT      SEGMENT
  17644.       ;|*** c   This program calculates the length of the hypotenuse of a
  17645.       ;|*** c   right triangle given the lengths of the other two sides.
  17646.       ;|***
  17647.       ;|***     real sidea, sideb, hyp
  17648.       ;|***
  17649.       ;|***     sidea = 3.
  17650.       ; Line 6
  17651.            PUBLIC    _main
  17652.       _main     PROC FAR
  17653.            *** 000000     55                  push bp
  17654.            *** 000001     8b ec               mov  bp,sp
  17655.            *** 000003     b8 02 00            mov  ax,2
  17656.            *** 000006     9a 00 00 00 00      call __chkstk
  17657.            *** 00000b     9b d9 06 00 00      fld  $T20002
  17658.            *** 000010     9b d9 1e 02 00      fstp $S14_SIDEA
  17659.       ;|***     sideb = 4.
  17660.       ; Line 7
  17661.            *** 000015     9b d9 06 04 00      fld  $T20003
  17662.            *** 00001a     9b d9 1e 06 00      fstp $S15_SIDEB
  17663.       ;|***
  17664.       ;|***     hyp = sqrt(sidea**2 + sideb**2)
  17665.       ; Line 9
  17666.            *** 00001f     9b d9 06 08 00      fld  $T20004
  17667.            *** 000024     9a 00 00 00 00      call __FIsqrt
  17668.            *** 000029     9b d9 1e 0a 00      fstp $S16_HYP
  17669.            *** 00002e     90 9b               fwait
  17670.       ;|***
  17671.       ;|***     write(*,100) hyp
  17672.       .
  17673.       .
  17674.       .
  17675.       _main     ENDP
  17676.       SQRT_TEXT ENDS
  17677.       END
  17678.       ;|***
  17679.  
  17680.  Note that this sample is like the object-listing sample, except the program
  17681.  source line is provided in addition to the line number.
  17682.  
  17683.  
  17684.  Map File
  17685.  
  17686.  The map file contains a list of segments in order of their appearance within
  17687.  the load module. An example is shown below:
  17688.  
  17689.       Start  Stop   Length Name                   Class
  17690.       00000H 00059H 0005AH SQRT_TEXT              CODE
  17691.       0005AH 018E1H 01888H _TEXT                  CODE
  17692.       .
  17693.       .
  17694.       .
  17695.  
  17696.  The information in the Start and Stop columns shows the 20-bit address (in
  17697.  hexadecimal) of each segment, relative to the beginning of the load module.
  17698.  The load module begins at location zero. The  Length column gives the length
  17699.  of the segment in bytes. The  Name column gives the name of the segment, and
  17700.  the Class column gives information about the segment type.
  17701.  
  17702.  The starting address and name of each group appear after the list of
  17703.  segments. A sample group listing is shown below:
  17704.  
  17705.       Origin   Group
  17706.       0643:0   DGROUP
  17707.  
  17708.  In the example above, DGROUP is the name of the data group. DGROUP is the
  17709.  only group used by most programs compiled with the Microsoft FORTRAN
  17710.  Compiler, Version 5.0. (Multithread and DLL applications use other groups.)
  17711.  
  17712.  The map file shown below contains two lists of global symbols: the first
  17713.  list is sorted by symbol address and the second is sorted alphabetically by
  17714.  symbol name. The notation Abs appears next to absolute symbol names (symbols
  17715.  containing 16-bit constant values that are not associated with program
  17716.  addresses).
  17717.  
  17718.  Many of the global symbols that appear in the map file are symbols used
  17719.  internally by the FORTRAN compiler. These symbols usually begin with one or
  17720.  two leading underscores or end with QQ.
  17721.  
  17722.       Address         Publics by Name
  17723.  
  17724.       0005:1594       $i8_output
  17725.       0005:1855       $i8_tpwr10
  17726.       0000:FE32  Abs  FIARQQ
  17727.       0000:0E32  Abs  FICRQQ
  17728.       0000:5C32  Abs  FIDRQQ
  17729.       0000:1632  Abs  FIERQQ
  17730.       0000:0632  Abs  FISRQQ
  17731.       0000:A23D  Abs  FIWRQQ
  17732.       0000:4000  Abs  FJARQQ
  17733.       0000:C000  Abs  FJCRQQ
  17734.       0000:8000  Abs  FJSRQQ
  17735.       018E:190B       ICLRER
  17736.       018E:1932       IGETER
  17737.       0643:058D       OFF_ARGPTR
  17738.       0643:058B       OFF_DESCPT
  17739.       0643:00F4       STKHQQ
  17740.       0005:0885       _access
  17741.       0005:106F       _brkctl
  17742.       0005:091A       _chsize
  17743.       .
  17744.       .
  17745.       .
  17746.       0643:00F0       __aaltstkovr
  17747.       0643:0278       __abrkp
  17748.       0643:0228       __abrktb
  17749.       0643:0278       __abrktbe
  17750.       .
  17751.       .
  17752.       .
  17753.  
  17754.  Finally, the map file gives the program entry point:
  17755.  
  17756.       Program entry point at 0005:03C9
  17757.  
  17758.  
  17759.  7.19  Searching for Include Files (/I, /X)
  17760.  
  17761.  
  17762.  Options
  17763.  
  17764.  /Idirectory «/Idirectory...»
  17765.  /X
  17766.  
  17767.  The /I and /X options temporarily override the environment variable INCLUDE.
  17768.  These options give special handling to a particular file or files, without
  17769.  changing the normal compiler environment.
  17770.  
  17771.  The /I (include) option causes the compiler to search the directory or
  17772.  directories you specify before it searches the standard places given by the
  17773.  INCLUDE environment variable.
  17774.  
  17775.  You can search more than one include-file directory by giving the /I option
  17776.  more than once. The directories are searched in order of their appearance on
  17777.  the command line. Each occurrence of an /I option applies only to source
  17778.  files following the option.
  17779.  
  17780.  The directories are searched only until the include file specified in the
  17781.  source file is found. If the file cannot be found, the compiler prints an
  17782.  error message and stops processing. When this occurs you must restart
  17783.  compilation with a corrected directory specification.
  17784.  
  17785.  The following list describes the compiler's search order for include files:
  17786.  
  17787.    1. All the directories in the "parent" file's path. The parent file is the
  17788.       file containing the INCLUDE statement or $INCLUDE metacommand. For
  17789.       example, if a file named FILE1 includes a file named FILE2, FILE1 is
  17790.       the parent file of FILE2.
  17791.  
  17792.       Include files can be nested; thus, in the preceding example, FILE2 can
  17793.       include another file named FILE3. In this case, FILE1 is said to be the
  17794.       "grandparent" file of FILE3. For nested include files, the search
  17795.       begins with the directories in the parent file's path, then proceeds
  17796.       through the directories of each of its grandparent files. (See the
  17797.       examples below for an illustration of this procedure.)
  17798.  
  17799.    2. The directories specified in each /I option.
  17800.  
  17801.    3. The places specified in the INCLUDE environment variable.
  17802.  
  17803.  The INCLUDE statement or $INCLUDE metacommand may give a full or partial
  17804.  path specification for the file. (A full path specification starts with the
  17805.  drive name; a partial path specification gives one or more directory names
  17806.  before the name of the file, but no drive name.) If a full path
  17807.  specification is given for the include file, the compiler uses the given
  17808.  path to find the file, and the INCLUDE environment variable and any /I
  17809.  options have no effect. If a partial path specification is given, the
  17810.  compiler attempts to find that path, starting from the parent file's
  17811.  directory, then from the grandparent file's directories, then from the
  17812.  directories given on the command line, and finally from the directories
  17813.  given by the INCLUDE environment variable.
  17814.  
  17815.  The /X (exclude) option stops the compiler from searching the standard
  17816.  places given by the INCLUDE environment variable. When /X is given, FL
  17817.  considers the list of standard places to be empty. The parent and
  17818.  grandparent directories are still searched, however.
  17819.  
  17820.  Like the /I option, /X applies only to source files following the option on
  17821.  the command line. The /X option can be followed by one or more /I options.
  17822.  This causes the compiler to search only the parent and grandparent
  17823.  directories and the directories given by the /I options, ignoring the
  17824.  standard places.
  17825.  
  17826.  
  17827.  Examples
  17828.  
  17829.       FL /IC:\TESTDIR /IC:\PREVIOUS *.FOR
  17830.  
  17831.  The example above assumes the INCLUDE environment variable is set to
  17832.  C:\FOR\INCLUDE. It compiles all source files with the default extension
  17833.  (.FOR) in the current working directory, searching for include files in the
  17834.  following order:
  17835.  
  17836.    1. The current working directory
  17837.  
  17838.    2. \TESTDIR,  the first directory on the command line
  17839.  
  17840.    3. \PREVIOUS,  the second directory on the command line
  17841.  
  17842.    4. \FOR\INCLUDE,  the directory given by the INCLUDE environment variable
  17843.  
  17844.  However, if the metacommand $INCLUDE:'\SUB\DEFS' is contained in one of the
  17845.  source files, the compiler adds the subdirectory  \SUB to the end of each
  17846.  path it searches. Thus, the search for the include file named DEFS proceeds
  17847.  in the following order:
  17848.  
  17849.    1. The current working directory (which contains any parent source files)
  17850.  
  17851.    2. The \SUB subdirectory of the current working directory
  17852.  
  17853.    3. \TESTDIR,  the first directory on the command line
  17854.  
  17855.    4. \PREVIOUS,  the second directory on the command line
  17856.  
  17857.    5. \FOR\INCLUDE,  the directory given by the INCLUDE environment variable
  17858.  
  17859.  The following example assumes that the INCLUDE environment variable is set
  17860.  to C:\FOR\INCLUDE:
  17861.  
  17862.       FL ..\TESTS\*.FOR
  17863.  
  17864.  It compiles all source files with the default extension (.FOR) in the
  17865.  directory named ..\TESTS, searching directories for include files in the
  17866.  following order:
  17867.  
  17868.    1. ..\TESTS,  the directory containing any possible parent files
  17869.  
  17870.    2. \FOR\INCLUDE,  the directory given by the INCLUDE environment variable
  17871.  
  17872.  However, if one of the source files in the directory ..\TESTS contains the
  17873.  metacommand $INCLUDE:'\SUB\DEFS', the compiler adds the subdirectory \SUB to
  17874.  the end of each path it searches. Thus, the search for the include file
  17875.  named DEFS proceeds in the following order:
  17876.  
  17877.    1. ..\TESTS\SUB,  adding the subdirectory \SUB to the directory ..\TESTS,
  17878.       where ..\TESTS is the directory containing the parent source file
  17879.  
  17880.    2. \FOR\INCLUDE\SUB,  adding the subdirectory \SUB to the directory
  17881.       \FOR\INCLUDE,  where \FOR\INCLUDE is the directory given by the INCLUDE
  17882.       environment variable
  17883.  
  17884.  If the file \SUB\DEFS contains the metacommand $INCLUDE:'COMS', the compiler
  17885.  searches directories for the nested include file named COMS in the following
  17886.  order:
  17887.  
  17888.    1. ..\TESTS\SUB,  the directory containing DEFS,  the parent file of the
  17889.       file named COM
  17890.  
  17891.    2. ..\TESTS,  the directory containing the grandparent source file of the
  17892.       file named COM
  17893.  
  17894.    3. ..\FOR\INCLUDE,  the directory given by the INCLUDE environment
  17895.       variable
  17896.  
  17897.  In this last case, since COMS is not specified as part of another
  17898.  subdirectory, no subdirectory is added to the end of the path specified in
  17899.  the INCLUDE environment variable.
  17900.  
  17901.  The search ends when the file is found.
  17902.  
  17903.  The following example uses a combination of the /I and /X options to control
  17904.  the search path:
  17905.  
  17906.       FL  MAIN.FOR  /X  /ITEST1  SUB1.FOR  /ITEST2  SUB2.FOR
  17907.  
  17908.  Since no /I option appears before MAIN.FOR on the command line, the compiler
  17909.  searches for any files included by MAIN.FOR in the standard places defined
  17910.  by the INCLUDE environment variable (after searching the parent file's
  17911.  directory). Since the /X option precedes the next file name, SUB1.FOR, the
  17912.  compiler does not search the standard places for any files SUB1.FOR includes
  17913.  (in this case, the environment variable is not used). Instead, only the
  17914.  directory of the parent source file SUB2.FOR and the directory TEST1  are
  17915.  searched. If the include file or files cannot be found in one of those
  17916.  places, an error occurs. The second /I option adds one more directory to be
  17917.  searched for any include files specified in the parent file SUB2.FOR. The
  17918.  TEST2 subdirectory is searched after the TEST1 subdirectory.
  17919.  
  17920.  
  17921.  7.20  Handling Warnings and Errors
  17922.  
  17923.  There are several kinds of errors that can occur when a program is compiled,
  17924.  linked, and run. Section 7.20.1 gives an overview of Microsoft FORTRAN error
  17925.  messages. Several options are available to control the types of warnings
  17926.  generated at compile time and to enable or disable expanded error handling
  17927.  at run time. See Section 7.20.2 for a description of these options.
  17928.  
  17929.  
  17930.  7.20.1  Understanding Error Messages
  17931.  
  17932.  Errors can occur at any stage of program development, as explained below:
  17933.  
  17934.    1. During compilation, the compiler generates a broad range of error and
  17935.       warning messages to help you locate errors and potential problems in
  17936.       your source files.
  17937.  
  17938.    2. While linking, the linker is responsible for generating error messages.
  17939.  
  17940.    3. When a program is executed, any error messages are run-time error
  17941.       messages. This category includes messages about floating-point
  17942.       exceptions, which are errors generated by an 8087, 80287, or 80387
  17943.       coprocessor.
  17944.  
  17945.  Other utilities included in this package, such as NMAKE and EXEMOD, generate
  17946.  their own error messages. You can also distinguish the type of a message by
  17947.  its format. See Appendix D, "Error Messages," for a description of
  17948.  error-message formats, a list of actual error messages, and explanations of
  17949.  the circumstances that cause them.
  17950.  
  17951.  When you are compiling and linking using the FL command, you may see both
  17952.  compiler and linker messages. The LINK program banner appears on the screen
  17953.  when linking begins. Compiler messages are any messages that appear before
  17954.  the LINK banner, and linker messages are those that appear after the banner.
  17955.  Compiler messages have numbers preceded by the letter F, and linker messages
  17956.  have numbers preceded by the letter L.
  17957.  
  17958.  Compiler error messages are sent to standard output, which is usually your
  17959.  terminal. You can redirect the messages to a file or printer by using one of
  17960.  the DOS redirection symbols: > or >>.
  17961.  
  17962.  Error redirection is useful in batch-file processing. For example, the
  17963.  following command redirects error messages to the printer device (designated
  17964.  by PRN):
  17965.  
  17966.       FL  /c  COUNT.FOR > PRN
  17967.  
  17968.  See Section 7.15, "Special File Names," or your DOS documentation for a list
  17969.  of device names, including PRN.
  17970.  
  17971.  In the following command, only output that ordinarily goes to the console
  17972.  screen is redirected.
  17973.  
  17974.       FL  COUNT.FOR > COUNT.ERR
  17975.  
  17976.  The FL control program returns an exit code indicating the compilation
  17977.  status. Exit codes are useful with the DOS batch command IF ERRORLEVEL and
  17978.  with the NMAKE utility. You can use them to test for the success or failure
  17979.  of the compilation before proceeding with other tasks. See Appendix B,
  17980.  "Using Exit Codes," in the Microsoft CodeView and Utilities User's Guide
  17981.  for more information.
  17982.  
  17983.  
  17984.  7.20.2  The Warning-Level Option (/W)
  17985.  
  17986.  
  17987.  Option
  17988.  
  17989.  /W{0 | 1| 2}
  17990.  
  17991.  You can suppress compiler warning messages with the /W (warning) option. Any
  17992.  message beginning with F4 is a compiler warning message. Warnings indicate
  17993.  potential problems (rather than actual errors) with statements that may not
  17994.  be compiled as you intend.
  17995.  
  17996.  /W1 (the default) causes the compiler to display warning messages. /W0 turns
  17997.  off warning messages. The /W0 option is useful when compiling programs that
  17998.  deliberately include questionable statements. /W2 suppresses the following
  17999.  error messages:
  18000.  
  18001.  F4998          variable used but not declared
  18002.  
  18003.  F4999          variable declared but not used
  18004.  
  18005.                 /W0 and /W2 apply to the remainder of the command line or
  18006.                 until the next occurrence of /W1 on the command line. These
  18007.                 options have no effect on object files given on the command
  18008.                 line.
  18009.  
  18010.  
  18011.  Example
  18012.  
  18013.       FL  /W0  CRUNCH.FOR  PRINT.FOR
  18014.  
  18015.  This example suppresses warning messages when the files CRUNCH.FOR and
  18016.  PRINT.FOR are compiled.
  18017.  
  18018.  
  18019.  7.21  Syntax Errors (/Zs)
  18020.  
  18021.  
  18022.  Option
  18023.  
  18024.  /Zs
  18025.  
  18026.  The /Zs option tells the compiler to perform a syntax check only. This is a
  18027.  quick way to find and correct syntax errors before compiling a source file.
  18028.  With /Zs, no code is generated and no object files or object listings are
  18029.  produced. However, you can specify the /Fs option on the same command line
  18030.  to generate a source listing.
  18031.  
  18032.  The /Zs option applies to all source files that follow the option on the
  18033.  command line but does not affect any source files preceding the option.
  18034.  
  18035.  
  18036.  Example
  18037.  
  18038.       FL  /Zs  TEST*.FOR
  18039.  
  18040.  This command causes the compiler to perform a syntax check on all source
  18041.  files in the current working directory that begin with TEST and end with the
  18042.  default extension (.FOR). The compiler displays messages for any errors
  18043.  found.
  18044.  
  18045.  ───────────────────────────────────────────────────────────────────────────
  18046.  NOTE
  18047.     The /4Yb and /4Yd options discussed in Section 7.9.2 above are also
  18048.     useful in identifying errors.
  18049.  ───────────────────────────────────────────────────────────────────────────
  18050.  
  18051.  
  18052.  7.22  Preparing for Debugging (/Zi, /Od, /Zd)
  18053.  
  18054.  Option                                     Effect
  18055.  
  18056.  /Zi                                        Prepares for debugging with the
  18057.                                             Microsoft CodeView debugger
  18058.  
  18059.  /Od                                        Disables optimization
  18060.  
  18061.  /Zd                                        Prepares for debugging with
  18062.                                             CodeView
  18063.  
  18064.  The /Zi option produces an object file containing full symbolic debugging
  18065.  information──including the symbol table and line numbers──for use with the
  18066.  Microsoft CodeView window-oriented debugger.
  18067.  
  18068.  When you use the FL command to compile and link, giving the /Zi option
  18069.  automatically causes the /CO option to be given at link time. If you link
  18070.  separately (whether using FL or the LINK command), instead of compiling and
  18071.  linking in one step, be sure to give the /CO option when you link.
  18072.  Otherwise, symbols and source-code lines will be missing when you run the
  18073.  CodeView debugger. See Section 1.3.5, "Preparing FORTRAN Programs," in the
  18074.  Microsoft CodeView and Utilities User's Guide for more information on /CO.
  18075.  
  18076.  The /Od option tells the compiler not to optimize. The default is to
  18077.  optimize. Using /Od is recommended whenever you use /Zi. It is also
  18078.  recommended while testing, since it can improve compilation speed by 30 to
  18079.  35 percent.
  18080.  
  18081.  ───────────────────────────────────────────────────────────────────────────
  18082.  NOTE
  18083.     If you use /Od when compiling, the F3S.EXE file must be in the current
  18084.     search path.
  18085.  ───────────────────────────────────────────────────────────────────────────
  18086.  
  18087.  Since optimization may rearrange instructions and store values in machine
  18088.  registers, you may have trouble finding and fixing errors if you optimize
  18089.  before debugging.
  18090.  
  18091.  Note that turning off or restricting optimization of a program usually
  18092.  increases the size of the generated code. If your program contains a module
  18093.  that is close to the 64K limit on compiled code, turning off optimization
  18094.  may cause the module to exceed the limit.
  18095.  
  18096.  See Section 7.24, "Optimizing," for a discussion of additional optimization
  18097.  options.
  18098.  
  18099.  ───────────────────────────────────────────────────────────────────────────
  18100.  NOTE
  18101.     When the debug option (/4Yb) is enabled, loop optimization is disabled.
  18102.     See Section 7.9.2.1 for a description of the debug option.
  18103.  ───────────────────────────────────────────────────────────────────────────
  18104.  
  18105.  The /Zd option produces an object file containing line-number records that
  18106.  correspond to the line numbers of the source file. The /Zd option is used
  18107.  when you want to pass an object file to the SYMDEB symbolic debugger,
  18108.  available with other Microsoft products (for instance, FORTRAN Version 3.0
  18109.  and earlier). The debugger can use the line numbers to refer to program
  18110.  locations. However, only global symbol-table information is available with
  18111.  SYMDEB (unlike the CodeView debugger, which also recognizes local symbols).
  18112.  
  18113.  When you use the FL command to compile and link, giving the /Zd option
  18114.  causes the /LI option to be given at link time. (See Chapter 13, "Linking
  18115.  Object Files with LINK," in the Microsoft Codeview and Utilities User's
  18116.  Guide for more information on /LI.) If you compile a source file with the
  18117.  /Zd option, and then link in a separate step using FL, be sure to give the
  18118.  /Zd option when you link. (If you link using the LINK command, give the /LI
  18119.  option.) Otherwise, your executable file will not contain line numbers.
  18120.  
  18121.  The /Zd option generates a map file, whether or not the /Fm option is given.
  18122.  If /Fm is not used to specify a file name or location for the file, the map
  18123.  file is created in the current working directory and given the default name,
  18124.  as described in Section 7.14.
  18125.  
  18126.  The /Zi, /Od, and /Zd options apply to any source files following the option
  18127.  on the command line, but do not affect source files preceding the option.
  18128.  The /Zi and /Od options have no effect on object files given on the command
  18129.  line. /Zd causes the /LI option to be given at link time.
  18130.  
  18131.  
  18132.  Example
  18133.  
  18134.       FL  /Zi  /Od  /Fs  P*.FOR  /FePROCESS  /FmPROCESS
  18135.  
  18136.  This command compiles all source files in the current working directory
  18137.  beginning with P and ending with the default extension (.FOR), creating
  18138.  object files that contain the symbolic information needed by the CodeView
  18139.  debugger. Optimization is disabled with /Od. The /Fs option creates a source
  18140.  listing for each source file. The executable file is named PROCESS.EXE, and
  18141.  a map file named PROCESS.MAP is also created.
  18142.  
  18143.  ───────────────────────────────────────────────────────────────────────────
  18144.  NOTE
  18145.     The /4Yb and /Zi options are incompatible. There is a conflict between
  18146.     the line information that each stores. If both are used and the code is
  18147.     brought up under CodeView, the source will come up in assembly mode with
  18148.     the statement, "No Symbolic Information." There is no need to turn on the
  18149.     debugging switch if you intend to debug in CodeView.
  18150.  ───────────────────────────────────────────────────────────────────────────
  18151.  
  18152.  
  18153.  7.23  Using an 80186, 80188, 80286, or 80386 Processor (/G0, /G1, /G2)
  18154.  
  18155.  Option                          Effect
  18156.  
  18157.  /G0                             8086/8088 instruction set
  18158.                                  (default)
  18159.  
  18160.  /G1                             80186/80188 instruction set
  18161.  
  18162.  /G2                             80286/80386 instruction set
  18163.  
  18164.  If you have an 80186/80188 or 80286/80386 processor, you can use the /G1 or
  18165.  /G2 option to enable the instruction set for your processor. Use /G1 for the
  18166.  80186 or 80188 processor; use /G2 for the 80286 or 80386. (80286 code runs
  18167.  on the 80386, but does not use any of the 80386's specialized instructions.)
  18168.  Although it is advantageous to use the appropriate instruction set, you are
  18169.  not required to do so. If you have an 80286 processor, for example, but want
  18170.  your code to also run on an 8086, do not use the /G1 or /G2 option.
  18171.  
  18172.  The /G0 option enables the instruction set for the 8086/8088 processor. You
  18173.  do not have to specify this option explicitly since the 8086/8088
  18174.  instruction set is used by default. Programs compiled this way also run on
  18175.  an 80186, 80188, 80286, or 80386 processor.
  18176.  
  18177.  Only one of these three options is allowed on the FL command line. If more
  18178.  than one appears, FL issues a warning and generates code using the last /G
  18179.  option on the line.
  18180.  
  18181.  
  18182.  Example
  18183.  
  18184.       FL  /G2  /FeFINAL  *.FOR
  18185.  
  18186.  The example above compiles and links all source files with the default
  18187.  extension (.FOR) in the current working directory, using the 80286
  18188.  instruction set. The resulting program, named FINAL.EXE, will run only on an
  18189.  80286 or 80386.
  18190.  
  18191.  
  18192.  7.24  Optimizing (/O and /Zp)
  18193.  
  18194.  The optimizing procedures performed by the Microsoft FORTRAN Compiler can
  18195.  reduce the storage space and execution time required for a compiled program
  18196.  by eliminating unnecessary instructions and rearranging code. The compiler
  18197.  performs some optimizations by default. You can use the /O options to
  18198.  exercise greater control over the optimization performed.
  18199.  
  18200.  
  18201.  Option
  18202.  
  18203.  /Oletters
  18204.  
  18205.  The /O (optimize) option controls optimization. The letters after /O alter
  18206.  the way the compiler optimizes your code. The letters are one or more of the
  18207.  following:
  18208.  
  18209.  Character                          Optimizing Procedure
  18210.  
  18211.  d                                  Disables optimization; leaves
  18212.                                     stack checking on
  18213.  
  18214.  l                                  Loop optimization
  18215.  
  18216.  p                                  Improves consistency of
  18217.                                     floating-point results
  18218.  
  18219.  s                                  Favors reduced code size
  18220.  
  18221.  t                                  Favors rapid execution
  18222.  
  18223.  x                                  Full optimization; equivalent to
  18224.                                     /Olt /Gs
  18225.  
  18226.  More than one /O option may appear on a command line. All of the options
  18227.  apply to all of the source-code files. FL processes the options in the order
  18228.  in which they appear, so their order is significant. For example, /Od
  18229.  followed by /Ol (or only /Odl) disables all optimization, then reinstates
  18230.  loop optimization only. On the other hand, /Ol followed by /Od (or just
  18231.  /Old) requests loop optimization, then disables all optimization. Hence, no
  18232.  optimization of any kind is performed.
  18233.  
  18234.  When you omit the /O option, or when you give an /O option but do not use
  18235.  the letter x, the compiler defaults to /Ox. Whenever the compiler has a
  18236.  choice between producing smaller (but slower) code and larger (but faster)
  18237.  code, the compiler chooses to generate the larger, faster code. To make the
  18238.  compiler produce smaller code, use the /Os option.
  18239.  
  18240.  The /Od option turns off optimization. This option is useful in the early
  18241.  stages of program development because it avoids optimizing code that is not
  18242.  in its final form, and it improves compilation speed by approximately 30 to
  18243.  35 percent. Because optimization may involve rearrangement of instructions,
  18244.  you may also want to specify the /Od option when you use a debugger other
  18245.  than the CodeView debugger with your program, or when you want to examine an
  18246.  object listing. (The /Zi option, which prepares a program for debugging with
  18247.  the CodeView debugger, automatically turns off loop optimization and
  18248.  optimization involving code rearrangement.) If you optimize before
  18249.  debugging, it can be difficult to recognize and correct your code.
  18250.  
  18251.  You may add options to the /Od option to reinstate specific optimizations.
  18252.  For example, /Odl performs only loop optimization, and /Odtp favors speed
  18253.  and floating-point consistency without optimizing loops. Any consistent
  18254.  combination is permitted. For example, /Odts would not be allowed since you
  18255.  cannot simultaneously optimize for size and speed.
  18256.  
  18257.  Note that turning off or restricting optimization usually increases the
  18258.  program's size. If your program contains a module that is close to the 64K
  18259.  limit on compiled code, turning off optimization may cause the module to
  18260.  exceed the limit.
  18261.  
  18262.  ───────────────────────────────────────────────────────────────────────────
  18263.  NOTE
  18264.     In performing optimizations on extremely complex code, the compiler may
  18265.     experience an internal error. It is sometimes possible to work around
  18266.     this problem by disabling the optimization pass with the /Od option.
  18267.     In all cases where you experience this type of compiler error, please
  18268.     contact Microsoft Corporation so that corrections can be made for
  18269.     subsequent releases.
  18270.  ───────────────────────────────────────────────────────────────────────────
  18271.  
  18272.  The /Op option is useful when floating-point results must be consistent.
  18273.  This option changes the compiler's default handling of floating-point
  18274.  values. Normally, the compiler tries to avoid assigning any value to a
  18275.  variable until all the calculations required for the variable's final value
  18276.  have been completed. It does this by storing intermediate values (wherever
  18277.  possible) in an 80-bit machine register.
  18278.  
  18279.  However, since floating-point types are allocated less than 80 bits of
  18280.  storage (32 bits for REAL*4 and 64 bits for REAL*8), a register value may
  18281.  actually be more precise than the same value stored in a floating-point
  18282.  variable. Over the course of many calculations, the value that results from
  18283.  the use of a machine register may be different from the value produced if
  18284.  the compiler assigned intermediate results to a variable. Furthermore,
  18285.  adding or deleting code may change the number of machine registers available
  18286.  to hold intermediate results, and thus alter the result of a particular
  18287.  calculation.
  18288.  
  18289.  Specifying the /Op option tells the compiler to place all intermediate
  18290.  results in variables rather than machine registers. Although this may give
  18291.  less precise results than using registers, and may increase program size, it
  18292.  guarantees consistent results in floating-point calculations.
  18293.  
  18294.  ───────────────────────────────────────────────────────────────────────────
  18295.  NOTE
  18296.     When the debug option (/4Yb) is enabled, loop optimization is disabled.
  18297.     See Section 7.9.2.1 for a description of the debug option.
  18298.  ───────────────────────────────────────────────────────────────────────────
  18299.  
  18300.  
  18301.  Examples
  18302.  
  18303.       FL  /c  /Os  FILE.FOR
  18304.  
  18305.  The command above favors code size over execution speed when compiling
  18306.  FILE.FOR.
  18307.  
  18308.       FL  /Od  *.FOR
  18309.  
  18310.  The command above compiles and links all FORTRAN source files with the
  18311.  default extension (.FOR) in the current directory and disables optimization.
  18312.  This command is useful during the early stages of program development, since
  18313.  it improves compilation speed.
  18314.  
  18315.       FL  /Op  /FeTESTRUN  *.FOR
  18316.  
  18317.  The command above causes floating-point assignments to variables to be
  18318.  carried out immediately (where specified) when compiling all source files
  18319.  with the default extension (.FOR) in the current working directory. By
  18320.  default, the optimization favors execution time. The resulting program is
  18321.  named TESTRUN.EXE.
  18322.  
  18323.  
  18324.  Option
  18325.  
  18326.  /Zp«{1 | 2 | 4}»
  18327.  
  18328.  The /Zp option controls the starting addresses (packing) of variables in
  18329.  structures. A tight pack saves memory space, at the expense of slightly
  18330.  slower access for noncharacter variables. Any $PACK:n metacommand in the
  18331.  file overrides a /Zp option, except for $PACK, which restores whatever
  18332.  command-line option was given.
  18333.  
  18334.  If no /Zp option is given, and if there is no $PACK metacommand in the file,
  18335.  structures are packed according to the following default rules: INTEGER*1,
  18336.  LOGICAL*1, and all CHARACTER variables begin at the next available byte,
  18337.  whether odd or even; all other variables begin at the next even byte. This
  18338.  arrangement wastes some memory space, but gives the quickest access.
  18339.  
  18340.  If /Zp1 is specified, all variables begin at the next available byte,
  18341.  whether odd or even. Although this slightly increases access time, no memory
  18342.  space is wasted.
  18343.  
  18344.  If /Zp2 is specified, INTEGER*1, LOGICAL*1, and all CHARACTER variables
  18345.  begin at the next available byte, whether odd or even. All other variables
  18346.  start on the next available even byte. This is equivalent to the default
  18347.  packing, described above.
  18348.  
  18349.  If /Zp4 is specified, INTEGER*1, LOGICAL*1, and all CHARACTER variables
  18350.  begin at the next available byte, whether odd or even. All other variables
  18351.  start on the next four-byte boundary.
  18352.  
  18353.  
  18354.  7.25  Enabling and Disabling Stack Probes (/Ge, /Gs)
  18355.  
  18356.  Option                          Effect
  18357.  
  18358.  /Ge                             Enables stack probes
  18359.  
  18360.  /Gs                             Disables stack probes (default)
  18361.  
  18362.  A stack probe is a short subroutine called on entry to a procedure to verify
  18363.  that the program stack has enough space for any automatic local variables.
  18364.  When stack probes are enabled, the stack-probe subroutine is automatically
  18365.  called at every entry point. The stack-probe subroutine generates a message
  18366.  and ends the program if it determines that the required stack space is not
  18367.  available.
  18368.  
  18369.  By default, all Microsoft FORTRAN variables are static, not automatic, so
  18370.  only procedures containing automatic variables require stack space for
  18371.  variable allocation. However, any procedure call consumes stack space for
  18372.  the return address and the addresses or values of the arguments passed. If
  18373.  your program has many nested procedure calls, or passes a lot of variables
  18374.  to procedures, the stack may overflow. Although enabling a stack probe does
  18375.  not prevent an overflow, it will tell you when one occurs.
  18376.  
  18377.  Note, however, that programs with stack checking are slightly larger and may
  18378.  perform less efficiently due to the calls to the probe routine. Stack probes
  18379.  can be used during development, then removed from the final version of the
  18380.  program.
  18381.  
  18382.  The /Ge option applies to all source files following the option on the
  18383.  command line. The /Gs option disables stack checking for all source files
  18384.  that follow it on the command line.
  18385.  
  18386.  ───────────────────────────────────────────────────────────────────────────
  18387.  NOTE
  18388.     Although the default option, which disables stack probes, reduces program
  18389.     size, it means that no compiler error message is displayed if a stack
  18390.     overflow occurs. You may want to use the /Ge option when testing to make
  18391.     sure the program does not cause a stack overflow.
  18392.  ───────────────────────────────────────────────────────────────────────────
  18393.  
  18394.  
  18395.  Example
  18396.  
  18397.       FL  /c  /Ge  /Ot  FILE.FOR
  18398.  
  18399.  This example enables stack probes and favors execution time when compiling
  18400.  FILE.FOR.
  18401.  
  18402.  
  18403.  7.26  Suppressing Automatic Library Selection (/Zl)
  18404.  
  18405.  
  18406.  Option
  18407.  
  18408.  / Zl
  18409.  
  18410.  The compiler ordinarily places in the object file the name of the FORTRAN
  18411.  library corresponding to the floating-point and memory-model options you
  18412.  choose. The linker uses the library name to link the program automatically
  18413.  with the corresponding library. Thus, you do not need to specify a library
  18414.  name to the linker, provided that the appropriate library exists for the
  18415.  floating-point and memory-model options you are using.
  18416.  
  18417.  The /Zl option suppresses the insertion of library names in object files.
  18418.  When you specify /Zl, the compiler does not place a library name in the
  18419.  object file. As a result, the object file is slightly smaller.
  18420.  
  18421.  The /Zl option produces a significant space savings when building a library
  18422.  containing many object modules. When you link a library created using the
  18423.  /Zl option with a program file compiled without the /Zl option, the program
  18424.  file supplies the name of the library.
  18425.  
  18426.  The /Zl option applies to the remainder of the source files on the command
  18427.  line.
  18428.  
  18429.  
  18430.  Examples
  18431.  
  18432.       FL  ONE.FOR  /Zl  TWO.FOR
  18433.  
  18434.  The example above creates an object file named ONE.OBJ. Since no
  18435.  floating-point or memory-model options are specified on the FL command line,
  18436.  this object file contains the name of the FORTRAN library that corresponds
  18437.  to the default floating-point and memory-model options (LLIBFOR7.LIB). The
  18438.  example also creates an object file named TWO.OBJ without any library
  18439.  information, since the /Zl option appears before the file name on the
  18440.  command line. When ONE.OBJ and TWO.OBJ are linked to create an executable
  18441.  file, the library information in ONE.OBJ causes LLIBFOR7.LIB to be searched
  18442.  for any unresolved references in either ONE.OBJ or TWO.OBJ.
  18443.  
  18444.       FL  /c  /Zl  *.FOR
  18445.  
  18446.  The example above compiles all source files with the default extension
  18447.  (.FOR) in the current working directory. None of the resulting object files
  18448.  contain library information.
  18449.  
  18450.  
  18451.  7.27  Setting the Stack Size (/F)
  18452.  
  18453.  
  18454.  Option
  18455.  
  18456.  /F hexnum
  18457.  
  18458.  The /F option sets the size of the program stack. A space must separate /F
  18459.  and hexnum.
  18460.  
  18461.  The hexnum is a hexadecimal number representing the stack size in bytes. The
  18462.  number must be positive and cannot exceed 10,000 hexadecimal (65,536
  18463.  decimal). The default stack size is 2K.
  18464.  
  18465.  If many variables are declared as automatic, or if many parameters are
  18466.  passed to procedures, a larger stack may be needed to accommodate them.
  18467.  Stack overflow does not always cause a program to crash; it may have no
  18468.  effect at all, or it may cause erratic operation or incorrect results. If
  18469.  there is any doubt whether the stack is large enough, use the /Ge option to
  18470.  enable stack probes. Stack overflow will then automatically halt the
  18471.  program.
  18472.  
  18473.  This option affects object files only. It has no effect on source files.
  18474.  
  18475.  Using the /F option with the FL command has the same effect as using the
  18476.  /STACK option with the LINK program. See Chapter 13, "Linking Object Files
  18477.  with LINK," in the Microsoft CodeView and Utilities User's Guide for more
  18478.  information on the /STACK option.
  18479.  
  18480.  
  18481.  Example
  18482.  
  18483.       FL /F C00 *.OBJ
  18484.  
  18485.  This example sets the stack size to C00 hexadecimal (3K decimal) for the
  18486.  program created by linking all object files in the current working
  18487.  directory.
  18488.  
  18489.  
  18490.  7.28  Restricting the Length of External Names (/H)
  18491.  
  18492.  
  18493.  Option
  18494.  
  18495.  /Hnumber
  18496.  
  18497.  The /H option restricts the length of external names in the object file. The
  18498.  number is an integer specifying the maximum number of significant characters
  18499.  in external names.
  18500.  
  18501.  The /H option has no effect during compilation. The first 31 characters of a
  18502.  name are significant if $NOTRUNCATE (the default) is in effect, and only the
  18503.  first six if $TRUNCATE is in effect. It is only when the object file is
  18504.  created that any external names longer than number characters are truncated.
  18505.  
  18506.  This option has no effect on local names.
  18507.  
  18508.  
  18509.  7.29  Labeling the Object File (/V)
  18510.  
  18511.  
  18512.  Option
  18513.  
  18514.  /V"string"
  18515.  
  18516.  Use the /V (version) option to embed a given text string into an object
  18517.  file. The quotation marks may be omitted if the string does not contain
  18518.  blanks or tabs. A common use of the /V option is to label an object file
  18519.  with a version number or copyright notice.
  18520.  
  18521.  The /V option applies to all source files following the option on the
  18522.  com-mand line.
  18523.  
  18524.  
  18525.  Example
  18526.  
  18527.       FL /V"Microsoft FORTRAN Compiler Version 5.0" MAIN.FOR
  18528.  
  18529.  This command places the string Microsoft FORTRAN Compiler Version 5.0 in the
  18530.  object file MAIN.OBJ.
  18531.  
  18532.  
  18533.  7.30  Linking with Libraries
  18534.  
  18535.  When the FL command compiles a source file, it places a FORTRAN library name
  18536.  in the object file. The library name corresponds to the memory-model and
  18537.  floating-point options you chose on the FL command line, or the defaults for
  18538.  those options you did not explicitly select. See Table 7.1 in Section 7.4,
  18539.  "Memory-Model Options," for the library names FL includes in the object file
  18540.  for each combination of memory-model and floating-point options.
  18541.  
  18542.  The linker looks for a library matching the name embedded in the object
  18543.  file. If it finds a library with that name, it automatically links the
  18544.  library with the object file.
  18545.  
  18546.  The result is that you do not need to specify library names on the FL
  18547.  command line unless you want to link with standard libraries renamed during
  18548.  SETUP with libraries other than the default library for the floating-point
  18549.  and memory-model options you have chosen, or with user-created libraries.
  18550.  
  18551.  Setting up under OS/2 for both real- and protected-mode programming creates
  18552.  separate real- and protected-mode libraries, with different names. Use the
  18553.  /L option to specify the correct link library. See Section 7.5, "OS/2
  18554.  Library Options," for more information.
  18555.  
  18556.  If you want to link with other libraries, you must either use the /link
  18557.  option on the FL command line and include the new library names, or run the
  18558.  linker and specify the library names separately. In either case, the linker
  18559.  tries to resolve external references by searching the library you specified
  18560.  before it searches the library whose name is embedded in the object file. If
  18561.  you want the linker to ignore the library whose name is embedded in the
  18562.  object file, you must also include the /NOD (NODEFAULTLIBRARYSEARCH) linker
  18563.  option, either as part of the /link option on the FL command line, or as an
  18564.  option on the LINK command line.
  18565.  
  18566.  See Section 7.32, "Using FL to Link without Compiling," for information
  18567.  about the /link option of the FL command. See Chapter 13, "Linking Object
  18568.  Files with LINK," in the Microsoft Codeview and Utilities User's Guide for
  18569.  information about specifying library names to the linker.
  18570.  
  18571.  See Section 7.4, "Memory-Model Options," for more information on
  18572.  dynamic-link library and multithread linking.
  18573.  
  18574.  
  18575.  7.31  Creating Overlays
  18576.  
  18577.  You can specify program overlays on the command line. Overlays let several
  18578.  program modules use the same memory area, one module at a time. When needed,
  18579.  a module is loaded from the disk. See Chapter 13, "Linking Object Files with
  18580.  LINK," in the Microsoft CodeView and Utilities User's Guide for more
  18581.  information about overlays.
  18582.  
  18583.  The modules to be overlaid are enclosed in parentheses. For example, the
  18584.  following command line instructs FL to overlay modules OVER1.FOR  and
  18585.  OVER2.FOR:
  18586.  
  18587.       FL  MAIN.FOR  (OVER1.FOR  OVER2.FOR)
  18588.  
  18589.  
  18590.  7.32  Using FL to Link without Compiling
  18591.  
  18592.  Just as the FL command can compile files without linking the resulting
  18593.  object code, you can use FL to link object files that were previously
  18594.  compiled. If all of the files you give FL have extensions other than .FOR,
  18595.  and if no /Tf options appear, FL skips the compiling stage and links your
  18596.  files. To link object files, use the following special form of the FL
  18597.  command:
  18598.  
  18599.  FL objfile«,objfile...» /link «libfield» « linkoptions»
  18600.  
  18601.  When FL links object files, it gives the resulting executable file the base
  18602.  name of the first object file on the command line, plus an .EXE extension,
  18603.  by default. Alternately, you can specify files with the .LTB extension
  18604.  without the /link option. The /link option is most useful for passing link
  18605.  options. (This is the same naming convention FL uses when it compiles source
  18606.  files first, then links the resulting object files.)
  18607.  
  18608.  Command options beginning with /F allow you to supply the file names and
  18609.  options that would otherwise appear on the LINK command line (or in response
  18610.  to LINK prompts). The following list shows each FL option for the linker and
  18611.  the corresponding LINK command-line field, prompt, or option:
  18612.  
  18613.  FL Option                            LINK Field/Prompt/Option
  18614.  
  18615.  /Feexefile                           The exefile field or "Run File"
  18616.                                       prompt
  18617.  
  18618.  /Fmmapfile                           The mapfile field or "List File"
  18619.                                       prompt
  18620.  
  18621.  /link libfile linkoptions            The libfiles field or "Libraries"
  18622.                                       prompt, and any of the LINK
  18623.                                       options described in Chapter 13
  18624.                                       of the Microsoft CodeView and
  18625.                                       Utilities User's Guide
  18626.  
  18627.  /Fhexnum                             The /STACK option
  18628.  
  18629.  See Section 7.13 for a description of the /Fe option, Section 7.14 for a
  18630.  description of the /Fm option, and Section 7.27 for a description of the /F
  18631.  option. Chapter 13 of the Microsoft CodeView and Utilities User's Guide
  18632.  describes the LINK command-line fields and the /STACK option.
  18633.  
  18634.  If you use the /link libfile linkoptions option with the FL command, it must
  18635.  be the last option on the command line.
  18636.  
  18637.  ───────────────────────────────────────────────────────────────────────────
  18638.  NOTE
  18639.     The FL command normally links without having to specify the /link option.
  18640.     However, you can include the /link option in an FL command line if you
  18641.     wish to modify the linking process, such as by specifying a different
  18642.     library.
  18643.  ───────────────────────────────────────────────────────────────────────────
  18644.  
  18645.  
  18646.  7.33  Specifying Assembler Options (/MA)
  18647.  
  18648.  
  18649.  Option
  18650.  
  18651.  /MA option
  18652.  
  18653.  The /MA option allows you to specify Microsoft Assembler options when
  18654.  including assembly-language filenames on the command line. You must use a
  18655.  separate /MA option for each assembly-language option. The option applies to
  18656.  all of the assembly-language files that follow it on the command line,
  18657.  unless another option overrides it.
  18658.  
  18659.  
  18660.  Example
  18661.  
  18662.       FL FORT1.FOR /MA/B40 ASM1.ASM
  18663.  
  18664.  In this example, the /B40 option is passed to the Microsoft Assembler,
  18665.  specifying that the source file buffer is to be 40K when ASM1.ASM is
  18666.  assembled.
  18667.  
  18668.  
  18669.  Appendix A  ASCII Character Codes
  18670.  
  18671.  ───────────────────────────────────────────────────────────────────────────
  18672.  
  18673.  ASCII Character Codes
  18674.  
  18675.  Ctl D  H  O  C Code  D  H  O   C   D  H  O   C   D  H  O   C
  18676.  
  18677.  ^@   0  00  000     NUL│  32  20  040    │  64  40  100  @ │  96  60  140  `
  18678.  ^A   1  01  001    SOH│  33  21  041  ! │  65  41  101  A │  97  61  141  a
  18679.  ^B   2  02  002    STX│  34  22  042  " │  66  42  102  B │  98  62  142  b
  18680.  ^C   3  03  003    ETX│  35  23  043  # │  67  43  103  C │  99  63  143  c
  18681.  ^D   4  04  004    EOT│  36  24  044  $ │  68  44  104  D │ 100  64  144  d
  18682.  ^E   5  05  005    ENQ│  37  25  045  % │  69  45  105  E │ 101  65  145  e
  18683.  ^F   6  06  006    ACK│  38  26  046  & │  70  46  106  F │ 102  66  146  f
  18684.  ^G   7  07  007    BEL│  39  27  047  ' │  71  47  107  G │ 103  67  147  g
  18685.  ^H   8  08  010    BS │  40  28  050  ( │  72  48  110  H │ 104  68  150  h
  18686.  ^I   9  09  011        HT │  41  29  051  ) │  73  49  111  I │ 105  69  151  i
  18687.  ^J  10  0A  012     LF │  42  2A  052  * │  74  4A  112  J │ 106  6A  152  j
  18688.  ^K  11  0B  013     VT │  43  2B  053  + │  75  4B  113  K │ 107  6B  153  k
  18689.  ^L  12  0C  014     FF │  44  2C  054  , │  76  4C  114  L │ 108  6C  154  l
  18690.  ^M  13  0D  015     CR │  45  2D  055  - │  77  4D  115  M │ 109  6D  155  m
  18691.  ^N  14  0E  016    SO │  46  2E  056  . │  78  4E  116  N │ 110  6E  156  n
  18692.  ^O  15  0F  017    SI │  47  2F  057  / │  79  4F  117  O │ 111  6F  157  o
  18693.  ^P  16  10  020    DLE│  48  30  060  0 │  80  50  120  P │ 112  70  160  p
  18694.  ^Q  17  11  021    DC1│  49  31  061  1 │  81  51  121  Q │ 113  71  161  q
  18695.  ^R  18  12  022    DC2│  50  32  062  2 │  82  52  122  R │ 114  72  162  r
  18696.  ^S  19  13  023    DC3│  51  33  063  3 │  83  53  123  S │ 115  73  163  s
  18697.  ^T  20  14  024    DC4│  52  34  064  4 │  84  54  124  T │ 116  74  164  t
  18698.  ^U  21  15  025    NAK│  53  35  065  5 │  85  55  125  U │ 117  75  165  u
  18699.  ^V  22  16  026    SYN│  54  36  066  6 │  86  56  126  V │ 118  76  166  v
  18700.  ^W  23  17  027    ETB│  55  37  067  7 │  87  57  127  W │ 119  77  167  w
  18701.  ^X  24  18  030    CAN│  56  38  070  8 │  88  58  130  X │ 120  78  170  x
  18702.  ^Y  25  19  031    EM │  57  39  071  9 │  89  59  131  Y │ 121  79  171  y
  18703.  ^Z  26  1A  032     SUB│  58  3A  072  : │  90  5A  132  Z │ 122  7A  172  z
  18704.  ^[  27  1B  033    ESC│  59  3B  073  ; │  91  5B  133  [ │ 123  7B  173  {
  18705.  ^\  28  1C  034    FS │  60  3C  074  < │  92  5C  134  \ │ 124  7C  174  |
  18706.  ^]  29  1D  035    GS │  61  3D  075  = │  93  5D  135  ] │ 125  7D  175  }
  18707.  ^^  30  1E  036    RS │  62  3E  076  > │  94  5E  136  ^ │ 126  7E  176  ~
  18708.  ^_  31  1F  037    US │  63  3F  077  ? │  95  5F  137  _ │ 127  7F  177  
  18709.  
  18710.         D    H   O    C   D    H   O    C   D    H   O    C   D
  18711.  
  18712.         128  80  200  Ç │ 160  A0  240  á │ 192  C0  300  └ │ 224  E0  340  α
  18713.         129  81  201  ü │ 161  A1  241  í │ 193  C1  301  ┴ │ 225  E1  341  ß
  18714.         130  82  202  é │ 162  A2  242  ó │ 194  C2  302  ┬ │ 226  E2  342  Γ
  18715.         131  83  203  â │ 163  A3  243  ú │ 195  C3  303  ├ │ 227  E3  343  π
  18716.         132  84  204  ä │ 164  A4  244  ñ │ 196  C4  304  ─ │ 228  E4  344  Σ
  18717.         133  85  205  à │ 165  A5  245  Ñ │ 197  C5  305  ┼ │ 229  E5  345  σ
  18718.         134  86  206  å │ 166  A6  246  ª │ 198  C6  306  ╞ │ 230  E6  346  µ
  18719.         135  87  207  ç │ 167  A7  247  º │ 199  C7  307  ╟ │ 231  E7  347  τ
  18720.         136  88  210  ê │ 168  A8  250  ¿ │ 200  C8  310  ╚ │ 232  E8  350  Φ
  18721.         137  89  211  ë │ 169  A9  251  ⌐ │ 201  C9  311  ╔ │ 233  E9  351  Θ
  18722.         138  8A  212  è │ 170  AA  252  ¬ │ 202  CA  312  ╩ │ 234  EA  352  Ω
  18723.         139  8B  213  ï │ 171  AB  253  ½ │ 203  CB  313  ╦ │ 235  EB  353  δ
  18724.         140  8C  214  î │ 172  AC  254  ¼ │ 204  CC  314  ╠ │ 236  EC  354  ∞
  18725.         141  8D  215  ì │ 173  AD  255  ¡ │ 205  CD  315  ═ │ 237  ED  355  φ
  18726.         142  8E  216  Ä │ 174  AE  256  « │ 206  CE  316  ╬ │ 238  EE  356  ε
  18727.         143  8F  217  Å │ 175  AF  257  » │ 207  CF  317  ╧ │ 239  EF  357  ∩
  18728.         144  90  220  É │ 176  B0  260  ░ │ 208  D0  320  ╨ │ 240  F0  360  ≡
  18729.         145  91  221  æ │ 177  B1  261  ▒ │ 209  D1  321  ╤ │ 241  F1  361  ±
  18730.         146  92  222  Æ │ 178  B2  262  ▓ │ 210  D2  322  ╥ │ 242  F2  362  ≥
  18731.         147  93  223  ô │ 179  B3  263  │ │ 211  D3  323  ╙ │ 243  F3  363  ≤
  18732.         148  94  224  ö │ 180  B4  264  ┤ │ 212  D4  324  ╘ │ 244  F4  364  ⌠
  18733.         149  95  225  ò │ 181  B5  265  ╡ │ 213  D5  325  ╒ │ 245  F5  365  ⌡
  18734.         150  96  226  û │ 182  B6  266  ╢ │ 214  D6  326  ╓ │ 246  F6  366  ÷
  18735.         151  97  227  ù │ 183  B7  267  ╖ │ 215  D7  327  ╫ │ 247  F7  367  ≈
  18736.         152  98  230  ÿ │ 184  B8  270  ╕ │ 216  D8  330  ╪ │ 248  F8  370  °
  18737.         153  99  231  Ö │ 185  B9  271  ╣ │ 217  D9  331  ┘ │ 249  F9  371  ∙
  18738.         154  9A  232  Ü │ 186  BA  272  ║ │ 218  DA  332  ┌ │ 250  FA  372  ·
  18739.         155  9B  233  ¢ │ 187  BB  273  ╗ │ 219  DB  333  █ │ 251  FB  373  √
  18740.         156  9C  234  £ │ 188  BC  274  ╝ │ 220  DC  334  ▄ │ 252  FC  374  ⁿ
  18741.         157  9D  235  ¥ │ 189  BD  275  ╜ │ 221  DD  335  ▌ │ 253  FD  375  ²
  18742.         158  9E  236  ₧ │ 190  BE  276  ╛ │ 222  DE  336  ▐ │ 254  FE  376  ■
  18743.         159  9F  237  ƒ │ 191  BF  277  ┐ │ 223  DF  337  ▀ │ 255  FF  377   
  18744.  
  18745.  
  18746.  Appendix B  Differences from Previous Versions
  18747.  
  18748.  ───────────────────────────────────────────────────────────────────────────
  18749.  
  18750.  This appendix documents the changes to Microsoft FORTRAN as the language has
  18751.  evolved from Versions 3.2 and 3.3 to Versions 4.0, 4.1, and 5.0. The
  18752.  appendix is in three sections, one for each update.
  18753.  
  18754.  The first section describes the current update, from Version 4.1 to Version
  18755.  5.0. The second section explains the changes that occurred when OS/2
  18756.  features were added to Version 4.0 to create Version 4.1. The third section
  18757.  describes the changes from Versions 3.2 and 3.3 to Version 4.0.
  18758.  
  18759.  The README.DOC file may also contain information unavailable when this
  18760.  update was printed.
  18761.  
  18762.  You may use the SETUP program to create libraries to link with Version 5.0
  18763.  programs. If you choose all the default responses for SETUP, the library
  18764.  that SETUP builds requires that you have an 8087 or 80287 coprocessor
  18765.  installed.
  18766.  
  18767.  ───────────────────────────────────────────────────────────────────────────
  18768.  NOTE
  18769.     Since MS-DOS and PC-DOS are functionally the same operating system,
  18770.     Microsoft manuals and updates use the term DOS to include both systems,
  18771.     except when noting features that are unique to one or the other.
  18772.  ───────────────────────────────────────────────────────────────────────────
  18773.  
  18774.  
  18775.  B.1  Changes from Version 4.1 to Version 5.0
  18776.  
  18777.  This section summarizes the Microsoft FORTRAN features introduced in Version
  18778.  5.0.
  18779.  
  18780.  
  18781.  B.1.1  Alphabetical Summary
  18782.  
  18783.  Changes to individual statements, metacommands, and other features are
  18784.  listed alphabetically below.
  18785.  
  18786.  
  18787.  B.1.1.1  Allocatable Arrays
  18788.  
  18789.  Arrays may be declared as allocatable. Although the number of dimensions is
  18790.  fixed during compilation, the size and range of each dimension can be set at
  18791.  run time.
  18792.  
  18793.  
  18794.  B.1.1.2  APPEND Mode
  18795.  
  18796.  Files may be opened in ACCESS='APPEND' mode, which automatically positions
  18797.  the file pointer at the end of the file.
  18798.  
  18799.  
  18800.  B.1.1.3  Array Operations
  18801.  
  18802.  A complete array can now be an operand in an expression. For example, two
  18803.  arrays may be directly added together in a single statement, without having
  18804.  to use a DO loop. Similarly, a constant value may be subtracted from every
  18805.  element in an array, or two arrays of LOGICAL variables can be compared with
  18806.  a logical operator.
  18807.  
  18808.  An array may also be passed to a function (intrinsic or external). The
  18809.  function returns an identically-dimensioned array whose individual elements
  18810.  are the values obtained when the function is applied to the corresponding
  18811.  element of the original array. For more information, see Section 1.7.5,
  18812.  "Array Expressions."
  18813.  
  18814.  
  18815.  B.1.1.4  AUTOMATIC Variables
  18816.  
  18817.  Local variables may be declared "on the stack," rather than at fixed memory
  18818.  locations, with the AUTOMATIC statement.
  18819.  
  18820.  
  18821.  B.1.1.5  Compatibility with Versions 3.2 and 3.3
  18822.  
  18823.  Version 5.0 no longer supports compatibility with object files produced by
  18824.  Version 3.2 and 3.3 compilers. If you wish to use their code in new
  18825.  programs, they must be recompiled with the Version 5.0 compiler.
  18826.  
  18827.  
  18828.  B.1.1.6  Conditional Compilation
  18829.  
  18830.  The $DEFINE, $UNDEFINE, $IF, $ELSE, $ELSEIF, and $ENDIF metacommands control
  18831.  conditional compilation of FORTRAN source code. FL command-line arguments
  18832.  permit test values to be passed to these metacommands.
  18833.  
  18834.  
  18835.  B.1.1.7  CYCLE Statement
  18836.  
  18837.  The CYCLE statement transfers control back to the first line of a DO or DO
  18838.  WHILE loop.
  18839.  
  18840.  
  18841.  B.1.1.8  DO WHILE Statement
  18842.  
  18843.  The new DO WHILE statement permits a loop to be executed as long as a
  18844.  logical condition is .TRUE..
  18845.  
  18846.  
  18847.  B.1.1.9  END DO Statement
  18848.  
  18849.  The END DO statement can now terminate a DO or DO WHILE loop. Labeled
  18850.  terminating statements are no longer required (though they are still
  18851.  permitted).
  18852.  
  18853.  
  18854.  B.1.1.10  End-of-line Comments
  18855.  
  18856.  A comment line may now begin with an exclamation point. An exclamation point
  18857.  outside a character or Hollerith constant that is not in column six is
  18858.  considered the beginning of a comment, and it may appear anywhere on a line
  18859.  following the statement.
  18860.  
  18861.  
  18862.  B.1.1.11  Exclusive Or (.xor.) Logical Operator
  18863.  
  18864.  The .XOR. logical operator has been added. Although its function is
  18865.  identical to the existing .NEQV. operator, its meaning is clearer.
  18866.  
  18867.  
  18868.  B.1.1.12  EXIT Statement
  18869.  
  18870.  The EXIT statement transfers control to the first statement following a DO
  18871.  or DO WHILE loop.
  18872.  
  18873.  
  18874.  B.1.1.13  IMPLICIT NONE Statement
  18875.  
  18876.  The new IMPLICIT NONE statement removes implicit data typing. Any variable
  18877.  not explicitly typed produces a compile-time warning message.
  18878.  
  18879.  
  18880.  B.1.1.14  INCLUDE Statement
  18881.  
  18882.  The INCLUDE statement inserts the contents of a specified file at the point
  18883.  in the program where the INCLUDE statement appears. The compiler immediately
  18884.  processes these statements. The $INCLUDE metacommand, which has the same
  18885.  function, is retained.
  18886.  
  18887.  
  18888.  B.1.1.15  Loop Optimization
  18889.  
  18890.  Loop optimization may be enabled and disabled with the $LOOPOPT and
  18891.  $NOLOOPOPT metacommands.
  18892.  
  18893.  
  18894.  B.1.1.16  NAMELIST Statement
  18895.  
  18896.  The NAMELIST statement defines a group of variables that are written to or
  18897.  read from a formatted file with a single I/O statement. When written, the
  18898.  namelist variable values are labeled with their names. When read, a variable
  18899.  is assigned the value given in a varname = value statement. The namelist
  18900.  feature allows a programmer to display a large group of variables with only
  18901.  a single statement, or to read the values of a group of parameters from an
  18902.  ASCII file.
  18903.  
  18904.  
  18905.  B.1.1.17  Numeric Arguments for Logical Operators
  18906.  
  18907.  The .AND., .OR., .XOR., .EQV., .NEQV., and .NOT. logical operators now
  18908.  accept INTEGER arguments. The result of the operation is not a logical
  18909.  value, but an integer value determined by bitwise comparison of the
  18910.  operands.
  18911.  
  18912.  
  18913.  B.1.1.18  Quotes
  18914.  
  18915.  Character literals may now be delimited by quotes, as well as apostrophes.
  18916.  
  18917.  
  18918.  B.1.1.19  SELECT CASE Statement
  18919.  
  18920.  The SELECT CASE construct is similar to other languages' case-selection
  18921.  mechanisms. The test expression may be of INTEGER, LOGICAL, or  CHARACTER*1
  18922.  type. The case-list values may be single values, ranges of values, or any
  18923.  combination of the two. An optional CASE DEFAULT statement handles
  18924.  situations when none of the list values match the test expression.
  18925.  
  18926.  
  18927.  B.1.1.20  Structure Type
  18928.  
  18929.  A user-defined data type called a "structure" may be created. A structure
  18930.  type is a combination of other data types, including other structures. The
  18931.  RECORD statement creates variables of a specific structure type. Structure
  18932.  variables may be used both for internal data representation, and for reading
  18933.  and writing groups of data from unformatted files.
  18934.  
  18935.  
  18936.  B.1.1.21  Symbol Table Enlargement
  18937.  
  18938.  The Microsoft FORTRAN compiler has changed its internal allocation of the
  18939.  symbol table from near to far memory, allowing many more symbols in a given
  18940.  subprogram before the compiler runs out of memory.
  18941.  
  18942.  
  18943.  B.1.1.22  $TRUNCATE
  18944.  
  18945.  Microsoft FORTRAN no longer sets $TRUNCATE by default. Programs which
  18946.  contain variable names longer than six characters but with differences after
  18947.  the sixth character will need to explicitly set the $TRUNCATE metacommand.
  18948.  
  18949.  
  18950.  B.1.2  New Microsoft FORTRAN Functions and Procedures
  18951.  
  18952.  See Chapter 5 , "Intrinsic Functions and Additional Procedures," for full
  18953.  descriptions of the following functions and procedures.
  18954.  
  18955.  Function or Procedure                      Description
  18956.  
  18957.  EPSILON                                    Smallest number that is larger
  18958.                                             than one
  18959.  
  18960.  GETARG                                     Returns nth command-line argument
  18961.  
  18962.  HUGE                                       Largest positive number
  18963.  
  18964.  LEN_TRIM                                   Returns the length of a string
  18965.                                             (less trailing blanks)
  18966.  
  18967.  MAXEXPONENT                                Largest positive exponent for a
  18968.                                             data type
  18969.  
  18970.  MINEXPONENT                                Largest negative exponent for a
  18971.                                             data type
  18972.  
  18973.  NARGS                                      Returns number of command-line
  18974.                                             arguments
  18975.  
  18976.  NEAREST                                    Closest number (larger or
  18977.                                             smaller) to a given number
  18978.  
  18979.  SCAN                                       Searches a string for a character
  18980.                                             in a set
  18981.  
  18982.  TINY                                       Smallest positive number
  18983.  
  18984.  VERIFY                                     Searches a string for a character
  18985.                                             not in a set
  18986.  
  18987.  
  18988.  B.1.3  Microsoft FORTRAN Language Extensions
  18989.  
  18990.  Microsoft FORTRAN Version 5.0 supports all IBM SAA extensions. Microsoft
  18991.  FORTRAN Version 5.0 includes many (but not all) VAX extensions. Some of
  18992.  these features may be implemented in this manual differently than DEC
  18993.  implementation. Read the appropriate section to see if there are differences
  18994.  that are important to your application.
  18995.  
  18996.  For ease in transporting SAA or VAX applications to MS-DOS computers, there
  18997.  are two FL command-line options which disable all Microsoft FORTRAN
  18998.  extensions except for SAA extensions (/4Yi) or VAX extensions (/4Yv). See
  18999.  Chapter 7, "The FL Command," for more information on these options.
  19000.  
  19001.  
  19002.  B.1.4  OS/2
  19003.  
  19004.  Microsoft FORTRAN now supports a method for building dynamic-link and
  19005.  multithread libraries. For more information, see Microsoft FORTRAN Advanced
  19006.  Topics.
  19007.  
  19008.  
  19009.  B.1.5  Graphics
  19010.  
  19011.  Microsoft FORTRAN now provides a graphics library which supports text
  19012.  manipulation under both DOS and OS/2, and line- and shape-drawing functions
  19013.  under DOS. For more information , see Microsoft FORTRAN Advanced Topics.
  19014.  
  19015.  
  19016.  B.2  Changes from Version 4.0 to Version 4.1
  19017.  
  19018.  The principal change from Version 4.0 to Version 4.1 is the addition of OS/2
  19019.  support. The compiler, the linker, and the FL utility have been modified to
  19020.  correctly compile and link OS/2 real- or protected-mode programs.
  19021.  
  19022.  
  19023.  B.2.1  OS/2 Support
  19024.  
  19025.  You can write protected-mode programs that run under OS/2, real-mode
  19026.  programs that run under DOS Version 3.0 (or higher), or bound programs that
  19027.  run under both operating systems. For detailed information about developing
  19028.  programs for OS/2, see Chapter 3, "Programming Under OS/2," in Microsoft
  19029.  FORTRAN Advanced Topics.
  19030.  
  19031.  
  19032.  B.2.2  Enhanced FL Utility
  19033.  
  19034.  You can now use an environment variable to specify frequently used FL
  19035.  options. The new version of FL also lets you specify libraries anywhere on
  19036.  the command line and create overlays without a separate link step. The FL
  19037.  command also includes switches for compiling and linking under OS/2.
  19038.  
  19039.  
  19040.  B.2.2.1  Creating Overlays
  19041.  
  19042.  The FL utility now lets you specify program overlays on the command line, by
  19043.  enclosing the modules to be overlaid in parentheses.
  19044.  
  19045.  
  19046.  B.2.2.2  Specifying Libraries
  19047.  
  19048.  If you have set up the compiler for both real- and protected-mode OS/2, you
  19049.  must specify the correct library to use when linking. You can use the /Lp
  19050.  option to specify the protected-mode libraries, and the /Lr or /Lc option to
  19051.  specify the real-mode libraries.
  19052.  
  19053.  
  19054.  B.2.2.3  FL Environment Variable
  19055.  
  19056.  The FL environment variable can be used to specify a group of default
  19057.  options that are automatically added to the FL command line.
  19058.  
  19059.  
  19060.  B.2.2.4  Creating Bound Applications
  19061.  
  19062.  The /Fb option may be used to create a bound program that runs under either
  19063.  DOS or OS/2.
  19064.  
  19065.  
  19066.  B.2.2.5  Mixing .LIB and .DEF Files
  19067.  
  19068.  You can now mix .LIB and .DEF files on the command line with other options
  19069.  and files. FL sorts through the file names and sends them in the correct
  19070.  order to the linker.
  19071.  
  19072.  
  19073.  B.2.2.6  /NOI Option
  19074.  
  19075.  The /NOI (NOIGNORECASE) option is no longer the default. You must specify
  19076.  this option by including /link /NOI on the command line or in the
  19077.  environment variable.
  19078.  
  19079.  
  19080.  B.2.2.7  /Tf Option
  19081.  
  19082.  To specify a source file with an extension other than .FOR, use the /Tf
  19083.  option.
  19084.  
  19085.  
  19086.  B.2.3  Extended Control Over Default Libraries (Linker Options)
  19087.  
  19088.  An extension to the /NOD option lets you specify that a particular default
  19089.  library not be searched during linking.
  19090.  
  19091.  The version of the linker included with Microsoft FORTRAN Version 4.1
  19092.  includes an extension to the /NOD (ignore default libraries) option. In
  19093.  previous versions, /NOD made the linker avoid searching any library
  19094.  specified in the object file. You can now use the option to tell LINK not to
  19095.  search a specific default library by including the name after a colon (:).
  19096.  
  19097.  
  19098.  B.3  Changes from Versions 3.2 and 3.3 to Version 4.0
  19099.  
  19100.  This section describes features of the Microsoft FORTRAN Compiler, Version
  19101.  4.0, that are extensions of or changes to Version 3.3. It summarizes the
  19102.  changes made in Version 4.0 to support the ANSI full-language standard; it
  19103.  discusses compatibility between source and object files for Versions 3.2,
  19104.  3.3, and 4.0; and it describes changes and additions to the compiler and
  19105.  linker software, the run-time library system, and the language itself.
  19106.  
  19107.  
  19108.  B.3.1  Changes for ANSI Full-Language Standard
  19109.  
  19110.  Version 4.0 of the Microsoft FORTRAN Compiler is an implementation of the
  19111.  ANSI X3.9-1978 FORTRAN full-language standard; Version 3.3 implemented only
  19112.  the subset standard. The following list summarizes the new features in
  19113.  Version 4.0 that were required for the ANSI full-language standard.
  19114.  
  19115.  Language Construct                         Change for Version 4.0
  19116.  
  19117.  Concatenation operator (//)                Now supported.
  19118.  
  19119.  Asterisk length specifiers                 Can be used with character
  19120.                                             functions and character
  19121.                                             parameters.
  19122.  
  19123.  CHARACTER*n arguments                      Argument length passed with
  19124.                                             CHARACTER*n arguments to
  19125.                                             subprograms or functions. The
  19126.                                             maximum value of n is now 32,767
  19127.                                             instead of 127.
  19128.  
  19129.  Format specifiers                          Can be character arrays.
  19130.  
  19131.  Unit specifiers                            Unit specifiers that include the
  19132.                                             UNIT= keyword can appear at any
  19133.                                             position in the I/O control list.
  19134.  
  19135.  LEN intrinsic function                     Now supported.
  19136.  
  19137.  INDEX intrinsic function                   Now supported.
  19138.  
  19139.  Assignment statement                       Can include Hollerith constants.
  19140.  (computational)
  19141.  
  19142.  BACKSPACE, ENDFILE, and REWIND             Can transfer control to a label
  19143.  statements                                 after errors and use a variable
  19144.                                             to indicate error or end-of-file
  19145.                                             status.
  19146.  
  19147.  CLOSE and OPEN statements                  Can transfer control to a label
  19148.                                             after errors. The OPEN statement
  19149.                                             can specify how blanks are
  19150.                                             interpreted in numeric input.
  19151.  
  19152.  DATA statement                             Items that are assigned values
  19153.                                             can include substring names and
  19154.                                             implied-DO lists.
  19155.  
  19156.  CALL statement                             Can include Hollerith constants.
  19157.  
  19158.  DATA statement                             Can include Hollerith constants.
  19159.  
  19160.  DIMENSION statement                        Both upper and lower bounds
  19161.                                             allowed for dimension
  19162.                                             declarators.
  19163.  
  19164.  DO statement                               Loop indices can be of any REAL
  19165.                                             type.
  19166.  
  19167.  ENTRY statement                            Now supported.
  19168.  
  19169.  STATUS= in OPEN statements                 Opening existing files with the
  19170.                                             STATUS='NEW' option is illegal.
  19171.                                             STATUS='UNKNOWN' in Version 4.0
  19172.                                             behaves the same way as does
  19173.                                             STATUS='NEW' in Version 3.3.
  19174.  
  19175.  Constants in PARAMETER statements          Arithmetic, logical, and
  19176.                                             character constants fully
  19177.                                             supported.
  19178.  
  19179.  PRINT statement                            Now supported.
  19180.  
  19181.  READ statement                             READ statements without a control
  19182.                                             information list or without a
  19183.                                             unit specifier supported.
  19184.  
  19185.  
  19186.  B.3.2  Source Compatibility
  19187.  
  19188.  Version 4.0 of the Microsoft FORTRAN Compiler compiles any valid source
  19189.  program that you successfully compiled using an earlier version of the
  19190.  compiler, except where list-directed I/O and direct-access I/O are used
  19191.  together. However, source programs may behave differently when compiled with
  19192.  Version 4.0.
  19193.  
  19194.  
  19195.  B.3.3  Attributes in Array Declarations
  19196.  
  19197.  In array declarations in Version 4.0, attributes appear before the list of
  19198.  array bounds. In Version 3.3, attributes appear after the list of array
  19199.  bounds.
  19200.  
  19201.  For example, this declaration in a Version 3.3 source file
  19202.  
  19203.             DIMENSION x(10)[VALUE]
  19204.  
  19205.  should appear as shown below in a Version 4.0 source file:
  19206.  
  19207.             DIMENSION x[VALUE](10)
  19208.  
  19209.  
  19210.  B.3.4  Blanks in Formatted Files
  19211.  
  19212.  The ANSI full-language and subset standards treat blanks in formatted files
  19213.  differently. In the full-language standard, blanks are treated as null
  19214.  characters unless the BN and BZ format descriptors, or the BLANK= option in
  19215.  an OPEN statement, specify otherwise. In the subset standard, blanks are
  19216.  treated as zeros unless the BN and BZ format descriptors indicate otherwise.
  19217.  
  19218.  Version 4.0 supports the full-language treatment of blanks: it considers
  19219.  blanks to be null characters unless otherwise specified.
  19220.  
  19221.  If the files used by a program expect blanks to be treated as zeros by
  19222.  default, the program must include the BLANK='ZERO' option in the OPEN
  19223.  statements for those files.
  19224.  
  19225.  
  19226.  B.3.5  MODE and STATUS Options in OPEN Statement
  19227.  
  19228.  In Version 4.0, if the MODE=mode option does not appear in an OPEN
  19229.  statement, the FORTRAN run-time system tries to open the file with MODE
  19230.  values of 'READWRITE', 'READ', and 'WRITE', in that order. In Version 3.3,
  19231.  if the MODE=mode option does not appear in an OPEN statement, the FORTRAN
  19232.  run-time system tries to open the file with MODE values of 'READWRITE',
  19233.  'WRITE', and 'READ', in that order.
  19234.  
  19235.  In Version 4.0, when the STATUS='NEW' option appears in an OPEN statement,
  19236.  the file specified in the statement must not exist. If an existing file has
  19237.  the same path name as the file specified in the statement, an error results.
  19238.  In Version 3.3, when the STATUS='NEW' option appears in an OPEN statement,
  19239.  the file specified in the statement can exist at the time the statement is
  19240.  executed. Any file with the same path name as the file specified in the
  19241.  statement is overwritten. (This conflicts with a strict interpretation of
  19242.  the standard.)
  19243.  
  19244.  If you want programs compiled using Version 4.0 to behave in the same way as
  19245.  programs compiled using Version 3.3, substitute the STATUS='UNKNOWN' option
  19246.  for the STATUS='NEW' option in any OPEN statements that specify the path
  19247.  names of existing files.
  19248.  
  19249.  
  19250.  B.3.6  Temporary Scratch-File Names
  19251.  
  19252.  In Version 4.0, if no file name is specified in an OPEN statement, the
  19253.  FORTRAN run-time system creates a temporary scratch file with a file name in
  19254.  the following format:
  19255.  
  19256.       ZZprocessno
  19257.  
  19258.  In this file name, processno is an alphanumeric character followed by a
  19259.  5-digit process number. The alphanumeric character is "0" for the first
  19260.  temporary file opened, followed by the letters "a", "b", "c", and so on for
  19261.  each subsequent file name. For example, if you opened five files with no
  19262.  file names in a single program, the file names assigned to the temporary
  19263.  files would be the following (if "12345" is the process number):
  19264.  
  19265.  ZZ012345 (first file opened) ZZa12345 (second file opened) ZZb12345 (third
  19266.  file opened) ZZc12345 (fourth file opened) ZZd12345 (fifth file opened)
  19267.  
  19268.  In Version 3.3, if no file name is specified in an OPEN statement, the
  19269.  scratch file name has the following format:
  19270.  
  19271.       Tunitspec.TMP
  19272.  
  19273.  In this file name, unitspec is the unit number specified in the OPEN
  19274.  statement.
  19275.  
  19276.  
  19277.  B.3.7  Binary Direct Files
  19278.  
  19279.  In Version 4.0, binary files can be opened for direct access. In most cases,
  19280.  I/O operations performed on binary direct files produce the same results as
  19281.  the same operations performed on unformatted direct files. An exception is
  19282.  that the number of bytes transferred in a single binary direct read or write
  19283.  operation is no longer limited by the record length (although even multiples
  19284.  of the record length are still used in repositioning between successive READ
  19285.  and WRITE statements).
  19286.  
  19287.  See Chapter 6, "Record Structure: File Formats and Access," in Microsoft
  19288.  FORTRAN Advanced Topics.
  19289.  
  19290.  
  19291.  B.3.8  Precision of Floating-Point Operations
  19292.  
  19293.  Programs that use floating-point values may give slightly different results
  19294.  when compiled with Version 4.0 because Version 4.0 passes more information
  19295.  to the 8087/80287 coprocessor than Version 3.3. This has the effect of
  19296.  maintaining higher precision than if the values were truncated into double-
  19297.  or single-precision values.
  19298.  
  19299.  For example, in Version 4.0, arguments to transcendental functions are
  19300.  passed in the 8087/80287 registers. If these arguments are expressions,
  19301.  their values are in the 64-bit precision of the coprocessor. In Version 3.3,
  19302.  arguments to transcendental functions are passed in memory as either single-
  19303.  or double-precision values. Thus, these arguments are truncated to 23- or
  19304.  52-bit precision, respectively.
  19305.  
  19306.  See Chapter 1, "Controlling Floating-Point Operations," in Microsoft FORTRAN
  19307.  Advanced Topics for more information.
  19308.  
  19309.  
  19310.  B.3.9  Exponentiation Exceptions
  19311.  
  19312.  Versions 4.0 and 3.3 give different results for certain cases of
  19313.  exponentiation. These differences fall into four categories:
  19314.  
  19315.    1. Zero raised to a zero power
  19316.  
  19317.    2. Zero raised to a negative power
  19318.  
  19319.    3. COMPLEX zero raised to a COMPLEX power
  19320.  
  19321.    4. Negative INTEGER or REAL values raised to a REAL power
  19322.  
  19323.  Tables B.1-B.4 summarize these differences. The following abbreviations are
  19324.  used in the tables:
  19325.  
  19326.  Abbreviation                Meaning
  19327.  
  19328.  f                           Nonintegral real number (for
  19329.                              example, 1.5)
  19330.  
  19331.  -n                          Negative integer
  19332.  
  19333.  +r                          Positive real number
  19334.  
  19335.  -r                          Negative real number
  19336.  
  19337.  s                           Nonzero real number
  19338.  
  19339.  w                           Integral real number (for
  19340.                              example, 3.0)
  19341.  
  19342.  Table B.1  Negative INTEGER or REAL Raised to a REAL Power
  19343.  
  19344.  
  19345.                                                        Version     Version
  19346.  Base        Exponent                                  4.0         3.3
  19347.  Type        Type         Formula      Example         Returns     Returns
  19348.  
  19349.  INTEGER     REAL         (-n)w        (-3)^(3.0)      -27.0       Error
  19350.  INTEGER     REAL         (-n)f        (-1)^(1.5)      Error       Error
  19351.  REAL        REAL         (-r)^(w)     (-3.0)^(3.0)    -27.0       Error
  19352.  REAL        REAL         (-r)^(f)     (-1.0)^(1.5)    Error       Error
  19353.  
  19354.  
  19355.  Table B.2  Zero Raised to a Negative Power
  19356.  
  19357.  
  19358.                                                     Version       Version
  19359.  Base        Exponent                               4.0           3.3
  19360.  Type        Type         Formula                   Returns       Returns
  19361.  
  19362.  INTEGER     INTEGER      0^(-n)                    Error         Error
  19363.  REAL        INTEGER      0.0^(-n)                  Error         Error
  19364.  REAL        REAL         0.0^(-r)                  Error         Error
  19365.  COMPLEX     INTEGER      (0.0,0.0)^(-n)            Error         (0.0,0.0)
  19366.  COMPLEX     REAL         (0.0,0.0)^(-r)            Error         (0.0,0.0)
  19367.  COMPLEX     COMPLEX      (0.0,0.0)^(-(r,0))        Error         (0.0,0.0)
  19368.  
  19369.  
  19370.  Table B.3  COMPLEX Zero Raised to a COMPLEX Power
  19371.  
  19372.                                                     Version       Version
  19373.  Base        Exponent                               4.0           3.3
  19374.  Type        Type         Formula                   Returns       Returns
  19375.  
  19376.  COMPLEX     COMPLEX      (0.0, 0.0)^(+r,0.0)       (0.0,0.0)     (0.0,0.0)
  19377.  COMPLEX     COMPLEX      (0.0,0.0)^(0.0,0.0)       (1.0,0.0)     (0.0,0.0)
  19378.  COMPLEX     COMPLEX      (0.0,0.0)^(-r,0.0)        Error         (0.0,0.0)
  19379.  COMPLEX     COMPLEX      (0.0,0.0)^(+r,s)          (0.0,0.0)     (0.0,0.0)
  19380.  COMPLEX     COMPLEX      (0.0,0.0)^(0.0,s)         Error         (0.0,0.0)
  19381.  COMPLEX     COMPLEX      (0.0,0.0)^(-r,s)          Error         (0.0,0.0)
  19382.  
  19383.  Table B.4  Zero Raised to the Zero Power
  19384.  
  19385.                                                     Version        Version
  19386.  Base         Exponent                              4.0            3.3
  19387.  Type         Type         Formula                  Returns        Returns
  19388.  
  19389.  INTEGER      INTEGER      0^(0)                    1              1
  19390.  REAL         INTEGER      0.0^(0)                  1.0            1.0
  19391.  REAL         REAL         0.0^(0.0)                1.0            1.0
  19392.  COMPLEX      INTEGER      (0.0,0.0)^(0)            (1.0,0.0)      (0.0,0.0)
  19393.  COMPLEX      REAL         (0.0,0.0)^(0.0)          (1.0,0.0)      (0.0,0.0)
  19394.  COMPLEX      COMPLEX      (0.0,0.0)^(0.0,0.0)      (1.0,0.0)      (0.0,0.0)
  19395.  
  19396.  
  19397.  B.3.10  List-Directed Output
  19398.  
  19399.  In Version 4.0, the conventions for list-directed output have changed. The
  19400.  following conventions are used:
  19401.  
  19402.    1. Integer output constants are produced with the effect of an I11 edit
  19403.       descriptor. (Version 3.3 uses the I12 edit descriptor for this.)
  19404.  
  19405.    2. Real and double-precision constants are produced with the effect of
  19406.       either an F or an E edit descriptor, depending on the value of the
  19407.       constant c in the following range:
  19408.  
  19409.       1<=c<10^(7)
  19410.  
  19411.       a.   If c is within the range, the constant is produced by using
  19412.            0PF15.6 for single precision and 0PF24.15 for double precision.
  19413.            In Version 3.3, 0PF16.7 is used for single precision and
  19414.            0PF23.14 is used for double precision.
  19415.  
  19416.       b.   If c is outside the range, the constant is produced using
  19417.            1PE15.6E2 for single precision and 1PE24.15E3 for double
  19418.            precision. The value 0 is printed with this format. (In Version
  19419.            3.3, 1PE14.6E3 is used for single precision and 1PE21.13E3 is
  19420.            used for double precision.)
  19421.  
  19422.       The same field widths are used to force the constants in both cases to
  19423.       line up on a printed page.
  19424.  
  19425.  
  19426.  B.3.11  DO-Loop Ranges
  19427.  
  19428.  The code generated for DO loops in Version 4.0 uses the standard formula for
  19429.  determining the loop iteration count, which is, consequently, limited to the
  19430.  maximum allowable integer size. In Version 3.3, the code generated for DO
  19431.  loops allows more iterations than the maximum allowable integer value; for
  19432.  example, if the $STORAGE:2 metacommand is in effect, a DO loop of the
  19433.  following form loops 65,535 times in Version 3.3 but is illegal in Version
  19434.  4.0:
  19435.  
  19436.             DO 200 I = -32767,32767
  19437.  
  19438.  
  19439.  B.3.12  Object Compatibility
  19440.  
  19441.  Sections B.3.13-B.3.15 discuss compatibility between object files compiled
  19442.  with Versions 4.0, 3.3, and 3.2. If possible, you should recompile programs
  19443.  and subprograms to take advantage of the improved code generated by Version
  19444.  4.0. If you cannot do this (for example, if the source files are
  19445.  unavailable), you can continue to link object files generated by Version 3.3
  19446.  with those generated by Version 4.0. However, you should read the
  19447.  information in the following paragraphs to make sure that object files
  19448.  compiled under the two versions link correctly.
  19449.  
  19450.  
  19451.  B.3.13  Library Compatibility
  19452.  
  19453.  If your program mixes modules compiled with Version 4.0 and modules compiled
  19454.  with Version 3.3, you must link them with the FORTRAN.LIB library that comes
  19455.  with Version 4.0 in addition to a standard FORTRAN library built by the
  19456.  SETUP program. The SETUP program installs the Version 4.0 FORTRAN.LIB if you
  19457.  request compatibility with Version 3.3 or 3.2. This library is required
  19458.  because the standard Version 4.0 libraries are different internally from the
  19459.  standard Version 3.3 and Version 3.2 libraries, and the code generated by
  19460.  the Version 4.0 compiler accesses these libraries differently. Thus, special
  19461.  interfaces are required so that the code produced by the two versions can
  19462.  work together.
  19463.  
  19464.  The Version 4.0 FORTRAN.LIB library includes the interfaces required to work
  19465.  with Version 3.3 and Version 3.2 modules. It contains all the external
  19466.  interfaces supported by Version 3.3 and Version 3.2 FORTRAN.LIB. However,
  19467.  the interfaces in the Version 4.0 library generally use parts of the
  19468.  standard Version 4.0 library to perform their processing.
  19469.  
  19470.  FORTRAN.LIB is not required if all of the object files you are linking were
  19471.  compiled with Version 4.0. Also, since modules compiled with Versions 3.3
  19472.  and 3.2 have library search directives for FORTRAN.LIB embedded in them, you
  19473.  do not need to specify FORTRAN.LIB explicitly when you link. However, this
  19474.  library should be found in the standard place specified in the LIB
  19475.  environment variable.
  19476.  
  19477.  You can use Version 3.3 and Version 3.2 modules with Version 4.0 modules
  19478.  that are compiled with any /FP compiler option, subject to the restrictions
  19479.  that apply to the Version 4.0 modules: that is, you cannot link with an
  19480.  alternate math library (LLIBFORA.LIB) if any of the modules contains in-line
  19481.  instructions.
  19482.  
  19483.  However, you must still tell the SETUP program to include the compatibility
  19484.  math interfaces in the LLIBFORx.LIB library that it builds if you plan to
  19485.  use the library with Version 3.3 and Version 3.2 modules. The resulting
  19486.  program will not be affected, but the library that SETUP builds will be
  19487.  slightly larger. (The math interfaces are not included in FORTRAN.LIB since,
  19488.  unlike the standard FORTRAN libraries built by SETUP, FORTRAN.LIB is not
  19489.  typically associated with a particular /FP option.)
  19490.  
  19491.  
  19492.  B.3.14  Mixing Version 4.0 and Version 3.3 Modules
  19493.  
  19494.  Version 4.0 modules that are linked with Version 3.3 modules must be
  19495.  compiled using the large memory model. This model is the default for Version
  19496.  4.0 FORTRAN programs. (See Chapter 2 of Microsoft FORTRAN Advanced Topics
  19497.  for more information about memory models.)
  19498.  
  19499.  In most cases, the calling and argument-passing conventions are the same in
  19500.  Versions 3.3 and 4.0, so that routines compiled under either version can
  19501.  call each other freely. The only exception is the case of a Version 3.3
  19502.  routine calling a Version 4.0 routine and passing a CHARACTER*(*) argument.
  19503.  (This situation is most likely to arise when a Version 3.3 program passes a
  19504.  subprogram as an argument to another subprogram compiled with Version 4.0.)
  19505.  
  19506.  A routine compiled with Version 3.3 cannot call a Version 4.0 routine that
  19507.  has CHARACTER*(*) formal arguments. Version 4.0 expects the caller to
  19508.  specify the lengths of all such arguments in a special way. Since Version
  19509.  3.3 does not support arguments of this type, Version 3.3 programs cannot
  19510.  pass the argument length. Any such call gives undefined results at run time.
  19511.  (This change was made in order to support the more powerful feature of the
  19512.  full ANSI FORTRAN-77 standard.) This problem does not arise in calls from
  19513.  Version 4.0 routines to Version 3.3 routines. Version 4.0 routines pass the
  19514.  length of a CHARACTER*(*) argument in such a way that Version 3.3 routines
  19515.  can safely ignore it.
  19516.  
  19517.  ───────────────────────────────────────────────────────────────────────────
  19518.  NOTE
  19519.     Certain additional rules apply if you are linking C modules with FORTRAN
  19520.     modules. Chapter 4 of Microsoft FORTRAN Advanced Topics explains these
  19521.     rules.
  19522.  ───────────────────────────────────────────────────────────────────────────
  19523.  
  19524.  If you compile a Version 3.3 source file that includes the STATUS='NEW'
  19525.  option and link the resulting object file with a Version 4.0 library that
  19526.  includes the Version 3.3 compatibility package, the STATUS='NEW' option is
  19527.  mapped to STATUS='UNKNOWN'. This results in behavior more similar to the
  19528.  Version 3.3 implementation of the STATUS='NEW' option.
  19529.  
  19530.  
  19531.  B.3.15  Mixing Version 4.0 and Version 3.2 Modules
  19532.  
  19533.  In general, programs can mix modules compiled with Versions 4.0 and 3.2 of
  19534.  Microsoft FORTRAN. However, the following considerations apply:
  19535.  
  19536.    ■  All considerations that apply to mixing Version 3.3 modules with
  19537.       Version 4.0 modules also apply to mixing Version 3.2 modules with
  19538.       Version 4.0 modules.
  19539.  
  19540.    ■  You must compile any Version 4.0 modules in these programs with the /Gr
  19541.       option to the FL command. This is because the code that Version 4.0
  19542.       generates by default preserves the SI and DI registers for the duration
  19543.       of a subprogram, while the code that Version 3.2 generates does not. If
  19544.       you specify /Gr, the Version 4.0 code does not expect the SI and DI
  19545.       registers to be preserved.
  19546.  
  19547.  
  19548.  B.4  Changes for Version 4.0
  19549.  
  19550.  Sections B.4.1-B.4.4 discuss changes and enhancements to the Microsoft
  19551.  FORTRAN Compiler for Version 4.0. These changes fall under the following
  19552.  categories:
  19553.  
  19554.    ■  Enhancements and additions to the compiler and linker
  19555.  
  19556.    ■  Run-time library changes
  19557.  
  19558.    ■  Language changes
  19559.  
  19560.  
  19561.  B.4.1  Enhancements and Additions to the Compiler and Linker
  19562.  
  19563.  Several features have been added to, or changed in, Version 4.0 of the
  19564.  Microsoft FORTRAN Compiler and the Microsoft Overlay Linker (LINK) to make
  19565.  them easier to use. These features should not affect your source code, but
  19566.  you may need to revise existing batch files or MAKE description files so
  19567.  that they work correctly with Version 4.0.
  19568.  
  19569.  
  19570.  B.4.1.1  The FL Command
  19571.  
  19572.  In Microsoft FORTRAN, a new command, FL, automatically executes the compiler
  19573.  and the linker. The options associated with this command give you
  19574.  considerable flexibility in controlling compilation and linking.
  19575.  
  19576.  You can specify the /c option with the FL command to compile without
  19577.  linking. You can invoke the linker separately after you compile, either
  19578.  through FL or through the LINK command.
  19579.  
  19580.  The FL command performs many of the same functions as any batch files that
  19581.  you may have created to compile and link your FORTRAN programs. It also
  19582.  allows you to specify on the command line all files you want to compile and
  19583.  link and all options for controlling the process. You can include wild-card
  19584.  characters in the files you specify so that you can easily compile and link
  19585.  more than one file. FL automatically prompts you if it cannot find a file
  19586.  that it needs at any point during compilation and linking. Note that you
  19587.  must give the entire source-file name, including the .FOR extension, to the
  19588.  FL command. If you do not include the .FOR extension, FL interprets the file
  19589.  name as an object-file name. If you wish to convert existing batch files so
  19590.  they compile and link correctly under Version 4.0, be sure that you
  19591.  substitute the appropriate FL command for any FOR1, PAS2, PAS3, and LINK
  19592.  commands that may have been in the original batch files.
  19593.  
  19594.  See Chapter 7, "The FL Command," for detailed instructions on using the FL
  19595.  command for program compilation and linking.
  19596.  
  19597.  
  19598.  B.4.1.2  Changes to the Linker
  19599.  
  19600.  Several linker options have been added for Version 4.0. You can specify
  19601.  these options either by using the /link option of the FL command, or by
  19602.  using the LINK command if you choose to invoke the linker separately.
  19603.  
  19604.  The following list gives the new linker options:
  19605.  
  19606.  Option                          Task
  19607.  
  19608.  /CO                             Prepares a special executable
  19609.                                  file for use with the Microsoft
  19610.                                  CodeView window-oriented debugger
  19611.  
  19612.  /DO                             Enforces the default
  19613.                                  segment-loading order for
  19614.                                  Microsoft language products
  19615.                                  (including Microsoft FORTRAN)
  19616.  
  19617.  /E                              Packs the executable file during
  19618.                                  linking
  19619.  
  19620.  /HE                             Lists all LINK command options on
  19621.                                  standard output
  19622.  
  19623.  /I                              Displays information about the
  19624.                                  effect of the linking process on
  19625.                                  standard error output
  19626.  
  19627.  
  19628.  B.4.1.3  Memory Models
  19629.  
  19630.  When you compile a program using Version 4.0 of the Microsoft FORTRAN
  19631.  Compiler, you can choose a memory model to be used for your program. The
  19632.  memory model you choose specifies how memory for the code and data in your
  19633.  program will be allocated. Three memory models are available: medium, large,
  19634.  and huge. You choose a memory model by specifying the /AL (large), /AM
  19635.  (medium), or /AH (huge) option with the FL command at compile time. The
  19636.  default is the large memory model. (See Chapter 2 of Microsoft FORTRAN
  19637.  Advanced Topics for information on the use of memory models.)
  19638.  
  19639.  All programs compiled with Version 3.3 of the Microsoft FORTRAN Compiler are
  19640.  large-model programs. The large model is the default memory model for
  19641.  Version 4.0.
  19642.  
  19643.  For programs that mix modules compiled under Versions 3.3 and 4.0, Version
  19644.  4.0 modules cannot be compiled using the medium memory model. If this model
  19645.  is used for the Version 4.0 modules, the program may produce undefined
  19646.  results, although it may appear to link correctly.
  19647.  
  19648.  ───────────────────────────────────────────────────────────────────────────
  19649.  NOTE
  19650.     Using the $LARGE metacommand on an entire program has the same effect as
  19651.     specifying the huge memory model, except that fixed-size arrays are
  19652.     implicitly declared with the HUGE attribute. The $LARGE metacommand is
  19653.     not associated with the large memory model.
  19654.  ───────────────────────────────────────────────────────────────────────────
  19655.  
  19656.  
  19657.  B.4.2  Run-Time Library Changes
  19658.  
  19659.  The following changes have been made to the libraries provided with Version
  19660.  4.0 of the Microsoft FORTRAN Compiler:
  19661.  
  19662.    ■  The auxiliary library DECMATH.LIB, which supported an alternative
  19663.       floating-point format in Version 3.3, is no longer provided.
  19664.  
  19665.    ■  The library structure for Version 4.0 is considerably different from
  19666.       the structure for Version 3.3. During installation, you can specify the
  19667.       memory model, the math package you wish to use, and various other
  19668.       options. Then the SETUP program builds a library according to your
  19669.       specifications.  The memory-model and floating-point options you
  19670.       specify on the FL command line allow your program to be linked with the
  19671.       library you build automatically.
  19672.  
  19673.  
  19674.  B.4.3  Changes to the Language
  19675.  
  19676.  This section lists the changes made to the Microsoft FORTRAN language for
  19677.  Version 4.0. For each difference, a reference to the appropriate section in
  19678.  the documentation for Version 4.0 or Version 3.3 is given.
  19679.  
  19680.  
  19681.  B.4.3.1  Underscore (_) as a Digit
  19682.  
  19683.  In Version 4.0, the underscore is classified as a digit, which can be used
  19684.  as any character of a name other than the first character. An underscore
  19685.  cannot be used in names if the /4Ys option is used in compiling (or the
  19686.  $STRICT metacommand is in effect). In Version 3.3, the underscore (_) is
  19687.  classified as a special character, which cannot be used in names.
  19688.  
  19689.  
  19690.  B.4.3.2  Dollar Sign ($) in Collating Sequence
  19691.  
  19692.  In Version 4.0, the dollar sign is classified as an alphanumeric character,
  19693.  which can be used in names and which appears after uppercase Z in the
  19694.  collating sequence.
  19695.  
  19696.  The dollar sign cannot be used as an alphanumeric character in names in the
  19697.  following cases:
  19698.  
  19699.    ■  If the /4Ys option is used in compiling (or the $STRICT metacommand is
  19700.       in effect)
  19701.  
  19702.    ■  If the name is declared using the C attribute
  19703.  
  19704.  In Version 3.3, the dollar sign ($) is classified as a special character,
  19705.  which appears as the first character in the FORTRAN collating sequence.
  19706.  
  19707.  
  19708.  B.4.3.3  Significant Characters in Names
  19709.  
  19710.  In Version 4.0, only the first six characters in a name are significant,
  19711.  unless the /4Nt option is used in compiling or the $NOTRUNCATE metacommand
  19712.  is in effect. In this case, the first 31 characters in a name are
  19713.  significant.
  19714.  
  19715.  In Version 3.3, only the first six characters in a name are significant
  19716.  under any circumstances.
  19717.  
  19718.  
  19719.  B.4.3.4  Column Restrictions for Source Files
  19720.  
  19721.  Version 4.0 allows source code to be in free-form format. The /4Yf option to
  19722.  the FL command (and the $FREEFORM metacommand) gives you this choice.
  19723.  
  19724.  In Version 3.3, statements in source programs are required to obey the
  19725.  standard FORTRAN column restrictions.
  19726.  
  19727.  
  19728.  B.4.3.5  Restrictions on Continuation Lines
  19729.  
  19730.  In Version 4.0, limits on the number of continuation lines have been
  19731.  removed, unless the /4Ys option is used in compiling (or the $STRICT
  19732.  metacommand is in effect). In these cases, the compiler  generates an error
  19733.  if a statement extends over more than 19 continuation lines or includes more
  19734.  than 1,320 characters.
  19735.  
  19736.  In Version 3.3, these restrictions are always in effect.
  19737.  
  19738.  
  19739.  B.4.3.6  Maximum Character-Value Length
  19740.  
  19741.  In Version 4.0, the maximum length of character values is 32,767 characters.
  19742.  Character constants are effectively limited to 1,958 characters.
  19743.  
  19744.  In Version 3.3, character values can have a maximum length of 127
  19745.  characters.
  19746.  
  19747.  
  19748.  B.4.3.7  Arithmetic Operations
  19749.  
  19750.  In Version 4.0, raising a negative-value operand to an integral real power
  19751.  is permitted.
  19752.  
  19753.  In Version 3.3, raising a negative-value operand to any real power produces
  19754.  an error.
  19755.  
  19756.  
  19757.  B.4.3.8  Character Editing and Hollerith Data Types
  19758.  
  19759.  In Version 4.0, Hollerith data types can be used with the A edit descriptor
  19760.  when an input/output list item is of type INTEGER, REAL, or LOGICAL.
  19761.  
  19762.  
  19763.  B.4.3.9  Expressions in Substring Specifications
  19764.  
  19765.  In Version 4.0, any type of arithmetic expression can be used to specify the
  19766.  first and last characters in a substring, unless the /4Ys is used in
  19767.  compiling (or the $STRICT metacommand is specified). In effect, noninteger
  19768.  substring expressions are truncated by an implicit use of the INT intrinsic
  19769.  function before substring operations are performed. If the /4Ys option (or
  19770.  $STRICT metacommand) appears, only integer expressions can be used to
  19771.  specify the first and last characters in a substring.
  19772.  
  19773.  In Version 3.3, these restrictions are always in effect.
  19774.  
  19775.  In Version 4.0 the compiler verifies the following relationships, where
  19776.  first is the arithmetic expression that defines the first character in the
  19777.  substring, last is the arithmetic expression that defines the last
  19778.  character, and length is the length of the character variable:
  19779.  
  19780.    ■  first<=last
  19781.  
  19782.    ■  1<=first<=length
  19783.  
  19784.    ■  1<=last<=length
  19785.  
  19786.  If either of these relationships is false and the /4Yb option is used in
  19787.  compiling (or the $DEBUG metacommand is in effect), the compiler generates
  19788.  an error message. If either of these relationships is false and the /4Yb
  19789.  option is not used (or the $DEBUG metacommand is not in effect), the
  19790.  substring is undefined.
  19791.  
  19792.  
  19793.  B.4.3.10  Array Subscripts
  19794.  
  19795.  In Version 4.0, array subscripts can be any arithmetic expression, unless
  19796.  the /4Ys option is used in compiling (or the $STRICT metacommand is
  19797.  specified). In effect, noninteger subscript expressions are truncated by an
  19798.  implicit use of the INT intrinsic function before subscripting operations
  19799.  are performed. If the /4Yb option is used in compiling (or the $DEBUG
  19800.  metacommand is specified), subscripts are checked on all arrays that are not
  19801.  formal arguments, and an error message is generated for invalid subscripts.
  19802.  
  19803.  In Version 3.3, array-element references must be integer expressions.
  19804.  
  19805.  
  19806.  B.4.3.11  Changes to the Input/Output System
  19807.  
  19808.  This section describes changes to the input/output system used in Version
  19809.  4.0 of Microsoft FORTRAN.
  19810.  
  19811.  
  19812.  Unit Specifiers
  19813.  
  19814.  In Version 4.0, unit specifiers can be used more flexibly. The optional
  19815.  UNIT= string can appear before the unit specifier in all I/O statements
  19816.  except PRINT,  INQUIRE with a FILE= option, and the EOF intrinsic function.
  19817.  If the optional UNIT= string appears in the unit specifier, the specifier
  19818.  can appear at any position in the I/O control list. This change was made to
  19819.  conform with the ANSI full-language standard for FORTRAN.
  19820.  
  19821.  In Version 3.3, the unit specifier must appear in the first position.
  19822.  
  19823.  In Version 4.0, the following external unit specifiers can be reconnected to
  19824.  another file:
  19825.  
  19826.  External Unit                     Description
  19827.  
  19828.  0                                 Initially represents the keyboard
  19829.                                    or the screen
  19830.  
  19831.  5                                 Initially represents the keyboard
  19832.  
  19833.  6                                 Initially represents the screen
  19834.  
  19835.  If you connect any of these specifiers to a different file using an OPEN
  19836.  statement and then close that file, the specifier resumes its preconnected
  19837.  status.
  19838.  
  19839.  
  19840.  Output Lists
  19841.  
  19842.  In Version 4.0, arbitrary expressions used in an output list can begin with
  19843.  a left parenthesis.
  19844.  
  19845.  In Version 3.3, arbitrary expressions used in an output list cannot begin
  19846.  with a left parenthesis because left parentheses are reserved for implied-DO
  19847.  lists.
  19848.  
  19849.  
  19850.  Format Specifiers
  19851.  
  19852.  In Version 4.0, statement labels, integer variables, character expressions,
  19853.  character variables, or character arrays can be used as format specifiers.
  19854.  If the /4Ys option is not used in compiling (and the $STRICT metacommand is
  19855.  not in effect), noncharacter arrays can also be used.
  19856.  
  19857.  In Version 3.3, only statement labels, integer variables, character
  19858.  expressions, or character variables can be used as format specifiers.
  19859.  
  19860.  
  19861.  Backslash (\) Edit Descriptor
  19862.  
  19863.  In Version 4.0, the backslash (\) edit descriptor is only recognized for
  19864.  files connected to terminal devices such as screens or printers. Otherwise,
  19865.  it is ignored.
  19866.  
  19867.  In Version 3.3, the backslash edit descriptor is recognized for all file
  19868.  types.
  19869.  
  19870.  
  19871.  B.4.3.12  Assignment Statement (Computational)
  19872.  
  19873.  In Version 4.0, the expression in a computational assignment statement can
  19874.  be a Hollerith constant. A Hollerith constant can be assigned to any type of
  19875.  variable. The normal rules for padding and truncation of character data
  19876.  types also apply to Hollerith constants.
  19877.  
  19878.  In Version 3.3, Hollerith constants cannot be used in assignments.
  19879.  
  19880.  
  19881.  B.4.3.13  CALL Statement
  19882.  
  19883.  In Version 4.0, the actuals parameter can include Hollerith constants.
  19884.  Hollerith constants cannot be passed to character formal arguments.
  19885.  
  19886.  In Version 3.3, Hollerith constants cannot be used in CALL statements.
  19887.  
  19888.  
  19889.  B.4.3.14  DATA Statement
  19890.  
  19891.  In Version 4.0, the nlist parameter in a DATA statement can include
  19892.  substring names and implied-DO lists, and the clist parameter can include
  19893.  Hollerith constants. The normal rules for padding and truncation of
  19894.  character data types also apply to Hollerith constants.
  19895.  
  19896.  In Version 3.3, these constructs are not allowed.
  19897.  
  19898.  
  19899.  B.4.3.15  BACKSPACE, ENDFILE, and REWIND Statements
  19900.  
  19901.  In Version 4.0, the BACKSPACE, ENDFILE, and REWIND statements can include an
  19902.  ERR= option to specify the flow of control after errors, and an  IOSTAT=
  19903.  option to specify a variable to be used to indicate error or end-of-file
  19904.  status.
  19905.  
  19906.  In Version 3.3, the only option allowed in the BACKSPACE, ENDFILE, and
  19907.  REWIND statements is a unit specifier, which specifies the unit location of
  19908.  the file that the command acts on.
  19909.  
  19910.  
  19911.  B.4.3.16  CLOSE and OPEN Statements
  19912.  
  19913.  In Version 4.0, the CLOSE and OPEN statements can include the ERR= option to
  19914.  specify the flow of control if an error occurs during statement execution.
  19915.  In addition, the OPEN statement can include the BLANK= option to indicate
  19916.  how blanks are interpreted in numeric input and the BLOCKSIZE= option to
  19917.  assign a new I/O-buffer size for the file being opened.
  19918.  
  19919.  
  19920.  B.4.3.17  DIMENSION Statement
  19921.  
  19922.  In Version 4.0, no restriction is placed on the number of array dimensions
  19923.  unless the /4Ys option is used in compiling, or the $STRICT metacommand is
  19924.  set. In that case, arrays are restricted to seven dimensions.
  19925.  
  19926.  Arrays in Version 3.3 are always restricted to seven dimensions.
  19927.  
  19928.  In Version 4.0, lower array-dimension bounds can be specified explicitly and
  19929.  can be positive, negative, or 0. If a lower dimension bound is not
  19930.  specified, it is 1 by default.
  19931.  
  19932.  The upper and lower bounds are checked according to the following rules:
  19933.  
  19934.    ■  If the upper and lower dimension bounds are constants, the compiler
  19935.       verifies that the upper dimension bound is greater than or equal to the
  19936.       lower dimension bound. If it is not, the compiler generates an error
  19937.       message.
  19938.  
  19939.    ■  If either the upper or the lower dimension bound is not a constant, the
  19940.       /4Yb compiler option must be used (or the $DEBUG metacommand must be in
  19941.       effect) if you want to verify that the upper bound is greater than or
  19942.       equal to the lower bound.
  19943.  
  19944.  ───────────────────────────────────────────────────────────────────────────
  19945.  NOTE
  19946.     If all of an array's dimensions are declared with no lower bounds and
  19947.     with upper bounds of 1, no bounds checking is performed, even if /4Yb or
  19948.     $DEBUG is used. In this case, the array is treated the same as an
  19949.     adjustable-size array, except that the declared size of the array is used
  19950.     to determined whether or not huge addressing is used.
  19951.  ───────────────────────────────────────────────────────────────────────────
  19952.  
  19953.  Dimension declarators in Version 3.3 do not include lower bounds; the lower
  19954.  bound is always 1.
  19955.  
  19956.  In Version 4.0, a dimension declarator can be an arithmetic expression,
  19957.  unless the /4Ys option is used in compiling (or the $STRICT metacommand is
  19958.  specified). The result of the expression is truncated to an integer by an
  19959.  implicit use of the INT intrinsic function. If an arithmetic expression is
  19960.  used as a dimension declarator, it cannot contain function or array-element
  19961.  references. If a dimension declarator with variables is used to declare an
  19962.  adjustable-size array, the variables either must be formal arguments to a
  19963.  routine or must exist in a common block. Also, the array itself must be a
  19964.  formal argument.
  19965.  
  19966.  
  19967.  B.4.3.18  DO Statement
  19968.  
  19969.  In Version 4.0, loop indices in a DO statement can be integer, real, or
  19970.  double-precision expressions.
  19971.  
  19972.  In Version 3.3, loop indices in a DO statement must be integer expressions.
  19973.  
  19974.  
  19975.  B.4.3.19  INQUIRE Statement
  19976.  
  19977.  In Version 4.0, the INQUIRE statement can include the BINARY= option to
  19978.  indicate whether the file (or the file connected to the unit) specified in
  19979.  the statement is in binary format. It can also include the BLOCKSIZE=
  19980.  option, which reports the I/O buffer size for the file.
  19981.  
  19982.  In Version 3.3., these options do not appear.
  19983.  
  19984.  
  19985.  B.4.3.20  PAUSE Statement
  19986.  
  19987.  In Version 4.0, the PAUSE statement allows the user to enter a blank line to
  19988.  return control to the program. It also allows the user to execute one or
  19989.  more DOS commands before returning control to the program. If this feature
  19990.  is used, the subdirectory containing COMMAND.COM should be part of the
  19991.  user's search path. While the program is suspended, the user can enter
  19992.  either of the following:
  19993.  
  19994.    ■  A DOS command. After the command is executed, control is automatically
  19995.       returned to the program.
  19996.  
  19997.    ■  The word COMMAND (uppercase or lowercase). After entering COMMAND, the
  19998.       user can enter as many DOS commands as desired, then type EXIT
  19999.       (uppercase or lowercase) to return control to the program.
  20000.  
  20001.  In Version 3.3, the PAUSE statement only allows the user to enter a blank
  20002.  line to return control to the program.
  20003.  
  20004.  
  20005.  B.4.3.21  READ and WRITE Statements
  20006.  
  20007.  In Version 4.0, the READ and WRITE statements can include the FMT=
  20008.  formatspec option, which can appear at any position in the I/O control list.
  20009.  However, the READ statement must include a unit specifier if the
  20010.  FMT=formatspec option is used.
  20011.  
  20012.  In Version 3.3, a format specifier must be the second argument in a
  20013.  formatted READ or WRITE statement.
  20014.  
  20015.  In Version 4.0, the unit specifier can be omitted in a READ statement of the
  20016.  following form:
  20017.  
  20018.  READ formatspec, iolist
  20019.  
  20020.  In this form of the READ statement, the unit is assumed to be the keyboard
  20021.  (*) unit.
  20022.  
  20023.  In Version 3.3, a unit specifier must be the first argument to a READ
  20024.  statement.
  20025.  
  20026.  
  20027.  B.4.3.22  STOP Statement
  20028.  
  20029.  In Version 4.0, if the message parameter in a STOP statement is an integer,
  20030.  the program displays this value on the screen and returns the
  20031.  least-significant byte of this value to the operating system. (This is a
  20032.  value between 0 and 255, inclusive.) If the message parameter is not an
  20033.  integer, the program displays this value on the screen and returns 0 to the
  20034.  operating system.
  20035.  
  20036.  In Version 3.3, if the message parameter in a STOP statement is an integer,
  20037.  the program displays the specified integer.
  20038.  
  20039.  
  20040.  B.4.3.23  Type Statements
  20041.  
  20042.  Type statements in Version 4.0 can be used to initialize the values of
  20043.  variables. However, variables that appear in COMMON and EQUIVALENCE
  20044.  statements cannot be initialized in this way.
  20045.  
  20046.  Also, length specifiers in type statements in Version 4.0 can appear either
  20047.  before or after dimension declarators.
  20048.  
  20049.  
  20050.  B.4.3.24  Conditional Compilation
  20051.  
  20052.  In Version 4.0, the /4cc option of the FL command (or the $DEBUG:string
  20053.  metacommand) can be used to specify conditional compilation. If one or more
  20054.  letters follows the /4cc option (or $DEBUG metacommand), lines in the source
  20055.  file that have one of those letters in column 1 are compiled into the
  20056.  program. Lines beginning with other characters are treated as comments.
  20057.  
  20058.  
  20059.  B.4.4  New Language Features
  20060.  
  20061.  Sections B.4.4.1-B.4.4.9 discuss new features for Version 4.0 of Microsoft
  20062.  FORTRAN and the changes you may have to make to source programs to take
  20063.  advantage of these features.
  20064.  
  20065.  
  20066.  B.4.4.1  INTEGER*1 and LOGICAL*1 Data Types
  20067.  
  20068.  Version 4.0 supports two new data types: INTEGER*1 and LOGICAL*1.
  20069.  
  20070.  An INTEGER*1 value occupies 1 byte and can be any number in the range -127
  20071.  to 127, inclusive. In an arithmetic expression, INTEGER*1 is the
  20072.  lowest-ranked operand. If an INTEGER*1 value is converted to an INTEGER*2
  20073.  value, the INTEGER*1 value is used as the least-significant part of the
  20074.  INTEGER*2 value, and the most-significant part is filled with copies of the
  20075.  sign bit (that is, it is sign extended). A new intrinsic function, INT1, is
  20076.  provided to convert values to type INTEGER*1. A LOGICAL*1 value occupies 1
  20077.  byte of storage. The value of this byte is either 0 (.FALSE.) or 1 (.TRUE.).
  20078.  
  20079.  
  20080.  B.4.4.2  C Strings
  20081.  
  20082.  The following new string escape sequences from the C language have been
  20083.  added for Version 4.0:
  20084.  
  20085.  Sequence                           Character
  20086.  
  20087.  \""                                Double quote
  20088.  
  20089.  \xhh                               Hexadecimal bit pattern (where h
  20090.                                     is between 0 and F, inclusive)
  20091.  
  20092.  \a                                 Bell
  20093.  
  20094.  See Chapter 2 in Microsoft FORTRAN Advanced Topics, for more information
  20095.  about C strings.
  20096.  
  20097.  
  20098.  B.4.4.3  Concatenation Operator
  20099.  
  20100.  Version 4.0 supports the use of the concatenation operator (//) in character
  20101.  expressions.
  20102.  
  20103.  
  20104.  B.4.4.4  New Intrinsic Functions
  20105.  
  20106.  New intrinsic functions that perform data-type conversion and bit
  20107.  manipulation have been added for Version 4.0.
  20108.  
  20109.  
  20110.  Data-Type Conversion
  20111.  
  20112.  The following list summarizes the new intrinsic functions that are used for
  20113.  data-type conversion:
  20114.  
  20115.  Function                          Operation
  20116.  
  20117.  INT1                              Converts arguments to type
  20118.                                    INTEGER*1
  20119.  
  20120.  HFIX                              Converts arguments to type
  20121.                                    INTEGER*2
  20122.  
  20123.  JFIX                              Converts arguments to type
  20124.                                    INTEGER*4
  20125.  
  20126.  See Chapter 5, "Intrinsic Functions and Additional Procedures," for more
  20127.  information about these functions.
  20128.  
  20129.  
  20130.  Bit Manipulation
  20131.  
  20132.  In Version 4.0, several new intrinsic functions can be used to perform
  20133.  bit-wise operations on variables. The list below summarizes these new
  20134.  intrinsic functions:
  20135.  
  20136.  Function                          Operation
  20137.  
  20138.  BTEST                             Bit test
  20139.  
  20140.  IAND                              Logical product
  20141.  
  20142.  IBCHNG                            Bit change
  20143.  
  20144.  IBCLR                             Bit clear
  20145.  
  20146.  IBSET                             Bit set
  20147.  
  20148.  IEOR                              Exclusive or
  20149.  
  20150.  IOR                               Inclusive or
  20151.  
  20152.  ISHA                              Arithmetic shift
  20153.  
  20154.  ISHC                              Rotate
  20155.  
  20156.  ISHFT                             Logical shift
  20157.  
  20158.  ISHL                              Logical shift
  20159.  
  20160.  NOT                               Logical complement
  20161.  
  20162.  All of these functions except NOT and BTEST accept two arguments of type
  20163.  INTEGER, INTEGER*1, INTEGER*2, or INTEGER*4 and return a result of the same
  20164.  type. If two arguments with different INTEGER types are given, the larger of
  20165.  the two types is returned (provided that it is also a legal type).
  20166.  
  20167.  NOT accepts one argument of one of these types and returns a result of the
  20168.  same type. BTEST accepts two arguments of one of these types and returns a
  20169.  LOGICAL result. All of these functions can be passed as actual arguments.
  20170.  
  20171.  
  20172.  B.4.4.5  New Time and Date Functions
  20173.  
  20174.  New subroutines and functions that get and set the date and time have been
  20175.  added for Version 4.0. The following list summarizes these functions:
  20176.  
  20177.  Function              Operation
  20178.  
  20179.  GETDAT                Gets the system date
  20180.  
  20181.  GETTIM                Gets the system time
  20182.  
  20183.  SETDAT                Sets the system date
  20184.  
  20185.  SETTIM                Sets the system time
  20186.  
  20187.  See Chapter 5, "Intrinsic Functions and Additional Procedures,"  for more
  20188.  information about these functions.
  20189.  
  20190.  
  20191.  B.4.4.6  Z Edit Descriptor
  20192.  
  20193.  The new Z repeatable edit descriptor allows you to specify hexadecimal
  20194.  editing in input/output lists. This edit descriptor has the form Zw, which
  20195.  specifies a field that is w characters wide. Hexadecimal digits A-F are
  20196.  output in uppercase. See Section 3.7.2 for rules for the use of this edit
  20197.  descriptor.
  20198.  
  20199.  
  20200.  B.4.4.7  ENTRY Statement
  20201.  
  20202.  ENTRY specifies an entry point for a subroutine or external function.
  20203.  
  20204.  
  20205.  B.4.4.8  PRINT Statement
  20206.  
  20207.  PRINT specifies output to the screen (unit *).
  20208.  
  20209.  
  20210.  B.4.4.9  $[NO]DECLARE, $[NO]FREEFORM, and $[NO]TRUNCATE Metacommands
  20211.  
  20212.  Six new metacommands have been added to Version 4.0 of Microsoft FORTRAN
  20213.  $DECLARE, $NODECLARE, $FREEFORM, $NOFREEFORM, $TRUNCATE, and $NOTRUNCATE.
  20214.  
  20215.  The $DECLARE metacommand causes the compiler to display warning messages for
  20216.  variables that are not declared in type statements. The $NODECLARE
  20217.  metacommand suppresses these warnings. The $NODECLARE metacommand is the
  20218.  default. Note that the /4Yd compiler option has the same effect as the
  20219.  $DECLARE metacommand, and the /4Nd compiler option has the same effect as
  20220.  the $NODECLARE metacommand.
  20221.  
  20222.  The $FREEFORM metacommand tells the compiler that the source program ignores
  20223.  the standard FORTRAN column restrictions (labels in columns 1-5,
  20224.  continuation characters in column 6, statements in columns 7-72, and any
  20225.  columns beyond 72 ignored). The $NOFREEFORM metacommand tells the compiler
  20226.  that the source program observes these column restrictions. $NOFREEFORM is
  20227.  the default. Note that the /4Yf compiler option has the same effect as the
  20228.  $FREEFORM metacommand, and the /4Nf compiler option has the same effect as
  20229.  the $NOFREEFORM metacommand.
  20230.  
  20231.  The $TRUNCATE metacommand tells the compiler to generate warning messages
  20232.  for any names longer than six characters. This option makes it easier to
  20233.  port your programs to other systems. The $NOTRUNCATE metacommand tells the
  20234.  compiler to treat the first 31 characters in a name as significant.
  20235.  $TRUNCATE is the default. Note that the /4Yt compiler option has the same
  20236.  effect as the $TRUNCATE metacommand, and the /4Nt compiler option has the
  20237.  same effect as the $NOTRUNCATE metacommand.
  20238.  
  20239.  See Chapter 6, "Metacommands," for more information on these metacommands.
  20240.  
  20241.  
  20242.  Appendix C  Compiler and Linker Limits
  20243.  
  20244.  ───────────────────────────────────────────────────────────────────────────
  20245.  
  20246.  This appendix discusses the limits imposed by the Microsoft FORTRAN Compiler
  20247.  and the Microsoft Segmented-Executable Linker (for example, the maximum
  20248.  length of an identifier) and suggests programming strategies for avoiding
  20249.  these limits.
  20250.  
  20251.  
  20252.  C.1  Compiler Limits
  20253.  
  20254.  To operate the Microsoft FORTRAN Compiler you must have sufficient disk
  20255.  space for the compiler to create temporary files used in processing. The
  20256.  required space is approximately two times the size of the source file.
  20257.  
  20258.  Table C.1 summarizes the limits imposed by the Microsoft FORTRAN Compiler.
  20259.  If your program exceeds one of these limits, an error message will inform
  20260.  you of the problem.
  20261.  
  20262.  Table C.1  Limits Imposed by the Microsoft FORTRAN Compiler
  20263.  
  20264.  Program Item               Maximum Limit
  20265.  
  20266.  Actual arguments           Number per subprogram: approximately 64
  20267.  
  20268.  Character constants        Length: approximately 1,900 bytes
  20269.  
  20270.  Names                      Length: 31 bytes (default) or 6 bytes (if /4Ys or
  20271.                             /4Yt is used in compiling or if $STRICT or
  20272.                             $TRUNCATE metacommand is in effect); in either
  20273.                             case, additional characters are discarded
  20274.  
  20275.                             Internal, length: 40 bytes per module: 20,000
  20276.                             names
  20277.  
  20278.  Simple variables           Number of simple variables per subprogram:
  20279.                             approximately 5,000 (depending on lengths of
  20280.                             variable names)
  20281.  
  20282.  Statements                 Levels of nesting: approximately 40 levels
  20283.  
  20284.  ENTRY statements           Number per subroutine: 32,000
  20285.  
  20286.  FORMAT statements          Number per module: 20,000
  20287.  
  20288.                             Format length: approximately 1,900 characters
  20289.  
  20290.                             Memory limitations: in medium-model programs, no
  20291.                             more than 64K internal formats in the default
  20292.                             data segment
  20293.  
  20294.                             Number of errors per statement: 10 errors
  20295.  
  20296.  GOTO statements            Number per subroutine: 64
  20297.  (assigned)
  20298.  
  20299.  INTEGER items              Size: 128 bytes for a string of digits
  20300.  
  20301.  Include files              Levels of nesting: 10 levels
  20302.  
  20303.  
  20304.  The compiler does not set explicit limits on the number and complexity of
  20305.  declarations, definitions, and statements in an individual function or in a
  20306.  program. If the compiler encounters a function or program that is too large
  20307.  or too complex to be processed, it produces an error message to that effect.
  20308.  
  20309.  During compilation, large programs are most often limited in the number of
  20310.  identifiers allowed in any one source file. They are also occasionally
  20311.  limited by the complexity of the program or one of its statements.
  20312.  
  20313.  
  20314.  C.1.1  Limits on Number of Names
  20315.  
  20316.  The Microsoft FORTRAN Compiler limits the number of names you can use in a
  20317.  source program. The compiler creates symbol-table entries for the names
  20318.  declared in source programs. Symbol-table entries are created for the
  20319.  following objects:
  20320.  
  20321.    ■  The program
  20322.  
  20323.    ■  Subroutines and functions declared or referenced in the program unit
  20324.  
  20325.    ■  Common blocks and variables
  20326.  
  20327.    ■  Statement functions
  20328.  
  20329.    ■  Formal parameters
  20330.  
  20331.    ■  Local variables
  20332.  
  20333.  Common variables, statement functions, formal parameters, and local
  20334.  variables are required only while the subroutine or function containing them
  20335.  is being compiled. These names are discarded at the end of the subroutine,
  20336.  and the space they used is made available for other names. Hence, you can
  20337.  create much bigger programs by splitting up your code into more subroutines
  20338.  and functions so that the space for local names can be shared. You can also
  20339.  place the subroutines and functions into their own files and compile them
  20340.  separately, since this usually reduces the number of names in groups being
  20341.  used per module.
  20342.  
  20343.  
  20344.  C.1.2  Limits on Complicated Expressions
  20345.  
  20346.  The compiler may run out of memory when it encounters any of the following:
  20347.  
  20348.    ■  A deeply nested statement or expression
  20349.  
  20350.    ■  A large number of error messages
  20351.  
  20352.    ■  A large block of specification statements (EQUIVALENCE statements in
  20353.       particular)
  20354.  
  20355.  Usually, if pass 1 runs successfully on a program without running out of
  20356.  memory, pass 2 will also run successfully, except for complicated basic
  20357.  blocks. A basic block is defined as follows:
  20358.  
  20359.    ■  A sequence of statements with no labels or other breaks
  20360.  
  20361.    ■  A sequence of statements containing long expressions or parameter lists
  20362.       (especially including I/O statements or character expressions)
  20363.  
  20364.  Pass 2 makes a smaller number of symbol-table entries than pass 1 (for
  20365.  example, for the program, subroutines, and functions declared or referenced
  20366.  in the program unit, for common blocks, and for many of the transcendental
  20367.  functions called in a program). If pass 2 runs out of memory, it displays a
  20368.  line-number reference and one of the following messages:
  20369.  
  20370.       out of heap space
  20371.  
  20372.       expression too complex, please simplify
  20373.  
  20374.  If a particularly long expression or parameter list appears near this line,
  20375.  break up the expression or parameter list by assigning parts of the
  20376.  expression to local variables or by using multiple WRITE statements. If this
  20377.  does not work, add labels to statements to break the basic block.
  20378.  
  20379.  
  20380.  C.1.3  Limits on Character Expressions
  20381.  
  20382.  Use the following programming strategies to avoid compiler limitations when
  20383.  initializing or assigning values to large character variables or array
  20384.  elements:
  20385.  
  20386.    ■  Use smaller pieces
  20387.  
  20388.    ■  Use substrings
  20389.  
  20390.    ■  Use EQUIVALENCE statements to assign values to a character array
  20391.  
  20392.  To avoid compiler limitations on character expressions, assign pieces of the
  20393.  character value to smaller variables or substrings. Just having nonconstants
  20394.  in the expression causes more of the expression to be evaluated at run time
  20395.  instead of at compile time, thus avoiding the 1,900-character compile-time
  20396.  limit on constants.
  20397.  
  20398.  
  20399.  C.2  Linker Limits
  20400.  
  20401.  Table C.2 summarizes the limits imposed by the linker. If you encounter one
  20402.  of these limits, you must adjust your program so that the linker can
  20403.  accommodate it.
  20404.  
  20405.  Table C.2  Limits Imposed by the Microsoft Segmented-Executable Linker
  20406.  
  20407.  Item                       Limit
  20408.  
  20409.  Symbol table               Only limited by available memory
  20410.  
  20411.  DOS load-time              Default is 32K. If /EXEPACK is used, the maximum
  20412.  relocations                is 512K.
  20413.  
  20414.  External symbols per       1,023
  20415.  module
  20416.  
  20417.  Groups                     Maximum number is 21, but the linker always
  20418.                             defines DGROUP so the effective maximum is 20.
  20419.  
  20420.  Overlays                   63
  20421.  
  20422.  Logical segments           128 by default; however, this maximum can be set
  20423.                             by using the /SEGMENTS option of the LINK
  20424.                             command.
  20425.  
  20426.  Libraries                  32
  20427.  
  20428.  Group definitions per      21
  20429.  module
  20430.  
  20431.  Physical segments per      255
  20432.  module
  20433.  
  20434.  Stack                      64K
  20435.  
  20436.  
  20437.  C.3  Run-Time Limits
  20438.  
  20439.  When running under MS-DOS or OS/2, a FORTRAN program cannot open more than
  20440.  20 files at one time. If an OS/2 program uses either the multithread library
  20441.  or a dynamically-linked FORTRAN run-time library, this limit is extended to
  20442.  40 files. In practice, the actual limit might be slightly less, depending on
  20443.  how the operating system uses available memory.
  20444.  
  20445.  Exceeding this limit will halt program execution and produce a run-time
  20446.  error message. The message varies, depending on whether you have exceeded
  20447.  the run-time limit set by FORTRAN, or the operating system limit on the
  20448.  number of open files.
  20449.  
  20450.  You can increase the maximum number of open files with the following
  20451.  procedures. In general, you should increase both the FORTRAN run-time limit
  20452.  and the operating system limit; if you have exceeded the FORTRAN run-time
  20453.  limit, increasing just the operating system limit will have no effect.
  20454.  
  20455.  
  20456.  C.3.1  Increasing the Maximum Number of Open Files
  20457.  
  20458.  FORTRAN 5.0 allows you to increase the maximum number of open files. To do
  20459.  this, you must be running under DOS 3.3 (or a later version), or under OS/2
  20460.  (any version).
  20461.  
  20462.  The following instructions refer to two .ASM files. These files are included
  20463.  on your Microsoft FORTRAN distribution disks in directories called STARTUP,
  20464.  STARTUP\DOS  and STARTUP\OS2, whose location is specified in the PACKING.LST
  20465.  file on the SETUP disk. The appropriate .ASM files for each operating system
  20466.  are in the corresponding subdirectory. Both multithread and
  20467.  dynamically-linked FORTRAN run-time libraries require special considerations
  20468.  (See Section C.3.3, below).
  20469.  
  20470.  
  20471.  C.3.1.1  Increasing File Handles
  20472.  
  20473.  Edit the startup source file CRT0DAT.ASM to increase the number of file
  20474.  handles. Change the number in the line
  20475.  
  20476.             _NFILE_ = 20
  20477.  
  20478.  to the maximum number of file handles desired. The limit is 256.
  20479.  
  20480.  
  20481.  C.3.1.2  Increasing Units
  20482.  
  20483.  The next step is to increase the size of the table which FORTRAN uses to
  20484.  manage units. Edit the source file UNIT.ASM so that the number in the line
  20485.  
  20486.             _NFILE_ = 20
  20487.  
  20488.  equals the same value you chose in CRT0DAT.ASM. Note that the number of
  20489.  handles must always be greater than or equal to the number of units.
  20490.  Therefore, if you increase the number of units in UNIT.ASM, there must be at
  20491.  least as many file handles specified in CRT0DAT.ASM.
  20492.  
  20493.  
  20494.  C.3.1.3  Increasing the System Limit
  20495.  
  20496.  To have more than 20 files open at one time, you must increase the file
  20497.  limit that the operating system imposes on your process. To do this, you
  20498.  must increase both the system-wide limit and the per-process limit.
  20499.  
  20500.  
  20501.  C.3.1.4  Increasing the System-Wide Limit
  20502.  
  20503.  You can increase the system limit on the number of open files by changing
  20504.  the FILES specification in the CONFIG.SYS file. If you wanted 100 files, you
  20505.  would place the following statement in your CONFIG.SYS file (or change the
  20506.  existing FILES statement):
  20507.  
  20508.             FILES=100
  20509.  
  20510.  
  20511.  C.3.1.5  Increasing the Per-Process Limit
  20512.  
  20513.  You must also increase the number of files the operating system makes
  20514.  available for your particular process. This is done by enabling the
  20515.  appropriate commented-out code in CRT0DAT.ASM.
  20516.  
  20517.  For example, the MS-DOS version of CRT0DAT.ASM contains the following
  20518.  commented-out code:
  20519.  
  20520.             ;     mov      ah, 67H
  20521.             ;     mov bx,  _NFILE_
  20522.             ;     callos
  20523.  
  20524.  In the OS/2 version of CRT0DAT.ASM, this code appears as a call to
  20525.  DOSSETMAXFH. Under OS/2, you must also enable the 'extern DOSSETMAXFH:far'
  20526.  declaration that appears near the beginning of the file.
  20527.  
  20528.  In either case, remove the semicolons to enable this code.
  20529.  
  20530.  
  20531.  C.3.2  Using the Modified Files
  20532.  
  20533.  After modifying CRT0DAT.ASM and UNIT.ASM, assemble the files, using the
  20534.  batch files and make files in the STARTUP  directory on the distribution
  20535.  disks. To use the new object code, either explicitly link your program with
  20536.  the new CRT0DAT.OBJ and UNIT.OBJ files, or replace the CRT0DAT.OBJ and
  20537.  UNIT.OBJ objects in the appropriate memory-model version of the FORTRAN
  20538.  run-time library.
  20539.  
  20540.  
  20541.  C.3.3  Multithread and Dynamic Link Applications
  20542.  
  20543.  To increase the default number of files that may be opened when linking with
  20544.  the multithread or dynamic link libraries from 40, you need only edit the
  20545.  UNIT.ASM file. Set the _NFILE_ constant defined between "else" and "endif"
  20546.  to the desired number of files, as described above. When assembling
  20547.  UNIT.ASM, be sure to define MTHREAD on the command line in the startup
  20548.  makefile to assure the correct conditional assembly:
  20549.  
  20550.             masm -DMTHREAD unit. asm
  20551.  
  20552.  You do not need to edit CRT0DAT.ASM. Instead, you must make an explicit call
  20553.  to DOSSETMAXFH in your application. The form of the call is shown in the
  20554.  OS/2 version of CRT0DAT.ASM. You must also increase the system-wide limit,
  20555.  as explained above.
  20556.  
  20557.  See the README.DOC file in the STARTUP  subdirectory of the distribution
  20558.  disks for more information on building memory-model-specific startup
  20559.  objects.
  20560.  
  20561.  
  20562.  Appendix D  Error Messages
  20563.  
  20564.  ───────────────────────────────────────────────────────────────────────────
  20565.  
  20566.  This appendix lists error messages you may encounter as you develop a
  20567.  program, and describes actions you can take to correct the errors. The list
  20568.  below indicates where to find error messages for various components of
  20569.  Microsoft FORTRAN:
  20570.  
  20571.  Component                                  Section
  20572.  
  20573.  Command line used to invoke the            Section D.1, "Command-Line Error
  20574.  Microsoft FORTRAN Compiler                 Messages"
  20575.  
  20576.  Microsoft FORTRAN Compiler                 Section D.2, "Compiler Error
  20577.                                             Messages"
  20578.  
  20579.  Microsoft FORTRAN run-time                 Section D.3, "Run-Time Error
  20580.  libraries and other run-time               Messages"
  20581.  situations
  20582.  
  20583.  
  20584.  D.1  Command-Line Error Messages
  20585.  
  20586.  Messages that indicate errors on the command line used to invoke the
  20587.  compiler have one of the following formats:
  20588.  
  20589.       command line fatal error D1xxx: messagetext
  20590.       command line error D2xxx: messagetext
  20591.       command line warning D4xxx: messagetext
  20592.  
  20593.  If possible, the compiler continues operation, printing error and warning
  20594.  messages. In some cases, command-line errors are fatal and the compiler
  20595.  terminates processing. The following messages indicate errors on the command
  20596.  line:
  20597.  
  20598. ╓┌─────────────┌─────────────────────────────────────────────────────────────╖
  20599.  Number         Command-Line Error Message
  20600.  
  20601.  D1000          UNKNOWN COMMAND LINE FATAL ERROR Contact Microsoft
  20602.                 Technical Support
  20603.  Number         Command-Line Error Message
  20604.                Technical Support
  20605.  
  20606.                 An unknown error condition has been detected by the compiler.
  20607.  
  20608.                 Please report this condition to Microsoft Corporation using
  20609.                 the Software Problem Report form at the back of this manual.
  20610.  
  20611.  D2000          UNKNOWN COMMAND LINE ERROR Contact Microsoft Technical
  20612.                 Support
  20613.  
  20614.                 An unknown error condition has been detected by the compiler.
  20615.  
  20616.                 Please report this condition to Microsoft Corporation using
  20617.                 the Software Problem Report form at the back of this manual.
  20618.  
  20619.  D2001          too many symbols predefined with -D
  20620.  
  20621.                 The maximum allowable number of -D switches is 20.
  20622.  
  20623.  D2002          a previously defined model specification has been
  20624.  Number         Command-Line Error Message
  20625. D2002          a previously defined model specification has been
  20626.                 overridden
  20627.  
  20628.                 Two different memory models were specified.
  20629.  
  20630.  D2003          missing source file name
  20631.  
  20632.                 You must give the name of the source file to be compiled.
  20633.  
  20634.  D2008          too many option flags, 'string'
  20635.  
  20636.                 Too many letters were given with a specific option (for
  20637.                 example, with the /O option).
  20638.  
  20639.  D2011          only one floating point model allowed
  20640.  
  20641.                 Only one /FP option can be given on the command line. For
  20642.                 example, the following FL command would cause this error:
  20643.  
  20644.                 FL /FPa test1.for /FPi test2.for
  20645.  Number         Command-Line Error Message
  20646.                FL /FPa test1.for /FPi test2.for
  20647.  
  20648.  D2012          too many linker flags on command line
  20649.  
  20650.                 An attempt was made to pass more than 128 separate options
  20651.                 and object files to the linker.
  20652.  
  20653.  D2016          switch and switch are incompatible
  20654.  
  20655.                 The two switches you've chosen cannot be used together. The
  20656.                 -AM and -MD switches, for example, are incompatible.
  20657.  
  20658.  D2018          cannot open linker cmd file
  20659.  
  20660.                 The response file used to pass object-file names and options
  20661.                 to the linker could not be opened.
  20662.  
  20663.                 This error can occur if another read-only file has the same
  20664.                 name as the re-sponse file.
  20665.  
  20666.  Number         Command-Line Error Message
  20667. 
  20668.  D2019          cannot overwrite the source/object file, 'filename'
  20669.  
  20670.                 The source-file name was specified as an output-file name.
  20671.                 The compiler does not allow compiler output files to
  20672.                 overwrite the source file.
  20673.  
  20674.  D2021          invalid numerical argument 'string'
  20675.  
  20676.                 An invalid number was read (for example, /Gt -1).
  20677.  
  20678.  D2022          cannot open help file, 'fl.hlp'
  20679.  
  20680.                 The /HELP compiler option was used, but the file containing
  20681.                 the help messages (FL.HLP) was not in the current directory
  20682.                 or in any of the directories specified by the PATH
  20683.                 environment variable.
  20684.  
  20685.  D2027          could not execute 'filename'
  20686.  
  20687.  Number         Command-Line Error Message
  20688. 
  20689.                 The specified file containing a compiler pass or the linker
  20690.                 was found but for some reason could not be executed.
  20691.  
  20692.                 An illegal EXE file format is the most likely cause.
  20693.  
  20694.  D4000          UNKNOWN COMMAND LINE WARNING Contact Microsoft Technical
  20695.                 Support
  20696.  
  20697.                 An unknown error condition has been detected by the compiler.
  20698.  
  20699.                 Please report this condition to Microsoft Corporation using
  20700.                 the Software Problem Report form at the back of this manual.
  20701.  
  20702.  D4001          listing has precedence over assembly output
  20703.  
  20704.                 Two different listing options were chosen (for example, /Fl
  20705.                 and /Fa). The assembly-language listing was not created.
  20706.  
  20707.  D4002          ignoring unknown flag 'string'
  20708.  Number         Command-Line Error Message
  20709. D4002          ignoring unknown flag 'string'
  20710.  
  20711.                 One of the options given on the command line was not
  20712.                 recognized and was ignored.
  20713.  
  20714.  D4003          different processors selected for code generation
  20715.  
  20716.                 Both the /G0 option and either the /G1 or the /G2 option were
  20717.                 given; the last /G switch takes precedence.
  20718.  
  20719.  D4005          could not execute 'filename'; Please enter new file name
  20720.                 (full path) or Ctrl+C to quit
  20721.  
  20722.                 The compiler cannot find the indicated file either in the
  20723.                 current working directory or in the directories specified by
  20724.                 the PATH variable. Enter the correct path and file name to
  20725.                 continue.
  20726.  
  20727.  D4008          non-standard model──defaulting to large model libraries
  20728.  
  20729.  Number         Command-Line Error Message
  20730. 
  20731.                 A nonstandard memory model was specified with the /Astring
  20732.                 option. The library-search records in the object module are
  20733.                 set to use the large-model libraries.
  20734.  
  20735.  D4009          threshold only for far/huge data, ignored
  20736.  
  20737.                 The /Gt option cannot be used in medium-model programs, which
  20738.                 have near data pointers. It can be used only in large and
  20739.                 huge models.
  20740.  
  20741.  D4013          combined listing has precedence over object listing
  20742.  
  20743.                 When /Fc is specified along with either /Fl or /Fa, the
  20744.                 combined listing (/Fc) is created.
  20745.  
  20746.  D4014          invalid value number for 'option'. Default number is used
  20747.  
  20748.                 An out-of-range value was specified for an FL option. For
  20749.                 example, the value for the /Sp or /Sl option may have been
  20750.  Number         Command-Line Error Message
  20751.                example, the value for the /Sp or /Sl option may have been
  20752.                 too large or too small.
  20753.  
  20754.  D4018          .DEF files supported in protected mode only
  20755.  
  20756.                 You used the /Lr (real-mode libraries) option and specified a
  20757.                 .DEF file on the command line. .DEF files can only be used
  20758.                 with protected-mode programs.
  20759.  
  20760.  D4019          String too long──truncated to 40 characters
  20761.  
  20762.                 A string of more than 40 characters was specified for one of
  20763.                 the following switches: /NM, /NT, /St, or /Ss. The string is
  20764.                 truncated to 40 characters, and FL continues. This message is
  20765.                 a warning.
  20766.  
  20767.  
  20768.  D.2  Compiler Error Messages
  20769.  
  20770.  The error messages produced by the Microsoft FORTRAN Compiler fall into the
  20771.  following four categories:
  20772.  
  20773.    1. Fatal error messages
  20774.  
  20775.    2. Compilation error messages
  20776.  
  20777.    3. Recoverable error messages
  20778.  
  20779.    4. Warning messages
  20780.  
  20781.  The messages for each category are listed in Sections D.2.1-D.2.4 in
  20782.  numerical order, with a brief explanation of each error. To look up an error
  20783.  message, first determine the message category, then find the error number.
  20784.  All messages give the file name and line number where the error occurs. The
  20785.  following paragraphs discuss error-message format.
  20786.  
  20787.  
  20788.  Fatal Error Messages
  20789.  
  20790.  Fatal error messages indicate a severe problem, one that prevents the
  20791.  compiler from processing your program any further. These messages have the
  20792.  following format:
  20793.  
  20794.  filename(line) : fatal error F1xxx: messagetext
  20795.  
  20796.  After the compiler displays a fatal error message, it terminates without
  20797.  producing an object file or checking for further errors.
  20798.  
  20799.  
  20800.  Compilation Error Messages
  20801.  
  20802.  Compilation error messages identify actual program errors. These messages
  20803.  appear in the following format:
  20804.  
  20805.  filename(line) : error F2xxx: messagetext
  20806.  
  20807.  The compiler does not produce an object file for a source file that has
  20808.  compilation errors in the program. When the compiler encounters such errors,
  20809.  it attempts to recover from the error. If possible, it continues to process
  20810.  the source file and produce error messages. If errors are too numerous or
  20811.  too severe, the compiler stops processing.
  20812.  
  20813.  
  20814.  Recoverable Error Messages
  20815.  
  20816.  Recoverable error messages are informational only; they do not prevent
  20817.  compiling and linking. These messages appear in the following format:
  20818.  
  20819.  filename(line) : error F3xxx: messagetext
  20820.  
  20821.  Recoverable error messages are similar to warning error messages (see
  20822.  below), except that you cannot suppress them using the /W option. (See
  20823.  Section 7.20.2 for a description of this option.)
  20824.  
  20825.  
  20826.  Warning Messages
  20827.  
  20828.  Warning messages are informational only; they do not prevent compilation and
  20829.  linking. These messages appear in the following format:
  20830.  
  20831.  filename(line) : warning F4xxx : messagetext
  20832.  
  20833.  You can use the /W option to control the level of warnings that the compiler
  20834.  generates.
  20835.  
  20836.  
  20837.  D.2.1  Compiler Fatal Error Messages
  20838.  
  20839.  The following messages identify fatal errors. The compiler cannot recover
  20840.  from a fatal error; it stops processing after printing the error message.
  20841.  
  20842. ╓┌─────────────┌─────────────────────────────────────────────────────────────╖
  20843.  Number         Compiler Fatal Error Messages
  20844.  
  20845.  F1000          UNKNOWN FATAL ERROR Contact Microsoft Technical Support
  20846.  
  20847.                 An unknown fatal error has occurred.
  20848.  
  20849.                 Please report this condition to Microsoft Corporation using
  20850.                 the Software Problem Report form at the back of this manual.
  20851.  
  20852.  F1001          Internal Compiler Error compiler file 'filename,' line
  20853.                 'number' Contact Microsoft Technical Support
  20854.  
  20855.  Number         Compiler Fatal Error Messages
  20856. 
  20857.                 An internal compiler error has occurred.
  20858.  
  20859.                 Please report this condition to Microsoft Corporation using
  20860.                 the Software Problem Report form at the back of this manual.
  20861.  
  20862.  F1002          out of heap space
  20863.  
  20864.                 The compiler ran out of dynamic memory space. This usually
  20865.                 means that your program has many complex expressions.
  20866.  
  20867.                 Try breaking expressions into smaller subexpressions.
  20868.  
  20869.  F1003          error count exceeds number; stopping compilation
  20870.  
  20871.                 The limit for compilation errors was exceeded.
  20872.  
  20873.  F1005          string too big for buffer
  20874.  
  20875.                 A string in a compiler intermediate file overflowed a buffer.
  20876.  Number         Compiler Fatal Error Messages
  20877.                A string in a compiler intermediate file overflowed a buffer.
  20878.  
  20879.                 This internal compiler error could result from initializing a
  20880.                 very long character string with a DATA statement. Try
  20881.                 decreasing the length of the character string.
  20882.  
  20883.  F1006          write error on compiler intermediate file
  20884.  
  20885.                 A write error occurred on a compiler intermediate file.
  20886.  
  20887.                 This could be caused by a faulty disk.
  20888.  
  20889.  F1027          DGROUP data allocation exceeds 64K
  20890.  
  20891.                 Allocation of variables to the default data segment exceeded
  20892.                 64K.
  20893.  
  20894.                 For large- and huge-model programs, compile with the /Gt
  20895.                 option to move items into separate segments.
  20896.  
  20897.  Number         Compiler Fatal Error Messages
  20898. 
  20899.  F1031          limit exceeded for nesting function calls
  20900.  
  20901.                 Function calls were nested to more than 30 levels.
  20902.  
  20903.  F1032          cannot open object listing file name
  20904.  
  20905.                 The compiler could not open the given object-listing file for
  20906.                 writing.
  20907.  
  20908.                 The file or disk may be write-protected, or the disk is full.
  20909.  
  20910.  F1033          cannot open assembly language output file name
  20911.  
  20912.                 The compiler could not open the given assembly-listing file
  20913.                 for writing.
  20914.  
  20915.                 The file or disk may be write-protected, or the disk is full.
  20916.  
  20917.  F1035          expression too complex, please simplify
  20918.  Number         Compiler Fatal Error Messages
  20919. F1035          expression too complex, please simplify
  20920.  
  20921.                 The compiler could not generate code for a complicated
  20922.                 expression.
  20923.  
  20924.                 Try breaking the expression into simpler subexpressions and
  20925.                 recompiling. Please report this error to Microsoft
  20926.                 Corporation using the Software Problem Report form at the
  20927.                 back of this manual.
  20928.  
  20929.  F1036          cannot open source listing file name
  20930.  
  20931.                 The compiler could not open the given source-listing file for
  20932.                 writing.
  20933.  
  20934.                 The file or disk may be write-protected, or the disk is full.
  20935.  
  20936.  F1037          cannot open object file name
  20937.  
  20938.                 The compiler could not open the given object file for
  20939.  Number         Compiler Fatal Error Messages
  20940.                The compiler could not open the given object file for
  20941.                 writing.
  20942.  
  20943.                 The file or disk may be write-protected, or the disk is full.
  20944.  
  20945.  F1039          unrecoverable heap overflow in Pass 3
  20946.  
  20947.                 The compiler ran out of dynamic memory space.
  20948.  
  20949.                 A subroutine may have too many symbols; simplify the
  20950.                 subroutine and make it smaller.
  20951.  
  20952.  F1041          cannot open compiler intermediate file - no more files
  20953.  
  20954.                 The compiler was unable to open an intermediate file because
  20955.                 too many files were already open.
  20956.  
  20957.  F1043          cannot open compiler intermediate file
  20958.  
  20959.                 The compiler was unable to open an intermediate file. This
  20960.  Number         Compiler Fatal Error Messages
  20961.                The compiler was unable to open an intermediate file. This
  20962.                 could occur if the environment variable TMP was set to a
  20963.                 nonexistent directory.
  20964.  
  20965.                 Try setting the environment variable TMP to an existing
  20966.                 directory, or not setting TMP at all.
  20967.  
  20968.  F1044          out of disk space for compiler intermediate file
  20969.  
  20970.                 The compiler ran out of disk space while writing to an
  20971.                 intermediate file.
  20972.  
  20973.                 Try making more disk space available and recompiling.
  20974.  
  20975.  F1045          floating-point overflow
  20976.  
  20977.                 A compile-time evaluation of a floating or complex expression
  20978.                 resulted in overflow, as shown in the following example:
  20979.  
  20980.                       real a,b,c
  20981.  Number         Compiler Fatal Error Messages
  20982.                      real a,b,c
  20983.                          a=10e30
  20984.                          b=10e30
  20985.                          c=a*b
  20986.  
  20987.  F1050          name : code segment too large
  20988.  
  20989.                 The amount of object code in the named segment was larger
  20990.                 than 64K.
  20991.  
  20992.  F1051          program too complex
  20993.  
  20994.                 Your program caused the compiler to overflow one of its
  20995.                 internal tables. For example, this error can occur if your
  20996.                 program has too many labels.
  20997.  
  20998.                 The /4Yb compiler option and the $DEBUG metacommand cause a
  20999.                 large number of labels to be generated. If you encounter this
  21000.                 message, try recompiling with the /4Nb option or changing the
  21001.                 $DEBUG metacommand to $NODEBUG in your source file and
  21002.  Number         Compiler Fatal Error Messages
  21003.                $DEBUG metacommand to $NODEBUG in your source file and
  21004.                 recompiling; or, if your file contains more than one
  21005.                 procedure, try compiling the procedures in separate files.
  21006.  
  21007.  F1900          maximum memory-allocation size exceeded
  21008.  
  21009.                 The program tried to allocate more than approximately 1900
  21010.                 bytes at one time. This is the upper limit for the size of
  21011.                 character constants. (See Appendix C, "Compiler and Linker
  21012.                 Limits," for more information.)
  21013.  
  21014.  F1901          program too large for memory
  21015.  
  21016.                 The combination of heap space and stack space overflowed the
  21017.                 memory configurations of the machine.
  21018.  
  21019.  F1902          statement stack underflow
  21020.  
  21021.                 This is an internal error. The compiler could not interpret
  21022.                 the nesting of statements.
  21023.  Number         Compiler Fatal Error Messages
  21024.                the nesting of statements.
  21025.  
  21026.                 Please report this condition to Microsoft Corporation using
  21027.                 the Software Problem Report form at the back of this manual.
  21028.  
  21029.  F1903          statement-nesting limit exceeded
  21030.  
  21031.                 Structured statements were nested too deeply.
  21032.  
  21033.                 The maximum legal depth is about 40 statements and varies
  21034.                 slightly depending on the type of statement.
  21035.  
  21036.  F1904          illegal command-line option
  21037.  
  21038.                 This error should never occur.
  21039.  
  21040.                 If it does, please report it to Microsoft Corporation using
  21041.                 the Software Problem Report form at the back of this manual.
  21042.  
  21043.  F1907          too many symbols
  21044.  Number         Compiler Fatal Error Messages
  21045. F1907          too many symbols
  21046.  
  21047.                 The program overflowed the internal symbol counter.
  21048.  
  21049.                 There is no set upper limit on the number of symbols allowed
  21050.                 in a source file. However, in any case, no more than 20,000
  21051.                 names are allowed in one module.
  21052.  
  21053.  F1908          ASSIGN : too many format labels
  21054.  
  21055.                 The program overflowed the assigned format-label table.
  21056.  
  21057.                 This error probably occurred because an INTEGER*1 variable,
  21058.                 which has a limit of 127 labels, was specified. To avoid this
  21059.                 error, use an INTEGER*2 variable instead. (See Appendix C,
  21060.                 "Compiler and Linker Limits," for more information.)
  21061.  
  21062.  F1909          filename : include file nested too deeply
  21063.  
  21064.                 More than 10 include files were active at the same time. (See
  21065.  Number         Compiler Fatal Error Messages
  21066.                More than 10 include files were active at the same time. (See
  21067.                 Appendix C, "Compiler and Linker Limits," for more
  21068.                 information.)
  21069.  
  21070.  F1910          name : unrecognized option
  21071.  
  21072.                 This is an internal error; the compiler driver FL caught an
  21073.                 illegal option.
  21074.  
  21075.  F1912          filename : cannot open file
  21076.  
  21077.                 The specified file could not be opened.
  21078.  
  21079.  F1913          name : name too long
  21080.  
  21081.                 The specified internal file name was more than 14 characters
  21082.                 long. The compiler creates internal files in the directory
  21083.                 specified by the TMP environment variable. If the combined
  21084.                 length of the TMP environment variable and the unique
  21085.                 internal name exceeds the name-buffer length, this message
  21086.  Number         Compiler Fatal Error Messages
  21087.                internal name exceeds the name-buffer length, this message
  21088.                 appears (see Appendix C, "Compiler and Linker Limits," for
  21089.                 more information).
  21090.  
  21091.                 Create a smaller TMP environment variable. If no TMP variable
  21092.                 is specified, this error should never occur.
  21093.  
  21094.  F1914          cannot open internal files
  21095.  
  21096.                 Internal files could not be created.
  21097.  
  21098.  F1917          unknown primitive type
  21099.  
  21100.                 An internal error has occurred.
  21101.  
  21102.                 Please report this error to Microsoft Corporation using the
  21103.                 Software Problem Report form at the back of this manual.
  21104.  
  21105.  F1918          missing symbol reference
  21106.  
  21107.  Number         Compiler Fatal Error Messages
  21108. 
  21109.                 An internal error has occurred.
  21110.  
  21111.                 Please report this error to Microsoft Corporation using the
  21112.                 Software Problem Report form at the back of this manual.
  21113.  
  21114.  F1919          unknown constant type
  21115.  
  21116.                 An internal error has occurred.
  21117.  
  21118.                 Please report this error to Microsoft Corporation using the
  21119.                 Software Problem Report form at the back of this manual.
  21120.  
  21121.  F1920          illegal -A option
  21122.  
  21123.                 An invalid memory-model option was given for the FL command
  21124.                 line.
  21125.  
  21126.  F1921          too many ENTRY statements
  21127.  
  21128.  Number         Compiler Fatal Error Messages
  21129. 
  21130.                 More than 32,000 ENTRY statements were used in this
  21131.                 subprogram. (This error is not likely to occur.)
  21132.  
  21133.  F1922          integer string too long
  21134.  
  21135.                 An integer-constant string of digits overflowed an internal
  21136.                 buffer. (This error should never occur in normal use.)
  21137.  
  21138.                 Shorten the integer strings to legal value.
  21139.  
  21140.  F1923          CHARACTER constant too long
  21141.  
  21142.                 A constant of type CHARACTER can have a maximum of
  21143.                 approximately 1,900 characters. (See Appendix C, "Compiler
  21144.                 and Linker Limits," for more information.)
  21145.  
  21146.  F1924          FORMAT string too long
  21147.  
  21148.                 A FORMAT statement can have a maximum of approximately 1,900
  21149.  Number         Compiler Fatal Error Messages
  21150.                A FORMAT statement can have a maximum of approximately 1,900
  21151.                 characters. (See Appendix C, "Compiler and Linker Limits,"
  21152.                 for more information.)
  21153.  
  21154.  F1925          out of disk space for compiler internal file
  21155.  
  21156.                 The disk became full while the compiler was writing to an
  21157.                 internal file.
  21158.  
  21159.  F1926          write error on compiler internal file
  21160.  
  21161.                 An error occurred while the compiler was writing to an
  21162.                 internal file.
  21163.  
  21164.                 Please report this error to Microsoft Corporation using the
  21165.                 Software Problem Report form at the back of this manual.
  21166.  
  21167.  
  21168.  D.2.2  Compilation Error Messages
  21169.  
  21170.  The messages listed below indicate that your program has errors. When the
  21171.  compiler encounters any of the errors listed in this section, it continues
  21172.  compiling the program (if possible) and outputs additional error messages.
  21173.  However, no object file is produced.
  21174.  
  21175.  
  21176. ╓┌─────────────┌─────────────────────────────────────────────────────────────╖
  21177.  Number         Compiler Compilation Error Message
  21178.  
  21179.  F2000          UNKNOWN ERROR Contact Microsoft Technical Support
  21180.  
  21181.                 An unknown compilation error has occurred.
  21182.  
  21183.                 Please report this condition to Microsoft Corporation using
  21184.                 the Software Problem Report form at the back of this manual.
  21185.  
  21186.  F2001          INTEGER value overflow
  21187.  
  21188.                 An INTEGER constant was too large to be of the specified
  21189.                 type.
  21190.  
  21191.  Number         Compiler Compilation Error Message
  21192. 
  21193.  F2002          Hollerith not allowed
  21194.  
  21195.                 Hollerith constants are not allowed when the /4Ys compiler
  21196.                 option is used (or the $STRICT metacommand is in effect).
  21197.  
  21198.  F2003          illegal base value
  21199.  
  21200.                 The specified base value was not between 2 and 36, inclusive.
  21201.  
  21202.  F2004          INTEGER constant must follow #
  21203.  
  21204.                 No alphanumerics within the legal range for the base
  21205.                 immediately (allowing for white space) followed the number
  21206.                 sign (#).
  21207.  
  21208.  F2005          illegal REAL constant
  21209.  
  21210.                 A floating-point constant was in an illegal form.
  21211.  
  21212.  Number         Compiler Compilation Error Message
  21213. 
  21214.  F2006          missing ] following attribute string
  21215.  
  21216.                 The closing bracket for an attribute list was missing.
  21217.  
  21218.  F2007          opening quote missing
  21219.  
  21220.                 The leading quote in a string value of an ALIAS attribute was
  21221.                 missing.
  21222.  
  21223.  F2008          unrecognized attribute
  21224.  
  21225.                 An item used as an attribute was not a legal FORTRAN
  21226.                 attribute.
  21227.  
  21228.  F2009          character : illegal separator
  21229.  
  21230.                 An attribute list did not end with a closing right bracket
  21231.                 (]) and was not continued with a comma (,), or an illegal
  21232.                 character was used in the list for the $NOTLARGE metacommand.
  21233.  Number         Compiler Compilation Error Message
  21234.                character was used in the list for the $NOTLARGE metacommand.
  21235.  
  21236.  F2010          name : name too long; truncated
  21237.  
  21238.                 The specified name was more than 31 characters long. (The
  21239.                 limit on the length of names may be less in some
  21240.                 environments; see Appendix C, "Compiler and Linker Limits,"
  21241.                 for more information.)
  21242.  
  21243.  F2011          octal value too big for byte
  21244.  
  21245.                 An octal value was not within the range 8#0 to 8#377.
  21246.  
  21247.  F2012          name : already specified in $[NOT]LARGE
  21248.  
  21249.                 The specified item appeared in the lists for both the $LARGE
  21250.                 and the $NOTLARGE metacommands. (The message shows the
  21251.                 metacommand that appears first in the source program.)
  21252.  
  21253.  F2013          too many continuation lines
  21254.  Number         Compiler Compilation Error Message
  21255. F2013          too many continuation lines
  21256.  
  21257.                 Either the /4Ys compiler option was used in compiling or the
  21258.                 $STRICT metacommand was in effect, and more than 19
  21259.                 continuation lines were used.
  21260.  
  21261.  F2015          $DEBUG:'<debug list>' : string expected
  21262.  
  21263.                 A quoted string was expected after a $DEBUG metacommand.
  21264.  
  21265.  F2016          $IF: no matching $ENDIF
  21266.  
  21267.                 No matching ENDIF was found when an $IF was used.
  21268.  
  21269.  F2017          $INCLUDE:'<filename>' : string expected
  21270.  
  21271.                 A quoted string specifying a file name was expected after an
  21272.                 $INCLUDE metacommand.
  21273.  
  21274.  F2018          $LINESIZE  ($PACK or $PAGESIZE) : integer constant out of
  21275.  Number         Compiler Compilation Error Message
  21276. F2018          $LINESIZE  ($PACK or $PAGESIZE) : integer constant out of
  21277.                 range
  21278.  
  21279.                 An integer constant less than 80 or greater than 132 was
  21280.                 specified in a $LINESIZE metacommand, or a lower bound of
  21281.                 less than 15 was specified in the $PAGESIZE metacommand. An
  21282.                 integer constant other than 1, 2, or 4, was specified for the
  21283.                 $PACK metacommand.
  21284.  
  21285.  F2019          $LINESIZE (or $PAGESIZE) : integer constant expected
  21286.  
  21287.                 An integer constant was expected after a $LINESIZE or
  21288.                 $PAGESIZE metacommand.
  21289.  
  21290.  F2020          $[NOT]LARGE already set
  21291.  
  21292.                 The $LARGE or $NOTLARGE metacommand appeared more than once
  21293.                 in a procedure. (The metacommand appearing more than once is
  21294.                 indicated in the message.)
  21295.  
  21296.  Number         Compiler Compilation Error Message
  21297. 
  21298.  F2021          $[NOT]LARGE illegal in executable statements
  21299.  
  21300.                 The $LARGE or $NOTLARGE metacommand appeared between
  21301.                 subprograms or within the specification section of a
  21302.                 subprogram. (The metacommand that appeared between
  21303.                 subprograms or within the specification section is indicated
  21304.                 in the message.)
  21305.  
  21306.  F2022          $MESSAGE:'<message>' : string expected
  21307.  
  21308.                 A quoted string containing a message was expected after a
  21309.                 $MESSAGE metacommand.
  21310.  
  21311.  F2023          divide by 0
  21312.  
  21313.                 The second operand in a division operation (/) evaluated to
  21314.                 0, giving undefined results.
  21315.  
  21316.  F2024          mod by 0
  21317.  Number         Compiler Compilation Error Message
  21318. F2024          mod by 0
  21319.  
  21320.                 The second operand in a MOD function evaluated to 0, giving
  21321.                 undefined results.
  21322.  
  21323.  F2025          no matching $IF
  21324.  
  21325.                 A $ELSE, $ELSEIF, or $ENDIF was seen without a previous $IF.
  21326.  
  21327.  F2026          metacommands are nonstandard
  21328.  
  21329.                 The metacommands used are nonstandard.
  21330.  
  21331.  F2027          $STORAGE:<number> : 2 or 4 expected
  21332.  
  21333.                 A number other than 2 or 4 followed the $STORAGE:
  21334.                 metacommand.
  21335.  
  21336.  F2028          $SUBTITLE:'<subtitle>' : string expected
  21337.  
  21338.  Number         Compiler Compilation Error Message
  21339. 
  21340.                 A quoted string was expected following a $SUBTITLE:
  21341.                 metacommand.
  21342.  
  21343.  F2029          $TITLE:'<title>' : string expected
  21344.  
  21345.                 A quoted string was expected following a $TITLE: metacommand.
  21346.  
  21347.  F2030          unrecognized metacommand
  21348.  
  21349.                 An unrecognized string followed the dollar sign ($) in the
  21350.                 source file.
  21351.  
  21352.  F2031          closing quote missing
  21353.  
  21354.                 A quoted string did not end with a single quote (').
  21355.  
  21356.  F2032          zero-length CHARACTER constant
  21357.  
  21358.                 An illegal CHARACTER constant of length 0 was used in the
  21359.  Number         Compiler Compilation Error Message
  21360.                An illegal CHARACTER constant of length 0 was used in the
  21361.                 program.
  21362.  
  21363.  F2033          Hollerith constant exceeds 1313 characters
  21364.  
  21365.                 A Hollerith constant exceeded the maximum legal length.
  21366.  
  21367.  F2034          zero-length Hollerith constant
  21368.  
  21369.                 An illegal Hollerith constant of length 0 was used in the
  21370.                 program.
  21371.  
  21372.  F2035          Hollerith constant : text length disagrees with given
  21373.                 length
  21374.  
  21375.                 A Hollerith constant was smaller than the size given in the
  21376.                 length field of the Hollerith constant.
  21377.  
  21378.  F2036          character : non-FORTRAN character
  21379.  
  21380.  Number         Compiler Compilation Error Message
  21381. 
  21382.                 A special character in the source file was not recognized.
  21383.  
  21384.  F2037          illegal label field
  21385.  
  21386.                 A nondigit value was used in a label field.
  21387.  
  21388.  F2038          zero-value label field
  21389.  
  21390.                 A label with the value 0 was used in the program.
  21391.  
  21392.                 Labels must have values between 1 and 99,999, inclusive.
  21393.  
  21394.  F2039          free-form label too long
  21395.  
  21396.                 A label was more than five digits long.
  21397.  
  21398.  F2040          label on continuation line
  21399.  
  21400.                 A label was declared on a continuation line.
  21401.  Number         Compiler Compilation Error Message
  21402.                A label was declared on a continuation line.
  21403.  
  21404.  F2041          first statement line must have ' ' or '0' in column 6
  21405.  
  21406.                 A continuation character was used on the first statement line
  21407.                 in the program.
  21408.  
  21409.  F2042          label on blank line
  21410.  
  21411.                 A label was used on a line with no statements.
  21412.  
  21413.  F2043          alternate bases illegal
  21414.  
  21415.                 Alternate integer bases are not allowed if the /4Ys compiler
  21416.                 option is used (or the $STRICT metacommand is in effect).
  21417.  
  21418.  F2044          " nonstandard character string delimiter
  21419.  
  21420.                 The quotation mark is a nonstandard Microsoft extension
  21421.                 character-string delimiter.
  21422.  Number         Compiler Compilation Error Message
  21423.                character-string delimiter.
  21424.  
  21425.  F2050          $DEFINE : name already defined
  21426.  
  21427.                 A name may only be given a $DEFINE value once. To re-define,
  21428.                 $UNDEF the variable first.
  21429.  
  21430.  F2051          invalid expression in metacommand
  21431.  
  21432.                 The compiler could not interpret an expression in an $IF,
  21433.                 $ELSE, $ELSEIF, $ENDIF, or $DEFINE metacommand.
  21434.  
  21435.  F2052          unmatched parenthesis
  21436.  
  21437.                 A closing parenthesis was found without an opening
  21438.                 parenthesis preceding it.
  21439.  
  21440.  F2053          Character : unrecognized character
  21441.  
  21442.                 The compiler encountered an operator it did not recognize or
  21443.  Number         Compiler Compilation Error Message
  21444.                The compiler encountered an operator it did not recognize or
  21445.                 a name beginning with a nonalphabetic character.
  21446.  
  21447.  F2054          name : not defined
  21448.  
  21449.                 A name was referenced which had not been $DEFINEd.
  21450.  
  21451.  F2055          logical operator expected
  21452.  
  21453.                 An .AND. or .OR. operator was expected: the other operators
  21454.                 cannot appear consecutively.
  21455.  
  21456.  F2056          character: unexpected characters at end of expression
  21457.  
  21458.                 There were additional characters on the line that could not
  21459.                 be part of the expression.
  21460.  
  21461.  F2059          operand expected
  21462.  
  21463.                 The operator requires an operand.
  21464.  Number         Compiler Compilation Error Message
  21465.                The operator requires an operand.
  21466.  
  21467.  F2060          invalid integer constant
  21468.  
  21469.                 The constant is out of range for integer type or not in
  21470.                 correct form for a constant.
  21471.  
  21472.  F2062          relational operator expected
  21473.  
  21474.                 The operands supplied must have a relational operator.
  21475.  
  21476.  F2064          name: defined with no value
  21477.  
  21478.                 If a name was $DEFINEd with no value, it can only be used as
  21479.                 an argument to DEFINE( ).
  21480.  
  21481.  F2070          filename : cannot open include file
  21482.  
  21483.                 The specified include file could not be opened because it was
  21484.                 not found in the source directory or in other directories
  21485.  Number         Compiler Compilation Error Message
  21486.                not found in the source directory or in other directories
  21487.                 specified by the include search paths given on the command
  21488.                 line.
  21489.  
  21490.  F2071          INCLUDE : quoted string missing
  21491.  
  21492.                 The argument for the INCLUDE statement or $INCLUDE
  21493.                 metacommand was not of CHARACTER type.
  21494.  
  21495.  F2072          INCLUDE : argument must be character constant
  21496.  
  21497.                 The argument must be enclosed in apostrophes or quotes.
  21498.  
  21499.  F2101          DO : too many expressions
  21500.  
  21501.                 A DO statement had more than three items following the equal
  21502.                 sign (=).
  21503.  
  21504.  F2102          I/O implied-DO list : list empty
  21505.  
  21506.  Number         Compiler Compilation Error Message
  21507. 
  21508.                 No items appeared in an I/O implied-DO list.
  21509.  
  21510.  F2103          I/O implied-DO list : too many expressions
  21511.  
  21512.                 More than three expressions appeared after the equal sign (=)
  21513.                 in an I/O implied-DO list.
  21514.  
  21515.  F2104          I/O implied-DO list : illegal assignment
  21516.  
  21517.                 Only one assignment is legal in an I/O implied-DO list.
  21518.  
  21519.  F2105          I/O implied-DO list : too few expressions
  21520.  
  21521.                 Fewer than two expressions followed the equal sign (=) in an
  21522.                 I/O implied-DO list.
  21523.  
  21524.  F2106          I/O implied-DO list : assignment missing
  21525.  
  21526.                 No assignment appeared in an I/O implied-DO list, or more
  21527.  Number         Compiler Compilation Error Message
  21528.                No assignment appeared in an I/O implied-DO list, or more
  21529.                 than two expressions in the list were embedded in
  21530.                 parentheses.
  21531.  
  21532.  F2107          assignments in COMPLEX constant illegal
  21533.  
  21534.                 An illegal embedded assignment appeared in a constant of type
  21535.                 COMPLEX.
  21536.  
  21537.  F2108          illegal assignment in parenthesized expression
  21538.  
  21539.                 An illegal embedded assignment appeared in an expression
  21540.                 enclosed in parentheses.
  21541.  
  21542.  F2111          numeric constant expected
  21543.  
  21544.                 A symbolic or numeric constant did not appear as part of a
  21545.                 complex constant.
  21546.  
  21547.  F2112          name : not symbolic constant
  21548.  Number         Compiler Compilation Error Message
  21549. F2112          name : not symbolic constant
  21550.  
  21551.                 The specified name was not a symbolic constant.
  21552.  
  21553.  F2113          component of COMPLEX number not INTEGER or REAL
  21554.  
  21555.                 A component of a COMPLEX number was not of type INTEGER or
  21556.                 REAL.
  21557.  
  21558.  F2114          parser stack overflow, statement too complex
  21559.  
  21560.                 The statement being parsed was too large for the parser.
  21561.  
  21562.  F2115          syntax error
  21563.  
  21564.                 The source file contained a syntax error at the specified
  21565.                 line.
  21566.  
  21567.  F2124          CODE GENERATION ERROR Contact Microsoft Technical Support
  21568.  
  21569.  Number         Compiler Compilation Error Message
  21570. 
  21571.                 The compiler could not generate code for an expression.
  21572.                 Usually this error occurs with a complicated expression.
  21573.  
  21574.                 Try rearranging the expression. Please report this error to
  21575.                 Microsoft Corporation using the Software Problem Report form
  21576.                 at the back of this manual.
  21577.  
  21578.  F2125          name : allocation exceeds 64K
  21579.  
  21580.                 The specified item exceeded the limit of 64K.
  21581.  
  21582.                 Huge arrays are the only items that are allowed to be larger
  21583.                 than 64K.
  21584.  
  21585.  F2126          name : automatic allocation exceeds 32K
  21586.  
  21587.                 The subroutine or function name has an exceedingly large
  21588.                 amount of compiler-generated temporary variables that take up
  21589.                 more than 32,767 bytes.
  21590.  Number         Compiler Compilation Error Message
  21591.                more than 32,767 bytes.
  21592.  
  21593.                 Try splitting the subroutine or function into smaller pieces.
  21594.  
  21595.  F2127          parameter allocation exceeds 32K
  21596.  
  21597.                 The storage space required for the arguments to a function
  21598.                 exceeded the limit of 32K.
  21599.  
  21600.  F2128          name : huge array cannot be aligned to segment boundary
  21601.  
  21602.                 The specified array violated one of the restrictions imposed
  21603.                 on huge arrays.
  21604.  
  21605.  F2200          subprogram : formal argument name : CHARACTER*(*) cannot
  21606.                 pass by value
  21607.  
  21608.                 Arguments that are passed by value must have a length that
  21609.                 can be determined at run time. CHARACTER*(*) lengths are
  21610.                 determined at run time.
  21611.  Number         Compiler Compilation Error Message
  21612.                determined at run time.
  21613.  
  21614.  F2201          subprogram : type redefined
  21615.  
  21616.                 The type given in the specified ENTRY, FUNCTION, or
  21617.                 SUBROUTINE statement was redefined. It was defined with a
  21618.                 different type in an earlier subprogram.
  21619.  
  21620.  F2202          subprogram : defined with different number of arguments
  21621.  
  21622.                 The specified ENTRY, FUNCTION, or SUBROUTINE statement was
  21623.                 defined or used earlier in the program with a different
  21624.                 number of arguments.
  21625.  
  21626.  F2203          subprogram : formal argument name : symbol-class mismatch
  21627.  
  21628.                 The specified formal argument was defined previously with a
  21629.                 different class.
  21630.  
  21631.                 An EXTERNAL statement that passes a function to a variable,
  21632.  Number         Compiler Compilation Error Message
  21633.                An EXTERNAL statement that passes a function to a variable,
  21634.                 or a similar symbol-class mismatch, can cause this error.
  21635.  
  21636.  F2206          ENTRY seen before FUNCTION or SUBROUTINE
  21637.  
  21638.                 An ENTRY statement appeared before any FUNCTION or SUBROUTINE
  21639.                 statements in the program.
  21640.  
  21641.                 An ENTRY statement can only appear in functions and
  21642.                 subroutines.
  21643.  
  21644.  F2207          ENTRY not in function or subroutine
  21645.  
  21646.                 An ENTRY statement appeared in a subprogram that was not a
  21647.                 function or subroutine. It may have appeared in the main
  21648.                 program.
  21649.  
  21650.  F2208          name : formal argument used as ENTRY
  21651.  
  21652.                 The specified name was used as a formal argument in an
  21653.  Number         Compiler Compilation Error Message
  21654.                The specified name was used as a formal argument in an
  21655.                 earlier ENTRY statement or in the subprogram header in the
  21656.                 current subprogram.
  21657.  
  21658.  F2209          name : illegal as formal argument
  21659.  
  21660.                 The symbol class of the formal argument was illegal.
  21661.  
  21662.                 A formal argument can only be a variable, array, subroutine,
  21663.                 function, or entry point.
  21664.  
  21665.  F2210          name : formal argument redefined
  21666.  
  21667.                 The specified formal argument appeared in the argument list
  21668.                 more than once.
  21669.  
  21670.  F2211          alternate RETURN only legal within subroutine
  21671.  
  21672.                 An alternate RETURN statement was specified outside of a
  21673.                 subroutine.
  21674.  Number         Compiler Compilation Error Message
  21675.                subroutine.
  21676.  
  21677.  F2212          subprogram : subprogram used or declared before INTERFACE
  21678.  
  21679.                 The specified subprogram was used or declared before the
  21680.                 corresponding INTERFACE statement appeared in the program.
  21681.  
  21682.  F2213          subprogram : already defined
  21683.  
  21684.                 The specified subprogram was already defined in the current
  21685.                 module.
  21686.  
  21687.  F2214          subprogram : already used or declared with different symbol
  21688.                 class
  21689.  
  21690.                 The specified subprogram was used earlier in the program with
  21691.                 a different class. For example, a subprogram that was used
  21692.                 earlier in the program as a function and then declared as a
  21693.                 subroutine would cause this error.
  21694.  
  21695.  Number         Compiler Compilation Error Message
  21696. 
  21697.  F2215          subprogram : ENTRY : CHARACTER lengths differ
  21698.  
  21699.                 In a subprogram, if an entry name of type CHARACTER is used,
  21700.                 then all of the entry names in that subprogram must be of
  21701.                 type CHARACTER. If one entry name is of type CHARACTER*(*),
  21702.                 then all must be of that type.
  21703.  
  21704.  F2216          subprogram : CHARACTER and non-CHARACTER types mixed in
  21705.                 ENTRY statements
  21706.  
  21707.                 CHARACTER and non-CHARACTER types were mixed in a subprogram.
  21708.  
  21709.  F2217          too many PROGRAM statements
  21710.  
  21711.                 More than one PROGRAM statement appeared in the source file.
  21712.  
  21713.                 Only one PROGRAM statement is allowed per program.
  21714.  
  21715.  F2218          name : used or declared before ENTRY statement
  21716.  Number         Compiler Compilation Error Message
  21717. F2218          name : used or declared before ENTRY statement
  21718.  
  21719.                 The name in an ENTRY statement was declared or used
  21720.                 previously in the same subprogram. This caused a symbol-class
  21721.                 conflict that prevented the name from being used in an ENTRY
  21722.                 statement.
  21723.  
  21724.  F2219          subprogram : formal argument name : VALUE/REFERENCE
  21725.                 mismatch
  21726.  
  21727.                 An INTERFACE statement or prior call specified a different
  21728.                 way of passing this argument than that specified in the
  21729.                 current declaration.
  21730.  
  21731.  F2220          subprogram : length redefined
  21732.  
  21733.                 The length of a function when called was different than when
  21734.                 it was defined.
  21735.  
  21736.  F2221          subprogram : formal argument name : NEAR/FAR/HUGE mismatch
  21737.  Number         Compiler Compilation Error Message
  21738. F2221          subprogram : formal argument name : NEAR/FAR/HUGE mismatch
  21739.  
  21740.                 The NEAR, FAR, or HUGE attributes were defined differently in
  21741.                 the INTERFACE statement than in the subprogram definition or
  21742.                 its arguments.
  21743.  
  21744.  F2222          name : formal argument previously initialized
  21745.  
  21746.                 The formal argument to an ENTRY statement appeared previously
  21747.                 in a DATA statement within the same subprogram.
  21748.  
  21749.  F2223          subprogram : formal argument name : subprogram passed by
  21750.                 VALUE
  21751.  
  21752.                 The formal argument had the VALUE attribute. Subprograms
  21753.                 cannot be passed to items with the VALUE attribute.
  21754.  
  21755.  F2224          name : language attribute mismatch
  21756.  
  21757.                 Language attributes were declared differently in the
  21758.  Number         Compiler Compilation Error Message
  21759.                Language attributes were declared differently in the
  21760.                 subprogram declaration than in the INTERFACE statement.
  21761.  
  21762.  F2225          name : NEAR/FAR attribute mismatch
  21763.  
  21764.                 The NEAR or FAR attribute was used differently in the
  21765.                 INTERFACE statement than in the subprogram declaration.
  21766.  
  21767.  F2226          name : VARYING attribute mismatch
  21768.  
  21769.                 The VARYING attribute was not used in both the INTERFACE
  21770.                 statement and the subprogram declaration.
  21771.  
  21772.  F2227          subprogram : formal argument name : previously passed by
  21773.                 value, now by reference
  21774.  
  21775.                 A formal argument previously passed by value was passed by
  21776.                 reference.
  21777.  
  21778.                 The VALUE attribute should be specified for the formal
  21779.  Number         Compiler Compilation Error Message
  21780.                The VALUE attribute should be specified for the formal
  21781.                 argument.
  21782.  
  21783.  F2228          subprogram : formal argument name : previously passed by
  21784.                 reference, now by value
  21785.  
  21786.                 A formal argument previously passed by reference was passed
  21787.                 by value.
  21788.  
  21789.                 The REFERENCE attribute should be specified for the formal
  21790.                 argument.
  21791.  
  21792.  F2229          subprogram : formal argument name : previously passed with
  21793.                 NEAR, now with FAR or HUGE
  21794.  
  21795.                 An address-length mismatch occurred. This is because an
  21796.                 INTERFACE statement specifying the FAR or HUGE attribute for
  21797.                 the formal argument was not given.
  21798.  
  21799.  F2230          subprogram : formal argument name : previously passed with
  21800.  Number         Compiler Compilation Error Message
  21801. F2230          subprogram : formal argument name : previously passed with
  21802.                 FAR or HUGE, now with NEAR
  21803.  
  21804.                 An INTERFACE statement specifying the NEAR attribute for the
  21805.                 formal argument was not given.
  21806.  
  21807.  F2231          name : PROGRAM : name redefined
  21808.  
  21809.                 The program name already exists as a global entity.
  21810.  
  21811.  F2232          subprogram : formal argument name : Hollerith passed to
  21812.                 CHARACTER formal argument.
  21813.  
  21814.                 Hollerith constants may only be passed to formal arguments of
  21815.                 type integer, logical, or real.
  21816.  
  21817.  F2233          name : previously called near
  21818.  
  21819.                 A function that was previously declared or referenced with
  21820.                 near addressing was used with a far call.
  21821.  Number         Compiler Compilation Error Message
  21822.                near addressing was used with a far call.
  21823.  
  21824.  F2234          name : previously called far
  21825.  
  21826.                 A function that was previously declared or referenced with
  21827.                 far addressing was used with a near call.
  21828.  
  21829.  F2299          name : EQUIVALENCE: structure components illegal
  21830.  
  21831.                 A structure variable may appear in an EQUIVALENCE statement,
  21832.                 but not in an individual field of a structure.
  21833.  
  21834.  F2301          name : EQUIVALENCE (or COMMON): formal argument illegal
  21835.  
  21836.                 An item other than a local variable or array, or a variable
  21837.                 or an array in a common block, appeared in an EQUIVALENCE or
  21838.                 COMMON statement.
  21839.  
  21840.  F2302          name : EQUIVALENCE : not array
  21841.  
  21842.  Number         Compiler Compilation Error Message
  21843. 
  21844.                 In an EQUIVALENCE  statement, an item that was not an array
  21845.                 had an argument or subscript list attached to it.
  21846.  
  21847.  F2303          name : EQUIVALENCE : array subscripts missing
  21848.  
  21849.                 A construct such as  x( ) was used to declare the specified
  21850.                 array.
  21851.  
  21852.                 If no bounds are required, delete the parentheses.
  21853.  
  21854.  F2304          name : EQUIVALENCE : nonconstant offset illegal
  21855.  
  21856.                 A nonconstant offset was used for an array in an EQUIVALENCE
  21857.                 statement.
  21858.  
  21859.  F2305          name : nonconstant lower substring expression illegal
  21860.  
  21861.                 The lower bound of a substring expression was not a constant
  21862.                 in an EQUIVALENCE statement.
  21863.  Number         Compiler Compilation Error Message
  21864.                in an EQUIVALENCE statement.
  21865.  
  21866.  F2306          name : EQUIVALENCE : enclosing class too big
  21867.  
  21868.                 Arithmetic overflow occurred while the offset of an array
  21869.                 expression in an EQUIVALENCE statement was being calculated.
  21870.  
  21871.  F2307          name : stmt : allocatable array illegal
  21872.  
  21873.                 Allocatable arrays may not appear in COMMON or EQUIVALENCE
  21874.                 lists.
  21875.  
  21876.  F2308          name : COMMON (or NAMELIST): length specification illegal
  21877.  
  21878.                 It is illegal to specify the length of a type in a COMMON
  21879.                 statement.
  21880.  
  21881.                 Use a separate type statement to declare the length.
  21882.  
  21883.  F2309          name : COMMON (or NAMELIST): attributes on items illegal
  21884.  Number         Compiler Compilation Error Message
  21885. F2309          name : COMMON (or NAMELIST): attributes on items illegal
  21886.  
  21887.                 STRUCTURE may appear as well as COMMON. Fields in a STRUCTURE
  21888.                 may not have attributes.
  21889.  
  21890.  F2310          name : COMMON (or EQUIVALENCE) : SUBROUTINE (or FUNCTION)
  21891.                 name illegal
  21892.  
  21893.                 A function or subroutine name was included in a COMMON or
  21894.                 EQUIVALENCE statement.
  21895.  
  21896.                 Only local variables and arrays are legal.
  21897.  
  21898.  F2311          name : COMMON (or EQUIVALENCE or STRUCTURE) :
  21899.                 preinitial-ization illegal
  21900.  
  21901.                 Items in COMMON or EQUIVALENCE statements cannot be
  21902.                 preinitialized in type-declaration statements.
  21903.  
  21904.                 Use the standard notation for the DATA statement.
  21905.  Number         Compiler Compilation Error Message
  21906.                Use the standard notation for the DATA statement.
  21907.  
  21908.  F2312          name : COMMON (or EQUIVALENCE or NAMELIST) : formal
  21909.                 argument illegal
  21910.  
  21911.                 The specified formal argument was used in a COMMON or
  21912.                 EQUIVALENCE statement.
  21913.  
  21914.  F2313          name : COMMON (or EQUIVALENCE or NAMELIST) : not an array
  21915.                 or variable
  21916.  
  21917.                 An item other than an array or variable was used in an
  21918.                 EQUIVALENCE or COMMON statement.
  21919.  
  21920.  F2314          array : COMMON : too big
  21921.  
  21922.                 Arithmetic overflow occurred while the size of a common block
  21923.                 was being calculated. STRUCTURE can also appear. Common
  21924.                 blocks can be very large; structures must be less than 64K
  21925.                 bytes in size.
  21926.  Number         Compiler Compilation Error Message
  21927.                bytes in size.
  21928.  
  21929.  F2315          array : COMMON : array size nonconstant or zero
  21930.  
  21931.                 A nonconstant or 0 value was used to dimension the array.
  21932.  
  21933.  F2316          name1, name2 : EQUIVALENCE : both in blank common block
  21934.  
  21935.                 Two items specified in an EQUIVALENCE statement at different
  21936.                 offsets were both in a blank common block. In the EQUIVALENCE
  21937.                 statement, these items were specified to be at the same
  21938.                 location in memory.
  21939.  
  21940.  F2317          name1, name2 : EQUIVALENCE : both in common block
  21941.                 commonblock
  21942.  
  21943.                 Two items specified in an EQUIVALENCE statement at different
  21944.                 offsets were both in a named common block. These items were
  21945.                 specified in the EQUIVALENCE statement to be at the same
  21946.                 location in memory.
  21947.  Number         Compiler Compilation Error Message
  21948.                location in memory.
  21949.  
  21950.  F2318          name1, name2 : EQUIVALENCE : in different common blocks
  21951.  
  21952.                 Two items in different common blocks were specified in an
  21953.                 EQUIVALENCE statement.
  21954.  
  21955.  F2319          name : EQUIVALENCE : extends blank common block forward
  21956.  
  21957.                 In an EQUIVALENCE statement, it is illegal to increase the
  21958.                 size of a blank common block by adding memory elements before
  21959.                 the beginning common block declared in the COMMON statement.
  21960.  
  21961.  F2320          name : EQUIVALENCE : extends common block commonblock
  21962.                 forward
  21963.  
  21964.                 In an EQUIVALENCE statement, it is illegal to increase the
  21965.                 size of a named common block by adding memory elements before
  21966.                 the beginning common block declared in the COMMON statement.
  21967.  
  21968.  Number         Compiler Compilation Error Message
  21969. 
  21970.  F2321          name1, name2 : EQUIVALENCE : conflicting offsets
  21971.  
  21972.                 The processing of an EQUIVALENCE statement detected two items
  21973.                 that should have had the same offsets but did not.
  21974.                 Inconsistent use of EQUIVALENCE statements caused this
  21975.                 problem.
  21976.  
  21977.  F2322          name : EQUIVALENCE : two different common blocks
  21978.  
  21979.                 An EQUIVALENCE statement placed an item in two different
  21980.                 common blocks.
  21981.  
  21982.  F2323          commonblock : COMMON : size changed
  21983.  
  21984.                 The size of the specified common block differed from the size
  21985.                 allocated in a prior subprogram.
  21986.  
  21987.  F2324          commonblock : COMMON : too big to be NEAR
  21988.  
  21989.  Number         Compiler Compilation Error Message
  21990. 
  21991.                 The specified common block, declared with the NEAR attribute,
  21992.                 is larger than a segment.
  21993.  
  21994.  F2325          name : COMMON : function or subroutine name
  21995.  
  21996.                 The specified name was used as both a common-block name and a
  21997.                 function or subroutine name.
  21998.  
  21999.  F2326          name : already in COMMON
  22000.  
  22001.                 The specified name appeared in a COMMON statement elsewhere
  22002.                 in this subprogram.
  22003.  
  22004.  F2327          name : EQUIVALENCE : needs at least two items
  22005.  
  22006.                 An EQUIVALENCE statement had fewer than two items in a class.
  22007.  
  22008.  F2328          name : already typed
  22009.  
  22010.  Number         Compiler Compilation Error Message
  22011. 
  22012.                 The specified item appeared in an earlier type statement in
  22013.                 the same subprogram or derived-type definition.
  22014.  
  22015.  F2329          blank common cannot be HUGE
  22016.  
  22017.                 In medium model, blank common items must be smaller than a
  22018.                 single segment. Named common items do not have this
  22019.                 restriction.
  22020.  
  22021.  F2330          name : already dimensioned
  22022.  
  22023.                 Array bounds appeared for the specified item in an earlier
  22024.                 specification statement in the same subprogram.
  22025.  
  22026.  F2331          name : types illegal on BLOCK
  22027.                 DATA/COMMON/PROGRAM/SUBROUTINE
  22028.  
  22029.                 The specified item was not one of the symbol classes that can
  22030.                 be typed.
  22031.  Number         Compiler Compilation Error Message
  22032.                be typed.
  22033.  
  22034.  F2332          name : cannot initialize in type statements
  22035.  
  22036.                 An attempt was made to initialize the specified item in a
  22037.                 type statement while the /4Ys compiler option was used or the
  22038.                 $STRICT metacommand was in effect.
  22039.  
  22040.  F2333          name : DIMENSION : not array
  22041.  
  22042.                 The specified item in a DIMENSION statement (for example, an
  22043.                 item already declared in an EXTERNAL or PARAMETER statement)
  22044.                 was not an array.
  22045.  
  22046.  F2334          name : ALLOCATABLE: bounds must be omitted
  22047.  
  22048.                 An allocatable array declaration's subscripts must be ':'
  22049.                 only, with no upper or lower parameters.
  22050.  
  22051.  F2336          array : array bounds missing
  22052.  Number         Compiler Compilation Error Message
  22053. F2336          array : array bounds missing
  22054.  
  22055.                 Both bound expressions were missing from the declaration of
  22056.                 the specified array.
  22057.  
  22058.                 At least an upper bound must be present.
  22059.  
  22060.  F2337          array : * : not last array bound
  22061.  
  22062.                 An assumed-size array was declared with an asterisk (*) that
  22063.                 did not occur in the last bound.
  22064.  
  22065.  F2338          array : bound size too small
  22066.  
  22067.                 The bound size of the specified array was not a positive
  22068.                 whole number.
  22069.  
  22070.                 Bounds of adjustable-size arrays can be checked at run time.
  22071.                 This compile-time error occurs only when the upper and
  22072.                 (possibly implicit) lower bounds create a negative or zero
  22073.  Number         Compiler Compilation Error Message
  22074.                (possibly implicit) lower bounds create a negative or zero
  22075.                 element count for an array bound.
  22076.  
  22077.  F2339          array : adjustable-size array not in subprogram
  22078.  
  22079.                 The specified adjustable-size array was declared in a
  22080.                 subprogram declared with a PROGRAM or BLOCK DATA statement.
  22081.  
  22082.                 An adjustable-size array is legal only in an ENTRY, FUNCTION,
  22083.                 or SUBROUTINE statement in a subprogram.
  22084.  
  22085.  F2340          IMPLICIT already seen
  22086.  
  22087.                 An IMPLICIT statement has already been seen, so an IMPLICIT
  22088.                 NONE statement is illegal.
  22089.  
  22090.  F2341          letters : IMPLICIT : only single letter allowed
  22091.  
  22092.                 The upper or lower value of the range in an IMPLICIT
  22093.                 statement was not a single character.
  22094.  Number         Compiler Compilation Error Message
  22095.                statement was not a single character.
  22096.  
  22097.  F2342          IMPLICIT NONE already seen
  22098.  
  22099.                 There may only be one IMPLICIT NONE statement per subprogram.
  22100.  
  22101.  F2343          letter1, letter2 : IMPLICIT : lower limit exceeds upper
  22102.                 limit
  22103.  
  22104.                 The upper letter in the range in an IMPLICIT statement had a
  22105.                 smaller value than the letter in the lower range.
  22106.  
  22107.  F2344          letter : already IMPLICIT
  22108.  
  22109.                 The specified character already appeared in an IMPLICIT
  22110.                 statement earlier in the same subprogram.
  22111.  
  22112.  F2345          name : illegal use of SAVE (or AUTOMATIC, EXTERNAL,
  22113.                 INTRINSIC, PARAMETER)
  22114.  
  22115.  Number         Compiler Compilation Error Message
  22116. 
  22117.                 The specified name appeared earlier in a conflicting type
  22118.                 statement.
  22119.  
  22120.  F2346          name : INTRINSIC : unknown name
  22121.  
  22122.                 The specified name is not the name of a supported intrinsic
  22123.                 function.
  22124.  
  22125.  F2348          name : already declared SAVE (or AUTOMATIC, EXTERNAL,
  22126.                 INTRINSIC, PARAMETER)
  22127.  
  22128.                 The specified name was declared more than once with the same
  22129.                 type of statement.
  22130.  
  22131.  F2349          name : PARAMETER : nonconstant expression
  22132.  
  22133.                 The specified item was declared with a nonconstant value in a
  22134.                 PARAMETER statement.
  22135.  
  22136.  Number         Compiler Compilation Error Message
  22137. 
  22138.  F2350          RECORD : structure type illegal in IMPLICIT statement
  22139.  
  22140.                 Structure variables cannot be implicitly typed.
  22141.  
  22142.  F2351          name : repeated in formal-argument list
  22143.  
  22144.                 The specified item was repeated in the formal-argument list
  22145.                 to a statement function.
  22146.  
  22147.  F2352          name : formal argument not local variable
  22148.  
  22149.                 Only local variables can be used as formal arguments to
  22150.                 statement functions.
  22151.  
  22152.  F2354          name : statement function already declared
  22153.  
  22154.                 The specified statement function was already declared in the
  22155.                 current subprogram.
  22156.  
  22157.  Number         Compiler Compilation Error Message
  22158. 
  22159.  F2355          name : formal argument not a variable
  22160.  
  22161.                 An argument list or substring operator for the specified item
  22162.                 appeared in the formal-argument list to a statement function.
  22163.  
  22164.  F2356          name : statement function : too few actual arguments
  22165.  
  22166.                 More formal arguments than actual arguments were declared for
  22167.                 a statement function.
  22168.  
  22169.  F2357          name : statement function : too many actual arguments
  22170.  
  22171.                 More actual arguments than formal arguments were declared for
  22172.                 a statement function.
  22173.  
  22174.  F2359          type : illegal length
  22175.  
  22176.                 An illegal length specifier for the given type was used in a
  22177.                 declaration. For example,  REAL*13  would cause this error.
  22178.  Number         Compiler Compilation Error Message
  22179.                declaration. For example,  REAL*13  would cause this error.
  22180.  
  22181.  F2360          END STRUCTURE: no matching STRUCTURE statement
  22182.  
  22183.                 An END STRUCTURE statement was seen without a preceding
  22184.                 STRUCTURE statement.
  22185.  
  22186.  F2361          stmt : not a name
  22187.  
  22188.                 The argument on the STRUCTURE or END STRUCTURE statement was
  22189.                 not a symbol name.
  22190.  
  22191.  F2362          integer constant expression expected
  22192.  
  22193.                 An integer value or integer constant expression was expected
  22194.                 for an optional type-length specification.
  22195.  
  22196.  F2363          length value : illegal type length
  22197.  
  22198.                 A zero or negative length specifier was used in a type
  22199.  Number         Compiler Compilation Error Message
  22200.                A zero or negative length specifier was used in a type
  22201.                 statement, or the length specifier was larger than the
  22202.                 largest allowed for all types.
  22203.  
  22204.  F2364          only C attribute legal on INTEGER type
  22205.  
  22206.                 An attribute other than the C attribute appeared with an
  22207.                 INTEGER type statement.
  22208.  
  22209.  F2365          attributes illegal on non-INTEGER types
  22210.  
  22211.                 Attributes in type statements are illegal, other than the C
  22212.                 attribute on the INTEGER statement. Attributes were not put
  22213.                 on the variables themselves.
  22214.  
  22215.  F2366          DOUBLE PRECISION : length specifier illegal DOUBLE COMPLEX
  22216.                 : length specifier illegal
  22217.  
  22218.                 A DOUBLE PRECISION or DOUBLE COMPLEX statement included a
  22219.                 length specifier. DOUBLE PRECISION is the same as REAL*8.
  22220.  Number         Compiler Compilation Error Message
  22221.                length specifier. DOUBLE PRECISION is the same as REAL*8.
  22222.                 DOUBLE COMPLEX is the same as COMPLEX*8.
  22223.  
  22224.  F2367          value value : INTEGER : range error
  22225.  
  22226.                 The specified constant was out of range for type conversion,
  22227.                 or the type of an integer item was in conflict with the
  22228.                 integer size specified in the /4I compiler option (or
  22229.                 $STORAGE metacommand). For example, the following code
  22230.                 induces this error:
  22231.  
  22232.                 $STORAGE:2
  22233.                       INTEGER*4 i
  22234.                       i = 300000+30000
  22235.                       i =     10* 4000
  22236.                       = -30000-30000
  22237.                       END
  22238.  
  22239.                 To correct this error, use the appropriate INT2 or INT4
  22240.                 intrinsic function to make sure the appropriate (2- or
  22241.  Number         Compiler Compilation Error Message
  22242.                intrinsic function to make sure the appropriate (2- or
  22243.                 4-byte) arithmetic is performed on the variable.
  22244.  
  22245.  F2368          name : truncated to 6 characters
  22246.  
  22247.                 When the /4Ys compiler option is used or the $STRICT
  22248.                 metacommand is in effect, only six characters can appear in
  22249.                 identifier names.
  22250.  
  22251.  F2369          name : $ illegal in C name
  22252.  
  22253.                 A character in the specified name was illegal for a C
  22254.                 variable. C variables allow only underscores (_) and
  22255.                 alphanumeric characters in names.
  22256.  
  22257.  F2370          length specification illegal
  22258.  
  22259.                 When the /4Ys compiler option is used (or the $STRICT
  22260.                 metacommand is in effect), length specifications can only be
  22261.                 used with CHARACTER type statements.
  22262.  Number         Compiler Compilation Error Message
  22263.                used with CHARACTER type statements.
  22264.  
  22265.  F2371          name1, name2 : EQUIVALENCE : character and noncharacter
  22266.                 items mixed
  22267.  
  22268.                 Character and noncharacter items were mixed in an EQUIVALENCE
  22269.                 statement.
  22270.  
  22271.  F2372          name : more than 7 array bounds
  22272.  
  22273.                 When the /4Ys compiler option is used (or the $STRICT
  22274.                 metacommand is in effect), an array cannot have more than
  22275.                 seven bounds.
  22276.  
  22277.  F2373          name : REFERENCE or VALUE only legal on formal arguments
  22278.  
  22279.                 A REFERENCE or VALUE attribute was used with an item that was
  22280.                 not declared in the formal-argument list for the routine.
  22281.  
  22282.                 If the item is used in a type statement, then the attributed
  22283.  Number         Compiler Compilation Error Message
  22284.                If the item is used in a type statement, then the attributed
  22285.                 item must also appear in the formal-argument list of a
  22286.                 subprogram. If the item appears in an ENTRY statement,
  22287.                 include the attribute there instead.
  22288.  
  22289.  F2374          name : attributes illegal on array bounds
  22290.  
  22291.                 No attributes are allowed on items that are used when
  22292.                 dimensioning arrays.
  22293.  
  22294.  F2375          name : assumed-size array : cannot pass by value
  22295.  
  22296.                 An assumed-size array was passed as an actual argument to a
  22297.                 routine that had its formal argument declared with the VALUE
  22298.                 attribute.
  22299.  
  22300.  F2376          name : adjustable-size array : cannot pass by value
  22301.  
  22302.                 An adjustable-size array was passed as an actual argument to
  22303.                 a routine that had its formal argument declared with the
  22304.  Number         Compiler Compilation Error Message
  22305.                a routine that had its formal argument declared with the
  22306.                 VALUE attribute.
  22307.  
  22308.  F2377          name : NEAR common block has HUGE item
  22309.  
  22310.                 A common block declared with the NEAR attribute included
  22311.                 item(s) that required the common block to be huge.
  22312.  
  22313.  F2378          name : NEAR array bigger than segment
  22314.  
  22315.                 An array declared with the NEAR attribute was larger than a
  22316.                 segment.
  22317.  
  22318.  F2379          name : item in common block crosses segment
  22319.  
  22320.                 An item or an array element in a common block crossed a
  22321.                 segment boundary. Items or arrays must be evenly aligned to
  22322.                 signal boundaries when a common block crosses a segment.
  22323.  
  22324.  F2380          name : VARYING illegal on symbol class
  22325.  Number         Compiler Compilation Error Message
  22326. F2380          name : VARYING illegal on symbol class
  22327.  
  22328.                 The VARYING attribute was used on something other than a
  22329.                 function or subroutine.
  22330.  
  22331.  F2381          commonblock : NEAR/FAR/HUGE attribute mismatches default
  22332.  
  22333.                 An attribute declared for the given common block was
  22334.                 different from the attribute implicitly applied to the common
  22335.                 block in an earlier subprogram.
  22336.  
  22337.                 In medium-model programs, the NEAR attribute is used
  22338.                 implicitly, unless the size of the common block requires the
  22339.                 common block to be huge. In large-model programs, the FAR or
  22340.                 HUGE attribute is used implicitly.
  22341.  
  22342.  F2382          commonblock : attribute attribute mismatch with earlier
  22343.                 NEAR/FAR/HUGE
  22344.  
  22345.                 An attribute given in an earlier common-block declaration
  22346.  Number         Compiler Compilation Error Message
  22347.                An attribute given in an earlier common-block declaration
  22348.                 (possibly in a different subprogram) was not the same as the
  22349.                 current attribute.
  22350.  
  22351.  F2383          name : COMMON : character and noncharacter items mixed
  22352.  
  22353.                 Character and noncharacter items cannot be mixed in a common
  22354.                 block when the /4Ys compiler option is used (or the $STRICT
  22355.                 metacommand is in effect).
  22356.  
  22357.  F2384          name : attribute  variable cannot be AUTOMATIC
  22358.  
  22359.                 The attribute can be one of the following four: HUGE, FAR,
  22360.                 EXTERN, ALLOCATABLE.
  22361.  
  22362.  F2385          name : STRUCTURE has no elements
  22363.  
  22364.                 A STRUCTURE was declared with no component fields.
  22365.  
  22366.  F2386          NAMELIST:  group name required
  22367.  Number         Compiler Compilation Error Message
  22368. F2386          NAMELIST:  group name required
  22369.  
  22370.                 A name must appear between the slashes.
  22371.  
  22372.  F2387          name : STRUCTURE : intrinsic type name
  22373.  
  22374.                 Derived type names may not be the same as the names of
  22375.                 intrinsic types.
  22376.  
  22377.  F2388          name : NAMELIST : array bounds illegal
  22378.  
  22379.                 Only variable and array names are allowed in a NAMELIST
  22380.                 statement (the array must be declared someplace else).
  22381.  
  22382.  F2389          name : not a STRUCTURE name
  22383.  
  22384.                 The argument in the STRUCTURE( ) statement has not previously
  22385.                 been declared in a STRUCTURE statement.
  22386.  
  22387.  F2390          name : ALLOCATABLE : common block variable illegal
  22388.  Number         Compiler Compilation Error Message
  22389. F2390          name : ALLOCATABLE : common block variable illegal
  22390.  
  22391.                 Common block variables may not be allocatable attribute.
  22392.  
  22393.  F2391          name : ALLOCATABLE : equivalenced variable illegal
  22394.  
  22395.                 Equivalenced variables may not be given the allocatable
  22396.                 attribute.
  22397.  
  22398.  F2392          MAP : no enclosing UNION statement
  22399.  
  22400.                 A map can only appear within a UNION statement.
  22401.  
  22402.  F2393          name: element name conflicts with operator
  22403.  
  22404.  F2394          name: NAMELIST: structure illegal
  22405.  
  22406.                 Structure variables cannot appear in NAMELIST groups.
  22407.  
  22408.  F2395          UNION : not in a STRUCTURE
  22409.  Number         Compiler Compilation Error Message
  22410. F2395          UNION : not in a STRUCTURE
  22411.  
  22412.                 A union can only appear within a STRUCTURE statement.
  22413.  
  22414.  F2396          name : ALLOCATABLE : must be in array
  22415.  
  22416.                 A variable was given the allocatable attribute but not
  22417.                 dimensioned.
  22418.  
  22419.  F2401          name : DATA : illegal address expression
  22420.  
  22421.                 An illegal expression was used for the offset in a DATA
  22422.                 statement.
  22423.  
  22424.                 Only constant offsets are legal for items in DATA statements.
  22425.  
  22426.  F2402          name : cannot initialize formal argument
  22427.  
  22428.                 The item being initialized was a formal argument to a
  22429.                 subprogram.
  22430.  Number         Compiler Compilation Error Message
  22431.                subprogram.
  22432.  
  22433.  F2403          name : cannot initialize item in blank common block
  22434.  
  22435.                 An attempt was made to use a DATA statement to initialize the
  22436.                 specified item in a blank common block.
  22437.  
  22438.  F2404          name : can only initialize common block in BLOCK DATA
  22439.                 subprogram
  22440.  
  22441.                 An attempt was made to initialize the specified item named in
  22442.                 a common block in a DATA statement.
  22443.  
  22444.                 Items in named common blocks can be initialized only in BLOCK
  22445.                 DATA subprograms.
  22446.  
  22447.  F2405          name : DATA : not an array or variable
  22448.  
  22449.                 Only arrays and variables can be initialized in DATA
  22450.                 statements.
  22451.  Number         Compiler Compilation Error Message
  22452.                statements.
  22453.  
  22454.  F2406          name : repeat count not positive integer
  22455.  
  22456.                 The repeat count for initialization of the specified item was
  22457.                 not a positive integer value.
  22458.  
  22459.  F2407          name : DATA : nonconstant item in initializer list
  22460.  
  22461.                 A nonconstant value was used to initialize the specified item
  22462.                 in a DATA statement.
  22463.  
  22464.  F2408          name : DATA : too few constants to initialize item
  22465.  
  22466.                 The DATA statement did not include enough constants to
  22467.                 initialize the specified item.
  22468.  
  22469.  F2409          name : nonstatic address illegal in initialization
  22470.  
  22471.                 During processing of an implied-DO list in a DATA statement,
  22472.  Number         Compiler Compilation Error Message
  22473.                During processing of an implied-DO list in a DATA statement,
  22474.                 the specified item did not have a static address.
  22475.  
  22476.                 Make sure the item has constant subscript specifiers.
  22477.  
  22478.  F2410          name : bound or increment not constant
  22479.  
  22480.                 The specified item in implied-DO initialization in a DATA
  22481.                 statement did not have constant bounds.
  22482.  
  22483.  F2411          name : DATA : zero increment
  22484.  
  22485.                 In a DATA statement, the increment value in the implied-DO
  22486.                 list for the specified item must be set so the loop exits.
  22487.  
  22488.  F2412          name : DATA : active implied-DO variable
  22489.  
  22490.                 The specified implied-DO variable was used in nested DATA
  22491.                 implied-DO initialization loops in a DATA statement.
  22492.  
  22493.  Number         Compiler Compilation Error Message
  22494. 
  22495.  F2413          name : DATA : implied-DO variable not INTEGER
  22496.  
  22497.                 In DATA statements, only implied-DO variables of types
  22498.                 INTEGER and  INTEGER*n  are legal.
  22499.  
  22500.  F2414          name : DATA : not array-element name
  22501.  
  22502.                 Only array elements can be initialized in implied-DO
  22503.                 initializations in DATA statements.
  22504.  
  22505.  F2415          DATA : too few constants to initialize names
  22506.  
  22507.                 The constant list was exhausted before the initialization of
  22508.                 the name list was complete.
  22509.  
  22510.  F2416          name: bound or increment not INTEGER
  22511.  
  22512.                 When the /4Ys compiler option is used (or the $STRICT
  22513.                 metacommand is in effect), only items of type INTEGER are
  22514.  Number         Compiler Compilation Error Message
  22515.                metacommand is in effect), only items of type INTEGER are
  22516.                 allowed for DATA implied-DO loop bounds and increments.
  22517.                 Otherwise, any arithmetic type is allowed and is truncated to
  22518.                 type INTEGER by an implicit use of the INT intrinsic
  22519.                 function.
  22520.  
  22521.  F2417          DATA : iteration count not positive
  22522.  
  22523.                 In the implied-DO list (...,dovar=start,stop,inc), if the
  22524.                 increment inc is positive, then start must be greater than
  22525.                 stop; if the increment inc is negative, then stop must be
  22526.                 greater than start. If not, then the loop would execute zero
  22527.                 times, which is not allowed.
  22528.  
  22529.  F2418          name  : variable was declared automatic
  22530.  
  22531.                 A variable which is going to go on the stack (declared
  22532.                 AUTOMATIC) cannot be given the HUGE attribute.
  22533.  
  22534.  F2419          name : cannot initialize allocatable array
  22535.  Number         Compiler Compilation Error Message
  22536. F2419          name : cannot initialize allocatable array
  22537.  
  22538.                 An allocatable array cannot appear in a DATA statement.
  22539.  
  22540.  F2490          name : STAT= must be last parameter
  22541.  
  22542.                 The STAT= parameter must be last in an ALLOCATE statement.
  22543.  
  22544.  F2491          name : stmt : not allocatable array
  22545.  
  22546.                 The name in the allocate or deallocate statement is not an
  22547.                 allocatable array. (The second parameter is ALLOCATE or
  22548.                 DEALLOCATE.)
  22549.  
  22550.  F2492          stmt : STAT= variable must be scalar integer
  22551.  
  22552.                 First parameter is ALLOCATE or DEALLOCATE.
  22553.  
  22554.  F2493          name : * :  illegal bound
  22555.  
  22556.  Number         Compiler Compilation Error Message
  22557. 
  22558.                 There are no assumed-size dimensions in an allocatable array.
  22559.  
  22560.  F2500          array : adjustable-size array : used before definition
  22561.  
  22562.                 An adjustable-size array was used before it was seen in an
  22563.                 ENTRY statement.
  22564.  
  22565.  F2502          type : cannot convert to type
  22566.  
  22567.                 When the /4Ys compiler option is used (or the $STRICT
  22568.                 metacommand is in effect), constants cannot be converted
  22569.                 between CHARACTER and nonCHARACTER types.
  22570.  
  22571.  F2503          intrinsic : incorrect use of intrinsic function
  22572.  
  22573.                 Invalid arguments were given for the specified intrinsic
  22574.                 function.
  22575.  
  22576.  F2504          intrinsic : multiple arguments
  22577.  Number         Compiler Compilation Error Message
  22578. F2504          intrinsic : multiple arguments
  22579.  
  22580.                 The specified intrinsic function had more than one argument;
  22581.                 only one is legal.
  22582.  
  22583.  F2505          intrinsic : cannot convert FAR address to NEAR
  22584.  
  22585.                 An item in the specified intrinsic function can only be
  22586.                 referenced with addressing consistent with the FAR or HUGE
  22587.                 attribute.
  22588.  
  22589.  F2506          cannot convert type to type
  22590.  
  22591.                 An invalid type conversion to CHARACTER or LOGICAL type was
  22592.                 attempted.
  22593.  
  22594.  F2508          array: array bound used array reference
  22595.  
  22596.                 An expression having an array was used when declaring an
  22597.                 adjustable-size array.
  22598.  Number         Compiler Compilation Error Message
  22599.                adjustable-size array.
  22600.  
  22601.                 Only simple variables in common blocks on the current
  22602.                 subprogram's formal argument list are allowed as variables in
  22603.                 the bound expression.
  22604.  
  22605.  F2509          element : not an element of name
  22606.  
  22607.                 The name given as a component of a derived type is undefined.
  22608.  
  22609.  F2510          name : symbolic constant : subscript illegal
  22610.  
  22611.                 The specified symbolic constant had an array index or
  22612.                 argument list.
  22613.  
  22614.  F2511          name : symbolic constant : substring illegal
  22615.  
  22616.                 The specified symbolic constant had a substring operator.
  22617.  
  22618.  F2512          name : variable : argument list illegal
  22619.  Number         Compiler Compilation Error Message
  22620. F2512          name : variable : argument list illegal
  22621.  
  22622.                 The specified simple variable included an argument list.
  22623.  
  22624.  F2513          name : not a variable
  22625.  
  22626.                 The specified item was not a variable.
  22627.  
  22628.                 A variable is expected in this context.
  22629.  
  22630.  F2514          concatenation with CHARACTER*(*)
  22631.  
  22632.                 A CHARACTER*(*) item was used in a concatenation operation.
  22633.  
  22634.                 Only items with specified lengths are legal in
  22635.                 concatenations.
  22636.  
  22637.  F2515          left side of assignment illegal
  22638.  
  22639.                 The left side of an assignment statement was illegal.
  22640.  Number         Compiler Compilation Error Message
  22641.                The left side of an assignment statement was illegal.
  22642.  
  22643.                 Only variables, array elements, or function-return variables
  22644.                 may appear on the left side of assignment statements.
  22645.  
  22646.  F2516          name : assignment using active DO variable illegal
  22647.  
  22648.                 An active DO variable was used in an assignment statement.
  22649.  
  22650.  F2517          illegal implied-DO list in expression
  22651.  
  22652.                 In this context, implied-DO statements are illegal in
  22653.                 expressions.
  22654.  
  22655.  F2518          name : not a structure
  22656.  
  22657.                 A variable which is not of derived type was specified with a
  22658.                 component field.
  22659.  
  22660.  F2519          name : operation error with COMPLEX operands
  22661.  Number         Compiler Compilation Error Message
  22662. F2519          name : operation error with COMPLEX operands
  22663.  
  22664.                 A constant-folding error occurred. The number created would
  22665.                 probably overflow the allowed storage. Using smaller numbers
  22666.                 will correct.
  22667.  
  22668.  F2520          name : operation error with REAL operands
  22669.  
  22670.                 A constant-folding error occurred. The number created would
  22671.                 probably overflow the allowed storage. Using smaller numbers
  22672.                 will correct.
  22673.  
  22674.  F2521          negative exponent with zero base
  22675.  
  22676.                 A negative exponent was used with a zero-value base.
  22677.  
  22678.  F2522          division by zero
  22679.  
  22680.                 Division by zero occurred during constant folding.
  22681.  
  22682.  Number         Compiler Compilation Error Message
  22683. 
  22684.  F2523          only comparisons by .EQ. and .NE. allowed for complex items
  22685.  
  22686.                 Only .EQ. and .NE. are legal as comparison operators for
  22687.                 complex items.
  22688.  
  22689.  F2524          non-numeric operand
  22690.  
  22691.                 A nonarithmetic operand was specified with an arithmetic
  22692.                 operator.
  22693.  
  22694.  F2525          exponentiation of COMPLEX and DOUBLE PRECISION together
  22695.                 illegal
  22696.  
  22697.                 When the /4Ys compiler option is used (or the $STRICT
  22698.                 metacommand is in effect), exponentiation is illegal with
  22699.                 bases of type COMPLEX having DOUBLE PRECISION exponents, or
  22700.                 with bases of type DOUBLE PRECISION having COMPLEX exponents.
  22701.  
  22702.  F2526          concatenation of expressions illegal
  22703.  Number         Compiler Compilation Error Message
  22704. F2526          concatenation of expressions illegal
  22705.  
  22706.                 An illegal concatenation operation occurred.
  22707.  
  22708.                 If a noncharacter item is used in a concatenation, it must be
  22709.                 a constant or it must be addressable.
  22710.  
  22711.  F2527          noncharacter operand
  22712.  
  22713.                 When the /4Ys compiler option is used (or when the $STRICT
  22714.                 metacommand is in effect), concatenation operators can be
  22715.                 used only with character operands.
  22716.  
  22717.  F2528          nonlogical operand
  22718.  
  22719.                 Logical operators (.AND., .OR., .NOT., .EQV., and .NEQV.)
  22720.                 must be used with logical operands.
  22721.  
  22722.  F2529          operands of relation not numeric or character
  22723.  
  22724.  Number         Compiler Compilation Error Message
  22725. 
  22726.                 Relational operators (.LT., .LE., .GT., .GE., .EQ., and .NE.)
  22727.                 must be used with arithmetic or character operands.
  22728.  
  22729.  F2530          name: symbol class illegal here
  22730.  
  22731.                 The class of the given symbol was illegal in this context.
  22732.  
  22733.  F2531          name: bound not integer
  22734.  
  22735.                 The /4Ys compiler option was used in compiling (or the
  22736.                 $STRICT metacommand was in effect), and a substring had a
  22737.                 noninteger substring-bound expression.
  22738.  
  22739.                 If the /4Ns compiler option is used in compiling (or the
  22740.                 $NOTSTRICT metacommand is in effect), any arithmetic
  22741.                 expression is legal and is truncated to integers through an
  22742.                 implicit use of the INT intrinsic function.
  22743.  
  22744.  F2532          name : substring on noncharacter item
  22745.  Number         Compiler Compilation Error Message
  22746. F2532          name : substring on noncharacter item
  22747.  
  22748.                 An attempt was made to take the substring from an item that
  22749.                 was not a character variable or array item.
  22750.  
  22751.  F2533          name : lower substring bound exceeds upper bound
  22752.  
  22753.                 The /4Yb compiler option was used (or the $DEBUG metacommand
  22754.                 was in effect), and the value of the upper substring bound
  22755.                 was less than the value of the lower substring bound.
  22756.  
  22757.  F2534          name : upper substring bound exceeds string length
  22758.  
  22759.                 The /4Yb compiler option was used (or the $DEBUG metacommand
  22760.                 was in effect), and the upper substring bound was greater
  22761.                 than the length of the item from which the substring was
  22762.                 taken.
  22763.  
  22764.                 This error occurs only if the length of the item was not
  22765.                 specified (that is, if it was declared as a CHARACTER*n
  22766.  Number         Compiler Compilation Error Message
  22767.                specified (that is, if it was declared as a CHARACTER*n
  22768.                 item).
  22769.  
  22770.  F2535          name : lower substring bound not positive
  22771.  
  22772.                 The /4Yb compiler option was used (or the $DEBUG metacommand
  22773.                 was in effect), and the lower substring bound was less than
  22774.                 or equal to 0.
  22775.  
  22776.                 The minimum value for items of type CHARACTER is 1.
  22777.  
  22778.  F2536          array : subscript number out of range
  22779.  
  22780.                 The /4Yb compiler option was used (or the $DEBUG metacommand
  22781.                 was in effect), and a local array or an array in a common
  22782.                 block had a bound out of range.
  22783.  
  22784.  F2537          array : array subscripts missing
  22785.  
  22786.                 The specified array, which did not have array subscripts, was
  22787.  Number         Compiler Compilation Error Message
  22788.                The specified array, which did not have array subscripts, was
  22789.                 used in an expression.
  22790.  
  22791.  F2538          array : subscript number : not integer
  22792.  
  22793.                 When the /4Ys compiler option is used (or the $STRICT
  22794.                 metacommand is in effect), a subscripting expression used in
  22795.                 the specified array must be of type INTEGER. Otherwise, it
  22796.                 must be an arithmetic type that is truncated to  INTEGER by
  22797.                 an implicit use of the INT intrinsic function.
  22798.  
  22799.  F2539          array : too few array subscripts
  22800.  
  22801.                 Not enough subscripts were given when the specified array was
  22802.                 used in an expression.
  22803.  
  22804.  F2540          array : too many array subscripts
  22805.  
  22806.                 Too many subscripts were given when the array was used in an
  22807.                 expression.
  22808.  Number         Compiler Compilation Error Message
  22809.                expression.
  22810.  
  22811.  F2541          cannot convert between CHARACTER and non CHARACTER
  22812.                 constants
  22813.  
  22814.                 If the /4Ys compiler option is used (or the $STRICT
  22815.                 metacommand is in effect), constants cannot be converted
  22816.                 between CHARACTER and nonCHARACTER types.
  22817.  
  22818.  F2542          one numeric, one character operand
  22819.  
  22820.                 If the /4Ys compiler option is used in compiling (or the
  22821.                 $STRICT metacommand is in effect), both operands used with
  22822.                 relational operators must be character or both must be
  22823.                 arithmetic. Operands of different types cannot be mixed.
  22824.  
  22825.  F2543          operand type must be logical or integer
  22826.  
  22827.                 See F2528. When the $STRICT metacommand is off, integer
  22828.                 operands are allowed also.
  22829.  Number         Compiler Compilation Error Message
  22830.                operands are allowed also.
  22831.  
  22832.  F2544          operand types do not match
  22833.  
  22834.                 One argument is a derived type and the other argument is not.
  22835.  
  22836.  F2545          invalid operator for structure operands
  22837.  
  22838.                 Only the .EQ. and .NE. operators are defined for structures.
  22839.  
  22840.  F2559          array : array bound used illegal variable
  22841.  
  22842.                 Only variables in common blocks or in the formal argument
  22843.                 list to the current subprogram are legal when declaring
  22844.                 adjustable-size arrays.
  22845.  
  22846.  F2560          array : array bound used intrinsic call
  22847.  
  22848.                 Only variables in common blocks or in the formal argument
  22849.                 list to the current subprogram are legal when declaring
  22850.  Number         Compiler Compilation Error Message
  22851.                list to the current subprogram are legal when declaring
  22852.                 adjustable-size arrays.
  22853.  
  22854.  F2561          array : array bound used function call
  22855.  
  22856.                 Only variables in common blocks or in the formal argument
  22857.                 list to the current subprogram are legal when declaring
  22858.                 adjustable-size arrays.
  22859.  
  22860.  F2562          cannot pass CHARACTER*(*) by value
  22861.  
  22862.                 The program tried to pass by value an item of type
  22863.                 CHARACTER*(*). This is illegal because the length of such
  22864.                 items is not known at compile time.
  22865.  
  22866.                 Actual arguments with a length of n can be passed to
  22867.                 CHARACTER*n items, and these items can be passed by value, if
  22868.                 required.
  22869.  
  22870.  F2563          incompatible types for formal and actual arguments
  22871.  Number         Compiler Compilation Error Message
  22872. F2563          incompatible types for formal and actual arguments
  22873.  
  22874.                 The types of the formal and actual arguments did not match.
  22875.  
  22876.                 Formal and actual arguments must have the same types (except
  22877.                 for arguments of type CHARACTER, where the lengths can
  22878.                 differ).
  22879.  
  22880.  F2564          incompatible types in assignment
  22881.  
  22882.                 The expressions on the left and right sides of an assignment
  22883.                 statement were of different types. For example, a logical
  22884.                 expression cannot be assigned to an integer variable.
  22885.  
  22886.  F2565          operation : COMPLEX : type conversion error
  22887.  
  22888.                 An attempt was made to convert values of one type to types
  22889.                 that hold a smaller range of values.
  22890.  
  22891.  F2566          operation : REAL : type conversion error
  22892.  Number         Compiler Compilation Error Message
  22893. F2566          operation : REAL : type conversion error
  22894.  
  22895.                 An attempt was made to convert values of one type to types
  22896.                 that hold a smaller range of values.
  22897.  
  22898.  F2567          LEN : illegal expression
  22899.  
  22900.                 Only constants, symbols, concatenations, intrinsic type
  22901.                 casts, and strings are allowed in the LEN intrinsic function.
  22902.  
  22903.  F2568          name : illegal bound type
  22904.  
  22905.                 Only integer items are allowed as array bounds when the /4Ys
  22906.                 compiler option is used (or the $STRICT metacommand is in
  22907.                 effect). Otherwise, arithmetic types are allowed and are
  22908.                 converted through an implicit use of the INT intrinsic
  22909.                 function.
  22910.  
  22911.  F2569          name : Hollerith constant passed by value
  22912.  
  22913.  Number         Compiler Compilation Error Message
  22914. 
  22915.                 A Hollerith constant must be passed by reference to a
  22916.                 logical, real, or integer formal argument.
  22917.  
  22918.  F2570          consecutive arithmetic operators illegal
  22919.  
  22920.                 Unary plus and minus cannot follow other arithmetic
  22921.                 operators. For example,  I = I**-1  is illegal; I = I**(-1)
  22922.                 must be used instead.
  22923.  
  22924.  F2571          consecutive relational operators illegal
  22925.  
  22926.                 The .NOT. operator cannot follow another .NOT. operator.
  22927.  
  22928.  F2572          illegal use of Hollerith constant
  22929.  
  22930.                 Hollerith constants are only allowed in assignments, DATA
  22931.                 statements, and subprogram references.
  22932.  
  22933.  F2600          name : directly recursive
  22934.  Number         Compiler Compilation Error Message
  22935. F2600          name : directly recursive
  22936.  
  22937.                 A subprogram is trying to call itself.
  22938.  
  22939.  F2601          intrinsic : intrinsic function illegal as actual argument
  22940.  
  22941.                 This intrinsic function is illegal as an actual argument.
  22942.                 (Some specific versions of the generic intrinsic functions
  22943.                 can be passed as actual arguments.)
  22944.  
  22945.  F2602          name : formal argument name : character expressions cannot
  22946.                 be passed by VALUE
  22947.  
  22948.                 A character expression cannot be passed by value.
  22949.  
  22950.  F2604          subprogram : function : argument list missing
  22951.  
  22952.                 The specified function was missing an argument list.
  22953.  
  22954.                 At least an empty argument list (( )) must be present in
  22955.  Number         Compiler Compilation Error Message
  22956.                At least an empty argument list (( )) must be present in
  22957.                 expressions.
  22958.  
  22959.  F2605          subprogram : function : substring operator illegal
  22960.  
  22961.                 A substring operator was used illegally with the specified
  22962.                 routine name.
  22963.  
  22964.                 Substring operators can only be used with arrays and
  22965.                 variables.
  22966.  
  22967.  F2606          subprogram : formal argument name : type mismatch
  22968.  
  22969.                 The type of a formal argument was different from the type of
  22970.                 the actual argument used in the subprogram call.
  22971.  
  22972.  F2607          subprogram : formal argument name : length mismatch
  22973.  
  22974.                 The length of a formal argument was different from the length
  22975.                 of the actual argument used in the subprogram call.
  22976.  Number         Compiler Compilation Error Message
  22977.                of the actual argument used in the subprogram call.
  22978.  
  22979.  F2608          subprogram : formal argument name : Hollerith illegal with
  22980.                 CHARACTER
  22981.  
  22982.                 Hollerith constants can only be used with items of type
  22983.                 INTEGER, LOGICAL, and REAL in DATA statements and subprogram
  22984.                 references.
  22985.  
  22986.  F2609          subprogram : formal argument * : actual not
  22987.                 alternate-return label
  22988.  
  22989.                 Because the specified formal argument was an alternate-return
  22990.                 label, the current argument must also be an alternate-return
  22991.                 label.
  22992.  
  22993.  F2610          subprogram : formal argument name : not alternate-return
  22994.                 label
  22995.  
  22996.                 Because the specified formal argument was not an
  22997.  Number         Compiler Compilation Error Message
  22998.                Because the specified formal argument was not an
  22999.                 alternate-return label, the current argument must not be an
  23000.                 alternate-return label.
  23001.  
  23002.  F2611          subprogram : formal argument name : actual not subprogram
  23003.  
  23004.                 The formal argument used in a subprogram declaration was a
  23005.                 subprogram, but the actual argument was not.
  23006.  
  23007.  F2612          subprogram : NEAR formal argument name : actual has FAR or
  23008.                 HUGE address
  23009.  
  23010.                 It is illegal to pass an item that must be addressed with far
  23011.                 or huge addressing to a formal argument that must be
  23012.                 addressed with near addressing.
  23013.  
  23014.  F2615          name : not function or subroutine
  23015.  
  23016.                 The specified item was not a function or subroutine.
  23017.  
  23018.  Number         Compiler Compilation Error Message
  23019. 
  23020.                 Check the item's use or declaration earlier in the program.
  23021.  
  23022.  F2616          subprogram : illegal use of function or subroutine
  23023.  
  23024.                 The program tried to use a function as a subroutine or use a
  23025.                 subroutine as a function.
  23026.  
  23027.  F2617          subprogram : adjustable-size array array : cannot pass by
  23028.                 value
  23029.  
  23030.                 An attempt was made to pass an adjustable-size array by
  23031.                 value.
  23032.  
  23033.  F2618          subprogram : cannot use CHARACTER*(*) function
  23034.  
  23035.                 CHARACTER*(*) functions cannot be directly referenced. They
  23036.                 can only be passed as actual arguments.
  23037.  
  23038.  F2619          name : value argument bigger than segment
  23039.  Number         Compiler Compilation Error Message
  23040. F2619          name : value argument bigger than segment
  23041.  
  23042.                 An argument with a VALUE attribute was too big to be passed
  23043.                 onto the stack.
  23044.  
  23045.  F2620          subprogram : formal argument name : subprogram mismatch
  23046.  
  23047.                 The type of the formal argument to the subprogram was not the
  23048.                 same as the actual argument.
  23049.  
  23050.                 Both the formal and the actual argument must be subroutines
  23051.                 or functions.
  23052.  
  23053.  F2621          name : formal argument name : not subprogram
  23054.  
  23055.                 The actual argument to the subprogram was a subprogram, but
  23056.                 the formal argument was not a subprogram.
  23057.  
  23058.  F2622          assumed-size array array : cannot pass by value
  23059.  
  23060.  Number         Compiler Compilation Error Message
  23061. 
  23062.                 An assumed-size array can only be passed by reference.
  23063.  
  23064.  F2623          name : nonconstant CHARACTER length : cannot pass by value
  23065.  
  23066.                 If a substring is used when passing a CHARACTER*(n) or
  23067.                 CHARACTER*(*) argument to a formal argument declared with the
  23068.                 VALUE attribute, then the lower and upper substring values
  23069.                 must be constant. Otherwise, the length cannot be determined.
  23070.  
  23071.  F2624          subprogram : too few actual arguments
  23072.  
  23073.                 The number of actual and formal arguments for the given
  23074.                 subprogram did not match.
  23075.  
  23076.                 This practice is legal only when the C and VARYING attributes
  23077.                 are specified for the subprogram.
  23078.  
  23079.  F2625          subprogram : too many actual arguments
  23080.  
  23081.  Number         Compiler Compilation Error Message
  23082. 
  23083.                 The number of actual and formal arguments for the given
  23084.                 subprogram did not match.
  23085.  
  23086.                 This practice is legal only when the C and VARYING attributes
  23087.                 are specified for the subprogram.
  23088.  
  23089.  F2626          formal argument <name> : cannot be SAVE or AUTOMATIC
  23090.  
  23091.                 A formal argument cannot appear in either a SAVE or AUTOMATIC
  23092.                 statement.
  23093.  
  23094.  F2650          name : array expression: cannot be adjustable-size array
  23095.  
  23096.                 An adjustable-size array may not appear in an array
  23097.                 expression.
  23098.  
  23099.  F2651          name : array expression: argument does not conform
  23100.  
  23101.                 The array name is not the same size as other arrays in the
  23102.  Number         Compiler Compilation Error Message
  23103.                The array name is not the same size as other arrays in the
  23104.                 expression.
  23105.  
  23106.  F2652          name : array expression: cannot be assumed-size array
  23107.  
  23108.                 An assumed-size array may not appear in an array expression.
  23109.  
  23110.  F2653          <name> : array expression : cannot be allocatable array
  23111.  
  23112.                 An allocatable array name cannot appear in an array
  23113.                 expression, since its bounds are not known at compile time.
  23114.  
  23115.  F2702          iooption : array subscript missing
  23116.  
  23117.                 In this context, the array in the specified I/O option cannot
  23118.                 appear without subscripts.
  23119.  
  23120.  F2703          iooption : not type
  23121.  
  23122.                 The specified I/O option required an item of a different
  23123.  Number         Compiler Compilation Error Message
  23124.                The specified I/O option required an item of a different
  23125.                 type. For example, the REC=rec option requires an integer
  23126.                 expression.
  23127.  
  23128.  F2704          iooption : not a variable or array element
  23129.  
  23130.                 The specified I/O option required a variable or an array
  23131.                 element, as opposed to an arbitrary expression.
  23132.  
  23133.  F2705          label number : not between 1 and 99999
  23134.  
  23135.                 Statement labels are restricted to the range 1-99,999; they
  23136.                 must be one to five digits, not all of which are 0.
  23137.  
  23138.  F2706          UNIT= * illegal for this statement
  23139.  
  23140.                 The asterisk (*) unit specifier (console unit) cannot be
  23141.                 specified for this I/O statement.
  23142.  
  23143.                 Use the asterisk (*) unit specifier only with READ, WRITE, or
  23144.  Number         Compiler Compilation Error Message
  23145.                Use the asterisk (*) unit specifier only with READ, WRITE, or
  23146.                 INQUIRE statements. For INQUIRE statements, the asterisk (*)
  23147.                 unit specifier is allowed only when the /4Ns compiler option
  23148.                 is used (or the $NOTSTRICT metacommand is in effect).
  23149.  
  23150.  F2707          illegal unit specifier
  23151.  
  23152.                 The unit specifier in a UNIT= option was not an integer
  23153.                 expression, asterisk (*), character variable, array element,
  23154.                 array, or substring.
  23155.  
  23156.                 A noncharacter array is a legal unit specifier if the /4Ns
  23157.                 compiler option is used in compiling (or the $NOTSTRICT
  23158.                 metacommand is in effect).
  23159.  
  23160.  F2708          illegal format specifier
  23161.  
  23162.                 The format specifier in a FMT= option was not a statement
  23163.                 label, integer variable, character expression, character
  23164.                 array, noncharacter array, or asterisk (*).
  23165.  Number         Compiler Compilation Error Message
  23166.                array, noncharacter array, or asterisk (*).
  23167.  
  23168.  F2709          HUGE format illegal
  23169.  
  23170.                 An array declared with a HUGE attribute that appeared in a
  23171.                 $LARGE metacommand, or that spanned more than one segment,
  23172.                 was used as a format specifier.
  23173.  
  23174.  F2710          UNIT=* : unformatted I/O illegal
  23175.  
  23176.                 The keyboard or terminal is opened for sequential formatted
  23177.                 I/O only.
  23178.  
  23179.  F2711          FAR format illegal in medium model
  23180.  
  23181.                 Data allocated with the FAR attribute were used as a format
  23182.                 specifier in a medium-model program.
  23183.  
  23184.  F2712          iooption : appears twice
  23185.  
  23186.  Number         Compiler Compilation Error Message
  23187. 
  23188.                 The specified I/O option was used more than once in the same
  23189.                 I/O statement.
  23190.  
  23191.  F2713          END= (or ERR=): illegal statement label
  23192.  
  23193.                 An integer number in the range 1 to 99,999 must be specified
  23194.                 for statement labels following the ERR= and END= input/output
  23195.                 options. (Compile-time error.)
  23196.  
  23197.  F2714          I/O option number : <keyword=> missing
  23198.  
  23199.                 The I/O option at position number in the option list appeared
  23200.                 without a keyword.
  23201.  
  23202.                 An I/O option without a keyword must not appear past the
  23203.                 second position in the option list. Also, only UNIT= and FMT=
  23204.                 options can appear without a keyword. If the UNIT= option
  23205.                 appears without a keyword, it must be the first option in the
  23206.                 option list. If the FMT= option appears without a keyword, it
  23207.  Number         Compiler Compilation Error Message
  23208.                option list. If the FMT= option appears without a keyword, it
  23209.                 must follow a UNIT= option without a keyword.
  23210.  
  23211.                 For example,
  23212.  
  23213.                       OPEN (2, 'F.DOT')
  23214.  
  23215.                 would produce the message
  23216.  
  23217.                 I/O option 2:  <keyword=> missing
  23218.  
  23219.                 because the FILE= option is missing in the second option.
  23220.  
  23221.  F2715          iooption : option illegal for this statement
  23222.  
  23223.                 The given I/O option could not be used with this I/O
  23224.                 statement.
  23225.  
  23226.  F2716          INQUIRE : either UNIT= or FILE= needed
  23227.  
  23228.  Number         Compiler Compilation Error Message
  23229. 
  23230.                 The INQUIRE statement must have either a UNIT= option or a
  23231.                 FILE= option, but not both.
  23232.  
  23233.  F2717          UNIT= missing
  23234.  
  23235.                 This I/O statement lacked a UNIT= option.
  23236.  
  23237.  F2718          illegal I/O formatting for internal unit
  23238.  
  23239.                 Internal units do not allow the use of unformatted or
  23240.                 list-directed I/O.
  23241.  
  23242.                 A format specifier other than asterisk (*) must be used.
  23243.  
  23244.  F2719          REC= illegal for internal unit
  23245.  
  23246.                 Direct-access I/O is illegal for internal units.
  23247.  
  23248.  F2720          FORMAT : label missing
  23249.  Number         Compiler Compilation Error Message
  23250. F2720          FORMAT : label missing
  23251.  
  23252.                 A FORMAT statement lacked a statement label in the range 1 to
  23253.                 99,999.
  23254.  
  23255.  F2721          no ASSIGN statements for FMT=<integer variable>
  23256.  
  23257.                 The current format specifier had no corresponding ASSIGN
  23258.                 statement to set the integer variable to a valid FORMAT
  23259.                 statement label.
  23260.  
  23261.  F2722          UNIT= : not between -32767 and 32767
  23262.  
  23263.                 An external unit number was out of range.
  23264.  
  23265.  F2723          iooption : unrecognized value in option
  23266.  
  23267.                 An invalid or misspelled value was used with the given I/O
  23268.                 option. For example, ACCESS='DIREKT'  and  ACCESS='RANDOM'
  23269.                 are both illegal.
  23270.  Number         Compiler Compilation Error Message
  23271.                are both illegal.
  23272.  
  23273.  F2724          RECL= required to open direct-access file
  23274.  
  23275.                 When opening a file for direct access, the RECL= option is
  23276.                 required.
  23277.  
  23278.  F2725          illegal input list item
  23279.  
  23280.                 An input list item was not a variable, array, array element,
  23281.                 or substring.
  23282.  
  23283.  F2726          iooption: * illegal with this option
  23284.  
  23285.                 The asterisk (*) unit specifier (console unit) cannot be used
  23286.                 with the given I/O control specifier.
  23287.  
  23288.  F2727          array : assumed-size array illegal here
  23289.  
  23290.                 An assumed-size array cannot be used in this context.
  23291.  Number         Compiler Compilation Error Message
  23292.                An assumed-size array cannot be used in this context.
  23293.  
  23294.  F2728          attributes are non-standard
  23295.  
  23296.                 Specifying attributes is nonstandard (-4Ys or $STRICT has
  23297.                 been specified).
  23298.  
  23299.  F2729          FAR or HUGE I/O item illegal in medium model
  23300.  
  23301.                 Data items having the FAR or HUGE attribute cannot be used in
  23302.                 I/O statements in medium-model programs.
  23303.  
  23304.  F2730          name : cannot modify active DO variable
  23305.  
  23306.                 A DO variable cannot be modified within its range. For
  23307.                 example, the following program fragments cause this error:
  23308.  
  23309.                       DO 100 I = 1,10
  23310.                       OPEN (33, IOSTAT = I)
  23311.                   100 CONTINUE
  23312.  Number         Compiler Compilation Error Message
  23313.                  100 CONTINUE
  23314.  
  23315.                       READ (*,*) (I, I = 1,10)
  23316.  
  23317.  F2731          iooption : noncharacter array nonstandard
  23318.  
  23319.                 If the /4Ys compiler option is used in compiling (or the
  23320.                 $STRICT metacommand is in effect), standard forms of the
  23321.                 language must be used. In these cases, only character
  23322.                 variables, arrays, array elements, and substrings are legal
  23323.                 as I/O specifiers.
  23324.  
  23325.  F2732          stmt : nonstandard statement
  23326.  
  23327.                 (IMPLICIT NONE, INCLUDE, SELECT, END DO, DO WHILE, NAMELIST,
  23328.                 TYPE, END TYPE, TYPE ( ), etc.) The statement is non-standard
  23329.                 and $STRICT has been specified. ALLOCATE, DEALLOCATE TYPE,
  23330.                 and INTERFACE are also nonstandard features.
  23331.  
  23332.  F2733          iooption : option nonstandard
  23333.  Number         Compiler Compilation Error Message
  23334. F2733          iooption : option nonstandard
  23335.  
  23336.                 The specified I/O option is not part of standard FORTRAN 77;
  23337.                 it cannot be given if the /4Ys compiler option is used (or
  23338.                 the $STRICT metacommand is in effect).
  23339.  
  23340.  F2734          END= : illegal when REC= present
  23341.  
  23342.                 In READ statements, the REC= and END= options cannot both be
  23343.                 present.
  23344.  
  23345.  F2735          REC= : illegal when FMT= *
  23346.  
  23347.                 In READ and WRITE statements, the REC= option is illegal if
  23348.                 list-directed I/O is in use.
  23349.  
  23350.  F2736          LOCKING : nonstandard
  23351.  
  23352.                 If the /4Ys compiler option is used (or the $STRICT
  23353.                 metacommand is in effect), the LOCKING statement is
  23354.  Number         Compiler Compilation Error Message
  23355.                metacommand is in effect), the LOCKING statement is
  23356.                 prohibited.
  23357.  
  23358.  F2737          iooption : lowercase in string nonstandard
  23359.  
  23360.                 If the /4Ys compiler option is used (or the $STRICT
  23361.                 metacommand is in effect), the value of the specified I/O
  23362.                 option must be given in uppercase. For example,
  23363.                 ACCESS='DIRECT' is legal in this case, but  ACCESS='direct'
  23364.                 is not.
  23365.  
  23366.  F2738          name : HUGE internal units illegal
  23367.  
  23368.                 An array used as an internal unit cannot be declared with the
  23369.                 HUGE attribute or used in a $LARGE metacommand. The array
  23370.                 cannot be larger than one segment.
  23371.  
  23372.  F2739          name : record length too large for internal unit
  23373.  
  23374.                 For a noncharacter array used as an internal unit, the
  23375.  Number         Compiler Compilation Error Message
  23376.                For a noncharacter array used as an internal unit, the
  23377.                 element size multiplied by the element count (that is, the
  23378.                 record length of the internal file) was too large.
  23379.  
  23380.  F2740          RECL= : out of range
  23381.  
  23382.                 The value of the RECL= option was less than or equal to 0 or
  23383.                 exceeded the maximum legal value.
  23384.  
  23385.  F2741          ACCESS= : nonstandard option value
  23386.  
  23387.                 This option is not allowed for file access.
  23388.  
  23389.  F2742          format specification illegal when namelist specified
  23390.  
  23391.                 The NML= and FMT=specifiers are mutually exclusive.
  23392.  
  23393.  F2743          name : NML= : not a namelist group name
  23394.  
  23395.                 The name specified by the NML= spec was not declared in a
  23396.  Number         Compiler Compilation Error Message
  23397.                The name specified by the NML= spec was not declared in a
  23398.                 NAMELIST statement.
  23399.  
  23400.  F2744          NML= : namelist group name missing
  23401.  
  23402.                 The NML= spec requires a name as an argument.
  23403.  
  23404.  F2745          name : i/o of entire structures illegal
  23405.  
  23406.                 Only structure variable elements can be written to or read
  23407.                 from files using formatted I/O.
  23408.  
  23409.  F2800          name : CHARACTER*(*) type illegal
  23410.  
  23411.                 An item was declared with CHARACTER*(*) type, but it was not
  23412.                 in the formal-argument list in the current subprogram.
  23413.  
  23414.  F2801          no ASSIGN statements for assigned GOTO (or FMT=)
  23415.  
  23416.                 The program unit had no ASSIGN statements for use with an
  23417.  Number         Compiler Compilation Error Message
  23418.                The program unit had no ASSIGN statements for use with an
  23419.                 assigned GOTO statement or assigned FMT= specifier.
  23420.  
  23421.  F2803          name : ASSIGN : variable not INTEGER
  23422.  
  23423.                 Only variables of type INTEGER*n or INTEGER are legal in
  23424.                 ASSIGN statements.
  23425.  
  23426.  F2804          name : ASSIGN : too many INTEGER*1 variables
  23427.  
  23428.                 Only the first 127 ASSIGN statements may use variables of
  23429.                 type INTEGER*1 in a subprogram. This is caused by the storage
  23430.                 limitations of INTEGER*1 items.
  23431.  
  23432.  F2805          label number : redefined in program unit
  23433.  
  23434.                 The specified label appeared earlier in the subprogram.
  23435.  
  23436.                 Labels may not be defined more than once within a single
  23437.                 subprogram unit. This error may also occur if a DO loop
  23438.  Number         Compiler Compilation Error Message
  23439.                subprogram unit. This error may also occur if a DO loop
  23440.                 references a previously defined label.
  23441.  
  23442.  F2806          DO-loop variable : not a variable
  23443.  
  23444.                 A DO-loop variable was a symbolic constant, not an actual
  23445.                 variable.
  23446.  
  23447.  F2807          name : illegal use of active DO-loop variable
  23448.  
  23449.                 It is illegal to use an active DO-loop variable as another
  23450.                 DO-loop variable in a nested DO statement. Values cannot be
  23451.                 assigned to DO-loop variables within DO loops.
  23452.  
  23453.  F2808          DO-loop variable not INTEGER or REAL
  23454.  
  23455.                 Only variables of type INTEGER*n and REAL*n are legal as
  23456.                 DO-loop variables.
  23457.  
  23458.  F2809          DO-loop expression not INTEGER or REAL
  23459.  Number         Compiler Compilation Error Message
  23460. F2809          DO-loop expression not INTEGER or REAL
  23461.  
  23462.                 Only expressions of type INTEGER*n and REAL*n are legal as
  23463.                 DO-loop bounds.
  23464.  
  23465.  F2810          zero illegal as increment
  23466.  
  23467.                 Only nonzero increments are legal as DO-loop increments.
  23468.                 Otherwise, the loop would never exit.
  23469.  
  23470.  F2811          IF or ELSEIF missing
  23471.  
  23472.                 No IF or ELSEIF statement matching an ELSE or ELSEIF
  23473.                 statement appeared in the program.
  23474.  
  23475.  F2812          ENDIF missing
  23476.  
  23477.                 Not all IF ENDIF blocks were exited before an END statement
  23478.                 appeared.
  23479.  
  23480.  Number         Compiler Compilation Error Message
  23481. 
  23482.  F2813          DO-loop label number : not seen
  23483.  
  23484.                 Not all DO loops were exited before an END statement
  23485.                 appeared.
  23486.  
  23487.  F2814          IF, ELSEIF, or ELSE missing
  23488.  
  23489.                 No IF, ELSEIF, or ELSE statement matching an ENDIF statement
  23490.                 appeared in the program.
  23491.  
  23492.  F2815          assigned GOTO variable not INTEGER
  23493.  
  23494.                 Only items of type INTEGER*n and INTEGER are legal for
  23495.                 assigned GOTO variables.
  23496.  
  23497.  F2816          computed GOTO variable not INTEGER
  23498.  
  23499.                 Only items of type INTEGER*n and INTEGER are legal for
  23500.                 computed GOTO variables.
  23501.  Number         Compiler Compilation Error Message
  23502.                computed GOTO variables.
  23503.  
  23504.  F2817          expression type not LOGICAL
  23505.  
  23506.                 Expression types for logical or block IF statements must be
  23507.                 of type LOGICAL«*n».
  23508.  
  23509.  F2818          expression type not INTEGER or REAL
  23510.  
  23511.                 Expression types for arithmetic IF statements must be of type
  23512.                 INTEGER«*n» or REAL«*n».
  23513.  
  23514.  F2819          illegal statement after logical IF
  23515.  
  23516.                 Only single-line statements can follow logical IF statements.
  23517.                 All executable statements except DO, ELSE, ELSEIF, END,
  23518.                 ENDIF, block IF, and logical IF can follow a logical IF
  23519.                 statement.
  23520.  
  23521.  F2820          block label number : must not be referenced
  23522.  Number         Compiler Compilation Error Message
  23523. F2820          block label number : must not be referenced
  23524.  
  23525.                 Labels that appear on ELSE and ELSEIF statements cannot be
  23526.                 referenced.
  23527.  
  23528.  F2821          label number : previously used as executable label
  23529.  
  23530.                 The specified label, previously referenced as an executable
  23531.                 label, was used as a label for a FORMAT statement or
  23532.                 specification statement.
  23533.  
  23534.  F2822          label number : previously used as FORMAT label
  23535.  
  23536.                 The specified label, previously referenced as a label for a
  23537.                 FORMAT statement, was used as an executable label or a label
  23538.                 for a specification statement.
  23539.  
  23540.  F2823          DO-loop label number : out of order
  23541.  
  23542.                 The specified termination label for a DO statement was out of
  23543.  Number         Compiler Compilation Error Message
  23544.                The specified termination label for a DO statement was out of
  23545.                 order. DO-loop labels may have been reversed.
  23546.  
  23547.  F2824          assigned and unconditional GOTO illegal here
  23548.  
  23549.                 Assigned and unconditional GOTO statements cannot terminate
  23550.                 DO loops.
  23551.  
  23552.  F2825          block and arithmetic IF illegal here
  23553.  
  23554.                 Block and arithmetic IF statements cannot terminate a DO
  23555.                 loop.
  23556.  
  23557.  F2826          statement illegal as DO-loop termination
  23558.  
  23559.                 An ELSE, ELSEIF, END, ENDIF, FORMAT, RETURN, or STOP
  23560.                 statement cannot be used to terminate a DO loop.
  23561.  
  23562.  F2827          STOP (or PAUSE) : maximum of 5 digits
  23563.  
  23564.  Number         Compiler Compilation Error Message
  23565. 
  23566.                 The STOP and PAUSE statements allow only numeric values
  23567.                 between 0 and 99,999, inclusive.
  23568.  
  23569.  F2828          ASSIGN target not an INTEGER variable
  23570.  
  23571.                 Only variables of type INTEGER are allowed as targets in
  23572.                 ASSIGN statements.
  23573.  
  23574.  F2829          STOP (or PAUSE) : illegal expression
  23575.  
  23576.                 Only integers or character constants are legal in STOP and
  23577.                 PAUSE statements.
  23578.  
  23579.  F2830          END missing
  23580.  
  23581.                 An END statement did not appear as the last statement in the
  23582.                 module.
  23583.  
  23584.  F2831          label number : must not be referenced
  23585.  Number         Compiler Compilation Error Message
  23586. F2831          label number : must not be referenced
  23587.  
  23588.                 The specified label appeared on a specification or DATA
  23589.                 statement.
  23590.  
  23591.  F2832          statement illegal in INTERFACE
  23592.  
  23593.                 Only specification statements are legal in INTERFACE
  23594.                 statements.
  23595.  
  23596.  F2833          RETURN : integer or character expression required
  23597.  
  23598.                 If the /4Ys compiler option is used for compiling (or the
  23599.                 $STRICT metacommand is in effect), only integer or character
  23600.                 expressions can follow the RETURN statement.
  23601.  
  23602.  F2834          name : alternate RETURN missing
  23603.  
  23604.                 An alternate RETURN statement was given in the specified
  23605.                 subprogram when none was given in the subprogram declaration.
  23606.  Number         Compiler Compilation Error Message
  23607.                subprogram when none was given in the subprogram declaration.
  23608.  
  23609.  F2835          statement out of order or END missing
  23610.  
  23611.                 A specification statement was embedded in execution
  23612.                 statements, another statement appeared out of the legal
  23613.                 statement sequence, or an END statement did not terminate a
  23614.                 previous subprogram.
  23615.  
  23616.  F2836          statement out of order
  23617.  
  23618.                 A statement appeared out of the legal order of statements in
  23619.                 the program. For example, a specification statement may have
  23620.                 appeared with execution statements.
  23621.  
  23622.  F2837          label number : undefined
  23623.  
  23624.                 The specified label, which was referenced in a subprogram,
  23625.                 was not defined.
  23626.  
  23627.  Number         Compiler Compilation Error Message
  23628. 
  23629.  F2838          statement illegal in BLOCK DATA
  23630.  
  23631.                 Only type-specification and DATA statements are legal in
  23632.                 BLOCK DATA subprograms.
  23633.  
  23634.  F2839          only variables allowed in assigned GOTO statements
  23635.  
  23636.                 Only variables are allowed in assigned GOTO statements.
  23637.  
  23638.  F2840          name : assumed-size array : not reference argument
  23639.  
  23640.                 Assumed-size arrays must be passed by reference. They cannot
  23641.                 be local entities to the subprogram.
  23642.  
  23643.  F2841          name : adjustable-size array : not reference argument
  23644.  
  23645.                 Adjustable-size arrays must be passed by reference. They
  23646.                 cannot be local entities to a subprogram.
  23647.  
  23648.  Number         Compiler Compilation Error Message
  23649. 
  23650.  F2842          too many assigned GOTO statements
  23651.  
  23652.                 Only 255 assigned GOTO statements are allowed in a
  23653.                 subprogram. (Compile-time error.)
  23654.  
  23655.  F2843          statement illegal with INTERFACE TO
  23656.  
  23657.                 An interface must refer to a subroutine or function. The
  23658.                 INTERFACE TO statement may not be used to declare calls to
  23659.                 subprograms. For more information, see the entry for the
  23660.                 INTERFACE TO statement in Section 4.2, "Statement
  23661.                 Directory."
  23662.  
  23663.  F2844          no matching DO loop
  23664.  
  23665.                 An EXIT, CYCLE, or END DO was seen without a matching DO
  23666.                 loop.
  23667.  
  23668.  F2845          END SELECT missing
  23669.  Number         Compiler Compilation Error Message
  23670. F2845          END SELECT missing
  23671.  
  23672.                 A SELECT construct was not closed by the end of the
  23673.                 subprogram.
  23674.  
  23675.  F2846          DO-LOOP ENDDO : not seen
  23676.  
  23677.                 A DO loop without a label was not closed by the end of the
  23678.                 subprogram.
  23679.  
  23680.  F2847          statement illegal in STRUCTURE declaration
  23681.  
  23682.                 Only STRUCTURE statements are allowed in a STRUCTURE
  23683.                 declaration.
  23684.  
  23685.  F2860          expression must be integer, character, or logical
  23686.  
  23687.                 SELECT CASE expressions must be integer, CHARACTER*1, or
  23688.                 logical.
  23689.  
  23690.  Number         Compiler Compilation Error Message
  23691. 
  23692.  F2861          no matching SELECT CASE statement
  23693.  
  23694.                 An END SELECT statement was seen without a previous SELECT
  23695.                 CASE statement.
  23696.  
  23697.  F2862          only one CASE DEFAULT allowed
  23698.  
  23699.                 No more than one CASE DEFAULT can appear in a SELECT CASE
  23700.                 statement.
  23701.  
  23702.  F2863          CASE values must be constant expressions
  23703.  
  23704.                 A CASE value cannot be a variable or an expression that
  23705.                 contains variables.
  23706.  
  23707.  F2864          CASE value type does not match SELECT CASE expression type
  23708.  
  23709.                 A CASE value type and SELECT CASE expression data types must
  23710.                 match.
  23711.  Number         Compiler Compilation Error Message
  23712.                match.
  23713.  
  23714.  F2865          overlapping case values
  23715.  
  23716.                 A given value must match only one CASE.
  23717.  
  23718.  F2866          The CASE statement must follow a SELECT CASE statement
  23719.  
  23720.                 A CASE statement appeared without a previous SELECT CASE
  23721.                 statement.
  23722.  
  23723.  F2867          LOGICAL case value ranges illegal
  23724.  
  23725.                 A logical case value must not be expressed as a range.
  23726.  
  23727.  F2868          SELECT CASE : character expression must be of length 1
  23728.  
  23729.                 Only CHARACTER*1 character expressions are allowed.
  23730.  
  23731.  F2869          lower value exceeds upper value in case value range
  23732.  Number         Compiler Compilation Error Message
  23733. F2869          lower value exceeds upper value in case value range
  23734.  
  23735.                 The value to the left of the colon must be less than the
  23736.                 value to the right of the colon.
  23737.  
  23738.  F2870          name : element is an array
  23739.  
  23740.                 A field which is an array of structures is not being indexed.
  23741.  
  23742.  F2901          -4I2 or -4I4 expected
  23743.  
  23744.                 Only 2- and 4-byte default integer and logical values are
  23745.                 supported.
  23746.  
  23747.  F2902          -4Y and -4N : both options used for argument
  23748.  
  23749.                 The $DO66 or $FREEFORM metacommand was specified in both the
  23750.                 /4Y and the /4N compiler options.
  23751.  
  23752.  F2993          separator expected in format
  23753.  Number         Compiler Compilation Error Message
  23754. F2993          separator expected in format
  23755.  
  23756.                 When the /4Ys compiler option is used (or the $STRICT
  23757.                 metacommand is in effect), a comma (,), colon (:), right
  23758.                 parenthesis ()), or slash (/) is expected to separate items
  23759.                 in a format except in the following cases:
  23760.  
  23761.    1. Between a P edit descriptor and an immediately following F, D, E, or G
  23762.       edit descriptor
  23763.  
  23764.    2. Before or after a slash (/) edit descriptor
  23765.  
  23766.    3. Before or after a colon (:) edit descriptor
  23767.  
  23768.  F2994          \ or $ : nonstandard edit descriptor in format
  23769.  
  23770.                 The \ and $ edit descriptors are not part of standard FORTRAN
  23771.                 77 but are extensions to the language. This error occurs only
  23772.                 if the /4Ys compiler option is used (or if the $STRICT
  23773.                 metacommand is in effect).
  23774.  Number         Compiler Compilation Error Message
  23775.                metacommand is in effect).
  23776.  
  23777.  F2995          Z : nonstandard edit descriptor in format
  23778.  
  23779.                 The Z edit descriptor is not part of standard FORTRAN 77 but
  23780.                 is an extension to the language. This error occurs only if
  23781.                 the /4Ys compiler option is used (or if the $STRICT
  23782.                 metacommand is in effect).
  23783.  
  23784.  
  23785.  D.2.3  Recoverable Error Messages
  23786.  
  23787.  The messages listed below indicate potential problems but do not hinder
  23788.  compilation and linking. The /W compiler option has no effect on the output
  23789.  of these messages.
  23790.  
  23791. ╓┌─────────────┌─────────────────────────────────────────────────────────────╖
  23792.  Number         Compiler Recoverable Error Message
  23793.  
  23794.  F3606          subprogram : formal argument name : type mismatch
  23795.  Number         Compiler Recoverable Error Message
  23796. F3606          subprogram : formal argument name : type mismatch
  23797.  
  23798.                 The type of a formal argument was different from the type of
  23799.                 the actual argument used in the subprogram call.
  23800.  
  23801.  F3607          subprogram : formal argument name : length mismatch
  23802.  
  23803.                 The length of a formal argument was different from the length
  23804.                 of the actual argument used in the subprogram call.
  23805.  
  23806.  
  23807.  D.2.4  Warning Error Messages
  23808.  
  23809.  The messages listed below indicate potential problems but do not hinder
  23810.  compilation and linking.
  23811.  
  23812.  F4000          UNKNOWN WARNING Contact Microsoft Technical Support
  23813.  
  23814.                 An unknown warning has occurred.
  23815.  
  23816.  Number         Compiler Recoverable Error Message
  23817. 
  23818.                 Please report this condition to Microsoft Corporation using
  23819.                 the Software Problem Report form at the back of this manual.
  23820.  
  23821.  F4001          colon expected following ALIAS
  23822.  
  23823.                 An ALIAS attribute had the wrong form.
  23824.  
  23825.                 The correct form for ALIAS is the following:
  23826.  
  23827.       ALIAS:string
  23828.  
  23829.  F4002          $DEBUG:'<debug-list>' illegal with $FREEFORM
  23830.  
  23831.                 This form of the $DEBUG metacommand was used when the
  23832.                 $FREEFORM metacommand was in effect.
  23833.  
  23834.  F4003          $DECMATH not supported
  23835.  
  23836.                 The $DECMATH metacommand is not supported in this version of
  23837.  Number         Compiler Recoverable Error Message
  23838.                The $DECMATH metacommand is not supported in this version of
  23839.                 FORTRAN.
  23840.  
  23841.  F4006          metacommand already set
  23842.  
  23843.                 A metacommand that may appear only once was reset.
  23844.  
  23845.  F4007          metacommand must come before all FORTRAN statements
  23846.  
  23847.                 This metacommand must appear before all FORTRAN statements.
  23848.  
  23849.  F4008          characters following metacommand ignored
  23850.  
  23851.                 Any characters that follow a fully processed metacommand are
  23852.                 ignored.
  23853.  
  23854.  F4010          filename : error closing file
  23855.  
  23856.                 A system error occurred while the specified source file was
  23857.                 being closed.
  23858.  Number         Compiler Recoverable Error Message
  23859.                being closed.
  23860.  
  23861.  F4011          empty escape sequence
  23862.  
  23863.                 A backslash (\) occurred at the end of a C string such as
  23864.                 'abc\'. It is replaced by a zero.
  23865.  
  23866.                 The backslash should be removed.
  23867.  
  23868.  F4014          character : nonalphabetic character in $DEBUG ignored
  23869.  
  23870.                 A nonalphabetic character was included in the list for the
  23871.                 $DEBUG metacommand.
  23872.  
  23873.                 The characters a-z or A-Z are the only legal characters. Case
  23874.                 is ignored.
  23875.  
  23876.  F4056          overflow in constant arithmetic
  23877.  
  23878.                 The result of an operation exceeded #7FFFFFFF.
  23879.  Number         Compiler Recoverable Error Message
  23880.                The result of an operation exceeded #7FFFFFFF.
  23881.  
  23882.  F4057          overflow in constant multiplication
  23883.  
  23884.                 The result of an operation exceeded #7FFFFFFF.
  23885.  
  23886.  F4058          address of frame variable taken, DS != SS
  23887.  
  23888.                 The program was compiled with the default data segment (DS)
  23889.                 not equal to the stack segment (SS), and the program tried to
  23890.                 point to a frame variable with a near pointer.
  23891.  
  23892.  F4059          segment lost in conversion
  23893.  
  23894.                 The conversion of a far pointer (a full segmented address) to
  23895.                 a near pointer (a segmented offset) resulted in the loss of
  23896.                 the segmented address.
  23897.  
  23898.  F4060          conversion of long address to short address
  23899.  
  23900.  Number         Compiler Recoverable Error Message
  23901. 
  23902.                 The conversion of a long address (a 32-bit pointer) to a
  23903.                 short address (a 16-bit pointer) resulted in the loss of the
  23904.                 segmented address.
  23905.  
  23906.  F4061          long/short mismatch in argument : conversion supplied
  23907.  
  23908.                 Actual and formal arguments of a function differed in base
  23909.                 type. The type of the actual argument was converted to the
  23910.                 type of the formal argument.
  23911.  
  23912.  F4062          near/far mismatch in argument : conversion supplied
  23913.  
  23914.                 Actual and formal arguments of a function differed in pointer
  23915.                 size. The size of the actual argument was converted to the
  23916.                 size of the formal argument.
  23917.  
  23918.  F4063          name : function too large for post-optimizer
  23919.  
  23920.                 The compiler tried to optimize a function but ran out of
  23921.  Number         Compiler Recoverable Error Message
  23922.                The compiler tried to optimize a function but ran out of
  23923.                 memory while doing so. It flagged the warning, skipped the
  23924.                 optimization, and continued the compilation.
  23925.  
  23926.                 To avoid this problem, break the functions in the program
  23927.                 into smaller functions.
  23928.  
  23929.  F4064          procedure too large, skipping optimization optimization and
  23930.                 continuing
  23931.  
  23932.                 The compiler tried to perform the given type of optimization
  23933.                 on a function but ran out of memory while doing so. It
  23934.                 flagged the warning, skipped the given part of the
  23935.                 optimization, and continued the compilation.
  23936.  
  23937.                 To avoid this problem, break the function into smaller
  23938.                 functions.
  23939.  
  23940.  F4065          recoverable heap overflow in post-optimizer - some
  23941.                 optimizations may be missed
  23942.  Number         Compiler Recoverable Error Message
  23943.                optimizations may be missed
  23944.  
  23945.                 The compiler tried to optimize a function but ran out of
  23946.                 memory while doing so. It flagged the warning, skipped the
  23947.                 optimization, and continued the compilation.
  23948.  
  23949.                 To avoid this problem, break the function into smaller
  23950.                 functions.
  23951.  
  23952.  F4066          local symbol table overflow - some local symbols may be
  23953.                 missing in listings
  23954.  
  23955.                 The compiler ran out of memory when it tried to collect the
  23956.                 local symbols for source listings. Not all of the symbols are
  23957.                 listed.
  23958.  
  23959.  F4072          insufficient memory to process debugging information
  23960.  
  23961.                 You specified the /Zi compiler option, but the compiler did
  23962.                 not have enough memory to store all of the required debugging
  23963.  Number         Compiler Recoverable Error Message
  23964.                not have enough memory to store all of the required debugging
  23965.                 information. (Compile-time warning.)
  23966.  
  23967.  F4186          string too long-truncated to 40 characters
  23968.  
  23969.                 A string of more than 40 characters was used in a $TITLE or
  23970.                 $SUBTITLE metacommand. The string is truncated to 40
  23971.                 characters.
  23972.  
  23973.  F4201          ENTRY : formal argument name : ATTRIBUTE attribute :
  23974.                 mismatch
  23975.  
  23976.                 VALUE and REFERENCE attributes were mismatched in the
  23977.                 declaration and use of an ENTRY statement.
  23978.  
  23979.  F4202          subprogram : formal argument name : never used
  23980.  
  23981.                 If a formal argument is never referenced, the compiler must
  23982.                 assume a variable was meant for this argument. In medium
  23983.                 model, if a function is passed to the formal argument, the
  23984.  Number         Compiler Recoverable Error Message
  23985.                model, if a function is passed to the formal argument, the
  23986.                 wrong amount of storage may be allocated. This message is
  23987.                 suppressed by any previous compiler error message  (F2xxx).
  23988.  
  23989.  F4303          name : language attributes illegal on formal arguments
  23990.  
  23991.                 A language attribute (C or PASCAL) was specified for a formal
  23992.                 argument to the current routine. It has no effect.
  23993.  
  23994.  F4313          name : not previously declared
  23995.  
  23996.                 While the /4Yd compiler option was used (or the $DECLARE
  23997.                 metacommand was in effect), name was not declared in a type
  23998.                 statement before it was used.
  23999.  
  24000.  F4314          intrinsic : declared with wrong type
  24001.  
  24002.                 The specified name was declared with an incorrect type in an
  24003.                 INTRINSIC statement. The incorrect type is ignored, and the
  24004.                 correct type is used.
  24005.  Number         Compiler Recoverable Error Message
  24006.                correct type is used.
  24007.  
  24008.  F4315          name : attribute illegal with attributes specified in same
  24009.                 list
  24010.  
  24011.                 The specified attribute contradicts an earlier attribute for
  24012.                 the item in the same attribute list.
  24013.  
  24014.  F4316          name : attribute illegal with attributes specified in
  24015.                 earlier list
  24016.  
  24017.                 The specified attribute contradicts an attribute in an
  24018.                 earlier attribute list for the item.
  24019.  
  24020.  F4317          name : attribute attribute repeated
  24021.  
  24022.                 The specified attribute was already used once in an earlier
  24023.                 attribute list for the item, and it should only have appeared
  24024.                 in one attribute list.
  24025.  
  24026.  Number         Compiler Recoverable Error Message
  24027. 
  24028.  F4318          name : attribute illegal on COMMON statements
  24029.  
  24030.                 The specified attribute is illegal on common-block
  24031.                 declarations.
  24032.  
  24033.  F4319          name : attribute illegal on formal arguments
  24034.  
  24035.                 The specified attribute cannot be used on formal arguments.
  24036.  
  24037.  F4320          name : attribute illegal on ENTRY statements
  24038.  
  24039.                 The specified attribute cannot be used on ENTRY statements.
  24040.  
  24041.  F4321          name : attribute illegal on subprogram statements
  24042.  
  24043.                 The specified attribute cannot be used on SUBPROGRAM
  24044.                 statements.
  24045.  
  24046.  F4322          name : attribute illegal on variable declarations
  24047.  Number         Compiler Recoverable Error Message
  24048. F4322          name : attribute illegal on variable declarations
  24049.  
  24050.                 The specified attribute cannot be used on variable
  24051.                 declarations.
  24052.  
  24053.  F4323          name : attribute illegal on type declarations
  24054.  
  24055.                 The specified attribute cannot be used on type declarations.
  24056.  
  24057.  F4325          name : attribute illegal on NAMELIST declarations
  24058.  
  24059.                 Attributes are illegal on NAMELIST declarations.
  24060.  
  24061.  F4326          name : EQUIVALENCE : nonconstant upper substring expression
  24062.                 ignored
  24063.  
  24064.                 The upper substring expression in an EQUIVALENCE statement
  24065.                 was not a constant. Since the expression is not used in the
  24066.                 addressing expression, it is ignored.
  24067.  
  24068.  Number         Compiler Recoverable Error Message
  24069. 
  24070.  F4327          name : INTERFACE : not formal argument
  24071.  
  24072.                 A variable was declared that was not given in the
  24073.                 formal-argument list to the subprogram specified in the
  24074.                 INTERFACE statement.
  24075.  
  24076.  F4328          name : attribute illegal on STRUCTURE declarations
  24077.  
  24078.                 An illegal attribute was specified on a STRUCTURE
  24079.                 declaration.
  24080.  
  24081.  F4329          %fs : COMMON : size changed
  24082.  
  24083.                 This is a warning level message which is the same as F2323.
  24084.                 F2323 now only occurs if $STRICT (or -4Ys) is set. Otherwise,
  24085.                 the warning occurs.
  24086.  
  24087.  F4400          DATA : more constants than names
  24088.  
  24089.  Number         Compiler Recoverable Error Message
  24090. 
  24091.                 Extra constants appearing in a constant list of a DATA
  24092.                 statement were ignored.
  24093.  
  24094.  F4501          array : subscript number out of range
  24095.  
  24096.                 The /4Yb compiler option was used in compiling (or the $DEBUG
  24097.                 metacommand was in effect), and an array passed as an
  24098.                 argument had a bound out of range. (This practice is legal
  24099.                 for formal arguments because it is common in FORTRAN to
  24100.                 declare the last bound to be 1.)
  24101.  
  24102.  F4602          name : alternate RETURN statement missing
  24103.  
  24104.                 The subprogram declaration where the specified name appeared
  24105.                 had no alternate RETURN statement.
  24106.  
  24107.  F4605          name : FAR formal argument name : passed HUGE array
  24108.  
  24109.                 An array declared with a HUGE attribute was passed to a
  24110.  Number         Compiler Recoverable Error Message
  24111.                An array declared with a HUGE attribute was passed to a
  24112.                 formal argument declared with a FAR attribute.
  24113.  
  24114.  F4608          name : formal argument name : passed FAR/HUGE
  24115.  
  24116.                 A variable which was declared NEAR is being passed FAR.
  24117.  
  24118.  F4801          label number : used across blocks
  24119.  
  24120.                 An executable statement label was referenced across a
  24121.                 statement block. This situation may arise in the following
  24122.                 cases:
  24123.  
  24124.    ■  When a GOTO statement uses a statement label in a different arm of an
  24125.       IF...ELSE...ENDIF statement
  24126.  
  24127.    ■  When the program jumps into a DO loop
  24128.  
  24129.  F4802          no assigned GOTO or FMT= for ASSIGN statement
  24130.  
  24131.  Number         Compiler Recoverable Error Message
  24132. 
  24133.                 An ASSIGN statement was used to assign a label to a variable
  24134.                 in the subprogram, but the variable was not used.
  24135.  
  24136.  F4803          name : FUNCTION : return variable not set
  24137.  
  24138.                 A return variable specified in a FUNCTION statement was not
  24139.                 set at least once in the function.
  24140.  
  24141.  F4901          -4Y and -4N : both options used; -4Y assumed
  24142.  
  24143.                 The $DEBUG, $DECLARE, $LIST, $STRICT, or $TRUNCATE
  24144.                 metacommand was specified with both the /4Y and /4N compiler
  24145.                 options. For example, $DEBUG was specified using both a /4Yb
  24146.                 option and a /4Nb option.
  24147.  
  24148.  F4902          -Wnumber : illegal warning level ignored
  24149.  
  24150.                 This is an internal check. Microsoft FORTRAN supports only
  24151.                 warning levels 0 and 1.
  24152.  Number         Compiler Recoverable Error Message
  24153.                warning levels 0 and 1.
  24154.  
  24155.  F4903          -Zpnumber : illegal pack value ignored
  24156.  
  24157.                 Only the structure packing values 1, 2, and 4 are valid.
  24158.  
  24159.  F4980          integer expected in format
  24160.  
  24161.                 An edit descriptor lacked a required integer value.
  24162.  
  24163.  F4981          initial left parenthesis expected in format
  24164.  
  24165.                 A format did not start with a left parenthesis (().
  24166.  
  24167.  F4982          positive integer expected in format
  24168.  
  24169.                 An unexpected negative or 0 value was used in a format.
  24170.  
  24171.                 Negative integer values can appear only with the P edit
  24172.                 descriptor. Integer values of 0 can appear only in the d and
  24173.  Number         Compiler Recoverable Error Message
  24174.                descriptor. Integer values of 0 can appear only in the d and
  24175.                 m fields of numeric edit descriptors.
  24176.  
  24177.  F4983          repeat count on nonrepeatable descriptor
  24178.  
  24179.                 One or more BN, BZ, S, SP, SS, T, TL, TR, /, \, $, :, or
  24180.                 apostrophe (') edit descriptors had repeat counts associated
  24181.                 with them.
  24182.  
  24183.  F4984          integer expected preceding H, X, or P edit descriptor
  24184.  
  24185.                 An integer did not precede a (nonrepeatable) H, X, or P edit
  24186.                 descriptor.
  24187.  
  24188.                 The correct formats for these edit descriptors are nH, nX,
  24189.                 and kP, respectively, where n is a positive integer and k is
  24190.                 an optionally signed integer.
  24191.  
  24192.  F4985          N or Z expected after B in format
  24193.  
  24194.  Number         Compiler Recoverable Error Message
  24195. 
  24196.                 An illegal edit descriptor beginning with "B" was used.
  24197.  
  24198.                 The only valid edit descriptors beginning with "B" are BN and
  24199.                 BZ, used to specify the interpretation of blanks as nulls or
  24200.                 zeros, respectively.
  24201.  
  24202.  F4986          format nesting limit exceeded
  24203.  
  24204.                 More than 16 sets of parentheses were nested inside the main
  24205.                 level of parentheses in a format.
  24206.  
  24207.  F4987          '.' : expected in format
  24208.  
  24209.                 A period did not appear between the w and d fields of a D, E,
  24210.                 F, or G edit descriptor.
  24211.  
  24212.  F4988          unexpected end of format
  24213.  
  24214.                 An incomplete format was used.
  24215.  Number         Compiler Recoverable Error Message
  24216.                An incomplete format was used.
  24217.  
  24218.                 Improperly matched parentheses, an unfinished Hollerith (H)
  24219.                 descriptor, or another incomplete descriptor specification
  24220.                 can cause this error.
  24221.  
  24222.  F4989          'character' : unexpected character in format
  24223.  
  24224.                 A character that cannot be interpreted as a valid edit
  24225.                 descriptor was used in a format.
  24226.  
  24227.  F4990          M field exceeds W field in I edit descriptor
  24228.  
  24229.                 The length of the m field specified in an I edit descriptor
  24230.                 exceeded the length of the w field.
  24231.  
  24232.  F4997          CHARACTER*(*) in multithread-thread may not work
  24233.  
  24234.                 Character*(*) arguments and functions may not work when
  24235.                 linked with the multithread-thread FORTRAN run-time library.
  24236.  Number         Compiler Recoverable Error Message
  24237.                linked with the multithread-thread FORTRAN run-time library.
  24238.  
  24239.  F4998          name :  variable used but not defined
  24240.  
  24241.                 A variable was used in the subprogram but never given a
  24242.                 value.
  24243.  
  24244.  F4999          name : variable declared but not used
  24245.  
  24246.                 A variable was declared, but never referenced anywhere else
  24247.                 in the subprogram. (This is one of only two warnings shut off
  24248.                 by -W2.)
  24249.  
  24250.  
  24251.  D.3  Run-Time Error Messages
  24252.  
  24253.  Run-time error messages fall into two categories:
  24254.  
  24255.    1. Error messages generated by the run-time library to notify you of
  24256.       serious errors. These messages are listed and described in Section
  24257.       D.3.1.
  24258.  
  24259.    2. Floating-point exceptions generated by the 8087/80287 hardware or the
  24260.       emulator. These exceptions are listed and described in Section D.3.2,
  24261.       "Other Run-Time Error Messages."
  24262.  
  24263.  
  24264.  D.3.1  Run-Time-Library Error Messages
  24265.  
  24266.  The following messages may appear at run time when your program has serious
  24267.  errors. Run-time error-message numbers range from F6000 to F6999.
  24268.  
  24269.  A run-time error message takes the following general form:
  24270.  
  24271.       «sourcefile(line) :» run-time error F6nnn : operation«(filename)»
  24272.       - messagetext
  24273.  
  24274.  The sourcefile (line) information appears only when the $DEBUG metacommand
  24275.  is in effect.
  24276.  
  24277.  For operation, one of the following may appear: ALLOCATE, BACKSPACE,
  24278.  BEGINTHREAD, CLOSE, DEALLOCATE, ENDFILE, EOF, INQUIRE, LOCKING, OPEN, READ,
  24279.  REWIND, WRITE, or $DEBUG.
  24280.  
  24281.  The filename of the file affected by operation is shown except when
  24282.  operation is $DEBUG.
  24283.  
  24284.  The messagetext follows on the next line.
  24285.  
  24286. ╓┌─────────────┌─────────────────────────────────────────────────────────────╖
  24287.  Number         Run-Time Error Messages
  24288.  
  24289.  F6096          array subscript expression out of range
  24290.  
  24291.                 An expression used to index an array was smaller than the
  24292.                 lower dimension bound or larger than the upper dimension
  24293.                 bound. This message appears only if the /4Yb option is used
  24294.                 in compiling (or the $DEBUG metacommand is in effect).
  24295.  
  24296.  F6097          CHARACTER substring expression out of range
  24297.  
  24298.                 An expression used to index a character substring was
  24299.  Number         Run-Time Error Messages
  24300.                An expression used to index a character substring was
  24301.                 illegal. This message appears only if the /4Yb option is used
  24302.                 in compiling (or the $DEBUG metacommand is in effect).
  24303.  
  24304.  F6098          label not found in assigned GOTO list
  24305.  
  24306.                 The label assigned to the integer-variable name was not
  24307.                 specified in the label list of the assigned GOTO statement.
  24308.                 This message appears only if the /4Yb option is used in
  24309.                 compiling (or the $DEBUG metacommand is in effect).
  24310.  
  24311.  F6099          INTEGER overflow
  24312.  
  24313.                 This error occurs whenever integer arithmetic results in
  24314.                 overflow, or when assignment to an integer is out of range.
  24315.                 This message appears only if the /4Yb option is used in
  24316.                 compiling (or the $DEBUG metacommand is in effect).
  24317.  
  24318.  F6100          INTEGER overflow on input
  24319.  
  24320.  Number         Run-Time Error Messages
  24321. 
  24322.                 An INTEGER*n item exceeded the legal size limits.
  24323.  
  24324.                 An INTEGER*1 item must be in the range -127 to 127. An
  24325.                 INTEGER*2 item must be in the range -32,767 to 32,767. An
  24326.                 INTEGER*4 item must be in the range -2,147,483,647 to
  24327.                 2,147,483,647.
  24328.  
  24329.  F6101          invalid INTEGER
  24330.  
  24331.                 Either an illegal character appeared as part of an integer,
  24332.                 or a numeric character larger than the radix was used in an
  24333.                 alternate radix specifier.
  24334.  
  24335.  F6102          REAL indefinite (uninitialized or previous error)
  24336.  
  24337.                 An illegal argument was specified for an intrinsic function
  24338.                 (for example, SQRT(-1) or ASIN(2)). This error message does
  24339.                 not always appear where the mistake was originally made. It
  24340.                 may appear if the invalid value is used later in the program.
  24341.  Number         Run-Time Error Messages
  24342.                may appear if the invalid value is used later in the program.
  24343.  
  24344.  F6103          invalid REAL
  24345.  
  24346.                 An illegal character appeared as part of a real number.
  24347.  
  24348.  F6104          REAL math overflow
  24349.  
  24350.                 A real value was too large. Floating-point overflows in
  24351.                 either direct or emulated mode generate NAN (Not-A-Number)
  24352.                 exceptions, which appear in the output field as asterisks (*)
  24353.                 or the letters  NAN.
  24354.  
  24355.  F6200          formatted I/O not consistent with OPEN options
  24356.  
  24357.                 The program tried to perform formatted I/O on a unit opened
  24358.                 with FORM='UNFORMATTED' or FORM='BINARY'.
  24359.  
  24360.  F6201          list-directed I/O not consistent with OPEN options
  24361.  
  24362.  Number         Run-Time Error Messages
  24363. 
  24364.                 The program tried to perform list-directed I/O on a file that
  24365.                 was not opened with FORM='FORMATTED' and ACCESS='SEQUENTIAL'.
  24366.  
  24367.  F6202          terminal I/O not consistent with OPEN options
  24368.  
  24369.                 The ACCESS='SEQUENTIAL' option and either the
  24370.                 FORM='FORMATTED' or the FORM='BINARY' option were not
  24371.                 included in the OPEN statement for a special device name such
  24372.                 as CON, LPT1, or PRN. These options are required because
  24373.                 special device names are connected to devices that do not
  24374.                 support direct access.
  24375.  
  24376.                 When a unit is connected to a terminal device, an OPEN
  24377.                 statement that has the options FORM='FORMATTED' and
  24378.                 ACCESS='SEQUENTIAL' results in carriage control. If the
  24379.                 FORM='BINARY' and ACCESS='SEQUENTIAL' options appear in an
  24380.                 OPEN statement, binary data transfer takes place.
  24381.  
  24382.  F6203          direct I/O not consistent with OPEN options
  24383.  Number         Run-Time Error Messages
  24384. F6203          direct I/O not consistent with OPEN options
  24385.  
  24386.                 A REC= option was included in a statement that transferred
  24387.                 data to a file that was opened with the ACCESS='SEQUENTIAL'
  24388.                 option.
  24389.  
  24390.  F6204          unformatted I/O not consistent with OPEN options
  24391.  
  24392.                 If a file is opened with FORM='FORMATTED', unformatted or
  24393.                 binary data transfer is prohibited.
  24394.  
  24395.  F6205          A edit descriptor expected for CHARACTER
  24396.  
  24397.                 The A edit descriptor was not specified when a character data
  24398.                 item was read or written using formatted I/O.
  24399.  
  24400.  F6206          E, F, D, or G edit descriptor expected for REAL
  24401.  
  24402.                 The E, F, D, or G edit descriptor was not specified when a
  24403.                 real data item was read or written using formatted I/O.
  24404.  Number         Run-Time Error Messages
  24405.                real data item was read or written using formatted I/O.
  24406.  
  24407.  F6207          I edit descriptor expected for INTEGER
  24408.  
  24409.                 The I edit descriptor was not specified when an integer data
  24410.                 item was read or written using formatted I/O.
  24411.  
  24412.  F6208          L edit descriptor expected for LOGICAL
  24413.  
  24414.                 The L edit descriptor was not specified when a logical data
  24415.                 item was read or written using formatted I/O.
  24416.  
  24417.  F6209          file already open : parameter mismatch
  24418.  
  24419.                 An OPEN statement specified a connection between a unit and a
  24420.                 file name that was already in effect. In this case, only the
  24421.                 BLANK= option can have a different setting.
  24422.  
  24423.  F6210          namelist I/O not consistent with OPEN options
  24424.  
  24425.  Number         Run-Time Error Messages
  24426. 
  24427.                 The program tried to perform namelist I/O on a file that was
  24428.                 not opened with FORM='FORMATTED' and ACCESS='SEQUENTIAL'.
  24429.  
  24430.  F6300          KEEP illegal for scratch file
  24431.  
  24432.                 STATUS='KEEP' was specified for a scratch file; this is
  24433.                 illegal because scratch files are automatically deleted at
  24434.                 program termination.
  24435.  
  24436.  F6301          SCRATCH illegal for named file
  24437.  
  24438.                 STATUS='SCRATCH' should not be used in an OPEN statement that
  24439.                 includes a file name.
  24440.  
  24441.  F6302          multiple radix specifiers
  24442.  
  24443.                 More than one alternate radix for numeric I/O was specified.
  24444.  
  24445.  F6303          illegal radix specifier
  24446.  Number         Run-Time Error Messages
  24447. F6303          illegal radix specifier
  24448.  
  24449.                 A radix specifier was not between 2 and 36, inclusive.
  24450.  
  24451.  F6304          illegal STATUS value
  24452.  
  24453.                 An illegal value was used with the STATUS= option.
  24454.  
  24455.                 STATUS= accepts the following values:
  24456.  
  24457.    1. 'KEEP' or 'DELETE' when used with CLOSE statements
  24458.  
  24459.    2. 'OLD', 'NEW', 'SCRATCH', or 'UNKNOWN' when used with OPEN statements
  24460.  
  24461.  F6305          illegal MODE value
  24462.  
  24463.                 An illegal value was used with the MODE= option.
  24464.  
  24465.                 MODE= accepts the values 'READ', 'WRITE', or 'READWRITE'.
  24466.  
  24467.  Number         Run-Time Error Messages
  24468. 
  24469.  F6306          illegal ACCESS value
  24470.  
  24471.                 An illegal value was used with the ACCESS= option.
  24472.  
  24473.                 ACCESS= accepts the values 'SEQUENTIAL' and 'DIRECT'.
  24474.  
  24475.  F6307          illegal BLANK value
  24476.  
  24477.                 An illegal value was used with the BLANK= option.
  24478.  
  24479.                 BLANK= accepts the values 'NULL' and 'ZERO'.
  24480.  
  24481.  F6308          illegal FORM value
  24482.  
  24483.                 An illegal value was used with the FORM= option.
  24484.  
  24485.                 FORM= accepts the following values: 'FORMATTED',
  24486.                 'UNFORMATTED', and 'BINARY'.
  24487.  
  24488.  Number         Run-Time Error Messages
  24489. 
  24490.  F6309          illegal SHARE value
  24491.  
  24492.                 An illegal value was used with the SHARE= option.
  24493.  
  24494.                 SHARE= accepts the values 'COMPAT', 'DENYRW', 'DENYWR',
  24495.                 'DENYRD', and 'DENYNONE'.
  24496.  
  24497.  F6310          illegal LOCKMODE value
  24498.  
  24499.                 An illegal value was used with the LOCKMODE= option.
  24500.  
  24501.                 LOCKMODE= accepts the values 'LOCK', 'NBLCK', 'NBRLCK',
  24502.                 'RLCK', and 'UNLCK'.
  24503.  
  24504.  F6311          illegal record number
  24505.  
  24506.                 An invalid number was specified as the record number for a
  24507.                 direct-access file.
  24508.  
  24509.  Number         Run-Time Error Messages
  24510. 
  24511.                 The first valid record number for direct-access files is 1.
  24512.  
  24513.  F6312          no unit number associated with *
  24514.  
  24515.                 In an INQUIRE statement, the NUMBER= option was specified for
  24516.                 the file associated with * (console).
  24517.  
  24518.  F6313          illegal RECORDS value
  24519.  
  24520.                 The RECORDS= option in a LOCKING statement specified a
  24521.                 negative number.
  24522.  
  24523.  F6314          illegal unit number
  24524.  
  24525.                 An illegal unit number was specified.
  24526.  
  24527.                 Legal unit numbers can range from -32,767 to 32,767,
  24528.                 inclusive.
  24529.  
  24530.  Number         Run-Time Error Messages
  24531. 
  24532.  F6315          illegal RECL value
  24533.  
  24534.                 A negative or zero record length was specified for a direct
  24535.                 file.
  24536.  
  24537.                 The smallest valid record length for direct files is 1.
  24538.  
  24539.  F6316          array already allocated
  24540.  
  24541.                 The program attempted to reallocate an already allocated
  24542.                 array.
  24543.  
  24544.  F6317          array size zero or negative
  24545.  
  24546.                 The size specified for an array in an ALLOCATE statement must
  24547.                 be greater than zero.
  24548.  
  24549.  F6318          non-HUGE array exceeds 64K
  24550.  
  24551.  Number         Run-Time Error Messages
  24552. 
  24553.                 The memory space required for an array in an ALLOCATE
  24554.                 statement exceeds 64K, but the HUGE attribute was not
  24555.                 specified.
  24556.  
  24557.  F6319          array not allocated
  24558.  
  24559.                 The program attempted to DEALLOCATE an array that was never
  24560.                 allocated.
  24561.  
  24562.  F6400          BACKSPACE illegal on terminal device
  24563.  
  24564.                 A BACKSPACE statement specified a unit connected to a
  24565.                 terminal device such as a terminal or printer.
  24566.  
  24567.  F6401          EOF illegal on terminal device
  24568.  
  24569.                 An EOF intrinsic function specified a unit connected to a
  24570.                 terminal device such as a terminal or printer.
  24571.  
  24572.  Number         Run-Time Error Messages
  24573. 
  24574.  F6402          ENDFILE illegal on terminal device
  24575.  
  24576.                 An ENDFILE statement specified a unit connected to a terminal
  24577.                 device such as a terminal or printer.
  24578.  
  24579.  F6403          REWIND illegal on terminal device
  24580.  
  24581.                 A REWIND statement specified a unit connected to a terminal
  24582.                 device such as a terminal or printer.
  24583.  
  24584.  F6404          DELETE illegal for read-only file
  24585.  
  24586.                 A CLOSE statement specified STATUS='DELETE' for a read-only
  24587.                 file.
  24588.  
  24589.  F6405          external I/O illegal beyond end of file
  24590.  
  24591.                 The program tried to access a file after executing an ENDFILE
  24592.                 statement or after it encountered the end-of-file record
  24593.  Number         Run-Time Error Messages
  24594.                statement or after it encountered the end-of-file record
  24595.                 during a read operation.
  24596.  
  24597.                 A BACKSPACE, REWIND, or OPEN statement must be used to
  24598.                 reposition the file before execution of any I/O statement
  24599.                 that transfers data.
  24600.  
  24601.  F6406          truncation error : file closed
  24602.  
  24603.                 This is a transient error. While the file was being
  24604.                 truncated, it was temporarily closed.
  24605.  
  24606.                 After a few minutes, the file should be run again. If this
  24607.                 error message reappears, the file should be checked for
  24608.                 characteristics, such as locking or permissions, that would
  24609.                 prevent it from being accessed.
  24610.  
  24611.  F6407          terminal buffer overflow
  24612.  
  24613.                 More than 131 characters were input to a record of a unit
  24614.  Number         Run-Time Error Messages
  24615.                More than 131 characters were input to a record of a unit
  24616.                 connected to the terminal (keyboard). Note that the operating
  24617.                 system may impose additional limits on the number of
  24618.                 characters that can be input to the terminal in a single
  24619.                 record.
  24620.  
  24621.  F6408          comma delimiter disabled after left repositioning
  24622.  
  24623.                 A comma could not be used as a field delimiter. This is
  24624.                 because the use of commas as input field delimiters is
  24625.                 disabled if left tabbing leaves the file positioned in a
  24626.                 previous buffer.
  24627.  
  24628.  F6409          LOCKING illegal on sequential file
  24629.  
  24630.                 A LOCKING statement specified a unit that was not opened with
  24631.                 ACCESS='DIRECT'.
  24632.  
  24633.  F6410          file already locked or unlocked
  24634.  
  24635.  Number         Run-Time Error Messages
  24636. 
  24637.                 The program tried to lock a file that was already locked or
  24638.                 tried to unlock a file that was already unlocked.
  24639.  
  24640.  F6411          file deadlocked
  24641.  
  24642.                 A LOCKING statement that included the 'LOCK' or 'RLCK' value
  24643.                 tried to lock a file, but the file could not be locked after
  24644.                 10 attempts.
  24645.  
  24646.  F6412          SHARE not installed
  24647.  
  24648.                 The SHARE.COM or SHARE.EXE file must be installed on your
  24649.                 system before you can use the LOCKING statement, or the
  24650.                 SHARE= option in an OPEN statement.
  24651.  
  24652.  F6413          file already connected to a different unit
  24653.  
  24654.                 The program tried to connect an already connected file to a
  24655.                 new unit.
  24656.  Number         Run-Time Error Messages
  24657.                new unit.
  24658.  
  24659.                 A file can be connected to only one unit at a time.
  24660.  
  24661.  F6414          access not allowed
  24662.  
  24663.                 This error is caused by one of the following occurrences:
  24664.  
  24665.    ■  The file name specified in an OPEN statement was a directory.
  24666.  
  24667.    ■  An OPEN statement tried to open a read-only file for writing.
  24668.  
  24669.    ■  The file's sharing mode does not allow the specified operations (DOS
  24670.       Versions 3.0 and later only).
  24671.  
  24672.  F6415          file already exists
  24673.  
  24674.                 An OPEN statement specified STATUS='NEW' for a file that
  24675.                 already exists.
  24676.  
  24677.  Number         Run-Time Error Messages
  24678. 
  24679.  F6416          file not found
  24680.  
  24681.                 An OPEN statement specified STATUS='OLD' for a file that does
  24682.                 not exist.
  24683.  
  24684.  F6417          too many open files
  24685.  
  24686.                 The program exceeded the system limit on the number of open
  24687.                 files allowed at one time.
  24688.  
  24689.                 To fix this problem, change the FILES= command in the
  24690.                 CONFIG.SYS file.
  24691.  
  24692.  F6418          too many units connected
  24693.  
  24694.                 The program exceeded the limit on the number of open files
  24695.                 per program.
  24696.  
  24697.                 Close any unnecessary files. See the FILES= command in the
  24698.  Number         Run-Time Error Messages
  24699.                Close any unnecessary files. See the FILES= command in the
  24700.                 Microsoft MS-DOS User's Guide and User's Reference for more
  24701.                 information.
  24702.  
  24703.  F6419          illegal structure for unformatted file
  24704.  
  24705.                 The file was opened with FORM='UNFORMATTED' and
  24706.                 ACCESS='SEQUENTIAL', but its internal physical-record
  24707.                 structure was incorrect or inconsistent.
  24708.  
  24709.  F6420          unknown unit number
  24710.  
  24711.                 A statement such as BACKSPACE or ENDFILE specified a file
  24712.                 that had not yet been opened. (The READ and WRITE statements
  24713.                 do not cause this problem since, instead of generating this
  24714.                 error, they prompt you for a file if the file has not been
  24715.                 opened yet.)
  24716.  
  24717.  F6421          file read-only or locked against writing
  24718.  
  24719.  Number         Run-Time Error Messages
  24720. 
  24721.                 The program tried to transfer data to a file that was opened
  24722.                 in read-only mode or locked against writing.
  24723.  
  24724.  F6422          no space left on device
  24725.  
  24726.                 The program tried to transfer data to a file residing on a
  24727.                 device that was out of storage space.
  24728.  
  24729.  F6423          too many threads
  24730.  
  24731.                 The program attempted to execute more threads than the
  24732.                 FORTRAN run-time system can handle.
  24733.  
  24734.  F6424          invalid argument
  24735.  
  24736.                 The system could not begin a thread of execution because an
  24737.                 argument to the BEGINTHREAD routine is incorrect. This
  24738.                 usually occurs when the stack argument does not start on a
  24739.                 word boundary (even address), or the stack size argument is
  24740.  Number         Run-Time Error Messages
  24741.                word boundary (even address), or the stack size argument is
  24742.                 odd or zero, or the stack crosses a segment boundary.
  24743.  
  24744.  F6500          file not open for reading or file locked
  24745.  
  24746.                 The program tried to read from a file that was not opened for
  24747.                 reading or was locked.
  24748.  
  24749.  F6501          end of file encountered
  24750.  
  24751.                 The program tried to read more data than the file contains.
  24752.  
  24753.  F6502          positive integer expected in repeat field
  24754.  
  24755.                 When the r*c form is used in list-directed input, the r must
  24756.                 be a positive integer.
  24757.  
  24758.  F6503          multiple repeat field
  24759.  
  24760.                 In list-directed input of the form r*c, an extra repeat field
  24761.  Number         Run-Time Error Messages
  24762.                In list-directed input of the form r*c, an extra repeat field
  24763.                 was used. For example,
  24764.  
  24765.                       READ(*,*) I,J,K
  24766.  
  24767.                 with input  2*1*3  returns this error. The  2*1  means send
  24768.                 two values, each 1; the  *3  is an error.
  24769.  
  24770.  F6504          invalid number in  input
  24771.  
  24772.                 Some of the values in a list-directed input record were not
  24773.                 numeric. The following example would cause this error:
  24774.  
  24775.                 123abc
  24776.  
  24777.  F6505          invalid string in input
  24778.  
  24779.                 A string item was not enclosed in single quotation marks.
  24780.  
  24781.  F6506          comma missing in COMPLEX input
  24782.  Number         Run-Time Error Messages
  24783. F6506          comma missing in COMPLEX input
  24784.  
  24785.                 When using list-directed input, the real and imaginary
  24786.                 components of a complex number were not separated by a comma.
  24787.  
  24788.  F6507          T or F expected in LOGICAL read
  24789.  
  24790.                 The wrong format was used for the input field for logical
  24791.                 data.
  24792.  
  24793.                 The input field for logical data consists of optional blanks,
  24794.                 followed by an optional decimal point, followed by a T for
  24795.                 true or F for false. The T or F may be followed by additional
  24796.                 characters in the field, so that .TRUE. and .FALSE. are
  24797.                 acceptable input forms.
  24798.  
  24799.  F6508          too many bytes read from unformatted record
  24800.  
  24801.                 The program tried to read more data from an unformatted file
  24802.                 than the current record contained. If the program was reading
  24803.  Number         Run-Time Error Messages
  24804.                than the current record contained. If the program was reading
  24805.                 from an unformatted direct file, it tried to read more than
  24806.                 the fixed record length as specified by the RECL= option. If
  24807.                 the program was reading from an unformatted sequential file,
  24808.                 it tried to read more data than was written to the record.
  24809.  
  24810.  F6509          H or apostrophe edit descriptor illegal on input
  24811.  
  24812.                 Hollerith (H) or apostrophe edit descriptors were encountered
  24813.                 in a format used by a READ statement.
  24814.  
  24815.  F6510          illegal character in hexadecimal input
  24816.  
  24817.                 The input field contained a character that was not
  24818.                 hexadecimal.
  24819.  
  24820.                 Legal hexadecimal characters are 0-9 and A-F.
  24821.  
  24822.  F6511          variable name not found
  24823.  
  24824.  Number         Run-Time Error Messages
  24825. 
  24826.                 A name encountered on input from a namelist record is not
  24827.                 declared in the corresponding NAMELIST statement.
  24828.  
  24829.  F6512          invalid NAMELIST input format
  24830.  
  24831.                 The input record is not in the correct form for namelist
  24832.                 input.
  24833.  
  24834.  F6513          wrong number of array dimensions
  24835.  
  24836.                 In namelist input, an array name was qualified with a
  24837.                 different number of subscripts than its declaration, or a
  24838.                 non-array name was qualified.
  24839.  
  24840.  F6514          array subscript exceeds allocated area
  24841.  
  24842.                 A subscript was specified in namelist input which exceeded
  24843.                 the declared dimensions of the array.
  24844.  
  24845.  Number         Run-Time Error Messages
  24846. 
  24847.  F6515          invalid subrange in namelist input
  24848.  
  24849.                 A character item in namelist input was qualified with a
  24850.                 subrange that did not meet the requirement that 1 <= e1 <= e2
  24851.                 <= len (where 'len' is the length of the character item, 'e1'
  24852.                 is the leftmost position of the substring, and 'e2' is the
  24853.                 rightmost position of the substring).
  24854.  
  24855.  F6516          substring range specified on non-CHARACTER item
  24856.  
  24857.                 A non-character item in namelist input was qualified with a
  24858.                 substring range.
  24859.  
  24860.  F6600          internal file overflow
  24861.  
  24862.                 The program either overflowed an internal-file record or
  24863.                 tried to write to a record beyond the end of an internal
  24864.                 file.
  24865.  
  24866.  Number         Run-Time Error Messages
  24867. 
  24868.  F6601          direct record overflow
  24869.  
  24870.                 The program tried to write more than the number of bytes
  24871.                 specified in the RECL= option to an individual record of a
  24872.                 direct-access file.
  24873.  
  24874.  F6602          numeric field bigger than record size
  24875.  
  24876.                 The program tried to write a noncharacter item across a
  24877.                 record boundary in list-directed or namelist output. Only
  24878.                 character constants can cross record boundaries.
  24879.  
  24880.  F6700          heap space limit exceeded
  24881.  
  24882.                 The program tried to open too many files at once. A file
  24883.                 control block (FCB) must be allocated from the heap for each
  24884.                 file opened, but no more heap space was available.
  24885.  
  24886.  F6701          scratch file name limit exceeded
  24887.  Number         Run-Time Error Messages
  24888. F6701          scratch file name limit exceeded
  24889.  
  24890.                 The program exhausted the template used to generate unique
  24891.                 scratch-file names.
  24892.  
  24893.  F6980          integer expected in format
  24894.  
  24895.                 An edit descriptor lacked a required integer value.
  24896.  
  24897.  F6981          initial left parenthesis expected in format
  24898.  
  24899.                 A format did not begin with a left parenthesis (().
  24900.  
  24901.  F6982          positive integer expected in format
  24902.  
  24903.                 A zero or negative integer value was used in a format.
  24904.  
  24905.                 Negative integer values can appear only with the P edit
  24906.                 descriptor. Integer values of 0 can appear only in the d and
  24907.                 m fields of numeric edit descriptors.
  24908.  Number         Run-Time Error Messages
  24909.                m fields of numeric edit descriptors.
  24910.  
  24911.  F6983          repeat count on nonrepeatable descriptor
  24912.  
  24913.                 One or more BN, BZ, S, SS, SP, T, TL, TR, /, \, $, :, or
  24914.                 apostrophe (') edit descriptors had repeat counts associated
  24915.                 with them.
  24916.  
  24917.  F6984          integer expected preceding H, X, or P edit descriptor
  24918.  
  24919.                 An integer did not precede a (nonrepeatable) H, X, or P edit
  24920.                 descriptor.
  24921.  
  24922.                 The correct formats for these descriptors are nH, nX, and kP,
  24923.                 respectively, where n is a positive integer and k is an
  24924.                 optionally signed integer.
  24925.  
  24926.  F6985          N or Z expected after B in format
  24927.  
  24928.                 An illegal edit descriptor beginning with "B" was used.
  24929.  Number         Run-Time Error Messages
  24930.                An illegal edit descriptor beginning with "B" was used.
  24931.  
  24932.                 The only valid edit descriptors beginning with "B" are BN and
  24933.                 BZ, used to specify the interpretation of blanks as nulls or
  24934.                 zeros, respectively.
  24935.  
  24936.  F6986          format nesting limit exceeded
  24937.  
  24938.                 More than 16 sets of parentheses were nested inside the main
  24939.                 level of parentheses in a format.
  24940.  
  24941.  F6987          '.' expected in format
  24942.  
  24943.                 No period appeared between the w and d fields of a D, E, F,
  24944.                 or G edit descriptor.
  24945.  
  24946.  F6988          unexpected end of format
  24947.  
  24948.                 An incomplete format was used.
  24949.  
  24950.  Number         Run-Time Error Messages
  24951. 
  24952.                 Improperly matched parentheses, an unfinished Hollerith (H)
  24953.                 descriptor, or another incomplete descriptor specification
  24954.                 can cause this error.
  24955.  
  24956.  F6989          unexpected character in format
  24957.  
  24958.                 A character that cannot be interpreted as part of a valid
  24959.                 edit descriptor was used in a format.
  24960.  
  24961.  F6990          M field exceeds W field in I edit descriptor
  24962.  
  24963.                 The value of the m field specified in an I edit descriptor
  24964.                 exceeded the value of the w field.
  24965.  
  24966.  F6991          integer out of range in format
  24967.  
  24968.                 An integer value specified in an edit descriptor was too
  24969.                 large to represent as a 4-byte integer.
  24970.  
  24971.  Number         Run-Time Error Messages
  24972. 
  24973.  F6992          format not set by ASSIGN
  24974.  
  24975.                 The format specifier in a READ, WRITE, or PRINT statement was
  24976.                 an integer variable, but an ASSIGN statement did not properly
  24977.                 assign it the statement label of a FORMAT statement in the
  24978.                 same program unit.
  24979.  
  24980.  
  24981.  D.3.2  Other Run-Time Error Messages
  24982.  
  24983.  The following sections describe math run-time errors and general run-time
  24984.  errors. Math run-time errors are divided into low-level and function-level
  24985.  math errors.
  24986.  
  24987.  
  24988.  Low-Level Math Errors
  24989.  
  24990.  The error messages listed below correspond to exceptions generated by the
  24991.  8087/80287 hardware. Refer to the Intel documentation for your processor for
  24992.  a detailed discussion of hardware exceptions. These errors may also be
  24993.  detected by the floating-point emulator or alternate math library.
  24994.  
  24995.  Using FORTRAN's default 8087/80287 control-word settings, the following
  24996.  exceptions are masked and do not occur:
  24997.  
  24998.  Exception                                  Default Masked Action
  24999.  
  25000.  Denormal                                   Exception masked
  25001.  
  25002.  Underflow                                  Result goes to 0.0
  25003.  
  25004.  Inexact                                    Exception masked
  25005.  
  25006.  See Chapter 1, "Controlling Floating-Point Operations," in Microsoft FORTRAN
  25007.  Advanced Topics for information on how to change the floating-point control
  25008.  word.
  25009.  
  25010.  The following errors do not occur with code generated by the Microsoft
  25011.  FORTRAN Compiler or code provided in the standard Microsoft FORTRAN
  25012.  libraries:
  25013.  
  25014.       square root
  25015.       stack underflow
  25016.       unemulated
  25017.  
  25018.  The low-level math error messages, listed below, have the following format:
  25019.  
  25020.       «sourcefile(line) : » run-time error M61xx: MATH
  25021.       - floating-point error: messagetext
  25022.  
  25023.  The sourcefile and line where the error occurred appear only if the /4Yb
  25024.  option is used in compiling (or the $DEBUG metacommand is in effect).
  25025.  
  25026. ╓┌─────────────┌─────────────────────────────────────────────────────────────╖
  25027.  Number         Low-Level Math Errors
  25028.  
  25029.  M6101          invalid
  25030.  
  25031.                 An invalid operation occurred. This usually involves
  25032.                 operating on NANs or infinities. This error terminates the
  25033.                 program with exit code 129.
  25034.  Number         Low-Level Math Errors
  25035.                program with exit code 129.
  25036.  
  25037.  M6102          denormal
  25038.  
  25039.                 A very small floating-point number was generated, which may
  25040.                 no longer be valid due to loss of significance. Denormals are
  25041.                 normally masked, causing them to be trapped and operated
  25042.                 upon. This error terminates the program with exit code 130.
  25043.  
  25044.  M6103          divide by 0
  25045.  
  25046.                 An attempt was made to divide by zero. This error terminates
  25047.                 the program with exit code 131.
  25048.  
  25049.  M6104          overflow
  25050.  
  25051.                 An overflow occurred in a floating-point operation. This
  25052.                 error terminates the program with exit code 132.
  25053.  
  25054.  M6105          underflow
  25055.  Number         Low-Level Math Errors
  25056. M6105          underflow
  25057.  
  25058.                 An underflow occurred in a floating-point operation. (An
  25059.                 underflow is normally masked so that the underflowing value
  25060.                 is replaced with 0.0.) This error terminates the program with
  25061.                 exit code 133.
  25062.  
  25063.  M6106          inexact
  25064.  
  25065.                 Loss of precision occurred in a floating-point operation.
  25066.                 This exception is normally masked, since almost any
  25067.                 floating-point operation can cause loss of precision. This
  25068.                 error terminates the program with exit code 134.
  25069.  
  25070.  M6107          unemulated
  25071.  
  25072.                 An attempt was made to execute an 8087/80287 instruction that
  25073.                 is invalid or is not supported by the emulator. This error
  25074.                 terminates the program with exit code 135.
  25075.  
  25076.  Number         Low-Level Math Errors
  25077. 
  25078.  M6108          square root
  25079.  
  25080.                 The operand in a square-root operation was negative. The
  25081.                 FORTRAN intrinsic function SQRT does not generate this
  25082.                 message; instead, SQRT gives a function-level  DOMAIN  error.
  25083.                 This error terminates the program with exit code 136 (see
  25084.                 error message M6201 below).
  25085.  
  25086.  M6110          stack overflow
  25087.  
  25088.                 A floating-point expression caused a stack overflow on the
  25089.                 8087/80287 or emulator. Stack-overflow exceptions are trapped
  25090.                 up to seven additional levels beyond the eight levels
  25091.                 normally supported by the 8087/80287 processor. This error
  25092.                 terminates the program with exit code 138.
  25093.  
  25094.  M6111          stack underflow
  25095.  
  25096.                 A floating-point operation resulted in a stack underflow on
  25097.  Number         Low-Level Math Errors
  25098.                A floating-point operation resulted in a stack underflow on
  25099.                 the 8087/80287 or emulator. This error terminates the program
  25100.                 with exit code 139.
  25101.  
  25102.  
  25103.  Function-Level Math Errors
  25104.  
  25105.  The function-level math error messages, listed below, appear when there are
  25106.  errors in the use of intrinsic functions. The error messages have the
  25107.  following format:
  25108.  
  25109.       «sourcefile(line): » run-time error M62xx: MATH
  25110.       -  functionname: messagetext
  25111.  
  25112.  The sourcefile and the line where the error occurred appear only if the /4Yb
  25113.  compiler option is used (or the $DEBUG metacommand is in effect).
  25114.  
  25115. ╓┌─────────────┌─────────────────────────────────────────────────────────────╖
  25116.  Number         Function-Level Math Errors
  25117.  
  25118.  Number         Function-Level Math Errors
  25119.  
  25120.  M6201          functionname : DOMAIN error
  25121.  
  25122.                 An argument to the given function was outside the domain of
  25123.                 that function (that is, outside the legal set of input values
  25124.                 for the function), as in the following examples:
  25125.  
  25126.                 SQRT(-1.0)
  25127.                 ACOS(-5.0)
  25128.  
  25129.  M6202          functionname : SING error
  25130.  
  25131.                 This error refers to argument singularity. The given function
  25132.                 was not properly defined for the value of its actual
  25133.                 argument, although it may have been defined at nearby points,
  25134.                 as in the following examples:
  25135.  
  25136.                 LOG10(0.0)
  25137.  
  25138.                 (0.0)**(-3.0)
  25139.  Number         Function-Level Math Errors
  25140.                (0.0)**(-3.0)
  25141.  
  25142.  M6203          functionname : OVERFLOW error
  25143.  
  25144.                 The result of the given function or one of its intermediate
  25145.                 computations was too large to be represented, as in the
  25146.                 following example:
  25147.  
  25148.                 EXP(25000.0)
  25149.  
  25150.  M6204          functionname : UNDERFLOW error
  25151.  
  25152.                 The result of the given function or one of its intermediate
  25153.                 computations was too small to be represented. (This error is
  25154.                 not currently supported; instead, the underflowing value goes
  25155.                 to 0.0.)
  25156.  
  25157.  M6205          functionname : TLOSS error
  25158.  
  25159.                 A total loss of significance (precision) occurred, as in the
  25160.  Number         Function-Level Math Errors
  25161.                A total loss of significance (precision) occurred, as in the
  25162.                 following example:
  25163.  
  25164.                 COS(1.0E30)
  25165.  
  25166.  M6206          functionname : PLOSS error
  25167.  
  25168.                 A partial loss of significance (precision) occurred. (This
  25169.                 error is not currently supported; instead, the
  25170.                 less-significant value is propagated to other computations or
  25171.                 returned as the result.)
  25172.  
  25173.  
  25174.  General Run-Time Error Messages
  25175.  
  25176.  The following messages indicate general problems that may occur during
  25177.  program start-up, termination, or execution. These error messages have the
  25178.  following format:
  25179.  
  25180.       «sourcefile(line): » run-time error R6xxx
  25181.       - messagetext
  25182.  
  25183.  The sourcefile and the line where the error occurred appear only if the /4Yb
  25184.  compiler option is used to compile the program (or the $DEBUG metacommand is
  25185.  in effect). This additional information is not available for  R6002,  R6004,
  25186.  R6008,  and  R6009, which appear at start-up time.
  25187.  
  25188. ╓┌─────────────┌─────────────────────────────────────────────────────────────╖
  25189.  Number         General Run-Time Error Messages
  25190.  
  25191.  R6000          stack overflow
  25192.  
  25193.                 Your program ran out of stack space. This can occur when a
  25194.                 program uses a large amount of space for local data or
  25195.                 temporary files or uses subprogram calls that are nested too
  25196.                 deeply. The program is terminated with exit code 255.
  25197.  
  25198.                 To correct, relink using the linker /STACK option to allocate
  25199.                 a large stack, or relink using the compiler option /Fhexnum.
  25200.                 You can also compile your program with the /Ge compiler
  25201.                 option to check for stack-overflow errors and modify the
  25202.  Number         General Run-Time Error Messages
  25203.                option to check for stack-overflow errors and modify the
  25204.                 stack information in the executable-file header by using the
  25205.                 EXEMOD program.
  25206.  
  25207.  R6001          null pointer assignment
  25208.  
  25209.                 The contents of the NULL segment changed in the course of
  25210.                 program execution. The NULL segment is a special low-memory
  25211.                 location (starting at offset 0 in DGROUP) that is not
  25212.                 normally used. If the contents of the NULL segment change
  25213.                 during a program's execution, it means that the program has
  25214.                 written to this area, usually by an inadvertent assignment
  25215.                 through a null pointer (a memory address whose offset is 0 in
  25216.                 the default data segment). Note that your program can contain
  25217.                 null pointers without generating this message; the message
  25218.                 appears only when you access a memory location through the
  25219.                 null pointer.
  25220.  
  25221.                 This error does not cause your program to terminate; the
  25222.                 error message is printed following the normal termination of
  25223.  Number         General Run-Time Error Messages
  25224.                error message is printed following the normal termination of
  25225.                 the program. This error yields a nonzero exit code.
  25226.  
  25227.                 This message reflects a potentially serious error in your
  25228.                 program. Although a program that produces this error may
  25229.                 appear to operate correctly, it is likely to cause problems
  25230.                 in the future and may fail to run in a different operating
  25231.                 environment.
  25232.  
  25233.  R6002          floating point not loaded
  25234.  
  25235.                 This error occurs when inadequate floating-point support has
  25236.                 been loaded. The program terminates with exit code 255. Three
  25237.                 situations can cause this error:
  25238.  
  25239.    1. The program was compiled or linked with an option (such as /FPi87) that
  25240.       required an 8087 or 80287 coprocessor, but the program was run on a
  25241.       machine that did not have a coprocessor installed.
  25242.  
  25243.       To fix this problem, recompile the program with the /FPi option, relink
  25244.  Number         General Run-Time Error Messages
  25245.      To fix this problem, recompile the program with the /FPi option, relink
  25246.       with an emulator library (LLIBFORE.LIB or MLIBFORE.LIB), or install a
  25247.       coprocessor. (See Chapter 1, "Controlling Floating-Point Operations,"
  25248.       in Microsoft FORTRAN Advanced Topics for more information about these
  25249.       options and libraries.)
  25250.  
  25251.    2. In a mixed-language program module that uses the C scanf or printf
  25252.       functions or their variants, a call to one of these functions included
  25253.       a floating-point format specification (such as f), but no
  25254.       floating-point values or variables appeared within the same C module.
  25255.       (The C compiler uses the presence of floating-point values and
  25256.       variables to determine whether or not to load floating-point conversion
  25257.       support.)
  25258.  
  25259.       To fix this problem, use a floating-point argument to correspond to the
  25260.       floating-point format specification in the scanf or printf call.
  25261.  
  25262.    3. In a mixed-language program that uses both C and FORTRAN modules, a C
  25263.       library (LLIBC.LIB or MLIBC.LIB) was specified before a FORTRAN library
  25264.       (LLIBFORx.LIB or MLIBFORx.LIB) in the linking stage.
  25265.  Number         General Run-Time Error Messages
  25266.      (LLIBFORx.LIB or MLIBFORx.LIB) in the linking stage.
  25267.  
  25268.       To fix this problem, relink and specify the libraries in reverse order:
  25269.       the FORTRAN library followed by the C library. (See Chapter 4,
  25270.       "Mixed-Language Programming," in Microsoft FORTRAN Advanced Topics for
  25271.       more information.)
  25272.  
  25273.  R6003          integer divide by 0
  25274.  
  25275.                 An attempt was made to divide an integer by 0, giving an
  25276.                 undefined result. Raising an integer 0 to a negative integer
  25277.                 power may also cause this error. This error terminates the
  25278.                 program with exit code 255.
  25279.  
  25280.  R6008          not enough space for arguments
  25281.  
  25282.                 At start-up time, there was enough memory to load the
  25283.                 program, but not enough room for the command-line arguments.
  25284.  
  25285.  R6009          not enough space for environment
  25286.  Number         General Run-Time Error Messages
  25287. R6009          not enough space for environment
  25288.  
  25289.  
  25290.  
  25291.  Glossary
  25292.  
  25293.  ───────────────────────────────────────────────────────────────────────────
  25294.  
  25295.  The definitions in this glossary are intended primarily for use with this
  25296.  manual and Microsoft FORTRAN Advanced Topics.
  25297.  
  25298.  8087, 80287, and 80387 coprocessors
  25299.    Intel(R) hardware products that provide very fast and precise number
  25300.    processing.
  25301.  
  25302.  Active page
  25303.    The area of memory that graphics instructions currently write to. This may
  25304.    or may not be the visual page.
  25305.  
  25306.  Actual argument
  25307.    The specific item (such as a variable, array, or expression) passed to a
  25308.    subroutine or function at a specific calling location.
  25309.  
  25310.  Alphanumeric
  25311.    A letter or a number.
  25312.  
  25313.  Argument
  25314.    A value passed to and from functions and subroutines.
  25315.  
  25316.  Array declarator
  25317.    The specifier array(«lower:»upper).
  25318.  
  25319.  Associated
  25320.    Referring to the same memory location.
  25321.  
  25322.  Attribute
  25323.    A keyword that specifies additional information about a variable, variable
  25324.    type, subprogram, or subprogram formal argument.
  25325.  
  25326.  Base name
  25327.    The portion of the file name that precedes the file-name extension. For
  25328.    example, samp  is the base name of the file  samp.for.
  25329.  
  25330.  Binary
  25331.    Base-2 notation.
  25332.  
  25333.  C string
  25334.    A character constant followed by the character C. The character constant
  25335.    is then interpreted as a C-language constant.
  25336.  
  25337.  Column-major order
  25338.    The order in which array elements are stored; the leftmost subscript is
  25339.    incremented first when the array is mapped into contiguous memory
  25340.    addresses.
  25341.  
  25342.  Compiland
  25343.    A file containing ASCII text to be compiled by the Microsoft FORTRAN
  25344.    Compiler. A compiland is also called a source file or program file.
  25345.  
  25346.  Compile time
  25347.    The time during which the compiler is executing, compiling a Microsoft
  25348.    FORTRAN source file, and creating a relocatable object file.
  25349.  
  25350.  Compiler
  25351.    A program that translates FORTRAN programs into code understood by the
  25352.    computer.
  25353.  
  25354.  Complex number
  25355.    A number with a real and an imaginary part.
  25356.  
  25357.  Constant folding
  25358.    The process of evaluating expressions that contain only constants, and
  25359.    then substituting the calculated constant for the expression. Constant
  25360.    folding is performed by the compiler during optimization. The expression
  25361.    9*3.1, for example, becomes  27.9.
  25362.  
  25363.  Dimension declarator
  25364.    The specifier «lower:»upper; an array has as many dimensions as it has
  25365.    dimension declarators. The number upper - lower + 1 is the size of a
  25366.    dimension.
  25367.  
  25368.  Domain
  25369.    The range of a function's valid input values. For example, in the
  25370.    expression  y = f(x), the domain of the function  f(x)  is the set of all
  25371.    values of  x  for which  f(x)  is defined. A DOMAIN error message is
  25372.    returned when an argument to a function is outside the domain of the
  25373.    function.
  25374.  
  25375.  Double-precision real number
  25376.    A real number that is allocated eight bytes of memory.
  25377.  
  25378.  Executable program
  25379.    A file containing executable program code. Such files usually end with the
  25380.    .EXE extension. When the name of the file is entered at the system prompt,
  25381.    the instructions in the program are performed.
  25382.  
  25383.  External
  25384.    In FORTRAN, user-defined subroutines and functions are said to be external
  25385.    (as opposed to the intrinsic procedures that are part of the language).
  25386.    The compiler assumes all references to non-intrinsic procedures are
  25387.    external, and will be satisfied during linkage.
  25388.  
  25389.  External reference
  25390.    A variable or routine in a given module that is referred to by a routine
  25391.    in another module.
  25392.  
  25393.  Far call
  25394.    An address that specifies the segment as well as the offset.
  25395.  
  25396.  FL
  25397.    A command used by Microsoft FORTRAN to compile and link programs.
  25398.  
  25399.  Formal argument
  25400.    The name by which a specific argument is known within a function or
  25401.    subroutine.
  25402.  
  25403.  Hexadecimal
  25404.    Base-16 notation.
  25405.  
  25406.  High-order bit
  25407.    The highest-numbered bit; the bit farthest to the left. It is also called
  25408.    the most-significant bit.
  25409.  
  25410.  Huge model
  25411.    A memory model that allows for more than one segment of code and more than
  25412.    one segment of data, and that allows individual data items to span more
  25413.    than one segment.
  25414.  
  25415.  IEEE
  25416.    Institute of Electrical and Electronics Engineers, Inc.
  25417.  
  25418.  Implicit open
  25419.    The file opening performed by a read or write operation when the file was
  25420.    not explicitly opened by an OPEN statement.
  25421.  
  25422.  In-line code
  25423.    Code that is in the main program, as opposed to code that is in a
  25424.    subroutine called by the main program. Using in-line code is faster, but
  25425.    it makes programs larger.
  25426.  
  25427.  Input/output list (I/O)
  25428.    A list of items to input or output. PRINT, READ, or WRITE statements can
  25429.    specify an I/O list.
  25430.  
  25431.  Intrinsic
  25432.    A subroutine or function that is part of the FORTRAN language. The
  25433.    compiler knows which procedures are intrinsic, and assumes their
  25434.    references will be linked with code from the FORTRAN libraries.
  25435.  
  25436.  Keyword
  25437.    A word with a special, predefined meaning for the compiler.
  25438.  
  25439.  Large model
  25440.    A memory model that allows for more than one segment of code and more than
  25441.    one segment of data.
  25442.  
  25443.  Large-model compiler
  25444.    A compiler that assumes a program has more than one segment of code and
  25445.    more than one segment of data.
  25446.  
  25447.  Least-significant byte
  25448.    The lowest-numbered byte; the first byte. It is also called the low-order
  25449.    byte.
  25450.  
  25451.  Library
  25452.    A file that stores modules of compiled code. These modules are used by the
  25453.    linker to create executable program files.
  25454.  
  25455.  Link time
  25456.    The time during which the linker is executing, that is, linking
  25457.    relocatable object files and library files.
  25458.  
  25459.  Linking
  25460.    The process by which the linker loads modules into memory, computes
  25461.    addresses for routines and variables in relocatable modules, and then
  25462.    resolves all external references by searching the run-time library. After
  25463.    loading and linking, the linker saves the modules it has loaded into
  25464.    memory as a single executable file.
  25465.  
  25466.  Long call
  25467.    An address that specifies the segment as well as the offset. It is also
  25468.    referred to as the long address.
  25469.  
  25470.  Low-order bit
  25471.    The lowest-numbered bit; the bit farthest to the right. It is also called
  25472.    the least-significant bit.
  25473.  
  25474.  Machine code
  25475.    Instructions that a microprocessor can execute.
  25476.  
  25477.  Mantissa
  25478.    The decimal part of a base-10 logarithm.
  25479.  
  25480.  Map
  25481.    An area of memory in which one or more variables are contiguous.
  25482.  
  25483.  Medium model
  25484.    A memory model that allows for more than one segment of code and only one
  25485.    segment of data.
  25486.  
  25487.  Memory map
  25488.    A representation of where in memory the compiler expects to find certain
  25489.    types of information.
  25490.  
  25491.  Most-significant byte
  25492.    The highest-numbered byte; the last byte. It is also called the high-order
  25493.    byte.
  25494.  
  25495.  NAN
  25496.    An abbreviation that stands for "Not A Number." NANs are generated when
  25497.    the result of an operation cannot be represented in the IEEE format. For
  25498.    example, if you try to add two positive numbers whose sum is larger than
  25499.    the maximum value permitted by the compiler, the processor will return a
  25500.    NAN instead of the sum.
  25501.  
  25502.  Near call
  25503.    A call to a routine in the same segment. The address of the called routine
  25504.    is specified with an offset.
  25505.  
  25506.  Object file
  25507.    A file that contains relocatable machine code.
  25508.  
  25509.  Offset
  25510.    The number of bytes from the beginning of a segment to a particular byte
  25511.    in that segment.
  25512.  
  25513.  Optimize
  25514.    To reduce the size of the executable file by eliminating unnecessary
  25515.    instructions or to increase the execution speed by using more efficient
  25516.    algorithms.
  25517.  
  25518.  Pass
  25519.    To transfer data between subroutines, functions, subprograms, and the main
  25520.    program. Data passes either by reference or by value. Individual readings
  25521.    of source code made by the compiler as it processes information. Each
  25522.    reading is called a pass.
  25523.  
  25524.  PLOSS
  25525.    Appears in an error message when the error caused a partial loss of
  25526.    accuracy in the significant digits of the result. For example, a PLOSS
  25527.    error on a single-precision result indicates that less than six decimal
  25528.    digits of the result are reliable.
  25529.  
  25530.  Principal value
  25531.    The angular representation of a complex number that falls between -112 and
  25532.    +112 radians.
  25533.  
  25534.  Program unit
  25535.    A main program, a subroutine, a function, or a block-data subprogram.
  25536.  
  25537.  Record
  25538.    A variable with a structure data type
  25539.  
  25540.  Relocatable
  25541.    Not containing absolute addresses.
  25542.  
  25543.  Row-major order
  25544.    The order in which array elements are stored: the rightmost subscript is
  25545.    incremented first when the array is mapped into contiguous memory
  25546.    addresses.
  25547.  
  25548.  Run time
  25549.    The time during which an executable file is running.
  25550.  
  25551.  Run-time library
  25552.    A file containing the routines needed to implement certain functions of
  25553.    the Microsoft FORTRAN language. A library module usually corresponds to a
  25554.    feature or subfeature of the Microsoft FORTRAN language.
  25555.  
  25556.  Scratch file
  25557.    A file created to hold temporary data, then discarded.
  25558.  
  25559.  Segment
  25560.    An area of memory, less than or equal to 64K long, containing program code
  25561.    or data.
  25562.  
  25563.  Short call
  25564.    A call to a routine in the same segment. The address of the called routine
  25565.    is specified with only an offset. It is also referred to as the short
  25566.    address.
  25567.  
  25568.  Sign extended
  25569.    The sign bit of a number is propagated through all the higher-order bits.
  25570.    In this way, the sign is preserved when the number is written into a
  25571.    larger format.
  25572.  
  25573.  Single-precision real number
  25574.    A real number that is allocated 4 bytes of memory.
  25575.  
  25576.  Source file
  25577.    A file containing the original ASCII text of a Microsoft FORTRAN program.
  25578.  
  25579.  Stack
  25580.    A dynamically shrinking and expanding area of memory in which data items
  25581.    are stored in consecutive order and removed on a last-in, first-out basis.
  25582.  
  25583.  String
  25584.    A character constant.
  25585.  
  25586.  Structure
  25587.    A data type compounded of other data types.
  25588.  
  25589.  Terminal I/O
  25590.    Any I/O done to a terminal device. Examples of a terminal device are the
  25591.    console, keyboard, and printer.
  25592.  
  25593.  TLOSS
  25594.    Appears in an error message when the error caused a total loss of accuracy
  25595.    in the significant digits of the result. For example, a TLOSS error on a
  25596.    single-precision result indicates that none of the six significant digits
  25597.    of the result are reliable.
  25598.  
  25599.  Truncate
  25600.    To convert a real number to an integer by discarding the fractional part;
  25601.    no rounding occurs.
  25602.  
  25603.  Two's complement
  25604.    A type of base-2 notation in which 1s and 0s are reversed (complemented),
  25605.    and 1 is added to the result.
  25606.  
  25607.  Type coercion
  25608.    The forcing of a variable to have a particular data type. For example,
  25609.    when integer values are used in expressions, if one operand of an
  25610.    expression containing the operators plus (+), minus (-), or multiplication
  25611.    (*) is of type REAL, the other operand is converted to a real number
  25612.    before the operation is performed.
  25613.  
  25614.  Undefined variable
  25615.    A variable that cannot be found, either in the routine being linked or,
  25616.    for an external reference, in a routine in another module.
  25617.  
  25618.  Union
  25619.    An overlaying of two or more maps; the variables in each map share the
  25620.    same memory locations.
  25621.  
  25622.  Unresolved reference
  25623.    A reference to a variable or a subprogram that cannot be found, either in
  25624.    the routine being linked or, for an external reference, in a routine in
  25625.    another module.
  25626.  
  25627.  Visual page
  25628.    The area of memory whose contents currently form the graphics display.
  25629.  
  25630.  
  25631.  Index
  25632.  
  25633.  Symbols
  25634.  ───────────────────────────────────────────────────────────────────────────
  25635.  
  25636.  $ (dollar sign), in user-defined names
  25637.  ' (single right quotation mark)
  25638.  (:) colon
  25639.  * (asterisk)
  25640.     alternate return
  25641.     formal argument
  25642.     multiplication operator
  25643.     unit specifier
  25644.        inquiring
  25645.        opening
  25646.        writing to
  25647.     upper dimension bound
  25648.  ** (asterisks), exponentiation operator
  25649.  + (plus sign)
  25650.     addition operator
  25651.     carriage-control character
  25652.  , (comma)
  25653.     edit list
  25654.     field delimiter
  25655.  ... (dots)
  25656.  / (forward slash), FL option character
  25657.  / (forward slash), division operator
  25658.  //(concatenation operator)
  25659.  { } (braces)
  25660.  | (bar)
  25661.  [ ] (brackets)
  25662.  \ (backslash)
  25663.     see also Backslash (\) editing
  25664.     character
  25665.     edit descriptor
  25666.     editing
  25667.  _ (underscore)
  25668.     FORTRAN 4.0 names, used in
  25669.     names using C attribute
  25670.  __ (double underscore),names
  25671.     in
  25672.  _main
  25673.  ` (single left quotation mark)
  25674.  
  25675.  1, carriage-control character
  25676.  16-bit arithmetic
  25677.     $DEBUG
  25678.     INT2
  25679.  2-byte arithmetic, see 16-bit arithmetic
  25680.  32-bit arithmetic
  25681.     $DEBUG
  25682.     INT4
  25683.  4-byte arithmetic, see 32-bit arithmetic
  25684.  /4I2 and /4I4 options (FL)
  25685.  /4Y6 and /4N6 options (FL)
  25686.  /4Yd and /4Nd options (FL)
  25687.  /4Yf and /4Nf options (FL)
  25688.  /4Yt and /4Nt options (FL)
  25689.  5 (unit specifier)
  25690.  6 (unit specifier)
  25691.  80186/80188 processor
  25692.  80286 processor
  25693.  8087/80287 coprocessor, defined
  25694.  
  25695.  A
  25696.  ───────────────────────────────────────────────────────────────────────────
  25697.  A editing
  25698.  Abbreviations, in intrinsic function tables
  25699.  ABS intrinsic function
  25700.  Absolute value
  25701.  Access
  25702.     described
  25703.     direct
  25704.     files, when networking
  25705.     internal file
  25706.     sequential
  25707.  ACCESS= option
  25708.  ACOS
  25709.  Action, metacommand heading
  25710.  Addresses
  25711.     common blocks
  25712.     even
  25713.     intrinsic function
  25714.     long
  25715.     odd
  25716.     offset
  25717.     segmented
  25718.     short
  25719.  Adjustable-size array
  25720.     defined
  25721.     passing by value
  25722.  /AH option (FL)
  25723.  Agreement, see Checking arguments
  25724.  AIMAG
  25725.  AINT
  25726.  /AL option (FL)
  25727.  Algorithms
  25728.     AIMAG
  25729.     AMOD
  25730.     ANINT
  25731.     CONJG
  25732.     DDIM
  25733.     DIM
  25734.     DMOD
  25735.     DNINT
  25736.     IDIM
  25737.     IDNINT
  25738.     MOD
  25739.     NINT
  25740.  ALIAS
  25741.  ALOG
  25742.  ALOG10
  25743.  Alphabetic characters
  25744.     character set
  25745.     names
  25746.  Alphanumeric
  25747.     characters, names
  25748.     defined
  25749.  Alternate return
  25750.     actual argument
  25751.     described
  25752.     formal argument
  25753.     function
  25754.     specifier
  25755.  /AM option (FL)
  25756.  AMAX0
  25757.  AMAX1
  25758.  American Standard Code for Information Interchange, see ASCII
  25759.  AMIN0
  25760.  AMIN1
  25761.  AMOD
  25762.  .AND. operator
  25763.  Angle, in trigonometric intrinsic function
  25764.  ANINT
  25765.  ANSI standard
  25766.     extensions
  25767.     identified
  25768.     $STRICT
  25769.     variables, size
  25770.  Apostrophe (')
  25771.     character string
  25772.     described
  25773.     editing
  25774.  Arc cosine intrinsic function
  25775.  Arc sine intrinsic function
  25776.  Arc tangent intrinsic function
  25777.  Arguments
  25778.     actual
  25779.        alternate-return specifier
  25780.        array
  25781.        array element
  25782.        associated
  25783.        corresponding formal argument
  25784.        default data segment
  25785.        defined
  25786.        EXTERNAL
  25787.        expression
  25788.        FAR
  25789.        function
  25790.        INTRINSIC
  25791.        multiple segments
  25792.        NEAR
  25793.        number
  25794.        subroutine
  25795.        usage
  25796.        variable
  25797.     agreement of data types
  25798.     CHAR
  25799.     checking
  25800.        integers
  25801.        INTERFACE, use of
  25802.        logical
  25803.        subroutine
  25804.     data type, subroutine
  25805.     data-type conversion
  25806.     defined
  25807.     different number of formal and actual
  25808.     FL options
  25809.     formal
  25810.        alternate return
  25811.        array
  25812.        assigning a value
  25813.        associated
  25814.        asterisk (*)
  25815.        C attribute
  25816.        corresponding actual argument (list)
  25817.        defined
  25818.        different number than actual arguments
  25819.        EXTERN
  25820.        EXTERNAL
  25821.        FAR
  25822.        function
  25823.        HUGE
  25824.        intrinsic function
  25825.        $LARGE
  25826.        number
  25827.        subroutine
  25828.        usage
  25829.        variable
  25830.     function
  25831.     ICHAR
  25832.     integer
  25833.        checking
  25834.        passing
  25835.     intrinsic function
  25836.        data type
  25837.        described
  25838.        LEN
  25839.        logarithm
  25840.        out of range
  25841.        square root
  25842.        undefined
  25843.     listing options (FL)
  25844.     name
  25845.     number
  25846.     spanning more than one segment
  25847.     statement function
  25848.     usage
  25849.     value, data-type conversion
  25850.  Arithmetic IF, described
  25851.  Arithmetic assignment statement, described
  25852.  Arithmetic expressions
  25853.  Arithmetic operand
  25854.     data-type conversion
  25855.     list
  25856.     rank
  25857.     type conversion
  25858.  Arithmetic shift intrinsic function
  25859.  Arithmetic
  25860.     16-bit (short)
  25861.        $DEBUG
  25862.        INT2
  25863.     32-bit (long)
  25864.        $DEBUG
  25865.        INT4
  25866.     high-precision, $DEBUG
  25867.     speed
  25868.     testing
  25869.  IArray bounds
  25870.  Array declarator
  25871.  Array element
  25872.     actual argument
  25873.     character
  25874.     expression, used in
  25875.     local
  25876.     referencing
  25877.     storage order
  25878.     syntax
  25879.     undefined
  25880.  Arrays
  25881.     actual argument
  25882.     adjustable size
  25883.     assumed size
  25884.     character
  25885.     default data type
  25886.     described
  25887.     DIMENSION statement
  25888.     dimensions
  25889.     EQUIVALENCE statement
  25890.     formal argument
  25891.     HUGE
  25892.     $LARGE
  25893.     names
  25894.     number of dimensions
  25895.     passing by value
  25896.     size
  25897.     storage order
  25898.  ASCII
  25899.     character set
  25900.     character values
  25901.     characters, representing
  25902.     collating sequence
  25903.        character set
  25904.        data-type conversion
  25905.        intrinsic functions
  25906.     values, input/output
  25907.  ASIN
  25908.  Assembly language
  25909.     accessing
  25910.     performance
  25911.  Assembly-listing files
  25912.     creating
  25913.     extensions
  25914.     format
  25915.  ASSIGN
  25916.     description
  25917.     format specifiers
  25918.     INTEGER*1 variables
  25919.  Assigned GOTO
  25920.  Assignment compatibility, statement functions
  25921.  Assignment statements
  25922.  Assignment, checking range
  25923.  Associated, defined
  25924.  Association
  25925.     address
  25926.     arguments, actual and formal
  25927.     common block
  25928.  Associativity, see Precedence
  25929.  Assumed-size array
  25930.     defined
  25931.     passing by value
  25932.  Asterisk (*)
  25933.     alternate return
  25934.     formal argument
  25935.     format specifier
  25936.     length specifier
  25937.     multiplication operator
  25938.     output
  25939.     unit specifier
  25940.        closing
  25941.        described
  25942.        inquiring
  25943.        opening
  25944.        writing to
  25945.     upper dimension bound
  25946.  Asterisks (**), exponentiation operator
  25947.  ATAN
  25948.  ATAN2
  25949.  Attributes
  25950.     ALIAS
  25951.     C
  25952.     defined
  25953.     described
  25954.     EXTERN
  25955.     FAR
  25956.     HUGE
  25957.     interface, used in
  25958.     NEAR
  25959.     PASCAL
  25960.     REFERENCE
  25961.     syntax
  25962.     (table)
  25963.     VALUE
  25964.     VARYING
  25965.  AUX
  25966.  
  25967.  B
  25968.  ───────────────────────────────────────────────────────────────────────────
  25969.  Backslash (\)
  25970.     character
  25971.     edit descriptor
  25972.     editing
  25973.  BACKSPACE
  25974.  Backspace character
  25975.  Bar (|)
  25976.  Base
  25977.  Base 10
  25978.     constants
  25979.     logarithm
  25980.  Base name, defined
  25981.  Batch files, FL command, converting for
  25982.  \bc*\ec (asterisk)
  25983.     unit specifier
  25984.        closing
  25985.  \bc196\ec (dash), FL option character
  25986.  \bc196\ec (minus sign), subtraction operator
  25987.  Bell character
  25988.  Big programs
  25989.  Binary files
  25990.     described
  25991.     reading
  25992.     record boundary
  25993.  Binary operators
  25994.     arithmetic
  25995.     logical
  25996.     relational
  25997.  Binary
  25998.     defined
  25999.     interface
  26000.  Bit change intrinsic function
  26001.  Bit clear intrinsic function
  26002.  Bit manipulation intrinsic function
  26003.  Bit set intrinsic function
  26004.  Bit test intrinsic function
  26005.  Bits
  26006.  Blank
  26007.     carriage-control character
  26008.     character constants
  26009.     column 6
  26010.     common block, initializing
  26011.     file name
  26012.     Hollerith fields
  26013.     input/output
  26014.     interpretation
  26015.     list-directed input
  26016.     names
  26017.     significance
  26018.  BLKDQQ
  26019.  BLOCK DATA
  26020.     also see Block-data subprogram
  26021.  Block ELSE IF, see ELSE IF block
  26022.  Block ELSE, see ELSE block
  26023.  Block IF, see IF block
  26024.  Block-data subprogram
  26025.      also see BLOCK DATA
  26026.  Block-data subprogram
  26027.     contents
  26028.     DATA statement
  26029.     described
  26030.     identifying
  26031.     named common blocks
  26032.     statements allowed
  26033.     summary
  26034.     unnamed
  26035.  BLOCKSIZE= option
  26036.  Blue type
  26037.  BN edit descriptor
  26038.  Bound, see Dimension bound
  26039.  Bounds, character substring
  26040.  Bounds, subscript, see Subscript
  26041.  Braces ({ })
  26042.  Brackets ([ ])
  26043.  BTEST
  26044.  Bytes
  26045.     also see Length
  26046.  BZ edit descriptor
  26047.  
  26048.  C
  26049.  ───────────────────────────────────────────────────────────────────────────
  26050.  C attribute
  26051.  C language
  26052.     also see Microsoft C
  26053.  C string
  26054.     defined
  26055.     described
  26056.     escape sequence, table
  26057.     nonprintable character
  26058.     null string
  26059.  /c option (FL)
  26060.  CABS
  26061.  Call
  26062.     long, defined
  26063.     short, defined
  26064.  CALL
  26065.     described
  26066.     DO loop, used with
  26067.     subroutine
  26068.  Calling conventions
  26069.  Calling subroutine
  26070.     CALL
  26071.     recursion
  26072.  Capital letter
  26073.     also see Case sensitivity
  26074.     notation
  26075.     small
  26076.  Card
  26077.  Carriage control
  26078.  Carriage-return character
  26079.  Case sensitivity
  26080.     ALIAS
  26081.     character constants
  26082.     described
  26083.     external names
  26084.     Hollerith fields
  26085.     keywords
  26086.  CCOS
  26087.  CDABS
  26088.  CDCOS
  26089.  CDEXP
  26090.  CDLOG
  26091.  CDSIN
  26092.  CDSQRT
  26093.  CEXP
  26094.  char
  26095.  CHAR
  26096.  CHARACTER
  26097.  Character array element
  26098.  Character assignment statement
  26099.  Character constants
  26100.     also see Strings
  26101.  Character data type
  26102.     common block
  26103.     list-directed input
  26104.     list-directed output
  26105.  Character editing
  26106.  Character expressions
  26107.  Character functions
  26108.  Character operand
  26109.  Character operator
  26110.  Character substring
  26111.     bounds
  26112.     checking
  26113.     described
  26114.     internal file
  26115.     length
  26116.     syntax
  26117.  Character variable
  26118.     common block
  26119.     internal file
  26120.     length
  26121.  Characters
  26122.     alphabetic
  26123.     ASCII
  26124.        using
  26125.     bell
  26126.     blank
  26127.     carriage control
  26128.     carriage return
  26129.     conversion to
  26130.     default length
  26131.     described
  26132.     digits
  26133.     form feed
  26134.     function
  26135.     hexadecimal bit pattern
  26136.     horizontal tab
  26137.     intrinsic function
  26138.     (list)
  26139.     lowercase
  26140.     names
  26141.     new line
  26142.     nonprintable
  26143.     octal bit pattern
  26144.     printable
  26145.     tab
  26146.     uppercase
  26147.     vertical tab
  26148.  Checking
  26149.     arguments
  26150.        described
  26151.        integers
  26152.        INTERFACE
  26153.        logical
  26154.        subroutines
  26155.     ranges
  26156.  CLOG
  26157.  CLOSE
  26158.     asterisk (*) unit
  26159.     described
  26160.     discarding files
  26161.     disconnecting units
  26162.     units 0, 5, 6, *
  26163.  Closing
  26164.     files
  26165.     units 0, 5, 6, *
  26166.  cmp
  26167.  cmp16
  26168.  cmp8
  26169.  CMPLX
  26170.  Code
  26171.     in-line
  26172.     machine
  26173.     size, optimizing
  26174.     source
  26175.  Coercion, see Conversion
  26176.  Collating sequence
  26177.     character set
  26178.     data-type conversion
  26179.     intrinsic functions
  26180.  Colon(:), nonrepeatable edit descriptor
  26181.  Column, statement
  26182.  Column-major order
  26183.  Comma (,)
  26184.     edit list
  26185.     field delimiter
  26186.  Command line
  26187.     error messages
  26188.     file names, entering
  26189.     FL
  26190.     switches
  26191.  Commands
  26192.     FL, defined
  26193.     MSF
  26194.     operating system
  26195.  Comment line
  26196.     described
  26197.     free form
  26198.     order
  26199.  COMMON
  26200.     also see Common block
  26201.  Common block
  26202.     blank, initializing
  26203.     character data type
  26204.     character variable
  26205.     COMMON
  26206.     EQUIVALENCE statement
  26207.     external name
  26208.     name
  26209.     named
  26210.        block-data subprogram
  26211.        DATA statement
  26212.        initializing
  26213.        length
  26214.     NEAR
  26215.  COMMQQ
  26216.  'COMPAT'
  26217.  Compatibility with old libraries
  26218.  Compatible data type
  26219.  Compiland, defined
  26220.  Compilation error messages
  26221.  Compilation unit
  26222.  Compilation, conditional
  26223.  Compile time, defined
  26224.  Compiler
  26225.     defined
  26226.     error messages
  26227.        categories
  26228.        compilation
  26229.        fatal
  26230.        identifying
  26231.        recoverable
  26232.        redirecting
  26233.        warning
  26234.     exit codes
  26235.     large model, defined
  26236.     limits
  26237.     options. See FL options
  26238.  Complement, logical
  26239.  Complex
  26240.     absolute value
  26241.     conjugate
  26242.     converting to
  26243.     described
  26244.     intrinsic function
  26245.        (table)
  26246.        described
  26247.        result
  26248.        square root
  26249.     number
  26250.     number, defined
  26251.     relational expression
  26252.     syntax
  26253.  COMPLEX*16
  26254.  COMPLEX*8
  26255.  Computed GOTO
  26256.  CON
  26257.  Concatenation operator (//)
  26258.  Conditional compilation
  26259.  CONJG
  26260.  Conjugate, complex
  26261.  Conjunction operator
  26262.  Consecutive operator
  26263.     arithmetic
  26264.     logical
  26265.  Constant
  26266.     base 10
  26267.     folding
  26268.     hexadecimal
  26269.     Hollerith
  26270.     integer
  26271.     naming
  26272.     specifying base
  26273.     specifying radix
  26274.  Continuation line
  26275.  CONTINUE
  26276.  Control statement (table)
  26277.  Conversion
  26278.     arithmetic operand
  26279.     character
  26280.     complex
  26281.     data type
  26282.        assignment
  26283.        DATA statement
  26284.        intrinsic functions
  26285.        subprogram argument
  26286.        (table)
  26287.        value arguments
  26288.     integer
  26289.     intrinsic functions
  26290.     real
  26291.  Coprocessor, defined
  26292.  Correctable error messages
  26293.  Correspondence, see Checking arguments
  26294.  COS
  26295.  COSH
  26296.  Cosine
  26297.    see arc, intrinsic function
  26298.     hyperbolic, intrinsic function
  26299.     intrinsic function
  26300.  COTAN
  26301.  Cotangent intrinsic function
  26302.  Count, iteration
  26303.  CSIN
  26304.  CSQRT
  26305.  
  26306.  D
  26307.  ───────────────────────────────────────────────────────────────────────────
  26308.  D editing
  26309.  D, real exponent
  26310.  DABS
  26311.  DACOS
  26312.  DASIN
  26313.  DATA
  26314.     also see Input/output
  26315.     described
  26316.     editing
  26317.     formatting
  26318.     reading
  26319.     writing
  26320.  Data segment, default
  26321.     LOCNEAR
  26322.     NEAR
  26323.  Data types
  26324.     abbreviation (table)
  26325.     arguments
  26326.        agreement
  26327.        subroutine
  26328.     arithmetic operand
  26329.     array
  26330.     character
  26331.        common block
  26332.        described
  26333.        list-directed input, output
  26334.        specifying
  26335.     compatible
  26336.     complex
  26337.     conversion
  26338.        arithmetic operand
  26339.        CHAR
  26340.        CMPLX
  26341.        DATA statement
  26342.        DBLE
  26343.        ICHAR
  26344.        intrinsic functions
  26345.        REAL
  26346.        subprogram argument
  26347.        value arguments
  26348.     declaring
  26349.     default
  26350.     expression
  26351.     func