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 buf is a nine-byte variable, array, array element, or character substring. The date is returned as a nine-byte ASCII character string of the form:
The EXIT subroutine causes program termination, closes all open files, and returns control to the operating system. It has the form:
SUBROUTINE GETARG(N, ARG)The GETARG subroutine returns the Nth command line argument in character variable ARG. For N equal to zero, the name of the program is returned.
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:
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 y is set equal to the value associated by the function with the seed argument i. The argument i must be an INTEGER*4 variable or INTEGER*4 array element.
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) y is set equal to the time in seconds since midnight, minus the user supplied value of the (REAL or DOUBLE PRECISION) x. Elapsed time computations can be performed with the following sequence of calls.
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 buf is an eight-byte variable, array, array element, or character substring. The TIME call returns the time as an eight-byte ASCII character string of the form:
16:45:23Note that a 24-hour clock is used.