DIGITAL Fortran 90
User Manual for
DIGITAL UNIX Systems


Previous Contents Index

Table 12-2 describes the 3f routines that provide special functions allowing DIGITAL Fortran 90 and C language programs to work together.

Table 12-2 3f Library Routines Providing Special Functions
Routine Name Function and Comments
for_rtl_init_ Allows a C main language program to use the DIGITAL Fortran 90 Run-Time Library environment by initializing the environment, including associated signal handlers; see for_rtl_init_ in Table 12-3
for_rtl_finish_ Allows a C main language program to terminate use of the DIGITAL Fortran 90 Run-Time Library environment; see for_rtl_finish_ in Table 12-3.
for_get_fpe Returns information on the floating-point exception handling established for the current program unit; see for_get_fpe in Table 12-3. To use for_get_fpe from a C program, you must first call for_rtl_init_ .
for_set_fpe Sets the floating-point exception handling established for the current program unit; see for_set_fpe in Table 12-3. To use for_set_fpe from a C program, you must first call for_rtl_init_ .
getfd Returns the file descriptor associated with a unit number, after the DIGITAL Fortran 90 Run-Time Library environment has opened the file; see getfd in Table 12-3.
omp_* Various OpenMP Fortran API run-time routines related to parallel processing; see omp_* in Table 12-3, also Section E.1.
ots* Various DIGITAL Fortran run-time routines related to parallel processing; see Section E.2.
shcom_connect Allows multiple processes to access common block data in a shared library (uses memory mapping); see shcom_connect(3f) .

For More Information:

12.4 Summary of 3f Library Routines

Table 12-3 describes each DIGITAL Fortran 90 3f library routine and lists the appropriate reference page. For those 3f library routines that serve as interface routines to a system call or a different library routine, the required related routine is listed. Most routines are invoked as functions, with the exception of those listed as subroutines in Table 12-3.

Table 12-3 DIGITAL Fortran 90 3f Functions and Subroutines
Name Reference Page Description
abort abort(3f) Terminates the program abnormally and may cause a core dump. Use as a subroutine.
access access(3f) Determines the accessibility of a file.
alarm alarm(3f) Executes a subroutine after a specified time.
and bit(3f) Returns the bitwise AND of two operands. Use as an intrinsic function.
besj0 bessel(3f) Returns single-precision (REAL*4) bessel function value (first kind, zero order).
besj1 bessel(3f) Returns single-precision (REAL*4) bessel function value (first kind, first order).
besjn bessel(3f) Returns single-precision (REAL*4) bessel function value (first kind, nth order).
besy0 bessel(3f) Returns single-precision (REAL*4) bessel function value (second kind, zero order).
besy1 bessel(3f) Returns single-precision (REAL*4) bessel function value (second kind, first order).
besyn bessel(3f) Returns single-precision (REAL*4) bessel function value (second kind, nth order).
chdir chdir(3f) Changes the default directory.
chmod chmod(3f) Changes the mode of a file.
ctime time(3f) Returns the system time as a 24-character ASCII string.
dbesj0 bessel(3f) Returns a double-precision (REAL*8) bessel function value (first kind, zero order).
dbesj1 bessel(3f) Returns a double-precision (REAL*8) bessel function value (first kind, first order).
dbesjn bessel(3f) Returns a double-precision (REAL*8) bessel function value (first kind, nth order).
dbesy0 bessel(3f) Returns a double-precision (REAL*8) bessel function value (second kind, zero order).
dbesy1 bessel(3f) Returns a double-precision (REAL*8) bessel function value (second kind, first order).
dbesyn bessel(3f) Returns a double-precision (REAL*8) bessel function value (second kind, nth order).
derf erf(3f) Returns a double-precision error function.
derfc erf(3f) Returns a double-precision error function (complementary form).
drand rand(3f) Generates a random number. Use drandm instead.
drandm random(3f) Generates a double-precision (REAL*8) random number.
dtime etime(3f) Returns the elapsed (delta) execution time.
erf erf(3f) Returns a single-precision error function.
erfc erf(3f) Returns a single-precision error function (complementary form).
etime etime(3f) Returns the actual execution time of a process.
falloc malloc(3f) Allocates space for an array in virtual memory. Use with malloc and free . Consider using the ALLOCATABLE attribute or the ALLOCATE and DEALLOCATE statements.
fdate fdate(3f) Returns the date and time in ASCII string. Use as a subroutine.
fgetc fgetc(3f) Returns a character from a specified logical unit.
flush flush(3f) Writes (flushes) the output in a user buffer to system buffer. Discards read-ahead data in user buffer.
for_get_fpe for_set_fpe(3f) Returns the status of the floating-point exception (fpe) handling currently set for the program. Usually used with for_set_fpe . To use for_set_fpe and for_get_fpe from a C program, see the for_rtl_init_ routine in this table. For more information, see Section 3.35.
for_rtl_init_ for_rtl_init_(3f) Initializes the DIGITAL Fortran 90 run-time library (RTL) environment for a C program. Use this subroutine from a main program written in C that calls DIGITAL Fortran 90 subprograms.

Calling this subroutine from the main C program initializes DIGITAL Fortran 90 RTL data. It also establishes DIGITAL Fortran 90 RTL signal handlers and floating-point exception handling so that the DIGITAL Fortran 90 subprograms behave as if they were the main program. The trailing underscore (_) is required, and this routine must be called from a C program.

For an example of for_rtl_init_, see Section 11.4.

for_rtl_finish_ for_rtl_init_(3f) Cleans up the DIGITAL Fortran 90 run-time library (RTL) environment for a C main program that previously called for_rtl_init_ . A status value is returned by this function. The trailing underscore (_) is required, and this routine must be called from a C program. Also see for_rtl_init_ .
for_set_fpe for_set_fpe(3f) Changes the floating-point exception (fpe) handling currently set for the program and also returns the status of the previous floating-point exception (fpe) handling setting. Can be used with for_get_fpe . For more information, see Section 3.35.
fork fork(3f) Creates a copy of the calling process.
fputc putc(3f) Writes a character to a specified logical unit.
free malloc(3f) Frees the memory allocated by falloc or malloc . Consider using the ALLOCATABLE attribute or the ALLOCATE and DEALLOCATE statements.
fseek fseek(3f) Repositions a file on a logical unit.
fstat stat(3f) Returns information about file status. The file is specified as a Fortran 90 logical unit number.
fsynch fsynch(3f) Writes the output in buffer to permanent storage.
ftell fseek(3f) Repositions a file on a logical unit.
gerror perror(3f) Writes system error messages.
getarg getarg(3f) Returns the command line arguments.
getc getc(3f) Returns a character from a logical unit.
getcwd getcwd(3f) Returns the directory path of the current directory.
getenv getenv(3f) Returns the value of environment variables.
getfd getfd(3f) For a file already opened by the DIGITAL Fortran 90 Run-Time Library, returns the file descriptor associated with a particular unit number.
getgid getuid(3f) Returns the group's id of the caller.
getlog getlog(3f) Returns the user's login name.
getpid getuid(3f) Returns the process id.
getuid getuid(3f) Returns the user's or group's id of the caller.
gmtime time(3f) Returns the system time in month, day, and so forth in G.M.T.
iargc getarg(3f) Returns the command line arguments.
idate idate(3f) Returns the date or time in numeric form. Also available as an intrinsic subroutine (DIGITAL extension) described in the DIGITAL Fortran Language Reference Manual.
ierrno perror(3f) Returns a system error message number.
index index(3f) Returns the index of a substring within the string. Consider using INDEX intrinsic function described in the DIGITAL Fortran Language Reference Manual.
irand rand(3f) Generates random values. For an example program that uses irand , see Section 12.7.
irandm random(3f) Generates a positive integer random number.
isatty ttynam(3f) Returns whether the specified unit is a terminal port. Use as a subroutine.
itime idate(3f) Returns the date or time in numeric form.
kill kill(3f) Sends a signal to a process.
len index(3f) Returns the length of a string. Use the LEN intrinsic function described in the DIGITAL Fortran Language Reference Manual.
link link(3f) Makes a directory link to an existing file.
lnblnk index(3f) Returns the index of the last nonblank character in a string.
loc loc(3f) Returns the address of an object. Similar to the %LOC built-in function described in the DIGITAL Fortran Language Reference Manual.
long long(3f) Converts INTEGER*2 to INTEGER*4.
lshift bit(3f) Shifts a word left by n bits. Use as an intrinsic function.
lstat stat(3f) Returns information about a file or a symbolic link.
ltime time(3f) Returns the system time in month, day, hour, minute, and seconds for the time zone.
malloc malloc(3f) Returns the address of a block of virtual memory. See also free . Consider using the ALLOCATABLE attribute or the ALLOCATE and DEALLOCATE statements.
not bit(3f) Returns the bitwise NOT (complement) of the operand. Use as an intrinsic function.
omp_set_num_threads omp_set_num_threads(3f) Sets the number of threads to use for the next parallel region.
omp_get_num_threads omp_get_num_threads(3f) Gets the number of threads currently in the team executing the parallel region from which the routine is called.
omp_get_max_threads omp_get_max_threads(3f) Gets the maximum value that can be returned by calls to the omp_get_num_threads() function.
omp_get_thread_num omp_get_thread_num(3f) Gets the thread number, within the team, in the range from zero to omp_get_num_threads() minus one.
omp_get_num_procs omp_get_num_procs(3f) Gets the number of processors that are available to the program.
omp_in_parallel omp_in_parallel(3f) Informs whether or not a region is executing in parallel.
omp_set_dynamic omp_set_dynamic(3f) Enables or disables dynamic adjustment of the number of threads available for execution of parallel regions.
omp_get_dynamic omp_get_dynamic(3f) Informs if dynamic thread adjustment is enabled.
omp_set_nested omp_set_nested(3f) Enables or disables nested parallelism.
omp_get_nested omp_get_nested(3f) Informs if nested parallelism is enabled.
omp_init_lock omp_init_lock(3f) Initializes a lock to be used in subsequent calls.
omp_destroy_lock omp_destroy_lock(3f) Disassociates a lock variable from any locks.
omp_set_lock omp_destroy_lock(3f) Makes the executing thread wait until the specified lock is available.
omp_unset_lock omp_set_lock(3f) Releases the executing thread from ownership of the lock.
omp_test_lock omp_unset_lock(3f) Try to set the lock associated with a lock variable.
or bit(3f) Returns the bitwise OR of two operands. Use as an intrinsic function.
perror perror(3f) Writes system error messages.
putc putc(3f) Writes a character to a Fortran 90 logical unit.
qsort qsort(3f) Performs a quick sort of array elements. For an example program that uses qsort , see Section 12.7.
rand rand(3f) Generates random values.
random random(3f) Generates a single-precision (REAL) random number.
rename rename(3f) Renames a file.
rindex index(3f) Returns index of a substring within the string. See also index and the INDEX intrinsic function described in the DIGITAL Fortran Language Reference Manual.
rshift bit(3f) Shifts a word right by n bits. Use as an intrinsic function.
short long(3f) Converts INTEGER*4 to INTEGER*2.
shcom_connect shcom_connect(3f) Allows multiple processes to access common block data in a shared library (uses memory mapping).
signal signal(3f) Changes the action of a signal.
sleep sleep(3f) Suspends execution for an interval.
srand rand(3f) Initializes the seed for subsequent use of rand and irand .
stat stat(3f) Returns information about the status of specified file.
symlnk link(3f) Makes a symbolic directory link to an existing file.
system system(3f) Executes a shell command.
tclose topen(3f) Disassociates (closes) a magnetic tape device name with a tape logical unit.
time time(3f) Returns the system time in number of seconds from 00:00:00 G.M.T. January 1, 1970. Also available as an intrinsic subroutine (DIGITAL extension) described in the DIGITAL Fortran Language Reference Manual.
topen topen(3f) Associates (opens) a magnetic tape device name with a tape logical unit.
tread topen(3f) Reads the next physical record from tape to a buffer.
trewin topen(3f) Rewinds the tape associated with the tape logical unit to the beginning of the first data file.
tskipf topen(3f) Skips over files and/or records on magnetic tape devices.
tstate topen(3f) Determines the logical state of the magnetic tape I/O channel (the tape drive control status register).
ttynam ttynam(3f) Returns the name of a terminal port or returns blanks if specified unit is not a terminal port.
twrite topen(3f) Writes the next physical record from the buffer to tape.
umask umask(3f) Sets the file mode creation mask (protection).
unlink unlink(3f) Removes a directory entry. See also link .
wait wait(3f) Waits for the process to terminate.
xor bit(3f) Returns the bitwise exclusive OR of two operands. Use as an intrinsic function.


Previous Next Contents Index