zacai.f

Go to the documentation of this file.
00001       SUBROUTINE ZACAI(ZR, ZI, FNU, KODE, MR, N, YR, YI, NZ, RL, TOL,
00002      * ELIM, ALIM)
00003 C***BEGIN PROLOGUE  ZACAI
00004 C***REFER TO  ZAIRY
00005 C
00006 C     ZACAI APPLIES THE ANALYTIC CONTINUATION FORMULA
00007 C
00008 C         K(FNU,ZN*EXP(MP))=K(FNU,ZN)*EXP(-MP*FNU) - MP*I(FNU,ZN)
00009 C                 MP=PI*MR*CMPLX(0.0,1.0)
00010 C
00011 C     TO CONTINUE THE K FUNCTION FROM THE RIGHT HALF TO THE LEFT
00012 C     HALF Z PLANE FOR USE WITH ZAIRY WHERE FNU=1/3 OR 2/3 AND N=1.
00013 C     ZACAI IS THE SAME AS ZACON WITH THE PARTS FOR LARGER ORDERS AND
00014 C     RECURRENCE REMOVED. A RECURSIVE CALL TO ZACON CAN RESULT IF ZACON
00015 C     IS CALLED FROM ZAIRY.
00016 C
00017 C***ROUTINES CALLED  ZASYI,ZBKNU,ZMLRI,ZSERI,ZS1S2,D1MACH,XZABS
00018 C***END PROLOGUE  ZACAI
00019 C     COMPLEX CSGN,CSPN,C1,C2,Y,Z,ZN,CY
00020       DOUBLE PRECISION ALIM, ARG, ASCLE, AZ, CSGNR, CSGNI, CSPNR,
00021      * CSPNI, C1R, C1I, C2R, C2I, CYR, CYI, DFNU, ELIM, FMR, FNU, PI,
00022      * RL, SGN, TOL, YY, YR, YI, ZR, ZI, ZNR, ZNI, D1MACH, XZABS
00023       INTEGER INU, IUF, KODE, MR, N, NN, NW, NZ
00024       DIMENSION YR(N), YI(N), CYR(2), CYI(2)
00025       DATA PI / 3.14159265358979324D0 /
00026       NZ = 0
00027       ZNR = -ZR
00028       ZNI = -ZI
00029       AZ = XZABS(ZR,ZI)
00030       NN = N
00031       DFNU = FNU + DBLE(FLOAT(N-1))
00032       IF (AZ.LE.2.0D0) GO TO 10
00033       IF (AZ*AZ*0.25D0.GT.DFNU+1.0D0) GO TO 20
00034    10 CONTINUE
00035 C-----------------------------------------------------------------------
00036 C     POWER SERIES FOR THE I FUNCTION
00037 C-----------------------------------------------------------------------
00038       CALL ZSERI(ZNR, ZNI, FNU, KODE, NN, YR, YI, NW, TOL, ELIM, ALIM)
00039       GO TO 40
00040    20 CONTINUE
00041       IF (AZ.LT.RL) GO TO 30
00042 C-----------------------------------------------------------------------
00043 C     ASYMPTOTIC EXPANSION FOR LARGE Z FOR THE I FUNCTION
00044 C-----------------------------------------------------------------------
00045       CALL ZASYI(ZNR, ZNI, FNU, KODE, NN, YR, YI, NW, RL, TOL, ELIM,
00046      * ALIM)
00047       IF (NW.LT.0) GO TO 80
00048       GO TO 40
00049    30 CONTINUE
00050 C-----------------------------------------------------------------------
00051 C     MILLER ALGORITHM NORMALIZED BY THE SERIES FOR THE I FUNCTION
00052 C-----------------------------------------------------------------------
00053       CALL ZMLRI(ZNR, ZNI, FNU, KODE, NN, YR, YI, NW, TOL)
00054       IF(NW.LT.0) GO TO 80
00055    40 CONTINUE
00056 C-----------------------------------------------------------------------
00057 C     ANALYTIC CONTINUATION TO THE LEFT HALF PLANE FOR THE K FUNCTION
00058 C-----------------------------------------------------------------------
00059       CALL ZBKNU(ZNR, ZNI, FNU, KODE, 1, CYR, CYI, NW, TOL, ELIM, ALIM)
00060       IF (NW.NE.0) GO TO 80
00061       FMR = DBLE(FLOAT(MR))
00062       SGN = -DSIGN(PI,FMR)
00063       CSGNR = 0.0D0
00064       CSGNI = SGN
00065       IF (KODE.EQ.1) GO TO 50
00066       YY = -ZNI
00067       CSGNR = -CSGNI*DSIN(YY)
00068       CSGNI = CSGNI*DCOS(YY)
00069    50 CONTINUE
00070 C-----------------------------------------------------------------------
00071 C     CALCULATE CSPN=EXP(FNU*PI*I) TO MINIMIZE LOSSES OF SIGNIFICANCE
00072 C     WHEN FNU IS LARGE
00073 C-----------------------------------------------------------------------
00074       INU = INT(SNGL(FNU))
00075       ARG = (FNU-DBLE(FLOAT(INU)))*SGN
00076       CSPNR = DCOS(ARG)
00077       CSPNI = DSIN(ARG)
00078       IF (MOD(INU,2).EQ.0) GO TO 60
00079       CSPNR = -CSPNR
00080       CSPNI = -CSPNI
00081    60 CONTINUE
00082       C1R = CYR(1)
00083       C1I = CYI(1)
00084       C2R = YR(1)
00085       C2I = YI(1)
00086       IF (KODE.EQ.1) GO TO 70
00087       IUF = 0
00088       ASCLE = 1.0D+3*D1MACH(1)/TOL
00089       CALL ZS1S2(ZNR, ZNI, C1R, C1I, C2R, C2I, NW, ASCLE, ALIM, IUF)
00090       NZ = NZ + NW
00091    70 CONTINUE
00092       YR(1) = CSPNR*C1R - CSPNI*C1I + CSGNR*C2R - CSGNI*C2I
00093       YI(1) = CSPNR*C1I + CSPNI*C1R + CSGNR*C2I + CSGNI*C2R
00094       RETURN
00095    80 CONTINUE
00096       NZ = -1
00097       IF(NW.EQ.(-2)) NZ=-2
00098       RETURN
00099       END
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines