1 SUBROUTINE ZACAI
(ZR
, ZI
, FNU
, KODE
, MR
, N
, YR
, YI
, NZ
, RL
, TOL
,
3 C***BEGIN PROLOGUE ZACAI
6 C ZACAI APPLIES THE ANALYTIC CONTINUATION FORMULA
8 C K(FNU,ZN*EXP(MP))=K(FNU,ZN)*EXP(-MP*FNU) - MP*I(FNU,ZN)
9 C MP=PI*MR*CMPLX(0.0,1.0)
11 C TO CONTINUE THE K FUNCTION FROM THE RIGHT HALF TO THE LEFT
12 C HALF Z PLANE FOR USE WITH ZAIRY WHERE FNU=1/3 OR 2/3 AND N=1.
13 C ZACAI IS THE SAME AS ZACON WITH THE PARTS FOR LARGER ORDERS AND
14 C RECURRENCE REMOVED. A RECURSIVE CALL TO ZACON CAN RESULT IF ZACON
15 C IS CALLED FROM ZAIRY.
17 C***ROUTINES CALLED ZASYI,ZBKNU,ZMLRI,ZSERI,ZS1S2,D1MACH,AZABS
18 C***END PROLOGUE ZACAI
19 C COMPLEX CSGN,CSPN,C1,C2,Y,Z,ZN,CY
20 DOUBLE PRECISION ALIM
, ARG
, ASCLE
, AZ
, CSGNR
, CSGNI
, CSPNR
,
21 * CSPNI
, C1R
, C1I
, C2R
, C2I
, CYR
, CYI
, DFNU
, ELIM
, FMR
, FNU
, PI
,
22 * RL
, SGN
, TOL
, YY
, YR
, YI
, ZR
, ZI
, ZNR
, ZNI
, D1MACH
, AZABS
23 INTEGER INU
, IUF
, KODE
, MR
, N
, NN
, NW
, NZ
24 DIMENSION YR
(N
), YI
(N
), CYR
(2), CYI
(2)
25 DATA PI
/ 3.14159265358979324D0
/
31 DFNU
= FNU
+ DBLE
(FLOAT
(N
-1))
32 IF (AZ
.LE
.2.0D0
) GO TO 10
33 IF (AZ*AZ*0
.25D0
.GT
.DFNU
+1.0D0
) GO TO 20
35 C-----------------------------------------------------------------------
36 C POWER SERIES FOR THE I FUNCTION
37 C-----------------------------------------------------------------------
38 CALL ZSERI
(ZNR
, ZNI
, FNU
, KODE
, NN
, YR
, YI
, NW
, TOL
, ELIM
, ALIM
)
41 IF (AZ
.LT
.RL
) GO TO 30
42 C-----------------------------------------------------------------------
43 C ASYMPTOTIC EXPANSION FOR LARGE Z FOR THE I FUNCTION
44 C-----------------------------------------------------------------------
45 CALL ZASYI
(ZNR
, ZNI
, FNU
, KODE
, NN
, YR
, YI
, NW
, RL
, TOL
, ELIM
,
50 C-----------------------------------------------------------------------
51 C MILLER ALGORITHM NORMALIZED BY THE SERIES FOR THE I FUNCTION
52 C-----------------------------------------------------------------------
53 CALL ZMLRI
(ZNR
, ZNI
, FNU
, KODE
, NN
, YR
, YI
, NW
, TOL
)
56 C-----------------------------------------------------------------------
57 C ANALYTIC CONTINUATION TO THE LEFT HALF PLANE FOR THE K FUNCTION
58 C-----------------------------------------------------------------------
59 CALL ZBKNU
(ZNR
, ZNI
, FNU
, KODE
, 1, CYR
, CYI
, NW
, TOL
, ELIM
, ALIM
)
65 IF (KODE
.EQ
.1) GO TO 50
67 CSGNR
= -CSGNI*DSIN
(YY
)
68 CSGNI
= CSGNI*DCOS
(YY
)
70 C-----------------------------------------------------------------------
71 C CALCULATE CSPN=EXP(FNU*PI*I) TO MINIMIZE LOSSES OF SIGNIFICANCE
73 C-----------------------------------------------------------------------
75 ARG
= (FNU
-DBLE
(FLOAT
(INU
)))*SGN
78 IF (MOD
(INU
,2).EQ
.0) GO TO 60
86 IF (KODE
.EQ
.1) GO TO 70
88 ASCLE
= 1.0D
+3*D1MACH
(1)/TOL
89 CALL ZS1S2
(ZNR
, ZNI
, C1R
, C1I
, C2R
, C2I
, NW
, ASCLE
, ALIM
, IUF
)
92 YR
(1) = CSPNR*C1R
- CSPNI*C1I
+ CSGNR*C2R
- CSGNI*C2I
93 YI
(1) = CSPNR*C1I
+ CSPNI*C1R
+ CSGNR*C2I
+ CSGNI*C2R