00001 SUBROUTINE ZUOIK(ZR, ZI, FNU, KODE, IKFLG, N, YR, YI, NUF, TOL,
00002 * ELIM, ALIM)
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 DOUBLE PRECISION AARG, AIC, ALIM, APHI, ARGI, ARGR, ASUMI, ASUMR,
00031 * ASCLE, AX, AY, BSUMI, BSUMR, CWRKI, CWRKR, CZI, CZR, ELIM, FNN,
00032 * FNU, GNN, GNU, PHII, PHIR, RCZ, STR, STI, SUMI, SUMR, TOL, YI,
00033 * YR, ZBI, ZBR, ZEROI, ZEROR, ZETA1I, ZETA1R, ZETA2I, ZETA2R, ZI,
00034 * ZNI, ZNR, ZR, ZRI, ZRR, D1MACH, XZABS
00035 INTEGER I, IDUM, IFORM, IKFLG, INIT, KODE, N, NN, NUF, NW
00036 DIMENSION YR(N), YI(N), CWRKR(16), CWRKI(16)
00037 DATA ZEROR,ZEROI / 0.0D0, 0.0D0 /
00038 DATA AIC / 1.265512123484645396D+00 /
00039 NUF = 0
00040 NN = N
00041 ZRR = ZR
00042 ZRI = ZI
00043 IF (ZR.GE.0.0D0) GO TO 10
00044 ZRR = -ZR
00045 ZRI = -ZI
00046 10 CONTINUE
00047 ZBR = ZRR
00048 ZBI = ZRI
00049 AX = DABS(ZR)*1.7321D0
00050 AY = DABS(ZI)
00051 IFORM = 1
00052 IF (AY.GT.AX) IFORM = 2
00053 GNU = DMAX1(FNU,1.0D0)
00054 IF (IKFLG.EQ.1) GO TO 20
00055 FNN = DBLE(FLOAT(NN))
00056 GNN = FNU + FNN - 1.0D0
00057 GNU = DMAX1(GNN,FNN)
00058 20 CONTINUE
00059
00060
00061
00062
00063
00064 IF (IFORM.EQ.2) GO TO 30
00065 INIT = 0
00066 CALL ZUNIK(ZRR, ZRI, GNU, IKFLG, 1, TOL, INIT, PHIR, PHII,
00067 * ZETA1R, ZETA1I, ZETA2R, ZETA2I, SUMR, SUMI, CWRKR, CWRKI)
00068 CZR = -ZETA1R + ZETA2R
00069 CZI = -ZETA1I + ZETA2I
00070 GO TO 50
00071 30 CONTINUE
00072 ZNR = ZRI
00073 ZNI = -ZRR
00074 IF (ZI.GT.0.0D0) GO TO 40
00075 ZNR = -ZNR
00076 40 CONTINUE
00077 CALL ZUNHJ(ZNR, ZNI, GNU, 1, TOL, PHIR, PHII, ARGR, ARGI, ZETA1R,
00078 * ZETA1I, ZETA2R, ZETA2I, ASUMR, ASUMI, BSUMR, BSUMI)
00079 CZR = -ZETA1R + ZETA2R
00080 CZI = -ZETA1I + ZETA2I
00081 AARG = XZABS(ARGR,ARGI)
00082 50 CONTINUE
00083 IF (KODE.EQ.1) GO TO 60
00084 CZR = CZR - ZBR
00085 CZI = CZI - ZBI
00086 60 CONTINUE
00087 IF (IKFLG.EQ.1) GO TO 70
00088 CZR = -CZR
00089 CZI = -CZI
00090 70 CONTINUE
00091 APHI = XZABS(PHIR,PHII)
00092 RCZ = CZR
00093
00094
00095
00096 IF (RCZ.GT.ELIM) GO TO 210
00097 IF (RCZ.LT.ALIM) GO TO 80
00098 RCZ = RCZ + DLOG(APHI)
00099 IF (IFORM.EQ.2) RCZ = RCZ - 0.25D0*DLOG(AARG) - AIC
00100 IF (RCZ.GT.ELIM) GO TO 210
00101 GO TO 130
00102 80 CONTINUE
00103
00104
00105
00106 IF (RCZ.LT.(-ELIM)) GO TO 90
00107 IF (RCZ.GT.(-ALIM)) GO TO 130
00108 RCZ = RCZ + DLOG(APHI)
00109 IF (IFORM.EQ.2) RCZ = RCZ - 0.25D0*DLOG(AARG) - AIC
00110 IF (RCZ.GT.(-ELIM)) GO TO 110
00111 90 CONTINUE
00112 DO 100 I=1,NN
00113 YR(I) = ZEROR
00114 YI(I) = ZEROI
00115 100 CONTINUE
00116 NUF = NN
00117 RETURN
00118 110 CONTINUE
00119 ASCLE = 1.0D+3*D1MACH(1)/TOL
00120 CALL XZLOG(PHIR, PHII, STR, STI, IDUM)
00121 CZR = CZR + STR
00122 CZI = CZI + STI
00123 IF (IFORM.EQ.1) GO TO 120
00124 CALL XZLOG(ARGR, ARGI, STR, STI, IDUM)
00125 CZR = CZR - 0.25D0*STR - AIC
00126 CZI = CZI - 0.25D0*STI
00127 120 CONTINUE
00128 AX = DEXP(RCZ)/TOL
00129 AY = CZI
00130 CZR = AX*DCOS(AY)
00131 CZI = AX*DSIN(AY)
00132 CALL ZUCHK(CZR, CZI, NW, ASCLE, TOL)
00133 IF (NW.NE.0) GO TO 90
00134 130 CONTINUE
00135 IF (IKFLG.EQ.2) RETURN
00136 IF (N.EQ.1) RETURN
00137
00138
00139
00140 140 CONTINUE
00141 GNU = FNU + DBLE(FLOAT(NN-1))
00142 IF (IFORM.EQ.2) GO TO 150
00143 INIT = 0
00144 CALL ZUNIK(ZRR, ZRI, GNU, IKFLG, 1, TOL, INIT, PHIR, PHII,
00145 * ZETA1R, ZETA1I, ZETA2R, ZETA2I, SUMR, SUMI, CWRKR, CWRKI)
00146 CZR = -ZETA1R + ZETA2R
00147 CZI = -ZETA1I + ZETA2I
00148 GO TO 160
00149 150 CONTINUE
00150 CALL ZUNHJ(ZNR, ZNI, GNU, 1, TOL, PHIR, PHII, ARGR, ARGI, ZETA1R,
00151 * ZETA1I, ZETA2R, ZETA2I, ASUMR, ASUMI, BSUMR, BSUMI)
00152 CZR = -ZETA1R + ZETA2R
00153 CZI = -ZETA1I + ZETA2I
00154 AARG = XZABS(ARGR,ARGI)
00155 160 CONTINUE
00156 IF (KODE.EQ.1) GO TO 170
00157 CZR = CZR - ZBR
00158 CZI = CZI - ZBI
00159 170 CONTINUE
00160 APHI = XZABS(PHIR,PHII)
00161 RCZ = CZR
00162 IF (RCZ.LT.(-ELIM)) GO TO 180
00163 IF (RCZ.GT.(-ALIM)) RETURN
00164 RCZ = RCZ + DLOG(APHI)
00165 IF (IFORM.EQ.2) RCZ = RCZ - 0.25D0*DLOG(AARG) - AIC
00166 IF (RCZ.GT.(-ELIM)) GO TO 190
00167 180 CONTINUE
00168 YR(NN) = ZEROR
00169 YI(NN) = ZEROI
00170 NN = NN - 1
00171 NUF = NUF + 1
00172 IF (NN.EQ.0) RETURN
00173 GO TO 140
00174 190 CONTINUE
00175 ASCLE = 1.0D+3*D1MACH(1)/TOL
00176 CALL XZLOG(PHIR, PHII, STR, STI, IDUM)
00177 CZR = CZR + STR
00178 CZI = CZI + STI
00179 IF (IFORM.EQ.1) GO TO 200
00180 CALL XZLOG(ARGR, ARGI, STR, STI, IDUM)
00181 CZR = CZR - 0.25D0*STR - AIC
00182 CZI = CZI - 0.25D0*STI
00183 200 CONTINUE
00184 AX = DEXP(RCZ)/TOL
00185 AY = CZI
00186 CZR = AX*DCOS(AY)
00187 CZI = AX*DSIN(AY)
00188 CALL ZUCHK(CZR, CZI, NW, ASCLE, TOL)
00189 IF (NW.NE.0) GO TO 180
00190 RETURN
00191 210 CONTINUE
00192 NUF = -1
00193 RETURN
00194 END