2 C The following code was excerpted from: initcb.f
4 SUBROUTINE INITCB
(TOLIN
)
8 C Written and copyright by:
9 C Barry Joe, Dept. of Computing Science, Univ. of Alberta
10 C Edmonton, Alberta, Canada T6G 2H1
11 C Phone: (403) 492-5757 Email: barry@cs.ualberta.ca
13 C Purpose: Initialize global variables in common blocks
14 C GERROR, GCONST, and GPRINT. The latter is used for
15 C printing debugging information.
18 C TOLIN - relative tolerance used to determine TOL
20 C Output parameters in common blocks:
21 C IERR - error code, initialized to 0
23 C TOL - relative tolerance MAX(TOLIN,100.0D0*EPS) where
24 C EPS is approximation to machine epsilon
25 C IPRT - standard output unit 6
26 C MSGLVL - message level, initialized to 0
28 INTEGER IERR
,IPRT
,MSGLVL
29 DOUBLE PRECISION PI
,TOL
31 COMMON /GCONST
/ PI
,TOL
32 COMMON /GPRINT
/ IPRT
,MSGLVL
33 SAVE
/GERROR
/,/GCONST
/,/GPRINT
/
35 DOUBLE PRECISION EPS
,EPSP1
43 IF (EPSP1
.GT
. 1.0D0
) GO TO 10
44 TOL
= MAX
(TOLIN
,100.0D0*EPS
)
49 C The following code was excerpted from: rotiar.f
51 SUBROUTINE ROTIAR
(N
,ARR
,SHIFT
)
52 IMPLICIT LOGICAL (A
-Z
)
56 C Written and copyright by:
57 C Barry Joe, Dept. of Computing Science, Univ. of Alberta
58 C Edmonton, Alberta, Canada T6G 2H1
59 C Phone: (403) 492-5757 Email: barry@cs.ualberta.ca
61 C Purpose: Rotate elements of integer array.
64 C N - number of elements of array
65 C ARR(0:N-1) - integer array
66 C SHIFT - amount of (left) shift or rotation; ARR(SHIFT) on input
67 C becomes ARR(0) on output
70 C ARR(0:N-1) - rotated integer array
72 INTEGER A
,B
,I
,J
,K
,L
,M
,R
,SH
,T
75 IF (SH
.LT
. 0) SH
= SH
+ N
83 IF (R
.GT
. 0) GO TO 20
90 IF (L
.GE
. N
) L
= L
- N