home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
apps
/
math
/
matlab
/
src
/
mat2.f
< prev
next >
Wrap
Text File
|
1992-04-21
|
33KB
|
1,081 lines
SUBROUTINE FACTOR
DOUBLE PRECISION STKR(50005),STKI(50005)
INTEGER IDSTK(4,48),LSTK(48),MSTK(48),NSTK(48),VSIZE,LSIZE,BOT,TOP
INTEGER IDS(4,32),PSTK(32),RSTK(32),PSIZE,PT,PTZ
INTEGER DDT,ERR,FMT,LCT(4),LIN(1024),LPT(6),RIO,WIO,RTE,WTE,HIO
INTEGER SYM,SYN(4),BUF(256),CHAR,FLP(2),FIN,FUN,LHS,RHS,RAN(2)
COMMON /VSTK/ STKR,STKI,IDSTK,LSTK,MSTK,NSTK,VSIZE,LSIZE,BOT,TOP
COMMON /RECU/ IDS,PSTK,RSTK,PSIZE,PT,PTZ
COMMON /IOP/ DDT,ERR,FMT,LCT,LIN,LPT,RIO,WIO,RTE,WTE,HIO
COMMON /COM/ SYM,SYN,BUF,CHAR,FLP,FIN,FUN,LHS,RHS,RAN
INTEGER SEMI,EOL,BLANK,R,ID(4),EXCNT,LPAREN,RPAREN
INTEGER STAR,DSTAR,COMMA,LESS,GREAT,QUOTE,NUM,NAME,ALFL
DATA DSTAR/54/,SEMI/39/,EOL/99/,BLANK/36/
DATA STAR/43/,COMMA/48/,LPAREN/37/,RPAREN/38/
DATA LESS/50/,GREAT/51/,QUOTE/49/,NUM/0/,NAME/1/,ALFL/52/
IF (DDT .EQ. 1) WRITE(WTE,100) PT,RSTK(PT),SYM
100 FORMAT(0X,'FACTOR',3I4)
R = RSTK(PT)
GO TO (99,99,99,99,99,99,99,01,01,25,45,65,99,99,99,55,75,32,37),R
01 IF (SYM.EQ.NUM .OR. SYM.EQ.QUOTE .OR. SYM.EQ.LESS) GO TO 10
IF (SYM .EQ. GREAT) GO TO 30
EXCNT = 0
IF (SYM .EQ. NAME) GO TO 40
ID(1) = BLANK
IF (SYM .EQ. LPAREN) GO TO 42
CALL ERROR(2)
IF (ERR .GT. 0) RETURN
C
C PUT SOMETHING ON THE STACK
10 L = 1
IF (TOP .GT. 0) L = LSTK(TOP) + MSTK(TOP)*NSTK(TOP)
IF (TOP+1 .GE. BOT) CALL ERROR(18)
IF (ERR .GT. 0) RETURN
TOP = TOP+1
LSTK(TOP) = L
IF (SYM .EQ. QUOTE) GO TO 15
IF (SYM .EQ. LESS) GO TO 20
C
C SINGLE NUMBER, GETSYM STORED IT IN STKI
MSTK(TOP) = 1
NSTK(TOP) = 1
STKR(L) = STKI(VSIZE)
STKI(L) = 0.0D0
CALL GETSYM
GO TO 60
C
C STRING
15 N = 0
LPT(4) = LPT(3)
CALL GETCH
16 IF (CHAR .EQ. QUOTE) GO TO 18
17 LN = L+N
IF (CHAR .EQ. EOL) CALL ERROR(31)
IF (ERR .GT. 0) RETURN
STKR(LN) = CHAR
STKI(LN) = 0.0D0
N = N+1
CALL GETCH
GO TO 16
18 CALL GETCH
IF (CHAR .EQ. QUOTE) GO TO 17
IF (N .LE. 0) CALL ERROR(31)
IF (ERR .GT. 0) RETURN
MSTK(TOP) = 1
NSTK(TOP) = N
CALL GETSYM
GO TO 60
C
C EXPLICIT MATRIX
20 MSTK(TOP) = 0
NSTK(TOP) = 0
21 TOP = TOP + 1
LSTK(TOP) = LSTK(TOP-1) + MSTK(TOP-1)*NSTK(TOP-1)
MSTK(TOP) = 0
NSTK(TOP) = 0
CALL GETSYM
22 IF (SYM.EQ.SEMI .OR. SYM.EQ.GREAT .OR. SYM.EQ.EOL) GO TO 27
IF (SYM .EQ. COMMA) CALL GETSYM
PT = PT+1
RSTK(PT) = 10
C *CALL* EXPR
RETURN
25 PT = PT-1
TOP = TOP - 1
IF (MSTK(TOP) .EQ. 0) MSTK(TOP) = MSTK(TOP+1)
IF (MSTK(TOP) .NE. MSTK(TOP+1)) CALL ERROR(5)
IF (ERR .GT. 0) RETURN
NSTK(TOP) = NSTK(TOP) + NSTK(TOP+1)
GO TO 22
27 IF (SYM.EQ.SEMI .AND. CHAR.EQ.EOL) CALL GETSYM
CALL STACK1(QUOTE)
IF (ERR .GT. 0) RETURN
TOP = TOP - 1
IF (MSTK(TOP) .EQ. 0) MSTK(TOP) = MSTK(TOP+1)
IF (MSTK(TOP).NE.MSTK(TOP+1) .AND. MSTK(TOP+1).GT.0) CALL ERROR(6)
IF (ERR .GT. 0) RETURN
NSTK(TOP) = NSTK(TOP) + NSTK(TOP+1)
IF (SYM .EQ. EOL) CALL GETLIN
IF (SYM .NE. GREAT) GO TO 21
CALL STACK1(QUOTE)
IF (ERR .GT. 0) RETURN
CALL GETSYM
GO TO 60
C
C MACRO STRING
30 CALL GETSYM
IF (SYM.EQ.LESS .AND. CHAR.EQ.EOL) CALL ERROR(28)
IF (ERR .GT. 0) RETURN
PT = PT+1
RSTK(PT) = 18
C *CALL* EXPR
RETURN
32 PT = PT-1
IF (SYM.NE.LESS .AND. SYM.NE.EOL) CALL ERROR(37)
IF (ERR .GT. 0) RETURN
IF (SYM .EQ. LESS) CALL GETSYM
K = LPT(6)
LIN(K+1) = LPT(1)
LIN(K+2) = LPT(2)
LIN(K+3) = LPT(6)
LPT(1) = K + 4
C TRANSFER STACK TO INPUT LINE
K = LPT(1)
L = LSTK(TOP)
N = MSTK(TOP)*NSTK(TOP)
DO 34 J = 1, N
LS = L + J-1
LIN(K) = IDINT(STKR(LS))
IF (LIN(K).LT.0 .OR. LIN(K).GE.ALFL) CALL ERROR(37)
IF (ERR .GT. 0) RETURN
IF (K.LT.1024) K = K+1
IF (K.EQ.1024) WRITE(WTE,33) K
33 FORMAT(0X,'INPUT BUFFER LIMIT IS ',I4,' CHARACTERS.')
34 CONTINUE
TOP = TOP-1
LIN(K) = EOL
LPT(6) = K
LPT(4) = LPT(1)
LPT(3) = 0
LPT(2) = 0
LCT(1) = 0
CHAR = BLANK
CALL GETSYM
PT = PT+1
RSTK(PT) = 19
C *CALL* EXPR
RETURN
37 PT = PT-1
K = LPT(1) - 4
LPT(1) = LIN(K+1)
LPT(4) = LIN(K+2)
LPT(6) = LIN(K+3)
CHAR = BLANK
CALL GETSYM
GO TO 60
C
C FUNCTION OR MATRIX ELEMENT
40 CALL PUTID(ID,SYN)
CALL GETSYM
IF (SYM .EQ. LPAREN) GO TO 42
RHS = 0
CALL FUNS(ID)
IF (FIN .NE. 0) CALL ERROR(25)
IF (ERR .GT. 0) RETURN
CALL STACKG(ID)
IF (ERR .GT. 0) RETURN
IF (FIN .EQ. 7) GO TO 50
IF (FIN .EQ. 0) CALL PUTID(IDS(1,PT+1),ID)
IF (FIN .EQ. 0) CALL ERROR(4)
IF (ERR .GT. 0) RETURN
GO TO 60
C
42 CALL GETSYM
EXCNT = EXCNT+1
PT = PT+1
PSTK(PT) = EXCNT
CALL PUTID(IDS(1,PT),ID)
RSTK(PT) = 11
C *CALL* EXPR
RETURN
45 CALL PUTID(ID,IDS(1,PT))
EXCNT = PSTK(PT)
PT = PT-1
IF (SYM .EQ. COMMA) GO TO 42
IF (SYM .NE. RPAREN) CALL ERROR(3)
IF (ERR .GT. 0) RETURN
IF (SYM .EQ. RPAREN) CALL GETSYM
IF (ID(1) .EQ. BLANK) GO TO 60
RHS = EXCNT
CALL STACKG(ID)
IF (ERR .GT. 0) RETURN
IF (FIN .EQ. 0) CALL FUNS(ID)
IF (FIN .EQ. 0) CALL ERROR(4)
IF (ERR .GT. 0) RETURN
C
C EVALUATE MATRIX FUNCTION
50 PT = PT+1
RSTK(PT) = 16
C *CALL* MATFN
RETURN
55 PT = PT-1
GO TO 60
C
C CHECK FOR QUOTE (TRANSPOSE) AND ** (POWER)
60 IF (SYM .NE. QUOTE) GO TO 62
I = LPT(3) - 2
IF (LIN(I) .EQ. BLANK) GO TO 90
CALL STACK1(QUOTE)
IF (ERR .GT. 0) RETURN
CALL GETSYM
62 IF (SYM.NE.STAR .OR. CHAR.NE.STAR) GO TO 90
CALL GETSYM
CALL GETSYM
PT = PT+1
RSTK(PT) = 12
C *CALL* FACTOR
GO TO 01
65 PT = PT-1
CALL STACK2(DSTAR)
IF (ERR .GT. 0) RETURN
IF (FUN .NE. 2) GO TO 90
C MATRIX POWER, USE EIGENVECTORS
PT = PT+1
RSTK(PT) = 17
C *CALL* MATFN
RETURN
75 PT = PT-1
90 RETURN
99 CALL ERROR(22)
IF (ERR .GT. 0) RETURN
RETURN
END
SUBROUTINE FUNS(ID)
INTEGER ID(4)
C
C SCAN FUNCTION LIST
C
DOUBLE PRECISION STKR(50005),STKI(50005)
INTEGER IDSTK(4,48),LSTK(48),MSTK(48),NSTK(48),VSIZE,LSIZE,BOT,TOP
INTEGER DDT,ERR,FMT,LCT(4),LIN(1024),LPT(6),RIO,WIO,RTE,WTE,HIO
INTEGER SYM,SYN(4),BUF(256),CHAR,FLP(2),FIN,FUN,LHS,RHS,RAN(2)
COMMON /VSTK/ STKR,STKI,IDSTK,LSTK,MSTK,NSTK,VSIZE,LSIZE,BOT,TOP
COMMON /IOP/ DDT,ERR,FMT,LCT,LIN,LPT,RIO,WIO,RTE,WTE,HIO
COMMON /COM/ SYM,SYN,BUF,CHAR,FLP,FIN,FUN,LHS,RHS,RAN
LOGICAL EQID
INTEGER FUNL,FUNN(4,57),FUNP(57)
DATA FUNL/57/
C
C 1 ABS ATAN BASE CHAR
C 2 CHOL CHOP COND CONJ
C 3 COS DET DIAG DIAR
C 4 DISP EIG EPS EXEC
C 5 EXP EYE FLOP HESS
C 6 HILB IMAG INV KRON
C 7 LINE LOAD LOG LU
C 8 MAGIC NORM ONES ORTH
C 9 PINV PLOT POLY PRINT
C $ PROD QR RAND RANK
C 1 RAT RCOND REAL ROOT
C 2 ROUND RREF SAVE SCHUR
C 3 SIN SIZE SQRT SUM
C 4 SVD TRIL TRIU USER
C 5 DEBUG
C
DATA FUNN/
1 10,11,28,36, 10,29,10,23, 11,10,28,14, 12,17,10,27,
2 12,17,24,21, 12,17,24,25, 12,24,23,13, 12,24,23,19,
3 12,24,28,36, 13,14,29,36, 13,18,10,16, 13,18,10,27,
4 13,18,28,25, 14,18,16,36, 14,25,28,36, 14,33,14,12,
5 14,33,25,36, 14,34,14,36, 15,21,24,25, 17,14,28,28,
6 17,18,21,11, 18,22,10,16, 18,23,31,36, 20,27,24,23,
7 21,18,23,14, 21,24,10,13, 21,24,16,36, 21,30,36,36,
8 22,10,16,18, 23,24,27,22, 24,23,14,28, 24,27,29,17,
9 25,18,23,31, 25,21,24,29, 25,24,21,34, 25,27,18,23,
$ 25,27,24,13, 26,27,36,36, 27,10,23,13, 27,10,23,20,
1 27,10,29,36, 27,12,24,23, 27,14,10,21, 27,24,24,29,
2 27,24,30,23, 27,27,14,15, 28,10,31,14, 28,12,17,30,
3 28,18,23,36, 28,18,35,14, 28,26,27,29, 28,30,22,36,
4 28,31,13,36, 29,27,18,21, 29,27,18,30, 30,28,14,27,
5 13,14,11,30/
C
DATA FUNP/
1 221,203,507,509, 106,609,303,225, 202,102,602,505,
4 506,211,000,501, 204,606,000,213, 105,224,101,611,
7 508,503,206,104, 601,304,608,402, 302,510,214,504,
$ 604,401,607,305, 511,103,223,215, 222,107,502,212,
3 201,610,205,603, 301,614,615,605, 512/
C
IF (ID(1).EQ.0) CALL PRNTID(FUNN,FUNL-1)
IF (ID(1).EQ.0) RETURN
C
DO 10 K = 1, FUNL
IF (EQID(ID,FUNN(1,K))) GO TO 20
10 CONTINUE
FIN = 0
RETURN
C
20 FIN = MOD(FUNP(K),100)
FUN = FUNP(K)/100
IF (RHS.EQ.0 .AND. FUNP(K).EQ.606) FIN = 0
IF (RHS.EQ.0 .AND. FUNP(K).EQ.607) FIN = 0
RETURN
END
SUBROUTINE STACKP(ID)
INTEGER ID(4)
C
C PUT VARIABLES INTO STORAGE
C
DOUBLE PRECISION STKR(50005),STKI(50005)
INTEGER IDSTK(4,48),LSTK(48),MSTK(48),NSTK(48),VSIZE,LSIZE,BOT,TOP
INTEGER DDT,ERR,FMT,LCT(4),LIN(1024),LPT(6),RIO,WIO,RTE,WTE,HIO
INTEGER SYM,SYN(4),BUF(256),CHAR,FLP(2),FIN,FUN,LHS,RHS,RAN(2)
COMMON /VSTK/ STKR,STKI,IDSTK,LSTK,MSTK,NSTK,VSIZE,LSIZE,BOT,TOP
COMMON /IOP/ DDT,ERR,FMT,LCT,LIN,LPT,RIO,WIO,RTE,WTE,HIO
COMMON /COM/ SYM,SYN,BUF,CHAR,FLP,FIN,FUN,LHS,RHS,RAN
LOGICAL EQID
INTEGER SEMI
DATA SEMI/39/
IF (DDT .EQ. 1) WRITE(WTE,100) ID
100 FORMAT(0X,'STACKP',4I4)
IF (TOP .LE. 0) CALL ERROR(1)
IF (ERR .GT. 0) RETURN
CALL FUNS(ID)
IF (FIN .NE. 0) CALL ERROR(25)
IF (ERR .GT. 0) RETURN
M = MSTK(TOP)
N = NSTK(TOP)
IF (M .GT. 0) L = LSTK(TOP)
IF (M .LT. 0) CALL ERROR(14)
IF (ERR .GT. 0) RETURN
IF (M .EQ. 0 .AND. N .NE. 0) GO TO 99
MN = M*N
LK = 0
MK = 1
NK = 0
LT = 0
MT = 0
NT = 0
C
C DOES VARIABLE ALREADY EXIST
CALL PUTID(IDSTK(1,BOT-1),ID)
K = LSIZE+1
05 K = K-1
IF (.NOT.EQID(IDSTK(1,K),ID)) GO TO 05
IF (K .EQ. BOT-1) GO TO 30
LK = LSTK(K)
MK = MSTK(K)
NK = NSTK(K)
MNK = MK*NK
IF (RHS .EQ. 0) GO TO 20
IF (RHS .GT. 2) CALL ERROR(15)
IF (ERR .GT. 0) RETURN
MT = MK
NT = NK
LT = L + MN
ERR = LT + MNK - LSTK(BOT)
IF (ERR .GT. 0) CALL ERROR(17)
IF (ERR .GT. 0) RETURN
CALL WCOPY(MNK,STKR(LK),STKI(LK),1,STKR(LT),STKI(LT),1)
C
C DOES IT FIT
20 IF (RHS.EQ.0 .AND. MN.EQ.MNK) GO TO 40
IF (K .GE. LSIZE-3) CALL ERROR(13)
IF (ERR .GT. 0) RETURN
C
C SHIFT STORAGE
IF (K .EQ. BOT) GO TO 25
LS = LSTK(BOT)
LL = LS + MNK
CALL WCOPY(LK-LS,STKR(LS),STKI(LS),-1,STKR(LL),STKI(LL),-1)
KM1 = K-1
DO 24 IB = BOT, KM1
I = BOT+KM1-IB
CALL PUTID(IDSTK(1,I+1),IDSTK(1,I))
MSTK(I+1) = MSTK(I)
NSTK(I+1) = NSTK(I)
LSTK(I+1) = LSTK(I)+MNK
24 CONTINUE
C
C DESTROY OLD VARIABLE
25 BOT = BOT+1
C
C CREATE NEW VARIABLE
30 IF (MN .EQ. 0) GO TO 99
IF (BOT-2 .LE. TOP) CALL ERROR(18)
IF (ERR .GT. 0) RETURN
K = BOT-1
CALL PUTID(IDSTK(1,K), ID)
IF (RHS .EQ. 1) GO TO 50
IF (RHS .EQ. 2) GO TO 55
C
C STORE
40 IF (K .LT. LSIZE) LSTK(K) = LSTK(K+1) - MN
MSTK(K) = M
NSTK(K) = N
LK = LSTK(K)
CALL WCOPY(MN,STKR(L),STKI(L),-1,STKR(LK),STKI(LK),-1)
GO TO 90
C
C VECT(ARG)
50 IF (MSTK(TOP-1) .LT. 0) GO TO 59
MN1 = 1
MN2 = 1
L1 = 0
L2 = 0
IF (N.NE.1 .OR. NK.NE.1) GO TO 52
L1 = LSTK(TOP-1)
M1 = MSTK(TOP-1)
MN1 = M1*NSTK(TOP-1)
M2 = -1
GO TO 60
52 IF (M.NE.1 .OR. MK.NE.1) CALL ERROR(15)
IF (ERR .GT. 0) RETURN
L2 = LSTK(TOP-1)
M2 = MSTK(TOP-1)
MN2 = M2*NSTK(TOP-1)
M1 = -1
GO TO 60
C
C MATRIX(ARG,ARG)
55 IF (MSTK(TOP-1).LT.0 .AND. MSTK(TOP-2).LT.0) GO TO 59
L2 = LSTK(TOP-1)
M2 = MSTK(TOP-1)
MN2 = M2*NSTK(TOP-1)
IF (M2 .LT. 0) MN2 = N
L1 = LSTK(TOP-2)
M1 = MSTK(TOP-2)
MN1 = M1*NSTK(TOP-2)
IF (M1 .LT. 0) MN1 = M
GO TO 60
C
59 IF (MN .NE. MNK) CALL ERROR(15)
IF (ERR .GT. 0) RETURN
LK = LSTK(K)
CALL WCOPY(MN,STKR(L),STKI(L),-1,STKR(LK),STKI(LK),-1)
GO TO 90
C
60 IF (MN1.NE.M .OR. MN2.NE.N) CALL ERROR(15)
IF (ERR .GT. 0) RETURN
LL = 1
IF (M1 .LT. 0) GO TO 62
DO 61 I = 1, MN1
LS = L1+I-1
MK = MAX0(MK,IDINT(STKR(LS)))
LL = MIN0(LL,IDINT(STKR(LS)))
61 CONTINUE
62 MK = MAX0(MK,M)
IF (M2 .LT. 0) GO TO 64
DO 63 I = 1, MN2
LS = L2+I-1
NK = MAX0(NK,IDINT(STKR(LS)))
LL = MIN0(LL,IDINT(STKR(LS)))
63 CONTINUE
64 NK = MAX0(NK,N)
IF (LL .LT. 1) CALL ERROR(21)
IF (ERR .GT. 0) RETURN
MNK = MK*NK
LK = LSTK(K+1) - MNK
ERR = LT + MT*NT - LK
IF (ERR .GT. 0) CALL ERROR(17)
IF (ERR .GT. 0) RETURN
LSTK(K) = LK
MSTK(K) = MK
NSTK(K) = NK
CALL WSET(MNK,0.0D0,0.0D0,STKR(LK),STKI(LK),1)
IF (NT .LT. 1) GO TO 67
DO 66 J = 1, NT
LS = LT+(J-1)*MT
LL = LK+(J-1)*MK
CALL WCOPY(MT,STKR(LS),STKI(LS),-1,STKR(LL),STKI(LL),-1)
66 CONTINUE
67 DO 68 J = 1, N
DO 68 I = 1, M
LI = L1+I-1
IF (M1 .GT. 0) LI = L1 + IDINT(STKR(LI)) - 1
LJ = L2+J-1
IF (M2 .GT. 0) LJ = L2 + IDINT(STKR(LJ)) - 1
LL = LK+LI-L1+(LJ-L2)*MK
LS = L+I-1+(J-1)*M
STKR(LL) = STKR(LS)
STKI(LL) = STKI(LS)
68 CONTINUE
GO TO 90
C
C POP STACK AND PRINT IF DESIRED
90 IF (K .EQ. BOT-1) BOT = BOT-1
99 IF (M .NE. 0) TOP = TOP - 1 - RHS
IF (M .EQ. 0) TOP = TOP - 1
IF (M .EQ. 0) RETURN
IF (SYM.NE.SEMI .AND. LCT(3).EQ.0) CALL PRINT(ID,K)
IF (SYM.EQ.SEMI .AND. LCT(3).EQ.1) CALL PRINT(ID,K)
RETURN
END
SUBROUTINE STACKG(ID)
INTEGER ID(4)
C
C GET VARIABLES FROM STORAGE
C
DOUBLE PRECISION STKR(50005),STKI(50005)
INTEGER IDSTK(4,48),LSTK(48),MSTK(48),NSTK(48),VSIZE,LSIZE,BOT,TOP
INTEGER DDT,ERR,FMT,LCT(4),LIN(1024),LPT(6),RIO,WIO,RTE,WTE,HIO
INTEGER SYM,SYN(4),BUF(256),CHAR,FLP(2),FIN,FUN,LHS,RHS,RAN(2)
COMMON /VSTK/ STKR,STKI,IDSTK,LSTK,MSTK,NSTK,VSIZE,LSIZE,BOT,TOP
COMMON /IOP/ DDT,ERR,FMT,LCT,LIN,LPT,RIO,WIO,RTE,WTE,HIO
COMMON /COM/ SYM,SYN,BUF,CHAR,FLP,FIN,FUN,LHS,RHS,RAN
LOGICAL EQID
IF (DDT .EQ. 1) WRITE(WTE,100) ID
100 FORMAT(0X,'STACKG',4I4)
CALL PUTID(IDSTK(1,BOT-1), ID)
K = LSIZE+1
10 K = K-1
IF (.NOT.EQID(IDSTK(1,K), ID)) GO TO 10
IF (K .GE. LSIZE-1 .AND. RHS .GT. 0) GO TO 98
IF (K .EQ. BOT-1) GO TO 98
LK = LSTK(K)
IF (RHS .EQ. 1) GO TO 40
IF (RHS .EQ. 2) GO TO 60
IF (RHS .GT. 2) CALL ERROR(21)
IF (ERR .GT. 0) RETURN
L = 1
IF (TOP .GT. 0) L = LSTK(TOP) + MSTK(TOP)*NSTK(TOP)
IF (TOP+1 .GE. BOT) CALL ERROR(18)
IF (ERR .GT. 0) RETURN
TOP = TOP+1
C
C LOAD VARIABLE TO TOP OF STACK
LSTK(TOP) = L
MSTK(TOP) = MSTK(K)
NSTK(TOP) = NSTK(K)
MN = MSTK(K)*NSTK(K)
ERR = L+MN - LSTK(BOT)
IF (ERR .GT. 0) CALL ERROR(17)
IF (ERR .GT. 0) RETURN
C IF RAND, MATFN6 GENERATES RANDOM NUMBER
IF (K .EQ. LSIZE) GO TO 97
CALL WCOPY(MN,STKR(LK),STKI(LK),1,STKR(L),STKI(L),1)
GO TO 99
C
C VECT(ARG)
40 IF (MSTK(TOP) .EQ. 0) GO TO 99
L = LSTK(TOP)
MN = MSTK(TOP)*NSTK(TOP)
MNK = MSTK(K)*NSTK(K)
IF (MSTK(TOP) .LT. 0) MN = MNK
DO 50 I = 1, MN
LL = L+I-1
LS = LK+I-1
IF (MSTK(TOP) .GT. 0) LS = LK + IDINT(STKR(LL)) - 1
IF (LS .LT. LK .OR. LS .GE. LK+MNK) CALL ERROR(21)
IF (ERR .GT. 0) RETURN
STKR(LL) = STKR(LS)
STKI(LL) = STKI(LS)
50 CONTINUE
MSTK(TOP) = 1
NSTK(TOP) = 1
IF (MSTK(K) .GT. 1) MSTK(TOP) = MN
IF (MSTK(K) .EQ. 1) NSTK(TOP) = MN
GO TO 99
C
C MATRIX(ARG,ARG)
60 TOP = TOP-1
L = LSTK(TOP)
IF (MSTK(TOP+1) .EQ. 0) MSTK(TOP) = 0
IF (MSTK(TOP) .EQ. 0) GO TO 99
L2 = LSTK(TOP+1)
M = MSTK(TOP)*NSTK(TOP)
IF (MSTK(TOP) .LT. 0) M = MSTK(K)
N = MSTK(TOP+1)*NSTK(TOP+1)
IF (MSTK(TOP+1) .LT. 0) N = NSTK(K)
L3 = L2 + N
MK = MSTK(K)
MNK = MSTK(K)*NSTK(K)
DO 70 J = 1, N
DO 70 I = 1, M
LI = L+I-1
IF (MSTK(TOP) .GT. 0) LI = L + IDINT(STKR(LI)) - 1
LJ = L2+J-1
IF (MSTK(TOP+1) .GT. 0) LJ = L2 + IDINT(STKR(LJ)) - 1
LS = LK + LI-L + (LJ-L2)*MK
IF (LS.LT.LK .OR. LS.GE.LK+MNK) CALL ERROR(21)
IF (ERR .GT. 0) RETURN
LL = L3 + I-1 + (J-1)*M
STKR(LL) = STKR(LS)
STKI(LL) = STKI(LS)
70 CONTINUE
MN = M*N
CALL WCOPY(MN,STKR(L3),STKI(L3),1,STKR(L),STKI(L),1)
MSTK(TOP) = M
NSTK(TOP) = N
GO TO 99
97 FIN = 7
FUN = 6
RETURN
98 FIN = 0
RETURN
99 FIN = -1
FUN = 0
RETURN
END
SUBROUTINE STACK1(OP)
INTEGER OP
C
C UNARY OPERATIONS
C
DOUBLE PRECISION STKR(50005),STKI(50005)
INTEGER IDSTK(4,48),LSTK(48),MSTK(48),NSTK(48),VSIZE,LSIZE,BOT,TOP
INTEGER DDT,ERR,FMT,LCT(4),LIN(1024),LPT(6),RIO,WIO,RTE,WTE,HIO
INTEGER SYM,SYN(4),BUF(256),CHAR,FLP(2),FIN,FUN,LHS,RHS,RAN(2)
COMMON /VSTK/ STKR,STKI,IDSTK,LSTK,MSTK,NSTK,VSIZE,LSIZE,BOT,TOP
COMMON /IOP/ DDT,ERR,FMT,LCT,LIN,LPT,RIO,WIO,RTE,WTE,HIO
COMMON /COM/ SYM,SYN,BUF,CHAR,FLP,FIN,FUN,LHS,RHS,RAN
INTEGER QUOTE
DATA QUOTE/49/
IF (DDT .EQ. 1) WRITE(WTE,100) OP
100 FORMAT(0X,'STACK1',I4)
L = LSTK(TOP)
M = MSTK(TOP)
N = NSTK(TOP)
MN = M*N
IF (MN .EQ. 0) GO TO 99
IF (OP .EQ. QUOTE) GO TO 30
C
C UNARY MINUS
CALL WRSCAL(MN,-1.0D0,STKR(L),STKI(L),1)
GO TO 99
C
C TRANSPOSE
30 LL = L + MN
ERR = LL+MN - LSTK(BOT)
IF (ERR .GT. 0) CALL ERROR(17)
IF (ERR .GT. 0) RETURN
CALL WCOPY(MN,STKR(L),STKI(L),1,STKR(LL),STKI(LL),1)
M = NSTK(TOP)
N = MSTK(TOP)
MSTK(TOP) = M
NSTK(TOP) = N
DO 50 I = 1, M
DO 50 J = 1, N
LS = L+MN+(J-1)+(I-1)*N
LL = L+(I-1)+(J-1)*M
STKR(LL) = STKR(LS)
STKI(LL) = -STKI(LS)
50 CONTINUE
GO TO 99
99 RETURN
END
SUBROUTINE STACK2(OP)
INTEGER OP
C
C BINARY AND TERNARY OPERATIONS
C
DOUBLE PRECISION STKR(50005),STKI(50005)
INTEGER IDSTK(4,48),LSTK(48),MSTK(48),NSTK(48),VSIZE,LSIZE,BOT,TOP
INTEGER IDS(4,32),PSTK(32),RSTK(32),PSIZE,PT,PTZ
INTEGER DDT,ERR,FMT,LCT(4),LIN(1024),LPT(6),RIO,WIO,RTE,WTE,HIO
INTEGER SYM,SYN(4),BUF(256),CHAR,FLP(2),FIN,FUN,LHS,RHS,RAN(2)
COMMON /VSTK/ STKR,STKI,IDSTK,LSTK,MSTK,NSTK,VSIZE,LSIZE,BOT,TOP
COMMON /RECU/ IDS,PSTK,RSTK,PSIZE,PT,PTZ
COMMON /IOP/ DDT,ERR,FMT,LCT,LIN,LPT,RIO,WIO,RTE,WTE,HIO
COMMON /COM/ SYM,SYN,BUF,CHAR,FLP,FIN,FUN,LHS,RHS,RAN
DOUBLE PRECISION WDOTUR,WDOTUI
DOUBLE PRECISION SR,SI,E1,ST,E2,T,FLOP
INTEGER PLUS,MINUS,STAR,DSTAR,SLASH,BSLASH,DOT,COLON
DATA PLUS/41/,MINUS/42/,STAR/43/,DSTAR/54/,SLASH/44/
DATA BSLASH/45/,DOT/47/,COLON/40/
C
IF (DDT .EQ. 1) WRITE(WTE,100) OP
100 FORMAT(0X,'STACK2',I4)
L2 = LSTK(TOP)
M2 = MSTK(TOP)
N2 = NSTK(TOP)
TOP = TOP-1
L = LSTK(TOP)
M = MSTK(TOP)
N = NSTK(TOP)
FUN = 0
IF (OP .EQ. PLUS) GO TO 01
IF (OP .EQ. MINUS) GO TO 03
IF (OP .EQ. STAR) GO TO 05
IF (OP .EQ. DSTAR) GO TO 30
IF (OP .EQ. SLASH) GO TO 20
IF (OP .EQ. BSLASH) GO TO 25
IF (OP .EQ. COLON) GO TO 60
IF (OP .GT. 2*DOT) GO TO 80
IF (OP .GT. DOT) GO TO 70
C
C ADDITION
01 IF (M .LT. 0) GO TO 50
IF (M2 .LT. 0) GO TO 52
IF (M .NE. M2) CALL ERROR(8)
IF (ERR .GT. 0) RETURN
IF (N .NE. N2) CALL ERROR(8)
IF (ERR .GT. 0) RETURN
CALL WAXPY(M*N,1.0D0,0.0D0,STKR(L2),STKI(L2),1,
$ STKR(L),STKI(L),1)
GO TO 99
C
C SUBTRACTION
03 IF (M .LT. 0) GO TO 54
IF (M2 .LT. 0) GO TO 56
IF (M .NE. M2) CALL ERROR(9)
IF (ERR .GT. 0) RETURN
IF (N .NE. N2) CALL ERROR(9)
IF (ERR .GT. 0) RETURN
CALL WAXPY(M*N,-1.0D0,0.0D0,STKR(L2),STKI(L2),1,
$ STKR(L),STKI(L),1)
GO TO 99
C
C MULTIPLICATION
05 IF (M2*M2*N2 .EQ. 1) GO TO 10
IF (M*N .EQ. 1) GO TO 11
IF (M2*N2 .EQ. 1) GO TO 10
IF (N .NE. M2) CALL ERROR(10)
IF (ERR .GT. 0) RETURN
MN = M*N2
LL = L + MN
ERR = LL+M*N+M2*N2 - LSTK(BOT)
IF (ERR .GT. 0) CALL ERROR(17)
IF (ERR .GT. 0) RETURN
CALL WCOPY(M*N+M2*N2,STKR(L),STKI(L),-1,STKR(LL),STKI(LL),-1)
DO 08 J = 1, N2
DO 08 I = 1, M
K1 = L + MN + (I-1)
K2 = L2 + MN + (J-1)*M2
K = L + (I-1) + (J-1)*M
STKR(K) = WDOTUR(N,STKR(K1),STKI(K1),M,STKR(K2),STKI(K2),1)
STKI(K) = WDOTUI(N,STKR(K1),STKI(K1),M,STKR(K2),STKI(K2),1)
08 CONTINUE
NSTK(TOP) = N2
GO TO 99
C
C MULTIPLICATION BY SCALAR
10 SR = STKR(L2)
SI = STKI(L2)
L1 = L
GO TO 13
11 SR = STKR(L)
SI = STKI(L)
L1 = L+1
MSTK(TOP) = M2
NSTK(TOP) = N2
13 MN = MSTK(TOP)*NSTK(TOP)
CALL WSCAL(MN,SR,SI,STKR(L1),STKI(L1),1)
IF (L1.NE.L)
$ CALL WCOPY(MN,STKR(L1),STKI(L1),1,STKR(L),STKI(L),1)
GO TO 99
C
C RIGHT DIVISION
20 IF (M2*N2 .EQ. 1) GO TO 21
IF (M2 .EQ. N2) FUN = 1
IF (M2 .NE. N2) FUN = 4
FIN = -1
RHS = 2
GO TO 99
21 SR = STKR(L2)
SI = STKI(L2)
MN = M*N
DO 22 I = 1, MN
LL = L+I-1
CALL WDIV(STKR(LL),STKI(LL),SR,SI,STKR(LL),STKI(LL))
IF (ERR .GT. 0) RETURN
22 CONTINUE
GO TO 99
C
C LEFT DIVISION
25 IF (M*N .EQ. 1) GO TO 26
IF (M .EQ. N) FUN = 1
IF (M .NE. N) FUN = 4
FIN = -2
RHS = 2
GO TO 99
26 SR = STKR(L)
SI = STKI(L)
MSTK(TOP) = M2
NSTK(TOP) = N2
MN = M2*N2
DO 27 I = 1, MN
LL = L+I-1
CALL WDIV(STKR(LL+1),STKI(LL+1),SR,SI,STKR(LL),STKI(LL))
IF (ERR .GT. 0) RETURN
27 CONTINUE
GO TO 99
C
C POWER
30 IF (M2*N2 .NE. 1) CALL ERROR(30)
IF (ERR .GT. 0) RETURN
IF (M .NE. N) CALL ERROR(20)
IF (ERR .GT. 0) RETURN
NEXP = IDINT(STKR(L2))
T = NEXP
IF (STKR(L2).NE.T .OR. STKI(L2).NE.0.0D0 .OR. NEXP.LT.2) GO TO 39
MN = M*N
ERR = L2+MN+N - LSTK(BOT)
IF (ERR .GT. 0) CALL ERROR(17)
IF (ERR .GT. 0) RETURN
CALL WCOPY(MN,STKR(L),STKI(L),1,STKR(L2),STKI(L2),1)
L3 = L2+MN
DO 36 KEXP = 2, NEXP
DO 35 J = 1, N
LS = L+(J-1)*N
CALL WCOPY(N,STKR(LS),STKI(LS),1,STKR(L3),STKI(L3),1)
DO 34 I = 1, N
LS = L2+I-1
LL = L+I-1+(J-1)*N
STKR(LL) = WDOTUR(N,STKR(LS),STKI(LS),N,STKR(L3),STKI(L3),1)
STKI(LL) = WDOTUI(N,STKR(LS),STKI(LS),N,STKR(L3),STKI(L3),1)
34 CONTINUE
35 CONTINUE
36 CONTINUE
GO TO 99
C
C NONINTEGER OR NONPOSITIVE POWER, USE EIGENVECTORS
39 FUN = 2
FIN = 0
GO TO 99
C
C ADD OR SUBTRACT SCALAR
50 IF (M2 .NE. N2) CALL ERROR(8)
IF (ERR .GT. 0) RETURN
M = M2
N = N2
MSTK(TOP) = M
NSTK(TOP) = N
SR = STKR(L)
SI = STKI(L)
CALL WCOPY(M*N,STKR(L+1),STKI(L+1),1,STKR(L),STKI(L),1)
GO TO 58
52 IF (M .NE. N) CALL ERROR(8)
IF (ERR .GT. 0) RETURN
SR = STKR(L2)
SI = STKI(L2)
GO TO 58
54 IF (M2 .NE. N2) CALL ERROR(9)
IF (ERR .GT. 0) RETURN
M = M2
N = N2
MSTK(TOP) = M
NSTK(TOP) = N
SR = STKR(L)
SI = STKI(L)
CALL WCOPY(M*N,STKR(L+1),STKI(L+1),1,STKR(L),STKI(L),1)
CALL WRSCAL(M*N,-1.0D0,STKR(L),STKI(L),1)
GO TO 58
56 IF (M .NE. N) CALL ERROR(9)
IF (ERR .GT. 0) RETURN
SR = -STKR(L2)
SI = -STKI(L2)
GO TO 58
58 DO 59 I = 1, N
LL = L + (I-1)*(N+1)
STKR(LL) = FLOP(STKR(LL)+SR)
STKI(LL) = FLOP(STKI(LL)+SI)
59 CONTINUE
GO TO 99
C
C COLON
60 E2 = STKR(L2)
ST = 1.0D0
N = 0
IF (RHS .LT. 3) GO TO 61
ST = STKR(L)
TOP = TOP-1
L = LSTK(TOP)
IF (ST .EQ. 0.0D0) GO TO 63
61 E1 = STKR(L)
C CHECK FOR CLAUSE
IF (RSTK(PT) .EQ. 3) GO TO 64
ERR = L + MAX0(3,IDINT((E2-E1)/ST)) - LSTK(BOT)
IF (ERR .GT. 0) CALL ERROR(17)
IF (ERR .GT. 0) RETURN
62 IF (ST .GT. 0.0D0 .AND. STKR(L) .GT. E2) GO TO 63
IF (ST .LT. 0.0D0 .AND. STKR(L) .LT. E2) GO TO 63
N = N+1
L = L+1
T = N
STKR(L) = E1 + T*ST
STKI(L) = 0.0D0
GO TO 62
63 NSTK(TOP) = N
MSTK(TOP) = 1
IF (N .EQ. 0) MSTK(TOP) = 0
GO TO 99
C
C FOR CLAUSE
64 STKR(L) = E1
STKR(L+1) = ST
STKR(L+2) = E2
MSTK(TOP) = -3
NSTK(TOP) = -1
GO TO 99
C
C ELEMENTWISE OPERATIONS
70 OP = OP - DOT
IF (M.NE.M2 .OR. N.NE.N2) CALL ERROR(10)
IF (ERR .GT. 0) RETURN
MN = M*N
DO 72 I = 1, MN
J = L+I-1
K = L2+I-1
IF (OP .EQ. STAR)
$ CALL WMUL(STKR(J),STKI(J),STKR(K),STKI(K),STKR(J),STKI(J))
IF (OP .EQ. SLASH)
$ CALL WDIV(STKR(J),STKI(J),STKR(K),STKI(K),STKR(J),STKI(J))
IF (OP .EQ. BSLASH)
$ CALL WDIV(STKR(K),STKI(K),STKR(J),STKI(J),STKR(J),STKI(J))
IF (ERR .GT. 0) RETURN
72 CONTINUE
GO TO 99
C
C KRONECKER
80 FIN = OP - 2*DOT - STAR + 11
FUN = 6
TOP = TOP + 1
RHS = 2
GO TO 99
C
99 RETURN
END
SUBROUTINE PRINT(ID,K)
C PRIMARY OUTPUT ROUTINE
INTEGER ID(4),K
DOUBLE PRECISION STKR(50005),STKI(50005)
INTEGER IDSTK(4,48),LSTK(48),MSTK(48),NSTK(48),VSIZE,LSIZE,BOT,TOP
INTEGER ALFA(52),ALFB(52),ALFL,CASE
INTEGER DDT,ERR,FMT,LCT(4),LIN(1024),LPT(6),RIO,WIO,RTE,WTE,HIO
INTEGER SYM,SYN(4),BUF(256),CHAR,FLP(2),FIN,FUN,LHS,RHS,RAN(2)
CHARACTER CLS
COMMON /VSTK/ STKR,STKI,IDSTK,LSTK,MSTK,NSTK,VSIZE,LSIZE,BOT,TOP
COMMON /ALFS/ ALFA,ALFB,ALFL,CASE
COMMON /IOP/ DDT,ERR,FMT,LCT,LIN,LPT,RIO,WIO,RTE,WTE,HIO
COMMON /COM/ SYM,SYN,BUF,CHAR,FLP,FIN,FUN,LHS,RHS,RAN
DOUBLE PRECISION S,TR,TI,PR(12),PI(12)
INTEGER FNO(11),FNL(11),SIG(12),PLUS,MINUS,BLANK,TYP,F
CHARACTER MYCHAR,CSIG(12)
DATA PLUS/41/,MINUS/42/,BLANK/36/
C FORMAT NUMBERS AND LENGTHS
DATA FNO /11,12,21,22,23,24,31,32,33,34,-1/
DATA FNL /12, 6, 8, 4, 6, 3, 4, 2, 3, 1, 1/
C FMT 1 2 3 4 5
C SHORT LONG SHORT E LONG E Z
C TYP 1 2 3
C INTEGER REAL COMPLEX
IF (DDT .EQ. 1) WRITE(WTE,100) ID
100 FORMAT(0X,'PRINT ',4I4)
IF (LCT(1) .LT. 0) GO TO 99
L = LSTK(K)
M = MSTK(K)
N = NSTK(K)
MN = M*N
TYP = 1
S = 0.0D0
DO 10 I = 1, MN
LS = L+I-1
TR = STKR(LS)
TI = STKI(LS)
KTR = DMIN1(DABS(TR),2147483647D0)
S = DMAX1(S,DABS(TR),DABS(TI))
IF (KTR .NE. DABS(TR)) TYP = MAX0(2,TYP)
IF (TI .NE. 0.0D0) TYP = 3
10 CONTINUE
IF (S .NE. 0.0D0) S = DLOG10(S)
KS = IDINT(S)
IF (-2 .LE. KS .AND. KS .LE. 1) KS = 0
IF (KS .EQ. 2 .AND. FMT .EQ. 1 .AND. TYP .EQ. 2) KS = 0
IF (TYP .EQ. 1 .AND. KS .LE. 2) F = 1
IF (TYP .EQ. 1 .AND. KS .GT. 2) F = 2
IF (TYP .EQ. 1 .AND. KS .GT. 9) TYP = 2
IF (TYP .EQ. 2) F = FMT + 2
IF (TYP .EQ. 3) F = FMT + 6
IF (MN.EQ.1 .AND. KS.NE.0 .AND. FMT.LT.3 .AND. TYP.NE.1) F = F+2
IF (FMT .EQ. 5) F = 11
JINC = FNL(F)
F = FNO(F)
S = 1.0D0
IF (F.EQ.21 .OR. F.EQ.22 .OR. F.EQ.31 .OR. F.EQ.32) S = 10.0D0**KS
LS = ((N-1)/JINC+1)*M + 2
IF (LCT(1) + LS .LE. LCT(2)) GO TO 20
LCT(1) = 0
WRITE(WTE,43) LS
READ(RTE,44,END=19) CLS
LS=ICHAR(CLS)
IF (LS .EQ. ALFA(BLANK+1)) GO TO 20
LCT(1) = -1
GO TO 99
19 CALL FILES(-RTE,BUF,BUF)
20 CONTINUE
WRITE(WTE,44)
IF (WIO .NE. 0) WRITE(WIO,44)
CALL PRNTID(ID,-1)
LCT(1) = LCT(1)+2
LUNIT = WTE
50 IF (S .NE. 1.0D0) WRITE(LUNIT,41) S
DO 80 J1 = 1, N, JINC
J2 = MIN0(N, J1+JINC-1)
WRITE(LUNIT,44)
IF (N .GT. JINC) WRITE(LUNIT,42) J1,J2
DO 70 I = 1, M
JM = J2-J1+1
DO 60 J = 1, JM
LS = L+I-1+(J+J1-2)*M
IF (F .LT. 20) BUF(J) = STKR(LS)
IF (F .LT. 20) GO TO 60
PR(J) = STKR(LS)/S
PI(J) = DABS(STKI(LS)/S)
SIG(J) = ALFA(PLUS+1)
IF (STKI(LS) .LT. 0.0D0) SIG(J) = ALFA(MINUS+1)
60 CONTINUE
DO 1000 J=1,JM
CSIG(J)=MYCHAR(SIG(J))
1000 CONTINUE
IF (F .EQ. 11) WRITE(LUNIT,11)(BUF(J),J=1,JM)
IF (F .EQ. 12) WRITE(LUNIT,12)(BUF(J),J=1,JM)
IF (F .EQ. 21) WRITE(LUNIT,21)(PR(J),J=1,JM)
IF (F .EQ. 22) WRITE(LUNIT,22)(PR(J),J=1,JM)
IF (F .EQ. 23) WRITE(LUNIT,23)(PR(J),J=1,JM)
IF (F .EQ. 24) WRITE(LUNIT,24)(PR(J),J=1,JM)
IF (F .EQ. 31) WRITE(LUNIT,31)(PR(J),CSIG(J),PI(J),J=1,JM)
IF (F .EQ. 32) WRITE(LUNIT,32)(PR(J),CSIG(J),PI(J),J=1,JM)
IF (F .EQ. 33) WRITE(LUNIT,33)(PR(J),CSIG(J),PI(J),J=1,JM)
IF (F .EQ. 34) WRITE(LUNIT,34)(PR(J),CSIG(J),PI(J),J=1,JM)
IF (F .EQ. -1) CALL FORMZ(LUNIT,STKR(LS),STKI(LS))
LCT(1) = LCT(1)+1
70 CONTINUE
80 CONTINUE
IF (LUNIT.EQ.WIO .OR. WIO.EQ.0) GO TO 99
LUNIT = WIO
GO TO 50
99 RETURN
C
11 FORMAT(0X,12I6)
12 FORMAT(0X,6I12)
21 FORMAT(0X,F9.4,7F10.4)
22 FORMAT(0X,F19.15,3F20.15)
23 FORMAT(0X,1P6D13.4)
24 FORMAT(0X,1P3D24.15)
31 FORMAT(0X,4(F9.4,' ',A1,F7.4,'i'))
32 FORMAT(0X,F19.15,A1,F18.15,'i',F20.15,A1,F18.15,'i')
33 FORMAT(0X,3(1PD13.4,' ',A1,1PD10.4,'i'))
34 FORMAT(0X,1PD24.15,' ',A1,1PD21.15,'i')
41 FORMAT(/0X,' ',1PD9.1,2H *)
42 FORMAT(0X,' COLUMNS',I3,' THRU',I3)
43 FORMAT(/0X,'AT LEAST ',I5,' MORE LINES.',
$ ' ENTER BLANK LINE TO CONTINUE OUTPUT.')
44 FORMAT(A1)
C
END
SUBROUTINE PRNTID(ID,ARGCNT)
C PRINT VARIABLE NAMES
INTEGER ID(4,1),ARGCNT
INTEGER ALFA(52),ALFB(52),ALFL,CASE
INTEGER DDT,ERR,FMT,LCT(4),LIN(1024),LPT(6),RIO,WIO,RTE,WTE,HIO
INTEGER SYM,SYN(4),BUF(256),CHAR,FLP(2),FIN,FUN,LHS,RHS,RAN(2)
COMMON /ALFS/ ALFA,ALFB,ALFL,CASE
COMMON /IOP/ DDT,ERR,FMT,LCT,LIN,LPT,RIO,WIO,RTE,WTE,HIO
COMMON /COM/ SYM,SYN,BUF,CHAR,FLP,FIN,FUN,LHS,RHS,RAN
CHARACTER CBUF(256)
CHARACTER MYCHAR
INTEGER EQUAL
DATA EQUAL/46/
J1 = 1
10 J2 = MIN0(J1+7,IABS(ARGCNT))
L = 0
DO 15 J = J1,J2
DO 15 I = 1, 4
K = ID(I,J)+1
L = L+1
BUF(L) = ALFA(K)
15 CONTINUE
IF (ARGCNT .EQ. -1) L=L+1
IF (ARGCNT .EQ. -1) BUF(L) = ALFA(EQUAL+1)
DO 1000 I=1,L
CBUF(I)=MYCHAR(BUF(I))
1000 CONTINUE
WRITE(WTE,20) (CBUF(I),I=1,L)
IF (WIO .NE. 0) WRITE(WIO,20) (CBUF(I),I=1,L)
20 FORMAT(0X,8(4A1,2H ))
J1 = J1+8
IF (J1 .LE. IABS(ARGCNT)) GO TO 10
RETURN
END