next up previous contents
Next: Makefile Up: Installation Previous: Installation

System Dependent Routines

 

MGGHAT was written to be as portable as possible, however there are three routines that are necessarily system dependent: second, system, and r1mach.

real function second is used for measuring elapsed CPU time. Since FORTRAN does not have a standard function for measuring elapsed time, this routine is system dependent. The function should return a value such that the difference between two evaluations will provide the intervening user CPU time in seconds. Typically, second returns the amount of CPU time since the beginning of the program execution. Three versions are provided with MGGHAT , one of which might work on your system. second.f uses the function etime, which is available on many UNIX systems. second.c interfaces with the C sys include files and function times, and should work if you can interface to C properly. Note, however, that I have encountered systems on which the macro HZ (Hertz) is not defined. Finally, second.aix.f is a version that works on the AIX system to which I have access.

subroutine system is used to invoke an operating system command. There are two possible problems with this routine. First, the routine itself is not a FORTRAN intrinsic, although it exists on many UNIX versions of FORTRAN . You may need to find an equivalent subroutine on your system, and write a version of system that calls that routine. For example, Cray uses subroutine ishell for this purpose, so I have provided the file system.cray.f with a version of system that calls ishell. Also, makefile.cray is modified to reflect the need to link in this version of system.

The second problem is that the operating system commands may differ between systems. MGGHAT assumes the operating system is some variant of UNIX . There are 5 instances of call system. They will be invoked only if the widget based menu for graphics is active. (In other words, if you do not use the widget based menu, you can provide a dummy routine for system.) Four of them issue a rm (remove) command; the fifth starts up the Tcl/Tk program wish . If your system is not UNIX , you may need to modify the source code to correct these system calls. You can find them by searching for the string call system in the file mgghat.f.

real function r1mach is used for defining constants relevant to the machine dependent arithmetic. Although r1mach is actually a BLAS routine, and hence can be obtained from netlib , I have included a copy of r1mach with MGGHAT . This copy contains the constants for a larger set of machines than the standard versions, including the ``auto-double'' version for some machines. As with the other BLAS routines, if you have the routine in your system library, you should use that version (see section 3.2). Otherwise, edit r1mach.f to select the constants for your machine, and r1mach8.f to select the constants for the auto-double version. As provided, these routines are configured for machines with IEEE arithmetic. It is not certain that r1mach8.f is correct for all such machines, but for the purposes of MGGHAT the constants are probably close enough.



next up previous contents
Next: Makefile Up: Installation Previous: Installation



william.mitchell@nist.gov