00001 SUBROUTINE CACAI(Z, FNU, KODE, MR, N, Y, NZ, RL, TOL, ELIM, ALIM)
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 COMPLEX CSGN, CSPN, C1, C2, Y, Z, ZN, CY
00019 REAL ALIM, ARG, ASCLE, AZ, CPN, DFNU, ELIM, FMR, FNU, PI, RL,
00020 * SGN, SPN, TOL, YY, R1MACH
00021 INTEGER INU, IUF, KODE, MR, N, NN, NW, NZ
00022 DIMENSION Y(N), CY(2)
00023 DATA PI / 3.14159265358979324E0 /
00024 NZ = 0
00025 ZN = -Z
00026 AZ = CABS(Z)
00027 NN = N
00028 DFNU = FNU + FLOAT(N-1)
00029 IF (AZ.LE.2.0E0) GO TO 10
00030 IF (AZ*AZ*0.25E0.GT.DFNU+1.0E0) GO TO 20
00031 10 CONTINUE
00032
00033
00034
00035 CALL CSERI(ZN, FNU, KODE, NN, Y, NW, TOL, ELIM, ALIM)
00036 GO TO 40
00037 20 CONTINUE
00038 IF (AZ.LT.RL) GO TO 30
00039
00040
00041
00042 CALL CASYI(ZN, FNU, KODE, NN, Y, NW, RL, TOL, ELIM, ALIM)
00043 IF (NW.LT.0) GO TO 70
00044 GO TO 40
00045 30 CONTINUE
00046
00047
00048
00049 CALL CMLRI(ZN, FNU, KODE, NN, Y, NW, TOL)
00050 IF(NW.LT.0) GO TO 70
00051 40 CONTINUE
00052
00053
00054
00055 CALL CBKNU(ZN, FNU, KODE, 1, CY, NW, TOL, ELIM, ALIM)
00056 IF (NW.NE.0) GO TO 70
00057 FMR = FLOAT(MR)
00058 SGN = -SIGN(PI,FMR)
00059 CSGN = CMPLX(0.0E0,SGN)
00060 IF (KODE.EQ.1) GO TO 50
00061 YY = -AIMAG(ZN)
00062 CPN = COS(YY)
00063 SPN = SIN(YY)
00064 CSGN = CSGN*CMPLX(CPN,SPN)
00065 50 CONTINUE
00066
00067
00068
00069
00070 INU = INT(FNU)
00071 ARG = (FNU-FLOAT(INU))*SGN
00072 CPN = COS(ARG)
00073 SPN = SIN(ARG)
00074 CSPN = CMPLX(CPN,SPN)
00075 IF (MOD(INU,2).EQ.1) CSPN = -CSPN
00076 C1 = CY(1)
00077 C2 = Y(1)
00078 IF (KODE.EQ.1) GO TO 60
00079 IUF = 0
00080 ASCLE = 1.0E+3*R1MACH(1)/TOL
00081 CALL CS1S2(ZN, C1, C2, NW, ASCLE, ALIM, IUF)
00082 NZ = NZ + NW
00083 60 CONTINUE
00084 Y(1) = CSPN*C1 + CSGN*C2
00085 RETURN
00086 70 CONTINUE
00087 NZ = -1
00088 IF(NW.EQ.(-2)) NZ=-2
00089 RETURN
00090 END