Technical Briefs
ROHAN help Files
IMSL - Compiling and Executing the Program
IMPORTANT: Before compiling any program using IMSL functions or subroutines
you must issue the command
source /opt/imsl/ipt/bin/iptsetup.csh
Add this line to your .login file, so that it is run automatically every time you log in.
Below is a record of a ROHAN terminal session during which the program
is compiled and executed. To start recording a session on rohan, type
script; to end recording, type exit. Optionally, you can specify a
filename for the session record in the script command.
Note that the program duvsta.f specifies that results are to be printed
to the terminal (actually, to the file a.out which can then be viewed as
below). Alternatively, you could write the results to an output file;
the DUVSTA subroutine stores results in the two-dimensional STAT array.
Script started on Mon Oct 02 14:38:19 1995
rohan% f77 -limsl -lsocket duvsta.f
duvsta.f:
MAIN sumstats:
rohan% a.out
Univariate Statistics from UVSTA
Variable Mean Variance Std. Dev. Skewness Kurtosis
1 72.3873 1471.6868 38.3626 0.9082 0.3221
Variable Minimum Maximum Range Coef. Var. Count
1 17.8800 173.4000 155.5200 0.5300 22.0000
Variable Lower CLM Upper CLM Lower CLV Upper CLV
1 58.3134 86.4611 945.9712 2666.2590
rohan% exit
rohan%
script done on Mon Oct 02 14:54:29 1995
Writing the Main Program
Here is the listing of a Fortran program that invokes IMSL to compute
summary statistics for a set of data:
program sumstats
C -----------------------------------------------------------------
C This program computes basic univariate statistics for a data set
C contained in the input file DATA.DAT. The IMSL subroutine DUVSTA
C is called to perform the calculations in double precision.
C
C Written by John Q. Public -- February 1990.
C Most recent modification -- September 1995.
C -----------------------------------------------------------------
parameter(ldstat=15, ldx=22, nvar=1)
implicit double precision (a-h,o-r,t-z)
double precision x(ldx,nvar),stat(ldstat,nvar)
C -----------------------------------------------------------------
C Open the input file and read the data.
C -----------------------------------------------------------------
open(unit=13,file='data.dat',status='old')
do i=1,ldx
do j=1,nvar
read(13,*,end=99) x(i,j)
end do
end do
99 close(unit=13,dispose='keep')
C -----------------------------------------------------------------
C Specify values for the input arguments to DUVSTA, then issue
C the subroutine call to perform the computations and print
C the results out to the screen.
C -----------------------------------------------------------------
ido=0
nrow=ldx
ifrq=0
iwt=0
mopt=1
conprm=90.0d0
conprv=90.0d0
iprint=1
call duvsta(ido,nrow,nvar,x,ldx,ifrq,iwt,mopt,
+ conprm,conprv,iprint,stat,ldstat,nrmiss)
end
|
|