1 SUBROUTINE ZWRSK
(ZRR
, ZRI
, FNU
, KODE
, N
, YR
, YI
, NZ
, CWR
, CWI
,
3 C***BEGIN PROLOGUE ZWRSK
4 C***REFER TO ZBESI,ZBESK
6 C ZWRSK COMPUTES THE I BESSEL FUNCTION FOR RE(Z).GE.0.0 BY
7 C NORMALIZING THE I FUNCTION RATIOS FROM ZRATI BY THE WRONSKIAN
9 C***ROUTINES CALLED D1MACH,ZBKNU,ZRATI,AZABS
10 C***END PROLOGUE ZWRSK
11 C COMPLEX CINU,CSCL,CT,CW,C1,C2,RCT,ST,Y,ZR
12 DOUBLE PRECISION ACT
, ACW
, ALIM
, ASCLE
, CINUI
, CINUR
, CSCLR
, CTI
,
13 * CTR
, CWI
, CWR
, C1I
, C1R
, C2I
, C2R
, ELIM
, FNU
, PTI
, PTR
, RACT
,
14 * STI
, STR
, TOL
, YI
, YR
, ZRI
, ZRR
, AZABS
, D1MACH
15 INTEGER I
, KODE
, N
, NW
, NZ
16 DIMENSION YR
(N
), YI
(N
), CWR
(2), CWI
(2)
17 C-----------------------------------------------------------------------
18 C I(FNU+I-1,Z) BY BACKWARD RECURRENCE FOR RATIOS
19 C Y(I)=I(FNU+I,Z)/I(FNU+I-1,Z) FROM CRATI NORMALIZED BY THE
20 C WRONSKIAN WITH K(FNU,Z) AND K(FNU+1,Z) FROM CBKNU.
21 C-----------------------------------------------------------------------
23 CALL ZBKNU
(ZRR
, ZRI
, FNU
, KODE
, 2, CWR
, CWI
, NW
, TOL
, ELIM
, ALIM
)
25 CALL ZRATI
(ZRR
, ZRI
, FNU
, N
, YR
, YI
, TOL
)
26 C-----------------------------------------------------------------------
27 C RECUR FORWARD ON I(FNU+1,Z) = R(FNU,Z)*I(FNU,Z),
28 C R(FNU+J-1,Z)=Y(J), J=1,...,N
29 C-----------------------------------------------------------------------
32 IF (KODE
.EQ
.1) GO TO 10
36 C-----------------------------------------------------------------------
37 C ON LOW EXPONENT MACHINES THE K FUNCTIONS CAN BE CLOSE TO BOTH
38 C THE UNDER AND OVERFLOW LIMITS AND THE NORMALIZATION MUST BE
39 C SCALED TO PREVENT OVER OR UNDERFLOW. CUOIK HAS DETERMINED THAT
40 C THE RESULT IS ON SCALE.
41 C-----------------------------------------------------------------------
42 ACW
= AZABS
(CWR
(2),CWI
(2))
43 ASCLE
= 1.0D
+3*D1MACH
(1)/TOL
45 IF (ACW
.GT
.ASCLE
) GO TO 20
50 IF (ACW
.LT
.ASCLE
) GO TO 30
59 C-----------------------------------------------------------------------
60 C CINU=CINU*(CONJG(CT)/CABS(CT))*(1.0D0/CABS(CT) PREVENTS
61 C UNDER- OR OVERFLOW PREMATURELY BY SQUARING CABS(CT)
62 C-----------------------------------------------------------------------
63 PTR
= STR*C1R
- STI*C1I
64 PTI
= STR*C1I
+ STI*C1R
67 CTR
= ZRR*PTR
- ZRI*PTI
68 CTI
= ZRR*PTI
+ ZRI*PTR
75 CINUR
= PTR*CTR
- PTI*CTI
76 CINUI
= PTR*CTI
+ PTI*CTR
81 PTR
= STR*CINUR
- STI*CINUI
82 CINUI
= STR*CINUI
+ STI*CINUR