2 SUBROUTINE ZKSCL
(ZRR
, ZRI
, FNU
, N
, YR
, YI
, NZ
, RZR
, RZI
, ASCLE
,
4 C***BEGIN PROLOGUE ZKSCL
6 C***PURPOSE Subsidiary to ZBESK
8 C***TYPE ALL (CKSCL-A, ZKSCL-A)
9 C***AUTHOR Amos, D. E., (SNL)
12 C SET K FUNCTIONS TO ZERO ON UNDERFLOW, CONTINUE RECURRENCE
13 C ON SCALED FUNCTIONS UNTIL TWO MEMBERS COME ON SCALE, THEN
14 C RETURN WITH MIN(NZ+2,N) VALUES SCALED BY 1/TOL.
17 C***ROUTINES CALLED ZABS, ZLOG, ZUCHK
18 C***REVISION HISTORY (YYMMDD)
20 C 910415 Prologue converted to Version 4.0 format. (BAB)
21 C 930122 Added ZLOG to EXTERNAL statement. (RWC)
22 C***END PROLOGUE ZKSCL
23 C COMPLEX CK,CS,CY,CZERO,RZ,S1,S2,Y,ZR,ZD,CELM
24 DOUBLE PRECISION ACS
, AS
, ASCLE
, CKI
, CKR
, CSI
, CSR
, CYI
,
25 * CYR
, ELIM
, FN
, FNU
, RZI
, RZR
, STR
, S1I
, S1R
, S2I
,
26 * S2R
, TOL
, YI
, YR
, ZEROI
, ZEROR
, ZRI
, ZRR
, ZABS
,
27 * ZDR
, ZDI
, CELMR
, ELM
, HELIM
, ALAS
28 INTEGER I
, IC
, IDUM
, KK
, N
, NN
, NW
, NZ
29 DIMENSION YR
(N
), YI
(N
), CYR
(2), CYI
(2)
31 DATA ZEROR
,ZEROI
/ 0.0D0
, 0.0D0
/
32 C***FIRST EXECUTABLE STATEMENT ZKSCL
46 IF (ACS
.LT
.(-ELIM
)) GO TO 10
47 CALL ZLOG
(S1R
, S1I
, CSR
, CSI
, IDUM
)
53 CALL ZUCHK
(CSR
, CSI
, NW
, ASCLE
, TOL
)
81 C FIND TWO CONSECUTIVE Y VALUES ON SCALE. SCALE RECURRENCE IF
82 C S2 GETS LARGER THAN EXP(ELIM/2)
88 S2R
= CKR*CSR
- CKI*CSI
+ S1R
89 S2I
= CKI*CSR
+ CKR*CSI
+ S1I
100 IF (ACS
.LT
.(-ELIM
)) GO TO 25
101 CALL ZLOG
(S2R
, S2I
, CSR
, CSI
, IDUM
)
107 CALL ZUCHK
(CSR
, CSI
, NW
, ASCLE
, TOL
)
108 IF (NW
.NE
.0) GO TO 25
112 IF (IC
.EQ
.KK
-1) GO TO 40
116 IF(ALAS
.LT
.HELIM
) GO TO 30