00001 SUBROUTINE ZACAI(ZR, ZI, FNU, KODE, MR, N, YR, YI, NZ, RL, TOL,
00002 * ELIM, ALIM)
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00036
00037
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
00043
00044
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
00051
00052
00053 CALL ZMLRI(ZNR, ZNI, FNU, KODE, NN, YR, YI, NW, TOL)
00054 IF(NW.LT.0) GO TO 80
00055 40 CONTINUE
00056
00057
00058
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
00071
00072
00073
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