© Digital Equipment Corporation 1994. All rights reserved.

8-Mar-1995

1.0 DEC Fortran for OSF/1 AXP Systems

These are the release notes for version 3.7 of the DEC Fortran on OSF/1 AXP compiler system. In what follows, DFAO refers to the DEC Fortran product on OSF/1 AXP.

If you have a field test version of DFAO v3.x or any version of DFAO that is older than this one, you will want to replace it with this one or later and recompile and relink any Fortran programs that used these older versions.

DFAO v3.7 contains a native compiler that runs on and generates code that will run on OSF/1 AXP v3.x. The code is native OSF/1 AXP code in the 64-bit addressing environment. The run-time libraries for DFAO code support are provided in both shared and static form. The f77 command can be used to compile and link Fortran files with the proper libraries. There is an f77(1) man page installed that documents all of the features of the driver.

1.1 Installation

The DFAO v3.7 native software is a setld kit. It contains the following subsets:

        DFABASE370      DEC Fortran v3.7 for OSF/AXP Systems
        DFADOC370       DEC Fortran v3.7 Release Notes
        DFACOM370       DEC Fortran v3.7 Tools and their Man Pages
        OTABASE105      DEC Compiled Code Support Library
        DFARTL358       DEC Fortran for OSF/AXP Runtime Support

Note that the libraries {libots} in the OTABASE subset are the same versions as those that now ship with AOSF v3.0 and later. OTABASE105 will decline installation on AOSF v3.x even though "setld -i" will not list it as an installed subset; OTABASE105 will state that the correct libraries are present, which they are.

Note that DFAO v3.7 does not contain an updated DECladebug debugger. Use the DECladebug that shipped on AOSF v3.x.

1.2 DFAO Files

The following files and their what(1) strings are included in v3.7:

decfort PFORT V3.7-680 -292H
fort DEC Fortran Compiler Driver V3.7-063 fortpr DEC Fortran Printer Driver V3.7-005 fsplit DEC Fortran Splitter V3.7-11 fpp DEC Fortran Preprocessor V1.0-1

libFutil.a DEC Convert RTL V1.1-57 1+ 27-oct-1994 libUfor.a DEC Fortran Unsupported RTL V1.1-20 1+ 5-dec-1994 libfor.a DEC Fortran RTL V1.1-231 1+ 10-feb-1995 libots.a libots.a T1.3-008G GEM 9 Feb 1994

libFutil.so DEC Convert RTL V1.1-57 1+ 27-oct-1994 libUfor.so DEC Fortran Unsupported RTL V1.1-20 1+ 5-dec-1994 libfor.so DEC Fortran RTL V1.1-231 1+ 10-feb-1995 libots.so libots.a T1.3-008G GEM 9 Feb 1994

for_msg.cat DEC Fortran RTL Message Catalog V1.1-7 08-Jul-1994 for_main.o DEC Fortran "main" program V1.0

The listing file version string in the page header is

"DEC Fortran V3.7-680"

1.3 What Has Changed in DFAO v3.7 from DFAO v3.6

	    This informational can be ignored - it means that image activation
	    will not be quick-startable, ie, slightly slower than it could be.
	    The executable is ok.  The informational will be suppressed in the
	    final release of AOSF v3.2 since it only annoys or confuses users.

Enables speculative code scheduling. Speculation occurs when a conditionally executed instruction is moved to a position prior to a test instruction so that the moved instruction is now executed unconditionally. This reduces instruction latency stalls although performance may be reduced because the run-time system must dismiss exceptions caused by speculative instructions. Since speculation turns off some run-time error checking this switch should not be used while debugging or while testing for errors.

This optimization is only availble with AOSF v3.x and newer versions of the operating system.

> f77
usage: "f77 [ options ] filespec [ options ]" example: "f77 foo.f -O0" or "f77 -v test2.f"

> f77 -O0
fort: Severe: No source or object file specified

Parameters to an entry point go out of scope at the beginning of the next entry. It is therefore advisable to examine any parameters at the breakpoint set on the entry. Once the user steps past another ENTRY statement, DECladebug considers the program as inside that procedure and cannot reconcile the parameters to the new entry point.

0**0 default using -fpe3

at least on arg is signal returns NaN some type of Floating
floating-point Invalid

both args are signals returns -1
INTEGER Floating
Exception

Expansion of multiplication and division refers to bit shifts that allow faster multiplication and division while producing the same result. For example, the integer expression (I*5) can be calculated as I with a 2-bit shift plus the original value of I or, as expressed using the DEC Fortran ISHFT intrinsic function:

J1 = I*5
J2 = ISHFT(I,2) + I ! equivalent expression for I*5

The optimizer uses machine code that, like the the ISHFT intrinsic function, shifts bits to expand multiplication and division.

+ - * /
real16 ** any-integer
conversions to and from real16

	    This means that intrinsics like "QSIN (1Q400)" or operations like
	    "1Q10 ** 1Q100" cannot appear in compile-time constant expressions
	    like PARAMETER values and dimension declarations.

2.0 Interesting Information About DFAO

Here is some interesting information about DFAO:

2.1 64 bit POINTERs

In DFAO a POINTER is 64-bits. Addresses in ALPHA/OSF are 64-bits unless the executing image is forced into the low 2GB of memory using the "-T" and "-D" options to ld(1). If a POINTER is stored into an INTEGER*4, the value will be truncated and data will be lost. Store POINTERs into INTEGER*8 variables. See the "-i8" command line option also.

2.2 Run-Time Message Catalog Not Found

Executing code compiled by DFAO uses the DFAO RTL. When the DFAO RTL encounters an error, it displays a message from its message catalog, for_msg.cat, installed as part of the installation of the DFAO product. If the DFAO RTL to be unable to find the message catalog, it displays a message to that effect. If that occurs, the work-around is to define NLSPATH to be the American English locale:

setenv NLSPATH "/usr/lib/nls/msg/en_US.ISO8859-1/%N"

so the message file can be located.

If you are logged in as root, NLSPATH is ignored. In this case, you can instead set the environment variable LANG to part of the path given above.

2.3 Static Array Offsets Must Be Smaller than 32-bit Integers - Dynamic Offsets May Exceed 32-bit Values

There is a restriction currently in the DFAO compiler. The restriction is that an array offset for a statically allocated array must fit in 32 bits (signed). An "array offset" is the byte offset from the array's virtual origin.

This restriction goes along with the restriction that no addressable statically allocated object, eg, array or COMMON block, can be bigger (in bytes) than 32-bits.

Array index calculations in DFAO V3.4 and later are done using 64-bit integer calculations (V3.3 used 32-bit arithmetic for these calculations).

This means that you can have dynamically-allocated arrays that exceed 2**31 bytes in total size (arrays whose storage is gotten by calling malloc, for example).

It is *not* yet possible to have statically allocated arrays this large. You can't declare an array larger than 2**31 bytes in total size. These are *not* supported:
INTEGER BIG_ARRAY_1D (2**30) INTEGER BIG_ARRAY_2D (2**26, 32)

The same restriction applies to adjustable arrays. For example, this is *not* supported:
CALL SUB (A, 2**26, 32, 10) ...
SUBROUTINE SUB (A, I, J, K) INTEGER*8 I,J,K
REAL A (I,J,K)

This is ok:
CALL SUB (A, 2**33)
...
SUBROUTINE SUB (A, A_SIZE) INTEGER*8 A_SIZE
REAL A (1)

2.4 delay_wbuffers - a potential slowdown for direct access I/O

There's a flag that was introduced in OSF/1 AXP to change the writeback buffer cache algorithms. It introduces delayed buffer cache writes and is particularly effective in programs that randomly read and write small files (fit in buffer cache). What's going on is that the write of a block from the cache results in the block being unavailable for reading while the write is in progress. In pathological cases this reduces reads and writes to disk speeds.

The name of the flag is "delay_wbuffers". When it is on (ie, has the value 1), it delays writing modified buffers. If the flag is off (the default), Fortran programs that read and write the same direct access, small records, over and over again, may run very slowly. Fortran programs that read or write large records and never touch the same record twice may run faster. See the system documentation on how to set or reset delay_wbuffers.

2.5 HPARITH Traps

DFAO now supports IEEE exceptional values (NaNs, Infs, denorms) but does not provide much assistance with user-written exception handlers that need to decode the instruction stream. See -fpe in f77(1) for DFAO's support for IEEE exceptional values.

The command line option "-synchronous_exceptions" will force the compiler to generate a TRAPB instruction after every floating point instruction. This reduces performance but it allows the user to trap "high performance arithmetic" exceptions in dbx and find the offending instruction.

2.6 Fast or Accurate Math Routines

The -math_library {accurate | fast} option allows you to choose between two alternate implementations of certain intrinsic functions.

If you omit -math_library fast, the compiler uses the standard, very accurate math library routines for each DEC Fortran intrinsic function, such as SQRT.

To use a special version of certain math library routines that produce faster results, but with a slight loss of precision and less exception checking, specify -math_library fast for your program.

-math_library accurate

Using -math_library accurate (default) produces the very accurate results and error checking expected of quality compiler products by using the standard set of math library routines for the applicable intrinsics.

The standard math library routines are designed to obtain very accurate "near correctly rounded" results and also provide the robustness needed to check for IEEE exceptional argument values, rather than achieve the fastest possible run-time execution speed. Using -math_library accurate allows user control of arithmetic exception handling with the -fpen flag and for_set_fpe routine.

-math_library fast

Specifying -math_library fast uses a fast version of certain math library routines that perform faster computations than the standard, more accurate math library routines, but with slightly less fractional accuracy and less reliable arithmetic exception handling. Using -math_library fast allows certain math library functions to get significant performance improvements when the applicable intrinsic function is used.

If you specify -math_library fast, the math library routines do not necessarily check for IEEE exceptional values and the -fpen flag, and calls to the for_set_fpe routine are ignored.

When you use -math_library fast, you should carefully check the calculated output from your program to verify that it is not relying on the full fractional accuracy of the floating-point data type[1] to produce correct results or producing unexpected exceptional values (exception handling is indeterminate). Programs that do not produce acceptable results with -math_library fast and single-precision data might produce acceptable results with -math_library fast if they are modified to use double-precision data.

The specific intrinsic routines that have special fast math routines depend on the version of the DEC OSF/1 AXP operating system in use. Allowed error bounds vary with each routine.

The math library shipped with OSF/1 AXP v3.0 and later contains special fast routines (single and double precision) for SQRT, EXP, SIN, COS, the optimized combined call SINCOS, LOG, LOG10, and power (**).


[1] See the DEC Fortran user manual for a description of the native IEEE floating-point data formats, including fractional precision.

2.7 IARGPTR Intrinsic and a Routine's Argument Block

IARGPTR () is an intrinsic recognized by DFAO to return a pointer to the argument block of the routine in which IARGPTR is called. IARGPTR takes no arguments and returns an INTEGER*8 address of the calling-standard defined "argument block".

On OpenVMS AXP and OSF/1 AXP, the address of the first actual argument is one quadword past the beginning of the "argument block". On OpenVMS AXP, the first quadword of the "argument block" is the argument count. This count is not present on OSF/1 AXP, so the contents of the first quadword of the argument block are not interesting (unless you are passing floating point values using %VAL - which is too complicated to describe here - see the Calling Standard).

Here is the code example, works on both OpenVMS AXP and OSF/1 AXP:

C Test IARGPTR intrinsic function.
EXTERNAL test_argptr
INTEGER*4 x,y,z,foo
x = 10
y = 20
z = 100
foo = 4

print 800, %LOC(x), %LOC(y), %LOC(z), %LOC(foo) 800 format (' Argument addresses: ',4(1x, Z16)) CALL test_argptr (4, x, y, z, foo)
END

OPTIONS /EXTEND_SOURCE SUBROUTINE test_argptr (N_ARGS)
POINTER (II, I_ARGN)
INTEGER*8 I_ARGN
POINTER (I_PTR, I_VAL) INTEGER I_VAL

II = IARGPTR() ! Get address of arg block II = II + SIZEOF (II) ! Get address of address of first arg

DO I = 1, N_ARGS+1

	    I_PTR = I_ARGN  		! Get address of actual from homed
					! arg list
	    print 900, I, I_PTR, I_VAL
900	    format ( ' Argument ', I2, ' address = ', Z16, ', contents = ', Z16)
	    II = II + SIZEOF (II)	! Get address of address of next arg

END DO
RETURN
END

2.8 DEC Fortran's Handling of Optional Arguments

Fortran's language rules require that all actual and formal arguments match in number, order and type. This means that it's not allowed to omit arguments when calling a Fortran routine. Yet applications do it anyway, so we've made some accomodation for that.

As long as the argument is not of type CHARACTER, or is used in an adjustable array bounds expression, you can get away with omitting arguments as long as you follow certain rules:

Routines Called With Omitted Arguments

              Optimization for dummy arguments may cause problems for
	      applications which contain Fortran routines that can be called
	      with some arguments omitted. Though omission of arguments is not
              supported by DEC Fortran, many applications have been
              written which took advantage of knowledge that the compiled
              code did not access the argument list for dummy arguments,
              other than those of type CHARACTER and adjustable arrays,
              until the argument was actually used during execution
              of the routine. This assumption is not valid, and
              these applications may fail, typically with an segmentation
              fault.

              To disable the optimization on dummy arguments, specify
              the "-assume dummy_aliases" command line
              qualifier. An alternative is to declare the specific dummy
              arguments to be VOLATILE or to use them as arguments to
              the %LOC built-in function. (Most existing subroutines
              which can be called with omitted arguments use %LOC to
              test for a zero address; these will not require changes.
              However, if the test for omission is made solely on the
              basis of argument count or some other value, one of the
              above changes is necessary.) For the language requirements
              regarding Actual Argument and Dummy Argument Association,
              see the DEC Fortran Language Reference Manual.

2.9 Useful Command line Options to the f77 Driver

The f77(1) man page and the DFAO User Manual gives in-depth information on all of the command line options that are available using the f77 driver. Here are some new and useful ones:

-fpe0 the default: abort on overflow, divide by 0, and Invalid; return 0 on underflow

-fpe1 overflow => +/-Infinity, divide by 0 => +/-Inf or NaN {0.0/0.0}, underflow => 0

-fpe2 -fpe1 semantics plus display a count of the exceptions

-fpe3 overflow => +/-Infinity, divide by 0 => +/-Inf or NaN {0.0/0.0}, underflow => denorm

-fpe4 -fpe3 semantics plus display a count of the exceptions

Notice that exceptional behavior can result in an exceptional value, eg, overflow leads to a result of Infinity. However, exceptional values can enter a program as constants or input where they may be detected as inputs to a computation, not the result of one. In such cases, the IEEE exceptional values of +/-Infinity, NaN, and denorms are considered "invalid" data and signal an Invalid exception, which can only be handled {slowly} in -fpe modes higher than 0.

See the f77(1), write_rnd(3), ieee(3), and ieee_functions(3) man pages for more information.

	    ********	BEWARE	  **************************************
	    *	Using any -fpe setting other than -fpe0 can result in
	    *	a noticeable performance slowdown.  If your application
	    *	does not rely on IEEE exceptional values, remove them
	    *	and run with -fpe0.
	    ************************************************************

Please note that format conversion does not occur on RECORD items in the I/O list {ie, those items using a STRUCTURE data declaration}. The individual fields of such RECORDs will not be converted from "foreign" to "native" format automatically by the -convert option.

-granularity {byte | longword | quadword}

defined. The default is "quadword". Use of "longword" or "byte" will cause slower performance of the generated code.

3.0 Reporting Problems with DFAO

If a problem arises with the DFAO product and you report it to your support services contact inside DEC, please include a complete description of problem including

Use the "-v" option to f77.

Include the version number of the compiler - it's in the listing page header.

Include the what(1) strings of all libraries loaded.

4.0 Changes in previous releases of DEC Fortran for OSF/1 AXP

4.1 Changes from v3.5 to v3.6 of DEC Fortran for OSF/1 AXP

-tune generic | host | ev4 | ev5

	    Selects processor-specific instruction tuning for implementations 
	    of the Alpha AXP architecture.  Regardless of the setting of the
	    -tune option, the generated code will run correctly on all
	    implementations of the Alpha AXP architecture.  Tuning for a
	    specific implementation can provide improvements in runtime
	    performance;  it is also possible that code tuned for a specific
	    target may run slower on another target.  

	    generic	
	        Selects instruction tuning that is appropriate for all
	        implementations of the Alpha AXP architecture.   

This option is the default.

host
Selects instruction tuning that is appropriate for the machine the compilation is occuring on.

ev4
Selects instruction tuning for the 21064, 20164A, 21066, and 21068 implementations of the Alpha AXP architecture.

ev5
Selects instruction tuning for the 21164 implementation of the Alpha AXP architecture.

The DEC Fortran User Manual for DEC OSF/1 AXP Systems was revised for Version 3.5. The following corrections apply:

	    The environment variable DECFORT_FPP applies only to
	    Fortran files (not C language files). If DECFORT_FPP is
	    set to any value, that value must be a pathname and file
	    name of a preprocessor to be invoked instead of cpp or
	    fpp. The DECFORT_FPP environment variable identifies the
	    preprocessor to be invoked if the command line requests
	    that a preprocessor be used. Setting DECFORT_FPP to a
	    value does not invoke a preprocessor; it is only used
	    when the command line requests a preprocessor (cpp or
	    fpp).

	    For those cases where the C preprocessor cpp would
	    have been invoked for Fortran files, if you specify the
	    f77 flag -fpp, the Fortran preprocessor fpp is invoked
	    instead of cpp.

4.2 Changes from v3.4 to V3.5 of DEC Fortran for OSF/1 AXP

	    The non-VMS ENDFILE behavior has been changed so that files
	    containing an ENDFILE record are now portable between Alpha/VMS
	    and non-VMS platforms.

	    In "VMS mode", an ENDFILE statement will write a record containing
	    a single ^Z -- never a ^D, and never in a segment.  This is what
	    VAX Fortran does.  This is the default on Alpha/VMS, and the
	    behavior on U*x if you use -vms.

	    In "U*x mode", an ENDFILE statement will truncate the file.  This
	    is the default on U*x, and the behavior on Alpha/VMS if you use
	    /NOVMS.

	    For those customers that have old segmented files with old-style
	    ENDFILE records in them, they will have to convert their files
	    before the RTL can read the ENDFILE records.  We are assuming
	    there are very few such customers.
	    The kernel was not signalling underflow in the case where a
	    denormalized number represented the value exactly, only where the
	    result was both denormalized and inexact.  As a result, the part
	    of the kernel that processed the UMZ request didn't pick up the
	    underflow and force the zero.

	    This will be fixed in the next release of AOSF v3.x.
	    DECLadebug requires that 'O2ABASE' in the COBOL kit be installed.
	    The O2ABASE subset is in DEC_Cobol_RTL/.

cvt_ftof (void * in, int in_type, void * out, int out_type, int flags)

	    in_type and out_type specify the floating types as one of
	    VAX f,d,g,h formats or ieee single or double.  Currently
	    the flags input is ignored.   In subsequent releases, this
	    routine may be enhanced to include IBM and CRAY single and
	    double formats and options will be added to deal with
	    source and destination endianness and the behavior on
	    "error" cases.

	    The prototype for cvt_ftof and the definitions of the type
	    parameters can be found in the header file cvt.h.  There
	    is also a man page for this function.

5.0 DEC Fortran Documentation Changes

5.1 Software Pipelining (-O5)

           Software pipelining and additional software dependency
           analysis are enabled using the -O5 flag, which in certain
           cases improves run-time performance.

           As compared to regular loop unrolling (enabled at -O3 or
           above), software pipelining uses instruction scheduling
           to eliminate instruction stalls within loops, rearranging
           instructions between different unrolled loop iterations to
           improve performance.

           For instance, if software dependency anaylsis of data
           flow reveals that certain calculations can be done before
           or after that iteration of the unrolled loop, software
           pipelining reschedules those instructions ahead or behind
           that loop iteration at places where their execution
           can prevent instruction stalls or otherwise improve
           performance.

           For this version of DEC Fortran, loops chosen for
           software pipelining:

           o  Are always innermost loops (those executed the most)

           o  Do not contain branches or procedure calls

           o  Do not use COMPLEX floating-point data (for this
              software version)

           By modifying the unrolled loop and inserting instructions
           as needed before and/or after the unrolled loop, software
           pipelining generally improves run-time performance, except
           for cases where the loops contain a large number of
           instructions with many existing overlapped operations.
           In this case, software pipelining may not have enough
           registers available to effectively improve execution
           performance and using -O5 instead of -O4 may not improve
           run-time performance.

           To determine whether using -O5 benefits your particular
           program, time program execution for the same program
           compiled at levels -O4 and -O5. For programs that contain
           loops that exhaust available registers, longer execution
           times may result with -O5.

           In cases where performance does not improve, consider
           compiling using -unroll 1 along with -O5 to possibly
           improve the effects of software pipelining.

5.2 INCLUDE file Processing with -I

The compiler now supports the same INCLUDE command line switches supported by cpp(1). The compiler applies them only to Fortran INCLUDE statements of the form

INCLUDE 'full-file-name'

The INCLUDE command line switches specify the places the compiler should look for the file to be included, as well as the order in which those places should be searched.

Search order

Depending on the command line switches specified the compiler searches

(a) The source directory.

This is the directory that contains the file that contains the INCLUDE statement; however, if the user specified -vms, it is the directory the user was in when the compiler was invoked.

and/or then

(b) Directories specified on the command line.

and/or then

(c) /usr/include

Note that this is the same search order that cpp applies to a particular flavor of #include statements.

Command line syntax for the compiler

Command line syntax for the compiler is

-I<directory> (may be repeated for additional directories)

and/or

-noinclude

or

(default) i.e., no include-related switches

Note that -I<directory> and -noinclude are not mutually exclusive.

The following shows how the command line determines the search order, using the 3 "places to be searched" described above:

		   Places to be searched
Command line       |  (a)  | (b)  |  (c)
===================+=======+======+=======
(default)          |  Yes  |  No  |  Yes
===================+=======+======+=======
-I<directory>      |  No   |  Yes |  Yes
===================+=======+======+=======
-noinclude         |  Yes  |  No  |  No

===================+=======+======+======= -I with -noinclude | No | Yes | No ===================+=======+======+=======

Command line syntax for the driver

The f77(1) driver passes -I<directory> directly to both cpp and the DFAO compiler. It passes -I (no <directory specified>) to cpp, and changes it to -noinclude for the compiler. Note that on OSF/1 cpp's -I switch (with no directory) is functionally equivalent to the compiler's -noinclude switch, ie, don't look in (c).

This way, the driver causes both cpp and the compiler to look for files to be included in the same places and in the same order.

5.3 Intrinsic functions promoted automatically when using -real_size 64 (-r8)

With -real_size 64, there is a set of intrinsic names (listed below) that require REAL*4 or COMPLEX*8 arguments, but that often end up with REAL*8 or COMPLEX*16 arguments as the result of other work done by -real_size 64. To help avoid the need for source changes in such situations, DEC Fortran substitutes use of the equivalent intrinsic that accepts REAL*8 or COMPLEX*16 values. There is no warning/informational message when this substitution is done, since the behavior is considered intuitive.

Name with argument(s) will become:

    	ALOG	REAL*8		DLOG
    	ALOG10	REAL*8		DLOG10
    	AMAX1	REAL*8		DMAX1
    	AMIN1	REAL*8		DMIN1
    	AMOD	REAL*8		DMOD

CMPLX REAL*8 DCMPLX FLOAT REAL*8 DFLOAT
IFIX REAL*8 INT
REAL REAL*8 DBLE
SNGL REAL*8 DBLE
AIMAG COMPLEX*16 DIMAG

    	CABS	COMPLEX*16	CDABS
    	CCOS	COMPLEX*16	CDCOS
    	CEXP	COMPLEX*16	CDEXP
    	CLOG	COMPLEX*16	CDLOG
    	CSIN	COMPLEX*16	CDSIN
    	CSQRT	COMPLEX*16	CDSQRT

5.4 Version Information in .o Files

DEC Fortran produces an object file that contains a variety of version number information. The response from the what utility on a DEC Fortran .o file is the string that you specify in the first CDEC$ IDENT directive. If you do not specify this directive, the what response will be empty.

For more version information, enter the following command:

% strings {object} | grep "@(.)" | sed "s/@([#cmd])//"

This command provides information on the following .o file strings:

        (#)users-ident\n    (may not be present)
        (c)compiler-ident\n
        (m)module-name\n
        (d)date\n

5.5 REAL*16 Data Type

A 128-bit floating point data type is now supported by software emulation in DFAO. The data type is called "X_float" and is in an IEEE format. Its binary format is not the same as VAX "H_float" supported by VAX/VMS. All other syntax and semantics of REAL*16 from DEC Fortran on VAX/VMS as documented in the DEC Fortran Language Reference Manual are the same as for REAL*16 in DFAO. This is the same as the REAL*16 support added in DEC Fortran on AXP/VMS v6.2.

The memory and register formats for X_float are strictly littleendian:

+---------------------------------------------------------------+ mem | fraction_low | A
+---------------------------------------------------------------+ |S| exponent | fraction_high | A+8
+---------------------------------------------------------------+

FRn v 1 FRn
+---------------------------------------------------------------+ reg |S| exp | fraction_high | fraction_low | +---------------------------------------------------------------+

REAL*16 support requires the system libraries that ship with OSF/1 AXP v3.0.

REAL*16 is manipulated as X_float by the foreign file support {-convert} when the file target is an IEEE format and as VAX H_float when the file target is a VAX format. In addition, two new -convert values are available:

-convert fdx VAX F-float, VAX D-float, IEEE X-float -convert fgx VAX F-float, VAX G-float, IEEE X-float

5.6 -pad_source Command Line Option

Spaces are insignificant in the Fortran language outside of character and Hollerith constants. The DEC Fortran compiler by default does not pad source records with explicit spaces out to the right margin {column 72 by default; 132 if -extend_source is used}. If a character or Hollerith constant is continued across record boundaries, it may not be obvious whether trailing spaces that appear to exist in fact do exist; some system editors remove trailing spaces from records.

-pad_source tells the compiler to extend all source records to the current right margin with spaces to remove this potential problem. When -nopad_source is in force, a character or Hollerith literal that is continued to the next source record before the right margin will trigger a CHACONCONTD {Character Context Continued} warning. This is the first in a class of warning that can be suppressed with the "-warn nousage" command line option. {The default is "-nopad_source -warn usage".}

5.7 Automatic Arrays

DFAO now supports automatic arrays:

subroutine sub1(n)
real a,b,c
integer n
dimension a(n,n),b(n,n),c(n,n)

where arrays local to routines are dimensioned by variables that are dummy arguments.

5.8 The SELECT CASE Construct

CASE Construct

The CASE construct conditionally executes one block of constructs or statements depending on the value of a scalar expression in a SELECT CASE statement.

The CASE construct takes the following form:

	    [name :] SELECT CASE (expr)
	    [CASE (case-value [,case-value]...) [name]
	      block]...
	    [CASE DEFAULT [name]
	      block]
	    END SELECT [name]

Integer and character expressions can be expressed as a range of case values, taking one of the following forms:

	    low:high
	    low:
	    :high

The case expression (expr) is evaluated first. The resulting case index is compared to the case values to find a matching value (there can be at most one). When a match occurs, the block following the matching case value is executed and the construct terminates.

The following rules determine whether a match occurs:


Data_Type_________A_Match_Occurs_If:____________________

Logical case-index .EQV. case-value

Integer or case-index == case-value Character_______________________________________________


Range_____________A_Match_Occurs_If:____________________

low: case-index >= low

:high case-index <= high

low:high__________low_<=_case-index_<=_high_____________

The following are all valid case values:

	    CASE (1, 4, 7, 11:14, 22)      ! Individual values as specified:
	                                   !     1, 4, 7, 11, 12, 13, 14, 22
	    CASE (:-1)                     ! All values less than zero
	    CASE (0)                       ! Only zero
	    CASE (1:)                      ! All values above zero

If no match occurs but a CASE DEFAULT statement is present, the block following that statement is executed and the construct terminates.

If no match occurs and no CASE DEFAULT statement is present, no block is executed, the construct terminates, and control passes to the next executable statement or construct following the END SELECT statement.

Examples

The following are examples of CASE constructs:

INTEGER FUNCTION STATUS_CODE (I)

	    INTEGER I
	    CHECK_STATUS: SELECT CASE (I)
	    CASE (:-1)
	      STATUS_CODE = -1
	    CASE (0)
	      STATUS_CODE = 0
	    CASE (1:)
	      STATUS_CODE = 1
	    END SELECT CHECK_STATUS

END FUNCTION STATUS_CODE

SELECT CASE (J)
CASE (1, 3:7, 9) ! Values: 1, 3, 4, 5, 6, 7, 9 CALL SUB_A
CASE DEFAULT
CALL SUB_B
END SELECT

The following three examples are equivalent:

1. SELECT CASE (ITEST .EQ. 1)

	     CASE (.TRUE.)
	       CALL SUB1 ()
	     CASE (.FALSE.)
	       CALL SUB2 ()
	     END SELECT

2. SELECT CASE (ITEST)

	     CASE DEFAULT
	       CALL SUB2 ()
	     CASE (1)
	       CALL SUB1 ()
	     END SELECT

3. IF (ITEST .EQ. 1) THEN

	       CALL SUB1 ()
	     ELSE
	       CALL SUB2 ()
	     END IF

5.9 The CYCLE and EXIT Statements and Construct Names

CYCLE Statement

The CYCLE statement interrupts the current execution cycle of the innermost (or named) DO construct.

The CYCLE statement takes the following form:

CYCLE [name]

When a CYCLE statement is executed, the following occurs:

  1. The current execution cycle of the named (or innermost) DO construct is terminated.

    If a DO construct name is specified, the CYCLE statement must be within the range of that construct.

    2. The iteration count (if any) is decremented by 1.

    3. The DO variable (if any) is incremented by the value of the increment parameter (if any).

    4. A new iteration cycle of the DO construct begins.

    Any executable statements following the CYCLE statement (including a labeled terminal statement) are not executed.

    Examples

    The following example shows the CYCLE statement:

    	    DO I =1, 10
    	      A(I) = C + D(I)
    	      IF (D(I) < 0) CYCLE    ! If true, the next statement is skipped
    	      A(I) = 0               ! and the loop is tested again.
    	    END DO
    

    EXIT Statement

    The EXIT statement terminates a DO construct. It takes the following form:

    EXIT [name]

    When an EXIT statement is executed, the named (or innermost) DO construct is terminated.

    Any DO variable present retains its last defined value.

    Examples

    The following example shows an EXIT statement:

    	    LOOP_A : DO I = 1, 15
    	      N = N + 1
    	      IF (N > I) EXIT LOOP_A
    	    END DO LOOP_A
    

    Construct Names

    DO, CASE, and IF constructs can be named. The name must appear on the initial line and terminal line of the construct. In the initial line, the name is separated from the statement keyword by a colon (:). For example:

    [name:] SELECT CASE (expr)
    ....
    END SELECT [name]

    The construct name must be a unique identifier in the program unit.

    5.10 Miscellaneous Functional Additions

    PARAMETER (IJK=3)
    ...
    DATA NNN /-IJK/

    PARAMETER FOR_K_FP_SNAN = '00000000'X PARAMETER FOR_K_FP_QNAN = '00000001'X PARAMETER FOR_K_FP_POS_INF = '00000002'X PARAMETER FOR_K_FP_NEG_INF = '00000003'X PARAMETER FOR_K_FP_POS_NORM = '00000004'X PARAMETER FOR_K_FP_NEG_NORM = '00000005'X PARAMETER FOR_K_FP_POS_DENORM = '00000006'X PARAMETER FOR_K_FP_NEG_DENORM = '00000007'X PARAMETER FOR_K_FP_POS_ZERO = '00000008'X PARAMETER FOR_K_FP_NEG_ZERO = '00000009'X

    COMPLEX values displayed by list-directed and NAMELIST writes used to begin a new record after the embedded "," if the REAL part would fit in the current record but the entire value would not. This has been fixed so that the entire value will be displayed in the next record if the entire value won't fit in this record.

    6.0 DEC Fortran Documentation and Online Information

           Installation-related DEC Fortran documentation and the
           DEC Fortran subsets are available online on the media CD-ROM
           device (Software Product Library CD-ROM or DEC Fortran CD-ROM).
    
           Bookreader versions of the DEC Fortran documentation are provided
           on the Online Documentation Library CD-ROM.
    
           For more information on the contents of the Software Product Library
           CD-ROM or DEC Fortran CD-ROM, see the Read Before Installing or Using
           DEC Fortran Version 3.n for DEC OSF/1 Alpha Systems cover letter.
    

    6.1 Online Documentation

          The DEC OSF/1 Software Product Library CD-ROM (media CD-ROM) kit
          includes a set of media CD-ROMs, a printed Software Product Library  
          CD-ROM User's Guide (media CD-ROM user guide), and a CD-ROM "read
          first" letter. The media CD-ROM user guide describes the cdmenu utility
          and the media CD-ROM online files.                                       
    
          With the DEC OSF/1 Software Product Library CD-ROM, see the      
          media CD-ROM user's guide or the CD-ROM master index file to
          locate the correct media CD-ROM that contains the DEC Fortran
          directories and the names of the DEC Fortran product directories. The
          CD-ROM user guide and CD master index are provided as online
          files in the /readme directory of the first media CD-ROM.     
    
          Follow the directions in the online DEC Fortran installation guide
          or CD-ROM user guide to mount the appropriate media CD-ROM. Use an ls    
          command to examine the files in the DEC Fortran (/mnt/dfa370/kit 
          and /mnt/dfa370/documentation) directories.                      
    
          Your media CD-ROM contains the following DEC Fortran files:
                                                                           
          o  The DEC Fortran setld installation subsets                    
                                                                           
          o  DEC Fortran documentation in PostScript[R] (.ps) form and     
             ASCII (.txt) form, including:                                 
    
             -  The DEC Fortran installation guide
    
             -  The DEC Fortran online release notes
    
             -  This "read first" cover letter    
    
             -  The DEC Fortran Software Product Description (SPD)           
    

    6.2 Online Release Notes, Reference Pages, and Help File

           DEC Fortran provides the following online information,
           which is copied to the user's system during installation:
    
           o  The DEC Fortran online release notes
    
              Provide more information on this version of DEC Fortran.
    
              You can view the DEC Fortran release notes before
              installing DEC Fortran once the media CD-ROM
              has been mounted locally from the following location:
    
                 /mnt/dfa370/documentation/dfa370_relnotes.txt
    
              After installation, the online release notes are copied to:
    
                 /usr/lib/cmplrs/fort/relnotes
    
           o  DEC Fortran online reference pages
    
              Describe the DEC Fortran software components, including
              f77(1), fsplit(1), fpr(1), intro(3f), and numerous section
              3f reference pages (for the 3f language interface routines)
              listed in intro(3f).
    
              Use the man command to read the appropriate reference page.
    
           o  The DEC Fortran help file
    
              Provides online access to DEC Fortran help, which
              includes error message descriptions, a summary of the
              language elements (statements, intrinsic functions, and
              so on), a glossary, and other information.
    
              Use the more command or the view command to access the
              information available in this file, located in:
    
                 /usr/lib/cmplrs/fort/decfortran.hlp
    
              The help file is large and is not usually printed on a
              printer or read sequentially.
    

    6.3 Summary of the DEC Fortran Documentation Set

           Depending on how you order the final product, you may
           receive printed copies of the following DEC Fortran manuals:
    
           o  DEC Fortran Language Reference Manual (AA-PU45B-TK)
    
              Revised for Version 3.7.
    
              Describes the DEC Fortran source language for reference
              purposes, including the format of statements, intrinsic
              functions, directives, and other language elements.
              Extensions to the ANSI FORTRAN-77 standard are identified
              by blue color in the printed document and by shading in
              Bookreader. Language differences among various DEC Fortran
              platforms (DEC OSF/1 AXP, Windows NT[TM] AXP, OpenVMS[TM] AXP,
              OpenVMS VAX[TM]) are also identified.
    
              This document is provided in Bookreader form on the
              Online Documentation Library CD-ROM.
    
           o  DEC Fortran User Manual for DEC OSF/1 AXP Systems (AA-PW81B-TK)
    
              Last revised for Version 3.5.
    
              Describes the development and run-time environment on
              DEC OSF/1 AXP systems, including the f77 command and
              its flags, the DECladebug and dbx debuggers, run-time
              performance guidelines, native data characteristics,
              and converting unformatted files in nonnative numeric formats.
    
              It also explains DEC Fortran I/O, the language interface
              with C, error handling and run-time messages, using
              structures and records, native data characteristics,
              Section 3f language interface (jacket) routines, and
              compatibility with other products (DEC Fortran on
              OpenVMS VAX Systems, DEC Fortran on OpenVMS AXP Systems,
              and FORTRAN IV).
    
              This document is provided in Bookreader form on the
              Online Documentation Library CD-ROM.
    
           o  DEC Fortran Installation Guide for DEC OSF/1 AXP Systems
              (AA-PW82B-TE)
    
              Printed version revised for Version 3.5; online CD-ROM version
              revised for Version 3.7.
    
              Explains how to install DEC Fortran on DEC OSF/1 AXP
              systems, including registering a license PAK (product
              authorization key), disk space and other prerequisites,
              and information about the DEC Fortran run-time library
              and message file.
    
              This installation guide is provided in PostScript form
              (.ps file suffix) and in plain ASCII form (.txt suffix)
              on the media CD-ROM; it is also provided in Bookreader
              form on the Online Documentation Library CD-ROM.
    
           o  Read Before Installing or Using DEC Fortran Version 3.n
              for DEC OSF/1 Alpha Systems cover letter (AV-PW83E-TE for
              Version 3.7)
    
              Describes the new features of this version of DEC Fortran, provides
              the minimum operating system version, and other information.
              The letter may contain installation information and should be
              read before installing DEC Fortran.
    
              This cover letter is provided in PostScript form (.ps
              file suffix) and in plain ASCII form (.txt suffix)
              for the final product on the media CD-ROM.
    
           You can order the these documents in printed form from
           Digital as an entire kit or individually.
    
           Online help files are also provided (see Section 6.2).
    

    6.4 Ordering Printed Documentation

           You can also order the printed DEC Fortran for DEC OSF/1
           Alpha Systems documentation set from Digital:
    
           o  DEC Fortran Language Reference Manual (AA-PU45B-TK)
    
           o  DEC Fortran User Manual for DEC OSF/1 AXP Systems (AA-PW81B-TE)
    
           o  DEC Fortran Installation Guide for DEC OSF/1 AXP Systems
              (AA-PW82B-TE)
    
           The language reference manual and read first letter were 
           revised for Version 3.7. The online installation guide
           was revised for Version 3.7. To order the complete printed
           documentation set, specify the order number QA-MV2AA-GZ.
    
           To order printed documentation from Digital, see the "How
           to Order Additional Documentation" page in the back of a
           recently printed Digital software document or use these
           guidelines:
    
           o  In the U.S.A., phone 1-800-344-4825 (DECdirect Sales)
    
           o  In Canada, phone 1-800-267-6215 (DECdirect Sales)
    
           o  In Puerto Rico, phone (809) 781-0505
    
           o  In other countries, contact your local Digital
              Subsidiary or reseller.
    

    6.5 Documentation Corrections and Additions

           In the DEC Fortran Language Reference Manual, there are no known
           corrections.
    
           In the DEC Fortran User Manual for DEC OSF/1 AXP Systems,
           note the following corrections and additions:
    
           o  The Fortran preprocessor environment variable DECFORT_FPP
              description is inaccurate.
    
              The environment variable DECFORT_FPP applies only to
              Fortran files (not C language files). If DECFORT_FPP is
              set to any value, that value must be a pathname and file
              name of a preprocessor to be invoked instead of cpp or
              fpp. The DECFORT_FPP environment variable identifies the
              preprocessor to be invoked if the command line requests
              that a preprocessor be used. Setting DECFORT_FPP to a
              value does not invoke a preprocessor; it is only used
              when the command line requests a preprocessor (cpp or fpp).
    
              For those cases where the C preprocessor cpp would have
              been invoked for Fortran files, if you specify the f77 flag
              -fpp, the Fortran preprocessor fpp is invoked instead of cpp.
    
           o  New command-line flags and options added to DEC Fortran
              since Version 3.5 are not described. These new features are
              described elsewhere in these release notes.
    
           In the DEC Fortran Installation Guide for DEC OSF/1 AXP
           Systems, note the following corrections and additions in the
           printed version. These corrections have been fixed in the
           online CD-ROM version of this installation guide, but not the
           printed version:
    
           o  The media CD-ROM pathnames and file names are now all lowercase
              letters.    
    
           o  The DEC Fortran Version 3.7 installation kit does not
              include a version of the DECladebug debugger. Use the
              version of the DECladebug debugger provided the DEC OSF/1
              AXP operating system.
    
              The DEC Fortran installation guide shows installing the
              DECladebug debugger from the DEC Fortran kit, since the
              DECladebug debugger was provided with DEC Fortran Version 3.5.
    
           DEC Fortran only installs the OTABASE subset if it is newer
           than its equivalent library files provided with the base
           DEC OSF/1 AXP operating system (Version 3.0 or higher).
           The installation guide correctly shows the display shown when
           the installation of the OTABASE105 subset is being declined.
    
           Although using the command setld -i OTABASE105 might not
           show OTABASE105 as an installed subset, the same files
           usually installed by the OTABASE105 subset are already
           present on a DEC OSF/1 AXP Version 3.0 (or higher) system.
    

    6.6 Sending Digital Your Comments on Documentation

           Digital welcomes your comments on any DEC Fortran manual or 
           DEC Fortran online information. You can send comments to 
           Digital in the following ways:
    
           o  Internet electronic mail: fortran_docs@zko.mts.dec.com
    
           o  FAX: 603-881-0120 Attn: Languages Documentation, ZKO2-3/K35
    
           o  A Reader's Comments form (located at the back of each
              printed DEC Fortran manual) sent to the address on the form.
    
           o  A letter or card sent to the following address:
    
              Digital Equipment Corporation
              Languages Documentation, ZKO2-3/K35
              110 Spit Brook Road
              Nashua, NH  03062-2698  USA
    

    [End of relnotes.]