This appendix discusses the VAX/VMS system subroutines and* *built-in
functions supported by *pgf77*.

**The
built-in functions perform inter-language utilities for argument passing and
location calculations. The following built-in functions are available:
**

Compute the address of the argument *arg*.

Pass the argument *a* by reference.

Pass the argument as a 32-bit immediate value (64-bit if a is double precision.) A value of 64-bits is also possible if supported for integer and logical values.

**The
DATE subroutine returns a nine-byte string containing the ASCII representation
of the current date. It has the form:
**

CALL DATE(buf)where

dd-mmm-yyWhere:

*dd*- Is the two-digit day of the month
*mmm*- Is the three-character abbreviation of the month
*yy*- Is the last two digits of the year

**The
EXIT subroutine causes program termination, closes all open files, and returns
control to the operating system. It has the form:
**

CALL EXIT[(exit_status)]where:

*exit_status*- is an optional integer argument used to specify the image exit value.

SUBROUTINE GETARG(N, ARG)The GETARG subroutine returns the

INTEGER*4 N

CHARACTER* (*) ARG

INTEGER*4 FUNCTION IARGC()The IARGC subroutine returns the number of command line arguments following the program name.

**The
IDATE subroutine returns three integer values representing the current month,
day, and year. It has the form:
**

CALL IDATE(IMONTH, IDAY, IYEAR)If the current date were October 9, 1992, the values of the integer variables upon return would be:

IMONTH = 10

IDAY = 9

IYEAR = 92

**The
MVBITS subroutine transfers a bit field from one storage location (source) to a
field in a second storage location (destination). MVBITS transfers ***a3*
bits from positions *a2* through (*a2* + *a3* - 1) of the
source, *src*, to positions *a5* through (*a5* + *a3* - 1)
of the destination, *dest*. Other bits of the destination location remain
unchanged. The values of (*a2* + *a3*) and (*a5* + *a3*)
must be less than or equal to 32 (if the source or destination is INTEGER*8,
less than or equal to 64). It has the form:

CALL MVBITS(src, a2, a3, dest, a5)Where:

*src*- is an integer variable or array element that represents the source location.
*a2*- is an integer expression that identifies the first position in the field
transferred from
*src*. *a3*- is an integer expression that identifies the length of the field
transferred from
*src*. *dest*- is an integer variable or array element that represents the destination location.
*a5*- is an integer expression that identifies the starting position within
*a4*, for the bits being transferred.

**The
RAN subroutine returns the next number from a sequence of pseudo-random numbers
of uniform distribution over the range 0 to 1. The result is a floating point
number that is uniformly distributed in the range between 0.0 and 1.0
exclusive. It has the form:
**

y = RAN(i)where

The argument *i* should initially be set to a large, odd integer value.
The RAN function stores a value in the argument that it later uses to calculate
the next random number.

There are no restrictions on the seed, although it should be initialized with different values on separate runs in order to obtain different random numbers. The seed is updated automatically, and RAN uses the following algorithm to update the seed passed as the parameter:

SEED = 6969 * SEED + 1 ! MOD 2**32The value of SEED is a 32-bit number whose high-order 24 bits are converted to floating point and returned as the result.

If the command-line option to treat all REAL declarations as DOUBLE PRECISION declarations is in effect, RAN returns a DOUBLE PRECISION value.

**The
SECNDS subroutine provides system time of day, or elapsed time, as a floating
point value in seconds. It has the form:
**

y = SECNDS(x)where (REAL or DOUBLE PRECISION)

X = SECNDS(0.0)The accuracy of this call is the same as the resolution of the system clock.

...

... ! Code to be timed

...

DELTA = SECNDS(X)

**The
TIME subroutine returns the current system time as an ASCII string. It has the
form:
**

CALL TIME(buf)where

hh:mm:ssFor example:

16:45:23Note that a 24-hour clock is used.