Privacy & Legal Notice


mbaselib - a fortran library interface to the unix system


f77 prog_file.f -lmbase


MBASELIB is a library of routines that provide a Fortran interface to a multitude of machine and system dependent capabilities in a machine-independent form. MBASELIB is very similar to earlier versions of BASELIB. It can perform number conversions, absolute disk I/O, system interrogation functions, string scanning, and parent/child communication.

The MBASELIB routines are all written in C. The library is installed in /usr/local/lib/libmbase.a. It is distributed as the tar file MBASEver.tar (ver is the version number) for use on other UNIX platforms. This file contains the files:

The MBASELIB library is comprised of five groups of routines.

  1. The names of the number conversion routines begin with MC.
  2. The names of the routines dealing with file I/O begin with MF.
  3. The names of the routines that Get system data begin with MG.
  4. The names of the character-handling routines begin with MS.
  5. The names of the parent/child control routines begin with MZ.

All MBASELIB routines must be called with the exact number and correct type of arguments according to their definition. MBASELIB is implemented with the assumption that integers are 64-bit values on Cray machines, and 32-bit values on other platforms. Floating point numbers are 64-bit values on all platforms. Also, MBASELIB requires all ASCII data to be passed in Fortran character variables.


Error status values are returned by all the MBASELIB functions except the MS routines. The meanings of the error values have the following general description:

0    No errors occurred for the current function
<0  System error; negative of the Unix errno value
1    Invalid input argument for the current function
2    Trouble opening, creating, or referencing a file
3    Conflict in the specification of an ioc or handle
4    Resource such as disk or memory is not available
5    Access permission problems referencing a file
6    Requested data exceeds its specified space
7    Trouble communicating with child process
8    An end-of-file condition was detected
9    Requested information not available


MCETOA Convert a binary floating-point number to E-type.
MCFATOB Convert a decimal string to a binary real number.
MCFTOA Convert a binary floating-point number to F-type.
MCHATOB Convert a hexadecimal string to a binary integer.
MCHTOA Convert a binary integer to (hexadecimal) Z-type.
MCIATOB Convert a decimal string to a binary integer.
MCITOA Convert a binary integer to (integer) I-type.
MCOATOB Convert an octal string to a binary integer.
MCOTOA Convert a binary integer to (octal) O-type.
MFCHANGE Change the name of a file.
MFCLOSE Close a file.
MFDKIN Read data from a file.
MFDKOUT Write data to a file.
MFDSTROY Unlink a file.
MFGETIOC Return an available IOC.
MFIOCNAM Return pathname of a file.
MFIODONE Wait for all I/O to complete.
MFIOSTAT Check status of I/O.
MFOPEN Open or create a file for I/O.
MFRLSIOC Release a reservation on an IOC.
MFRSVIOC Reserve an IOC.
MFSHRINK Truncate the length of a file to an indicated size.
MFWRZERO Write zeros in a file to set the file written length.
MGFILNDX Return file name entries from indicated directory.
MGFSTAT Return information about the indicated file.
MGHOSTNM Return the name of the host for the calling process.
MGLDINFO Return time and date current file last modified.
MGLIMIT Return the remaining time limit for the process.
MGLOGNM Return the log-in name for the current session.
MGMAXFL Return maximum field length for a machine.
MGMICS Return current reading of the microsecond clock.
MGPID Return the process id of the current process.
MGPRGFL Get current program field length in bytes.
MGTIME Return the current time and date in ASCII.
MGUSTIME Get elapsed time used by the current process.
MSCANLEQ Scan a string from the left for equality.
MSCANLNE Scan a string from the left for inequality.
MSCANREQ Scan a string from the right for equality.
MSCANRNE Scan a string from the right for inequality.
MSIGMA29 Compute the LLNL 29-bit universal checksum.
MSKEYBYT Search a string for a pattern.
MSMOVCHR Move a character string.
MSTRNLAT Translate a character string.
MZDSCNEK Terminate a child process.
MZEXIT Terminate the current process.
MZGETMC Get a message from a child process.
MZGETMP Get message from parent process or standard input.
MZGETSC Get symbols from a child process.
MZGETSP Get symbols from parent process or standard input.
MZISATTY Return flags for standard input, output, and error.
MZNITIAL Initialize a child process from a file.
MZSNDMC Send a message to a child process.
MZSNDMP Send message to parent process or standard output.
MZSTAT Return the exit status of a child.



High Performance Computing at LLNL   Lawrence Livermore National Laboratory

Last modified October 8, 2007
UCRL-MI-126792 Rev. 1