FORTRAN 5.1 README.DOC: Additions to Reference Manual
ID: Q73256
|
The information in this article applies to:
-
Microsoft FORTRAN for MS-DOS, version 5.1
-
Microsoft FORTRAN for OS/2, version 5.1
SUMMARY
The following is the "Additions to Microsoft Reference Manual" section
from the FORTRAN version 5.1 README.DOC:
MORE INFORMATION
README.DOC File
Release notes for the Microsoft(R) FORTRAN
Professional Development System, Version 5.1
This document contains release notes for version 5.1 of the Microsoft
FORTRAN Professional Development System for MS-DOS(R) and the
Microsoft Operating System/2 (MS(R) OS/2). The information in this
document is more up-to-date than that in the manuals and the Microsoft
Advisor (online help).
Microsoft improves its languages documentation at the time of
reprinting, so some of the information in this file may already be in
your manuals.
=========< Additions to the Microsoft FORTRAN Reference >============
/Gt option
----------
The /Gt, or data threshold, compiler option can remedy a number of
link-time and run-time errors in FORTRAN 5.1. The /Gt option sets a
threshold value that determines where data items are stored in
memory. Data items that are greater in size than the threshold value,
and that would normally be stored in the default data segment, or
DGROUP, are moved to a far segment of data. This frees up more room
in DGROUP for variables less than the threshold value and for other
uses, such as the program STACK and NEAR HEAP.
Using the /Gt switch can often help eliminate the LINK errors:
L1070: 'segment name':Segment exceeds 64K
where segment can be _BSS or _DATA
L2041: Stack Plus Data exceeds 64K
and the run-time error:
F6700: Heap Space Limit Exceeded
In each of these cases, too much data is being stored in DGROUP, and
using the /Gt switch may free up the required space. See Section 7.6
of the FORTRAN 5.1 Reference for more information.
/Oc Option
----------
When you use the /Oc (default common subexpression optimization), the
compiler examines only short sections of code for common
subexpressions. You can disable default common subexpression
optimization with the /Od option.
Special Device Names
--------------------
The list of special device names in the FORTRAN Reference Manual is
incomplete. The complete list of special device names is:
Device Name Comments
=========== ========
CON stdout, stdin
USER stdout, stdin
COM1 COM1 port
AUX COM1 alias
LINE COM1 alias
LPT1 stdprn
PRN stdprn
LPT2
LPT3
LPT4
ERR stderr
NUL null device
Note that COM2, COM3, and COM4 are not special device names in
FORTRAN 5.1.
To access these devices, use an OPEN statement of the form:
OPEN (10, FILE='lpt1')
For connections to LPT2 or COM2, you are also required to specify
STATUS='old'. These two devices are not treated as standard devices
like LPT1 and COM1. Output to these devices is of the same form as
to a file, i.e. the output is buffered and carriage control
characters in column 1 are ignored.
** NOTE ** The above section of the README.DOC is incorrect. LPT2-4
are treated as special device names by FORTRAN 5.10 and do not
require STATUS='OLD', nor do they ignore carriage control. The above
information still applies to COM2-4, however.
/ND Option
----------
When using the /ND option in a module, you must also set the loadds
attribute on all subprograms called from outside the module.
Restrictions on String Assignment
---------------------------------
The right and left sides of a string assignment may not reference the
same memory location. For example, the following may fail because
the generated code overlays the input as it produces the output:
character *10 string/'0123456789'
string = '#' // string
write (*,*) 'string = ' string
end
IBM VS Extensions in Microsoft FORTRAN
-----------------------------------------
Microsoft FORTRAN supports only the following IBM VS FORTRAN
extensions:
- 31-character names
- Allowing integer arrays to contain FORMAT specifications
- DO statements without specified labels
- DO WHILE statement
- END DO statement
- Equivalence of character and non character items
- Mixing of character and non-character items in COMMON
- NAMELIST
- Specification of common block items in DATA outside block data
subprograms
- Initialization on the declaration line
- IMPLICIT NONE
- INCLUDE
- Length specification within declarations
- Noninteger array subscripts
- Z edit descriptor
- ! comments
- $ and _ in identifiers
$NOTRUNCATE Metacommand
-----------------------
$NOTRUNCATE is now the default. As a result, it is possible to create
variable names, common block names, and function or subroutine names
that are longer than the 26-character space allotted in a .LST file.
If these identifiers do not differ in the first 26 characters, the
.LST file shows them with the same name.
New NINT Functions
------------------
Three NINT intrinsic functions have been added: NINT1, NINT2, and
NINT4. These return integer values of one, two, and four bytes
respectively.
The /4I2 Switch and the INT and NINT Functions
----------------------------------------------
The length of the value returned by the INT and NINT intrinsic
functions is determined by the integer storage switch: two bytes if
/4I2 is used, four bytes if /4I4 (the default) is used.
If you want these functions to return a value with a length different
from the length set by the integer storage switch, use INT1, INT2, or
INT4 instead of INT, and use NINT1, NINT2, or NINT4 instead of NINT.
80387 Coprocessor Instructions
------------------------------
The run-time libraries recognize the presence of an 80387
coprocessor. If you are not using the alternate math package, the
library uses the 80387 SIN and COS instructions, rather than deriving
sines and cosines from the FPTAN instruction.
Array Conformity in Functions and Subroutines
---------------------------------------------
A formal array argument in a subroutine or function does not have to
have the same number of dimensions or total size as the actual array
argument passed to it. This permits the procedure to contain a formal
array that is as large as you think you will ever need; the calling
program can then pass any array of the same size or smaller.
Note, however, that if the formal and actual dimensions do not match
in quantity and size, the formal array elements do not point to the
same memory locations as the actual array elements with the same
subscripts. In this case, your program has to calculate the correct
subscripts.
"Out of Memory" Error Message
-----------------------------
This compiler error does not have an error number. It occurs when the
FL program does not have sufficient memory, as in the following
cases:
1. You used wildcard characters to specify the files to be compiled
(for example, FL *.FOR) and there were too many files. The exact
number of files that can be handled depends on the amount of system
memory.
2. The computer did not have enough free memory. This may occur when
other processes are running under Microsoft Windows or OS/2.
Additional Compiler Error Messages
----------------------------------
F2399: <name> : COMMON (or EQUIVALENCE) : automatic variable illegal.
A variable previously declared as AUTOMATIC cannot appear in a COMMON
block or an EQUIVALENCE statement.
F4187: Debugging information exceeds 64K - extra ignored.
There was more debugging information than could fit in the allotted
64K space. The additional information (which is usually symbols) was
discarded.
Revised Compiler Error Message
------------------------------
The <attribute> in error message F2384 can be "common block" or
"equivalenced," in addition to ALLOCATABLE, EXTERN, FAR, or HUGE.
Linker Path Specification
-------------------------
The /link option does not allow you to specify the linker's path. FL
assumes the linker is in the same directory as the compiler.
FL Switch Default Values
------------------------
If no switches appear in the FL command line, the source code is
compiled with the following defaults:
1. The Large memory model is used
2. The 8086/8088 instruction set is used
3. 8087/287/387 in-line instructions are used for floating-point
calculations
4. Variable, subroutine, or function names are not truncated
5. All integer and single-precision floating-point numbers are four
bytes
6. All Microsoft extensions to FORTRAN are enabled
7. FORTRAN 66-style DO statements are disabled
8. Full optimization is performed
9. Debugging (extended run-time error handling) is disabled
Any metacommands in a source code file override these defaults.
Compiling Extremely Large Programs
----------------------------------
This release contains the file F1L.EXE, which is an alternate form of
the Compiler Pass 1 disk if you need it.
This compiler pass is used to compile programs that receive error
message "F1901: program too large for memory." The F1L.EXE pass is
invoked by adding the /B1 option to the FL command line, as follows:
FL /B1 F1L.EXE <sourcefile>.FOR
where <path> is the path (including drive and directory) where
F1L.EXE resides, and <sourcefile> is the name of the FORTRAN source
file you are compiling. Alternatively, you can rename F1L.EXE to
F1.EXE to make the high-capacity version the default.
Compiler Errors and Warnings Generated by $DEBUG and /4Yb
---------------------------------------------------------
In addition to the expanded run-time error handling and testing
that $DEBUG and /4Yb enable, there are a number of compiler errors
and warnings that appear if $DEBUG or /4Yb are used. They are:
Error F2367: INTEGER : range error
Error F2533: lower substring bound exceeds upper bound
Error F2534: upper substring bound exceeds string length
Error F2535: lower substring bound not positive
Error F2536: subscript out of range
Warning F4501: subscript out of range (array argument)
Additional query words:
5.10
Keywords :
Version : :5.1
Platform :
Issue type :