1 SUBROUTINE ZACON
(ZR
, ZI
, FNU
, KODE
, MR
, N
, YR
, YI
, NZ
, RL
, FNUL
,
3 C***BEGIN PROLOGUE ZACON
4 C***REFER TO ZBESK,ZBESH
6 C ZACON 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
14 C***ROUTINES CALLED ZBINU,ZBKNU,ZS1S2,D1MACH,AZABS,ZMLT
15 C***END PROLOGUE ZACON
16 C COMPLEX CK,CONE,CSCL,CSCR,CSGN,CSPN,CY,CZERO,C1,C2,RZ,SC1,SC2,ST,
18 DOUBLE PRECISION ALIM
, ARG
, ASCLE
, AS2
, AZN
, BRY
, BSCLE
, CKI
,
19 * CKR
, CONER
, CPN
, CSCL
, CSCR
, CSGNI
, CSGNR
, CSPNI
, CSPNR
,
20 * CSR
, CSRR
, CSSR
, CYI
, CYR
, C1I
, C1M
, C1R
, C2I
, C2R
, ELIM
, FMR
,
21 * FN
, FNU
, FNUL
, PI
, PTI
, PTR
, RAZN
, RL
, RZI
, RZR
, SC1I
, SC1R
,
22 * SC2I
, SC2R
, SGN
, SPN
, STI
, STR
, S1I
, S1R
, S2I
, S2R
, TOL
, YI
, YR
,
23 * YY
, ZEROR
, ZI
, ZNI
, ZNR
, ZR
, D1MACH
, AZABS
24 INTEGER I
, INU
, IUF
, KFLAG
, KODE
, MR
, N
, NN
, NW
, NZ
25 DIMENSION YR
(N
), YI
(N
), CYR
(2), CYI
(2), CSSR
(3), CSRR
(3), BRY
(3)
26 DATA PI
/ 3.14159265358979324D0
/
27 DATA ZEROR
,CONER
/ 0.0D0
,1.0D0
/
32 CALL ZBINU
(ZNR
, ZNI
, FNU
, KODE
, NN
, YR
, YI
, NW
, RL
, FNUL
, TOL
,
35 C-----------------------------------------------------------------------
36 C ANALYTIC CONTINUATION TO THE LEFT HALF PLANE FOR THE K FUNCTION
37 C-----------------------------------------------------------------------
39 CALL ZBKNU
(ZNR
, ZNI
, FNU
, KODE
, NN
, CYR
, CYI
, NW
, TOL
, ELIM
, ALIM
)
47 IF (KODE
.EQ
.1) GO TO 10
51 CALL ZMLT
(CSGNR
, CSGNI
, CPN
, SPN
, CSGNR
, CSGNI
)
53 C-----------------------------------------------------------------------
54 C CALCULATE CSPN=EXP(FNU*PI*I) TO MINIMIZE LOSSES OF SIGNIFICANCE
56 C-----------------------------------------------------------------------
58 ARG
= (FNU
-DBLE
(FLOAT
(INU
)))*SGN
63 IF (MOD
(INU
,2).EQ
.0) GO TO 20
72 ASCLE
= 1.0D
+3*D1MACH
(1)/TOL
73 IF (KODE
.EQ
.1) GO TO 30
74 CALL ZS1S2
(ZNR
, ZNI
, C1R
, C1I
, C2R
, C2I
, NW
, ASCLE
, ALIM
, IUF
)
79 CALL ZMLT
(CSPNR
, CSPNI
, C1R
, C1I
, STR
, STI
)
80 CALL ZMLT
(CSGNR
, CSGNI
, C2R
, C2I
, PTR
, PTI
)
92 IF (KODE
.EQ
.1) GO TO 40
93 CALL ZS1S2
(ZNR
, ZNI
, C1R
, C1I
, C2R
, C2I
, NW
, ASCLE
, ALIM
, IUF
)
98 CALL ZMLT
(CSPNR
, CSPNI
, C1R
, C1I
, STR
, STI
)
99 CALL ZMLT
(CSGNR
, CSGNI
, C2R
, C2I
, PTR
, PTI
)
114 C-----------------------------------------------------------------------
115 C SCALE NEAR EXPONENT EXTREMES DURING RECURRENCE ON K FUNCTIONS
116 C-----------------------------------------------------------------------
130 IF (AS2
.GT
.BRY
(1)) GO TO 50
134 IF (AS2
.LT
.BRY
(2)) GO TO 60
138 S1R
= S1R*CSSR
(KFLAG
)
139 S1I
= S1I*CSSR
(KFLAG
)
140 S2R
= S2R*CSSR
(KFLAG
)
141 S2I
= S2I*CSSR
(KFLAG
)
146 S2R
= CKR*STR
- CKI*STI
+ S1R
147 S2I
= CKR*STI
+ CKI*STR
+ S1I
156 IF (KODE
.EQ
.1) GO TO 70
157 IF (IUF
.LT
.0) GO TO 70
158 CALL ZS1S2
(ZNR
, ZNI
, C1R
, C1I
, C2R
, C2I
, NW
, ASCLE
, ALIM
, IUF
)
164 IF (IUF
.NE
.3) GO TO 70
166 S1R
= SC1R*CSSR
(KFLAG
)
167 S1I
= SC1I*CSSR
(KFLAG
)
168 S2R
= SC2R*CSSR
(KFLAG
)
169 S2I
= SC2I*CSSR
(KFLAG
)
173 PTR
= CSPNR*C1R
- CSPNI*C1I
174 PTI
= CSPNR*C1I
+ CSPNI*C1R
175 YR
(I
) = PTR
+ CSGNR*C2R
- CSGNI*C2I
176 YI
(I
) = PTI
+ CSGNR*C2I
+ CSGNI*C2R
181 IF (KFLAG
.GE
.3) GO TO 80
185 IF (C1M
.LE
.BSCLE
) GO TO 80
192 S1R
= S1R*CSSR
(KFLAG
)
193 S1I
= S1I*CSSR
(KFLAG
)
194 S2R
= S2R*CSSR
(KFLAG
)
195 S2I
= S2I*CSSR
(KFLAG
)